| 1 |
(function(react, react_dom, _elementor_router, _wordpress_i18n, _elementor_hooks, _elementor_ui, _elementor_icons, _elementor_app_ui, _elementor_site_editor) {var __vite_style__ = document.createElement('style');__vite_style__.textContent = "/*$vite$:1*/";document.head.appendChild(__vite_style__); |
| 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 __esmMin = (fn, res, err) => () => { |
| 15 |
if (err) throw err[0]; |
| 16 |
try { |
| 17 |
return fn && (res = fn(fn = 0)), res; |
| 18 |
} catch (e) { |
| 19 |
throw err = [e], e; |
| 20 |
} |
| 21 |
}; |
| 22 |
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); |
| 23 |
var __exportAll = (all, no_symbols) => { |
| 24 |
let target = {}; |
| 25 |
for (var name in all) { |
| 26 |
__defProp(target, name, { |
| 27 |
get: all[name], |
| 28 |
enumerable: true |
| 29 |
}); |
| 30 |
} |
| 31 |
if (!no_symbols) { |
| 32 |
__defProp(target, Symbol.toStringTag, { value: "Module" }); |
| 33 |
} |
| 34 |
return target; |
| 35 |
}; |
| 36 |
var __copyProps = (to, from, except, desc) => { |
| 37 |
if (from && typeof from === "object" || typeof from === "function") { |
| 38 |
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { |
| 39 |
key = keys[i]; |
| 40 |
if (!__hasOwnProp.call(to, key) && key !== except) { |
| 41 |
__defProp(to, key, { |
| 42 |
get: ((k) => from[k]).bind(null, key), |
| 43 |
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable |
| 44 |
}); |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
return to; |
| 49 |
}; |
| 50 |
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { |
| 51 |
value: mod, |
| 52 |
enumerable: true |
| 53 |
}) : target, mod)); |
| 54 |
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod); |
| 55 |
|
| 56 |
//#endregion |
| 57 |
react = __toESM(react); |
| 58 |
react_dom = __toESM(react_dom); |
| 59 |
_elementor_router = __toESM(_elementor_router); |
| 60 |
|
| 61 |
//#region node_modules/react-dom/client.js |
| 62 |
var require_client = /* @__PURE__ */ __commonJSMin(((exports) => { |
| 63 |
var m$1 = (globalThis.ReactDOM); |
| 64 |
var i = m$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; |
| 65 |
exports.createRoot = function(c, o) { |
| 66 |
i.usingClientEntryPoint = true; |
| 67 |
try { |
| 68 |
return m$1.createRoot(c, o); |
| 69 |
} finally { |
| 70 |
i.usingClientEntryPoint = false; |
| 71 |
} |
| 72 |
}; |
| 73 |
})); |
| 74 |
|
| 75 |
//#endregion |
| 76 |
//#region assets/dev/js/utils/react.js |
| 77 |
var import_client = require_client(); |
| 78 |
/** |
| 79 |
* Support conditional rendering of a React App to the DOM, based on the React version. |
| 80 |
* We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions. |
| 81 |
* |
| 82 |
* @param {Promise.resolve(React).ReactElement} app The app to render. |
| 83 |
* @param {HTMLElement} domElement The DOM element to render the app into. |
| 84 |
* |
| 85 |
* @return {{ unmount: () => void }} The unmount function. |
| 86 |
*/ |
| 87 |
function render(app, domElement) { |
| 88 |
var unmountFunction; |
| 89 |
try { |
| 90 |
var root = (0, import_client.createRoot)(domElement); |
| 91 |
root.render(app); |
| 92 |
unmountFunction = function unmountFunction() { |
| 93 |
root.unmount(); |
| 94 |
}; |
| 95 |
} catch (e) { |
| 96 |
react_dom.render(app, domElement); |
| 97 |
unmountFunction = function unmountFunction() { |
| 98 |
react_dom.unmountComponentAtNode(domElement); |
| 99 |
}; |
| 100 |
} |
| 101 |
return { unmount: unmountFunction }; |
| 102 |
} |
| 103 |
var react_default = { render }; |
| 104 |
|
| 105 |
//#endregion |
| 106 |
//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js |
| 107 |
/** @license React v16.13.1 |
| 108 |
* react-is.development.js |
| 109 |
* |
| 110 |
* Copyright (c) Facebook, Inc. and its affiliates. |
| 111 |
* |
| 112 |
* This source code is licensed under the MIT license found in the |
| 113 |
* LICENSE file in the root directory of this source tree. |
| 114 |
*/ |
| 115 |
var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => { |
| 116 |
(function() { |
| 117 |
"use strict"; |
| 118 |
var hasSymbol = typeof Symbol === "function" && Symbol.for; |
| 119 |
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; |
| 120 |
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; |
| 121 |
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; |
| 122 |
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; |
| 123 |
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; |
| 124 |
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; |
| 125 |
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; |
| 126 |
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; |
| 127 |
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; |
| 128 |
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; |
| 129 |
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; |
| 130 |
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; |
| 131 |
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; |
| 132 |
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; |
| 133 |
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; |
| 134 |
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; |
| 135 |
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; |
| 136 |
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; |
| 137 |
function isValidElementType(type) { |
| 138 |
return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); |
| 139 |
} |
| 140 |
function typeOf(object) { |
| 141 |
if (typeof object === "object" && object !== null) { |
| 142 |
var $$typeof = object.$$typeof; |
| 143 |
switch ($$typeof) { |
| 144 |
case REACT_ELEMENT_TYPE: |
| 145 |
var type = object.type; |
| 146 |
switch (type) { |
| 147 |
case REACT_ASYNC_MODE_TYPE: |
| 148 |
case REACT_CONCURRENT_MODE_TYPE: |
| 149 |
case REACT_FRAGMENT_TYPE: |
| 150 |
case REACT_PROFILER_TYPE: |
| 151 |
case REACT_STRICT_MODE_TYPE: |
| 152 |
case REACT_SUSPENSE_TYPE: return type; |
| 153 |
default: |
| 154 |
var $$typeofType = type && type.$$typeof; |
| 155 |
switch ($$typeofType) { |
| 156 |
case REACT_CONTEXT_TYPE: |
| 157 |
case REACT_FORWARD_REF_TYPE: |
| 158 |
case REACT_LAZY_TYPE: |
| 159 |
case REACT_MEMO_TYPE: |
| 160 |
case REACT_PROVIDER_TYPE: return $$typeofType; |
| 161 |
default: return $$typeof; |
| 162 |
} |
| 163 |
} |
| 164 |
case REACT_PORTAL_TYPE: return $$typeof; |
| 165 |
} |
| 166 |
} |
| 167 |
} |
| 168 |
var AsyncMode = REACT_ASYNC_MODE_TYPE; |
| 169 |
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; |
| 170 |
var ContextConsumer = REACT_CONTEXT_TYPE; |
| 171 |
var ContextProvider = REACT_PROVIDER_TYPE; |
| 172 |
var Element = REACT_ELEMENT_TYPE; |
| 173 |
var ForwardRef = REACT_FORWARD_REF_TYPE; |
| 174 |
var Fragment = REACT_FRAGMENT_TYPE; |
| 175 |
var Lazy = REACT_LAZY_TYPE; |
| 176 |
var Memo = REACT_MEMO_TYPE; |
| 177 |
var Portal = REACT_PORTAL_TYPE; |
| 178 |
var Profiler = REACT_PROFILER_TYPE; |
| 179 |
var StrictMode = REACT_STRICT_MODE_TYPE; |
| 180 |
var Suspense = REACT_SUSPENSE_TYPE; |
| 181 |
var hasWarnedAboutDeprecatedIsAsyncMode = false; |
| 182 |
function isAsyncMode(object) { |
| 183 |
if (!hasWarnedAboutDeprecatedIsAsyncMode) { |
| 184 |
hasWarnedAboutDeprecatedIsAsyncMode = true; |
| 185 |
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); |
| 186 |
} |
| 187 |
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; |
| 188 |
} |
| 189 |
function isConcurrentMode(object) { |
| 190 |
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; |
| 191 |
} |
| 192 |
function isContextConsumer(object) { |
| 193 |
return typeOf(object) === REACT_CONTEXT_TYPE; |
| 194 |
} |
| 195 |
function isContextProvider(object) { |
| 196 |
return typeOf(object) === REACT_PROVIDER_TYPE; |
| 197 |
} |
| 198 |
function isElement(object) { |
| 199 |
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; |
| 200 |
} |
| 201 |
function isForwardRef(object) { |
| 202 |
return typeOf(object) === REACT_FORWARD_REF_TYPE; |
| 203 |
} |
| 204 |
function isFragment(object) { |
| 205 |
return typeOf(object) === REACT_FRAGMENT_TYPE; |
| 206 |
} |
| 207 |
function isLazy(object) { |
| 208 |
return typeOf(object) === REACT_LAZY_TYPE; |
| 209 |
} |
| 210 |
function isMemo(object) { |
| 211 |
return typeOf(object) === REACT_MEMO_TYPE; |
| 212 |
} |
| 213 |
function isPortal(object) { |
| 214 |
return typeOf(object) === REACT_PORTAL_TYPE; |
| 215 |
} |
| 216 |
function isProfiler(object) { |
| 217 |
return typeOf(object) === REACT_PROFILER_TYPE; |
| 218 |
} |
| 219 |
function isStrictMode(object) { |
| 220 |
return typeOf(object) === REACT_STRICT_MODE_TYPE; |
| 221 |
} |
| 222 |
function isSuspense(object) { |
| 223 |
return typeOf(object) === REACT_SUSPENSE_TYPE; |
| 224 |
} |
| 225 |
exports.AsyncMode = AsyncMode; |
| 226 |
exports.ConcurrentMode = ConcurrentMode; |
| 227 |
exports.ContextConsumer = ContextConsumer; |
| 228 |
exports.ContextProvider = ContextProvider; |
| 229 |
exports.Element = Element; |
| 230 |
exports.ForwardRef = ForwardRef; |
| 231 |
exports.Fragment = Fragment; |
| 232 |
exports.Lazy = Lazy; |
| 233 |
exports.Memo = Memo; |
| 234 |
exports.Portal = Portal; |
| 235 |
exports.Profiler = Profiler; |
| 236 |
exports.StrictMode = StrictMode; |
| 237 |
exports.Suspense = Suspense; |
| 238 |
exports.isAsyncMode = isAsyncMode; |
| 239 |
exports.isConcurrentMode = isConcurrentMode; |
| 240 |
exports.isContextConsumer = isContextConsumer; |
| 241 |
exports.isContextProvider = isContextProvider; |
| 242 |
exports.isElement = isElement; |
| 243 |
exports.isForwardRef = isForwardRef; |
| 244 |
exports.isFragment = isFragment; |
| 245 |
exports.isLazy = isLazy; |
| 246 |
exports.isMemo = isMemo; |
| 247 |
exports.isPortal = isPortal; |
| 248 |
exports.isProfiler = isProfiler; |
| 249 |
exports.isStrictMode = isStrictMode; |
| 250 |
exports.isSuspense = isSuspense; |
| 251 |
exports.isValidElementType = isValidElementType; |
| 252 |
exports.typeOf = typeOf; |
| 253 |
})(); |
| 254 |
})); |
| 255 |
|
| 256 |
//#endregion |
| 257 |
//#region node_modules/prop-types/node_modules/react-is/index.js |
| 258 |
var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 259 |
module.exports = require_react_is_development(); |
| 260 |
})); |
| 261 |
|
| 262 |
//#endregion |
| 263 |
//#region node_modules/object-assign/index.js |
| 264 |
/* |
| 265 |
object-assign |
| 266 |
(c) Sindre Sorhus |
| 267 |
@license MIT |
| 268 |
*/ |
| 269 |
var require_object_assign = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 270 |
var getOwnPropertySymbols = Object.getOwnPropertySymbols; |
| 271 |
var hasOwnProperty = Object.prototype.hasOwnProperty; |
| 272 |
var propIsEnumerable = Object.prototype.propertyIsEnumerable; |
| 273 |
function toObject(val) { |
| 274 |
if (val === null || val === void 0) throw new TypeError("Object.assign cannot be called with null or undefined"); |
| 275 |
return Object(val); |
| 276 |
} |
| 277 |
function shouldUseNative() { |
| 278 |
try { |
| 279 |
if (!Object.assign) return false; |
| 280 |
var test1 = /* @__PURE__ */ new String("abc"); |
| 281 |
test1[5] = "de"; |
| 282 |
if (Object.getOwnPropertyNames(test1)[0] === "5") return false; |
| 283 |
var test2 = {}; |
| 284 |
for (var i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; |
| 285 |
if (Object.getOwnPropertyNames(test2).map(function(n) { |
| 286 |
return test2[n]; |
| 287 |
}).join("") !== "0123456789") return false; |
| 288 |
var test3 = {}; |
| 289 |
"abcdefghijklmnopqrst".split("").forEach(function(letter) { |
| 290 |
test3[letter] = letter; |
| 291 |
}); |
| 292 |
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") return false; |
| 293 |
return true; |
| 294 |
} catch (err) { |
| 295 |
return false; |
| 296 |
} |
| 297 |
} |
| 298 |
module.exports = shouldUseNative() ? Object.assign : function(target, source) { |
| 299 |
var from; |
| 300 |
var to = toObject(target); |
| 301 |
var symbols; |
| 302 |
for (var s = 1; s < arguments.length; s++) { |
| 303 |
from = Object(arguments[s]); |
| 304 |
for (var key in from) if (hasOwnProperty.call(from, key)) to[key] = from[key]; |
| 305 |
if (getOwnPropertySymbols) { |
| 306 |
symbols = getOwnPropertySymbols(from); |
| 307 |
for (var i = 0; i < symbols.length; i++) if (propIsEnumerable.call(from, symbols[i])) to[symbols[i]] = from[symbols[i]]; |
| 308 |
} |
| 309 |
} |
| 310 |
return to; |
| 311 |
}; |
| 312 |
})); |
| 313 |
|
| 314 |
//#endregion |
| 315 |
//#region node_modules/prop-types/lib/ReactPropTypesSecret.js |
| 316 |
/** |
| 317 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 318 |
* |
| 319 |
* This source code is licensed under the MIT license found in the |
| 320 |
* LICENSE file in the root directory of this source tree. |
| 321 |
*/ |
| 322 |
var require_ReactPropTypesSecret = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 323 |
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; |
| 324 |
module.exports = ReactPropTypesSecret; |
| 325 |
})); |
| 326 |
|
| 327 |
//#endregion |
| 328 |
//#region node_modules/prop-types/lib/has.js |
| 329 |
var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 330 |
module.exports = Function.call.bind(Object.prototype.hasOwnProperty); |
| 331 |
})); |
| 332 |
|
| 333 |
//#endregion |
| 334 |
//#region node_modules/prop-types/checkPropTypes.js |
| 335 |
/** |
| 336 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 337 |
* |
| 338 |
* This source code is licensed under the MIT license found in the |
| 339 |
* LICENSE file in the root directory of this source tree. |
| 340 |
*/ |
| 341 |
var require_checkPropTypes = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 342 |
var printWarning = function() {}; |
| 343 |
var ReactPropTypesSecret = require_ReactPropTypesSecret(); |
| 344 |
var loggedTypeFailures = {}; |
| 345 |
var has = require_has(); |
| 346 |
printWarning = function(text) { |
| 347 |
var message = "Warning: " + text; |
| 348 |
if (typeof console !== "undefined") console.error(message); |
| 349 |
try { |
| 350 |
throw new Error(message); |
| 351 |
} catch (x) {} |
| 352 |
}; |
| 353 |
/** |
| 354 |
* Assert that the values match with the type specs. |
| 355 |
* Error messages are memorized and will only be shown once. |
| 356 |
* |
| 357 |
* @param {object} typeSpecs Map of name to a ReactPropType |
| 358 |
* @param {object} values Runtime values that need to be type-checked |
| 359 |
* @param {string} location e.g. "prop", "context", "child context" |
| 360 |
* @param {string} componentName Name of the component for error messages. |
| 361 |
* @param {?Function} getStack Returns the component stack. |
| 362 |
* @private |
| 363 |
*/ |
| 364 |
function checkPropTypes(typeSpecs, values, location, componentName, getStack) { |
| 365 |
for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) { |
| 366 |
var error; |
| 367 |
try { |
| 368 |
if (typeof typeSpecs[typeSpecName] !== "function") { |
| 369 |
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); |
| 370 |
err.name = "Invariant Violation"; |
| 371 |
throw err; |
| 372 |
} |
| 373 |
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); |
| 374 |
} catch (ex) { |
| 375 |
error = ex; |
| 376 |
} |
| 377 |
if (error && !(error instanceof Error)) printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."); |
| 378 |
if (error instanceof Error && !(error.message in loggedTypeFailures)) { |
| 379 |
loggedTypeFailures[error.message] = true; |
| 380 |
var stack = getStack ? getStack() : ""; |
| 381 |
printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : "")); |
| 382 |
} |
| 383 |
} |
| 384 |
} |
| 385 |
/** |
| 386 |
* Resets warning cache when testing. |
| 387 |
* |
| 388 |
* @private |
| 389 |
*/ |
| 390 |
checkPropTypes.resetWarningCache = function() { |
| 391 |
loggedTypeFailures = {}; |
| 392 |
}; |
| 393 |
module.exports = checkPropTypes; |
| 394 |
})); |
| 395 |
|
| 396 |
//#endregion |
| 397 |
//#region node_modules/prop-types/factoryWithTypeCheckers.js |
| 398 |
/** |
| 399 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 400 |
* |
| 401 |
* This source code is licensed under the MIT license found in the |
| 402 |
* LICENSE file in the root directory of this source tree. |
| 403 |
*/ |
| 404 |
var require_factoryWithTypeCheckers = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 405 |
var ReactIs = require_react_is(); |
| 406 |
var assign = require_object_assign(); |
| 407 |
var ReactPropTypesSecret = require_ReactPropTypesSecret(); |
| 408 |
var has = require_has(); |
| 409 |
var checkPropTypes = require_checkPropTypes(); |
| 410 |
var printWarning = function() {}; |
| 411 |
printWarning = function(text) { |
| 412 |
var message = "Warning: " + text; |
| 413 |
if (typeof console !== "undefined") console.error(message); |
| 414 |
try { |
| 415 |
throw new Error(message); |
| 416 |
} catch (x) {} |
| 417 |
}; |
| 418 |
function emptyFunctionThatReturnsNull() { |
| 419 |
return null; |
| 420 |
} |
| 421 |
module.exports = function(isValidElement, throwOnDirectAccess) { |
| 422 |
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; |
| 423 |
var FAUX_ITERATOR_SYMBOL = "@@iterator"; |
| 424 |
/** |
| 425 |
* Returns the iterator method function contained on the iterable object. |
| 426 |
* |
| 427 |
* Be sure to invoke the function with the iterable as context: |
| 428 |
* |
| 429 |
* var iteratorFn = getIteratorFn(myIterable); |
| 430 |
* if (iteratorFn) { |
| 431 |
* var iterator = iteratorFn.call(myIterable); |
| 432 |
* ... |
| 433 |
* } |
| 434 |
* |
| 435 |
* @param {?object} maybeIterable |
| 436 |
* @return {?function} |
| 437 |
*/ |
| 438 |
function getIteratorFn(maybeIterable) { |
| 439 |
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); |
| 440 |
if (typeof iteratorFn === "function") return iteratorFn; |
| 441 |
} |
| 442 |
/** |
| 443 |
* Collection of methods that allow declaration and validation of props that are |
| 444 |
* supplied to React components. Example usage: |
| 445 |
* |
| 446 |
* var Props = require('ReactPropTypes'); |
| 447 |
* var MyArticle = React.createClass({ |
| 448 |
* propTypes: { |
| 449 |
* // An optional string prop named "description". |
| 450 |
* description: Props.string, |
| 451 |
* |
| 452 |
* // A required enum prop named "category". |
| 453 |
* category: Props.oneOf(['News','Photos']).isRequired, |
| 454 |
* |
| 455 |
* // A prop named "dialog" that requires an instance of Dialog. |
| 456 |
* dialog: Props.instanceOf(Dialog).isRequired |
| 457 |
* }, |
| 458 |
* render: function() { ... } |
| 459 |
* }); |
| 460 |
* |
| 461 |
* A more formal specification of how these methods are used: |
| 462 |
* |
| 463 |
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) |
| 464 |
* decl := ReactPropTypes.{type}(.isRequired)? |
| 465 |
* |
| 466 |
* Each and every declaration produces a function with the same signature. This |
| 467 |
* allows the creation of custom validation functions. For example: |
| 468 |
* |
| 469 |
* var MyLink = React.createClass({ |
| 470 |
* propTypes: { |
| 471 |
* // An optional string or URI prop named "href". |
| 472 |
* href: function(props, propName, componentName) { |
| 473 |
* var propValue = props[propName]; |
| 474 |
* if (propValue != null && typeof propValue !== 'string' && |
| 475 |
* !(propValue instanceof URI)) { |
| 476 |
* return new Error( |
| 477 |
* 'Expected a string or an URI for ' + propName + ' in ' + |
| 478 |
* componentName |
| 479 |
* ); |
| 480 |
* } |
| 481 |
* } |
| 482 |
* }, |
| 483 |
* render: function() {...} |
| 484 |
* }); |
| 485 |
* |
| 486 |
* @internal |
| 487 |
*/ |
| 488 |
var ANONYMOUS = "<<anonymous>>"; |
| 489 |
var ReactPropTypes = { |
| 490 |
array: createPrimitiveTypeChecker("array"), |
| 491 |
bigint: createPrimitiveTypeChecker("bigint"), |
| 492 |
bool: createPrimitiveTypeChecker("boolean"), |
| 493 |
func: createPrimitiveTypeChecker("function"), |
| 494 |
number: createPrimitiveTypeChecker("number"), |
| 495 |
object: createPrimitiveTypeChecker("object"), |
| 496 |
string: createPrimitiveTypeChecker("string"), |
| 497 |
symbol: createPrimitiveTypeChecker("symbol"), |
| 498 |
any: createAnyTypeChecker(), |
| 499 |
arrayOf: createArrayOfTypeChecker, |
| 500 |
element: createElementTypeChecker(), |
| 501 |
elementType: createElementTypeTypeChecker(), |
| 502 |
instanceOf: createInstanceTypeChecker, |
| 503 |
node: createNodeChecker(), |
| 504 |
objectOf: createObjectOfTypeChecker, |
| 505 |
oneOf: createEnumTypeChecker, |
| 506 |
oneOfType: createUnionTypeChecker, |
| 507 |
shape: createShapeTypeChecker, |
| 508 |
exact: createStrictShapeTypeChecker |
| 509 |
}; |
| 510 |
/** |
| 511 |
* inlined Object.is polyfill to avoid requiring consumers ship their own |
| 512 |
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is |
| 513 |
*/ |
| 514 |
function is(x, y) { |
| 515 |
if (x === y) return x !== 0 || 1 / x === 1 / y; |
| 516 |
else return x !== x && y !== y; |
| 517 |
} |
| 518 |
/** |
| 519 |
* We use an Error-like object for backward compatibility as people may call |
| 520 |
* PropTypes directly and inspect their output. However, we don't use real |
| 521 |
* Errors anymore. We don't inspect their stack anyway, and creating them |
| 522 |
* is prohibitively expensive if they are created too often, such as what |
| 523 |
* happens in oneOfType() for any type before the one that matched. |
| 524 |
*/ |
| 525 |
function PropTypeError(message, data) { |
| 526 |
this.message = message; |
| 527 |
this.data = data && typeof data === "object" ? data : {}; |
| 528 |
this.stack = ""; |
| 529 |
} |
| 530 |
PropTypeError.prototype = Error.prototype; |
| 531 |
function createChainableTypeChecker(validate) { |
| 532 |
var manualPropTypeCallCache = {}; |
| 533 |
var manualPropTypeWarningCount = 0; |
| 534 |
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { |
| 535 |
componentName = componentName || ANONYMOUS; |
| 536 |
propFullName = propFullName || propName; |
| 537 |
if (secret !== ReactPropTypesSecret) { |
| 538 |
if (throwOnDirectAccess) { |
| 539 |
var err = /* @__PURE__ */ new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"); |
| 540 |
err.name = "Invariant Violation"; |
| 541 |
throw err; |
| 542 |
} else if (typeof console !== "undefined") { |
| 543 |
var cacheKey = componentName + ":" + propName; |
| 544 |
if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { |
| 545 |
printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."); |
| 546 |
manualPropTypeCallCache[cacheKey] = true; |
| 547 |
manualPropTypeWarningCount++; |
| 548 |
} |
| 549 |
} |
| 550 |
} |
| 551 |
if (props[propName] == null) { |
| 552 |
if (isRequired) { |
| 553 |
if (props[propName] === null) return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); |
| 554 |
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); |
| 555 |
} |
| 556 |
return null; |
| 557 |
} else return validate(props, propName, componentName, location, propFullName); |
| 558 |
} |
| 559 |
var chainedCheckType = checkType.bind(null, false); |
| 560 |
chainedCheckType.isRequired = checkType.bind(null, true); |
| 561 |
return chainedCheckType; |
| 562 |
} |
| 563 |
function createPrimitiveTypeChecker(expectedType) { |
| 564 |
function validate(props, propName, componentName, location, propFullName, secret) { |
| 565 |
var propValue = props[propName]; |
| 566 |
if (getPropType(propValue) !== expectedType) { |
| 567 |
var preciseType = getPreciseType(propValue); |
| 568 |
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType }); |
| 569 |
} |
| 570 |
return null; |
| 571 |
} |
| 572 |
return createChainableTypeChecker(validate); |
| 573 |
} |
| 574 |
function createAnyTypeChecker() { |
| 575 |
return createChainableTypeChecker(emptyFunctionThatReturnsNull); |
| 576 |
} |
| 577 |
function createArrayOfTypeChecker(typeChecker) { |
| 578 |
function validate(props, propName, componentName, location, propFullName) { |
| 579 |
if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); |
| 580 |
var propValue = props[propName]; |
| 581 |
if (!Array.isArray(propValue)) { |
| 582 |
var propType = getPropType(propValue); |
| 583 |
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); |
| 584 |
} |
| 585 |
for (var i = 0; i < propValue.length; i++) { |
| 586 |
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret); |
| 587 |
if (error instanceof Error) return error; |
| 588 |
} |
| 589 |
return null; |
| 590 |
} |
| 591 |
return createChainableTypeChecker(validate); |
| 592 |
} |
| 593 |
function createElementTypeChecker() { |
| 594 |
function validate(props, propName, componentName, location, propFullName) { |
| 595 |
var propValue = props[propName]; |
| 596 |
if (!isValidElement(propValue)) { |
| 597 |
var propType = getPropType(propValue); |
| 598 |
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); |
| 599 |
} |
| 600 |
return null; |
| 601 |
} |
| 602 |
return createChainableTypeChecker(validate); |
| 603 |
} |
| 604 |
function createElementTypeTypeChecker() { |
| 605 |
function validate(props, propName, componentName, location, propFullName) { |
| 606 |
var propValue = props[propName]; |
| 607 |
if (!ReactIs.isValidElementType(propValue)) { |
| 608 |
var propType = getPropType(propValue); |
| 609 |
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); |
| 610 |
} |
| 611 |
return null; |
| 612 |
} |
| 613 |
return createChainableTypeChecker(validate); |
| 614 |
} |
| 615 |
function createInstanceTypeChecker(expectedClass) { |
| 616 |
function validate(props, propName, componentName, location, propFullName) { |
| 617 |
if (!(props[propName] instanceof expectedClass)) { |
| 618 |
var expectedClassName = expectedClass.name || ANONYMOUS; |
| 619 |
var actualClassName = getClassName(props[propName]); |
| 620 |
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); |
| 621 |
} |
| 622 |
return null; |
| 623 |
} |
| 624 |
return createChainableTypeChecker(validate); |
| 625 |
} |
| 626 |
function createEnumTypeChecker(expectedValues) { |
| 627 |
if (!Array.isArray(expectedValues)) { |
| 628 |
if (arguments.length > 1) printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."); |
| 629 |
else printWarning("Invalid argument supplied to oneOf, expected an array."); |
| 630 |
return emptyFunctionThatReturnsNull; |
| 631 |
} |
| 632 |
function validate(props, propName, componentName, location, propFullName) { |
| 633 |
var propValue = props[propName]; |
| 634 |
for (var i = 0; i < expectedValues.length; i++) if (is(propValue, expectedValues[i])) return null; |
| 635 |
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { |
| 636 |
if (getPreciseType(value) === "symbol") return String(value); |
| 637 |
return value; |
| 638 |
}); |
| 639 |
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); |
| 640 |
} |
| 641 |
return createChainableTypeChecker(validate); |
| 642 |
} |
| 643 |
function createObjectOfTypeChecker(typeChecker) { |
| 644 |
function validate(props, propName, componentName, location, propFullName) { |
| 645 |
if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); |
| 646 |
var propValue = props[propName]; |
| 647 |
var propType = getPropType(propValue); |
| 648 |
if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); |
| 649 |
for (var key in propValue) if (has(propValue, key)) { |
| 650 |
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); |
| 651 |
if (error instanceof Error) return error; |
| 652 |
} |
| 653 |
return null; |
| 654 |
} |
| 655 |
return createChainableTypeChecker(validate); |
| 656 |
} |
| 657 |
function createUnionTypeChecker(arrayOfTypeCheckers) { |
| 658 |
if (!Array.isArray(arrayOfTypeCheckers)) { |
| 659 |
printWarning("Invalid argument supplied to oneOfType, expected an instance of array."); |
| 660 |
return emptyFunctionThatReturnsNull; |
| 661 |
} |
| 662 |
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { |
| 663 |
var checker = arrayOfTypeCheckers[i]; |
| 664 |
if (typeof checker !== "function") { |
| 665 |
printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."); |
| 666 |
return emptyFunctionThatReturnsNull; |
| 667 |
} |
| 668 |
} |
| 669 |
function validate(props, propName, componentName, location, propFullName) { |
| 670 |
var expectedTypes = []; |
| 671 |
for (var i = 0; i < arrayOfTypeCheckers.length; i++) { |
| 672 |
var checker = arrayOfTypeCheckers[i]; |
| 673 |
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); |
| 674 |
if (checkerResult == null) return null; |
| 675 |
if (checkerResult.data && has(checkerResult.data, "expectedType")) expectedTypes.push(checkerResult.data.expectedType); |
| 676 |
} |
| 677 |
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; |
| 678 |
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); |
| 679 |
} |
| 680 |
return createChainableTypeChecker(validate); |
| 681 |
} |
| 682 |
function createNodeChecker() { |
| 683 |
function validate(props, propName, componentName, location, propFullName) { |
| 684 |
if (!isNode(props[propName])) return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); |
| 685 |
return null; |
| 686 |
} |
| 687 |
return createChainableTypeChecker(validate); |
| 688 |
} |
| 689 |
function invalidValidatorError(componentName, location, propFullName, key, type) { |
| 690 |
return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."); |
| 691 |
} |
| 692 |
function createShapeTypeChecker(shapeTypes) { |
| 693 |
function validate(props, propName, componentName, location, propFullName) { |
| 694 |
var propValue = props[propName]; |
| 695 |
var propType = getPropType(propValue); |
| 696 |
if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); |
| 697 |
for (var key in shapeTypes) { |
| 698 |
var checker = shapeTypes[key]; |
| 699 |
if (typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); |
| 700 |
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); |
| 701 |
if (error) return error; |
| 702 |
} |
| 703 |
return null; |
| 704 |
} |
| 705 |
return createChainableTypeChecker(validate); |
| 706 |
} |
| 707 |
function createStrictShapeTypeChecker(shapeTypes) { |
| 708 |
function validate(props, propName, componentName, location, propFullName) { |
| 709 |
var propValue = props[propName]; |
| 710 |
var propType = getPropType(propValue); |
| 711 |
if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); |
| 712 |
for (var key in assign({}, props[propName], shapeTypes)) { |
| 713 |
var checker = shapeTypes[key]; |
| 714 |
if (has(shapeTypes, key) && typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); |
| 715 |
if (!checker) return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")); |
| 716 |
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); |
| 717 |
if (error) return error; |
| 718 |
} |
| 719 |
return null; |
| 720 |
} |
| 721 |
return createChainableTypeChecker(validate); |
| 722 |
} |
| 723 |
function isNode(propValue) { |
| 724 |
switch (typeof propValue) { |
| 725 |
case "number": |
| 726 |
case "string": |
| 727 |
case "undefined": return true; |
| 728 |
case "boolean": return !propValue; |
| 729 |
case "object": |
| 730 |
if (Array.isArray(propValue)) return propValue.every(isNode); |
| 731 |
if (propValue === null || isValidElement(propValue)) return true; |
| 732 |
var iteratorFn = getIteratorFn(propValue); |
| 733 |
if (iteratorFn) { |
| 734 |
var iterator = iteratorFn.call(propValue); |
| 735 |
var step; |
| 736 |
if (iteratorFn !== propValue.entries) { |
| 737 |
while (!(step = iterator.next()).done) if (!isNode(step.value)) return false; |
| 738 |
} else while (!(step = iterator.next()).done) { |
| 739 |
var entry = step.value; |
| 740 |
if (entry) { |
| 741 |
if (!isNode(entry[1])) return false; |
| 742 |
} |
| 743 |
} |
| 744 |
} else return false; |
| 745 |
return true; |
| 746 |
default: return false; |
| 747 |
} |
| 748 |
} |
| 749 |
function isSymbol(propType, propValue) { |
| 750 |
if (propType === "symbol") return true; |
| 751 |
if (!propValue) return false; |
| 752 |
if (propValue["@@toStringTag"] === "Symbol") return true; |
| 753 |
if (typeof Symbol === "function" && propValue instanceof Symbol) return true; |
| 754 |
return false; |
| 755 |
} |
| 756 |
function getPropType(propValue) { |
| 757 |
var propType = typeof propValue; |
| 758 |
if (Array.isArray(propValue)) return "array"; |
| 759 |
if (propValue instanceof RegExp) return "object"; |
| 760 |
if (isSymbol(propType, propValue)) return "symbol"; |
| 761 |
return propType; |
| 762 |
} |
| 763 |
function getPreciseType(propValue) { |
| 764 |
if (typeof propValue === "undefined" || propValue === null) return "" + propValue; |
| 765 |
var propType = getPropType(propValue); |
| 766 |
if (propType === "object") { |
| 767 |
if (propValue instanceof Date) return "date"; |
| 768 |
else if (propValue instanceof RegExp) return "regexp"; |
| 769 |
} |
| 770 |
return propType; |
| 771 |
} |
| 772 |
function getPostfixForTypeWarning(value) { |
| 773 |
var type = getPreciseType(value); |
| 774 |
switch (type) { |
| 775 |
case "array": |
| 776 |
case "object": return "an " + type; |
| 777 |
case "boolean": |
| 778 |
case "date": |
| 779 |
case "regexp": return "a " + type; |
| 780 |
default: return type; |
| 781 |
} |
| 782 |
} |
| 783 |
function getClassName(propValue) { |
| 784 |
if (!propValue.constructor || !propValue.constructor.name) return ANONYMOUS; |
| 785 |
return propValue.constructor.name; |
| 786 |
} |
| 787 |
ReactPropTypes.checkPropTypes = checkPropTypes; |
| 788 |
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; |
| 789 |
ReactPropTypes.PropTypes = ReactPropTypes; |
| 790 |
return ReactPropTypes; |
| 791 |
}; |
| 792 |
})); |
| 793 |
|
| 794 |
//#endregion |
| 795 |
//#region node_modules/prop-types/index.js |
| 796 |
var require_prop_types = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 797 |
var ReactIs = require_react_is(); |
| 798 |
var throwOnDirectAccess = true; |
| 799 |
module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); |
| 800 |
})); |
| 801 |
|
| 802 |
//#endregion |
| 803 |
//#region node_modules/invariant/browser.js |
| 804 |
/** |
| 805 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 806 |
* |
| 807 |
* This source code is licensed under the MIT license found in the |
| 808 |
* LICENSE file in the root directory of this source tree. |
| 809 |
*/ |
| 810 |
var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 811 |
/** |
| 812 |
* Use invariant() to assert state which your program assumes to be true. |
| 813 |
* |
| 814 |
* Provide sprintf-style format (only %s is supported) and arguments |
| 815 |
* to provide information about what broke and what you were |
| 816 |
* expecting. |
| 817 |
* |
| 818 |
* The invariant message will be stripped in production, but the invariant |
| 819 |
* will remain to ensure logic does not differ in production. |
| 820 |
*/ |
| 821 |
var invariant = function(condition, format, a, b, c, d, e, f) { |
| 822 |
if (format === void 0) throw new Error("invariant requires an error message argument"); |
| 823 |
if (!condition) { |
| 824 |
var error; |
| 825 |
if (format === void 0) error = /* @__PURE__ */ new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); |
| 826 |
else { |
| 827 |
var args = [ |
| 828 |
a, |
| 829 |
b, |
| 830 |
c, |
| 831 |
d, |
| 832 |
e, |
| 833 |
f |
| 834 |
]; |
| 835 |
var argIndex = 0; |
| 836 |
error = new Error(format.replace(/%s/g, function() { |
| 837 |
return args[argIndex++]; |
| 838 |
})); |
| 839 |
error.name = "Invariant Violation"; |
| 840 |
} |
| 841 |
error.framesToPop = 1; |
| 842 |
throw error; |
| 843 |
} |
| 844 |
}; |
| 845 |
module.exports = invariant; |
| 846 |
})); |
| 847 |
|
| 848 |
//#endregion |
| 849 |
//#region node_modules/gud/index.js |
| 850 |
var require_gud = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 851 |
var key = "__global_unique_id__"; |
| 852 |
module.exports = function() { |
| 853 |
return global[key] = (global[key] || 0) + 1; |
| 854 |
}; |
| 855 |
})); |
| 856 |
|
| 857 |
//#endregion |
| 858 |
//#region node_modules/warning/warning.js |
| 859 |
/** |
| 860 |
* Copyright (c) 2014-present, Facebook, Inc. |
| 861 |
* |
| 862 |
* This source code is licensed under the MIT license found in the |
| 863 |
* LICENSE file in the root directory of this source tree. |
| 864 |
*/ |
| 865 |
var require_warning = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 866 |
/** |
| 867 |
* Similar to invariant but only logs a warning if the condition is not met. |
| 868 |
* This can be used to log issues in development environments in critical |
| 869 |
* paths. Removing the logging code for production environments will keep the |
| 870 |
* same logic and follow the same code paths. |
| 871 |
*/ |
| 872 |
var __DEV__ = true; |
| 873 |
var warning = function() {}; |
| 874 |
if (__DEV__) { |
| 875 |
var printWarning = function printWarning(format, args) { |
| 876 |
var len = arguments.length; |
| 877 |
args = new Array(len > 1 ? len - 1 : 0); |
| 878 |
for (var key = 1; key < len; key++) args[key - 1] = arguments[key]; |
| 879 |
var argIndex = 0; |
| 880 |
var message = "Warning: " + format.replace(/%s/g, function() { |
| 881 |
return args[argIndex++]; |
| 882 |
}); |
| 883 |
if (typeof console !== "undefined") console.error(message); |
| 884 |
try { |
| 885 |
throw new Error(message); |
| 886 |
} catch (x) {} |
| 887 |
}; |
| 888 |
warning = function(condition, format, args) { |
| 889 |
var len = arguments.length; |
| 890 |
args = new Array(len > 2 ? len - 2 : 0); |
| 891 |
for (var key = 2; key < len; key++) args[key - 2] = arguments[key]; |
| 892 |
if (format === void 0) throw new Error("`warning(condition, format, ...args)` requires a warning message argument"); |
| 893 |
if (!condition) printWarning.apply(null, [format].concat(args)); |
| 894 |
}; |
| 895 |
} |
| 896 |
module.exports = warning; |
| 897 |
})); |
| 898 |
|
| 899 |
//#endregion |
| 900 |
//#region node_modules/create-react-context/lib/implementation.js |
| 901 |
var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 902 |
exports.__esModule = true; |
| 903 |
var _react = (globalThis.React); |
| 904 |
_interopRequireDefault(_react); |
| 905 |
var _propTypes2 = _interopRequireDefault(require_prop_types()); |
| 906 |
var _gud2 = _interopRequireDefault(require_gud()); |
| 907 |
var _warning2 = _interopRequireDefault(require_warning()); |
| 908 |
function _interopRequireDefault(obj) { |
| 909 |
return obj && obj.__esModule ? obj : { default: obj }; |
| 910 |
} |
| 911 |
function _classCallCheck(instance, Constructor) { |
| 912 |
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); |
| 913 |
} |
| 914 |
function _possibleConstructorReturn(self, call) { |
| 915 |
if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 916 |
return call && (typeof call === "object" || typeof call === "function") ? call : self; |
| 917 |
} |
| 918 |
function _inherits(subClass, superClass) { |
| 919 |
if (typeof superClass !== "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); |
| 920 |
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { |
| 921 |
value: subClass, |
| 922 |
enumerable: false, |
| 923 |
writable: true, |
| 924 |
configurable: true |
| 925 |
} }); |
| 926 |
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; |
| 927 |
} |
| 928 |
var MAX_SIGNED_31_BIT_INT = 1073741823; |
| 929 |
function objectIs(x, y) { |
| 930 |
if (x === y) return x !== 0 || 1 / x === 1 / y; |
| 931 |
else return x !== x && y !== y; |
| 932 |
} |
| 933 |
function createEventEmitter(value) { |
| 934 |
var handlers = []; |
| 935 |
return { |
| 936 |
on: function on(handler) { |
| 937 |
handlers.push(handler); |
| 938 |
}, |
| 939 |
off: function off(handler) { |
| 940 |
handlers = handlers.filter(function(h) { |
| 941 |
return h !== handler; |
| 942 |
}); |
| 943 |
}, |
| 944 |
get: function get() { |
| 945 |
return value; |
| 946 |
}, |
| 947 |
set: function set(newValue, changedBits) { |
| 948 |
value = newValue; |
| 949 |
handlers.forEach(function(handler) { |
| 950 |
return handler(value, changedBits); |
| 951 |
}); |
| 952 |
} |
| 953 |
}; |
| 954 |
} |
| 955 |
function onlyChild(children) { |
| 956 |
return Array.isArray(children) ? children[0] : children; |
| 957 |
} |
| 958 |
function createReactContext(defaultValue, calculateChangedBits) { |
| 959 |
var _Provider$childContex; |
| 960 |
var _Consumer$contextType; |
| 961 |
var contextProp = "__create-react-context-" + (0, _gud2.default)() + "__"; |
| 962 |
var Provider = function(_Component) { |
| 963 |
_inherits(Provider, _Component); |
| 964 |
function Provider() { |
| 965 |
var _temp; |
| 966 |
var _this; |
| 967 |
var _ret; |
| 968 |
_classCallCheck(this, Provider); |
| 969 |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 970 |
return _ret = (_temp = (_this = _possibleConstructorReturn(this, _Component.call.apply(_Component, [this].concat(args))), _this), _this.emitter = createEventEmitter(_this.props.value), _temp), _possibleConstructorReturn(_this, _ret); |
| 971 |
} |
| 972 |
Provider.prototype.getChildContext = function getChildContext() { |
| 973 |
var _ref; |
| 974 |
return _ref = {}, _ref[contextProp] = this.emitter, _ref; |
| 975 |
}; |
| 976 |
Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { |
| 977 |
if (this.props.value !== nextProps.value) { |
| 978 |
var oldValue = this.props.value; |
| 979 |
var newValue = nextProps.value; |
| 980 |
var changedBits = void 0; |
| 981 |
if (objectIs(oldValue, newValue)) changedBits = 0; |
| 982 |
else { |
| 983 |
changedBits = typeof calculateChangedBits === "function" ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT; |
| 984 |
(0, _warning2.default)((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits, "calculateChangedBits: Expected the return value to be a 31-bit integer. Instead received: %s", changedBits); |
| 985 |
changedBits |= 0; |
| 986 |
if (changedBits !== 0) this.emitter.set(nextProps.value, changedBits); |
| 987 |
} |
| 988 |
} |
| 989 |
}; |
| 990 |
Provider.prototype.render = function render() { |
| 991 |
return this.props.children; |
| 992 |
}; |
| 993 |
return Provider; |
| 994 |
}(_react.Component); |
| 995 |
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = _propTypes2.default.object.isRequired, _Provider$childContex); |
| 996 |
var Consumer = function(_Component2) { |
| 997 |
_inherits(Consumer, _Component2); |
| 998 |
function Consumer() { |
| 999 |
var _temp2; |
| 1000 |
var _this2; |
| 1001 |
var _ret2; |
| 1002 |
_classCallCheck(this, Consumer); |
| 1003 |
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2]; |
| 1004 |
return _ret2 = (_temp2 = (_this2 = _possibleConstructorReturn(this, _Component2.call.apply(_Component2, [this].concat(args))), _this2), _this2.state = { value: _this2.getValue() }, _this2.onUpdate = function(newValue, changedBits) { |
| 1005 |
if (((_this2.observedBits | 0) & changedBits) !== 0) _this2.setState({ value: _this2.getValue() }); |
| 1006 |
}, _temp2), _possibleConstructorReturn(_this2, _ret2); |
| 1007 |
} |
| 1008 |
Consumer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { |
| 1009 |
var observedBits = nextProps.observedBits; |
| 1010 |
this.observedBits = observedBits === void 0 || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; |
| 1011 |
}; |
| 1012 |
Consumer.prototype.componentDidMount = function componentDidMount() { |
| 1013 |
if (this.context[contextProp]) this.context[contextProp].on(this.onUpdate); |
| 1014 |
var observedBits = this.props.observedBits; |
| 1015 |
this.observedBits = observedBits === void 0 || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits; |
| 1016 |
}; |
| 1017 |
Consumer.prototype.componentWillUnmount = function componentWillUnmount() { |
| 1018 |
if (this.context[contextProp]) this.context[contextProp].off(this.onUpdate); |
| 1019 |
}; |
| 1020 |
Consumer.prototype.getValue = function getValue() { |
| 1021 |
if (this.context[contextProp]) return this.context[contextProp].get(); |
| 1022 |
else return defaultValue; |
| 1023 |
}; |
| 1024 |
Consumer.prototype.render = function render() { |
| 1025 |
return onlyChild(this.props.children)(this.state.value); |
| 1026 |
}; |
| 1027 |
return Consumer; |
| 1028 |
}(_react.Component); |
| 1029 |
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = _propTypes2.default.object, _Consumer$contextType); |
| 1030 |
return { |
| 1031 |
Provider, |
| 1032 |
Consumer |
| 1033 |
}; |
| 1034 |
} |
| 1035 |
exports.default = createReactContext; |
| 1036 |
module.exports = exports["default"]; |
| 1037 |
})); |
| 1038 |
|
| 1039 |
//#endregion |
| 1040 |
//#region node_modules/create-react-context/lib/index.js |
| 1041 |
var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 1042 |
exports.__esModule = true; |
| 1043 |
var _react2 = _interopRequireDefault((globalThis.React)); |
| 1044 |
var _implementation2 = _interopRequireDefault(require_implementation()); |
| 1045 |
function _interopRequireDefault(obj) { |
| 1046 |
return obj && obj.__esModule ? obj : { default: obj }; |
| 1047 |
} |
| 1048 |
exports.default = _react2.default.createContext || _implementation2.default; |
| 1049 |
module.exports = exports["default"]; |
| 1050 |
})); |
| 1051 |
|
| 1052 |
//#endregion |
| 1053 |
//#region node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js |
| 1054 |
/** |
| 1055 |
* Copyright (c) 2013-present, Facebook, Inc. |
| 1056 |
* |
| 1057 |
* This source code is licensed under the MIT license found in the |
| 1058 |
* LICENSE file in the root directory of this source tree. |
| 1059 |
*/ |
| 1060 |
function componentWillMount() { |
| 1061 |
var state = this.constructor.getDerivedStateFromProps(this.props, this.state); |
| 1062 |
if (state !== null && state !== void 0) this.setState(state); |
| 1063 |
} |
| 1064 |
function componentWillReceiveProps(nextProps) { |
| 1065 |
function updater(prevState) { |
| 1066 |
var state = this.constructor.getDerivedStateFromProps(nextProps, prevState); |
| 1067 |
return state !== null && state !== void 0 ? state : null; |
| 1068 |
} |
| 1069 |
this.setState(updater.bind(this)); |
| 1070 |
} |
| 1071 |
function componentWillUpdate(nextProps, nextState) { |
| 1072 |
try { |
| 1073 |
var prevProps = this.props; |
| 1074 |
var prevState = this.state; |
| 1075 |
this.props = nextProps; |
| 1076 |
this.state = nextState; |
| 1077 |
this.__reactInternalSnapshotFlag = true; |
| 1078 |
this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(prevProps, prevState); |
| 1079 |
} finally { |
| 1080 |
this.props = prevProps; |
| 1081 |
this.state = prevState; |
| 1082 |
} |
| 1083 |
} |
| 1084 |
function polyfill(Component) { |
| 1085 |
var prototype = Component.prototype; |
| 1086 |
if (!prototype || !prototype.isReactComponent) throw new Error("Can only polyfill class components"); |
| 1087 |
if (typeof Component.getDerivedStateFromProps !== "function" && typeof prototype.getSnapshotBeforeUpdate !== "function") return Component; |
| 1088 |
var foundWillMountName = null; |
| 1089 |
var foundWillReceivePropsName = null; |
| 1090 |
var foundWillUpdateName = null; |
| 1091 |
if (typeof prototype.componentWillMount === "function") foundWillMountName = "componentWillMount"; |
| 1092 |
else if (typeof prototype.UNSAFE_componentWillMount === "function") foundWillMountName = "UNSAFE_componentWillMount"; |
| 1093 |
if (typeof prototype.componentWillReceiveProps === "function") foundWillReceivePropsName = "componentWillReceiveProps"; |
| 1094 |
else if (typeof prototype.UNSAFE_componentWillReceiveProps === "function") foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"; |
| 1095 |
if (typeof prototype.componentWillUpdate === "function") foundWillUpdateName = "componentWillUpdate"; |
| 1096 |
else if (typeof prototype.UNSAFE_componentWillUpdate === "function") foundWillUpdateName = "UNSAFE_componentWillUpdate"; |
| 1097 |
if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { |
| 1098 |
var componentName = Component.displayName || Component.name; |
| 1099 |
var newApiName = typeof Component.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; |
| 1100 |
throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + componentName + " uses " + newApiName + " but also contains the following legacy lifecycles:" + (foundWillMountName !== null ? "\n " + foundWillMountName : "") + (foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "") + (foundWillUpdateName !== null ? "\n " + foundWillUpdateName : "") + "\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks"); |
| 1101 |
} |
| 1102 |
if (typeof Component.getDerivedStateFromProps === "function") { |
| 1103 |
prototype.componentWillMount = componentWillMount; |
| 1104 |
prototype.componentWillReceiveProps = componentWillReceiveProps; |
| 1105 |
} |
| 1106 |
if (typeof prototype.getSnapshotBeforeUpdate === "function") { |
| 1107 |
if (typeof prototype.componentDidUpdate !== "function") throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype"); |
| 1108 |
prototype.componentWillUpdate = componentWillUpdate; |
| 1109 |
var componentDidUpdate = prototype.componentDidUpdate; |
| 1110 |
prototype.componentDidUpdate = function componentDidUpdatePolyfill(prevProps, prevState, maybeSnapshot) { |
| 1111 |
var snapshot = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : maybeSnapshot; |
| 1112 |
componentDidUpdate.call(this, prevProps, prevState, snapshot); |
| 1113 |
}; |
| 1114 |
} |
| 1115 |
return Component; |
| 1116 |
} |
| 1117 |
var init_react_lifecycles_compat_es = __esmMin((() => { |
| 1118 |
componentWillMount.__suppressDeprecationWarning = true; |
| 1119 |
componentWillReceiveProps.__suppressDeprecationWarning = true; |
| 1120 |
componentWillUpdate.__suppressDeprecationWarning = true; |
| 1121 |
})); |
| 1122 |
|
| 1123 |
//#endregion |
| 1124 |
//#region node_modules/@reach/router/es/lib/utils.js |
| 1125 |
var import_browser$1, startsWith, pick, resolve, insertParams, validateRedirect, paramRe, SEGMENT_POINTS, STATIC_POINTS, DYNAMIC_POINTS, SPLAT_PENALTY, ROOT_POINTS, isRootSegment, isDynamic, isSplat, rankRoute, rankRoutes, segmentize, addQuery, reservedNames, shallowCompare; |
| 1126 |
var init_utils$5 = __esmMin((() => { |
| 1127 |
import_browser$1 = /* @__PURE__ */ __toESM(require_browser()); |
| 1128 |
startsWith = function startsWith(string, search) { |
| 1129 |
return string.substr(0, search.length) === search; |
| 1130 |
}; |
| 1131 |
pick = function pick(routes, uri) { |
| 1132 |
var match = void 0; |
| 1133 |
var default_ = void 0; |
| 1134 |
var uriPathname = uri.split("?")[0]; |
| 1135 |
var uriSegments = segmentize(uriPathname); |
| 1136 |
var isRootUri = uriSegments[0] === ""; |
| 1137 |
var ranked = rankRoutes(routes); |
| 1138 |
for (var i = 0, l = ranked.length; i < l; i++) { |
| 1139 |
var missed = false; |
| 1140 |
var route = ranked[i].route; |
| 1141 |
if (route.default) { |
| 1142 |
default_ = { |
| 1143 |
route, |
| 1144 |
params: {}, |
| 1145 |
uri |
| 1146 |
}; |
| 1147 |
continue; |
| 1148 |
} |
| 1149 |
var routeSegments = segmentize(route.path); |
| 1150 |
var params = {}; |
| 1151 |
var max = Math.max(uriSegments.length, routeSegments.length); |
| 1152 |
var index = 0; |
| 1153 |
for (; index < max; index++) { |
| 1154 |
var routeSegment = routeSegments[index]; |
| 1155 |
var uriSegment = uriSegments[index]; |
| 1156 |
if (isSplat(routeSegment)) { |
| 1157 |
var param = routeSegment.slice(1) || "*"; |
| 1158 |
params[param] = uriSegments.slice(index).map(decodeURIComponent).join("/"); |
| 1159 |
break; |
| 1160 |
} |
| 1161 |
if (uriSegment === void 0) { |
| 1162 |
missed = true; |
| 1163 |
break; |
| 1164 |
} |
| 1165 |
var dynamicMatch = paramRe.exec(routeSegment); |
| 1166 |
if (dynamicMatch && !isRootUri) { |
| 1167 |
!(reservedNames.indexOf(dynamicMatch[1]) === -1) && (0, import_browser$1.default)(false, "<Router> dynamic segment \"" + dynamicMatch[1] + "\" is a reserved name. Please use a different name in path \"" + route.path + "\"."); |
| 1168 |
var value = decodeURIComponent(uriSegment); |
| 1169 |
params[dynamicMatch[1]] = value; |
| 1170 |
} else if (routeSegment !== uriSegment) { |
| 1171 |
missed = true; |
| 1172 |
break; |
| 1173 |
} |
| 1174 |
} |
| 1175 |
if (!missed) { |
| 1176 |
match = { |
| 1177 |
route, |
| 1178 |
params, |
| 1179 |
uri: "/" + uriSegments.slice(0, index).join("/") |
| 1180 |
}; |
| 1181 |
break; |
| 1182 |
} |
| 1183 |
} |
| 1184 |
return match || default_ || null; |
| 1185 |
}; |
| 1186 |
resolve = function resolve(to, base) { |
| 1187 |
if (startsWith(to, "/")) return to; |
| 1188 |
var _to$split = to.split("?"); |
| 1189 |
var toPathname = _to$split[0]; |
| 1190 |
var toQuery = _to$split[1]; |
| 1191 |
var basePathname = base.split("?")[0]; |
| 1192 |
var toSegments = segmentize(toPathname); |
| 1193 |
var baseSegments = segmentize(basePathname); |
| 1194 |
if (toSegments[0] === "") return addQuery(basePathname, toQuery); |
| 1195 |
if (!startsWith(toSegments[0], ".")) { |
| 1196 |
var pathname = baseSegments.concat(toSegments).join("/"); |
| 1197 |
return addQuery((basePathname === "/" ? "" : "/") + pathname, toQuery); |
| 1198 |
} |
| 1199 |
var allSegments = baseSegments.concat(toSegments); |
| 1200 |
var segments = []; |
| 1201 |
for (var i = 0, l = allSegments.length; i < l; i++) { |
| 1202 |
var segment = allSegments[i]; |
| 1203 |
if (segment === "..") segments.pop(); |
| 1204 |
else if (segment !== ".") segments.push(segment); |
| 1205 |
} |
| 1206 |
return addQuery("/" + segments.join("/"), toQuery); |
| 1207 |
}; |
| 1208 |
insertParams = function insertParams(path, params) { |
| 1209 |
var _path$split = path.split("?"); |
| 1210 |
var pathBase = _path$split[0]; |
| 1211 |
var _path$split$ = _path$split[1]; |
| 1212 |
var query = _path$split$ === void 0 ? "" : _path$split$; |
| 1213 |
var constructedPath = "/" + segmentize(pathBase).map(function(segment) { |
| 1214 |
var match = paramRe.exec(segment); |
| 1215 |
return match ? params[match[1]] : segment; |
| 1216 |
}).join("/"); |
| 1217 |
var _params$location = params.location; |
| 1218 |
_params$location = _params$location === void 0 ? {} : _params$location; |
| 1219 |
var _params$location$sear = _params$location.search; |
| 1220 |
var searchSplit = (_params$location$sear === void 0 ? "" : _params$location$sear).split("?")[1] || ""; |
| 1221 |
constructedPath = addQuery(constructedPath, query, searchSplit); |
| 1222 |
return constructedPath; |
| 1223 |
}; |
| 1224 |
validateRedirect = function validateRedirect(from, to) { |
| 1225 |
var filter = function filter(segment) { |
| 1226 |
return isDynamic(segment); |
| 1227 |
}; |
| 1228 |
return segmentize(from).filter(filter).sort().join("/") === segmentize(to).filter(filter).sort().join("/"); |
| 1229 |
}; |
| 1230 |
paramRe = /^:(.+)/; |
| 1231 |
SEGMENT_POINTS = 4; |
| 1232 |
STATIC_POINTS = 3; |
| 1233 |
DYNAMIC_POINTS = 2; |
| 1234 |
SPLAT_PENALTY = 1; |
| 1235 |
ROOT_POINTS = 1; |
| 1236 |
isRootSegment = function isRootSegment(segment) { |
| 1237 |
return segment === ""; |
| 1238 |
}; |
| 1239 |
isDynamic = function isDynamic(segment) { |
| 1240 |
return paramRe.test(segment); |
| 1241 |
}; |
| 1242 |
isSplat = function isSplat(segment) { |
| 1243 |
return segment && segment[0] === "*"; |
| 1244 |
}; |
| 1245 |
rankRoute = function rankRoute(route, index) { |
| 1246 |
return { |
| 1247 |
route, |
| 1248 |
score: route.default ? 0 : segmentize(route.path).reduce(function(score, segment) { |
| 1249 |
score += SEGMENT_POINTS; |
| 1250 |
if (isRootSegment(segment)) score += ROOT_POINTS; |
| 1251 |
else if (isDynamic(segment)) score += DYNAMIC_POINTS; |
| 1252 |
else if (isSplat(segment)) score -= SEGMENT_POINTS + SPLAT_PENALTY; |
| 1253 |
else score += STATIC_POINTS; |
| 1254 |
return score; |
| 1255 |
}, 0), |
| 1256 |
index |
| 1257 |
}; |
| 1258 |
}; |
| 1259 |
rankRoutes = function rankRoutes(routes) { |
| 1260 |
return routes.map(rankRoute).sort(function(a, b) { |
| 1261 |
return a.score < b.score ? 1 : a.score > b.score ? -1 : a.index - b.index; |
| 1262 |
}); |
| 1263 |
}; |
| 1264 |
segmentize = function segmentize(uri) { |
| 1265 |
return uri.replace(/(^\/+|\/+$)/g, "").split("/"); |
| 1266 |
}; |
| 1267 |
addQuery = function addQuery(pathname) { |
| 1268 |
for (var _len = arguments.length, query = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) query[_key - 1] = arguments[_key]; |
| 1269 |
query = query.filter(function(q) { |
| 1270 |
return q && q.length > 0; |
| 1271 |
}); |
| 1272 |
return pathname + (query && query.length > 0 ? "?" + query.join("&") : ""); |
| 1273 |
}; |
| 1274 |
reservedNames = ["uri", "path"]; |
| 1275 |
shallowCompare = function shallowCompare(obj1, obj2) { |
| 1276 |
var obj1Keys = Object.keys(obj1); |
| 1277 |
return obj1Keys.length === Object.keys(obj2).length && obj1Keys.every(function(key) { |
| 1278 |
return obj2.hasOwnProperty(key) && obj1[key] === obj2[key]; |
| 1279 |
}); |
| 1280 |
}; |
| 1281 |
})); |
| 1282 |
|
| 1283 |
//#endregion |
| 1284 |
//#region node_modules/@reach/router/es/lib/history.js |
| 1285 |
var _extends$2, getLocation, createHistory, createMemorySource, canUseDOM, globalHistory, navigate; |
| 1286 |
var init_history = __esmMin((() => { |
| 1287 |
_extends$2 = Object.assign || function(target) { |
| 1288 |
for (var i = 1; i < arguments.length; i++) { |
| 1289 |
var source = arguments[i]; |
| 1290 |
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key]; |
| 1291 |
} |
| 1292 |
return target; |
| 1293 |
}; |
| 1294 |
getLocation = function getLocation(source) { |
| 1295 |
var _source$location = source.location; |
| 1296 |
var search = _source$location.search; |
| 1297 |
var hash = _source$location.hash; |
| 1298 |
var href = _source$location.href; |
| 1299 |
var origin = _source$location.origin; |
| 1300 |
var protocol = _source$location.protocol; |
| 1301 |
var host = _source$location.host; |
| 1302 |
var hostname = _source$location.hostname; |
| 1303 |
var port = _source$location.port; |
| 1304 |
var pathname = source.location.pathname; |
| 1305 |
if (!pathname && href && canUseDOM) pathname = new URL(href).pathname; |
| 1306 |
return { |
| 1307 |
pathname: encodeURI(decodeURI(pathname)), |
| 1308 |
search, |
| 1309 |
hash, |
| 1310 |
href, |
| 1311 |
origin, |
| 1312 |
protocol, |
| 1313 |
host, |
| 1314 |
hostname, |
| 1315 |
port, |
| 1316 |
state: source.history.state, |
| 1317 |
key: source.history.state && source.history.state.key || "initial" |
| 1318 |
}; |
| 1319 |
}; |
| 1320 |
createHistory = function createHistory(source, options) { |
| 1321 |
var listeners = []; |
| 1322 |
var location = getLocation(source); |
| 1323 |
var transitioning = false; |
| 1324 |
var resolveTransition = function resolveTransition() {}; |
| 1325 |
return { |
| 1326 |
get location() { |
| 1327 |
return location; |
| 1328 |
}, |
| 1329 |
get transitioning() { |
| 1330 |
return transitioning; |
| 1331 |
}, |
| 1332 |
_onTransitionComplete: function _onTransitionComplete() { |
| 1333 |
transitioning = false; |
| 1334 |
resolveTransition(); |
| 1335 |
}, |
| 1336 |
listen: function listen(listener) { |
| 1337 |
listeners.push(listener); |
| 1338 |
var popstateListener = function popstateListener() { |
| 1339 |
location = getLocation(source); |
| 1340 |
listener({ |
| 1341 |
location, |
| 1342 |
action: "POP" |
| 1343 |
}); |
| 1344 |
}; |
| 1345 |
source.addEventListener("popstate", popstateListener); |
| 1346 |
return function() { |
| 1347 |
source.removeEventListener("popstate", popstateListener); |
| 1348 |
listeners = listeners.filter(function(fn) { |
| 1349 |
return fn !== listener; |
| 1350 |
}); |
| 1351 |
}; |
| 1352 |
}, |
| 1353 |
navigate: function navigate(to) { |
| 1354 |
var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; |
| 1355 |
var state = _ref.state; |
| 1356 |
var _ref$replace = _ref.replace; |
| 1357 |
var replace = _ref$replace === void 0 ? false : _ref$replace; |
| 1358 |
if (typeof to === "number") source.history.go(to); |
| 1359 |
else { |
| 1360 |
state = _extends$2({}, state, { key: Date.now() + "" }); |
| 1361 |
try { |
| 1362 |
if (transitioning || replace) source.history.replaceState(state, null, to); |
| 1363 |
else source.history.pushState(state, null, to); |
| 1364 |
} catch (e) { |
| 1365 |
source.location[replace ? "replace" : "assign"](to); |
| 1366 |
} |
| 1367 |
} |
| 1368 |
location = getLocation(source); |
| 1369 |
transitioning = true; |
| 1370 |
var transition = new Promise(function(res) { |
| 1371 |
return resolveTransition = res; |
| 1372 |
}); |
| 1373 |
listeners.forEach(function(listener) { |
| 1374 |
return listener({ |
| 1375 |
location, |
| 1376 |
action: "PUSH" |
| 1377 |
}); |
| 1378 |
}); |
| 1379 |
return transition; |
| 1380 |
} |
| 1381 |
}; |
| 1382 |
}; |
| 1383 |
createMemorySource = function createMemorySource() { |
| 1384 |
var initialPath = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "/"; |
| 1385 |
var searchIndex = initialPath.indexOf("?"); |
| 1386 |
var initialLocation = { |
| 1387 |
pathname: searchIndex > -1 ? initialPath.substr(0, searchIndex) : initialPath, |
| 1388 |
search: searchIndex > -1 ? initialPath.substr(searchIndex) : "" |
| 1389 |
}; |
| 1390 |
var index = 0; |
| 1391 |
var stack = [initialLocation]; |
| 1392 |
var states = [null]; |
| 1393 |
return { |
| 1394 |
get location() { |
| 1395 |
return stack[index]; |
| 1396 |
}, |
| 1397 |
addEventListener: function addEventListener(name, fn) {}, |
| 1398 |
removeEventListener: function removeEventListener(name, fn) {}, |
| 1399 |
history: { |
| 1400 |
get entries() { |
| 1401 |
return stack; |
| 1402 |
}, |
| 1403 |
get index() { |
| 1404 |
return index; |
| 1405 |
}, |
| 1406 |
get state() { |
| 1407 |
return states[index]; |
| 1408 |
}, |
| 1409 |
pushState: function pushState(state, _, uri) { |
| 1410 |
var _uri$split = uri.split("?"); |
| 1411 |
var pathname = _uri$split[0]; |
| 1412 |
var _uri$split$ = _uri$split[1]; |
| 1413 |
var search = _uri$split$ === void 0 ? "" : _uri$split$; |
| 1414 |
index++; |
| 1415 |
stack.push({ |
| 1416 |
pathname, |
| 1417 |
search: search.length ? "?" + search : search |
| 1418 |
}); |
| 1419 |
states.push(state); |
| 1420 |
}, |
| 1421 |
replaceState: function replaceState(state, _, uri) { |
| 1422 |
var _uri$split2 = uri.split("?"); |
| 1423 |
var pathname = _uri$split2[0]; |
| 1424 |
var _uri$split2$ = _uri$split2[1]; |
| 1425 |
stack[index] = { |
| 1426 |
pathname, |
| 1427 |
search: _uri$split2$ === void 0 ? "" : _uri$split2$ |
| 1428 |
}; |
| 1429 |
states[index] = state; |
| 1430 |
}, |
| 1431 |
go: function go(to) { |
| 1432 |
var newIndex = index + to; |
| 1433 |
if (newIndex < 0 || newIndex > states.length - 1) return; |
| 1434 |
index = newIndex; |
| 1435 |
} |
| 1436 |
} |
| 1437 |
}; |
| 1438 |
}; |
| 1439 |
canUseDOM = !!(typeof window !== "undefined" && window.document && window.document.createElement); |
| 1440 |
globalHistory = createHistory(function getSource() { |
| 1441 |
return canUseDOM ? window : createMemorySource(); |
| 1442 |
}()); |
| 1443 |
navigate = globalHistory.navigate; |
| 1444 |
})); |
| 1445 |
|
| 1446 |
//#endregion |
| 1447 |
//#region node_modules/@reach/router/es/index.js |
| 1448 |
function _objectWithoutProperties$1(obj, keys) { |
| 1449 |
var target = {}; |
| 1450 |
for (var i in obj) { |
| 1451 |
if (keys.indexOf(i) >= 0) continue; |
| 1452 |
if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; |
| 1453 |
target[i] = obj[i]; |
| 1454 |
} |
| 1455 |
return target; |
| 1456 |
} |
| 1457 |
function _classCallCheck$1(instance, Constructor) { |
| 1458 |
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); |
| 1459 |
} |
| 1460 |
function _possibleConstructorReturn$1(self, call) { |
| 1461 |
if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 1462 |
return call && (typeof call === "object" || typeof call === "function") ? call : self; |
| 1463 |
} |
| 1464 |
function _inherits$1(subClass, superClass) { |
| 1465 |
if (typeof superClass !== "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); |
| 1466 |
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { |
| 1467 |
value: subClass, |
| 1468 |
enumerable: false, |
| 1469 |
writable: true, |
| 1470 |
configurable: true |
| 1471 |
} }); |
| 1472 |
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; |
| 1473 |
} |
| 1474 |
function RedirectRequest(uri) { |
| 1475 |
this.uri = uri; |
| 1476 |
} |
| 1477 |
var import_prop_types$56, import_browser, import_lib, _extends$1, createNamedContext, LocationContext, Location, LocationProvider, BaseContext, Router, RouterImpl, FocusContext, FocusHandler, initialRender, focusHandlerCount, FocusHandlerImpl, k$1, forwardRef$1, Link$10, isRedirect, redirectTo, RedirectImpl, Redirect, useLocation, useNavigate, stripSlashes, createRoute, shouldNavigate; |
| 1478 |
var init_es$1 = __esmMin((() => { |
| 1479 |
import_prop_types$56 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 1480 |
import_browser = /* @__PURE__ */ __toESM(require_browser()); |
| 1481 |
import_lib = /* @__PURE__ */ __toESM(require_lib()); |
| 1482 |
init_react_lifecycles_compat_es(); |
| 1483 |
init_utils$5(); |
| 1484 |
init_history(); |
| 1485 |
_extends$1 = Object.assign || function(target) { |
| 1486 |
for (var i = 1; i < arguments.length; i++) { |
| 1487 |
var source = arguments[i]; |
| 1488 |
for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key]; |
| 1489 |
} |
| 1490 |
return target; |
| 1491 |
}; |
| 1492 |
__name(_objectWithoutProperties$1, "_objectWithoutProperties"); |
| 1493 |
__name(_classCallCheck$1, "_classCallCheck"); |
| 1494 |
__name(_possibleConstructorReturn$1, "_possibleConstructorReturn"); |
| 1495 |
__name(_inherits$1, "_inherits"); |
| 1496 |
createNamedContext = function createNamedContext(name, defaultValue) { |
| 1497 |
var Ctx = (0, import_lib.default)(defaultValue); |
| 1498 |
Ctx.displayName = name; |
| 1499 |
return Ctx; |
| 1500 |
}; |
| 1501 |
LocationContext = createNamedContext("Location"); |
| 1502 |
Location = function Location(_ref) { |
| 1503 |
var children = _ref.children; |
| 1504 |
return react.default.createElement(LocationContext.Consumer, null, function(context) { |
| 1505 |
return context ? children(context) : react.default.createElement(LocationProvider, null, children); |
| 1506 |
}); |
| 1507 |
}; |
| 1508 |
LocationProvider = function(_React$Component) { |
| 1509 |
_inherits$1(LocationProvider, _React$Component); |
| 1510 |
function LocationProvider() { |
| 1511 |
var _temp; |
| 1512 |
var _this; |
| 1513 |
var _ret; |
| 1514 |
_classCallCheck$1(this, LocationProvider); |
| 1515 |
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 1516 |
return _ret = (_temp = (_this = _possibleConstructorReturn$1(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = { |
| 1517 |
context: _this.getContext(), |
| 1518 |
refs: { unlisten: null } |
| 1519 |
}, _temp), _possibleConstructorReturn$1(_this, _ret); |
| 1520 |
} |
| 1521 |
LocationProvider.prototype.getContext = function getContext() { |
| 1522 |
var _props$history = this.props.history; |
| 1523 |
return { |
| 1524 |
navigate: _props$history.navigate, |
| 1525 |
location: _props$history.location |
| 1526 |
}; |
| 1527 |
}; |
| 1528 |
LocationProvider.prototype.componentDidCatch = function componentDidCatch(error, info) { |
| 1529 |
if (isRedirect(error)) { |
| 1530 |
var _navigate = this.props.history.navigate; |
| 1531 |
_navigate(error.uri, { replace: true }); |
| 1532 |
} else throw error; |
| 1533 |
}; |
| 1534 |
LocationProvider.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) { |
| 1535 |
if (prevState.context.location !== this.state.context.location) this.props.history._onTransitionComplete(); |
| 1536 |
}; |
| 1537 |
LocationProvider.prototype.componentDidMount = function componentDidMount() { |
| 1538 |
var _this2 = this; |
| 1539 |
var refs = this.state.refs; |
| 1540 |
var history = this.props.history; |
| 1541 |
history._onTransitionComplete(); |
| 1542 |
refs.unlisten = history.listen(function() { |
| 1543 |
Promise.resolve().then(function() { |
| 1544 |
requestAnimationFrame(function() { |
| 1545 |
if (!_this2.unmounted) _this2.setState(function() { |
| 1546 |
return { context: _this2.getContext() }; |
| 1547 |
}); |
| 1548 |
}); |
| 1549 |
}); |
| 1550 |
}); |
| 1551 |
}; |
| 1552 |
LocationProvider.prototype.componentWillUnmount = function componentWillUnmount() { |
| 1553 |
var refs = this.state.refs; |
| 1554 |
this.unmounted = true; |
| 1555 |
refs.unlisten(); |
| 1556 |
}; |
| 1557 |
LocationProvider.prototype.render = function render() { |
| 1558 |
var context = this.state.context; |
| 1559 |
var children = this.props.children; |
| 1560 |
return react.default.createElement(LocationContext.Provider, { value: context }, typeof children === "function" ? children(context) : children || null); |
| 1561 |
}; |
| 1562 |
return LocationProvider; |
| 1563 |
}(react.default.Component); |
| 1564 |
LocationProvider.defaultProps = { history: globalHistory }; |
| 1565 |
LocationProvider.propTypes = { history: import_prop_types$56.default.object.isRequired }; |
| 1566 |
BaseContext = createNamedContext("Base", { |
| 1567 |
baseuri: "/", |
| 1568 |
basepath: "/" |
| 1569 |
}); |
| 1570 |
Router = function Router(props) { |
| 1571 |
return react.default.createElement(BaseContext.Consumer, null, function(baseContext) { |
| 1572 |
return react.default.createElement(Location, null, function(locationContext) { |
| 1573 |
return react.default.createElement(RouterImpl, _extends$1({}, baseContext, locationContext, props)); |
| 1574 |
}); |
| 1575 |
}); |
| 1576 |
}; |
| 1577 |
RouterImpl = function(_React$PureComponent) { |
| 1578 |
_inherits$1(RouterImpl, _React$PureComponent); |
| 1579 |
function RouterImpl() { |
| 1580 |
_classCallCheck$1(this, RouterImpl); |
| 1581 |
return _possibleConstructorReturn$1(this, _React$PureComponent.apply(this, arguments)); |
| 1582 |
} |
| 1583 |
RouterImpl.prototype.render = function render() { |
| 1584 |
var _props = this.props; |
| 1585 |
var location = _props.location; |
| 1586 |
var _navigate2 = _props.navigate; |
| 1587 |
var basepath = _props.basepath; |
| 1588 |
var primary = _props.primary; |
| 1589 |
var children = _props.children; |
| 1590 |
_props.baseuri; |
| 1591 |
var _props$component = _props.component; |
| 1592 |
var component = _props$component === void 0 ? "div" : _props$component; |
| 1593 |
var domProps = _objectWithoutProperties$1(_props, [ |
| 1594 |
"location", |
| 1595 |
"navigate", |
| 1596 |
"basepath", |
| 1597 |
"primary", |
| 1598 |
"children", |
| 1599 |
"baseuri", |
| 1600 |
"component" |
| 1601 |
]); |
| 1602 |
var routes = react.default.Children.toArray(children).reduce(function(array, child) { |
| 1603 |
var routes = createRoute(basepath)(child); |
| 1604 |
return array.concat(routes); |
| 1605 |
}, []); |
| 1606 |
var pathname = location.pathname; |
| 1607 |
var match = pick(routes, pathname); |
| 1608 |
if (match) { |
| 1609 |
var params = match.params; |
| 1610 |
var uri = match.uri; |
| 1611 |
var route = match.route; |
| 1612 |
var element = match.route.value; |
| 1613 |
basepath = route.default ? basepath : route.path.replace(/\*$/, ""); |
| 1614 |
var props = _extends$1({}, params, { |
| 1615 |
uri, |
| 1616 |
location, |
| 1617 |
navigate: function navigate(to, options) { |
| 1618 |
return _navigate2(resolve(to, uri), options); |
| 1619 |
} |
| 1620 |
}); |
| 1621 |
var clone = react.default.cloneElement(element, props, element.props.children ? react.default.createElement(Router, { |
| 1622 |
location, |
| 1623 |
primary |
| 1624 |
}, element.props.children) : void 0); |
| 1625 |
var FocusWrapper = primary ? FocusHandler : component; |
| 1626 |
var wrapperProps = primary ? _extends$1({ |
| 1627 |
uri, |
| 1628 |
location, |
| 1629 |
component |
| 1630 |
}, domProps) : domProps; |
| 1631 |
return react.default.createElement(BaseContext.Provider, { value: { |
| 1632 |
baseuri: uri, |
| 1633 |
basepath |
| 1634 |
} }, react.default.createElement(FocusWrapper, wrapperProps, clone)); |
| 1635 |
} else return null; |
| 1636 |
}; |
| 1637 |
return RouterImpl; |
| 1638 |
}(react.default.PureComponent); |
| 1639 |
RouterImpl.defaultProps = { primary: true }; |
| 1640 |
FocusContext = createNamedContext("Focus"); |
| 1641 |
FocusHandler = function FocusHandler(_ref3) { |
| 1642 |
var uri = _ref3.uri; |
| 1643 |
var location = _ref3.location; |
| 1644 |
var component = _ref3.component; |
| 1645 |
var domProps = _objectWithoutProperties$1(_ref3, [ |
| 1646 |
"uri", |
| 1647 |
"location", |
| 1648 |
"component" |
| 1649 |
]); |
| 1650 |
return react.default.createElement(FocusContext.Consumer, null, function(requestFocus) { |
| 1651 |
return react.default.createElement(FocusHandlerImpl, _extends$1({}, domProps, { |
| 1652 |
component, |
| 1653 |
requestFocus, |
| 1654 |
uri, |
| 1655 |
location |
| 1656 |
})); |
| 1657 |
}); |
| 1658 |
}; |
| 1659 |
initialRender = true; |
| 1660 |
focusHandlerCount = 0; |
| 1661 |
FocusHandlerImpl = function(_React$Component2) { |
| 1662 |
_inherits$1(FocusHandlerImpl, _React$Component2); |
| 1663 |
function FocusHandlerImpl() { |
| 1664 |
var _temp2; |
| 1665 |
var _this4; |
| 1666 |
var _ret2; |
| 1667 |
_classCallCheck$1(this, FocusHandlerImpl); |
| 1668 |
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2]; |
| 1669 |
return _ret2 = (_temp2 = (_this4 = _possibleConstructorReturn$1(this, _React$Component2.call.apply(_React$Component2, [this].concat(args))), _this4), _this4.state = {}, _this4.requestFocus = function(node) { |
| 1670 |
if (!_this4.state.shouldFocus && node) node.focus(); |
| 1671 |
}, _temp2), _possibleConstructorReturn$1(_this4, _ret2); |
| 1672 |
} |
| 1673 |
FocusHandlerImpl.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) { |
| 1674 |
if (prevState.uri == null) return _extends$1({ shouldFocus: true }, nextProps); |
| 1675 |
else { |
| 1676 |
var myURIChanged = nextProps.uri !== prevState.uri; |
| 1677 |
var navigatedUpToMe = prevState.location.pathname !== nextProps.location.pathname && nextProps.location.pathname === nextProps.uri; |
| 1678 |
return _extends$1({ shouldFocus: myURIChanged || navigatedUpToMe }, nextProps); |
| 1679 |
} |
| 1680 |
}; |
| 1681 |
FocusHandlerImpl.prototype.componentDidMount = function componentDidMount() { |
| 1682 |
focusHandlerCount++; |
| 1683 |
this.focus(); |
| 1684 |
}; |
| 1685 |
FocusHandlerImpl.prototype.componentWillUnmount = function componentWillUnmount() { |
| 1686 |
focusHandlerCount--; |
| 1687 |
if (focusHandlerCount === 0) initialRender = true; |
| 1688 |
}; |
| 1689 |
FocusHandlerImpl.prototype.componentDidUpdate = function componentDidUpdate(prevProps, prevState) { |
| 1690 |
if (prevProps.location !== this.props.location && this.state.shouldFocus) this.focus(); |
| 1691 |
}; |
| 1692 |
FocusHandlerImpl.prototype.focus = function focus() { |
| 1693 |
var requestFocus = this.props.requestFocus; |
| 1694 |
if (requestFocus) requestFocus(this.node); |
| 1695 |
else if (initialRender) initialRender = false; |
| 1696 |
else if (this.node) { |
| 1697 |
if (!this.node.contains(document.activeElement)) this.node.focus(); |
| 1698 |
} |
| 1699 |
}; |
| 1700 |
FocusHandlerImpl.prototype.render = function render() { |
| 1701 |
var _this5 = this; |
| 1702 |
var _props2 = this.props; |
| 1703 |
_props2.children; |
| 1704 |
var style = _props2.style; |
| 1705 |
_props2.requestFocus; |
| 1706 |
var _props2$component = _props2.component; |
| 1707 |
var Comp = _props2$component === void 0 ? "div" : _props2$component; |
| 1708 |
_props2.uri; |
| 1709 |
_props2.location; |
| 1710 |
var domProps = _objectWithoutProperties$1(_props2, [ |
| 1711 |
"children", |
| 1712 |
"style", |
| 1713 |
"requestFocus", |
| 1714 |
"component", |
| 1715 |
"uri", |
| 1716 |
"location" |
| 1717 |
]); |
| 1718 |
return react.default.createElement(Comp, _extends$1({ |
| 1719 |
style: _extends$1({ outline: "none" }, style), |
| 1720 |
tabIndex: "-1", |
| 1721 |
ref: function ref(n) { |
| 1722 |
return _this5.node = n; |
| 1723 |
} |
| 1724 |
}, domProps), react.default.createElement(FocusContext.Provider, { value: this.requestFocus }, this.props.children)); |
| 1725 |
}; |
| 1726 |
return FocusHandlerImpl; |
| 1727 |
}(react.default.Component); |
| 1728 |
polyfill(FocusHandlerImpl); |
| 1729 |
k$1 = function k() {}; |
| 1730 |
forwardRef$1 = react.default.forwardRef; |
| 1731 |
if (typeof forwardRef$1 === "undefined") forwardRef$1 = function forwardRef(C) { |
| 1732 |
return C; |
| 1733 |
}; |
| 1734 |
Link$10 = forwardRef$1(function(_ref4, ref) { |
| 1735 |
var innerRef = _ref4.innerRef; |
| 1736 |
var props = _objectWithoutProperties$1(_ref4, ["innerRef"]); |
| 1737 |
return react.default.createElement(BaseContext.Consumer, null, function(_ref5) { |
| 1738 |
_ref5.basepath; |
| 1739 |
var baseuri = _ref5.baseuri; |
| 1740 |
return react.default.createElement(Location, null, function(_ref6) { |
| 1741 |
var location = _ref6.location; |
| 1742 |
var navigate = _ref6.navigate; |
| 1743 |
var to = props.to; |
| 1744 |
var state = props.state; |
| 1745 |
var replace = props.replace; |
| 1746 |
var _props$getProps = props.getProps; |
| 1747 |
var getProps = _props$getProps === void 0 ? k$1 : _props$getProps; |
| 1748 |
var anchorProps = _objectWithoutProperties$1(props, [ |
| 1749 |
"to", |
| 1750 |
"state", |
| 1751 |
"replace", |
| 1752 |
"getProps" |
| 1753 |
]); |
| 1754 |
var href = resolve(to, baseuri); |
| 1755 |
var encodedHref = encodeURI(href); |
| 1756 |
var isCurrent = location.pathname === encodedHref; |
| 1757 |
var isPartiallyCurrent = startsWith(location.pathname, encodedHref); |
| 1758 |
return react.default.createElement("a", _extends$1({ |
| 1759 |
ref: ref || innerRef, |
| 1760 |
"aria-current": isCurrent ? "page" : void 0 |
| 1761 |
}, anchorProps, getProps({ |
| 1762 |
isCurrent, |
| 1763 |
isPartiallyCurrent, |
| 1764 |
href, |
| 1765 |
location |
| 1766 |
}), { |
| 1767 |
href, |
| 1768 |
onClick: function onClick(event) { |
| 1769 |
if (anchorProps.onClick) anchorProps.onClick(event); |
| 1770 |
if (shouldNavigate(event)) { |
| 1771 |
event.preventDefault(); |
| 1772 |
var shouldReplace = replace; |
| 1773 |
if (typeof replace !== "boolean" && isCurrent) { |
| 1774 |
var _location$state = _extends$1({}, location.state); |
| 1775 |
_location$state.key; |
| 1776 |
var restState = _objectWithoutProperties$1(_location$state, ["key"]); |
| 1777 |
shouldReplace = shallowCompare(_extends$1({}, state), restState); |
| 1778 |
} |
| 1779 |
navigate(href, { |
| 1780 |
state, |
| 1781 |
replace: shouldReplace |
| 1782 |
}); |
| 1783 |
} |
| 1784 |
} |
| 1785 |
})); |
| 1786 |
}); |
| 1787 |
}); |
| 1788 |
}); |
| 1789 |
Link$10.displayName = "Link"; |
| 1790 |
Link$10.propTypes = { to: import_prop_types$56.default.string.isRequired }; |
| 1791 |
isRedirect = function isRedirect(o) { |
| 1792 |
return o instanceof RedirectRequest; |
| 1793 |
}; |
| 1794 |
redirectTo = function redirectTo(to) { |
| 1795 |
throw new RedirectRequest(to); |
| 1796 |
}; |
| 1797 |
RedirectImpl = function(_React$Component3) { |
| 1798 |
_inherits$1(RedirectImpl, _React$Component3); |
| 1799 |
function RedirectImpl() { |
| 1800 |
_classCallCheck$1(this, RedirectImpl); |
| 1801 |
return _possibleConstructorReturn$1(this, _React$Component3.apply(this, arguments)); |
| 1802 |
} |
| 1803 |
RedirectImpl.prototype.componentDidMount = function componentDidMount() { |
| 1804 |
var _props3 = this.props; |
| 1805 |
var navigate = _props3.navigate; |
| 1806 |
var to = _props3.to; |
| 1807 |
_props3.from; |
| 1808 |
var _props3$replace = _props3.replace; |
| 1809 |
var replace = _props3$replace === void 0 ? true : _props3$replace; |
| 1810 |
var state = _props3.state; |
| 1811 |
_props3.noThrow; |
| 1812 |
var baseuri = _props3.baseuri; |
| 1813 |
var props = _objectWithoutProperties$1(_props3, [ |
| 1814 |
"navigate", |
| 1815 |
"to", |
| 1816 |
"from", |
| 1817 |
"replace", |
| 1818 |
"state", |
| 1819 |
"noThrow", |
| 1820 |
"baseuri" |
| 1821 |
]); |
| 1822 |
Promise.resolve().then(function() { |
| 1823 |
navigate(insertParams(resolve(to, baseuri), props), { |
| 1824 |
replace, |
| 1825 |
state |
| 1826 |
}); |
| 1827 |
}); |
| 1828 |
}; |
| 1829 |
RedirectImpl.prototype.render = function render() { |
| 1830 |
var _props4 = this.props; |
| 1831 |
_props4.navigate; |
| 1832 |
var to = _props4.to; |
| 1833 |
_props4.from; |
| 1834 |
_props4.replace; |
| 1835 |
_props4.state; |
| 1836 |
var noThrow = _props4.noThrow; |
| 1837 |
var baseuri = _props4.baseuri; |
| 1838 |
var props = _objectWithoutProperties$1(_props4, [ |
| 1839 |
"navigate", |
| 1840 |
"to", |
| 1841 |
"from", |
| 1842 |
"replace", |
| 1843 |
"state", |
| 1844 |
"noThrow", |
| 1845 |
"baseuri" |
| 1846 |
]); |
| 1847 |
var resolvedTo = resolve(to, baseuri); |
| 1848 |
if (!noThrow) redirectTo(insertParams(resolvedTo, props)); |
| 1849 |
return null; |
| 1850 |
}; |
| 1851 |
return RedirectImpl; |
| 1852 |
}(react.default.Component); |
| 1853 |
Redirect = function Redirect(props) { |
| 1854 |
return react.default.createElement(BaseContext.Consumer, null, function(_ref7) { |
| 1855 |
var baseuri = _ref7.baseuri; |
| 1856 |
return react.default.createElement(Location, null, function(locationContext) { |
| 1857 |
return react.default.createElement(RedirectImpl, _extends$1({}, locationContext, { baseuri }, props)); |
| 1858 |
}); |
| 1859 |
}); |
| 1860 |
}; |
| 1861 |
Redirect.propTypes = { |
| 1862 |
from: import_prop_types$56.default.string, |
| 1863 |
to: import_prop_types$56.default.string.isRequired |
| 1864 |
}; |
| 1865 |
useLocation = function useLocation() { |
| 1866 |
var context = (0, react.useContext)(LocationContext); |
| 1867 |
if (!context) throw new Error("useLocation hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router"); |
| 1868 |
return context.location; |
| 1869 |
}; |
| 1870 |
useNavigate = function useNavigate() { |
| 1871 |
var context = (0, react.useContext)(LocationContext); |
| 1872 |
if (!context) throw new Error("useNavigate hook was used but a LocationContext.Provider was not found in the parent tree. Make sure this is used in a component that is a child of Router"); |
| 1873 |
return context.navigate; |
| 1874 |
}; |
| 1875 |
stripSlashes = function stripSlashes(str) { |
| 1876 |
return str.replace(/(^\/+|\/+$)/g, ""); |
| 1877 |
}; |
| 1878 |
createRoute = function createRoute(basepath) { |
| 1879 |
return function(element) { |
| 1880 |
if (!element) return null; |
| 1881 |
if (element.type === react.default.Fragment && element.props.children) return react.default.Children.map(element.props.children, createRoute(basepath)); |
| 1882 |
!(element.props.path || element.props.default || element.type === Redirect) && (0, import_browser.default)(false, "<Router>: Children of <Router> must have a `path` or `default` prop, or be a `<Redirect>`. None found on element type `" + element.type + "`"); |
| 1883 |
element.type === Redirect && (!element.props.from || !element.props.to) && (0, import_browser.default)(false, "<Redirect from=\"" + element.props.from + "\" to=\"" + element.props.to + "\"/> requires both \"from\" and \"to\" props when inside a <Router>."); |
| 1884 |
element.type === Redirect && !validateRedirect(element.props.from, element.props.to) && (0, import_browser.default)(false, "<Redirect from=\"" + element.props.from + " to=\"" + element.props.to + "\"/> has mismatched dynamic segments, ensure both paths have the exact same dynamic segments."); |
| 1885 |
if (element.props.default) return { |
| 1886 |
value: element, |
| 1887 |
default: true |
| 1888 |
}; |
| 1889 |
var elementPath = element.type === Redirect ? element.props.from : element.props.path; |
| 1890 |
var path = elementPath === "/" ? basepath : stripSlashes(basepath) + "/" + stripSlashes(elementPath); |
| 1891 |
return { |
| 1892 |
value: element, |
| 1893 |
default: element.props.default, |
| 1894 |
path: element.props.children ? stripSlashes(path) + "/*" : path |
| 1895 |
}; |
| 1896 |
}; |
| 1897 |
}; |
| 1898 |
shouldNavigate = function shouldNavigate(event) { |
| 1899 |
return !event.defaultPrevented && event.button === 0 && !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); |
| 1900 |
}; |
| 1901 |
})); |
| 1902 |
|
| 1903 |
//#endregion |
| 1904 |
//#region node_modules/reach-router-hash-history/index.js |
| 1905 |
init_es$1(); |
| 1906 |
function getHashPath() { |
| 1907 |
const href = window.location.href; |
| 1908 |
const hashIndex = href.indexOf("#"); |
| 1909 |
return hashIndex === -1 ? "" : href.substring(hashIndex + 1); |
| 1910 |
} |
| 1911 |
function pushHashPath(path) { |
| 1912 |
window.location.hash = "#" + path; |
| 1913 |
} |
| 1914 |
function replaceHashPath(path) { |
| 1915 |
const hashIndex = window.location.href.indexOf("#"); |
| 1916 |
window.location.replace(window.location.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + "#" + path); |
| 1917 |
} |
| 1918 |
var createHashSource = (initialPathname = "/") => { |
| 1919 |
let index = 0; |
| 1920 |
return { |
| 1921 |
get location() { |
| 1922 |
return { |
| 1923 |
pathname: getHashPath(), |
| 1924 |
search: "" |
| 1925 |
}; |
| 1926 |
}, |
| 1927 |
addEventListener(name, fn) { |
| 1928 |
if (name === "popstate") window.addEventListener("hashchange", fn); |
| 1929 |
}, |
| 1930 |
removeEventListener(name, fn) { |
| 1931 |
if (name === "popstate") window.addEventListener("hashchange", fn); |
| 1932 |
}, |
| 1933 |
history: { |
| 1934 |
get entries() { |
| 1935 |
return [{ |
| 1936 |
pathname: getHashPath(), |
| 1937 |
search: "" |
| 1938 |
}]; |
| 1939 |
}, |
| 1940 |
get index() { |
| 1941 |
return index; |
| 1942 |
}, |
| 1943 |
get state() {}, |
| 1944 |
pushState(state, _, uri) { |
| 1945 |
pushHashPath(uri); |
| 1946 |
}, |
| 1947 |
replaceState(state, _, uri) { |
| 1948 |
replaceHashPath(uri); |
| 1949 |
} |
| 1950 |
} |
| 1951 |
}; |
| 1952 |
}; |
| 1953 |
|
| 1954 |
//#endregion |
| 1955 |
//#region node_modules/@babel/runtime/helpers/esm/extends.js |
| 1956 |
function _extends() { |
| 1957 |
return _extends = Object.assign ? Object.assign.bind() : function(n) { |
| 1958 |
for (var e = 1; e < arguments.length; e++) { |
| 1959 |
var t = arguments[e]; |
| 1960 |
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); |
| 1961 |
} |
| 1962 |
return n; |
| 1963 |
}, _extends.apply(null, arguments); |
| 1964 |
} |
| 1965 |
var init_extends = __esmMin((() => {})); |
| 1966 |
|
| 1967 |
//#endregion |
| 1968 |
//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js |
| 1969 |
function _arrayLikeToArray$5(r, a) { |
| 1970 |
(null == a || a > r.length) && (a = r.length); |
| 1971 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 1972 |
return n; |
| 1973 |
} |
| 1974 |
var init_arrayLikeToArray = __esmMin((() => { |
| 1975 |
__name(_arrayLikeToArray$5, "_arrayLikeToArray"); |
| 1976 |
})); |
| 1977 |
|
| 1978 |
//#endregion |
| 1979 |
//#region node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js |
| 1980 |
function _arrayWithoutHoles(r) { |
| 1981 |
if (Array.isArray(r)) return _arrayLikeToArray$5(r); |
| 1982 |
} |
| 1983 |
var init_arrayWithoutHoles = __esmMin((() => { |
| 1984 |
init_arrayLikeToArray(); |
| 1985 |
})); |
| 1986 |
|
| 1987 |
//#endregion |
| 1988 |
//#region node_modules/@babel/runtime/helpers/esm/iterableToArray.js |
| 1989 |
function _iterableToArray(r) { |
| 1990 |
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); |
| 1991 |
} |
| 1992 |
var init_iterableToArray = __esmMin((() => {})); |
| 1993 |
|
| 1994 |
//#endregion |
| 1995 |
//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
| 1996 |
function _unsupportedIterableToArray$5(r, a) { |
| 1997 |
if (r) { |
| 1998 |
if ("string" == typeof r) return _arrayLikeToArray$5(r, a); |
| 1999 |
var t = {}.toString.call(r).slice(8, -1); |
| 2000 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$5(r, a) : void 0; |
| 2001 |
} |
| 2002 |
} |
| 2003 |
var init_unsupportedIterableToArray = __esmMin((() => { |
| 2004 |
init_arrayLikeToArray(); |
| 2005 |
__name(_unsupportedIterableToArray$5, "_unsupportedIterableToArray"); |
| 2006 |
})); |
| 2007 |
|
| 2008 |
//#endregion |
| 2009 |
//#region node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js |
| 2010 |
function _nonIterableSpread() { |
| 2011 |
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 2012 |
} |
| 2013 |
var init_nonIterableSpread = __esmMin((() => {})); |
| 2014 |
|
| 2015 |
//#endregion |
| 2016 |
//#region node_modules/@babel/runtime/helpers/esm/toConsumableArray.js |
| 2017 |
function _toConsumableArray(r) { |
| 2018 |
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray$5(r) || _nonIterableSpread(); |
| 2019 |
} |
| 2020 |
var init_toConsumableArray = __esmMin((() => { |
| 2021 |
init_arrayWithoutHoles(); |
| 2022 |
init_iterableToArray(); |
| 2023 |
init_unsupportedIterableToArray(); |
| 2024 |
init_nonIterableSpread(); |
| 2025 |
})); |
| 2026 |
|
| 2027 |
//#endregion |
| 2028 |
//#region node_modules/@babel/runtime/helpers/esm/typeof.js |
| 2029 |
function _typeof$1(o) { |
| 2030 |
"@babel/helpers - typeof"; |
| 2031 |
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 2032 |
return typeof o; |
| 2033 |
} : function(o) { |
| 2034 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 2035 |
}, _typeof$1(o); |
| 2036 |
} |
| 2037 |
var init_typeof$1 = __esmMin((() => { |
| 2038 |
__name(_typeof$1, "_typeof"); |
| 2039 |
})); |
| 2040 |
|
| 2041 |
//#endregion |
| 2042 |
//#region app/assets/js/utils/utils.js |
| 2043 |
var pxToRem, arrayToClassName, isOneOf, arrayToObjectByKey, htmlDecodeTextContent; |
| 2044 |
var init_utils$4 = __esmMin((() => { |
| 2045 |
init_typeof$1(); |
| 2046 |
pxToRem = function pxToRem(pixels) { |
| 2047 |
if (!pixels) return; |
| 2048 |
else if ("string" !== typeof pixels) pixels = pixels.toString(); |
| 2049 |
return pixels.split(" ").map(function(value) { |
| 2050 |
return "".concat(value * .0625, "rem"); |
| 2051 |
}).join(" "); |
| 2052 |
}; |
| 2053 |
arrayToClassName = function arrayToClassName(array, action) { |
| 2054 |
return array.filter(function(item) { |
| 2055 |
return "object" === _typeof$1(item) ? Object.entries(item)[0][1] : item; |
| 2056 |
}).map(function(item) { |
| 2057 |
var value = "object" === _typeof$1(item) ? Object.entries(item)[0][0] : item; |
| 2058 |
return action ? action(value) : value; |
| 2059 |
}).join(" "); |
| 2060 |
}; |
| 2061 |
isOneOf = function isOneOf(filetype, filetypeOptions) { |
| 2062 |
return filetypeOptions.some(function(type) { |
| 2063 |
return filetype.includes(type); |
| 2064 |
}); |
| 2065 |
}; |
| 2066 |
arrayToObjectByKey = function arrayToObjectByKey(array, key) { |
| 2067 |
var finalObject = {}; |
| 2068 |
array.forEach(function(item) { |
| 2069 |
return finalObject[item[key]] = item; |
| 2070 |
}); |
| 2071 |
return finalObject; |
| 2072 |
}; |
| 2073 |
htmlDecodeTextContent = function htmlDecodeTextContent(input) { |
| 2074 |
return new DOMParser().parseFromString(input, "text/html").documentElement.textContent; |
| 2075 |
}; |
| 2076 |
})); |
| 2077 |
|
| 2078 |
//#endregion |
| 2079 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/assets/js/ui/grid/grid.scss |
| 2080 |
init_extends(); |
| 2081 |
init_toConsumableArray(); |
| 2082 |
init_utils$4(); |
| 2083 |
|
| 2084 |
//#endregion |
| 2085 |
//#region app/assets/js/ui/grid/grid.js |
| 2086 |
var import_prop_types$55 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 2087 |
function Grid$14(props) { |
| 2088 |
var propsMap = { |
| 2089 |
direction: "--direction{{ -VALUE }}", |
| 2090 |
justify: "--justify{{ -VALUE }}", |
| 2091 |
alignContent: "--align-content{{ -VALUE }}", |
| 2092 |
alignItems: "--align-items{{ -VALUE }}", |
| 2093 |
container: "-container", |
| 2094 |
item: "-item", |
| 2095 |
noWrap: "-container--no-wrap", |
| 2096 |
wrapReverse: "-container--wrap-reverse", |
| 2097 |
zeroMinWidth: "-item--zero-min-width", |
| 2098 |
spacing: "-container--spacing", |
| 2099 |
xs: "-item-xs{{ -VALUE }}", |
| 2100 |
sm: "-item-sm{{ -VALUE }}", |
| 2101 |
md: "-item-md{{ -VALUE }}", |
| 2102 |
lg: "-item-lg{{ -VALUE }}", |
| 2103 |
xl: "-item-xl{{ -VALUE }}", |
| 2104 |
xxl: "-item-xxl{{ -VALUE }}" |
| 2105 |
}; |
| 2106 |
var getStyle = function getStyle() { |
| 2107 |
return isValidPropValue(props.spacing) ? { "--grid-spacing-gutter": pxToRem(props.spacing) } : {}; |
| 2108 |
}; |
| 2109 |
var classes = [getBaseClassName(), props.className].concat(_toConsumableArray(getPropsClasses(propsMap, props))); |
| 2110 |
return /*#__PURE__*/ react.default.createElement("div", { |
| 2111 |
style: getStyle(), |
| 2112 |
className: arrayToClassName(classes) |
| 2113 |
}, props.children); |
| 2114 |
} |
| 2115 |
__name(Grid$14, "Grid"); |
| 2116 |
function getPropsClasses(propsMap, props) { |
| 2117 |
var classes = []; |
| 2118 |
for (var prop in propsMap) if (props[prop]) { |
| 2119 |
var propValue = isValidPropValue(props[prop]) ? props[prop] : ""; |
| 2120 |
classes.push(getBaseClassName() + renderPropValueBrackets(propsMap[prop], propValue)); |
| 2121 |
} |
| 2122 |
return classes; |
| 2123 |
} |
| 2124 |
function renderPropValueBrackets(propClass, propValue) { |
| 2125 |
var brackets = propClass.match(/{{.*?}}/); |
| 2126 |
if (brackets) { |
| 2127 |
var bracketsValue = propValue ? brackets[0].replace(/[{ }]/g, "").replace(/value/i, propValue) : ""; |
| 2128 |
propClass = propClass.replace(brackets[0], bracketsValue); |
| 2129 |
} |
| 2130 |
return propClass; |
| 2131 |
} |
| 2132 |
function getBaseClassName() { |
| 2133 |
return "eps-grid"; |
| 2134 |
} |
| 2135 |
function isValidPropValue(propValue) { |
| 2136 |
return propValue && "boolean" !== typeof propValue; |
| 2137 |
} |
| 2138 |
Grid$14.propTypes = { |
| 2139 |
className: import_prop_types$55.default.string, |
| 2140 |
direction: import_prop_types$55.default.oneOf([ |
| 2141 |
"row", |
| 2142 |
"column", |
| 2143 |
"row-reverse", |
| 2144 |
"column-reverse" |
| 2145 |
]), |
| 2146 |
justify: import_prop_types$55.default.oneOf([ |
| 2147 |
"start", |
| 2148 |
"center", |
| 2149 |
"end", |
| 2150 |
"space-between", |
| 2151 |
"space-evenly", |
| 2152 |
"space-around", |
| 2153 |
"stretch" |
| 2154 |
]), |
| 2155 |
alignContent: import_prop_types$55.default.oneOf([ |
| 2156 |
"start", |
| 2157 |
"center", |
| 2158 |
"end", |
| 2159 |
"space-between", |
| 2160 |
"stretch" |
| 2161 |
]), |
| 2162 |
alignItems: import_prop_types$55.default.oneOf([ |
| 2163 |
"start", |
| 2164 |
"center", |
| 2165 |
"end", |
| 2166 |
"baseline", |
| 2167 |
"stretch" |
| 2168 |
]), |
| 2169 |
container: import_prop_types$55.default.bool, |
| 2170 |
item: import_prop_types$55.default.bool, |
| 2171 |
noWrap: import_prop_types$55.default.bool, |
| 2172 |
wrapReverse: import_prop_types$55.default.bool, |
| 2173 |
zeroMinWidth: import_prop_types$55.default.bool, |
| 2174 |
spacing: import_prop_types$55.default.number, |
| 2175 |
xs: import_prop_types$55.default.oneOfType([import_prop_types$55.default.number, import_prop_types$55.default.bool]), |
| 2176 |
sm: import_prop_types$55.default.oneOfType([import_prop_types$55.default.number, import_prop_types$55.default.bool]), |
| 2177 |
md: import_prop_types$55.default.oneOfType([import_prop_types$55.default.number, import_prop_types$55.default.bool]), |
| 2178 |
lg: import_prop_types$55.default.oneOfType([import_prop_types$55.default.number, import_prop_types$55.default.bool]), |
| 2179 |
xl: import_prop_types$55.default.oneOfType([import_prop_types$55.default.number, import_prop_types$55.default.bool]), |
| 2180 |
xxl: import_prop_types$55.default.oneOfType([import_prop_types$55.default.number, import_prop_types$55.default.bool]), |
| 2181 |
children: import_prop_types$55.default.any.isRequired |
| 2182 |
}; |
| 2183 |
Grid$14.defaultProps = { className: "" }; |
| 2184 |
|
| 2185 |
//#endregion |
| 2186 |
//#region app/assets/js/hooks/use-action.js |
| 2187 |
function useAction() { |
| 2188 |
return { |
| 2189 |
backToDashboard: function backToDashboard() { |
| 2190 |
if (window.top === window) window.top.location = elementorAppConfig.admin_url; |
| 2191 |
else window.top.$e.run("app/close"); |
| 2192 |
}, |
| 2193 |
backToReferrer: function backToReferrer() { |
| 2194 |
if (window.top === window) window.top.location = elementorAppConfig.return_url.includes(elementorAppConfig.login_url) ? elementorAppConfig.admin_url : elementorAppConfig.return_url; |
| 2195 |
else window.top.$e.run("app/close"); |
| 2196 |
} |
| 2197 |
}; |
| 2198 |
} |
| 2199 |
var init_use_action = __esmMin((() => {})); |
| 2200 |
|
| 2201 |
//#endregion |
| 2202 |
//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js |
| 2203 |
function _classCallCheck(a, n) { |
| 2204 |
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); |
| 2205 |
} |
| 2206 |
var init_classCallCheck = __esmMin((() => {})); |
| 2207 |
|
| 2208 |
//#endregion |
| 2209 |
//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js |
| 2210 |
function toPrimitive$1(t, r) { |
| 2211 |
if ("object" != _typeof$1(t) || !t) return t; |
| 2212 |
var e = t[Symbol.toPrimitive]; |
| 2213 |
if (void 0 !== e) { |
| 2214 |
var i = e.call(t, r || "default"); |
| 2215 |
if ("object" != _typeof$1(i)) return i; |
| 2216 |
throw new TypeError("@@toPrimitive must return a primitive value."); |
| 2217 |
} |
| 2218 |
return ("string" === r ? String : Number)(t); |
| 2219 |
} |
| 2220 |
var init_toPrimitive$1 = __esmMin((() => { |
| 2221 |
init_typeof$1(); |
| 2222 |
__name(toPrimitive$1, "toPrimitive"); |
| 2223 |
})); |
| 2224 |
|
| 2225 |
//#endregion |
| 2226 |
//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js |
| 2227 |
function toPropertyKey$1(t) { |
| 2228 |
var i = toPrimitive$1(t, "string"); |
| 2229 |
return "symbol" == _typeof$1(i) ? i : i + ""; |
| 2230 |
} |
| 2231 |
var init_toPropertyKey$1 = __esmMin((() => { |
| 2232 |
init_typeof$1(); |
| 2233 |
init_toPrimitive$1(); |
| 2234 |
__name(toPropertyKey$1, "toPropertyKey"); |
| 2235 |
})); |
| 2236 |
|
| 2237 |
//#endregion |
| 2238 |
//#region node_modules/@babel/runtime/helpers/esm/createClass.js |
| 2239 |
function _defineProperties(e, r) { |
| 2240 |
for (var t = 0; t < r.length; t++) { |
| 2241 |
var o = r[t]; |
| 2242 |
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey$1(o.key), o); |
| 2243 |
} |
| 2244 |
} |
| 2245 |
function _createClass(e, r, t) { |
| 2246 |
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; |
| 2247 |
} |
| 2248 |
var init_createClass = __esmMin((() => { |
| 2249 |
init_toPropertyKey$1(); |
| 2250 |
})); |
| 2251 |
|
| 2252 |
//#endregion |
| 2253 |
//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js |
| 2254 |
function _assertThisInitialized(e) { |
| 2255 |
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 2256 |
return e; |
| 2257 |
} |
| 2258 |
var init_assertThisInitialized = __esmMin((() => {})); |
| 2259 |
|
| 2260 |
//#endregion |
| 2261 |
//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js |
| 2262 |
function _possibleConstructorReturn(t, e) { |
| 2263 |
if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e; |
| 2264 |
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); |
| 2265 |
return _assertThisInitialized(t); |
| 2266 |
} |
| 2267 |
var init_possibleConstructorReturn = __esmMin((() => { |
| 2268 |
init_typeof$1(); |
| 2269 |
init_assertThisInitialized(); |
| 2270 |
})); |
| 2271 |
|
| 2272 |
//#endregion |
| 2273 |
//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js |
| 2274 |
function _getPrototypeOf(t) { |
| 2275 |
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { |
| 2276 |
return t.__proto__ || Object.getPrototypeOf(t); |
| 2277 |
}, _getPrototypeOf(t); |
| 2278 |
} |
| 2279 |
var init_getPrototypeOf = __esmMin((() => {})); |
| 2280 |
|
| 2281 |
//#endregion |
| 2282 |
//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js |
| 2283 |
function _superPropBase(t, o) { |
| 2284 |
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); |
| 2285 |
return t; |
| 2286 |
} |
| 2287 |
var init_superPropBase = __esmMin((() => { |
| 2288 |
init_getPrototypeOf(); |
| 2289 |
})); |
| 2290 |
|
| 2291 |
//#endregion |
| 2292 |
//#region node_modules/@babel/runtime/helpers/esm/get.js |
| 2293 |
function _get() { |
| 2294 |
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { |
| 2295 |
var p = _superPropBase(e, t); |
| 2296 |
if (p) { |
| 2297 |
var n = Object.getOwnPropertyDescriptor(p, t); |
| 2298 |
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; |
| 2299 |
} |
| 2300 |
}, _get.apply(null, arguments); |
| 2301 |
} |
| 2302 |
var init_get = __esmMin((() => { |
| 2303 |
init_superPropBase(); |
| 2304 |
})); |
| 2305 |
|
| 2306 |
//#endregion |
| 2307 |
//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js |
| 2308 |
function _setPrototypeOf(t, e) { |
| 2309 |
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { |
| 2310 |
return t.__proto__ = e, t; |
| 2311 |
}, _setPrototypeOf(t, e); |
| 2312 |
} |
| 2313 |
var init_setPrototypeOf = __esmMin((() => {})); |
| 2314 |
|
| 2315 |
//#endregion |
| 2316 |
//#region node_modules/@babel/runtime/helpers/esm/inherits.js |
| 2317 |
function _inherits(t, e) { |
| 2318 |
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); |
| 2319 |
t.prototype = Object.create(e && e.prototype, { constructor: { |
| 2320 |
value: t, |
| 2321 |
writable: !0, |
| 2322 |
configurable: !0 |
| 2323 |
} }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); |
| 2324 |
} |
| 2325 |
var init_inherits = __esmMin((() => { |
| 2326 |
init_setPrototypeOf(); |
| 2327 |
})); |
| 2328 |
|
| 2329 |
//#endregion |
| 2330 |
//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js |
| 2331 |
function _defineProperty$1(e, r, t) { |
| 2332 |
return (r = toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { |
| 2333 |
value: t, |
| 2334 |
enumerable: !0, |
| 2335 |
configurable: !0, |
| 2336 |
writable: !0 |
| 2337 |
}) : e[r] = t, e; |
| 2338 |
} |
| 2339 |
var init_defineProperty$1 = __esmMin((() => { |
| 2340 |
init_toPropertyKey$1(); |
| 2341 |
__name(_defineProperty$1, "_defineProperty"); |
| 2342 |
})); |
| 2343 |
|
| 2344 |
//#endregion |
| 2345 |
//#region app/assets/js/ui/popover-dialog/popover-dialog.js |
| 2346 |
function PopoverDialog(props) { |
| 2347 |
var targetRef = props.targetRef; |
| 2348 |
var offsetTop = props.offsetTop; |
| 2349 |
var offsetLeft = props.offsetLeft; |
| 2350 |
var wrapperClass = props.wrapperClass; |
| 2351 |
var trigger = props.trigger; |
| 2352 |
var hideAfter = props.hideAfter; |
| 2353 |
var popoverRef = (0, react.useCallback)(function(popoverEl) { |
| 2354 |
var target = targetRef === null || targetRef === void 0 ? void 0 : targetRef.current; |
| 2355 |
if (!target || !popoverEl) return; |
| 2356 |
/** |
| 2357 |
* Show Popover |
| 2358 |
*/ |
| 2359 |
var showPopover = function showPopover() { |
| 2360 |
popoverEl.style.display = "block"; |
| 2361 |
popoverEl.setAttribute("aria-expanded", true); |
| 2362 |
var targetRect = target.getBoundingClientRect(); |
| 2363 |
var popoverRect = popoverEl.getBoundingClientRect(); |
| 2364 |
var widthDifference = popoverRect.width - targetRect.width; |
| 2365 |
popoverEl.style.top = targetRect.bottom + offsetTop + "px"; |
| 2366 |
popoverEl.style.left = targetRect.left - widthDifference / 2 - offsetLeft + "px"; |
| 2367 |
popoverEl.style.setProperty("--popover-arrow-offset-end", (popoverRect.width - 16) / 2 + "px"); |
| 2368 |
}; |
| 2369 |
/** |
| 2370 |
* Hide Popover |
| 2371 |
*/ |
| 2372 |
var hidePopover = function hidePopover() { |
| 2373 |
popoverEl.style.display = "none"; |
| 2374 |
popoverEl.setAttribute("aria-expanded", false); |
| 2375 |
}; |
| 2376 |
/** |
| 2377 |
* Handle the Popover's hover functionality |
| 2378 |
*/ |
| 2379 |
var handlePopoverHover = function handlePopoverHover() { |
| 2380 |
var hideOnMouseOut = true; |
| 2381 |
var timeOut = null; |
| 2382 |
target.addEventListener("mouseover", function() { |
| 2383 |
hideOnMouseOut = true; |
| 2384 |
showPopover(); |
| 2385 |
}); |
| 2386 |
target.addEventListener("mouseleave", function() { |
| 2387 |
timeOut = setTimeout(function() { |
| 2388 |
if (hideOnMouseOut) { |
| 2389 |
if ("block" === popoverEl.style.display) hidePopover(); |
| 2390 |
} |
| 2391 |
}, hideAfter); |
| 2392 |
}); |
| 2393 |
popoverEl.addEventListener("mouseover", function() { |
| 2394 |
hideOnMouseOut = false; |
| 2395 |
if (timeOut) { |
| 2396 |
clearTimeout(timeOut); |
| 2397 |
timeOut = null; |
| 2398 |
} |
| 2399 |
}); |
| 2400 |
popoverEl.addEventListener("mouseleave", function() { |
| 2401 |
timeOut = setTimeout(function() { |
| 2402 |
if (hideOnMouseOut) { |
| 2403 |
if ("block" === popoverEl.style.display) hidePopover(); |
| 2404 |
} |
| 2405 |
}, hideAfter); |
| 2406 |
hideOnMouseOut = true; |
| 2407 |
}); |
| 2408 |
}; |
| 2409 |
/** |
| 2410 |
* Handle the Popover's click functionality |
| 2411 |
*/ |
| 2412 |
var handlePopoverClick = function handlePopoverClick() { |
| 2413 |
var popoverIsActive = false; |
| 2414 |
target.addEventListener("click", function(e) { |
| 2415 |
e.preventDefault(); |
| 2416 |
e.stopPropagation(); |
| 2417 |
if (popoverIsActive) { |
| 2418 |
hidePopover(); |
| 2419 |
popoverIsActive = false; |
| 2420 |
} else { |
| 2421 |
showPopover(); |
| 2422 |
popoverIsActive = true; |
| 2423 |
} |
| 2424 |
}); |
| 2425 |
popoverEl.addEventListener("click", function(e) { |
| 2426 |
e.stopPropagation(); |
| 2427 |
}); |
| 2428 |
document.body.addEventListener("click", function() { |
| 2429 |
if (popoverIsActive) { |
| 2430 |
hidePopover(); |
| 2431 |
popoverIsActive = false; |
| 2432 |
} |
| 2433 |
}); |
| 2434 |
}; |
| 2435 |
if ("hover" === trigger) handlePopoverHover(); |
| 2436 |
else if ("click" === trigger) handlePopoverClick(); |
| 2437 |
}, [targetRef]); |
| 2438 |
var wrapperClasses = "e-app__popover"; |
| 2439 |
if (wrapperClass) wrapperClasses += " " + wrapperClass; |
| 2440 |
return /*#__PURE__*/ react.default.createElement("div", { |
| 2441 |
className: wrapperClasses, |
| 2442 |
ref: popoverRef |
| 2443 |
}, props.children); |
| 2444 |
} |
| 2445 |
var import_prop_types$54; |
| 2446 |
var init_popover_dialog = __esmMin((() => { |
| 2447 |
import_prop_types$54 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 2448 |
PopoverDialog.propTypes = { |
| 2449 |
targetRef: import_prop_types$54.default.oneOfType([import_prop_types$54.default.func, import_prop_types$54.default.shape({ current: import_prop_types$54.default.any })]).isRequired, |
| 2450 |
trigger: import_prop_types$54.default.string, |
| 2451 |
direction: import_prop_types$54.default.string, |
| 2452 |
offsetTop: import_prop_types$54.default.oneOfType([import_prop_types$54.default.string, import_prop_types$54.default.number]), |
| 2453 |
offsetLeft: import_prop_types$54.default.oneOfType([import_prop_types$54.default.string, import_prop_types$54.default.number]), |
| 2454 |
wrapperClass: import_prop_types$54.default.string, |
| 2455 |
children: import_prop_types$54.default.any, |
| 2456 |
hideAfter: import_prop_types$54.default.number |
| 2457 |
}; |
| 2458 |
PopoverDialog.defaultProps = { |
| 2459 |
direction: "bottom", |
| 2460 |
trigger: "hover", |
| 2461 |
offsetTop: 10, |
| 2462 |
offsetLeft: 0, |
| 2463 |
hideAfter: 300 |
| 2464 |
}; |
| 2465 |
})); |
| 2466 |
|
| 2467 |
//#endregion |
| 2468 |
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js |
| 2469 |
function _objectWithoutPropertiesLoose(r, e) { |
| 2470 |
if (null == r) return {}; |
| 2471 |
var t = {}; |
| 2472 |
for (var n in r) if ({}.hasOwnProperty.call(r, n)) { |
| 2473 |
if (-1 !== e.indexOf(n)) continue; |
| 2474 |
t[n] = r[n]; |
| 2475 |
} |
| 2476 |
return t; |
| 2477 |
} |
| 2478 |
var init_objectWithoutPropertiesLoose = __esmMin((() => {})); |
| 2479 |
|
| 2480 |
//#endregion |
| 2481 |
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js |
| 2482 |
function _objectWithoutProperties(e, t) { |
| 2483 |
if (null == e) return {}; |
| 2484 |
var o; |
| 2485 |
var r; |
| 2486 |
var i = _objectWithoutPropertiesLoose(e, t); |
| 2487 |
if (Object.getOwnPropertySymbols) { |
| 2488 |
var n = Object.getOwnPropertySymbols(e); |
| 2489 |
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); |
| 2490 |
} |
| 2491 |
return i; |
| 2492 |
} |
| 2493 |
var init_objectWithoutProperties = __esmMin((() => { |
| 2494 |
init_objectWithoutPropertiesLoose(); |
| 2495 |
})); |
| 2496 |
|
| 2497 |
//#endregion |
| 2498 |
//#region app/assets/js/ui/atoms/icon.js |
| 2499 |
var import_prop_types$53, _excluded$4, Icon$2; |
| 2500 |
var init_icon = __esmMin((() => { |
| 2501 |
import_prop_types$53 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 2502 |
init_objectWithoutProperties(); |
| 2503 |
_excluded$4 = ["className"]; |
| 2504 |
Icon$2 = (0, react.forwardRef)(function(props, ref) { |
| 2505 |
var className = props.className; |
| 2506 |
var rest = _objectWithoutProperties(props, _excluded$4); |
| 2507 |
return /*#__PURE__*/ react.default.createElement("i", _extends({ |
| 2508 |
ref, |
| 2509 |
className: "eps-icon ".concat(className) |
| 2510 |
}, rest)); |
| 2511 |
}); |
| 2512 |
Icon$2.propTypes = { className: import_prop_types$53.default.string.isRequired }; |
| 2513 |
Icon$2.defaultProps = { className: "" }; |
| 2514 |
})); |
| 2515 |
|
| 2516 |
//#endregion |
| 2517 |
//#region app/assets/js/ui/molecules/button.js |
| 2518 |
function _callSuper$18(t, o, e) { |
| 2519 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$19() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 2520 |
} |
| 2521 |
function _isNativeReflectConstruct$19() { |
| 2522 |
try { |
| 2523 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 2524 |
} catch (t) {} |
| 2525 |
return (_isNativeReflectConstruct$19 = function _isNativeReflectConstruct() { |
| 2526 |
return !!t; |
| 2527 |
})(); |
| 2528 |
} |
| 2529 |
var import_prop_types$52, Button$29; |
| 2530 |
var init_button = __esmMin((() => { |
| 2531 |
import_prop_types$52 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 2532 |
init_extends(); |
| 2533 |
init_classCallCheck(); |
| 2534 |
init_createClass(); |
| 2535 |
init_possibleConstructorReturn(); |
| 2536 |
init_getPrototypeOf(); |
| 2537 |
init_inherits(); |
| 2538 |
init_defineProperty$1(); |
| 2539 |
init_popover_dialog(); |
| 2540 |
init_icon(); |
| 2541 |
__name(_callSuper$18, "_callSuper"); |
| 2542 |
__name(_isNativeReflectConstruct$19, "_isNativeReflectConstruct"); |
| 2543 |
Button$29 = /*#__PURE__*/ function(_React$Component) { |
| 2544 |
function Button() { |
| 2545 |
_classCallCheck(this, Button); |
| 2546 |
return _callSuper$18(this, Button, arguments); |
| 2547 |
} |
| 2548 |
_inherits(Button, _React$Component); |
| 2549 |
return _createClass(Button, [ |
| 2550 |
{ |
| 2551 |
key: "getCssId", |
| 2552 |
value: function getCssId() { |
| 2553 |
return this.props.id; |
| 2554 |
} |
| 2555 |
}, |
| 2556 |
{ |
| 2557 |
key: "getClassName", |
| 2558 |
value: function getClassName() { |
| 2559 |
var baseClassName = "eps-button"; |
| 2560 |
return [baseClassName, this.props.className].concat(this.getStylePropsClasses(baseClassName)).filter(function(classItem) { |
| 2561 |
return "" !== classItem; |
| 2562 |
}).join(" "); |
| 2563 |
} |
| 2564 |
}, |
| 2565 |
{ |
| 2566 |
key: "getStylePropsClasses", |
| 2567 |
value: function getStylePropsClasses(baseClassName) { |
| 2568 |
var _this = this; |
| 2569 |
var styleProps = [ |
| 2570 |
"color", |
| 2571 |
"size", |
| 2572 |
"variant" |
| 2573 |
]; |
| 2574 |
var stylePropClasses = []; |
| 2575 |
styleProps.forEach(function(styleProp) { |
| 2576 |
var stylePropValue = _this.props[styleProp]; |
| 2577 |
if (stylePropValue) stylePropClasses.push(baseClassName + "--" + stylePropValue); |
| 2578 |
}); |
| 2579 |
return stylePropClasses; |
| 2580 |
} |
| 2581 |
}, |
| 2582 |
{ |
| 2583 |
key: "getIcon", |
| 2584 |
value: function getIcon() { |
| 2585 |
if (this.props.icon) { |
| 2586 |
var iconRef = react.default.createRef(null); |
| 2587 |
var tooltip = this.props.tooltip || this.props.text; |
| 2588 |
var icon = /*#__PURE__*/ react.default.createElement(Icon$2, { |
| 2589 |
ref: iconRef, |
| 2590 |
className: this.props.icon, |
| 2591 |
"aria-hidden": "true" |
| 2592 |
}); |
| 2593 |
var screenReaderText = ""; |
| 2594 |
if (this.props.hideText) screenReaderText = /*#__PURE__*/ react.default.createElement("span", { className: "sr-only" }, tooltip); |
| 2595 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, icon, screenReaderText, this.props.tooltip && /*#__PURE__*/ react.default.createElement(PopoverDialog, { |
| 2596 |
targetRef: iconRef, |
| 2597 |
wrapperClass: "e-kit-library__tooltip" |
| 2598 |
}, this.props.tooltip)); |
| 2599 |
} |
| 2600 |
return ""; |
| 2601 |
} |
| 2602 |
}, |
| 2603 |
{ |
| 2604 |
key: "getText", |
| 2605 |
value: function getText() { |
| 2606 |
return this.props.hideText ? "" : /*#__PURE__*/ react.default.createElement("span", null, this.props.text); |
| 2607 |
} |
| 2608 |
}, |
| 2609 |
{ |
| 2610 |
key: "render", |
| 2611 |
value: function render() { |
| 2612 |
var attributes = {}; |
| 2613 |
var id = this.getCssId(); |
| 2614 |
var className = this.getClassName(); |
| 2615 |
if (id) attributes.id = id; |
| 2616 |
if (className) attributes.className = className; |
| 2617 |
if (this.props.onClick) attributes.onClick = this.props.onClick; |
| 2618 |
if (this.props.rel) attributes.rel = this.props.rel; |
| 2619 |
if (this.props.elRef) attributes.ref = this.props.elRef; |
| 2620 |
var buttonContent = /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, this.getIcon(), this.getText()); |
| 2621 |
if (this.props.url) { |
| 2622 |
if (0 === this.props.url.indexOf("http")) return /*#__PURE__*/ react.default.createElement("a", _extends({ |
| 2623 |
href: this.props.url, |
| 2624 |
target: this.props.target |
| 2625 |
}, attributes), buttonContent); |
| 2626 |
attributes.getProps = function(props) { |
| 2627 |
if (props.isCurrent) attributes.className += " active"; |
| 2628 |
return { className: attributes.className }; |
| 2629 |
}; |
| 2630 |
return /*#__PURE__*/ react.default.createElement(LocationProvider, { history: _elementor_router.default.appHistory }, /*#__PURE__*/ react.default.createElement(Link$10, _extends({ to: this.props.url }, attributes), buttonContent)); |
| 2631 |
} |
| 2632 |
return /*#__PURE__*/ react.default.createElement("div", attributes, buttonContent); |
| 2633 |
} |
| 2634 |
} |
| 2635 |
]); |
| 2636 |
}(react.default.Component); |
| 2637 |
_defineProperty$1(Button$29, "propTypes", { |
| 2638 |
text: import_prop_types$52.default.string.isRequired, |
| 2639 |
hideText: import_prop_types$52.default.bool, |
| 2640 |
icon: import_prop_types$52.default.string, |
| 2641 |
tooltip: import_prop_types$52.default.string, |
| 2642 |
id: import_prop_types$52.default.string, |
| 2643 |
className: import_prop_types$52.default.string, |
| 2644 |
url: import_prop_types$52.default.string, |
| 2645 |
onClick: import_prop_types$52.default.func, |
| 2646 |
variant: import_prop_types$52.default.oneOf([ |
| 2647 |
"contained", |
| 2648 |
"underlined", |
| 2649 |
"outlined", |
| 2650 |
"" |
| 2651 |
]), |
| 2652 |
color: import_prop_types$52.default.oneOf([ |
| 2653 |
"primary", |
| 2654 |
"secondary", |
| 2655 |
"cta", |
| 2656 |
"link", |
| 2657 |
"disabled" |
| 2658 |
]), |
| 2659 |
size: import_prop_types$52.default.oneOf([ |
| 2660 |
"sm", |
| 2661 |
"md", |
| 2662 |
"lg" |
| 2663 |
]), |
| 2664 |
target: import_prop_types$52.default.string, |
| 2665 |
rel: import_prop_types$52.default.string, |
| 2666 |
elRef: import_prop_types$52.default.object |
| 2667 |
}); |
| 2668 |
_defineProperty$1(Button$29, "defaultProps", { |
| 2669 |
id: "", |
| 2670 |
className: "", |
| 2671 |
variant: "", |
| 2672 |
target: "_parent" |
| 2673 |
}); |
| 2674 |
})); |
| 2675 |
|
| 2676 |
//#endregion |
| 2677 |
//#region app/assets/js/layout/header-button.js |
| 2678 |
function _callSuper$17(t, o, e) { |
| 2679 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$18() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 2680 |
} |
| 2681 |
function _isNativeReflectConstruct$18() { |
| 2682 |
try { |
| 2683 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 2684 |
} catch (t) {} |
| 2685 |
return (_isNativeReflectConstruct$18 = function _isNativeReflectConstruct() { |
| 2686 |
return !!t; |
| 2687 |
})(); |
| 2688 |
} |
| 2689 |
function _superPropGet(t, o, e, r) { |
| 2690 |
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); |
| 2691 |
return 2 & r && "function" == typeof p ? function(t) { |
| 2692 |
return p.apply(e, t); |
| 2693 |
} : p; |
| 2694 |
} |
| 2695 |
var Button$28; |
| 2696 |
var init_header_button = __esmMin((() => { |
| 2697 |
init_classCallCheck(); |
| 2698 |
init_createClass(); |
| 2699 |
init_possibleConstructorReturn(); |
| 2700 |
init_getPrototypeOf(); |
| 2701 |
init_get(); |
| 2702 |
init_inherits(); |
| 2703 |
init_defineProperty$1(); |
| 2704 |
init_button(); |
| 2705 |
__name(_callSuper$17, "_callSuper"); |
| 2706 |
__name(_isNativeReflectConstruct$18, "_isNativeReflectConstruct"); |
| 2707 |
Button$28 = /*#__PURE__*/ function(_BaseButton) { |
| 2708 |
function Button() { |
| 2709 |
_classCallCheck(this, Button); |
| 2710 |
return _callSuper$17(this, Button, arguments); |
| 2711 |
} |
| 2712 |
_inherits(Button, _BaseButton); |
| 2713 |
return _createClass(Button, [{ |
| 2714 |
key: "getCssId", |
| 2715 |
value: function getCssId() { |
| 2716 |
return "eps-app-header-btn-" + _superPropGet(Button, "getCssId", this, 3)([]); |
| 2717 |
} |
| 2718 |
}, { |
| 2719 |
key: "getClassName", |
| 2720 |
value: function getClassName() { |
| 2721 |
if (!this.props.includeHeaderBtnClass) return _superPropGet(Button, "getClassName", this, 3)([]); |
| 2722 |
return "eps-app__header-btn " + _superPropGet(Button, "getClassName", this, 3)([]); |
| 2723 |
} |
| 2724 |
}]); |
| 2725 |
}(Button$29); |
| 2726 |
_defineProperty$1(Button$28, "defaultProps", Object.assign({}, Button$29.defaultProps, { |
| 2727 |
hideText: true, |
| 2728 |
includeHeaderBtnClass: true |
| 2729 |
})); |
| 2730 |
})); |
| 2731 |
|
| 2732 |
//#endregion |
| 2733 |
//#region app/assets/js/layout/header-buttons.js |
| 2734 |
function HeaderButtons(props) { |
| 2735 |
var action = useAction(); |
| 2736 |
var actionOnClose = function actionOnClose() { |
| 2737 |
if (props.onClose) props.onClose(); |
| 2738 |
else action.backToDashboard(); |
| 2739 |
}; |
| 2740 |
var tools = ""; |
| 2741 |
if (props.buttons.length) { |
| 2742 |
var buttons = props.buttons.map(function(button) { |
| 2743 |
return /*#__PURE__*/ react.default.createElement(Button$28, _extends({ key: button.id }, button)); |
| 2744 |
}); |
| 2745 |
tools = /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, buttons); |
| 2746 |
} |
| 2747 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-app__header-buttons" }, /*#__PURE__*/ react.default.createElement(Button$28, { |
| 2748 |
text: (0, _wordpress_i18n.__)("Close", "elementor"), |
| 2749 |
icon: "eicon-close", |
| 2750 |
className: "eps-app__close-button", |
| 2751 |
onClick: actionOnClose |
| 2752 |
}), tools); |
| 2753 |
} |
| 2754 |
var import_prop_types$51; |
| 2755 |
var init_header_buttons = __esmMin((() => { |
| 2756 |
import_prop_types$51 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 2757 |
init_extends(); |
| 2758 |
init_use_action(); |
| 2759 |
init_header_button(); |
| 2760 |
HeaderButtons.propTypes = { |
| 2761 |
buttons: import_prop_types$51.default.arrayOf(import_prop_types$51.default.object), |
| 2762 |
onClose: import_prop_types$51.default.func |
| 2763 |
}; |
| 2764 |
HeaderButtons.defaultProps = { buttons: [] }; |
| 2765 |
})); |
| 2766 |
|
| 2767 |
//#endregion |
| 2768 |
//#region app/assets/js/hooks/use-page-title.js |
| 2769 |
function usePageTitle(_ref) { |
| 2770 |
var title = _ref.title; |
| 2771 |
var prefix = _ref.prefix; |
| 2772 |
var prefixRef = (0, react.useRef)(prefix); |
| 2773 |
(0, react.useEffect)(function() { |
| 2774 |
if (!prefix) prefixRef.current = (0, _wordpress_i18n.__)("Elementor", "elementor"); |
| 2775 |
document.title = "".concat(prefixRef.current, " | ").concat(title); |
| 2776 |
}, [title, prefix]); |
| 2777 |
} |
| 2778 |
var init_use_page_title = __esmMin((() => {})); |
| 2779 |
|
| 2780 |
//#endregion |
| 2781 |
//#region app/assets/js/layout/header.js |
| 2782 |
init_extends(); |
| 2783 |
init_header_buttons(); |
| 2784 |
init_use_page_title(); |
| 2785 |
function Header$1(props) { |
| 2786 |
usePageTitle({ title: props.title }); |
| 2787 |
var TitleTag = "span"; |
| 2788 |
var titleAttrs = {}; |
| 2789 |
if (props.titleRedirectRoute) { |
| 2790 |
TitleTag = "a"; |
| 2791 |
titleAttrs = { |
| 2792 |
href: "#".concat(props.titleRedirectRoute), |
| 2793 |
target: "_self" |
| 2794 |
}; |
| 2795 |
} |
| 2796 |
return /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 2797 |
container: true, |
| 2798 |
alignItems: "center", |
| 2799 |
justify: "space-between", |
| 2800 |
className: "eps-app__header" |
| 2801 |
}, /*#__PURE__*/ react.default.createElement(TitleTag, _extends({ className: "eps-app__logo-title-wrapper" }, titleAttrs), /*#__PURE__*/ react.default.createElement("i", { className: "eps-app__logo eicon-elementor-circle" }), /*#__PURE__*/ react.default.createElement("h1", { className: "eps-app__title" }, props.title)), /*#__PURE__*/ react.default.createElement(HeaderButtons, { |
| 2802 |
buttons: props.buttons, |
| 2803 |
onClose: props.onClose |
| 2804 |
})); |
| 2805 |
} |
| 2806 |
__name(Header$1, "Header"); |
| 2807 |
Header$1.propTypes = { |
| 2808 |
title: import_prop_types$55.default.string, |
| 2809 |
titleRedirectRoute: import_prop_types$55.default.string, |
| 2810 |
buttons: import_prop_types$55.default.arrayOf(import_prop_types$55.default.object), |
| 2811 |
onClose: import_prop_types$55.default.func |
| 2812 |
}; |
| 2813 |
Header$1.defaultProps = { buttons: [] }; |
| 2814 |
|
| 2815 |
//#endregion |
| 2816 |
//#region app/assets/js/layout/sidebar.js |
| 2817 |
function Sidebar(props) { |
| 2818 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-app__sidebar" }, props.children); |
| 2819 |
} |
| 2820 |
var import_prop_types$50; |
| 2821 |
var init_sidebar = __esmMin((() => { |
| 2822 |
import_prop_types$50 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 2823 |
Sidebar.propTypes = { children: import_prop_types$50.default.object }; |
| 2824 |
})); |
| 2825 |
|
| 2826 |
//#endregion |
| 2827 |
//#region app/assets/js/layout/content.js |
| 2828 |
function Content(props) { |
| 2829 |
return /*#__PURE__*/ react.default.createElement("main", { className: "eps-app__content ".concat(props.className) }, props.children); |
| 2830 |
} |
| 2831 |
var import_prop_types$49; |
| 2832 |
var init_content = __esmMin((() => { |
| 2833 |
import_prop_types$49 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 2834 |
Content.propTypes = { |
| 2835 |
children: import_prop_types$49.default.any, |
| 2836 |
className: import_prop_types$49.default.string |
| 2837 |
}; |
| 2838 |
Content.defaultProps = { className: "" }; |
| 2839 |
})); |
| 2840 |
|
| 2841 |
//#endregion |
| 2842 |
//#region app/assets/js/layout/footer.js |
| 2843 |
init_sidebar(); |
| 2844 |
init_content(); |
| 2845 |
function Footer$1(props) { |
| 2846 |
return /*#__PURE__*/ react.default.createElement("footer", { className: "eps-app__footer" }, props.children); |
| 2847 |
} |
| 2848 |
__name(Footer$1, "Footer"); |
| 2849 |
Footer$1.propTypes = { children: import_prop_types$55.default.object }; |
| 2850 |
|
| 2851 |
//#endregion |
| 2852 |
//#region app/assets/js/layout/page.js |
| 2853 |
function Page(props) { |
| 2854 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-app__lightbox ".concat(props.className) }, /*#__PURE__*/ react.default.createElement("div", { className: "eps-app" }, /*#__PURE__*/ react.default.createElement(Header$1, { |
| 2855 |
title: props.title, |
| 2856 |
buttons: props.headerButtons, |
| 2857 |
titleRedirectRoute: props.titleRedirectRoute, |
| 2858 |
onClose: props.onClose |
| 2859 |
}), /*#__PURE__*/ react.default.createElement("div", { className: "eps-app__main" }, function AppSidebar() { |
| 2860 |
if (!props.sidebar) return; |
| 2861 |
return /*#__PURE__*/ react.default.createElement(Sidebar, null, props.sidebar); |
| 2862 |
}(), /*#__PURE__*/ react.default.createElement(Content, null, props.content)), function AppFooter() { |
| 2863 |
if (!props.footer) return; |
| 2864 |
return /*#__PURE__*/ react.default.createElement(Footer$1, null, props.footer); |
| 2865 |
}())); |
| 2866 |
} |
| 2867 |
Page.propTypes = { |
| 2868 |
title: import_prop_types$55.default.string, |
| 2869 |
titleRedirectRoute: import_prop_types$55.default.string, |
| 2870 |
className: import_prop_types$55.default.string, |
| 2871 |
headerButtons: import_prop_types$55.default.arrayOf(import_prop_types$55.default.object), |
| 2872 |
sidebar: import_prop_types$55.default.object, |
| 2873 |
content: import_prop_types$55.default.object.isRequired, |
| 2874 |
footer: import_prop_types$55.default.object, |
| 2875 |
onClose: import_prop_types$55.default.func |
| 2876 |
}; |
| 2877 |
Page.defaultProps = { className: "" }; |
| 2878 |
|
| 2879 |
//#endregion |
| 2880 |
//#region app/assets/js/pages/not-found.js |
| 2881 |
function NotFound() { |
| 2882 |
var config = { |
| 2883 |
title: (0, _wordpress_i18n.__)("Not Found", "elementor"), |
| 2884 |
className: "eps-app__not-found", |
| 2885 |
content: /*#__PURE__*/ react.default.createElement("h1", null, " ", (0, _wordpress_i18n.__)("Not Found", "elementor"), " "), |
| 2886 |
sidebar: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null) |
| 2887 |
}; |
| 2888 |
return /*#__PURE__*/ react.default.createElement(Page, config); |
| 2889 |
} |
| 2890 |
|
| 2891 |
//#endregion |
| 2892 |
//#region app/assets/js/url-actions/actions-map.js |
| 2893 |
var actions_map_default = { "import-kit": "/import/process" }; |
| 2894 |
|
| 2895 |
//#endregion |
| 2896 |
//#region app/assets/js/pages/index.js |
| 2897 |
init_es$1(); |
| 2898 |
function Index$5() { |
| 2899 |
var _elementorAppConfig$m; |
| 2900 |
var urlSearchParams = new URLSearchParams(window.location.search); |
| 2901 |
var url = actions_map_default[Object.fromEntries(urlSearchParams.entries()).action] || ((_elementorAppConfig$m = elementorAppConfig.menu_url.split("#")) === null || _elementorAppConfig$m === void 0 ? void 0 : _elementorAppConfig$m[1]); |
| 2902 |
return /*#__PURE__*/ react.default.createElement(Redirect, { |
| 2903 |
to: url || "/not-found", |
| 2904 |
noThrow: true |
| 2905 |
}); |
| 2906 |
} |
| 2907 |
__name(Index$5, "Index"); |
| 2908 |
|
| 2909 |
//#endregion |
| 2910 |
//#region app/assets/js/ui/dialog/dialog-wrapper.js |
| 2911 |
init_button(); |
| 2912 |
function DialogWrapper(props) { |
| 2913 |
var WrapperTag = "div"; |
| 2914 |
if (props.onSubmit) WrapperTag = "form"; |
| 2915 |
return /*#__PURE__*/ react.default.createElement("section", { className: "eps-modal__overlay" }, /*#__PURE__*/ react.default.createElement(WrapperTag, { |
| 2916 |
className: "eps-modal eps-dialog", |
| 2917 |
onSubmit: props.onSubmit |
| 2918 |
}, props.onClose && /*#__PURE__*/ react.default.createElement(Button$29, { |
| 2919 |
onClick: props.onClose, |
| 2920 |
text: (0, _wordpress_i18n.__)("Close", "elementor"), |
| 2921 |
hideText: true, |
| 2922 |
icon: "eicon-close", |
| 2923 |
className: "eps-dialog__close-button" |
| 2924 |
}), props.children)); |
| 2925 |
} |
| 2926 |
DialogWrapper.propTypes = { |
| 2927 |
onClose: import_prop_types$55.default.func, |
| 2928 |
onSubmit: import_prop_types$55.default.func, |
| 2929 |
children: import_prop_types$55.default.any |
| 2930 |
}; |
| 2931 |
|
| 2932 |
//#endregion |
| 2933 |
//#region app/assets/js/ui/dialog/dialog-content.js |
| 2934 |
function DialogContent$4(props) { |
| 2935 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-dialog__content" }, props.children); |
| 2936 |
} |
| 2937 |
__name(DialogContent$4, "DialogContent"); |
| 2938 |
DialogContent$4.propTypes = { children: import_prop_types$55.default.any }; |
| 2939 |
|
| 2940 |
//#endregion |
| 2941 |
//#region app/assets/js/ui/atoms/heading.js |
| 2942 |
init_utils$4(); |
| 2943 |
function Heading$11(props) { |
| 2944 |
var baseClassName = "eps"; |
| 2945 |
var classes = [props.className]; |
| 2946 |
if (props.variant) classes.push(baseClassName + "-" + props.variant); |
| 2947 |
return /*#__PURE__*/ react.default.createElement(function Element() { |
| 2948 |
return react.default.createElement(props.tag, { className: arrayToClassName(classes) }, props.children); |
| 2949 |
}, null); |
| 2950 |
} |
| 2951 |
__name(Heading$11, "Heading"); |
| 2952 |
Heading$11.propTypes = { |
| 2953 |
className: import_prop_types$55.default.string, |
| 2954 |
children: import_prop_types$55.default.oneOfType([ |
| 2955 |
import_prop_types$55.default.string, |
| 2956 |
import_prop_types$55.default.object, |
| 2957 |
import_prop_types$55.default.arrayOf(import_prop_types$55.default.object) |
| 2958 |
]).isRequired, |
| 2959 |
tag: import_prop_types$55.default.oneOf([ |
| 2960 |
"h1", |
| 2961 |
"h2", |
| 2962 |
"h3", |
| 2963 |
"h4", |
| 2964 |
"h5", |
| 2965 |
"h6" |
| 2966 |
]), |
| 2967 |
variant: import_prop_types$55.default.oneOf([ |
| 2968 |
"display-1", |
| 2969 |
"display-2", |
| 2970 |
"display-3", |
| 2971 |
"display-4", |
| 2972 |
"h1", |
| 2973 |
"h2", |
| 2974 |
"h3", |
| 2975 |
"h4", |
| 2976 |
"h5", |
| 2977 |
"h6" |
| 2978 |
]).isRequired |
| 2979 |
}; |
| 2980 |
Heading$11.defaultProps = { |
| 2981 |
className: "", |
| 2982 |
tag: "h1" |
| 2983 |
}; |
| 2984 |
|
| 2985 |
//#endregion |
| 2986 |
//#region app/assets/js/ui/dialog/dialog-title.js |
| 2987 |
init_defineProperty$1(); |
| 2988 |
init_extends(); |
| 2989 |
function ownKeys$39(e, r) { |
| 2990 |
var t = Object.keys(e); |
| 2991 |
if (Object.getOwnPropertySymbols) { |
| 2992 |
var o = Object.getOwnPropertySymbols(e); |
| 2993 |
r && (o = o.filter(function(r) { |
| 2994 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 2995 |
})), t.push.apply(t, o); |
| 2996 |
} |
| 2997 |
return t; |
| 2998 |
} |
| 2999 |
__name(ownKeys$39, "ownKeys"); |
| 3000 |
function _objectSpread$38(e) { |
| 3001 |
for (var r = 1; r < arguments.length; r++) { |
| 3002 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 3003 |
r % 2 ? ownKeys$39(Object(t), !0).forEach(function(r) { |
| 3004 |
_defineProperty$1(e, r, t[r]); |
| 3005 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$39(Object(t)).forEach(function(r) { |
| 3006 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 3007 |
}); |
| 3008 |
} |
| 3009 |
return e; |
| 3010 |
} |
| 3011 |
__name(_objectSpread$38, "_objectSpread"); |
| 3012 |
function DialogTitle$3(props) { |
| 3013 |
return /*#__PURE__*/ react.default.createElement(Heading$11, _extends({}, props, { className: "eps-dialog__title ".concat(props.className) })); |
| 3014 |
} |
| 3015 |
__name(DialogTitle$3, "DialogTitle"); |
| 3016 |
DialogTitle$3.propTypes = _objectSpread$38(_objectSpread$38({}, Heading$11.propTypes), {}, { className: import_prop_types$55.default.string }); |
| 3017 |
DialogTitle$3.defaultProps = _objectSpread$38(_objectSpread$38({}, Heading$11.propTypes), {}, { |
| 3018 |
variant: "h3", |
| 3019 |
tag: "h3", |
| 3020 |
className: "" |
| 3021 |
}); |
| 3022 |
|
| 3023 |
//#endregion |
| 3024 |
//#region app/assets/js/ui/atoms/text.js |
| 3025 |
init_utils$4(); |
| 3026 |
function Text$11(props) { |
| 3027 |
var baseClassName = "eps"; |
| 3028 |
var classes = [props.className]; |
| 3029 |
var variant = props.variant && "md" !== props.variant ? "-" + props.variant : ""; |
| 3030 |
classes.push(baseClassName + "-text" + variant); |
| 3031 |
return /*#__PURE__*/ react.default.createElement(function Element() { |
| 3032 |
return react.default.createElement(props.tag, { className: arrayToClassName(classes) }, props.children); |
| 3033 |
}, null); |
| 3034 |
} |
| 3035 |
__name(Text$11, "Text"); |
| 3036 |
Text$11.propTypes = { |
| 3037 |
className: import_prop_types$55.default.string, |
| 3038 |
variant: import_prop_types$55.default.oneOf([ |
| 3039 |
"xl", |
| 3040 |
"lg", |
| 3041 |
"md", |
| 3042 |
"sm", |
| 3043 |
"xs", |
| 3044 |
"xxs" |
| 3045 |
]), |
| 3046 |
tag: import_prop_types$55.default.string, |
| 3047 |
children: import_prop_types$55.default.any.isRequired |
| 3048 |
}; |
| 3049 |
Text$11.defaultProps = { |
| 3050 |
className: "", |
| 3051 |
tag: "p" |
| 3052 |
}; |
| 3053 |
|
| 3054 |
//#endregion |
| 3055 |
//#region app/assets/js/ui/dialog/dialog-text.js |
| 3056 |
init_defineProperty$1(); |
| 3057 |
init_extends(); |
| 3058 |
function ownKeys$38(e, r) { |
| 3059 |
var t = Object.keys(e); |
| 3060 |
if (Object.getOwnPropertySymbols) { |
| 3061 |
var o = Object.getOwnPropertySymbols(e); |
| 3062 |
r && (o = o.filter(function(r) { |
| 3063 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 3064 |
})), t.push.apply(t, o); |
| 3065 |
} |
| 3066 |
return t; |
| 3067 |
} |
| 3068 |
__name(ownKeys$38, "ownKeys"); |
| 3069 |
function _objectSpread$37(e) { |
| 3070 |
for (var r = 1; r < arguments.length; r++) { |
| 3071 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 3072 |
r % 2 ? ownKeys$38(Object(t), !0).forEach(function(r) { |
| 3073 |
_defineProperty$1(e, r, t[r]); |
| 3074 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$38(Object(t)).forEach(function(r) { |
| 3075 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 3076 |
}); |
| 3077 |
} |
| 3078 |
return e; |
| 3079 |
} |
| 3080 |
__name(_objectSpread$37, "_objectSpread"); |
| 3081 |
function DialogText(props) { |
| 3082 |
return /*#__PURE__*/ react.default.createElement(Text$11, _extends({ variant: "xs" }, props, { className: "eps-dialog__text ".concat(props.className) })); |
| 3083 |
} |
| 3084 |
DialogText.propTypes = _objectSpread$37({}, Text$11.propTypes); |
| 3085 |
DialogText.defaultProps = _objectSpread$37(_objectSpread$37({}, Text$11.defaultProps), {}, { |
| 3086 |
tag: "p", |
| 3087 |
variant: "sm" |
| 3088 |
}); |
| 3089 |
|
| 3090 |
//#endregion |
| 3091 |
//#region app/assets/js/ui/dialog/dialog-actions.js |
| 3092 |
function DialogActions$4(props) { |
| 3093 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-dialog__buttons" }, props.children); |
| 3094 |
} |
| 3095 |
__name(DialogActions$4, "DialogActions"); |
| 3096 |
DialogActions$4.propTypes = { children: import_prop_types$55.default.any }; |
| 3097 |
|
| 3098 |
//#endregion |
| 3099 |
//#region app/assets/js/ui/dialog/dialog-button.js |
| 3100 |
init_defineProperty$1(); |
| 3101 |
init_extends(); |
| 3102 |
init_button(); |
| 3103 |
function ownKeys$37(e, r) { |
| 3104 |
var t = Object.keys(e); |
| 3105 |
if (Object.getOwnPropertySymbols) { |
| 3106 |
var o = Object.getOwnPropertySymbols(e); |
| 3107 |
r && (o = o.filter(function(r) { |
| 3108 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 3109 |
})), t.push.apply(t, o); |
| 3110 |
} |
| 3111 |
return t; |
| 3112 |
} |
| 3113 |
__name(ownKeys$37, "ownKeys"); |
| 3114 |
function _objectSpread$36(e) { |
| 3115 |
for (var r = 1; r < arguments.length; r++) { |
| 3116 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 3117 |
r % 2 ? ownKeys$37(Object(t), !0).forEach(function(r) { |
| 3118 |
_defineProperty$1(e, r, t[r]); |
| 3119 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$37(Object(t)).forEach(function(r) { |
| 3120 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 3121 |
}); |
| 3122 |
} |
| 3123 |
return e; |
| 3124 |
} |
| 3125 |
__name(_objectSpread$36, "_objectSpread"); |
| 3126 |
function DialogButton(props) { |
| 3127 |
return /*#__PURE__*/ react.default.createElement(Button$29, _extends({}, props, { className: "eps-dialog__button ".concat(props.className) })); |
| 3128 |
} |
| 3129 |
DialogButton.propTypes = _objectSpread$36(_objectSpread$36({}, Button$29.propTypes), {}, { |
| 3130 |
tabIndex: import_prop_types$55.default.string, |
| 3131 |
type: import_prop_types$55.default.string |
| 3132 |
}); |
| 3133 |
DialogButton.defaultProps = _objectSpread$36(_objectSpread$36({}, Button$29.defaultProps), {}, { |
| 3134 |
tabIndex: "0", |
| 3135 |
type: "button" |
| 3136 |
}); |
| 3137 |
|
| 3138 |
//#endregion |
| 3139 |
//#region app/assets/js/ui/dialog/dialog.js |
| 3140 |
function Dialog$9(props) { |
| 3141 |
return /*#__PURE__*/ react.default.createElement(DialogWrapper, { |
| 3142 |
onSubmit: props.onSubmit, |
| 3143 |
onClose: props.onClose |
| 3144 |
}, /*#__PURE__*/ react.default.createElement(DialogContent$4, null, props.title && /*#__PURE__*/ react.default.createElement(DialogTitle$3, null, props.title), props.text && /*#__PURE__*/ react.default.createElement(DialogText, null, props.text), props.children), /*#__PURE__*/ react.default.createElement(DialogActions$4, null, /*#__PURE__*/ react.default.createElement(DialogButton, { |
| 3145 |
key: "dismiss", |
| 3146 |
text: props.dismissButtonText, |
| 3147 |
onClick: props.dismissButtonOnClick, |
| 3148 |
url: props.dismissButtonUrl, |
| 3149 |
target: props.dismissButtonTarget, |
| 3150 |
tabIndex: "2" |
| 3151 |
}), /*#__PURE__*/ react.default.createElement(DialogButton, { |
| 3152 |
key: "approve", |
| 3153 |
text: props.approveButtonText, |
| 3154 |
onClick: props.approveButtonOnClick, |
| 3155 |
url: props.approveButtonUrl, |
| 3156 |
target: props.approveButtonTarget, |
| 3157 |
color: props.approveButtonColor, |
| 3158 |
elRef: props.approveButtonRef, |
| 3159 |
tabIndex: "1" |
| 3160 |
}))); |
| 3161 |
} |
| 3162 |
__name(Dialog$9, "Dialog"); |
| 3163 |
Dialog$9.propTypes = { |
| 3164 |
title: import_prop_types$55.default.any, |
| 3165 |
text: import_prop_types$55.default.any, |
| 3166 |
children: import_prop_types$55.default.any, |
| 3167 |
onSubmit: import_prop_types$55.default.func, |
| 3168 |
onClose: import_prop_types$55.default.func, |
| 3169 |
dismissButtonText: import_prop_types$55.default.string.isRequired, |
| 3170 |
dismissButtonOnClick: import_prop_types$55.default.func, |
| 3171 |
dismissButtonUrl: import_prop_types$55.default.string, |
| 3172 |
dismissButtonTarget: import_prop_types$55.default.string, |
| 3173 |
approveButtonText: import_prop_types$55.default.string.isRequired, |
| 3174 |
approveButtonOnClick: import_prop_types$55.default.func, |
| 3175 |
approveButtonUrl: import_prop_types$55.default.string, |
| 3176 |
approveButtonColor: import_prop_types$55.default.string, |
| 3177 |
approveButtonTarget: import_prop_types$55.default.string, |
| 3178 |
approveButtonRef: import_prop_types$55.default.object |
| 3179 |
}; |
| 3180 |
Dialog$9.defaultProps = {}; |
| 3181 |
Dialog$9.Wrapper = DialogWrapper; |
| 3182 |
Dialog$9.Content = DialogContent$4; |
| 3183 |
Dialog$9.Title = DialogTitle$3; |
| 3184 |
Dialog$9.Text = DialogText; |
| 3185 |
Dialog$9.Actions = DialogActions$4; |
| 3186 |
Dialog$9.Button = DialogButton; |
| 3187 |
|
| 3188 |
//#endregion |
| 3189 |
//#region app/assets/js/organisms/error-boundary.js |
| 3190 |
init_classCallCheck(); |
| 3191 |
init_createClass(); |
| 3192 |
init_possibleConstructorReturn(); |
| 3193 |
init_getPrototypeOf(); |
| 3194 |
init_inherits(); |
| 3195 |
init_defineProperty$1(); |
| 3196 |
function _callSuper$16(t, o, e) { |
| 3197 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$17() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 3198 |
} |
| 3199 |
__name(_callSuper$16, "_callSuper"); |
| 3200 |
function _isNativeReflectConstruct$17() { |
| 3201 |
try { |
| 3202 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 3203 |
} catch (t) {} |
| 3204 |
return (_isNativeReflectConstruct$17 = function _isNativeReflectConstruct() { |
| 3205 |
return !!t; |
| 3206 |
})(); |
| 3207 |
} |
| 3208 |
__name(_isNativeReflectConstruct$17, "_isNativeReflectConstruct"); |
| 3209 |
var ErrorBoundary = /*#__PURE__*/ function(_React$Component) { |
| 3210 |
function ErrorBoundary(props) { |
| 3211 |
var _this; |
| 3212 |
_classCallCheck(this, ErrorBoundary); |
| 3213 |
_this = _callSuper$16(this, ErrorBoundary, [props]); |
| 3214 |
_this.state = { hasError: null }; |
| 3215 |
return _this; |
| 3216 |
} |
| 3217 |
_inherits(ErrorBoundary, _React$Component); |
| 3218 |
return _createClass(ErrorBoundary, [{ |
| 3219 |
key: "goBack", |
| 3220 |
value: function goBack() { |
| 3221 |
if (window.top !== window.self) window.top.$e.run("app/close"); |
| 3222 |
window.location = elementorAppConfig.return_url; |
| 3223 |
} |
| 3224 |
}, { |
| 3225 |
key: "render", |
| 3226 |
value: function render() { |
| 3227 |
if (this.state.hasError) return /*#__PURE__*/ react.default.createElement(Dialog$9, { |
| 3228 |
title: this.props.title, |
| 3229 |
text: this.props.text, |
| 3230 |
approveButtonUrl: this.props.learnMoreUrl, |
| 3231 |
approveButtonColor: "link", |
| 3232 |
approveButtonTarget: "_blank", |
| 3233 |
approveButtonText: (0, _wordpress_i18n.__)("Learn More", "elementor"), |
| 3234 |
dismissButtonText: (0, _wordpress_i18n.__)("Go Back", "elementor"), |
| 3235 |
dismissButtonOnClick: this.goBack |
| 3236 |
}); |
| 3237 |
return this.props.children; |
| 3238 |
} |
| 3239 |
}], [{ |
| 3240 |
key: "getDerivedStateFromError", |
| 3241 |
value: function getDerivedStateFromError() { |
| 3242 |
return { hasError: true }; |
| 3243 |
} |
| 3244 |
}]); |
| 3245 |
}(react.default.Component); |
| 3246 |
_defineProperty$1(ErrorBoundary, "propTypes", { |
| 3247 |
children: import_prop_types$55.default.any, |
| 3248 |
title: import_prop_types$55.default.string, |
| 3249 |
text: import_prop_types$55.default.string, |
| 3250 |
learnMoreUrl: import_prop_types$55.default.string |
| 3251 |
}); |
| 3252 |
_defineProperty$1(ErrorBoundary, "defaultProps", { |
| 3253 |
title: (0, _wordpress_i18n.__)("App could not be loaded", "elementor"), |
| 3254 |
text: (0, _wordpress_i18n.__)("We’re sorry, but something went wrong. Click on ‘Learn more’ and follow each of the steps to quickly solve it.", "elementor"), |
| 3255 |
learnMoreUrl: "https://go.elementor.com/app-general-load-issue/" |
| 3256 |
}); |
| 3257 |
|
| 3258 |
//#endregion |
| 3259 |
//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
| 3260 |
function _arrayWithHoles(r) { |
| 3261 |
if (Array.isArray(r)) return r; |
| 3262 |
} |
| 3263 |
var init_arrayWithHoles = __esmMin((() => {})); |
| 3264 |
|
| 3265 |
//#endregion |
| 3266 |
//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
| 3267 |
function _iterableToArrayLimit(r, l) { |
| 3268 |
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 3269 |
if (null != t) { |
| 3270 |
var e; |
| 3271 |
var n; |
| 3272 |
var i; |
| 3273 |
var u; |
| 3274 |
var a = []; |
| 3275 |
var f = !0; |
| 3276 |
var o = !1; |
| 3277 |
try { |
| 3278 |
if (i = (t = t.call(r)).next, 0 === l) { |
| 3279 |
if (Object(t) !== t) return; |
| 3280 |
f = !1; |
| 3281 |
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); |
| 3282 |
} catch (r) { |
| 3283 |
o = !0, n = r; |
| 3284 |
} finally { |
| 3285 |
try { |
| 3286 |
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; |
| 3287 |
} finally { |
| 3288 |
if (o) throw n; |
| 3289 |
} |
| 3290 |
} |
| 3291 |
return a; |
| 3292 |
} |
| 3293 |
} |
| 3294 |
var init_iterableToArrayLimit = __esmMin((() => {})); |
| 3295 |
|
| 3296 |
//#endregion |
| 3297 |
//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
| 3298 |
function _nonIterableRest() { |
| 3299 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 3300 |
} |
| 3301 |
var init_nonIterableRest = __esmMin((() => {})); |
| 3302 |
|
| 3303 |
//#endregion |
| 3304 |
//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
| 3305 |
function _slicedToArray(r, e) { |
| 3306 |
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$5(r, e) || _nonIterableRest(); |
| 3307 |
} |
| 3308 |
var init_slicedToArray = __esmMin((() => { |
| 3309 |
init_arrayWithHoles(); |
| 3310 |
init_iterableToArrayLimit(); |
| 3311 |
init_unsupportedIterableToArray(); |
| 3312 |
init_nonIterableRest(); |
| 3313 |
})); |
| 3314 |
|
| 3315 |
//#endregion |
| 3316 |
//#region app/assets/js/app-context.js |
| 3317 |
init_slicedToArray(); |
| 3318 |
var AppContext = react.default.createContext(); |
| 3319 |
function AppProvider(props) { |
| 3320 |
var _useState2 = _slicedToArray((0, react.useState)({ isDarkMode: document.body.classList.contains("eps-theme-dark") }), 2); |
| 3321 |
var state = _useState2[0]; |
| 3322 |
var setState = _useState2[1]; |
| 3323 |
return /*#__PURE__*/ react.default.createElement(AppContext.Provider, { value: { |
| 3324 |
state, |
| 3325 |
setState |
| 3326 |
} }, props.children); |
| 3327 |
} |
| 3328 |
AppProvider.propTypes = { children: import_prop_types$55.default.object.isRequired }; |
| 3329 |
|
| 3330 |
//#endregion |
| 3331 |
//#region node_modules/styled-components/node_modules/tslib/tslib.es6.mjs |
| 3332 |
var __assign = function() { |
| 3333 |
__assign = Object.assign || function __assign(t) { |
| 3334 |
for (var s, i = 1, n = arguments.length; i < n; i++) { |
| 3335 |
s = arguments[i]; |
| 3336 |
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; |
| 3337 |
} |
| 3338 |
return t; |
| 3339 |
}; |
| 3340 |
return __assign.apply(this, arguments); |
| 3341 |
}; |
| 3342 |
function __spreadArray(to, from, pack) { |
| 3343 |
if (pack || arguments.length === 2) { |
| 3344 |
for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) { |
| 3345 |
if (!ar) ar = Array.prototype.slice.call(from, 0, i); |
| 3346 |
ar[i] = from[i]; |
| 3347 |
} |
| 3348 |
} |
| 3349 |
return to.concat(ar || Array.prototype.slice.call(from)); |
| 3350 |
} |
| 3351 |
|
| 3352 |
//#endregion |
| 3353 |
//#region node_modules/styled-components/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js |
| 3354 |
function memoize(fn) { |
| 3355 |
var cache = Object.create(null); |
| 3356 |
return function(arg) { |
| 3357 |
if (cache[arg] === void 0) cache[arg] = fn(arg); |
| 3358 |
return cache[arg]; |
| 3359 |
}; |
| 3360 |
} |
| 3361 |
|
| 3362 |
//#endregion |
| 3363 |
//#region node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js |
| 3364 |
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; |
| 3365 |
var isPropValid = /* #__PURE__ */ memoize(function(prop) { |
| 3366 |
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91; |
| 3367 |
}); |
| 3368 |
|
| 3369 |
//#endregion |
| 3370 |
//#region node_modules/shallowequal/index.js |
| 3371 |
var require_shallowequal = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 3372 |
module.exports = function shallowEqual(objA, objB, compare, compareContext) { |
| 3373 |
var ret = compare ? compare.call(compareContext, objA, objB) : void 0; |
| 3374 |
if (ret !== void 0) return !!ret; |
| 3375 |
if (objA === objB) return true; |
| 3376 |
if (typeof objA !== "object" || !objA || typeof objB !== "object" || !objB) return false; |
| 3377 |
var keysA = Object.keys(objA); |
| 3378 |
var keysB = Object.keys(objB); |
| 3379 |
if (keysA.length !== keysB.length) return false; |
| 3380 |
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB); |
| 3381 |
for (var idx = 0; idx < keysA.length; idx++) { |
| 3382 |
var key = keysA[idx]; |
| 3383 |
if (!bHasOwnProperty(key)) return false; |
| 3384 |
var valueA = objA[key]; |
| 3385 |
var valueB = objB[key]; |
| 3386 |
ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0; |
| 3387 |
if (ret === false || ret === void 0 && valueA !== valueB) return false; |
| 3388 |
} |
| 3389 |
return true; |
| 3390 |
}; |
| 3391 |
})); |
| 3392 |
|
| 3393 |
//#endregion |
| 3394 |
//#region node_modules/styled-components/node_modules/stylis/src/Enum.js |
| 3395 |
var MS = "-ms-"; |
| 3396 |
var MOZ = "-moz-"; |
| 3397 |
var WEBKIT = "-webkit-"; |
| 3398 |
var COMMENT = "comm"; |
| 3399 |
var RULESET = "rule"; |
| 3400 |
var DECLARATION = "decl"; |
| 3401 |
var IMPORT = "@import"; |
| 3402 |
var KEYFRAMES = "@keyframes"; |
| 3403 |
var LAYER = "@layer"; |
| 3404 |
|
| 3405 |
//#endregion |
| 3406 |
//#region node_modules/styled-components/node_modules/stylis/src/Utility.js |
| 3407 |
/** |
| 3408 |
* @param {number} |
| 3409 |
* @return {number} |
| 3410 |
*/ |
| 3411 |
var abs = Math.abs; |
| 3412 |
/** |
| 3413 |
* @param {number} |
| 3414 |
* @return {string} |
| 3415 |
*/ |
| 3416 |
var from = String.fromCharCode; |
| 3417 |
/** |
| 3418 |
* @param {object} |
| 3419 |
* @return {object} |
| 3420 |
*/ |
| 3421 |
var assign = Object.assign; |
| 3422 |
/** |
| 3423 |
* @param {string} value |
| 3424 |
* @param {number} length |
| 3425 |
* @return {number} |
| 3426 |
*/ |
| 3427 |
function hash(value, length) { |
| 3428 |
return charat(value, 0) ^ 45 ? (((length << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0; |
| 3429 |
} |
| 3430 |
/** |
| 3431 |
* @param {string} value |
| 3432 |
* @return {string} |
| 3433 |
*/ |
| 3434 |
function trim(value) { |
| 3435 |
return value.trim(); |
| 3436 |
} |
| 3437 |
/** |
| 3438 |
* @param {string} value |
| 3439 |
* @param {RegExp} pattern |
| 3440 |
* @return {string?} |
| 3441 |
*/ |
| 3442 |
function match(value, pattern) { |
| 3443 |
return (value = pattern.exec(value)) ? value[0] : value; |
| 3444 |
} |
| 3445 |
/** |
| 3446 |
* @param {string} value |
| 3447 |
* @param {(string|RegExp)} pattern |
| 3448 |
* @param {string} replacement |
| 3449 |
* @return {string} |
| 3450 |
*/ |
| 3451 |
function replace(value, pattern, replacement) { |
| 3452 |
return value.replace(pattern, replacement); |
| 3453 |
} |
| 3454 |
/** |
| 3455 |
* @param {string} value |
| 3456 |
* @param {string} search |
| 3457 |
* @param {number} position |
| 3458 |
* @return {number} |
| 3459 |
*/ |
| 3460 |
function indexof(value, search, position) { |
| 3461 |
return value.indexOf(search, position); |
| 3462 |
} |
| 3463 |
/** |
| 3464 |
* @param {string} value |
| 3465 |
* @param {number} index |
| 3466 |
* @return {number} |
| 3467 |
*/ |
| 3468 |
function charat(value, index) { |
| 3469 |
return value.charCodeAt(index) | 0; |
| 3470 |
} |
| 3471 |
/** |
| 3472 |
* @param {string} value |
| 3473 |
* @param {number} begin |
| 3474 |
* @param {number} end |
| 3475 |
* @return {string} |
| 3476 |
*/ |
| 3477 |
function substr(value, begin, end) { |
| 3478 |
return value.slice(begin, end); |
| 3479 |
} |
| 3480 |
/** |
| 3481 |
* @param {string} value |
| 3482 |
* @return {number} |
| 3483 |
*/ |
| 3484 |
function strlen(value) { |
| 3485 |
return value.length; |
| 3486 |
} |
| 3487 |
/** |
| 3488 |
* @param {any[]} value |
| 3489 |
* @return {number} |
| 3490 |
*/ |
| 3491 |
function sizeof(value) { |
| 3492 |
return value.length; |
| 3493 |
} |
| 3494 |
/** |
| 3495 |
* @param {any} value |
| 3496 |
* @param {any[]} array |
| 3497 |
* @return {any} |
| 3498 |
*/ |
| 3499 |
function append(value, array) { |
| 3500 |
return array.push(value), value; |
| 3501 |
} |
| 3502 |
/** |
| 3503 |
* @param {string[]} array |
| 3504 |
* @param {function} callback |
| 3505 |
* @return {string} |
| 3506 |
*/ |
| 3507 |
function combine(array, callback) { |
| 3508 |
return array.map(callback).join(""); |
| 3509 |
} |
| 3510 |
/** |
| 3511 |
* @param {string[]} array |
| 3512 |
* @param {RegExp} pattern |
| 3513 |
* @return {string[]} |
| 3514 |
*/ |
| 3515 |
function filter(array, pattern) { |
| 3516 |
return array.filter(function(value) { |
| 3517 |
return !match(value, pattern); |
| 3518 |
}); |
| 3519 |
} |
| 3520 |
|
| 3521 |
//#endregion |
| 3522 |
//#region node_modules/styled-components/node_modules/stylis/src/Tokenizer.js |
| 3523 |
var line = 1; |
| 3524 |
var column = 1; |
| 3525 |
var length = 0; |
| 3526 |
var position = 0; |
| 3527 |
var character = 0; |
| 3528 |
var characters = ""; |
| 3529 |
/** |
| 3530 |
* @param {string} value |
| 3531 |
* @param {object | null} root |
| 3532 |
* @param {object | null} parent |
| 3533 |
* @param {string} type |
| 3534 |
* @param {string[] | string} props |
| 3535 |
* @param {object[] | string} children |
| 3536 |
* @param {object[]} siblings |
| 3537 |
* @param {number} length |
| 3538 |
*/ |
| 3539 |
function node(value, root, parent, type, props, children, length, siblings) { |
| 3540 |
return { |
| 3541 |
value, |
| 3542 |
root, |
| 3543 |
parent, |
| 3544 |
type, |
| 3545 |
props, |
| 3546 |
children, |
| 3547 |
line, |
| 3548 |
column, |
| 3549 |
length, |
| 3550 |
return: "", |
| 3551 |
siblings |
| 3552 |
}; |
| 3553 |
} |
| 3554 |
/** |
| 3555 |
* @param {object} root |
| 3556 |
* @param {object} props |
| 3557 |
* @return {object} |
| 3558 |
*/ |
| 3559 |
function copy(root, props) { |
| 3560 |
return assign(node("", null, null, "", null, null, 0, root.siblings), root, { length: -root.length }, props); |
| 3561 |
} |
| 3562 |
/** |
| 3563 |
* @param {object} root |
| 3564 |
*/ |
| 3565 |
function lift(root) { |
| 3566 |
while (root.root) root = copy(root.root, { children: [root] }); |
| 3567 |
append(root, root.siblings); |
| 3568 |
} |
| 3569 |
/** |
| 3570 |
* @return {number} |
| 3571 |
*/ |
| 3572 |
function char() { |
| 3573 |
return character; |
| 3574 |
} |
| 3575 |
/** |
| 3576 |
* @return {number} |
| 3577 |
*/ |
| 3578 |
function prev() { |
| 3579 |
character = position > 0 ? charat(characters, --position) : 0; |
| 3580 |
if (column--, character === 10) column = 1, line--; |
| 3581 |
return character; |
| 3582 |
} |
| 3583 |
/** |
| 3584 |
* @return {number} |
| 3585 |
*/ |
| 3586 |
function next() { |
| 3587 |
character = position < length ? charat(characters, position++) : 0; |
| 3588 |
if (column++, character === 10) column = 1, line++; |
| 3589 |
return character; |
| 3590 |
} |
| 3591 |
/** |
| 3592 |
* @return {number} |
| 3593 |
*/ |
| 3594 |
function peek() { |
| 3595 |
return charat(characters, position); |
| 3596 |
} |
| 3597 |
/** |
| 3598 |
* @return {number} |
| 3599 |
*/ |
| 3600 |
function caret() { |
| 3601 |
return position; |
| 3602 |
} |
| 3603 |
/** |
| 3604 |
* @param {number} begin |
| 3605 |
* @param {number} end |
| 3606 |
* @return {string} |
| 3607 |
*/ |
| 3608 |
function slice(begin, end) { |
| 3609 |
return substr(characters, begin, end); |
| 3610 |
} |
| 3611 |
/** |
| 3612 |
* @param {number} type |
| 3613 |
* @return {number} |
| 3614 |
*/ |
| 3615 |
function token(type) { |
| 3616 |
switch (type) { |
| 3617 |
case 0: |
| 3618 |
case 9: |
| 3619 |
case 10: |
| 3620 |
case 13: |
| 3621 |
case 32: return 5; |
| 3622 |
case 33: |
| 3623 |
case 43: |
| 3624 |
case 44: |
| 3625 |
case 47: |
| 3626 |
case 62: |
| 3627 |
case 64: |
| 3628 |
case 126: |
| 3629 |
case 59: |
| 3630 |
case 123: |
| 3631 |
case 125: return 4; |
| 3632 |
case 58: return 3; |
| 3633 |
case 34: |
| 3634 |
case 39: |
| 3635 |
case 40: |
| 3636 |
case 91: return 2; |
| 3637 |
case 41: |
| 3638 |
case 93: return 1; |
| 3639 |
} |
| 3640 |
return 0; |
| 3641 |
} |
| 3642 |
/** |
| 3643 |
* @param {string} value |
| 3644 |
* @return {any[]} |
| 3645 |
*/ |
| 3646 |
function alloc(value) { |
| 3647 |
return line = column = 1, length = strlen(characters = value), position = 0, []; |
| 3648 |
} |
| 3649 |
/** |
| 3650 |
* @param {any} value |
| 3651 |
* @return {any} |
| 3652 |
*/ |
| 3653 |
function dealloc(value) { |
| 3654 |
return characters = "", value; |
| 3655 |
} |
| 3656 |
/** |
| 3657 |
* @param {number} type |
| 3658 |
* @return {string} |
| 3659 |
*/ |
| 3660 |
function delimit(type) { |
| 3661 |
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))); |
| 3662 |
} |
| 3663 |
/** |
| 3664 |
* @param {number} type |
| 3665 |
* @return {string} |
| 3666 |
*/ |
| 3667 |
function whitespace(type) { |
| 3668 |
while (character = peek()) if (character < 33) next(); |
| 3669 |
else break; |
| 3670 |
return token(type) > 2 || token(character) > 3 ? "" : " "; |
| 3671 |
} |
| 3672 |
/** |
| 3673 |
* @param {number} index |
| 3674 |
* @param {number} count |
| 3675 |
* @return {string} |
| 3676 |
*/ |
| 3677 |
function escaping(index, count) { |
| 3678 |
while (--count && next()) if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97) break; |
| 3679 |
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32)); |
| 3680 |
} |
| 3681 |
/** |
| 3682 |
* @param {number} type |
| 3683 |
* @return {number} |
| 3684 |
*/ |
| 3685 |
function delimiter(type) { |
| 3686 |
while (next()) switch (character) { |
| 3687 |
case type: return position; |
| 3688 |
case 34: |
| 3689 |
case 39: |
| 3690 |
if (type !== 34 && type !== 39) delimiter(character); |
| 3691 |
break; |
| 3692 |
case 40: |
| 3693 |
if (type === 41) delimiter(type); |
| 3694 |
break; |
| 3695 |
case 92: |
| 3696 |
next(); |
| 3697 |
break; |
| 3698 |
} |
| 3699 |
return position; |
| 3700 |
} |
| 3701 |
/** |
| 3702 |
* @param {number} type |
| 3703 |
* @param {number} index |
| 3704 |
* @return {number} |
| 3705 |
*/ |
| 3706 |
function commenter(type, index) { |
| 3707 |
while (next()) if (type + character === 57) break; |
| 3708 |
else if (type + character === 84 && peek() === 47) break; |
| 3709 |
return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next()); |
| 3710 |
} |
| 3711 |
/** |
| 3712 |
* @param {number} index |
| 3713 |
* @return {string} |
| 3714 |
*/ |
| 3715 |
function identifier(index) { |
| 3716 |
while (!token(peek())) next(); |
| 3717 |
return slice(index, position); |
| 3718 |
} |
| 3719 |
|
| 3720 |
//#endregion |
| 3721 |
//#region node_modules/styled-components/node_modules/stylis/src/Parser.js |
| 3722 |
/** |
| 3723 |
* @param {string} value |
| 3724 |
* @return {object[]} |
| 3725 |
*/ |
| 3726 |
function compile(value) { |
| 3727 |
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value)); |
| 3728 |
} |
| 3729 |
/** |
| 3730 |
* @param {string} value |
| 3731 |
* @param {object} root |
| 3732 |
* @param {object?} parent |
| 3733 |
* @param {string[]} rule |
| 3734 |
* @param {string[]} rules |
| 3735 |
* @param {string[]} rulesets |
| 3736 |
* @param {number[]} pseudo |
| 3737 |
* @param {number[]} points |
| 3738 |
* @param {string[]} declarations |
| 3739 |
* @return {object} |
| 3740 |
*/ |
| 3741 |
function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { |
| 3742 |
var index = 0; |
| 3743 |
var offset = 0; |
| 3744 |
var length = pseudo; |
| 3745 |
var atrule = 0; |
| 3746 |
var property = 0; |
| 3747 |
var previous = 0; |
| 3748 |
var variable = 1; |
| 3749 |
var scanning = 1; |
| 3750 |
var ampersand = 1; |
| 3751 |
var character = 0; |
| 3752 |
var type = ""; |
| 3753 |
var props = rules; |
| 3754 |
var children = rulesets; |
| 3755 |
var reference = rule; |
| 3756 |
var characters = type; |
| 3757 |
while (scanning) switch (previous = character, character = next()) { |
| 3758 |
case 40: if (previous != 108 && charat(characters, length - 1) == 58) { |
| 3759 |
if (indexof(characters += replace(delimit(character), "&", "&\f"), "&\f", abs(index ? points[index - 1] : 0)) != -1) ampersand = -1; |
| 3760 |
break; |
| 3761 |
} |
| 3762 |
case 34: |
| 3763 |
case 39: |
| 3764 |
case 91: |
| 3765 |
characters += delimit(character); |
| 3766 |
break; |
| 3767 |
case 9: |
| 3768 |
case 10: |
| 3769 |
case 13: |
| 3770 |
case 32: |
| 3771 |
characters += whitespace(previous); |
| 3772 |
break; |
| 3773 |
case 92: |
| 3774 |
characters += escaping(caret() - 1, 7); |
| 3775 |
continue; |
| 3776 |
case 47: |
| 3777 |
switch (peek()) { |
| 3778 |
case 42: |
| 3779 |
case 47: |
| 3780 |
append(comment(commenter(next(), caret()), root, parent, declarations), declarations); |
| 3781 |
break; |
| 3782 |
default: characters += "/"; |
| 3783 |
} |
| 3784 |
break; |
| 3785 |
case 123 * variable: points[index++] = strlen(characters) * ampersand; |
| 3786 |
case 125 * variable: |
| 3787 |
case 59: |
| 3788 |
case 0: |
| 3789 |
switch (character) { |
| 3790 |
case 0: |
| 3791 |
case 125: scanning = 0; |
| 3792 |
case 59 + offset: |
| 3793 |
if (ampersand == -1) characters = replace(characters, /\f/g, ""); |
| 3794 |
if (property > 0 && strlen(characters) - length) append(property > 32 ? declaration(characters + ";", rule, parent, length - 1, declarations) : declaration(replace(characters, " ", "") + ";", rule, parent, length - 2, declarations), declarations); |
| 3795 |
break; |
| 3796 |
case 59: characters += ";"; |
| 3797 |
default: |
| 3798 |
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets); |
| 3799 |
if (character === 123) if (offset === 0) parse(characters, root, reference, reference, props, rulesets, length, points, children); |
| 3800 |
else switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) { |
| 3801 |
case 100: |
| 3802 |
case 108: |
| 3803 |
case 109: |
| 3804 |
case 115: |
| 3805 |
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children); |
| 3806 |
break; |
| 3807 |
default: parse(characters, reference, reference, reference, [""], children, 0, points, children); |
| 3808 |
} |
| 3809 |
} |
| 3810 |
index = offset = property = 0, variable = ampersand = 1, type = characters = "", length = pseudo; |
| 3811 |
break; |
| 3812 |
case 58: length = 1 + strlen(characters), property = previous; |
| 3813 |
default: |
| 3814 |
if (variable < 1) { |
| 3815 |
if (character == 123) --variable; |
| 3816 |
else if (character == 125 && variable++ == 0 && prev() == 125) continue; |
| 3817 |
} |
| 3818 |
switch (characters += from(character), character * variable) { |
| 3819 |
case 38: |
| 3820 |
ampersand = offset > 0 ? 1 : (characters += "\f", -1); |
| 3821 |
break; |
| 3822 |
case 44: |
| 3823 |
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1; |
| 3824 |
break; |
| 3825 |
case 64: |
| 3826 |
if (peek() === 45) characters += delimit(next()); |
| 3827 |
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++; |
| 3828 |
break; |
| 3829 |
case 45: if (previous === 45 && strlen(characters) == 2) variable = 0; |
| 3830 |
} |
| 3831 |
} |
| 3832 |
return rulesets; |
| 3833 |
} |
| 3834 |
/** |
| 3835 |
* @param {string} value |
| 3836 |
* @param {object} root |
| 3837 |
* @param {object?} parent |
| 3838 |
* @param {number} index |
| 3839 |
* @param {number} offset |
| 3840 |
* @param {string[]} rules |
| 3841 |
* @param {number[]} points |
| 3842 |
* @param {string} type |
| 3843 |
* @param {string[]} props |
| 3844 |
* @param {string[]} children |
| 3845 |
* @param {number} length |
| 3846 |
* @param {object[]} siblings |
| 3847 |
* @return {object} |
| 3848 |
*/ |
| 3849 |
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length, siblings) { |
| 3850 |
var post = offset - 1; |
| 3851 |
var rule = offset === 0 ? rules : [""]; |
| 3852 |
var size = sizeof(rule); |
| 3853 |
for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x]))) props[k++] = z; |
| 3854 |
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings); |
| 3855 |
} |
| 3856 |
/** |
| 3857 |
* @param {number} value |
| 3858 |
* @param {object} root |
| 3859 |
* @param {object?} parent |
| 3860 |
* @param {object[]} siblings |
| 3861 |
* @return {object} |
| 3862 |
*/ |
| 3863 |
function comment(value, root, parent, siblings) { |
| 3864 |
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings); |
| 3865 |
} |
| 3866 |
/** |
| 3867 |
* @param {string} value |
| 3868 |
* @param {object} root |
| 3869 |
* @param {object?} parent |
| 3870 |
* @param {number} length |
| 3871 |
* @param {object[]} siblings |
| 3872 |
* @return {object} |
| 3873 |
*/ |
| 3874 |
function declaration(value, root, parent, length, siblings) { |
| 3875 |
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings); |
| 3876 |
} |
| 3877 |
|
| 3878 |
//#endregion |
| 3879 |
//#region node_modules/styled-components/node_modules/stylis/src/Prefixer.js |
| 3880 |
/** |
| 3881 |
* @param {string} value |
| 3882 |
* @param {number} length |
| 3883 |
* @param {object[]} children |
| 3884 |
* @return {string} |
| 3885 |
*/ |
| 3886 |
function prefix(value, length, children) { |
| 3887 |
switch (hash(value, length)) { |
| 3888 |
case 5103: return WEBKIT + "print-" + value + value; |
| 3889 |
case 5737: |
| 3890 |
case 4201: |
| 3891 |
case 3177: |
| 3892 |
case 3433: |
| 3893 |
case 1641: |
| 3894 |
case 4457: |
| 3895 |
case 2921: |
| 3896 |
case 5572: |
| 3897 |
case 6356: |
| 3898 |
case 5844: |
| 3899 |
case 3191: |
| 3900 |
case 6645: |
| 3901 |
case 3005: |
| 3902 |
case 6391: |
| 3903 |
case 5879: |
| 3904 |
case 5623: |
| 3905 |
case 6135: |
| 3906 |
case 4599: |
| 3907 |
case 4855: |
| 3908 |
case 4215: |
| 3909 |
case 6389: |
| 3910 |
case 5109: |
| 3911 |
case 5365: |
| 3912 |
case 5621: |
| 3913 |
case 3829: return WEBKIT + value + value; |
| 3914 |
case 4789: return MOZ + value + value; |
| 3915 |
case 5349: |
| 3916 |
case 4246: |
| 3917 |
case 4810: |
| 3918 |
case 6968: |
| 3919 |
case 2756: return WEBKIT + value + MOZ + value + MS + value + value; |
| 3920 |
case 5936: switch (charat(value, length + 11)) { |
| 3921 |
case 114: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value; |
| 3922 |
case 108: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value; |
| 3923 |
case 45: return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value; |
| 3924 |
} |
| 3925 |
case 6828: |
| 3926 |
case 4268: |
| 3927 |
case 2903: return WEBKIT + value + MS + value + value; |
| 3928 |
case 6165: return WEBKIT + value + MS + "flex-" + value + value; |
| 3929 |
case 5187: return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value; |
| 3930 |
case 5443: return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (!match(value, /flex-|baseline/) ? MS + "grid-row-" + replace(value, /flex-|-self/g, "") : "") + value; |
| 3931 |
case 4675: return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value; |
| 3932 |
case 5548: return WEBKIT + value + MS + replace(value, "shrink", "negative") + value; |
| 3933 |
case 5292: return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value; |
| 3934 |
case 6060: return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value; |
| 3935 |
case 4554: return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value; |
| 3936 |
case 6187: return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value; |
| 3937 |
case 5495: |
| 3938 |
case 3959: return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1"); |
| 3939 |
case 4968: return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value; |
| 3940 |
case 4200: |
| 3941 |
if (!match(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length) + value; |
| 3942 |
break; |
| 3943 |
case 2592: |
| 3944 |
case 3360: return MS + replace(value, "template-", "") + value; |
| 3945 |
case 4384: |
| 3946 |
case 3616: |
| 3947 |
if (children && children.some(function(element, index) { |
| 3948 |
return length = index, match(element.props, /grid-\w+-end/); |
| 3949 |
})) return ~indexof(value + (children = children[length].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ";"; |
| 3950 |
return MS + replace(value, "-start", "") + value; |
| 3951 |
case 4896: |
| 3952 |
case 4128: return children && children.some(function(element) { |
| 3953 |
return match(element.props, /grid-\w+-start/); |
| 3954 |
}) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value; |
| 3955 |
case 4095: |
| 3956 |
case 3583: |
| 3957 |
case 4068: |
| 3958 |
case 2532: return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value; |
| 3959 |
case 8116: |
| 3960 |
case 7059: |
| 3961 |
case 5753: |
| 3962 |
case 5535: |
| 3963 |
case 5445: |
| 3964 |
case 5701: |
| 3965 |
case 4933: |
| 3966 |
case 4677: |
| 3967 |
case 5533: |
| 3968 |
case 5789: |
| 3969 |
case 5021: |
| 3970 |
case 4765: |
| 3971 |
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) { |
| 3972 |
case 109: if (charat(value, length + 4) !== 45) break; |
| 3973 |
case 102: return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length + 3) == 108 ? "$3" : "$2-$3")) + value; |
| 3974 |
case 115: return ~indexof(value, "stretch", 0) ? prefix(replace(value, "stretch", "fill-available"), length, children) + value : value; |
| 3975 |
} |
| 3976 |
break; |
| 3977 |
case 5152: |
| 3978 |
case 5920: return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_, a, b, c, d, e, f) { |
| 3979 |
return MS + a + ":" + b + f + (c ? MS + a + "-span:" + (d ? e : +e - +b) + f : "") + value; |
| 3980 |
}); |
| 3981 |
case 4949: |
| 3982 |
if (charat(value, length + 6) === 121) return replace(value, ":", ":" + WEBKIT) + value; |
| 3983 |
break; |
| 3984 |
case 6444: |
| 3985 |
switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) { |
| 3986 |
case 120: return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value; |
| 3987 |
case 100: return replace(value, ":", ":" + MS) + value; |
| 3988 |
} |
| 3989 |
break; |
| 3990 |
case 5719: |
| 3991 |
case 2647: |
| 3992 |
case 2135: |
| 3993 |
case 3927: |
| 3994 |
case 2391: return replace(value, "scroll-", "scroll-snap-") + value; |
| 3995 |
} |
| 3996 |
return value; |
| 3997 |
} |
| 3998 |
|
| 3999 |
//#endregion |
| 4000 |
//#region node_modules/styled-components/node_modules/stylis/src/Serializer.js |
| 4001 |
/** |
| 4002 |
* @param {object[]} children |
| 4003 |
* @param {function} callback |
| 4004 |
* @return {string} |
| 4005 |
*/ |
| 4006 |
function serialize(children, callback) { |
| 4007 |
var output = ""; |
| 4008 |
for (var i = 0; i < children.length; i++) output += callback(children[i], i, children, callback) || ""; |
| 4009 |
return output; |
| 4010 |
} |
| 4011 |
/** |
| 4012 |
* @param {object} element |
| 4013 |
* @param {number} index |
| 4014 |
* @param {object[]} children |
| 4015 |
* @param {function} callback |
| 4016 |
* @return {string} |
| 4017 |
*/ |
| 4018 |
function stringify(element, index, children, callback) { |
| 4019 |
switch (element.type) { |
| 4020 |
case LAYER: if (element.children.length) break; |
| 4021 |
case IMPORT: |
| 4022 |
case DECLARATION: return element.return = element.return || element.value; |
| 4023 |
case COMMENT: return ""; |
| 4024 |
case KEYFRAMES: return element.return = element.value + "{" + serialize(element.children, callback) + "}"; |
| 4025 |
case RULESET: if (!strlen(element.value = element.props.join(","))) return ""; |
| 4026 |
} |
| 4027 |
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : ""; |
| 4028 |
} |
| 4029 |
|
| 4030 |
//#endregion |
| 4031 |
//#region node_modules/styled-components/node_modules/stylis/src/Middleware.js |
| 4032 |
/** |
| 4033 |
* @param {function[]} collection |
| 4034 |
* @return {function} |
| 4035 |
*/ |
| 4036 |
function middleware(collection) { |
| 4037 |
var length = sizeof(collection); |
| 4038 |
return function(element, index, children, callback) { |
| 4039 |
var output = ""; |
| 4040 |
for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || ""; |
| 4041 |
return output; |
| 4042 |
}; |
| 4043 |
} |
| 4044 |
/** |
| 4045 |
* @param {function} callback |
| 4046 |
* @return {function} |
| 4047 |
*/ |
| 4048 |
function rulesheet(callback) { |
| 4049 |
return function(element) { |
| 4050 |
if (!element.root) { |
| 4051 |
if (element = element.return) callback(element); |
| 4052 |
} |
| 4053 |
}; |
| 4054 |
} |
| 4055 |
/** |
| 4056 |
* @param {object} element |
| 4057 |
* @param {number} index |
| 4058 |
* @param {object[]} children |
| 4059 |
* @param {function} callback |
| 4060 |
*/ |
| 4061 |
function prefixer(element, index, children, callback) { |
| 4062 |
if (element.length > -1) { |
| 4063 |
if (!element.return) switch (element.type) { |
| 4064 |
case DECLARATION: |
| 4065 |
element.return = prefix(element.value, element.length, children); |
| 4066 |
return; |
| 4067 |
case KEYFRAMES: return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback); |
| 4068 |
case RULESET: if (element.length) return combine(children = element.props, function(value) { |
| 4069 |
switch (match(value, callback = /(::plac\w+|:read-\w+)/)) { |
| 4070 |
case ":read-only": |
| 4071 |
case ":read-write": |
| 4072 |
lift(copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] })); |
| 4073 |
lift(copy(element, { props: [value] })); |
| 4074 |
assign(element, { props: filter(children, callback) }); |
| 4075 |
break; |
| 4076 |
case "::placeholder": |
| 4077 |
lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] })); |
| 4078 |
lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] })); |
| 4079 |
lift(copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] })); |
| 4080 |
lift(copy(element, { props: [value] })); |
| 4081 |
assign(element, { props: filter(children, callback) }); |
| 4082 |
break; |
| 4083 |
} |
| 4084 |
return ""; |
| 4085 |
}); |
| 4086 |
} |
| 4087 |
} |
| 4088 |
} |
| 4089 |
|
| 4090 |
//#endregion |
| 4091 |
//#region node_modules/styled-components/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js |
| 4092 |
var import_shallowequal = /* @__PURE__ */ __toESM(require_shallowequal()); |
| 4093 |
var unitlessKeys = { |
| 4094 |
animationIterationCount: 1, |
| 4095 |
aspectRatio: 1, |
| 4096 |
borderImageOutset: 1, |
| 4097 |
borderImageSlice: 1, |
| 4098 |
borderImageWidth: 1, |
| 4099 |
boxFlex: 1, |
| 4100 |
boxFlexGroup: 1, |
| 4101 |
boxOrdinalGroup: 1, |
| 4102 |
columnCount: 1, |
| 4103 |
columns: 1, |
| 4104 |
flex: 1, |
| 4105 |
flexGrow: 1, |
| 4106 |
flexPositive: 1, |
| 4107 |
flexShrink: 1, |
| 4108 |
flexNegative: 1, |
| 4109 |
flexOrder: 1, |
| 4110 |
gridRow: 1, |
| 4111 |
gridRowEnd: 1, |
| 4112 |
gridRowSpan: 1, |
| 4113 |
gridRowStart: 1, |
| 4114 |
gridColumn: 1, |
| 4115 |
gridColumnEnd: 1, |
| 4116 |
gridColumnSpan: 1, |
| 4117 |
gridColumnStart: 1, |
| 4118 |
msGridRow: 1, |
| 4119 |
msGridRowSpan: 1, |
| 4120 |
msGridColumn: 1, |
| 4121 |
msGridColumnSpan: 1, |
| 4122 |
fontWeight: 1, |
| 4123 |
lineHeight: 1, |
| 4124 |
opacity: 1, |
| 4125 |
order: 1, |
| 4126 |
orphans: 1, |
| 4127 |
tabSize: 1, |
| 4128 |
widows: 1, |
| 4129 |
zIndex: 1, |
| 4130 |
zoom: 1, |
| 4131 |
WebkitLineClamp: 1, |
| 4132 |
fillOpacity: 1, |
| 4133 |
floodOpacity: 1, |
| 4134 |
stopOpacity: 1, |
| 4135 |
strokeDasharray: 1, |
| 4136 |
strokeDashoffset: 1, |
| 4137 |
strokeMiterlimit: 1, |
| 4138 |
strokeOpacity: 1, |
| 4139 |
strokeWidth: 1 |
| 4140 |
}; |
| 4141 |
|
| 4142 |
//#endregion |
| 4143 |
//#region node_modules/styled-components/dist/styled-components.browser.esm.js |
| 4144 |
var f = "undefined" != typeof process && ({}.REACT_APP_SC_ATTR || {}.SC_ATTR) || "data-styled"; |
| 4145 |
var m = "active"; |
| 4146 |
var y = "data-styled-version"; |
| 4147 |
var v = "6.1.19"; |
| 4148 |
var g = "/*!sc*/\n"; |
| 4149 |
var S = "undefined" != typeof window && "undefined" != typeof document; |
| 4150 |
var w = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== {}.REACT_APP_SC_DISABLE_SPEEDY && "" !== {}.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== {}.REACT_APP_SC_DISABLE_SPEEDY && {}.REACT_APP_SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== {}.SC_DISABLE_SPEEDY && "" !== {}.SC_DISABLE_SPEEDY ? "false" !== {}.SC_DISABLE_SPEEDY && {}.SC_DISABLE_SPEEDY : true); |
| 4151 |
var E = /invalid hook call/i; |
| 4152 |
var N = /* @__PURE__ */ new Set(); |
| 4153 |
var P = function(t, n) { |
| 4154 |
var o = n ? " with the id of \"".concat(n, "\"") : ""; |
| 4155 |
var s = "The component ".concat(t).concat(o, " has been created dynamically.\n") + "You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n"; |
| 4156 |
var i = console.error; |
| 4157 |
try { |
| 4158 |
var a = !0; |
| 4159 |
console.error = function(t) { |
| 4160 |
for (var n = [], o = 1; o < arguments.length; o++) n[o - 1] = arguments[o]; |
| 4161 |
E.test(t) ? (a = !1, N.delete(s)) : i.apply(void 0, __spreadArray([t], n, !1)); |
| 4162 |
}, (0, react.useRef)(), a && !N.has(s) && (console.warn(s), N.add(s)); |
| 4163 |
} catch (e) { |
| 4164 |
E.test(e.message) && N.delete(s); |
| 4165 |
} finally { |
| 4166 |
console.error = i; |
| 4167 |
} |
| 4168 |
}; |
| 4169 |
var _ = Object.freeze([]); |
| 4170 |
var C = Object.freeze({}); |
| 4171 |
function I(e, t, n) { |
| 4172 |
return void 0 === n && (n = C), e.theme !== n.theme && e.theme || t || n.theme; |
| 4173 |
} |
| 4174 |
var A = /* @__PURE__ */ new Set([ |
| 4175 |
"a", |
| 4176 |
"abbr", |
| 4177 |
"address", |
| 4178 |
"area", |
| 4179 |
"article", |
| 4180 |
"aside", |
| 4181 |
"audio", |
| 4182 |
"b", |
| 4183 |
"base", |
| 4184 |
"bdi", |
| 4185 |
"bdo", |
| 4186 |
"big", |
| 4187 |
"blockquote", |
| 4188 |
"body", |
| 4189 |
"br", |
| 4190 |
"button", |
| 4191 |
"canvas", |
| 4192 |
"caption", |
| 4193 |
"cite", |
| 4194 |
"code", |
| 4195 |
"col", |
| 4196 |
"colgroup", |
| 4197 |
"data", |
| 4198 |
"datalist", |
| 4199 |
"dd", |
| 4200 |
"del", |
| 4201 |
"details", |
| 4202 |
"dfn", |
| 4203 |
"dialog", |
| 4204 |
"div", |
| 4205 |
"dl", |
| 4206 |
"dt", |
| 4207 |
"em", |
| 4208 |
"embed", |
| 4209 |
"fieldset", |
| 4210 |
"figcaption", |
| 4211 |
"figure", |
| 4212 |
"footer", |
| 4213 |
"form", |
| 4214 |
"h1", |
| 4215 |
"h2", |
| 4216 |
"h3", |
| 4217 |
"h4", |
| 4218 |
"h5", |
| 4219 |
"h6", |
| 4220 |
"header", |
| 4221 |
"hgroup", |
| 4222 |
"hr", |
| 4223 |
"html", |
| 4224 |
"i", |
| 4225 |
"iframe", |
| 4226 |
"img", |
| 4227 |
"input", |
| 4228 |
"ins", |
| 4229 |
"kbd", |
| 4230 |
"keygen", |
| 4231 |
"label", |
| 4232 |
"legend", |
| 4233 |
"li", |
| 4234 |
"link", |
| 4235 |
"main", |
| 4236 |
"map", |
| 4237 |
"mark", |
| 4238 |
"menu", |
| 4239 |
"menuitem", |
| 4240 |
"meta", |
| 4241 |
"meter", |
| 4242 |
"nav", |
| 4243 |
"noscript", |
| 4244 |
"object", |
| 4245 |
"ol", |
| 4246 |
"optgroup", |
| 4247 |
"option", |
| 4248 |
"output", |
| 4249 |
"p", |
| 4250 |
"param", |
| 4251 |
"picture", |
| 4252 |
"pre", |
| 4253 |
"progress", |
| 4254 |
"q", |
| 4255 |
"rp", |
| 4256 |
"rt", |
| 4257 |
"ruby", |
| 4258 |
"s", |
| 4259 |
"samp", |
| 4260 |
"script", |
| 4261 |
"section", |
| 4262 |
"select", |
| 4263 |
"small", |
| 4264 |
"source", |
| 4265 |
"span", |
| 4266 |
"strong", |
| 4267 |
"style", |
| 4268 |
"sub", |
| 4269 |
"summary", |
| 4270 |
"sup", |
| 4271 |
"table", |
| 4272 |
"tbody", |
| 4273 |
"td", |
| 4274 |
"textarea", |
| 4275 |
"tfoot", |
| 4276 |
"th", |
| 4277 |
"thead", |
| 4278 |
"time", |
| 4279 |
"tr", |
| 4280 |
"track", |
| 4281 |
"u", |
| 4282 |
"ul", |
| 4283 |
"use", |
| 4284 |
"var", |
| 4285 |
"video", |
| 4286 |
"wbr", |
| 4287 |
"circle", |
| 4288 |
"clipPath", |
| 4289 |
"defs", |
| 4290 |
"ellipse", |
| 4291 |
"foreignObject", |
| 4292 |
"g", |
| 4293 |
"image", |
| 4294 |
"line", |
| 4295 |
"linearGradient", |
| 4296 |
"marker", |
| 4297 |
"mask", |
| 4298 |
"path", |
| 4299 |
"pattern", |
| 4300 |
"polygon", |
| 4301 |
"polyline", |
| 4302 |
"radialGradient", |
| 4303 |
"rect", |
| 4304 |
"stop", |
| 4305 |
"svg", |
| 4306 |
"text", |
| 4307 |
"tspan" |
| 4308 |
]); |
| 4309 |
var O = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g; |
| 4310 |
var D = /(^-|-$)/g; |
| 4311 |
function R(e) { |
| 4312 |
return e.replace(O, "-").replace(D, ""); |
| 4313 |
} |
| 4314 |
var T = /(a)(d)/gi; |
| 4315 |
var k = 52; |
| 4316 |
var j = function(e) { |
| 4317 |
return String.fromCharCode(e + (e > 25 ? 39 : 97)); |
| 4318 |
}; |
| 4319 |
function x(e) { |
| 4320 |
var t; |
| 4321 |
var n = ""; |
| 4322 |
for (t = Math.abs(e); t > k; t = t / k | 0) n = j(t % k) + n; |
| 4323 |
return (j(t % k) + n).replace(T, "$1-$2"); |
| 4324 |
} |
| 4325 |
var V; |
| 4326 |
var F = 5381; |
| 4327 |
var M = function(e, t) { |
| 4328 |
for (var n = t.length; n;) e = 33 * e ^ t.charCodeAt(--n); |
| 4329 |
return e; |
| 4330 |
}; |
| 4331 |
var z = function(e) { |
| 4332 |
return M(F, e); |
| 4333 |
}; |
| 4334 |
function $(e) { |
| 4335 |
return x(z(e) >>> 0); |
| 4336 |
} |
| 4337 |
function B(e) { |
| 4338 |
return "string" == typeof e && e || e.displayName || e.name || "Component"; |
| 4339 |
} |
| 4340 |
function L(e) { |
| 4341 |
return "string" == typeof e && e.charAt(0) === e.charAt(0).toLowerCase(); |
| 4342 |
} |
| 4343 |
var G = "function" == typeof Symbol && Symbol.for; |
| 4344 |
var Y = G ? Symbol.for("react.memo") : 60115; |
| 4345 |
var W = G ? Symbol.for("react.forward_ref") : 60112; |
| 4346 |
var q = { |
| 4347 |
childContextTypes: !0, |
| 4348 |
contextType: !0, |
| 4349 |
contextTypes: !0, |
| 4350 |
defaultProps: !0, |
| 4351 |
displayName: !0, |
| 4352 |
getDefaultProps: !0, |
| 4353 |
getDerivedStateFromError: !0, |
| 4354 |
getDerivedStateFromProps: !0, |
| 4355 |
mixins: !0, |
| 4356 |
propTypes: !0, |
| 4357 |
type: !0 |
| 4358 |
}; |
| 4359 |
var H = { |
| 4360 |
name: !0, |
| 4361 |
length: !0, |
| 4362 |
prototype: !0, |
| 4363 |
caller: !0, |
| 4364 |
callee: !0, |
| 4365 |
arguments: !0, |
| 4366 |
arity: !0 |
| 4367 |
}; |
| 4368 |
var U = { |
| 4369 |
$$typeof: !0, |
| 4370 |
compare: !0, |
| 4371 |
defaultProps: !0, |
| 4372 |
displayName: !0, |
| 4373 |
propTypes: !0, |
| 4374 |
type: !0 |
| 4375 |
}; |
| 4376 |
var J = ((V = {})[W] = { |
| 4377 |
$$typeof: !0, |
| 4378 |
render: !0, |
| 4379 |
defaultProps: !0, |
| 4380 |
displayName: !0, |
| 4381 |
propTypes: !0 |
| 4382 |
}, V[Y] = U, V); |
| 4383 |
function X(e) { |
| 4384 |
return ("type" in (t = e) && t.type.$$typeof) === Y ? U : "$$typeof" in e ? J[e.$$typeof] : q; |
| 4385 |
var t; |
| 4386 |
} |
| 4387 |
var Z = Object.defineProperty; |
| 4388 |
var K = Object.getOwnPropertyNames; |
| 4389 |
var Q = Object.getOwnPropertySymbols; |
| 4390 |
var ee = Object.getOwnPropertyDescriptor; |
| 4391 |
var te = Object.getPrototypeOf; |
| 4392 |
var ne = Object.prototype; |
| 4393 |
function oe(e, t, n) { |
| 4394 |
if ("string" != typeof t) { |
| 4395 |
if (ne) { |
| 4396 |
var o = te(t); |
| 4397 |
o && o !== ne && oe(e, o, n); |
| 4398 |
} |
| 4399 |
var r = K(t); |
| 4400 |
Q && (r = r.concat(Q(t))); |
| 4401 |
for (var s = X(e), i = X(t), a = 0; a < r.length; ++a) { |
| 4402 |
var c = r[a]; |
| 4403 |
if (!(c in H || n && n[c] || i && c in i || s && c in s)) { |
| 4404 |
var l = ee(t, c); |
| 4405 |
try { |
| 4406 |
Z(e, c, l); |
| 4407 |
} catch (e) {} |
| 4408 |
} |
| 4409 |
} |
| 4410 |
} |
| 4411 |
return e; |
| 4412 |
} |
| 4413 |
function re(e) { |
| 4414 |
return "function" == typeof e; |
| 4415 |
} |
| 4416 |
function se(e) { |
| 4417 |
return "object" == typeof e && "styledComponentId" in e; |
| 4418 |
} |
| 4419 |
function ie(e, t) { |
| 4420 |
return e && t ? "".concat(e, " ").concat(t) : e || t || ""; |
| 4421 |
} |
| 4422 |
function ae(e, t) { |
| 4423 |
if (0 === e.length) return ""; |
| 4424 |
for (var n = e[0], o = 1; o < e.length; o++) n += t ? t + e[o] : e[o]; |
| 4425 |
return n; |
| 4426 |
} |
| 4427 |
function ce(e) { |
| 4428 |
return null !== e && "object" == typeof e && e.constructor.name === Object.name && !("props" in e && e.$$typeof); |
| 4429 |
} |
| 4430 |
function le(e, t, n) { |
| 4431 |
if (void 0 === n && (n = !1), !n && !ce(e) && !Array.isArray(e)) return t; |
| 4432 |
if (Array.isArray(t)) for (var o = 0; o < t.length; o++) e[o] = le(e[o], t[o]); |
| 4433 |
else if (ce(t)) for (var o in t) e[o] = le(e[o], t[o]); |
| 4434 |
return e; |
| 4435 |
} |
| 4436 |
function ue(e, t) { |
| 4437 |
Object.defineProperty(e, "toString", { value: t }); |
| 4438 |
} |
| 4439 |
var pe = { |
| 4440 |
1: "Cannot create styled-component for component: %s.\n\n", |
| 4441 |
2: "Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n", |
| 4442 |
3: "Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n", |
| 4443 |
4: "The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n", |
| 4444 |
5: "The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n", |
| 4445 |
6: "Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n", |
| 4446 |
7: "ThemeProvider: Please return an object from your \"theme\" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n", |
| 4447 |
8: "ThemeProvider: Please make your \"theme\" prop an object.\n\n", |
| 4448 |
9: "Missing document `<head>`\n\n", |
| 4449 |
10: "Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n", |
| 4450 |
11: "_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n", |
| 4451 |
12: "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n", |
| 4452 |
13: "%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n", |
| 4453 |
14: "ThemeProvider: \"theme\" prop is required.\n\n", |
| 4454 |
15: "A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n", |
| 4455 |
16: "Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n", |
| 4456 |
17: "CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n", |
| 4457 |
18: "ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`" |
| 4458 |
}; |
| 4459 |
function de() { |
| 4460 |
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t]; |
| 4461 |
for (var n = e[0], o = [], r = 1, s = e.length; r < s; r += 1) o.push(e[r]); |
| 4462 |
return o.forEach(function(e) { |
| 4463 |
n = n.replace(/%[a-z]/, e); |
| 4464 |
}), n; |
| 4465 |
} |
| 4466 |
function he(t) { |
| 4467 |
for (var n = [], o = 1; o < arguments.length; o++) n[o - 1] = arguments[o]; |
| 4468 |
return new Error(de.apply(void 0, __spreadArray([pe[t]], n, !1)).trim()); |
| 4469 |
} |
| 4470 |
var fe = function() { |
| 4471 |
function e(e) { |
| 4472 |
this.groupSizes = /* @__PURE__ */ new Uint32Array(512), this.length = 512, this.tag = e; |
| 4473 |
} |
| 4474 |
return e.prototype.indexOfGroup = function(e) { |
| 4475 |
for (var t = 0, n = 0; n < e; n++) t += this.groupSizes[n]; |
| 4476 |
return t; |
| 4477 |
}, e.prototype.insertRules = function(e, t) { |
| 4478 |
if (e >= this.groupSizes.length) { |
| 4479 |
for (var n = this.groupSizes, o = n.length, r = o; e >= r;) if ((r <<= 1) < 0) throw he(16, "".concat(e)); |
| 4480 |
this.groupSizes = new Uint32Array(r), this.groupSizes.set(n), this.length = r; |
| 4481 |
for (var s = o; s < r; s++) this.groupSizes[s] = 0; |
| 4482 |
} |
| 4483 |
for (var i = this.indexOfGroup(e + 1), a = (s = 0, t.length); s < a; s++) this.tag.insertRule(i, t[s]) && (this.groupSizes[e]++, i++); |
| 4484 |
}, e.prototype.clearGroup = function(e) { |
| 4485 |
if (e < this.length) { |
| 4486 |
var t = this.groupSizes[e]; |
| 4487 |
var n = this.indexOfGroup(e); |
| 4488 |
var o = n + t; |
| 4489 |
this.groupSizes[e] = 0; |
| 4490 |
for (var r = n; r < o; r++) this.tag.deleteRule(n); |
| 4491 |
} |
| 4492 |
}, e.prototype.getGroup = function(e) { |
| 4493 |
var t = ""; |
| 4494 |
if (e >= this.length || 0 === this.groupSizes[e]) return t; |
| 4495 |
for (var n = this.groupSizes[e], o = this.indexOfGroup(e), r = o + n, s = o; s < r; s++) t += "".concat(this.tag.getRule(s)).concat(g); |
| 4496 |
return t; |
| 4497 |
}, e; |
| 4498 |
}(); |
| 4499 |
var me = 1 << 30; |
| 4500 |
var ye = /* @__PURE__ */ new Map(); |
| 4501 |
var ve = /* @__PURE__ */ new Map(); |
| 4502 |
var ge = 1; |
| 4503 |
var Se = function(e) { |
| 4504 |
if (ye.has(e)) return ye.get(e); |
| 4505 |
for (; ve.has(ge);) ge++; |
| 4506 |
var t = ge++; |
| 4507 |
if ((0 | t) < 0 || t > me) throw he(16, "".concat(t)); |
| 4508 |
return ye.set(e, t), ve.set(t, e), t; |
| 4509 |
}; |
| 4510 |
var we = function(e, t) { |
| 4511 |
ge = t + 1, ye.set(e, t), ve.set(t, e); |
| 4512 |
}; |
| 4513 |
var be = "style[".concat(f, "][").concat(y, "=\"").concat(v, "\"]"); |
| 4514 |
var Ee = new RegExp("^".concat(f, "\\.g(\\d+)\\[id=\"([\\w\\d-]+)\"\\].*?\"([^\"]*)")); |
| 4515 |
var Ne = function(e, t, n) { |
| 4516 |
for (var o, r = n.split(","), s = 0, i = r.length; s < i; s++) (o = r[s]) && e.registerName(t, o); |
| 4517 |
}; |
| 4518 |
var Pe = function(e, t) { |
| 4519 |
for (var n, o = (null !== (n = t.textContent) && void 0 !== n ? n : "").split(g), r = [], s = 0, i = o.length; s < i; s++) { |
| 4520 |
var a = o[s].trim(); |
| 4521 |
if (a) { |
| 4522 |
var c = a.match(Ee); |
| 4523 |
if (c) { |
| 4524 |
var l = 0 | parseInt(c[1], 10); |
| 4525 |
var u = c[2]; |
| 4526 |
0 !== l && (we(u, l), Ne(e, u, c[3]), e.getTag().insertRules(l, r)), r.length = 0; |
| 4527 |
} else r.push(a); |
| 4528 |
} |
| 4529 |
} |
| 4530 |
}; |
| 4531 |
var _e = function(e) { |
| 4532 |
for (var t = document.querySelectorAll(be), n = 0, o = t.length; n < o; n++) { |
| 4533 |
var r = t[n]; |
| 4534 |
r && r.getAttribute(f) !== m && (Pe(e, r), r.parentNode && r.parentNode.removeChild(r)); |
| 4535 |
} |
| 4536 |
}; |
| 4537 |
function Ce() { |
| 4538 |
return "undefined" != typeof __webpack_nonce__ ? __webpack_nonce__ : null; |
| 4539 |
} |
| 4540 |
var Ie = function(e) { |
| 4541 |
var t = document.head; |
| 4542 |
var n = e || t; |
| 4543 |
var o = document.createElement("style"); |
| 4544 |
var r = function(e) { |
| 4545 |
var t = Array.from(e.querySelectorAll("style[".concat(f, "]"))); |
| 4546 |
return t[t.length - 1]; |
| 4547 |
}(n); |
| 4548 |
var s = void 0 !== r ? r.nextSibling : null; |
| 4549 |
o.setAttribute(f, m), o.setAttribute(y, v); |
| 4550 |
var i = Ce(); |
| 4551 |
return i && o.setAttribute("nonce", i), n.insertBefore(o, s), o; |
| 4552 |
}; |
| 4553 |
var Ae = function() { |
| 4554 |
function e(e) { |
| 4555 |
this.element = Ie(e), this.element.appendChild(document.createTextNode("")), this.sheet = function(e) { |
| 4556 |
if (e.sheet) return e.sheet; |
| 4557 |
for (var t = document.styleSheets, n = 0, o = t.length; n < o; n++) { |
| 4558 |
var r = t[n]; |
| 4559 |
if (r.ownerNode === e) return r; |
| 4560 |
} |
| 4561 |
throw he(17); |
| 4562 |
}(this.element), this.length = 0; |
| 4563 |
} |
| 4564 |
return e.prototype.insertRule = function(e, t) { |
| 4565 |
try { |
| 4566 |
return this.sheet.insertRule(t, e), this.length++, !0; |
| 4567 |
} catch (e) { |
| 4568 |
return !1; |
| 4569 |
} |
| 4570 |
}, e.prototype.deleteRule = function(e) { |
| 4571 |
this.sheet.deleteRule(e), this.length--; |
| 4572 |
}, e.prototype.getRule = function(e) { |
| 4573 |
var t = this.sheet.cssRules[e]; |
| 4574 |
return t && t.cssText ? t.cssText : ""; |
| 4575 |
}, e; |
| 4576 |
}(); |
| 4577 |
var Oe = function() { |
| 4578 |
function e(e) { |
| 4579 |
this.element = Ie(e), this.nodes = this.element.childNodes, this.length = 0; |
| 4580 |
} |
| 4581 |
return e.prototype.insertRule = function(e, t) { |
| 4582 |
if (e <= this.length && e >= 0) { |
| 4583 |
var n = document.createTextNode(t); |
| 4584 |
return this.element.insertBefore(n, this.nodes[e] || null), this.length++, !0; |
| 4585 |
} |
| 4586 |
return !1; |
| 4587 |
}, e.prototype.deleteRule = function(e) { |
| 4588 |
this.element.removeChild(this.nodes[e]), this.length--; |
| 4589 |
}, e.prototype.getRule = function(e) { |
| 4590 |
return e < this.length ? this.nodes[e].textContent : ""; |
| 4591 |
}, e; |
| 4592 |
}(); |
| 4593 |
var De = function() { |
| 4594 |
function e(e) { |
| 4595 |
this.rules = [], this.length = 0; |
| 4596 |
} |
| 4597 |
return e.prototype.insertRule = function(e, t) { |
| 4598 |
return e <= this.length && (this.rules.splice(e, 0, t), this.length++, !0); |
| 4599 |
}, e.prototype.deleteRule = function(e) { |
| 4600 |
this.rules.splice(e, 1), this.length--; |
| 4601 |
}, e.prototype.getRule = function(e) { |
| 4602 |
return e < this.length ? this.rules[e] : ""; |
| 4603 |
}, e; |
| 4604 |
}(); |
| 4605 |
var Re = S; |
| 4606 |
var Te = { |
| 4607 |
isServer: !S, |
| 4608 |
useCSSOMInjection: !w |
| 4609 |
}; |
| 4610 |
var ke = function() { |
| 4611 |
function e(e, n, o) { |
| 4612 |
void 0 === e && (e = C), void 0 === n && (n = {}); |
| 4613 |
var r = this; |
| 4614 |
this.options = __assign(__assign({}, Te), e), this.gs = n, this.names = new Map(o), this.server = !!e.isServer, !this.server && S && Re && (Re = !1, _e(this)), ue(this, function() { |
| 4615 |
return function(e) { |
| 4616 |
for (var t = e.getTag(), n = t.length, o = "", r = function(n) { |
| 4617 |
var r = function(e) { |
| 4618 |
return ve.get(e); |
| 4619 |
}(n); |
| 4620 |
if (void 0 === r) return "continue"; |
| 4621 |
var s = e.names.get(r); |
| 4622 |
var i = t.getGroup(n); |
| 4623 |
if (void 0 === s || !s.size || 0 === i.length) return "continue"; |
| 4624 |
var a = "".concat(f, ".g").concat(n, "[id=\"").concat(r, "\"]"); |
| 4625 |
var c = ""; |
| 4626 |
void 0 !== s && s.forEach(function(e) { |
| 4627 |
e.length > 0 && (c += "".concat(e, ",")); |
| 4628 |
}), o += "".concat(i).concat(a, "{content:\"").concat(c, "\"}").concat(g); |
| 4629 |
}, s = 0; s < n; s++) r(s); |
| 4630 |
return o; |
| 4631 |
}(r); |
| 4632 |
}); |
| 4633 |
} |
| 4634 |
return e.registerId = function(e) { |
| 4635 |
return Se(e); |
| 4636 |
}, e.prototype.rehydrate = function() { |
| 4637 |
!this.server && S && _e(this); |
| 4638 |
}, e.prototype.reconstructWithOptions = function(n, o) { |
| 4639 |
return void 0 === o && (o = !0), new e(__assign(__assign({}, this.options), n), this.gs, o && this.names || void 0); |
| 4640 |
}, e.prototype.allocateGSInstance = function(e) { |
| 4641 |
return this.gs[e] = (this.gs[e] || 0) + 1; |
| 4642 |
}, e.prototype.getTag = function() { |
| 4643 |
return this.tag || (this.tag = (e = function(e) { |
| 4644 |
var t = e.useCSSOMInjection; |
| 4645 |
var n = e.target; |
| 4646 |
return e.isServer ? new De(n) : t ? new Ae(n) : new Oe(n); |
| 4647 |
}(this.options), new fe(e))); |
| 4648 |
var e; |
| 4649 |
}, e.prototype.hasNameForId = function(e, t) { |
| 4650 |
return this.names.has(e) && this.names.get(e).has(t); |
| 4651 |
}, e.prototype.registerName = function(e, t) { |
| 4652 |
if (Se(e), this.names.has(e)) this.names.get(e).add(t); |
| 4653 |
else { |
| 4654 |
var n = /* @__PURE__ */ new Set(); |
| 4655 |
n.add(t), this.names.set(e, n); |
| 4656 |
} |
| 4657 |
}, e.prototype.insertRules = function(e, t, n) { |
| 4658 |
this.registerName(e, t), this.getTag().insertRules(Se(e), n); |
| 4659 |
}, e.prototype.clearNames = function(e) { |
| 4660 |
this.names.has(e) && this.names.get(e).clear(); |
| 4661 |
}, e.prototype.clearRules = function(e) { |
| 4662 |
this.getTag().clearGroup(Se(e)), this.clearNames(e); |
| 4663 |
}, e.prototype.clearTag = function() { |
| 4664 |
this.tag = void 0; |
| 4665 |
}, e; |
| 4666 |
}(); |
| 4667 |
var je = /&/g; |
| 4668 |
var xe = /^\s*\/\/.*$/gm; |
| 4669 |
function Ve(e, t) { |
| 4670 |
return e.map(function(e) { |
| 4671 |
return "rule" === e.type && (e.value = "".concat(t, " ").concat(e.value), e.value = e.value.replaceAll(",", ",".concat(t, " ")), e.props = e.props.map(function(e) { |
| 4672 |
return "".concat(t, " ").concat(e); |
| 4673 |
})), Array.isArray(e.children) && "@keyframes" !== e.type && (e.children = Ve(e.children, t)), e; |
| 4674 |
}); |
| 4675 |
} |
| 4676 |
function Fe(e) { |
| 4677 |
var t; |
| 4678 |
var n; |
| 4679 |
var o; |
| 4680 |
var r = void 0 === e ? C : e; |
| 4681 |
var s = r.options; |
| 4682 |
var i = void 0 === s ? C : s; |
| 4683 |
var a = r.plugins; |
| 4684 |
var c = void 0 === a ? _ : a; |
| 4685 |
var l = function(e, o, r) { |
| 4686 |
return r.startsWith(n) && r.endsWith(n) && r.replaceAll(n, "").length > 0 ? ".".concat(t) : e; |
| 4687 |
}; |
| 4688 |
var u = c.slice(); |
| 4689 |
u.push(function(e) { |
| 4690 |
e.type === "rule" && e.value.includes("&") && (e.props[0] = e.props[0].replace(je, n).replace(o, l)); |
| 4691 |
}), i.prefix && u.push(prefixer), u.push(stringify); |
| 4692 |
var p = function(e, r, s, a) { |
| 4693 |
void 0 === r && (r = ""), void 0 === s && (s = ""), void 0 === a && (a = "&"), t = a, n = r, o = new RegExp("\\".concat(n, "\\b"), "g"); |
| 4694 |
var c = e.replace(xe, ""); |
| 4695 |
var l = compile(s || r ? "".concat(s, " ").concat(r, " { ").concat(c, " }") : c); |
| 4696 |
i.namespace && (l = Ve(l, i.namespace)); |
| 4697 |
var p = []; |
| 4698 |
return serialize(l, middleware(u.concat(rulesheet(function(e) { |
| 4699 |
return p.push(e); |
| 4700 |
})))), p; |
| 4701 |
}; |
| 4702 |
return p.hash = c.length ? c.reduce(function(e, t) { |
| 4703 |
return t.name || he(15), M(e, t.name); |
| 4704 |
}, F).toString() : "", p; |
| 4705 |
} |
| 4706 |
var Me = new ke(); |
| 4707 |
var ze = Fe(); |
| 4708 |
var $e$1 = react.default.createContext({ |
| 4709 |
shouldForwardProp: void 0, |
| 4710 |
styleSheet: Me, |
| 4711 |
stylis: ze |
| 4712 |
}); |
| 4713 |
var Be = $e$1.Consumer; |
| 4714 |
var Le = react.default.createContext(void 0); |
| 4715 |
function Ge() { |
| 4716 |
return (0, react.useContext)($e$1); |
| 4717 |
} |
| 4718 |
function Ye(e) { |
| 4719 |
var t = (0, react.useState)(e.stylisPlugins); |
| 4720 |
var n = t[0]; |
| 4721 |
var r = t[1]; |
| 4722 |
var c = Ge().styleSheet; |
| 4723 |
var l = (0, react.useMemo)(function() { |
| 4724 |
var t = c; |
| 4725 |
return e.sheet ? t = e.sheet : e.target && (t = t.reconstructWithOptions({ target: e.target }, !1)), e.disableCSSOMInjection && (t = t.reconstructWithOptions({ useCSSOMInjection: !1 })), t; |
| 4726 |
}, [ |
| 4727 |
e.disableCSSOMInjection, |
| 4728 |
e.sheet, |
| 4729 |
e.target, |
| 4730 |
c |
| 4731 |
]); |
| 4732 |
var u = (0, react.useMemo)(function() { |
| 4733 |
return Fe({ |
| 4734 |
options: { |
| 4735 |
namespace: e.namespace, |
| 4736 |
prefix: e.enableVendorPrefixes |
| 4737 |
}, |
| 4738 |
plugins: n |
| 4739 |
}); |
| 4740 |
}, [ |
| 4741 |
e.enableVendorPrefixes, |
| 4742 |
e.namespace, |
| 4743 |
n |
| 4744 |
]); |
| 4745 |
(0, react.useEffect)(function() { |
| 4746 |
(0, import_shallowequal.default)(n, e.stylisPlugins) || r(e.stylisPlugins); |
| 4747 |
}, [e.stylisPlugins]); |
| 4748 |
var d = (0, react.useMemo)(function() { |
| 4749 |
return { |
| 4750 |
shouldForwardProp: e.shouldForwardProp, |
| 4751 |
styleSheet: l, |
| 4752 |
stylis: u |
| 4753 |
}; |
| 4754 |
}, [ |
| 4755 |
e.shouldForwardProp, |
| 4756 |
l, |
| 4757 |
u |
| 4758 |
]); |
| 4759 |
return react.default.createElement($e$1.Provider, { value: d }, react.default.createElement(Le.Provider, { value: u }, e.children)); |
| 4760 |
} |
| 4761 |
var We = function() { |
| 4762 |
function e(e, t) { |
| 4763 |
var n = this; |
| 4764 |
this.inject = function(e, t) { |
| 4765 |
void 0 === t && (t = ze); |
| 4766 |
var o = n.name + t.hash; |
| 4767 |
e.hasNameForId(n.id, o) || e.insertRules(n.id, o, t(n.rules, o, "@keyframes")); |
| 4768 |
}, this.name = e, this.id = "sc-keyframes-".concat(e), this.rules = t, ue(this, function() { |
| 4769 |
throw he(12, String(n.name)); |
| 4770 |
}); |
| 4771 |
} |
| 4772 |
return e.prototype.getName = function(e) { |
| 4773 |
return void 0 === e && (e = ze), this.name + e.hash; |
| 4774 |
}, e; |
| 4775 |
}(); |
| 4776 |
var qe = function(e) { |
| 4777 |
return e >= "A" && e <= "Z"; |
| 4778 |
}; |
| 4779 |
function He(e) { |
| 4780 |
for (var t = "", n = 0; n < e.length; n++) { |
| 4781 |
var o = e[n]; |
| 4782 |
if (1 === n && "-" === o && "-" === e[0]) return e; |
| 4783 |
qe(o) ? t += "-" + o.toLowerCase() : t += o; |
| 4784 |
} |
| 4785 |
return t.startsWith("ms-") ? "-" + t : t; |
| 4786 |
} |
| 4787 |
var Ue = function(e) { |
| 4788 |
return null == e || !1 === e || "" === e; |
| 4789 |
}; |
| 4790 |
var Je = function(t) { |
| 4791 |
var n; |
| 4792 |
var o; |
| 4793 |
var r = []; |
| 4794 |
for (var s in t) { |
| 4795 |
var i = t[s]; |
| 4796 |
t.hasOwnProperty(s) && !Ue(i) && (Array.isArray(i) && i.isCss || re(i) ? r.push("".concat(He(s), ":"), i, ";") : ce(i) ? r.push.apply(r, __spreadArray(__spreadArray(["".concat(s, " {")], Je(i), !1), ["}"], !1)) : r.push("".concat(He(s), ": ").concat((n = s, null == (o = i) || "boolean" == typeof o || "" === o ? "" : "number" != typeof o || 0 === o || n in unitlessKeys || n.startsWith("--") ? String(o).trim() : "".concat(o, "px")), ";"))); |
| 4797 |
} |
| 4798 |
return r; |
| 4799 |
}; |
| 4800 |
function Xe(e, t, n, o) { |
| 4801 |
if (Ue(e)) return []; |
| 4802 |
if (se(e)) return [".".concat(e.styledComponentId)]; |
| 4803 |
if (re(e)) { |
| 4804 |
if (!re(s = e) || s.prototype && s.prototype.isReactComponent || !t) return [e]; |
| 4805 |
var r = e(t); |
| 4806 |
return "object" != typeof r || Array.isArray(r) || r instanceof We || ce(r) || null === r || console.error("".concat(B(e), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")), Xe(r, t, n, o); |
| 4807 |
} |
| 4808 |
var s; |
| 4809 |
return e instanceof We ? n ? (e.inject(n, o), [e.getName(o)]) : [e] : ce(e) ? Je(e) : Array.isArray(e) ? Array.prototype.concat.apply(_, e.map(function(e) { |
| 4810 |
return Xe(e, t, n, o); |
| 4811 |
})) : [e.toString()]; |
| 4812 |
} |
| 4813 |
function Ze(e) { |
| 4814 |
for (var t = 0; t < e.length; t += 1) { |
| 4815 |
var n = e[t]; |
| 4816 |
if (re(n) && !se(n)) return !1; |
| 4817 |
} |
| 4818 |
return !0; |
| 4819 |
} |
| 4820 |
var Ke = z(v); |
| 4821 |
var Qe = function() { |
| 4822 |
function e(e, t, n) { |
| 4823 |
this.rules = e, this.staticRulesId = "", this.isStatic = false, this.componentId = t, this.baseHash = M(Ke, t), this.baseStyle = n, ke.registerId(t); |
| 4824 |
} |
| 4825 |
return e.prototype.generateAndInjectStyles = function(e, t, n) { |
| 4826 |
var o = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e, t, n) : ""; |
| 4827 |
if (this.isStatic && !n.hash) if (this.staticRulesId && t.hasNameForId(this.componentId, this.staticRulesId)) o = ie(o, this.staticRulesId); |
| 4828 |
else { |
| 4829 |
var r = ae(Xe(this.rules, e, t, n)); |
| 4830 |
var s = x(M(this.baseHash, r) >>> 0); |
| 4831 |
if (!t.hasNameForId(this.componentId, s)) { |
| 4832 |
var i = n(r, ".".concat(s), void 0, this.componentId); |
| 4833 |
t.insertRules(this.componentId, s, i); |
| 4834 |
} |
| 4835 |
o = ie(o, s), this.staticRulesId = s; |
| 4836 |
} |
| 4837 |
else { |
| 4838 |
for (var a = M(this.baseHash, n.hash), c = "", l = 0; l < this.rules.length; l++) { |
| 4839 |
var u = this.rules[l]; |
| 4840 |
if ("string" == typeof u) c += u, a = M(a, u); |
| 4841 |
else if (u) { |
| 4842 |
var p = ae(Xe(u, e, t, n)); |
| 4843 |
a = M(a, p + l), c += p; |
| 4844 |
} |
| 4845 |
} |
| 4846 |
if (c) { |
| 4847 |
var d = x(a >>> 0); |
| 4848 |
t.hasNameForId(this.componentId, d) || t.insertRules(this.componentId, d, n(c, ".".concat(d), void 0, this.componentId)), o = ie(o, d); |
| 4849 |
} |
| 4850 |
} |
| 4851 |
return o; |
| 4852 |
}, e; |
| 4853 |
}(); |
| 4854 |
var et = react.default.createContext(void 0); |
| 4855 |
var tt = et.Consumer; |
| 4856 |
function ot(e) { |
| 4857 |
var n = react.default.useContext(et); |
| 4858 |
var r = (0, react.useMemo)(function() { |
| 4859 |
return function(e, n) { |
| 4860 |
if (!e) throw he(14); |
| 4861 |
if (re(e)) { |
| 4862 |
var o = e(n); |
| 4863 |
if (null === o || Array.isArray(o) || "object" != typeof o) throw he(7); |
| 4864 |
return o; |
| 4865 |
} |
| 4866 |
if (Array.isArray(e) || "object" != typeof e) throw he(8); |
| 4867 |
return n ? __assign(__assign({}, n), e) : e; |
| 4868 |
}(e.theme, n); |
| 4869 |
}, [e.theme, n]); |
| 4870 |
return e.children ? react.default.createElement(et.Provider, { value: r }, e.children) : null; |
| 4871 |
} |
| 4872 |
var rt = {}; |
| 4873 |
var st = /* @__PURE__ */ new Set(); |
| 4874 |
function it(e, r, s) { |
| 4875 |
var i = se(e); |
| 4876 |
var a = e; |
| 4877 |
var c = !L(e); |
| 4878 |
var p = r.attrs; |
| 4879 |
var d = void 0 === p ? _ : p; |
| 4880 |
var h = r.componentId; |
| 4881 |
var f = void 0 === h ? function(e, t) { |
| 4882 |
var n = "string" != typeof e ? "sc" : R(e); |
| 4883 |
rt[n] = (rt[n] || 0) + 1; |
| 4884 |
var o = "".concat(n, "-").concat($(v + n + rt[n])); |
| 4885 |
return t ? "".concat(t, "-").concat(o) : o; |
| 4886 |
}(r.displayName, r.parentComponentId) : h; |
| 4887 |
var m = r.displayName; |
| 4888 |
var y = void 0 === m ? function(e) { |
| 4889 |
return L(e) ? "styled.".concat(e) : "Styled(".concat(B(e), ")"); |
| 4890 |
}(e) : m; |
| 4891 |
var g = r.displayName && r.componentId ? "".concat(R(r.displayName), "-").concat(r.componentId) : r.componentId || f; |
| 4892 |
var S = i && a.attrs ? a.attrs.concat(d).filter(Boolean) : d; |
| 4893 |
var w = r.shouldForwardProp; |
| 4894 |
if (i && a.shouldForwardProp) { |
| 4895 |
var b = a.shouldForwardProp; |
| 4896 |
if (r.shouldForwardProp) { |
| 4897 |
var E = r.shouldForwardProp; |
| 4898 |
w = function(e, t) { |
| 4899 |
return b(e, t) && E(e, t); |
| 4900 |
}; |
| 4901 |
} else w = b; |
| 4902 |
} |
| 4903 |
var N = new Qe(s, g, i ? a.componentStyle : void 0); |
| 4904 |
function O(e, r) { |
| 4905 |
return function(e, r, s) { |
| 4906 |
var i = e.attrs; |
| 4907 |
var a = e.componentStyle; |
| 4908 |
var c = e.defaultProps; |
| 4909 |
var p = e.foldedComponentIds; |
| 4910 |
var d = e.styledComponentId; |
| 4911 |
var h = e.target; |
| 4912 |
var f = react.default.useContext(et); |
| 4913 |
var m = Ge(); |
| 4914 |
var y = e.shouldForwardProp || m.shouldForwardProp; |
| 4915 |
(0, react.useDebugValue)(d); |
| 4916 |
var v = I(r, f, c) || C; |
| 4917 |
var g = function(e, n, o) { |
| 4918 |
for (var r, s = __assign(__assign({}, n), { |
| 4919 |
className: void 0, |
| 4920 |
theme: o |
| 4921 |
}), i = 0; i < e.length; i += 1) { |
| 4922 |
var a = re(r = e[i]) ? r(s) : r; |
| 4923 |
for (var c in a) s[c] = "className" === c ? ie(s[c], a[c]) : "style" === c ? __assign(__assign({}, s[c]), a[c]) : a[c]; |
| 4924 |
} |
| 4925 |
return n.className && (s.className = ie(s.className, n.className)), s; |
| 4926 |
}(i, r, v); |
| 4927 |
var S = g.as || h; |
| 4928 |
var w = {}; |
| 4929 |
for (var b in g) void 0 === g[b] || "$" === b[0] || "as" === b || "theme" === b && g.theme === v || ("forwardedAs" === b ? w.as = g.forwardedAs : y && !y(b, S) || (w[b] = g[b], y || isPropValid(b) || st.has(b) || !A.has(S) || (st.add(b), console.warn("styled-components: it looks like an unknown prop \"".concat(b, "\" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)"))))); |
| 4930 |
var E = function(e, t) { |
| 4931 |
var n = Ge(); |
| 4932 |
var o = e.generateAndInjectStyles(t, n.styleSheet, n.stylis); |
| 4933 |
return (0, react.useDebugValue)(o), o; |
| 4934 |
}(a, g); |
| 4935 |
e.warnTooManyClasses && e.warnTooManyClasses(E); |
| 4936 |
var N = ie(p, d); |
| 4937 |
return E && (N += " " + E), g.className && (N += " " + g.className), w[L(S) && !A.has(S) ? "class" : "className"] = N, s && (w.ref = s), (0, react.createElement)(S, w); |
| 4938 |
}(D, e, r); |
| 4939 |
} |
| 4940 |
O.displayName = y; |
| 4941 |
var D = react.default.forwardRef(O); |
| 4942 |
return D.attrs = S, D.componentStyle = N, D.displayName = y, D.shouldForwardProp = w, D.foldedComponentIds = i ? ie(a.foldedComponentIds, a.styledComponentId) : "", D.styledComponentId = g, D.target = i ? a.target : e, Object.defineProperty(D, "defaultProps", { |
| 4943 |
get: function() { |
| 4944 |
return this._foldedDefaultProps; |
| 4945 |
}, |
| 4946 |
set: function(e) { |
| 4947 |
this._foldedDefaultProps = i ? function(e) { |
| 4948 |
for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n]; |
| 4949 |
for (var o = 0, r = t; o < r.length; o++) le(e, r[o], !0); |
| 4950 |
return e; |
| 4951 |
}({}, a.defaultProps, e) : e; |
| 4952 |
} |
| 4953 |
}), P(y, g), D.warnTooManyClasses = function(e, t) { |
| 4954 |
var n = {}; |
| 4955 |
var o = !1; |
| 4956 |
return function(r) { |
| 4957 |
if (!o && (n[r] = !0, Object.keys(n).length >= 200)) { |
| 4958 |
var s = t ? " with the id of \"".concat(t, "\"") : ""; |
| 4959 |
console.warn("Over ".concat(200, " classes were generated for component ").concat(e).concat(s, ".\n") + "Consider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"), o = !0, n = {}; |
| 4960 |
} |
| 4961 |
}; |
| 4962 |
}(y, g), ue(D, function() { |
| 4963 |
return ".".concat(D.styledComponentId); |
| 4964 |
}), c && oe(D, e, { |
| 4965 |
attrs: !0, |
| 4966 |
componentStyle: !0, |
| 4967 |
displayName: !0, |
| 4968 |
foldedComponentIds: !0, |
| 4969 |
shouldForwardProp: !0, |
| 4970 |
styledComponentId: !0, |
| 4971 |
target: !0 |
| 4972 |
}), D; |
| 4973 |
} |
| 4974 |
function at(e, t) { |
| 4975 |
for (var n = [e[0]], o = 0, r = t.length; o < r; o += 1) n.push(t[o], e[o + 1]); |
| 4976 |
return n; |
| 4977 |
} |
| 4978 |
var ct = function(e) { |
| 4979 |
return Object.assign(e, { isCss: !0 }); |
| 4980 |
}; |
| 4981 |
function lt(t) { |
| 4982 |
for (var n = [], o = 1; o < arguments.length; o++) n[o - 1] = arguments[o]; |
| 4983 |
if (re(t) || ce(t)) return ct(Xe(at(_, __spreadArray([t], n, !0)))); |
| 4984 |
var r = t; |
| 4985 |
return 0 === n.length && 1 === r.length && "string" == typeof r[0] ? Xe(r) : ct(Xe(at(r, n))); |
| 4986 |
} |
| 4987 |
function ut(n, o, r) { |
| 4988 |
if (void 0 === r && (r = C), !o) throw he(1, o); |
| 4989 |
var s = function(t) { |
| 4990 |
for (var s = [], i = 1; i < arguments.length; i++) s[i - 1] = arguments[i]; |
| 4991 |
return n(o, r, lt.apply(void 0, __spreadArray([t], s, !1))); |
| 4992 |
}; |
| 4993 |
return s.attrs = function(e) { |
| 4994 |
return ut(n, o, __assign(__assign({}, r), { attrs: Array.prototype.concat(r.attrs, e).filter(Boolean) })); |
| 4995 |
}, s.withConfig = function(e) { |
| 4996 |
return ut(n, o, __assign(__assign({}, r), e)); |
| 4997 |
}, s; |
| 4998 |
} |
| 4999 |
var pt = function(e) { |
| 5000 |
return ut(it, e); |
| 5001 |
}; |
| 5002 |
var dt = pt; |
| 5003 |
A.forEach(function(e) { |
| 5004 |
dt[e] = pt(e); |
| 5005 |
}); |
| 5006 |
var ht = function() { |
| 5007 |
function e(e, t) { |
| 5008 |
this.rules = e, this.componentId = t, this.isStatic = Ze(e), ke.registerId(this.componentId + 1); |
| 5009 |
} |
| 5010 |
return e.prototype.createStyles = function(e, t, n, o) { |
| 5011 |
var r = o(ae(Xe(this.rules, t, n, o)), ""); |
| 5012 |
var s = this.componentId + e; |
| 5013 |
n.insertRules(s, s, r); |
| 5014 |
}, e.prototype.removeStyles = function(e, t) { |
| 5015 |
t.clearRules(this.componentId + e); |
| 5016 |
}, e.prototype.renderStyles = function(e, t, n, o) { |
| 5017 |
e > 2 && ke.registerId(this.componentId + e), this.removeStyles(e, n), this.createStyles(e, t, n, o); |
| 5018 |
}, e; |
| 5019 |
}(); |
| 5020 |
var vt = function() { |
| 5021 |
function e() { |
| 5022 |
var e = this; |
| 5023 |
this._emitSheetCSS = function() { |
| 5024 |
var t = e.instance.toString(); |
| 5025 |
if (!t) return ""; |
| 5026 |
var n = Ce(); |
| 5027 |
var o = ae([ |
| 5028 |
n && "nonce=\"".concat(n, "\""), |
| 5029 |
"".concat(f, "=\"true\""), |
| 5030 |
"".concat(y, "=\"").concat(v, "\"") |
| 5031 |
].filter(Boolean), " "); |
| 5032 |
return "<style ".concat(o, ">").concat(t, "</style>"); |
| 5033 |
}, this.getStyleTags = function() { |
| 5034 |
if (e.sealed) throw he(2); |
| 5035 |
return e._emitSheetCSS(); |
| 5036 |
}, this.getStyleElement = function() { |
| 5037 |
var n; |
| 5038 |
if (e.sealed) throw he(2); |
| 5039 |
var r = e.instance.toString(); |
| 5040 |
if (!r) return []; |
| 5041 |
var s = ((n = {})[f] = "", n[y] = v, n.dangerouslySetInnerHTML = { __html: r }, n); |
| 5042 |
var i = Ce(); |
| 5043 |
return i && (s.nonce = i), [react.default.createElement("style", __assign({}, s, { key: "sc-0-0" }))]; |
| 5044 |
}, this.seal = function() { |
| 5045 |
e.sealed = !0; |
| 5046 |
}, this.instance = new ke({ isServer: !0 }), this.sealed = !1; |
| 5047 |
} |
| 5048 |
return e.prototype.collectStyles = function(e) { |
| 5049 |
if (this.sealed) throw he(2); |
| 5050 |
return react.default.createElement(Ye, { sheet: this.instance }, e); |
| 5051 |
}, e.prototype.interleaveWithNodeStream = function(e) { |
| 5052 |
throw he(3); |
| 5053 |
}, e; |
| 5054 |
}(); |
| 5055 |
"undefined" != typeof navigator && "ReactNative" === navigator.product && console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"); |
| 5056 |
var St = "__sc-".concat(f, "__"); |
| 5057 |
"undefined" != typeof window && (window[St] || (window[St] = 0), 1 === window[St] && console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."), window[St] += 1); |
| 5058 |
|
| 5059 |
//#endregion |
| 5060 |
//#region app/assets/js/app.js |
| 5061 |
/** |
| 5062 |
* Elementor App |
| 5063 |
*/ |
| 5064 |
init_es$1(); |
| 5065 |
var Suspense = react.default.Suspense; |
| 5066 |
function App$1() { |
| 5067 |
var isDarkMode = (0, react.useContext)(AppContext).state.isDarkMode; |
| 5068 |
var theme = { config: { variants: { |
| 5069 |
light: !isDarkMode, |
| 5070 |
dark: isDarkMode |
| 5071 |
} } }; |
| 5072 |
_elementor_router.default.appHistory = createHistory(createHashSource()); |
| 5073 |
return /*#__PURE__*/ react.default.createElement(ErrorBoundary, null, /*#__PURE__*/ react.default.createElement(LocationProvider, { history: _elementor_router.default.appHistory }, /*#__PURE__*/ react.default.createElement(ot, { theme }, /*#__PURE__*/ react.default.createElement(Suspense, { fallback: null }, /*#__PURE__*/ react.default.createElement(Router, null, _elementor_router.default.getRoutes(), /*#__PURE__*/ react.default.createElement(Index$5, { path: "/" }), /*#__PURE__*/ react.default.createElement(NotFound, { default: true })))))); |
| 5074 |
} |
| 5075 |
__name(App$1, "App"); |
| 5076 |
|
| 5077 |
//#endregion |
| 5078 |
//#region app/modules/import-export/assets/js/context/utils/reducer-utils.js |
| 5079 |
init_toConsumableArray(); |
| 5080 |
init_defineProperty$1(); |
| 5081 |
init_classCallCheck(); |
| 5082 |
init_createClass(); |
| 5083 |
function ownKeys$36(e, r) { |
| 5084 |
var t = Object.keys(e); |
| 5085 |
if (Object.getOwnPropertySymbols) { |
| 5086 |
var o = Object.getOwnPropertySymbols(e); |
| 5087 |
r && (o = o.filter(function(r) { |
| 5088 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 5089 |
})), t.push.apply(t, o); |
| 5090 |
} |
| 5091 |
return t; |
| 5092 |
} |
| 5093 |
__name(ownKeys$36, "ownKeys"); |
| 5094 |
function _objectSpread$35(e) { |
| 5095 |
for (var r = 1; r < arguments.length; r++) { |
| 5096 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 5097 |
r % 2 ? ownKeys$36(Object(t), !0).forEach(function(r) { |
| 5098 |
_defineProperty$1(e, r, t[r]); |
| 5099 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$36(Object(t)).forEach(function(r) { |
| 5100 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 5101 |
}); |
| 5102 |
} |
| 5103 |
return e; |
| 5104 |
} |
| 5105 |
__name(_objectSpread$35, "_objectSpread"); |
| 5106 |
var ReducerUtils = /*#__PURE__*/ function() { |
| 5107 |
function ReducerUtils() { |
| 5108 |
_classCallCheck(this, ReducerUtils); |
| 5109 |
} |
| 5110 |
return _createClass(ReducerUtils, null, [{ |
| 5111 |
key: "updateArray", |
| 5112 |
value: function updateArray(state, key, value, action) { |
| 5113 |
if ("add" === action) { |
| 5114 |
if (state[key].includes(value)) return state; |
| 5115 |
return _objectSpread$35(_objectSpread$35({}, state), {}, _defineProperty$1({}, key, [].concat(_toConsumableArray(state[key]), [value]))); |
| 5116 |
} else if ("remove" === action) return _objectSpread$35(_objectSpread$35({}, state), {}, _defineProperty$1({}, key, state[key].filter(function(item) { |
| 5117 |
return item !== value; |
| 5118 |
}))); |
| 5119 |
return state; |
| 5120 |
} |
| 5121 |
}]); |
| 5122 |
}(); |
| 5123 |
|
| 5124 |
//#endregion |
| 5125 |
//#region app/modules/import-export/assets/js/context/shared-context/shared-context-reducer.js |
| 5126 |
init_defineProperty$1(); |
| 5127 |
function ownKeys$35(e, r) { |
| 5128 |
var t = Object.keys(e); |
| 5129 |
if (Object.getOwnPropertySymbols) { |
| 5130 |
var o = Object.getOwnPropertySymbols(e); |
| 5131 |
r && (o = o.filter(function(r) { |
| 5132 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 5133 |
})), t.push.apply(t, o); |
| 5134 |
} |
| 5135 |
return t; |
| 5136 |
} |
| 5137 |
__name(ownKeys$35, "ownKeys"); |
| 5138 |
function _objectSpread$34(e) { |
| 5139 |
for (var r = 1; r < arguments.length; r++) { |
| 5140 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 5141 |
r % 2 ? ownKeys$35(Object(t), !0).forEach(function(r) { |
| 5142 |
_defineProperty$1(e, r, t[r]); |
| 5143 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$35(Object(t)).forEach(function(r) { |
| 5144 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 5145 |
}); |
| 5146 |
} |
| 5147 |
return e; |
| 5148 |
} |
| 5149 |
__name(_objectSpread$34, "_objectSpread"); |
| 5150 |
var reducer$3 = function reducer(state, _ref) { |
| 5151 |
var type = _ref.type; |
| 5152 |
var payload = _ref.payload; |
| 5153 |
switch (type) { |
| 5154 |
case "ADD_INCLUDE": return ReducerUtils.updateArray(state, "includes", payload, "add"); |
| 5155 |
case "REMOVE_INCLUDE": return ReducerUtils.updateArray(state, "includes", payload, "remove"); |
| 5156 |
case "SET_REFERRER": return _objectSpread$34(_objectSpread$34({}, state), {}, { referrer: payload }); |
| 5157 |
case "SET_INCLUDES": return _objectSpread$34(_objectSpread$34({}, state), {}, { includes: payload }); |
| 5158 |
case "SET_CPT": return _objectSpread$34(_objectSpread$34({}, state), {}, { customPostTypes: payload }); |
| 5159 |
case "SET_SELECTED_CPT": return _objectSpread$34(_objectSpread$34({}, state), {}, { selectedCustomPostTypes: payload }); |
| 5160 |
case "SET_CURRENT_PAGE_NAME": return _objectSpread$34(_objectSpread$34({}, state), {}, { currentPage: payload }); |
| 5161 |
case "SET_RETURN_TO": return _objectSpread$34(_objectSpread$34({}, state), {}, { returnTo: payload }); |
| 5162 |
default: return state; |
| 5163 |
} |
| 5164 |
}; |
| 5165 |
|
| 5166 |
//#endregion |
| 5167 |
//#region app/modules/import-export/assets/js/shared/kit-content-data/kit-content-data.js |
| 5168 |
var kitContentData$1 = [ |
| 5169 |
{ |
| 5170 |
type: "templates", |
| 5171 |
data: { |
| 5172 |
title: (0, _wordpress_i18n.__)("Templates", "elementor"), |
| 5173 |
features: { |
| 5174 |
open: [(0, _wordpress_i18n.__)("Saved Templates", "elementor")], |
| 5175 |
locked: [ |
| 5176 |
(0, _wordpress_i18n.__)("Headers", "elementor"), |
| 5177 |
(0, _wordpress_i18n.__)("Footers", "elementor"), |
| 5178 |
(0, _wordpress_i18n.__)("Archives", "elementor"), |
| 5179 |
(0, _wordpress_i18n.__)("Single Posts", "elementor"), |
| 5180 |
(0, _wordpress_i18n.__)("Single Pages", "elementor"), |
| 5181 |
(0, _wordpress_i18n.__)("Search Results", "elementor"), |
| 5182 |
(0, _wordpress_i18n.__)("404 Error Page", "elementor"), |
| 5183 |
(0, _wordpress_i18n.__)("Popups", "elementor"), |
| 5184 |
(0, _wordpress_i18n.__)("Global widgets", "elementor") |
| 5185 |
], |
| 5186 |
tooltip: (0, _wordpress_i18n.__)("To import or export these components, you’ll need Elementor Pro.", "elementor") |
| 5187 |
} |
| 5188 |
} |
| 5189 |
}, |
| 5190 |
{ |
| 5191 |
type: "content", |
| 5192 |
data: { |
| 5193 |
title: (0, _wordpress_i18n.__)("Content", "elementor"), |
| 5194 |
features: { open: [ |
| 5195 |
(0, _wordpress_i18n.__)("Elementor Pages", "elementor"), |
| 5196 |
(0, _wordpress_i18n.__)("Landing Pages", "elementor"), |
| 5197 |
(0, _wordpress_i18n.__)("Elementor Posts", "elementor"), |
| 5198 |
(0, _wordpress_i18n.__)("WP Pages", "elementor"), |
| 5199 |
(0, _wordpress_i18n.__)("WP Posts", "elementor"), |
| 5200 |
(0, _wordpress_i18n.__)("WP Menus", "elementor"), |
| 5201 |
(0, _wordpress_i18n.__)("Custom Post Types", "elementor") |
| 5202 |
] } |
| 5203 |
} |
| 5204 |
}, |
| 5205 |
{ |
| 5206 |
type: "settings", |
| 5207 |
data: { |
| 5208 |
title: (0, _wordpress_i18n.__)("Site Settings", "elementor"), |
| 5209 |
features: { open: [ |
| 5210 |
(0, _wordpress_i18n.__)("Global Colors", "elementor"), |
| 5211 |
(0, _wordpress_i18n.__)("Global Fonts", "elementor"), |
| 5212 |
(0, _wordpress_i18n.__)("Theme Style settings", "elementor"), |
| 5213 |
(0, _wordpress_i18n.__)("Layout Settings", "elementor"), |
| 5214 |
(0, _wordpress_i18n.__)("Lightbox Settings", "elementor"), |
| 5215 |
(0, _wordpress_i18n.__)("Background Settings", "elementor") |
| 5216 |
] } |
| 5217 |
} |
| 5218 |
} |
| 5219 |
]; |
| 5220 |
|
| 5221 |
//#endregion |
| 5222 |
//#region app/modules/import-export/assets/js/context/shared-context/shared-context-provider.js |
| 5223 |
init_slicedToArray(); |
| 5224 |
var SharedContext = react.default.createContext(); |
| 5225 |
function SharedContextProvider(props) { |
| 5226 |
var _useReducer2 = _slicedToArray((0, react.useReducer)(reducer$3, { |
| 5227 |
includes: kitContentData$1.map(function(item) { |
| 5228 |
return item.type; |
| 5229 |
}), |
| 5230 |
referrer: null, |
| 5231 |
customPostTypes: [], |
| 5232 |
selectedCustomPostTypes: null, |
| 5233 |
currentPage: null, |
| 5234 |
returnTo: null |
| 5235 |
}), 2); |
| 5236 |
var data = _useReducer2[0]; |
| 5237 |
var dispatch = _useReducer2[1]; |
| 5238 |
return /*#__PURE__*/ react.default.createElement(SharedContext.Provider, { value: { |
| 5239 |
data, |
| 5240 |
dispatch |
| 5241 |
} }, props.children); |
| 5242 |
} |
| 5243 |
SharedContextProvider.propTypes = { children: import_prop_types$55.default.object.isRequired }; |
| 5244 |
|
| 5245 |
//#endregion |
| 5246 |
//#region app/modules/import-export/assets/js/context/import-context/import-context-reducer.js |
| 5247 |
init_defineProperty$1(); |
| 5248 |
function ownKeys$34(e, r) { |
| 5249 |
var t = Object.keys(e); |
| 5250 |
if (Object.getOwnPropertySymbols) { |
| 5251 |
var o = Object.getOwnPropertySymbols(e); |
| 5252 |
r && (o = o.filter(function(r) { |
| 5253 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 5254 |
})), t.push.apply(t, o); |
| 5255 |
} |
| 5256 |
return t; |
| 5257 |
} |
| 5258 |
__name(ownKeys$34, "ownKeys"); |
| 5259 |
function _objectSpread$33(e) { |
| 5260 |
for (var r = 1; r < arguments.length; r++) { |
| 5261 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 5262 |
r % 2 ? ownKeys$34(Object(t), !0).forEach(function(r) { |
| 5263 |
_defineProperty$1(e, r, t[r]); |
| 5264 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$34(Object(t)).forEach(function(r) { |
| 5265 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 5266 |
}); |
| 5267 |
} |
| 5268 |
return e; |
| 5269 |
} |
| 5270 |
__name(_objectSpread$33, "_objectSpread"); |
| 5271 |
var reducer$2 = function reducer(state, _ref) { |
| 5272 |
var type = _ref.type; |
| 5273 |
var payload = _ref.payload; |
| 5274 |
switch (type) { |
| 5275 |
case "SET_ID": return _objectSpread$33(_objectSpread$33({}, state), {}, { id: payload }); |
| 5276 |
case "SET_FILE": return _objectSpread$33(_objectSpread$33({}, state), {}, { file: payload }); |
| 5277 |
case "SET_KIT_SOURCE": return _objectSpread$33(_objectSpread$33({}, state), {}, { source: payload }); |
| 5278 |
case "ADD_OVERRIDE_CONDITION": return ReducerUtils.updateArray(state, "overrideConditions", payload, "add"); |
| 5279 |
case "REMOVE_OVERRIDE_CONDITION": return ReducerUtils.updateArray(state, "overrideConditions", payload, "remove"); |
| 5280 |
case "SET_UPLOADED_DATA": return _objectSpread$33(_objectSpread$33({}, state), {}, { uploadedData: payload }); |
| 5281 |
case "SET_IMPORTED_DATA": return _objectSpread$33(_objectSpread$33({}, state), {}, { importedData: payload }); |
| 5282 |
case "SET_PLUGINS": return _objectSpread$33(_objectSpread$33({}, state), {}, { plugins: payload }); |
| 5283 |
case "SET_REQUIRED_PLUGINS": return _objectSpread$33(_objectSpread$33({}, state), {}, { requiredPlugins: payload }); |
| 5284 |
case "SET_IMPORTED_PLUGINS": return _objectSpread$33(_objectSpread$33({}, state), {}, { importedPlugins: payload }); |
| 5285 |
case "SET_IS_PRO_INSTALLED_DURING_PROCESS": return _objectSpread$33(_objectSpread$33({}, state), {}, { isProInstalledDuringProcess: payload }); |
| 5286 |
case "SET_ACTION_TYPE": return _objectSpread$33(_objectSpread$33({}, state), {}, { actionType: payload }); |
| 5287 |
case "SET_IS_RESOLVED": return _objectSpread$33(_objectSpread$33({}, state), {}, { isResolvedData: payload }); |
| 5288 |
case "SET_PLUGINS_STATE": return _objectSpread$33(_objectSpread$33({}, state), {}, { pluginsState: payload }); |
| 5289 |
default: return state; |
| 5290 |
} |
| 5291 |
}; |
| 5292 |
|
| 5293 |
//#endregion |
| 5294 |
//#region app/modules/import-export/assets/js/context/import-context/import-context-provider.js |
| 5295 |
init_slicedToArray(); |
| 5296 |
var ImportContext$1 = react.default.createContext(); |
| 5297 |
function ImportContextProvider$1(props) { |
| 5298 |
var _useReducer2 = _slicedToArray((0, react.useReducer)(reducer$2, { |
| 5299 |
id: null, |
| 5300 |
file: null, |
| 5301 |
uploadedData: null, |
| 5302 |
importedData: null, |
| 5303 |
source: "", |
| 5304 |
plugins: [], |
| 5305 |
requiredPlugins: [], |
| 5306 |
importedPlugins: [], |
| 5307 |
overrideConditions: [], |
| 5308 |
isProInstalledDuringProcess: false, |
| 5309 |
actionType: null, |
| 5310 |
isResolvedData: false, |
| 5311 |
pluginsState: "" |
| 5312 |
}), 2); |
| 5313 |
var data = _useReducer2[0]; |
| 5314 |
var dispatch = _useReducer2[1]; |
| 5315 |
return /*#__PURE__*/ react.default.createElement(ImportContext$1.Provider, { value: { |
| 5316 |
data, |
| 5317 |
dispatch |
| 5318 |
} }, props.children); |
| 5319 |
} |
| 5320 |
__name(ImportContextProvider$1, "ImportContextProvider"); |
| 5321 |
ImportContextProvider$1.propTypes = { children: import_prop_types$55.default.object.isRequired }; |
| 5322 |
|
| 5323 |
//#endregion |
| 5324 |
//#region app/assets/js/hooks/use-query-params.js |
| 5325 |
function ownKeys$33(e, r) { |
| 5326 |
var t = Object.keys(e); |
| 5327 |
if (Object.getOwnPropertySymbols) { |
| 5328 |
var o = Object.getOwnPropertySymbols(e); |
| 5329 |
r && (o = o.filter(function(r) { |
| 5330 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 5331 |
})), t.push.apply(t, o); |
| 5332 |
} |
| 5333 |
return t; |
| 5334 |
} |
| 5335 |
function _objectSpread$32(e) { |
| 5336 |
for (var r = 1; r < arguments.length; r++) { |
| 5337 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 5338 |
r % 2 ? ownKeys$33(Object(t), !0).forEach(function(r) { |
| 5339 |
_defineProperty$1(e, r, t[r]); |
| 5340 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$33(Object(t)).forEach(function(r) { |
| 5341 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 5342 |
}); |
| 5343 |
} |
| 5344 |
return e; |
| 5345 |
} |
| 5346 |
function useQueryParams() { |
| 5347 |
var _location$hash$match; |
| 5348 |
var urlSearchParams = new URLSearchParams(window.location.search); |
| 5349 |
var urlParams = Object.fromEntries(urlSearchParams.entries()); |
| 5350 |
var hashValue = (_location$hash$match = location.hash.match(/\?(.+)/)) === null || _location$hash$match === void 0 ? void 0 : _location$hash$match[1]; |
| 5351 |
var hashParams = {}; |
| 5352 |
if (hashValue) hashValue.split("&").forEach(function(pair) { |
| 5353 |
var _pair$split2 = _slicedToArray(pair.split("="), 2); |
| 5354 |
var key = _pair$split2[0]; |
| 5355 |
hashParams[key] = _pair$split2[1]; |
| 5356 |
}); |
| 5357 |
var queryParams = _objectSpread$32(_objectSpread$32({}, urlParams), hashParams); |
| 5358 |
return { getAll: function getAll() { |
| 5359 |
return queryParams; |
| 5360 |
} }; |
| 5361 |
} |
| 5362 |
var init_use_query_params = __esmMin((() => { |
| 5363 |
init_defineProperty$1(); |
| 5364 |
init_slicedToArray(); |
| 5365 |
__name(ownKeys$33, "ownKeys"); |
| 5366 |
__name(_objectSpread$32, "_objectSpread"); |
| 5367 |
})); |
| 5368 |
|
| 5369 |
//#endregion |
| 5370 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/import-export/assets/js/shared/content-layout/content-layout.scss |
| 5371 |
init_use_query_params(); |
| 5372 |
|
| 5373 |
//#endregion |
| 5374 |
//#region app/modules/import-export/assets/js/shared/content-layout/content-layout.js |
| 5375 |
function ContentLayout(props) { |
| 5376 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-app-import-export-content-layout" }, /*#__PURE__*/ react.default.createElement("div", { className: "e-app-import-export-content-layout__container" }, props.children)); |
| 5377 |
} |
| 5378 |
ContentLayout.propTypes = { children: import_prop_types$55.default.any.isRequired }; |
| 5379 |
|
| 5380 |
//#endregion |
| 5381 |
//#region app/assets/js/ui/modal/modal-section.js |
| 5382 |
init_utils$4(); |
| 5383 |
function ModalSection(props) { |
| 5384 |
return /*#__PURE__*/ react.default.createElement("section", { className: arrayToClassName(["eps-modal__section", props.className]) }, props.children); |
| 5385 |
} |
| 5386 |
ModalSection.propTypes = { |
| 5387 |
className: import_prop_types$55.default.string, |
| 5388 |
children: import_prop_types$55.default.any |
| 5389 |
}; |
| 5390 |
ModalSection.defaultProps = { className: "" }; |
| 5391 |
|
| 5392 |
//#endregion |
| 5393 |
//#region app/assets/js/ui/modal/modal-tip.js |
| 5394 |
init_utils$4(); |
| 5395 |
function ModalTip(props) { |
| 5396 |
return /*#__PURE__*/ react.default.createElement("div", { className: arrayToClassName(["eps-modal__tip", props.className]) }, /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 5397 |
variant: "h3", |
| 5398 |
tag: "h3" |
| 5399 |
}, props.title), props.description && /*#__PURE__*/ react.default.createElement(Text$11, { variant: "xs" }, props.description)); |
| 5400 |
} |
| 5401 |
ModalTip.propTypes = { |
| 5402 |
className: import_prop_types$55.default.string, |
| 5403 |
title: import_prop_types$55.default.string, |
| 5404 |
description: import_prop_types$55.default.string |
| 5405 |
}; |
| 5406 |
ModalTip.defaultProps = { |
| 5407 |
className: "", |
| 5408 |
title: (0, _wordpress_i18n.__)("Tip", "elementor") |
| 5409 |
}; |
| 5410 |
|
| 5411 |
//#endregion |
| 5412 |
//#region app/assets/js/ui/modal/modal.js |
| 5413 |
init_extends(); |
| 5414 |
init_defineProperty$1(); |
| 5415 |
init_slicedToArray(); |
| 5416 |
init_utils$4(); |
| 5417 |
init_button(); |
| 5418 |
init_icon(); |
| 5419 |
function ownKeys$32(e, r) { |
| 5420 |
var t = Object.keys(e); |
| 5421 |
if (Object.getOwnPropertySymbols) { |
| 5422 |
var o = Object.getOwnPropertySymbols(e); |
| 5423 |
r && (o = o.filter(function(r) { |
| 5424 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 5425 |
})), t.push.apply(t, o); |
| 5426 |
} |
| 5427 |
return t; |
| 5428 |
} |
| 5429 |
__name(ownKeys$32, "ownKeys"); |
| 5430 |
function _objectSpread$31(e) { |
| 5431 |
for (var r = 1; r < arguments.length; r++) { |
| 5432 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 5433 |
r % 2 ? ownKeys$32(Object(t), !0).forEach(function(r) { |
| 5434 |
_defineProperty$1(e, r, t[r]); |
| 5435 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$32(Object(t)).forEach(function(r) { |
| 5436 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 5437 |
}); |
| 5438 |
} |
| 5439 |
return e; |
| 5440 |
} |
| 5441 |
__name(_objectSpread$31, "_objectSpread"); |
| 5442 |
function ModalProvider$1(props) { |
| 5443 |
var _useState2 = _slicedToArray((0, react.useState)(props.show), 2); |
| 5444 |
var show = _useState2[0]; |
| 5445 |
var setShow = _useState2[1]; |
| 5446 |
var hideModal = function hideModal() { |
| 5447 |
setShow(false); |
| 5448 |
if (props.setShow) props.setShow(false); |
| 5449 |
}; |
| 5450 |
var showModal = function showModal() { |
| 5451 |
setShow(true); |
| 5452 |
if (props.setShow) props.setShow(true); |
| 5453 |
}; |
| 5454 |
var modalAttrs = _objectSpread$31(_objectSpread$31({}, props), {}, { |
| 5455 |
show, |
| 5456 |
hideModal, |
| 5457 |
showModal |
| 5458 |
}); |
| 5459 |
(0, react.useEffect)(function() { |
| 5460 |
setShow(props.show); |
| 5461 |
}, [props.show]); |
| 5462 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, props.toggleButtonProps && /*#__PURE__*/ react.default.createElement(Button$29, _extends({}, props.toggleButtonProps, { onClick: showModal })), /*#__PURE__*/ react.default.createElement(Modal, modalAttrs, props.children)); |
| 5463 |
} |
| 5464 |
__name(ModalProvider$1, "ModalProvider"); |
| 5465 |
ModalProvider$1.propTypes = { |
| 5466 |
children: import_prop_types$55.default.node.isRequired, |
| 5467 |
toggleButtonProps: import_prop_types$55.default.object, |
| 5468 |
title: import_prop_types$55.default.string, |
| 5469 |
icon: import_prop_types$55.default.string, |
| 5470 |
show: import_prop_types$55.default.bool, |
| 5471 |
setShow: import_prop_types$55.default.func, |
| 5472 |
onOpen: import_prop_types$55.default.func, |
| 5473 |
onClose: import_prop_types$55.default.func |
| 5474 |
}; |
| 5475 |
ModalProvider$1.defaultProps = { show: false }; |
| 5476 |
ModalProvider$1.Section = ModalSection; |
| 5477 |
ModalProvider$1.Tip = ModalTip; |
| 5478 |
var Modal = function Modal(props) { |
| 5479 |
var modalRef = (0, react.useRef)(null); |
| 5480 |
var closeRef = (0, react.useRef)(null); |
| 5481 |
var closeModal = function closeModal(e) { |
| 5482 |
var node = modalRef.current; |
| 5483 |
var closeNode = closeRef.current; |
| 5484 |
var isInCloseNode = closeNode && closeNode.contains(e.target); |
| 5485 |
if (node && node.contains(e.target) && !isInCloseNode) return; |
| 5486 |
props.hideModal(); |
| 5487 |
if (props.onClose) props.onClose(e); |
| 5488 |
}; |
| 5489 |
(0, react.useEffect)(function() { |
| 5490 |
if (props.show) { |
| 5491 |
var _props$onOpen; |
| 5492 |
document.addEventListener("mousedown", closeModal, false); |
| 5493 |
(_props$onOpen = props.onOpen) === null || _props$onOpen === void 0 || _props$onOpen.call(props); |
| 5494 |
} |
| 5495 |
return function() { |
| 5496 |
return document.removeEventListener("mousedown", closeModal, false); |
| 5497 |
}; |
| 5498 |
}, [props.show]); |
| 5499 |
if (!props.show) return null; |
| 5500 |
return /*#__PURE__*/ react.default.createElement("div", { |
| 5501 |
className: "eps-modal__overlay", |
| 5502 |
onClick: closeModal |
| 5503 |
}, /*#__PURE__*/ react.default.createElement("div", { |
| 5504 |
className: arrayToClassName(["eps-modal", props.className]), |
| 5505 |
ref: modalRef |
| 5506 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 5507 |
container: true, |
| 5508 |
className: "eps-modal__header", |
| 5509 |
justify: "space-between", |
| 5510 |
alignItems: "center" |
| 5511 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { item: true }, /*#__PURE__*/ react.default.createElement(Icon$2, { className: "eps-modal__icon ".concat(props.icon) }), /*#__PURE__*/ react.default.createElement(Text$11, { |
| 5512 |
className: "title", |
| 5513 |
tag: "span" |
| 5514 |
}, props.title)), /*#__PURE__*/ react.default.createElement(Grid$14, { item: true }, /*#__PURE__*/ react.default.createElement("div", { |
| 5515 |
className: "eps-modal__close-wrapper", |
| 5516 |
ref: closeRef |
| 5517 |
}, /*#__PURE__*/ react.default.createElement(Button$29, { |
| 5518 |
text: (0, _wordpress_i18n.__)("Close", "elementor"), |
| 5519 |
hideText: true, |
| 5520 |
icon: "eicon-close", |
| 5521 |
onClick: props.closeModal |
| 5522 |
})))), /*#__PURE__*/ react.default.createElement("div", { className: "eps-modal__body" }, props.children))); |
| 5523 |
}; |
| 5524 |
Modal.propTypes = { |
| 5525 |
className: import_prop_types$55.default.string, |
| 5526 |
children: import_prop_types$55.default.any.isRequired, |
| 5527 |
title: import_prop_types$55.default.string.isRequired, |
| 5528 |
icon: import_prop_types$55.default.string, |
| 5529 |
show: import_prop_types$55.default.bool, |
| 5530 |
setShow: import_prop_types$55.default.func, |
| 5531 |
hideModal: import_prop_types$55.default.func, |
| 5532 |
showModal: import_prop_types$55.default.func, |
| 5533 |
closeModal: import_prop_types$55.default.func, |
| 5534 |
onOpen: import_prop_types$55.default.func, |
| 5535 |
onClose: import_prop_types$55.default.func |
| 5536 |
}; |
| 5537 |
Modal.defaultProps = { className: "" }; |
| 5538 |
|
| 5539 |
//#endregion |
| 5540 |
//#region app/modules/import-export/assets/js/shared/info-modal/info-modal-section.js |
| 5541 |
init_utils$4(); |
| 5542 |
function InfoModalSection(props) { |
| 5543 |
return /*#__PURE__*/ react.default.createElement(ModalProvider$1.Section, { className: arrayToClassName(["e-app-import-export-info-modal__section", props.className]) }, props.children); |
| 5544 |
} |
| 5545 |
InfoModalSection.propTypes = { |
| 5546 |
className: import_prop_types$55.default.string, |
| 5547 |
children: import_prop_types$55.default.any |
| 5548 |
}; |
| 5549 |
InfoModalSection.defaultProps = { className: "" }; |
| 5550 |
|
| 5551 |
//#endregion |
| 5552 |
//#region app/modules/import-export/assets/js/shared/info-modal/info-modal-heading.js |
| 5553 |
init_utils$4(); |
| 5554 |
function InfoModalHeading(props) { |
| 5555 |
return /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 5556 |
variant: "h3", |
| 5557 |
tag: "h2", |
| 5558 |
className: arrayToClassName(["e-app-import-export-info-modal__heading", props.className]) |
| 5559 |
}, props.children); |
| 5560 |
} |
| 5561 |
InfoModalHeading.propTypes = { |
| 5562 |
className: import_prop_types$55.default.string, |
| 5563 |
children: import_prop_types$55.default.oneOfType([ |
| 5564 |
import_prop_types$55.default.string, |
| 5565 |
import_prop_types$55.default.object, |
| 5566 |
import_prop_types$55.default.arrayOf(import_prop_types$55.default.object) |
| 5567 |
]).isRequired |
| 5568 |
}; |
| 5569 |
InfoModalHeading.defaultProps = { className: "" }; |
| 5570 |
|
| 5571 |
//#endregion |
| 5572 |
//#region app/modules/import-export/assets/js/shared/info-modal/info-modal-text.js |
| 5573 |
init_utils$4(); |
| 5574 |
function InfoModalText(props) { |
| 5575 |
return /*#__PURE__*/ react.default.createElement(Text$11, { |
| 5576 |
variant: "sm", |
| 5577 |
className: arrayToClassName(["e-app-import-export-info-modal__text", props.className]) |
| 5578 |
}, props.children); |
| 5579 |
} |
| 5580 |
InfoModalText.propTypes = { |
| 5581 |
className: import_prop_types$55.default.string, |
| 5582 |
children: import_prop_types$55.default.any.isRequired |
| 5583 |
}; |
| 5584 |
InfoModalText.defaultProps = { className: "" }; |
| 5585 |
|
| 5586 |
//#endregion |
| 5587 |
//#region app/modules/import-export/assets/js/shared/info-modal/info-modal-tip.js |
| 5588 |
init_extends(); |
| 5589 |
init_utils$4(); |
| 5590 |
function InfoModalTip(props) { |
| 5591 |
return /*#__PURE__*/ react.default.createElement(ModalProvider$1.Tip, _extends({}, props, { className: arrayToClassName(["e-app-import-export-info-modal__tip", props.className]) })); |
| 5592 |
} |
| 5593 |
InfoModalTip.propTypes = { className: import_prop_types$55.default.string }; |
| 5594 |
InfoModalTip.defaultProps = { className: "" }; |
| 5595 |
|
| 5596 |
//#endregion |
| 5597 |
//#region app/modules/import-export/assets/js/shared/info-modal/info-modal.js |
| 5598 |
init_extends(); |
| 5599 |
var infoButtonProps = { |
| 5600 |
id: "info-modal", |
| 5601 |
className: "e-app-export-kit-information__info-icon", |
| 5602 |
icon: "eicon-info-circle", |
| 5603 |
text: (0, _wordpress_i18n.__)("Kit Info", "elementor"), |
| 5604 |
color: "secondary", |
| 5605 |
hideText: true |
| 5606 |
}; |
| 5607 |
function InfoModal(props) { |
| 5608 |
var attrs = { |
| 5609 |
className: "e-app-import-export-info-modal", |
| 5610 |
setShow: props.setShow, |
| 5611 |
onOpen: props.onOpen, |
| 5612 |
onClose: props.onClose, |
| 5613 |
referrer: props.referrer |
| 5614 |
}; |
| 5615 |
if (Object.prototype.hasOwnProperty.call(props, "show")) attrs.show = props.show; |
| 5616 |
else attrs.toggleButtonProps = infoButtonProps; |
| 5617 |
return /*#__PURE__*/ react.default.createElement(ModalProvider$1, _extends({}, attrs, { title: props.title }), props.children); |
| 5618 |
} |
| 5619 |
InfoModal.propTypes = { |
| 5620 |
show: import_prop_types$55.default.bool, |
| 5621 |
setShow: import_prop_types$55.default.func, |
| 5622 |
title: import_prop_types$55.default.string, |
| 5623 |
children: import_prop_types$55.default.any.isRequired, |
| 5624 |
onOpen: import_prop_types$55.default.func, |
| 5625 |
onClose: import_prop_types$55.default.func, |
| 5626 |
referrer: import_prop_types$55.default.string |
| 5627 |
}; |
| 5628 |
InfoModal.Section = InfoModalSection; |
| 5629 |
InfoModal.Heading = InfoModalHeading; |
| 5630 |
InfoModal.Text = InfoModalText; |
| 5631 |
InfoModal.Tip = InfoModalTip; |
| 5632 |
|
| 5633 |
//#endregion |
| 5634 |
//#region app/assets/js/ui/molecules/inline-link.js |
| 5635 |
init_es$1(); |
| 5636 |
init_utils$4(); |
| 5637 |
function InlineLink(props) { |
| 5638 |
var baseClassName = "eps-inline-link"; |
| 5639 |
var className = arrayToClassName([ |
| 5640 |
baseClassName, |
| 5641 |
"".concat(baseClassName, "--color-").concat(props.color), |
| 5642 |
"none" !== props.underline ? "".concat(baseClassName, "--underline-").concat(props.underline) : "", |
| 5643 |
props.italic ? "".concat(baseClassName, "--italic") : "", |
| 5644 |
props.className |
| 5645 |
]); |
| 5646 |
var getRouterLink = function getRouterLink() { |
| 5647 |
return /*#__PURE__*/ react.default.createElement(LocationProvider, { history: _elementor_router.default.appHistory }, /*#__PURE__*/ react.default.createElement(Link$10, { |
| 5648 |
to: props.url, |
| 5649 |
className |
| 5650 |
}, props.children)); |
| 5651 |
}; |
| 5652 |
var getExternalLink = function getExternalLink() { |
| 5653 |
return /*#__PURE__*/ react.default.createElement("a", { |
| 5654 |
href: props.url, |
| 5655 |
target: props.target, |
| 5656 |
rel: props.rel, |
| 5657 |
className, |
| 5658 |
onClick: props.onClick |
| 5659 |
}, props.children); |
| 5660 |
}; |
| 5661 |
var getActionLink = function getActionLink() { |
| 5662 |
return /*#__PURE__*/ react.default.createElement("button", { |
| 5663 |
className, |
| 5664 |
onClick: props.onClick |
| 5665 |
}, props.children); |
| 5666 |
}; |
| 5667 |
if (!props.url) return getActionLink(); |
| 5668 |
return props.url.includes("http") ? getExternalLink() : getRouterLink(); |
| 5669 |
} |
| 5670 |
InlineLink.propTypes = { |
| 5671 |
className: import_prop_types$55.default.string, |
| 5672 |
children: import_prop_types$55.default.any, |
| 5673 |
url: import_prop_types$55.default.string, |
| 5674 |
target: import_prop_types$55.default.string, |
| 5675 |
rel: import_prop_types$55.default.string, |
| 5676 |
text: import_prop_types$55.default.string, |
| 5677 |
color: import_prop_types$55.default.oneOf([ |
| 5678 |
"primary", |
| 5679 |
"secondary", |
| 5680 |
"cta", |
| 5681 |
"link", |
| 5682 |
"disabled" |
| 5683 |
]), |
| 5684 |
underline: import_prop_types$55.default.oneOf([ |
| 5685 |
"none", |
| 5686 |
"hover", |
| 5687 |
"always" |
| 5688 |
]), |
| 5689 |
italic: import_prop_types$55.default.bool, |
| 5690 |
onClick: import_prop_types$55.default.func |
| 5691 |
}; |
| 5692 |
InlineLink.defaultProps = { |
| 5693 |
className: "", |
| 5694 |
color: "link", |
| 5695 |
underline: "always", |
| 5696 |
target: "_blank", |
| 5697 |
rel: "noopener noreferrer" |
| 5698 |
}; |
| 5699 |
|
| 5700 |
//#endregion |
| 5701 |
//#region core/common/modules/events-manager/assets/js/events-config.js |
| 5702 |
var eventsConfig; |
| 5703 |
var init_events_config = __esmMin((() => { |
| 5704 |
eventsConfig = { |
| 5705 |
appTypes: { |
| 5706 |
editor: "editor", |
| 5707 |
wpAdmin: "wpadmin", |
| 5708 |
wpDash: "wpdash" |
| 5709 |
}, |
| 5710 |
windowNames: { sidebarMenu: "sidebar_menu" }, |
| 5711 |
targetTypes: { |
| 5712 |
dropdownItem: "dropdown_item", |
| 5713 |
button: "button", |
| 5714 |
tab: "tab", |
| 5715 |
toggle: "toggle", |
| 5716 |
searchInput: "search_input", |
| 5717 |
searchResult: "search_result", |
| 5718 |
buttons: "buttons", |
| 5719 |
searchWidget: "search_widget", |
| 5720 |
wpDashAdminMenuItem: "wpdash_admin_menu_item", |
| 5721 |
wpDashEditorMenu: "wpdash_editor_menu", |
| 5722 |
wpDashSubMenuItem: "wpdash_sub_menu_item", |
| 5723 |
link: "link" |
| 5724 |
}, |
| 5725 |
interactionResults: { |
| 5726 |
actionSelected: "action_selected", |
| 5727 |
navigate: "navigate", |
| 5728 |
create: "create", |
| 5729 |
sessionEnd: "session_end", |
| 5730 |
tabChanged: "tab_changed", |
| 5731 |
assetInserted: "asset_inserted", |
| 5732 |
assetFavorite: "asset_favorite", |
| 5733 |
aiGenerate: "ai_generate", |
| 5734 |
resultsUpdated: "results_updated", |
| 5735 |
noResults: "no_results", |
| 5736 |
selected: "selected", |
| 5737 |
promotionViewed: "promotion_viewed", |
| 5738 |
upgradeNow: "upgrade_now", |
| 5739 |
elementorSideMenuOpened: "elementor_side_menu_opened", |
| 5740 |
editorSubMenuOpened: "wpdash_editor_sub_menu_opened", |
| 5741 |
themeBuilderPromotionWindow: "theme_builder_promotion_window", |
| 5742 |
pageOpened: "page_opened", |
| 5743 |
expanded: "expanded", |
| 5744 |
collapsed: "collapsed" |
| 5745 |
}, |
| 5746 |
targetNames: { |
| 5747 |
publishDropdown: { |
| 5748 |
saveDraft: "save_draft", |
| 5749 |
saveAsTemplate: "save_as_template", |
| 5750 |
viewPage: "view_page", |
| 5751 |
copyAndShare: "copy_and_share" |
| 5752 |
}, |
| 5753 |
pageList: { addNewPage: "add_new_page" } |
| 5754 |
}, |
| 5755 |
triggers: { |
| 5756 |
click: "Click", |
| 5757 |
rightClick: "Right Click", |
| 5758 |
doubleClick: "Double Click", |
| 5759 |
accordionClick: "Accordion Click", |
| 5760 |
toggleClick: "Toggle Click", |
| 5761 |
dropdownClick: "Click Dropdown", |
| 5762 |
editorLoaded: "Editor Loaded", |
| 5763 |
visible: "Visible", |
| 5764 |
pageLoaded: "Page Loaded", |
| 5765 |
typing: "Typing", |
| 5766 |
tabSelect: "Tab Select", |
| 5767 |
insert: "Insert", |
| 5768 |
hover: "Hover" |
| 5769 |
}, |
| 5770 |
locations: { |
| 5771 |
widgetPanel: "Widget Panel", |
| 5772 |
topBar: "Top Bar", |
| 5773 |
sidebar: "Sidebar", |
| 5774 |
elementorEditor: "Elementor Editor", |
| 5775 |
templatesLibrary: { library: "Templates Library" }, |
| 5776 |
app: { |
| 5777 |
import: "Import Kit", |
| 5778 |
export: "Export Kit", |
| 5779 |
kitLibrary: "Kit Library", |
| 5780 |
cloudKitLibrary: "Cloud Kit Library" |
| 5781 |
}, |
| 5782 |
variables: "Variables Panel", |
| 5783 |
variablesManager: "Variables Manager", |
| 5784 |
admin: "WP admin", |
| 5785 |
wpDashAdmin: "wpdash_admin", |
| 5786 |
structurePanel: "Structure Panel", |
| 5787 |
canvas: "Canvas", |
| 5788 |
leftPanel: "Left Panel", |
| 5789 |
elementorLibrary: "Elementor Library", |
| 5790 |
components: { instanceEditingPanel: "Instance Editing Panel" } |
| 5791 |
}, |
| 5792 |
secondaryLocations: { |
| 5793 |
layout: "Layout Section", |
| 5794 |
basic: "Basic Section", |
| 5795 |
"pro-elements": "Pro Section", |
| 5796 |
general: "General Section", |
| 5797 |
"theme-elements": "Site Section", |
| 5798 |
"theme-elements-single": "Single Section", |
| 5799 |
"woocommerce-elements": "WooCommerce Section", |
| 5800 |
wordpress: "WordPress Section", |
| 5801 |
categories: "Widgets Tab", |
| 5802 |
global: "Globals Tab", |
| 5803 |
"whats-new": "What's New", |
| 5804 |
"document-settings": "Document Settings icon", |
| 5805 |
"preview-page": "Preview Page", |
| 5806 |
"publish-button": "Publish Button", |
| 5807 |
"widget-panel": "Widget Panel Icon", |
| 5808 |
finder: "Finder", |
| 5809 |
help: "Help", |
| 5810 |
elementorLogoDropdown: "top_bar_elementor_logo_dropdown", |
| 5811 |
elementorLogo: "Elementor Logo", |
| 5812 |
eLogoMenu: "E-logo Menu", |
| 5813 |
notes: "Notes", |
| 5814 |
siteSettings: "Site Settings", |
| 5815 |
structure: "Structure", |
| 5816 |
documentNameDropdown: "Document Name dropdown", |
| 5817 |
responsiveControls: "Responsive controls", |
| 5818 |
launchpad: "launchpad", |
| 5819 |
checklistHeader: "Checklist Header", |
| 5820 |
checklistSteps: "Checklist Steps", |
| 5821 |
userPreferences: "User Preferences", |
| 5822 |
contextMenu: "Context Menu", |
| 5823 |
templateLibrary: { |
| 5824 |
saveModal: "Save to Modal", |
| 5825 |
moveModal: "Move to Modal", |
| 5826 |
bulkMoveModal: "Bulk Move to Modal", |
| 5827 |
copyModal: "Copy to Modal", |
| 5828 |
bulkCopyModal: "Bulk Copy to Modal", |
| 5829 |
saveModalSelectFolder: "Save to Modal - select folder", |
| 5830 |
saveModalSelectConnect: "Save to Modal - connect", |
| 5831 |
saveModalSelectUpgrade: "Save to Modal - upgrade", |
| 5832 |
importModal: "Import Modal", |
| 5833 |
newFolderModal: "New Folder Modal", |
| 5834 |
deleteDialog: "Delete Dialog", |
| 5835 |
deleteFolderDialog: "Delete Folder Dialog", |
| 5836 |
renameDialog: "Rename Dialog", |
| 5837 |
createFolderDialog: "Create Folder Dialog", |
| 5838 |
applySettingsDialog: "Apply Settings Dialog", |
| 5839 |
cloudTab: "Cloud Tab", |
| 5840 |
siteTab: "Site Tab", |
| 5841 |
cloudTabFolder: "Cloud Tab - Folder", |
| 5842 |
cloudTabConnect: "Cloud Tab - Connect", |
| 5843 |
cloudTabUpgrade: "Cloud Tab - Upgrade", |
| 5844 |
morePopup: "Context Menu", |
| 5845 |
quotaBar: "Quota Bar" |
| 5846 |
}, |
| 5847 |
kitLibrary: { |
| 5848 |
cloudKitLibrary: "kits_cloud_library", |
| 5849 |
cloudKitLibraryConnect: "kits_cloud_library_connect", |
| 5850 |
cloudKitLibraryUpgrade: "kits_cloud_library_upgrade", |
| 5851 |
kitExportCustomization: "kit_export_customization", |
| 5852 |
kitExport: "kit_export", |
| 5853 |
kitExportCustomizationEdit: "kit_export_customization_edit", |
| 5854 |
kitExportSummary: "kit_export_summary", |
| 5855 |
kitImportUploadBox: "kit_import_upload_box", |
| 5856 |
kitImportCustomization: "kit_import_customization", |
| 5857 |
kitImportSummary: "kit_import_summary" |
| 5858 |
}, |
| 5859 |
variablesPopover: "Variables Popover", |
| 5860 |
admin: { |
| 5861 |
pluginToolsTab: "plugin_tools_tab", |
| 5862 |
pluginWebsiteTemplatesTab: "plugin_website_templates_tab" |
| 5863 |
}, |
| 5864 |
componentsTab: "Components Tab", |
| 5865 |
canvasElement: "Canvas Element", |
| 5866 |
publishDropdown: "Publish Dropdown", |
| 5867 |
pageListDropdown: "Page List Dropdown", |
| 5868 |
emptyBox: "Empty Box", |
| 5869 |
searchBar: "Search Bar", |
| 5870 |
finderResults: "Finder Results", |
| 5871 |
libraryTabs: "Library Tabs", |
| 5872 |
assetCard: "Asset Card", |
| 5873 |
wpDashElementorCoreMenu: "elementor_editor_core_menu", |
| 5874 |
wpDashElementorCoreSubMenu: "elementor_editor_core_sub_menu", |
| 5875 |
wpDashThemeBuilder: "wpdash_core_sub_menu_theme_builder" |
| 5876 |
}, |
| 5877 |
elements: { |
| 5878 |
accordionSection: "Accordion section", |
| 5879 |
buttonIcon: "Button Icon", |
| 5880 |
mainCta: "Main CTA", |
| 5881 |
button: "Button", |
| 5882 |
link: "Link", |
| 5883 |
dropdown: "Dropdown", |
| 5884 |
toggle: "Toggle", |
| 5885 |
launchpadChecklist: "Checklist popup" |
| 5886 |
}, |
| 5887 |
names: { |
| 5888 |
v1: { |
| 5889 |
layout: "v1_widgets_tab_layout_section", |
| 5890 |
basic: "v1_widgets_tab_basic_section", |
| 5891 |
"pro-elements": "v1_widgets_tab_pro_section", |
| 5892 |
general: "v1_widgets_tab_general_section", |
| 5893 |
"theme-elements": "v1_widgets_tab_site_section", |
| 5894 |
"theme-elements-single": "v1_widgets_tab_single_section", |
| 5895 |
"woocommerce-elements": "v1_widgets_tab_woocommerce_section", |
| 5896 |
wordpress: "v1_widgets_tab_wordpress_section", |
| 5897 |
categories: "v1_widgets_tab", |
| 5898 |
global: "v1_globals_tab" |
| 5899 |
}, |
| 5900 |
topBar: { |
| 5901 |
whatsNew: "top_bar_whats_new", |
| 5902 |
documentSettings: "top_bar_document_settings_icon", |
| 5903 |
previewPage: "top_bar_preview_page", |
| 5904 |
publishButton: "top_bar_publish_button", |
| 5905 |
widgetPanel: "top_bar_widget_panel_icon", |
| 5906 |
finder: "top_bar_finder", |
| 5907 |
help: "top_bar_help", |
| 5908 |
history: "top_bar_elementor_logo_dropdown_history", |
| 5909 |
userPreferences: "top_bar_elementor_logo_dropdown_user_preferences", |
| 5910 |
keyboardShortcuts: "top_bar_elementor_logo_dropdown_keyboard_shortcuts", |
| 5911 |
exitToWordpress: "top_bar_elementor_logo_dropdown_exit_to_wordpress", |
| 5912 |
themeBuilder: "top_bar_elementor_logo_dropdown_theme_builder", |
| 5913 |
notes: "top_bar_notes", |
| 5914 |
siteSettings: "top_bar_site_setting", |
| 5915 |
structure: "top_bar_structure", |
| 5916 |
documentNameDropdown: "top_bar_document_name_dropdown", |
| 5917 |
responsiveControls: "top_bar_responsive_controls", |
| 5918 |
launchpadOn: "top_bar_checklist_icon_show", |
| 5919 |
launchpadOff: "top_bar_checklist_icon_hide", |
| 5920 |
elementorLogoDropdown: "open_e_menu", |
| 5921 |
connectAccount: "connect_account", |
| 5922 |
accountConnected: "account_connected" |
| 5923 |
}, |
| 5924 |
elementorEditor: { |
| 5925 |
editorLoaded: "editor_loaded", |
| 5926 |
checklist: { |
| 5927 |
checklistHeaderClose: "checklist_header_close_icon", |
| 5928 |
checklistFirstPopup: "checklist popup triggered" |
| 5929 |
}, |
| 5930 |
userPreferences: { |
| 5931 |
checklistShow: "checklist_userpreferences_toggle_show", |
| 5932 |
checklistHide: "checklist_userpreferences_toggle_hide" |
| 5933 |
} |
| 5934 |
}, |
| 5935 |
variables: { |
| 5936 |
open: "open_variables_popover", |
| 5937 |
add: "add_new_variable", |
| 5938 |
connect: "connect_variable", |
| 5939 |
save: "save_new_variable", |
| 5940 |
update: "update_variable", |
| 5941 |
openManager: "open_variables_manager", |
| 5942 |
saveChanges: "save_variables_changes", |
| 5943 |
delete: "delete_variable", |
| 5944 |
variableSyncToV3: "variable_sync_to_v3" |
| 5945 |
}, |
| 5946 |
design_system: { |
| 5947 |
importOpened: "design_system_import_opened", |
| 5948 |
fileSelected: "design_system_file_selected", |
| 5949 |
validationFailed: "design_system_validation_failed", |
| 5950 |
conflictChoice: "design_system_conflict_choice", |
| 5951 |
confirmed: "design_system_import_confirmed", |
| 5952 |
imported: "design_system_imported", |
| 5953 |
importFailed: "design_system_import_failed", |
| 5954 |
export: "design_system_export", |
| 5955 |
opened: "design_system_opened" |
| 5956 |
}, |
| 5957 |
components: { |
| 5958 |
createClicked: "component_create_clicked", |
| 5959 |
createCancelled: "component_creation_cancelled", |
| 5960 |
created: "component_created", |
| 5961 |
instanceAdded: "component_instance_added", |
| 5962 |
edited: "component_edited", |
| 5963 |
propertiesPanelOpened: "component_properties_panel_opened", |
| 5964 |
propertiesGroupCreated: "component_properties_group_created", |
| 5965 |
propertyExposed: "component_property_exposed", |
| 5966 |
propertyRemoved: "component_property_removed", |
| 5967 |
detached: "component_detached" |
| 5968 |
}, |
| 5969 |
global_classes: { |
| 5970 |
classApplied: "class_applied", |
| 5971 |
classRemoved: "class_removed", |
| 5972 |
classManagerFilterCleared: "class_manager_filter_cleared", |
| 5973 |
classDeleted: "class_deleted", |
| 5974 |
classPublishConflict: "class_publish_conflict", |
| 5975 |
classRenamed: "class_renamed", |
| 5976 |
classCreated: "class_created", |
| 5977 |
classManagerSearched: "class_manager_searched", |
| 5978 |
classManagerFiltersOpened: "class_manager_filters_opened", |
| 5979 |
classManagerOpened: "class_manager_opened", |
| 5980 |
classManagerReorder: "class_manager_reorder", |
| 5981 |
classManagerFilterUsed: "class_manager_filter_used", |
| 5982 |
classUsageLocate: "class_usage_locate", |
| 5983 |
classUsageHovered: "class_usage_hovered", |
| 5984 |
classStyled: "class_styled", |
| 5985 |
classStateClicked: "class_state_clicked", |
| 5986 |
classUsageClicked: "class_usage_clicked", |
| 5987 |
classDuplicate: "class_duplicate", |
| 5988 |
classSyncToV3PopupShown: "class_sync_to_v3_popup_shown", |
| 5989 |
classSyncToV3: "class_sync_to_v3", |
| 5990 |
classSyncToV3PopupClick: "class_sync_to_v3_popup_click" |
| 5991 |
}, |
| 5992 |
editorOne: { |
| 5993 |
topBarPublishDropdown: "top_bar_publish_dropdown", |
| 5994 |
topBarPageList: "top_bar_page_list", |
| 5995 |
siteSettingsSession: "site_settings_session", |
| 5996 |
eLibraryNav: "e_library_nav", |
| 5997 |
eLibraryInsert: "e_library_insert", |
| 5998 |
eLibraryFavorite: "e_library_favorite", |
| 5999 |
eLibraryGenerateAi: "e_library_generate_ai", |
| 6000 |
finderSearchInput: "finder_search_input", |
| 6001 |
finderResultSelect: "finder_result_select", |
| 6002 |
canvasEmptyBoxAction: "canvas_empty_box_action", |
| 6003 |
widgetPanelSearch: "widget_panel_search", |
| 6004 |
wpDashElementorMenuClick: "wpdash_elementor_menu_click", |
| 6005 |
wpDashEditorSubMenuHover: "wpdash_editor_sub_menu_hover", |
| 6006 |
wpDashThemeBuilderClick: "wpdash_theme_builder_click", |
| 6007 |
sidebarMenuItemClicked: "sidebar_menu_item_clicked", |
| 6008 |
sidebarMenuGroupToggled: "sidebar_menu_group_toggled" |
| 6009 |
}, |
| 6010 |
interactions: { created: "interactions_created" }, |
| 6011 |
promotions: { |
| 6012 |
viewPromotion: "view_promotion", |
| 6013 |
upgradePromotionClick: "upgrade_promotion_click" |
| 6014 |
} |
| 6015 |
} |
| 6016 |
}; |
| 6017 |
})); |
| 6018 |
|
| 6019 |
//#endregion |
| 6020 |
//#region app/assets/js/event-track/apps-event-tracking.js |
| 6021 |
function ownKeys$31(e, r) { |
| 6022 |
var t = Object.keys(e); |
| 6023 |
if (Object.getOwnPropertySymbols) { |
| 6024 |
var o = Object.getOwnPropertySymbols(e); |
| 6025 |
r && (o = o.filter(function(r) { |
| 6026 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 6027 |
})), t.push.apply(t, o); |
| 6028 |
} |
| 6029 |
return t; |
| 6030 |
} |
| 6031 |
function _objectSpread$30(e) { |
| 6032 |
for (var r = 1; r < arguments.length; r++) { |
| 6033 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 6034 |
r % 2 ? ownKeys$31(Object(t), !0).forEach(function(r) { |
| 6035 |
_defineProperty$1(e, r, t[r]); |
| 6036 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$31(Object(t)).forEach(function(r) { |
| 6037 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 6038 |
}); |
| 6039 |
} |
| 6040 |
return e; |
| 6041 |
} |
| 6042 |
function _createForOfIteratorHelper$4(r, e) { |
| 6043 |
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 6044 |
if (!t) { |
| 6045 |
if (Array.isArray(r) || (t = _unsupportedIterableToArray$4(r)) || e && r && "number" == typeof r.length) { |
| 6046 |
t && (r = t); |
| 6047 |
var _n = 0; |
| 6048 |
var F = function F() {}; |
| 6049 |
return { |
| 6050 |
s: F, |
| 6051 |
n: function n() { |
| 6052 |
return _n >= r.length ? { done: !0 } : { |
| 6053 |
done: !1, |
| 6054 |
value: r[_n++] |
| 6055 |
}; |
| 6056 |
}, |
| 6057 |
e: function e(r) { |
| 6058 |
throw r; |
| 6059 |
}, |
| 6060 |
f: F |
| 6061 |
}; |
| 6062 |
} |
| 6063 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 6064 |
} |
| 6065 |
var o; |
| 6066 |
var a = !0; |
| 6067 |
var u = !1; |
| 6068 |
return { |
| 6069 |
s: function s() { |
| 6070 |
t = t.call(r); |
| 6071 |
}, |
| 6072 |
n: function n() { |
| 6073 |
var r = t.next(); |
| 6074 |
return a = r.done, r; |
| 6075 |
}, |
| 6076 |
e: function e(r) { |
| 6077 |
u = !0, o = r; |
| 6078 |
}, |
| 6079 |
f: function f() { |
| 6080 |
try { |
| 6081 |
a || null == t.return || t.return(); |
| 6082 |
} finally { |
| 6083 |
if (u) throw o; |
| 6084 |
} |
| 6085 |
} |
| 6086 |
}; |
| 6087 |
} |
| 6088 |
function _unsupportedIterableToArray$4(r, a) { |
| 6089 |
if (r) { |
| 6090 |
if ("string" == typeof r) return _arrayLikeToArray$4(r, a); |
| 6091 |
var t = {}.toString.call(r).slice(8, -1); |
| 6092 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$4(r, a) : void 0; |
| 6093 |
} |
| 6094 |
} |
| 6095 |
function _arrayLikeToArray$4(r, a) { |
| 6096 |
(null == a || a > r.length) && (a = r.length); |
| 6097 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 6098 |
return n; |
| 6099 |
} |
| 6100 |
var EVENTS_MAP, appsEventTrackingDispatch, AppsEventTracking; |
| 6101 |
var init_apps_event_tracking = __esmMin((() => { |
| 6102 |
init_defineProperty$1(); |
| 6103 |
init_classCallCheck(); |
| 6104 |
init_createClass(); |
| 6105 |
init_events_config(); |
| 6106 |
__name(ownKeys$31, "ownKeys"); |
| 6107 |
__name(_objectSpread$30, "_objectSpread"); |
| 6108 |
__name(_createForOfIteratorHelper$4, "_createForOfIteratorHelper"); |
| 6109 |
__name(_unsupportedIterableToArray$4, "_unsupportedIterableToArray"); |
| 6110 |
__name(_arrayLikeToArray$4, "_arrayLikeToArray"); |
| 6111 |
EVENTS_MAP = { |
| 6112 |
PAGE_VIEWS_WEBSITE_TEMPLATES: "page_views_website_templates", |
| 6113 |
KITS_CLOUD_UPGRADE_CLICKED: "kits_cloud_upgrade_clicked", |
| 6114 |
EXPORT_KIT_CUSTOMIZATION: "export_kit_customization", |
| 6115 |
IMPORT_KIT_CUSTOMIZATION: "import_kit_customization", |
| 6116 |
KIT_IMPORT_STATUS: "kit_import_status", |
| 6117 |
KIT_CLOUD_LIBRARY_APPLY: "kit_cloud_library_apply", |
| 6118 |
KIT_CLOUD_LIBRARY_DELETE: "kit_cloud_library_delete", |
| 6119 |
IMPORT_EXPORT_ADMIN_ACTION: "ie_admin_action", |
| 6120 |
KIT_IMPORT_UPLOAD_FILE: "kit_import_upload_file" |
| 6121 |
}; |
| 6122 |
appsEventTrackingDispatch = function appsEventTrackingDispatch(command, eventParams) { |
| 6123 |
var objectCreator = function objectCreator(array, obj) { |
| 6124 |
var _iterator = _createForOfIteratorHelper$4(array); |
| 6125 |
var _step; |
| 6126 |
try { |
| 6127 |
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 6128 |
var key = _step.value; |
| 6129 |
if (eventParams.hasOwnProperty(key) && eventParams[key] !== null) obj[key] = eventParams[key]; |
| 6130 |
} |
| 6131 |
} catch (err) { |
| 6132 |
_iterator.e(err); |
| 6133 |
} finally { |
| 6134 |
_iterator.f(); |
| 6135 |
} |
| 6136 |
return obj; |
| 6137 |
}; |
| 6138 |
var dataKeys = []; |
| 6139 |
var detailsKeys = [ |
| 6140 |
"layout", |
| 6141 |
"site_part", |
| 6142 |
"error", |
| 6143 |
"document_name", |
| 6144 |
"document_type", |
| 6145 |
"view_type_clicked", |
| 6146 |
"tag", |
| 6147 |
"sort_direction", |
| 6148 |
"sort_type", |
| 6149 |
"action", |
| 6150 |
"grid_location", |
| 6151 |
"kit_name", |
| 6152 |
"page_source", |
| 6153 |
"element_position", |
| 6154 |
"element", |
| 6155 |
"event_type", |
| 6156 |
"modal_type", |
| 6157 |
"method", |
| 6158 |
"status", |
| 6159 |
"step", |
| 6160 |
"item", |
| 6161 |
"category", |
| 6162 |
"element_location", |
| 6163 |
"search_term", |
| 6164 |
"section", |
| 6165 |
"site_area" |
| 6166 |
]; |
| 6167 |
var data = {}; |
| 6168 |
var details = {}; |
| 6169 |
(function init() { |
| 6170 |
objectCreator(detailsKeys, details); |
| 6171 |
objectCreator(dataKeys, data); |
| 6172 |
var commandSplit = command.split("/"); |
| 6173 |
data.placement = commandSplit[0]; |
| 6174 |
data.event = commandSplit[1]; |
| 6175 |
if (Object.keys(details).length) data.details = details; |
| 6176 |
})(); |
| 6177 |
$e.run(command, data); |
| 6178 |
}; |
| 6179 |
AppsEventTracking = /*#__PURE__*/ function() { |
| 6180 |
function AppsEventTracking() { |
| 6181 |
_classCallCheck(this, AppsEventTracking); |
| 6182 |
} |
| 6183 |
return _createClass(AppsEventTracking, null, [ |
| 6184 |
{ |
| 6185 |
key: "dispatchEvent", |
| 6186 |
value: function dispatchEvent(eventName, payload) { |
| 6187 |
var _window$elementorComm; |
| 6188 |
var _window$elementorComm2; |
| 6189 |
return (_window$elementorComm = window.elementorCommon) === null || _window$elementorComm === void 0 || (_window$elementorComm = _window$elementorComm.eventsManager) === null || _window$elementorComm === void 0 || (_window$elementorComm2 = _window$elementorComm.dispatchEvent) === null || _window$elementorComm2 === void 0 ? void 0 : _window$elementorComm2.call(_window$elementorComm, eventName, payload); |
| 6190 |
} |
| 6191 |
}, |
| 6192 |
{ |
| 6193 |
key: "sendPageViewsWebsiteTemplates", |
| 6194 |
value: function sendPageViewsWebsiteTemplates(page) { |
| 6195 |
return this.dispatchEvent(EVENTS_MAP.PAGE_VIEWS_WEBSITE_TEMPLATES, { |
| 6196 |
trigger: eventsConfig.triggers.pageLoaded, |
| 6197 |
page_loaded: page, |
| 6198 |
secondary_location: page |
| 6199 |
}); |
| 6200 |
} |
| 6201 |
}, |
| 6202 |
{ |
| 6203 |
key: "sendKitsCloudUpgradeClicked", |
| 6204 |
value: function sendKitsCloudUpgradeClicked(upgradeLocation) { |
| 6205 |
return this.dispatchEvent(EVENTS_MAP.KITS_CLOUD_UPGRADE_CLICKED, { |
| 6206 |
trigger: eventsConfig.triggers.click, |
| 6207 |
secondary_location: upgradeLocation, |
| 6208 |
upgrade_location: upgradeLocation |
| 6209 |
}); |
| 6210 |
} |
| 6211 |
}, |
| 6212 |
{ |
| 6213 |
key: "sendExportKitCustomization", |
| 6214 |
value: function sendExportKitCustomization(payload) { |
| 6215 |
return this.dispatchEvent(EVENTS_MAP.EXPORT_KIT_CUSTOMIZATION, _objectSpread$30({ trigger: eventsConfig.triggers.click }, payload)); |
| 6216 |
} |
| 6217 |
}, |
| 6218 |
{ |
| 6219 |
key: "sendImportKitCustomization", |
| 6220 |
value: function sendImportKitCustomization(payload) { |
| 6221 |
return this.dispatchEvent(EVENTS_MAP.IMPORT_KIT_CUSTOMIZATION, _objectSpread$30({ trigger: eventsConfig.triggers.click }, payload)); |
| 6222 |
} |
| 6223 |
}, |
| 6224 |
{ |
| 6225 |
key: "sendKitImportStatus", |
| 6226 |
value: function sendKitImportStatus() { |
| 6227 |
var error = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; |
| 6228 |
var isError = !!error; |
| 6229 |
return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_STATUS, _objectSpread$30({ kit_import_status: !isError }, isError && { kit_import_error: error.message })); |
| 6230 |
} |
| 6231 |
}, |
| 6232 |
{ |
| 6233 |
key: "sendKitCloudLibraryApply", |
| 6234 |
value: function sendKitCloudLibraryApply(kitId, kitApplyUrl) { |
| 6235 |
return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_APPLY, _objectSpread$30({ |
| 6236 |
trigger: eventsConfig.triggers.click, |
| 6237 |
kit_cloud_id: kitId |
| 6238 |
}, kitApplyUrl && { kit_apply_url: kitApplyUrl })); |
| 6239 |
} |
| 6240 |
}, |
| 6241 |
{ |
| 6242 |
key: "sendKitCloudLibraryDelete", |
| 6243 |
value: function sendKitCloudLibraryDelete() { |
| 6244 |
return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_DELETE, { trigger: eventsConfig.triggers.click }); |
| 6245 |
} |
| 6246 |
}, |
| 6247 |
{ |
| 6248 |
key: "sendImportExportAdminAction", |
| 6249 |
value: function sendImportExportAdminAction(actionType) { |
| 6250 |
return this.dispatchEvent(EVENTS_MAP.IMPORT_EXPORT_ADMIN_ACTION, { |
| 6251 |
trigger: eventsConfig.triggers.click, |
| 6252 |
action_type: actionType |
| 6253 |
}); |
| 6254 |
} |
| 6255 |
}, |
| 6256 |
{ |
| 6257 |
key: "sendKitImportUploadFile", |
| 6258 |
value: function sendKitImportUploadFile(status) { |
| 6259 |
return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_UPLOAD_FILE, { kit_import_upload_file_status: status }); |
| 6260 |
} |
| 6261 |
} |
| 6262 |
]); |
| 6263 |
}(); |
| 6264 |
})); |
| 6265 |
|
| 6266 |
//#endregion |
| 6267 |
//#region app/modules/import-export/assets/js/shared/info-modal/import-info-modal.js |
| 6268 |
init_extends(); |
| 6269 |
init_apps_event_tracking(); |
| 6270 |
function ImportInfoModal(props) { |
| 6271 |
var eventTracking = function eventTracking(element) { |
| 6272 |
return appsEventTrackingDispatch("kit-library/seek-more-info", { |
| 6273 |
page_source: "import", |
| 6274 |
modal_type: "info", |
| 6275 |
event_type: "click", |
| 6276 |
element |
| 6277 |
}); |
| 6278 |
}; |
| 6279 |
return /*#__PURE__*/ react.default.createElement(InfoModal, _extends({}, props, { title: (0, _wordpress_i18n.__)("Import a Website Template", "elementor") }), /*#__PURE__*/ react.default.createElement(InfoModal.Section, null, /*#__PURE__*/ react.default.createElement(InfoModal.Heading, null, (0, _wordpress_i18n.__)("What’s a Website Template?", "elementor")), /*#__PURE__*/ react.default.createElement(InfoModal.Text, null, /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("A Website Template is a .zip file that contains all the parts of a complete site. It’s an easy way to get a site up and running quickly.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 6280 |
url: "https://go.elementor.com/app-what-are-kits", |
| 6281 |
onClick: function onClick() { |
| 6282 |
return eventTracking("Learn more about website templates"); |
| 6283 |
} |
| 6284 |
}, " ", (0, _wordpress_i18n.__)(" Learn more about Website Templates", "elementor"))))), /*#__PURE__*/ react.default.createElement(InfoModal.Section, null, /*#__PURE__*/ react.default.createElement(InfoModal.Heading, null, (0, _wordpress_i18n.__)("How does importing work?", "elementor")), /*#__PURE__*/ react.default.createElement(InfoModal.Text, null, /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Start by uploading the file and selecting the parts and plugins you want to apply. If there are any overlaps between the kit and your current design, you’ll be able to choose which imported parts you want to apply or ignore. Once the file is ready, the kit will be applied to your site and you’ll be able to see it live.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 6285 |
url: "https://go.elementor.com/app-import-kit", |
| 6286 |
onClick: function onClick() { |
| 6287 |
return eventTracking("learn more"); |
| 6288 |
} |
| 6289 |
}, (0, _wordpress_i18n.__)("Learn More", "elementor")))))); |
| 6290 |
} |
| 6291 |
|
| 6292 |
//#endregion |
| 6293 |
//#region app/modules/import-export/assets/js/shared/info-modal/export-info-modal.js |
| 6294 |
init_extends(); |
| 6295 |
function ExportInfoModal(props) { |
| 6296 |
return /*#__PURE__*/ react.default.createElement(InfoModal, _extends({}, props, { title: (0, _wordpress_i18n.__)("Export a Website Kit", "elementor") }), /*#__PURE__*/ react.default.createElement(InfoModal.Section, null, /*#__PURE__*/ react.default.createElement(InfoModal.Heading, null, (0, _wordpress_i18n.__)("What’s a Website Kit?", "elementor")), /*#__PURE__*/ react.default.createElement(InfoModal.Text, null, /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("A Website Kit is a .zip file that contains all the parts of a complete site. It’s an easy way to get a site up and running quickly.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement(InlineLink, { url: "https://go.elementor.com/app-what-are-kits" }, (0, _wordpress_i18n.__)("Learn more about Website Kits", "elementor"))))), /*#__PURE__*/ react.default.createElement(InfoModal.Section, null, /*#__PURE__*/ react.default.createElement(InfoModal.Heading, null, (0, _wordpress_i18n.__)("How does exporting work?", "elementor")), /*#__PURE__*/ react.default.createElement(InfoModal.Text, null, /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("To turn your site into a Website Kit, select the templates, content, settings and plugins you want to include. Once it’s ready, you’ll get a .zip file that you can import to other sites.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement(InlineLink, { url: "https://go.elementor.com/app-export-kit" }, (0, _wordpress_i18n.__)("Learn More", "elementor")))))); |
| 6297 |
} |
| 6298 |
|
| 6299 |
//#endregion |
| 6300 |
//#region app/modules/import-export/assets/js/shared/utils/is-valid-redirect-url.js |
| 6301 |
function isValidRedirectUrl$1(url) { |
| 6302 |
try { |
| 6303 |
var parsedUrl = new URL(url); |
| 6304 |
return parsedUrl.hostname === window.location.hostname && ("http:" === parsedUrl.protocol || "https:" === parsedUrl.protocol); |
| 6305 |
} catch (e) { |
| 6306 |
return false; |
| 6307 |
} |
| 6308 |
} |
| 6309 |
var init_is_valid_redirect_url = __esmMin((() => { |
| 6310 |
__name(isValidRedirectUrl$1, "isValidRedirectUrl"); |
| 6311 |
})); |
| 6312 |
|
| 6313 |
//#endregion |
| 6314 |
//#region app/modules/import-export/assets/js/shared/utils/redirect.js |
| 6315 |
function safeRedirect$1(url) { |
| 6316 |
try { |
| 6317 |
if (url.startsWith("/")) url = window.location.origin + url; |
| 6318 |
var decodedUrl = decodeURIComponent(url); |
| 6319 |
if (isValidRedirectUrl$1(decodedUrl)) { |
| 6320 |
window.location.href = decodedUrl; |
| 6321 |
return true; |
| 6322 |
} |
| 6323 |
} catch (e) { |
| 6324 |
return false; |
| 6325 |
} |
| 6326 |
} |
| 6327 |
var init_redirect = __esmMin((() => { |
| 6328 |
init_is_valid_redirect_url(); |
| 6329 |
__name(safeRedirect$1, "safeRedirect"); |
| 6330 |
})); |
| 6331 |
|
| 6332 |
//#endregion |
| 6333 |
//#region app/modules/import-export/assets/js/templates/layout.js |
| 6334 |
init_toConsumableArray(); |
| 6335 |
init_defineProperty$1(); |
| 6336 |
init_slicedToArray(); |
| 6337 |
init_apps_event_tracking(); |
| 6338 |
init_redirect(); |
| 6339 |
function ownKeys$30(e, r) { |
| 6340 |
var t = Object.keys(e); |
| 6341 |
if (Object.getOwnPropertySymbols) { |
| 6342 |
var o = Object.getOwnPropertySymbols(e); |
| 6343 |
r && (o = o.filter(function(r) { |
| 6344 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 6345 |
})), t.push.apply(t, o); |
| 6346 |
} |
| 6347 |
return t; |
| 6348 |
} |
| 6349 |
__name(ownKeys$30, "ownKeys"); |
| 6350 |
function _objectSpread$29(e) { |
| 6351 |
for (var r = 1; r < arguments.length; r++) { |
| 6352 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 6353 |
r % 2 ? ownKeys$30(Object(t), !0).forEach(function(r) { |
| 6354 |
_defineProperty$1(e, r, t[r]); |
| 6355 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$30(Object(t)).forEach(function(r) { |
| 6356 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 6357 |
}); |
| 6358 |
} |
| 6359 |
return e; |
| 6360 |
} |
| 6361 |
__name(_objectSpread$29, "_objectSpread"); |
| 6362 |
function Layout(props) { |
| 6363 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 6364 |
var showInfoModal = _useState2[0]; |
| 6365 |
var setShowInfoModal = _useState2[1]; |
| 6366 |
var referrer = useQueryParams().getAll().referrer; |
| 6367 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 6368 |
var _sharedContext$data = sharedContext.data; |
| 6369 |
var currentPage = _sharedContext$data.currentPage; |
| 6370 |
var returnTo = _sharedContext$data.returnTo; |
| 6371 |
var eventTracking = function eventTracking(command) { |
| 6372 |
var elementPosition = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 6373 |
var element = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 6374 |
var eventType = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "click"; |
| 6375 |
var modalType = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null; |
| 6376 |
if ("kit-library" === sharedContext.data.referrer || referrer) appsEventTrackingDispatch(command, { |
| 6377 |
element, |
| 6378 |
page_source: "import", |
| 6379 |
event_type: eventType, |
| 6380 |
step: currentPage, |
| 6381 |
element_position: elementPosition, |
| 6382 |
modal_type: modalType |
| 6383 |
}); |
| 6384 |
}; |
| 6385 |
var onModalClose = function onModalClose(e, command) { |
| 6386 |
eventTracking(command, e.target.classList.contains("eps-modal__overlay") ? "overlay" : "x", null, "info"); |
| 6387 |
}; |
| 6388 |
var getContent = function getContent() { |
| 6389 |
var infoModalProps = { |
| 6390 |
show: showInfoModal, |
| 6391 |
setShow: setShowInfoModal |
| 6392 |
}; |
| 6393 |
if ("kit-library" === sharedContext.data.referrer || referrer) infoModalProps = _objectSpread$29(_objectSpread$29({ referrer }, infoModalProps), {}, { |
| 6394 |
onOpen: function onOpen() { |
| 6395 |
return eventTracking("kit-library/modal-open", null, null, "load", "info"); |
| 6396 |
}, |
| 6397 |
onClose: function onClose(e) { |
| 6398 |
return onModalClose(e, "kit-library/modal-close"); |
| 6399 |
} |
| 6400 |
}); |
| 6401 |
return /*#__PURE__*/ react.default.createElement(ContentLayout, null, props.children, "import" === props.type ? /*#__PURE__*/ react.default.createElement(ImportInfoModal, infoModalProps) : /*#__PURE__*/ react.default.createElement(ExportInfoModal, infoModalProps)); |
| 6402 |
}; |
| 6403 |
var getInfoButtonProps = function getInfoButtonProps() { |
| 6404 |
return _objectSpread$29(_objectSpread$29({}, infoButtonProps), {}, { onClick: function onClick() { |
| 6405 |
eventTracking("kit-library/seek-more-info", "app_header"); |
| 6406 |
setShowInfoModal(true); |
| 6407 |
} }); |
| 6408 |
}; |
| 6409 |
var _onClose = function onClose() { |
| 6410 |
eventTracking("kit-library/close", "app_header", null, "click"); |
| 6411 |
if (returnTo && safeRedirect$1(returnTo)) {} else if ("kit-library" === sharedContext.data.referrer || "kit-library" === referrer) window.top.location = elementorAppConfig.admin_url + "admin.php?page=elementor-app&source=kit_import#/kit-library"; |
| 6412 |
else window.top.location = elementorAppConfig.admin_url + "admin.php?page=elementor-tools#tab-import-export-kit"; |
| 6413 |
}; |
| 6414 |
var config = { |
| 6415 |
title: "import" === props.type ? (0, _wordpress_i18n.__)("Import", "elementor") : (0, _wordpress_i18n.__)("Export", "elementor"), |
| 6416 |
headerButtons: [getInfoButtonProps()].concat(_toConsumableArray(props.headerButtons)), |
| 6417 |
content: getContent(), |
| 6418 |
footer: props.footer, |
| 6419 |
onClose: function onClose() { |
| 6420 |
return _onClose(); |
| 6421 |
} |
| 6422 |
}; |
| 6423 |
var moduleAdminTab = "#tab-import-export-kit"; |
| 6424 |
if (!referrer && -1 === elementorAppConfig.return_url.indexOf(moduleAdminTab) && elementorAppConfig.return_url.includes("page=elementor-tools")) elementorAppConfig.return_url += moduleAdminTab; |
| 6425 |
(0, react.useEffect)(function() { |
| 6426 |
if (referrer) sharedContext.dispatch({ |
| 6427 |
type: "SET_REFERRER", |
| 6428 |
payload: referrer |
| 6429 |
}); |
| 6430 |
}, [referrer]); |
| 6431 |
return /*#__PURE__*/ react.default.createElement(Page, config); |
| 6432 |
} |
| 6433 |
Layout.propTypes = { |
| 6434 |
type: import_prop_types$55.default.oneOf(["import", "export"]), |
| 6435 |
headerButtons: import_prop_types$55.default.arrayOf(import_prop_types$55.default.object), |
| 6436 |
children: import_prop_types$55.default.object.isRequired, |
| 6437 |
footer: import_prop_types$55.default.object |
| 6438 |
}; |
| 6439 |
Layout.defaultProps = { headerButtons: [] }; |
| 6440 |
|
| 6441 |
//#endregion |
| 6442 |
//#region app/modules/import-export/assets/js/ui/page-header/page-header.js |
| 6443 |
init_utils$4(); |
| 6444 |
function PageHeader$1(props) { |
| 6445 |
var classes = ["e-app-import-export-page-header", props.className]; |
| 6446 |
return /*#__PURE__*/ react.default.createElement("div", { className: arrayToClassName(classes) }, /*#__PURE__*/ react.default.createElement(Grid$14, { container: true }, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 6447 |
item: true, |
| 6448 |
className: "e-app-import-export-page-header__content-wrapper" |
| 6449 |
}, props.heading && /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 6450 |
variant: "display-3", |
| 6451 |
className: "e-app-import-export-page-header__heading" |
| 6452 |
}, props.heading), props.description && /*#__PURE__*/ react.default.createElement(Text$11, { className: "e-app-import-export-page-header__description" }, function handleMultiLine(content) { |
| 6453 |
if (Array.isArray(content)) { |
| 6454 |
var multiLineArray = []; |
| 6455 |
content.forEach(function(line, index) { |
| 6456 |
if (index) multiLineArray.push(/*#__PURE__*/ react.default.createElement("br", { key: index })); |
| 6457 |
multiLineArray.push(line); |
| 6458 |
}); |
| 6459 |
return multiLineArray; |
| 6460 |
} |
| 6461 |
return content; |
| 6462 |
}(props.description))))); |
| 6463 |
} |
| 6464 |
__name(PageHeader$1, "PageHeader"); |
| 6465 |
PageHeader$1.propTypes = { |
| 6466 |
className: import_prop_types$55.default.string, |
| 6467 |
heading: import_prop_types$55.default.string, |
| 6468 |
description: import_prop_types$55.default.oneOfType([ |
| 6469 |
import_prop_types$55.default.string, |
| 6470 |
import_prop_types$55.default.array, |
| 6471 |
import_prop_types$55.default.object |
| 6472 |
]) |
| 6473 |
}; |
| 6474 |
PageHeader$1.defaultProps = { className: "" }; |
| 6475 |
|
| 6476 |
//#endregion |
| 6477 |
//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js |
| 6478 |
function asyncGeneratorStep(n, t, e, r, o, a, c) { |
| 6479 |
try { |
| 6480 |
var i = n[a](c); |
| 6481 |
var u = i.value; |
| 6482 |
} catch (n) { |
| 6483 |
e(n); |
| 6484 |
return; |
| 6485 |
} |
| 6486 |
i.done ? t(u) : Promise.resolve(u).then(r, o); |
| 6487 |
} |
| 6488 |
function _asyncToGenerator(n) { |
| 6489 |
return function() { |
| 6490 |
var t = this; |
| 6491 |
var e = arguments; |
| 6492 |
return new Promise(function(r, o) { |
| 6493 |
var a = n.apply(t, e); |
| 6494 |
function _next(n) { |
| 6495 |
asyncGeneratorStep(a, r, o, _next, _throw, "next", n); |
| 6496 |
} |
| 6497 |
function _throw(n) { |
| 6498 |
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); |
| 6499 |
} |
| 6500 |
_next(void 0); |
| 6501 |
}); |
| 6502 |
}; |
| 6503 |
} |
| 6504 |
var init_asyncToGenerator = __esmMin((() => {})); |
| 6505 |
|
| 6506 |
//#endregion |
| 6507 |
//#region node_modules/@babel/runtime/helpers/OverloadYield.js |
| 6508 |
var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6509 |
function _OverloadYield(e, d) { |
| 6510 |
this.v = e, this.k = d; |
| 6511 |
} |
| 6512 |
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6513 |
})); |
| 6514 |
|
| 6515 |
//#endregion |
| 6516 |
//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js |
| 6517 |
var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6518 |
function _regeneratorDefine(e, r, n, t) { |
| 6519 |
var i = Object.defineProperty; |
| 6520 |
try { |
| 6521 |
i({}, "", {}); |
| 6522 |
} catch (e) { |
| 6523 |
i = 0; |
| 6524 |
} |
| 6525 |
module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { |
| 6526 |
function o(r, n) { |
| 6527 |
_regeneratorDefine(e, r, function(e) { |
| 6528 |
return this._invoke(r, n, e); |
| 6529 |
}); |
| 6530 |
} |
| 6531 |
r ? i ? i(e, r, { |
| 6532 |
value: n, |
| 6533 |
enumerable: !t, |
| 6534 |
configurable: !t, |
| 6535 |
writable: !t |
| 6536 |
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); |
| 6537 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); |
| 6538 |
} |
| 6539 |
module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6540 |
})); |
| 6541 |
|
| 6542 |
//#endregion |
| 6543 |
//#region node_modules/@babel/runtime/helpers/regenerator.js |
| 6544 |
var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6545 |
var regeneratorDefine = require_regeneratorDefine(); |
| 6546 |
function _regenerator() { |
| 6547 |
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ |
| 6548 |
var e; |
| 6549 |
var t; |
| 6550 |
var r = "function" == typeof Symbol ? Symbol : {}; |
| 6551 |
var n = r.iterator || "@@iterator"; |
| 6552 |
var o = r.toStringTag || "@@toStringTag"; |
| 6553 |
function i(r, n, o, i) { |
| 6554 |
var c = n && n.prototype instanceof Generator ? n : Generator; |
| 6555 |
var u = Object.create(c.prototype); |
| 6556 |
return regeneratorDefine(u, "_invoke", function(r, n, o) { |
| 6557 |
var i; |
| 6558 |
var c; |
| 6559 |
var u; |
| 6560 |
var f = 0; |
| 6561 |
var p = o || []; |
| 6562 |
var y = !1; |
| 6563 |
var G = { |
| 6564 |
p: 0, |
| 6565 |
n: 0, |
| 6566 |
v: e, |
| 6567 |
a: d, |
| 6568 |
f: d.bind(e, 4), |
| 6569 |
d: function d(t, r) { |
| 6570 |
return i = t, c = 0, u = e, G.n = r, a; |
| 6571 |
} |
| 6572 |
}; |
| 6573 |
function d(r, n) { |
| 6574 |
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { |
| 6575 |
var o; |
| 6576 |
var i = p[t]; |
| 6577 |
var d = G.p; |
| 6578 |
var l = i[2]; |
| 6579 |
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); |
| 6580 |
} |
| 6581 |
if (o || r > 1) return a; |
| 6582 |
throw y = !0, n; |
| 6583 |
} |
| 6584 |
return function(o, p, l) { |
| 6585 |
if (f > 1) throw TypeError("Generator is already running"); |
| 6586 |
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { |
| 6587 |
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); |
| 6588 |
try { |
| 6589 |
if (f = 2, i) { |
| 6590 |
if (c || (o = "next"), t = i[o]) { |
| 6591 |
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); |
| 6592 |
if (!t.done) return t; |
| 6593 |
u = t.value, c < 2 && (c = 0); |
| 6594 |
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); |
| 6595 |
i = e; |
| 6596 |
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; |
| 6597 |
} catch (t) { |
| 6598 |
i = e, c = 1, u = t; |
| 6599 |
} finally { |
| 6600 |
f = 1; |
| 6601 |
} |
| 6602 |
} |
| 6603 |
return { |
| 6604 |
value: t, |
| 6605 |
done: y |
| 6606 |
}; |
| 6607 |
}; |
| 6608 |
}(r, o, i), !0), u; |
| 6609 |
} |
| 6610 |
var a = {}; |
| 6611 |
function Generator() {} |
| 6612 |
function GeneratorFunction() {} |
| 6613 |
function GeneratorFunctionPrototype() {} |
| 6614 |
t = Object.getPrototypeOf; |
| 6615 |
var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() { |
| 6616 |
return this; |
| 6617 |
}), t); |
| 6618 |
var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); |
| 6619 |
function f(e) { |
| 6620 |
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; |
| 6621 |
} |
| 6622 |
return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() { |
| 6623 |
return this; |
| 6624 |
}), regeneratorDefine(u, "toString", function() { |
| 6625 |
return "[object Generator]"; |
| 6626 |
}), (module.exports = _regenerator = function _regenerator() { |
| 6627 |
return { |
| 6628 |
w: i, |
| 6629 |
m: f |
| 6630 |
}; |
| 6631 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports)(); |
| 6632 |
} |
| 6633 |
module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6634 |
})); |
| 6635 |
|
| 6636 |
//#endregion |
| 6637 |
//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js |
| 6638 |
var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6639 |
var OverloadYield = require_OverloadYield(); |
| 6640 |
var regeneratorDefine = require_regeneratorDefine(); |
| 6641 |
function AsyncIterator(t, e) { |
| 6642 |
function n(r, o, i, f) { |
| 6643 |
try { |
| 6644 |
var c = t[r](o); |
| 6645 |
var u = c.value; |
| 6646 |
return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) { |
| 6647 |
n("next", t, i, f); |
| 6648 |
}, function(t) { |
| 6649 |
n("throw", t, i, f); |
| 6650 |
}) : e.resolve(u).then(function(t) { |
| 6651 |
c.value = t, i(c); |
| 6652 |
}, function(t) { |
| 6653 |
return n("throw", t, i, f); |
| 6654 |
}); |
| 6655 |
} catch (t) { |
| 6656 |
f(t); |
| 6657 |
} |
| 6658 |
} |
| 6659 |
var r; |
| 6660 |
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() { |
| 6661 |
return this; |
| 6662 |
})), regeneratorDefine(this, "_invoke", function(t, o, i) { |
| 6663 |
function f() { |
| 6664 |
return new e(function(e, r) { |
| 6665 |
n(t, i, e, r); |
| 6666 |
}); |
| 6667 |
} |
| 6668 |
return r = r ? r.then(f, f) : f(); |
| 6669 |
}, !0); |
| 6670 |
} |
| 6671 |
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6672 |
})); |
| 6673 |
|
| 6674 |
//#endregion |
| 6675 |
//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js |
| 6676 |
var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6677 |
var regenerator = require_regenerator$1(); |
| 6678 |
var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); |
| 6679 |
function _regeneratorAsyncGen(r, e, t, o, n) { |
| 6680 |
return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); |
| 6681 |
} |
| 6682 |
module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6683 |
})); |
| 6684 |
|
| 6685 |
//#endregion |
| 6686 |
//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js |
| 6687 |
var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6688 |
var regeneratorAsyncGen = require_regeneratorAsyncGen(); |
| 6689 |
function _regeneratorAsync(n, e, r, t, o) { |
| 6690 |
var a = regeneratorAsyncGen(n, e, r, t, o); |
| 6691 |
return a.next().then(function(n) { |
| 6692 |
return n.done ? n.value : a.next(); |
| 6693 |
}); |
| 6694 |
} |
| 6695 |
module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6696 |
})); |
| 6697 |
|
| 6698 |
//#endregion |
| 6699 |
//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js |
| 6700 |
var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6701 |
function _regeneratorKeys(e) { |
| 6702 |
var n = Object(e); |
| 6703 |
var r = []; |
| 6704 |
for (var t in n) r.unshift(t); |
| 6705 |
return function e() { |
| 6706 |
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; |
| 6707 |
return e.done = !0, e; |
| 6708 |
}; |
| 6709 |
} |
| 6710 |
module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6711 |
})); |
| 6712 |
|
| 6713 |
//#endregion |
| 6714 |
//#region node_modules/@babel/runtime/helpers/typeof.js |
| 6715 |
var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6716 |
function _typeof(o) { |
| 6717 |
"@babel/helpers - typeof"; |
| 6718 |
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 6719 |
return typeof o; |
| 6720 |
} : function(o) { |
| 6721 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 6722 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); |
| 6723 |
} |
| 6724 |
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6725 |
})); |
| 6726 |
|
| 6727 |
//#endregion |
| 6728 |
//#region node_modules/@babel/runtime/helpers/regeneratorValues.js |
| 6729 |
var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6730 |
var _typeof = require_typeof()["default"]; |
| 6731 |
function _regeneratorValues(e) { |
| 6732 |
if (null != e) { |
| 6733 |
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"]; |
| 6734 |
var r = 0; |
| 6735 |
if (t) return t.call(e); |
| 6736 |
if ("function" == typeof e.next) return e; |
| 6737 |
if (!isNaN(e.length)) return { next: function next() { |
| 6738 |
return e && r >= e.length && (e = void 0), { |
| 6739 |
value: e && e[r++], |
| 6740 |
done: !e |
| 6741 |
}; |
| 6742 |
} }; |
| 6743 |
} |
| 6744 |
throw new TypeError(_typeof(e) + " is not iterable"); |
| 6745 |
} |
| 6746 |
module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6747 |
})); |
| 6748 |
|
| 6749 |
//#endregion |
| 6750 |
//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js |
| 6751 |
var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6752 |
var OverloadYield = require_OverloadYield(); |
| 6753 |
var regenerator = require_regenerator$1(); |
| 6754 |
var regeneratorAsync = require_regeneratorAsync(); |
| 6755 |
var regeneratorAsyncGen = require_regeneratorAsyncGen(); |
| 6756 |
var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); |
| 6757 |
var regeneratorKeys = require_regeneratorKeys(); |
| 6758 |
var regeneratorValues = require_regeneratorValues(); |
| 6759 |
function _regeneratorRuntime() { |
| 6760 |
"use strict"; |
| 6761 |
var r = regenerator(); |
| 6762 |
var e = r.m(_regeneratorRuntime); |
| 6763 |
var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; |
| 6764 |
function n(r) { |
| 6765 |
var e = "function" == typeof r && r.constructor; |
| 6766 |
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); |
| 6767 |
} |
| 6768 |
var o = { |
| 6769 |
"throw": 1, |
| 6770 |
"return": 2, |
| 6771 |
"break": 3, |
| 6772 |
"continue": 3 |
| 6773 |
}; |
| 6774 |
function a(r) { |
| 6775 |
var e; |
| 6776 |
var t; |
| 6777 |
return function(n) { |
| 6778 |
e || (e = { |
| 6779 |
stop: function stop() { |
| 6780 |
return t(n.a, 2); |
| 6781 |
}, |
| 6782 |
"catch": function _catch() { |
| 6783 |
return n.v; |
| 6784 |
}, |
| 6785 |
abrupt: function abrupt(r, e) { |
| 6786 |
return t(n.a, o[r], e); |
| 6787 |
}, |
| 6788 |
delegateYield: function delegateYield(r, o, a) { |
| 6789 |
return e.resultName = o, t(n.d, regeneratorValues(r), a); |
| 6790 |
}, |
| 6791 |
finish: function finish(r) { |
| 6792 |
return t(n.f, r); |
| 6793 |
} |
| 6794 |
}, t = function t(r, _t, o) { |
| 6795 |
n.p = e.prev, n.n = e.next; |
| 6796 |
try { |
| 6797 |
return r(_t, o); |
| 6798 |
} finally { |
| 6799 |
e.next = n.n; |
| 6800 |
} |
| 6801 |
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; |
| 6802 |
try { |
| 6803 |
return r.call(this, e); |
| 6804 |
} finally { |
| 6805 |
n.p = e.prev, n.n = e.next; |
| 6806 |
} |
| 6807 |
}; |
| 6808 |
} |
| 6809 |
return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { |
| 6810 |
return { |
| 6811 |
wrap: function wrap(e, t, n, o) { |
| 6812 |
return r.w(a(e), t, n, o && o.reverse()); |
| 6813 |
}, |
| 6814 |
isGeneratorFunction: n, |
| 6815 |
mark: r.m, |
| 6816 |
awrap: function awrap(r, e) { |
| 6817 |
return new OverloadYield(r, e); |
| 6818 |
}, |
| 6819 |
AsyncIterator: regeneratorAsyncIterator, |
| 6820 |
async: function async(r, e, t, o, u) { |
| 6821 |
return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); |
| 6822 |
}, |
| 6823 |
keys: regeneratorKeys, |
| 6824 |
values: regeneratorValues |
| 6825 |
}; |
| 6826 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports)(); |
| 6827 |
} |
| 6828 |
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 6829 |
})); |
| 6830 |
|
| 6831 |
//#endregion |
| 6832 |
//#region node_modules/@babel/runtime/regenerator/index.js |
| 6833 |
var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 6834 |
var runtime = require_regeneratorRuntime()(); |
| 6835 |
module.exports = runtime; |
| 6836 |
try { |
| 6837 |
regeneratorRuntime = runtime; |
| 6838 |
} catch (accidentalStrictMode) { |
| 6839 |
if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime; |
| 6840 |
else Function("r", "regeneratorRuntime = r")(runtime); |
| 6841 |
} |
| 6842 |
})); |
| 6843 |
|
| 6844 |
//#endregion |
| 6845 |
//#region app/assets/js/hooks/use-ajax.js |
| 6846 |
function ownKeys$29(e, r) { |
| 6847 |
var t = Object.keys(e); |
| 6848 |
if (Object.getOwnPropertySymbols) { |
| 6849 |
var o = Object.getOwnPropertySymbols(e); |
| 6850 |
r && (o = o.filter(function(r) { |
| 6851 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 6852 |
})), t.push.apply(t, o); |
| 6853 |
} |
| 6854 |
return t; |
| 6855 |
} |
| 6856 |
function _objectSpread$28(e) { |
| 6857 |
for (var r = 1; r < arguments.length; r++) { |
| 6858 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 6859 |
r % 2 ? ownKeys$29(Object(t), !0).forEach(function(r) { |
| 6860 |
_defineProperty$1(e, r, t[r]); |
| 6861 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$29(Object(t)).forEach(function(r) { |
| 6862 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 6863 |
}); |
| 6864 |
} |
| 6865 |
return e; |
| 6866 |
} |
| 6867 |
function useAjax() { |
| 6868 |
var _useState2 = _slicedToArray((0, react.useState)(null), 2); |
| 6869 |
var ajax = _useState2[0]; |
| 6870 |
var setAjax = _useState2[1]; |
| 6871 |
var initialStatusKey = "initial"; |
| 6872 |
var _useState4 = _slicedToArray((0, react.useState)({ |
| 6873 |
status: initialStatusKey, |
| 6874 |
isComplete: false, |
| 6875 |
response: null |
| 6876 |
}), 2); |
| 6877 |
var ajaxState = _useState4[0]; |
| 6878 |
var setAjaxState = _useState4[1]; |
| 6879 |
var ajaxActions = { reset: function reset() { |
| 6880 |
return setAjaxState(initialStatusKey); |
| 6881 |
} }; |
| 6882 |
var runRequest = /*#__PURE__*/ function() { |
| 6883 |
var _ref = _asyncToGenerator(/*#__PURE__*/ import_regenerator$4.default.mark(function _callee(config) { |
| 6884 |
return import_regenerator$4.default.wrap(function(_context) { |
| 6885 |
while (1) switch (_context.prev = _context.next) { |
| 6886 |
case 0: return _context.abrupt("return", new Promise(function(resolve, reject) { |
| 6887 |
var formData = new FormData(); |
| 6888 |
if (config.data) { |
| 6889 |
for (var key in config.data) formData.append(key, config.data[key]); |
| 6890 |
if (!config.data.nonce) formData.append("_nonce", elementorCommon.config.ajax.nonce); |
| 6891 |
} |
| 6892 |
var options = _objectSpread$28(_objectSpread$28({ |
| 6893 |
type: "post", |
| 6894 |
url: elementorCommon.config.ajax.url, |
| 6895 |
headers: {}, |
| 6896 |
cache: false, |
| 6897 |
contentType: false, |
| 6898 |
processData: false |
| 6899 |
}, config), {}, { |
| 6900 |
data: formData, |
| 6901 |
success: function success(response) { |
| 6902 |
resolve(response); |
| 6903 |
}, |
| 6904 |
error: function error(_error) { |
| 6905 |
reject(_error); |
| 6906 |
} |
| 6907 |
}); |
| 6908 |
jQuery.ajax(options); |
| 6909 |
})); |
| 6910 |
case 1: |
| 6911 |
case "end": return _context.stop(); |
| 6912 |
} |
| 6913 |
}, _callee); |
| 6914 |
})); |
| 6915 |
return function runRequest(_x) { |
| 6916 |
return _ref.apply(this, arguments); |
| 6917 |
}; |
| 6918 |
}(); |
| 6919 |
(0, react.useEffect)(function() { |
| 6920 |
if (ajax) runRequest(ajax).then(function(response) { |
| 6921 |
var status = response.success ? "success" : "error"; |
| 6922 |
setAjaxState(function(prevState) { |
| 6923 |
return _objectSpread$28(_objectSpread$28({}, prevState), {}, { |
| 6924 |
status, |
| 6925 |
response: response === null || response === void 0 ? void 0 : response.data |
| 6926 |
}); |
| 6927 |
}); |
| 6928 |
}).catch(function(error) { |
| 6929 |
var _error$responseJSON; |
| 6930 |
var response = 408 === error.status ? "timeout" : (_error$responseJSON = error.responseJSON) === null || _error$responseJSON === void 0 ? void 0 : _error$responseJSON.data; |
| 6931 |
setAjaxState(function(prevState) { |
| 6932 |
return _objectSpread$28(_objectSpread$28({}, prevState), {}, { |
| 6933 |
status: "error", |
| 6934 |
response |
| 6935 |
}); |
| 6936 |
}); |
| 6937 |
}).finally(function() { |
| 6938 |
setAjaxState(function(prevState) { |
| 6939 |
return _objectSpread$28(_objectSpread$28({}, prevState), {}, { isComplete: true }); |
| 6940 |
}); |
| 6941 |
}); |
| 6942 |
}, [ajax]); |
| 6943 |
return { |
| 6944 |
ajax, |
| 6945 |
setAjax, |
| 6946 |
ajaxState, |
| 6947 |
ajaxActions, |
| 6948 |
runRequest |
| 6949 |
}; |
| 6950 |
} |
| 6951 |
var import_regenerator$4; |
| 6952 |
var init_use_ajax = __esmMin((() => { |
| 6953 |
init_defineProperty$1(); |
| 6954 |
init_asyncToGenerator(); |
| 6955 |
init_slicedToArray(); |
| 6956 |
import_regenerator$4 = /* @__PURE__ */ __toESM(require_regenerator()); |
| 6957 |
__name(ownKeys$29, "ownKeys"); |
| 6958 |
__name(_objectSpread$28, "_objectSpread"); |
| 6959 |
})); |
| 6960 |
|
| 6961 |
//#endregion |
| 6962 |
//#region app/modules/import-export/assets/js/hooks/use-kit.js |
| 6963 |
function _createForOfIteratorHelper$3(r, e) { |
| 6964 |
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 6965 |
if (!t) { |
| 6966 |
if (Array.isArray(r) || (t = _unsupportedIterableToArray$3(r)) || e && r && "number" == typeof r.length) { |
| 6967 |
t && (r = t); |
| 6968 |
var _n = 0; |
| 6969 |
var F = function F() {}; |
| 6970 |
return { |
| 6971 |
s: F, |
| 6972 |
n: function n() { |
| 6973 |
return _n >= r.length ? { done: !0 } : { |
| 6974 |
done: !1, |
| 6975 |
value: r[_n++] |
| 6976 |
}; |
| 6977 |
}, |
| 6978 |
e: function e(r) { |
| 6979 |
throw r; |
| 6980 |
}, |
| 6981 |
f: F |
| 6982 |
}; |
| 6983 |
} |
| 6984 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 6985 |
} |
| 6986 |
var o; |
| 6987 |
var a = !0; |
| 6988 |
var u = !1; |
| 6989 |
return { |
| 6990 |
s: function s() { |
| 6991 |
t = t.call(r); |
| 6992 |
}, |
| 6993 |
n: function n() { |
| 6994 |
var r = t.next(); |
| 6995 |
return a = r.done, r; |
| 6996 |
}, |
| 6997 |
e: function e(r) { |
| 6998 |
u = !0, o = r; |
| 6999 |
}, |
| 7000 |
f: function f() { |
| 7001 |
try { |
| 7002 |
a || null == t.return || t.return(); |
| 7003 |
} finally { |
| 7004 |
if (u) throw o; |
| 7005 |
} |
| 7006 |
} |
| 7007 |
}; |
| 7008 |
} |
| 7009 |
function _unsupportedIterableToArray$3(r, a) { |
| 7010 |
if (r) { |
| 7011 |
if ("string" == typeof r) return _arrayLikeToArray$3(r, a); |
| 7012 |
var t = {}.toString.call(r).slice(8, -1); |
| 7013 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$3(r, a) : void 0; |
| 7014 |
} |
| 7015 |
} |
| 7016 |
function _arrayLikeToArray$3(r, a) { |
| 7017 |
(null == a || a > r.length) && (a = r.length); |
| 7018 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 7019 |
return n; |
| 7020 |
} |
| 7021 |
function ownKeys$28(e, r) { |
| 7022 |
var t = Object.keys(e); |
| 7023 |
if (Object.getOwnPropertySymbols) { |
| 7024 |
var o = Object.getOwnPropertySymbols(e); |
| 7025 |
r && (o = o.filter(function(r) { |
| 7026 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 7027 |
})), t.push.apply(t, o); |
| 7028 |
} |
| 7029 |
return t; |
| 7030 |
} |
| 7031 |
function _objectSpread$27(e) { |
| 7032 |
for (var r = 1; r < arguments.length; r++) { |
| 7033 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 7034 |
r % 2 ? ownKeys$28(Object(t), !0).forEach(function(r) { |
| 7035 |
_defineProperty$1(e, r, t[r]); |
| 7036 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$28(Object(t)).forEach(function(r) { |
| 7037 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 7038 |
}); |
| 7039 |
} |
| 7040 |
return e; |
| 7041 |
} |
| 7042 |
function useKit$1() { |
| 7043 |
var _useAjax = useAjax(); |
| 7044 |
var ajaxState = _useAjax.ajaxState; |
| 7045 |
var setAjax = _useAjax.setAjax; |
| 7046 |
var ajaxActions = _useAjax.ajaxActions; |
| 7047 |
var runRequest = _useAjax.runRequest; |
| 7048 |
var _useState2 = _slicedToArray((0, react.useState)({ |
| 7049 |
status: KIT_STATUS_MAP.INITIAL, |
| 7050 |
data: null |
| 7051 |
}), 2); |
| 7052 |
var kitState = _useState2[0]; |
| 7053 |
var setKitState = _useState2[1]; |
| 7054 |
var uploadKit = function uploadKit(_ref) { |
| 7055 |
var kitId = _ref.kitId; |
| 7056 |
var file = _ref.file; |
| 7057 |
var kitLibraryNonce = _ref.kitLibraryNonce; |
| 7058 |
var _ref$source = _ref.source; |
| 7059 |
setAjax({ data: _objectSpread$27(_objectSpread$27({ |
| 7060 |
action: UPLOAD_KIT_KEY, |
| 7061 |
source: _ref$source === void 0 ? "" : _ref$source |
| 7062 |
}, file ? { e_import_file: file } : null), {}, { kit_id: kitId }, kitLibraryNonce ? { e_kit_library_nonce: kitLibraryNonce } : {}) }); |
| 7063 |
}; |
| 7064 |
var initImportProcess = /*#__PURE__*/ function() { |
| 7065 |
var _ref3 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$3.default.mark(function _callee(_ref2) { |
| 7066 |
var id; |
| 7067 |
var session; |
| 7068 |
var include; |
| 7069 |
var overrideConditions; |
| 7070 |
var referrer; |
| 7071 |
var selectedCustomPostTypes; |
| 7072 |
var ajaxConfig; |
| 7073 |
return import_regenerator$3.default.wrap(function(_context) { |
| 7074 |
while (1) switch (_context.prev = _context.next) { |
| 7075 |
case 0: |
| 7076 |
id = _ref2.id, session = _ref2.session, include = _ref2.include, overrideConditions = _ref2.overrideConditions, referrer = _ref2.referrer, selectedCustomPostTypes = _ref2.selectedCustomPostTypes; |
| 7077 |
ajaxConfig = { data: { |
| 7078 |
action: IMPORT_KIT_KEY, |
| 7079 |
data: { |
| 7080 |
id, |
| 7081 |
session, |
| 7082 |
include, |
| 7083 |
overrideConditions |
| 7084 |
} |
| 7085 |
} }; |
| 7086 |
if (referrer) ajaxConfig.data.data.referrer = referrer; |
| 7087 |
if (selectedCustomPostTypes) ajaxConfig.data.data.selectedCustomPostTypes = selectedCustomPostTypes; |
| 7088 |
ajaxConfig.data.data = JSON.stringify(ajaxConfig.data.data); |
| 7089 |
return _context.abrupt("return", runRequest(ajaxConfig).catch(function(error) { |
| 7090 |
var _error$responseJSON; |
| 7091 |
var response = 408 === error.status ? "timeout" : (_error$responseJSON = error.responseJSON) === null || _error$responseJSON === void 0 ? void 0 : _error$responseJSON.data; |
| 7092 |
setKitState(function(prevState) { |
| 7093 |
return _objectSpread$27(_objectSpread$27({}, prevState), {}, { |
| 7094 |
status: KIT_STATUS_MAP.ERROR, |
| 7095 |
data: response || {} |
| 7096 |
}); |
| 7097 |
}); |
| 7098 |
})); |
| 7099 |
case 1: |
| 7100 |
case "end": return _context.stop(); |
| 7101 |
} |
| 7102 |
}, _callee); |
| 7103 |
})); |
| 7104 |
return function initImportProcess(_x) { |
| 7105 |
return _ref3.apply(this, arguments); |
| 7106 |
}; |
| 7107 |
}(); |
| 7108 |
var runImportRunners = /*#__PURE__*/ function() { |
| 7109 |
var _ref4 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$3.default.mark(function _callee2(session, runners) { |
| 7110 |
var stopIterations; |
| 7111 |
var _iterator; |
| 7112 |
var _step; |
| 7113 |
var _step$value; |
| 7114 |
var iteration; |
| 7115 |
var runner; |
| 7116 |
var ajaxConfig; |
| 7117 |
var isLastIteration; |
| 7118 |
var _t; |
| 7119 |
return import_regenerator$3.default.wrap(function(_context2) { |
| 7120 |
while (1) switch (_context2.prev = _context2.next) { |
| 7121 |
case 0: |
| 7122 |
stopIterations = false; |
| 7123 |
_iterator = _createForOfIteratorHelper$3(runners.entries()); |
| 7124 |
_context2.prev = 1; |
| 7125 |
_iterator.s(); |
| 7126 |
case 2: |
| 7127 |
if ((_step = _iterator.n()).done) { |
| 7128 |
_context2.next = 7; |
| 7129 |
break; |
| 7130 |
} |
| 7131 |
_step$value = _slicedToArray(_step.value, 2), iteration = _step$value[0], runner = _step$value[1]; |
| 7132 |
if (!stopIterations) { |
| 7133 |
_context2.next = 3; |
| 7134 |
break; |
| 7135 |
} |
| 7136 |
return _context2.abrupt("continue", 7); |
| 7137 |
case 3: |
| 7138 |
ajaxConfig = { data: { |
| 7139 |
action: RUN_RUNNER_KEY, |
| 7140 |
data: { |
| 7141 |
session, |
| 7142 |
runner |
| 7143 |
} |
| 7144 |
} }; |
| 7145 |
ajaxConfig.data.data = JSON.stringify(ajaxConfig.data.data); |
| 7146 |
isLastIteration = iteration === runners.length - 1; |
| 7147 |
if (isLastIteration) { |
| 7148 |
_context2.next = 5; |
| 7149 |
break; |
| 7150 |
} |
| 7151 |
_context2.next = 4; |
| 7152 |
return runRequest(ajaxConfig).catch(function(error) { |
| 7153 |
var _error$responseJSON2; |
| 7154 |
stopIterations = true; |
| 7155 |
var response = 408 === error.status ? "timeout" : (_error$responseJSON2 = error.responseJSON) === null || _error$responseJSON2 === void 0 ? void 0 : _error$responseJSON2.data; |
| 7156 |
setKitState(function(prevState) { |
| 7157 |
return _objectSpread$27(_objectSpread$27({}, prevState), { |
| 7158 |
status: KIT_STATUS_MAP.ERROR, |
| 7159 |
data: response || {} |
| 7160 |
}); |
| 7161 |
}); |
| 7162 |
}); |
| 7163 |
case 4: |
| 7164 |
_context2.next = 6; |
| 7165 |
break; |
| 7166 |
case 5: setAjax(ajaxConfig); |
| 7167 |
case 6: |
| 7168 |
_context2.next = 2; |
| 7169 |
break; |
| 7170 |
case 7: |
| 7171 |
_context2.next = 9; |
| 7172 |
break; |
| 7173 |
case 8: |
| 7174 |
_context2.prev = 8; |
| 7175 |
_t = _context2["catch"](1); |
| 7176 |
_iterator.e(_t); |
| 7177 |
case 9: |
| 7178 |
_context2.prev = 9; |
| 7179 |
_iterator.f(); |
| 7180 |
return _context2.finish(9); |
| 7181 |
case 10: |
| 7182 |
case "end": return _context2.stop(); |
| 7183 |
} |
| 7184 |
}, _callee2, null, [[ |
| 7185 |
1, |
| 7186 |
8, |
| 7187 |
9, |
| 7188 |
10 |
| 7189 |
]]); |
| 7190 |
})); |
| 7191 |
return function runImportRunners(_x2, _x3) { |
| 7192 |
return _ref4.apply(this, arguments); |
| 7193 |
}; |
| 7194 |
}(); |
| 7195 |
var importKit = /*#__PURE__*/ function() { |
| 7196 |
var _ref6 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$3.default.mark(function _callee3(_ref5) { |
| 7197 |
var id; |
| 7198 |
var session; |
| 7199 |
var include; |
| 7200 |
var overrideConditions; |
| 7201 |
var referrer; |
| 7202 |
var selectedCustomPostTypes; |
| 7203 |
var importSession; |
| 7204 |
return import_regenerator$3.default.wrap(function(_context3) { |
| 7205 |
while (1) switch (_context3.prev = _context3.next) { |
| 7206 |
case 0: |
| 7207 |
id = _ref5.id, session = _ref5.session, include = _ref5.include, overrideConditions = _ref5.overrideConditions, referrer = _ref5.referrer, selectedCustomPostTypes = _ref5.selectedCustomPostTypes; |
| 7208 |
ajaxActions.reset(); |
| 7209 |
_context3.next = 1; |
| 7210 |
return initImportProcess({ |
| 7211 |
id, |
| 7212 |
session, |
| 7213 |
include, |
| 7214 |
overrideConditions, |
| 7215 |
referrer, |
| 7216 |
selectedCustomPostTypes |
| 7217 |
}); |
| 7218 |
case 1: |
| 7219 |
importSession = _context3.sent; |
| 7220 |
if (importSession) { |
| 7221 |
_context3.next = 2; |
| 7222 |
break; |
| 7223 |
} |
| 7224 |
return _context3.abrupt("return"); |
| 7225 |
case 2: |
| 7226 |
_context3.next = 3; |
| 7227 |
return runImportRunners(importSession.data.session, importSession.data.runners); |
| 7228 |
case 3: |
| 7229 |
case "end": return _context3.stop(); |
| 7230 |
} |
| 7231 |
}, _callee3); |
| 7232 |
})); |
| 7233 |
return function importKit(_x4) { |
| 7234 |
return _ref6.apply(this, arguments); |
| 7235 |
}; |
| 7236 |
}(); |
| 7237 |
var exportKit = function exportKit(_ref7) { |
| 7238 |
var include = _ref7.include; |
| 7239 |
var kitInfo = _ref7.kitInfo; |
| 7240 |
var plugins = _ref7.plugins; |
| 7241 |
var selectedCustomPostTypes = _ref7.selectedCustomPostTypes; |
| 7242 |
var screenShotBlob = _ref7.screenShotBlob; |
| 7243 |
setAjax({ data: { |
| 7244 |
action: EXPORT_KIT_KEY, |
| 7245 |
data: JSON.stringify({ |
| 7246 |
include, |
| 7247 |
kitInfo, |
| 7248 |
plugins, |
| 7249 |
selectedCustomPostTypes, |
| 7250 |
screenShotBlob |
| 7251 |
}) |
| 7252 |
} }); |
| 7253 |
}; |
| 7254 |
var reset = function reset() { |
| 7255 |
return ajaxActions.reset(); |
| 7256 |
}; |
| 7257 |
(0, react.useEffect)(function() { |
| 7258 |
if ("initial" !== ajaxState.status) { |
| 7259 |
var newState = {}; |
| 7260 |
if ("success" === ajaxState.status) { |
| 7261 |
var _ajaxState$response; |
| 7262 |
var _ajaxState$response2; |
| 7263 |
if ((_ajaxState$response = ajaxState.response) !== null && _ajaxState$response !== void 0 && _ajaxState$response.file || (_ajaxState$response2 = ajaxState.response) !== null && _ajaxState$response2 !== void 0 && _ajaxState$response2.kit) newState.status = KIT_STATUS_MAP.EXPORTED; |
| 7264 |
else { |
| 7265 |
var _ajaxState$response3; |
| 7266 |
newState.status = (_ajaxState$response3 = ajaxState.response) !== null && _ajaxState$response3 !== void 0 && _ajaxState$response3.manifest ? KIT_STATUS_MAP.UPLOADED : KIT_STATUS_MAP.IMPORTED; |
| 7267 |
} |
| 7268 |
} else if ("error" === ajaxState.status) newState.status = KIT_STATUS_MAP.ERROR; |
| 7269 |
newState.data = ajaxState.response || {}; |
| 7270 |
setKitState(function(prevState) { |
| 7271 |
return _objectSpread$27(_objectSpread$27({}, prevState), newState); |
| 7272 |
}); |
| 7273 |
} |
| 7274 |
}, [ajaxState.status]); |
| 7275 |
return { |
| 7276 |
kitState, |
| 7277 |
KIT_STATUS_MAP, |
| 7278 |
kitActions: { |
| 7279 |
upload: uploadKit, |
| 7280 |
import: importKit, |
| 7281 |
export: exportKit, |
| 7282 |
reset |
| 7283 |
} |
| 7284 |
}; |
| 7285 |
} |
| 7286 |
var import_regenerator$3, KIT_SOURCE_MAP, KIT_STATUS_MAP, UPLOAD_KIT_KEY, IMPORT_KIT_KEY, EXPORT_KIT_KEY, RUN_RUNNER_KEY; |
| 7287 |
var init_use_kit$1 = __esmMin((() => { |
| 7288 |
init_asyncToGenerator(); |
| 7289 |
init_defineProperty$1(); |
| 7290 |
init_slicedToArray(); |
| 7291 |
import_regenerator$3 = /* @__PURE__ */ __toESM(require_regenerator()); |
| 7292 |
init_use_ajax(); |
| 7293 |
__name(_createForOfIteratorHelper$3, "_createForOfIteratorHelper"); |
| 7294 |
__name(_unsupportedIterableToArray$3, "_unsupportedIterableToArray"); |
| 7295 |
__name(_arrayLikeToArray$3, "_arrayLikeToArray"); |
| 7296 |
__name(ownKeys$28, "ownKeys"); |
| 7297 |
__name(_objectSpread$27, "_objectSpread"); |
| 7298 |
KIT_SOURCE_MAP = { |
| 7299 |
CLOUD: "cloud", |
| 7300 |
FILE: "file" |
| 7301 |
}; |
| 7302 |
KIT_STATUS_MAP = Object.freeze({ |
| 7303 |
INITIAL: "initial", |
| 7304 |
UPLOADED: "uploaded", |
| 7305 |
IMPORTED: "imported", |
| 7306 |
EXPORTED: "exported", |
| 7307 |
ERROR: "error" |
| 7308 |
}); |
| 7309 |
UPLOAD_KIT_KEY = "elementor_upload_kit"; |
| 7310 |
IMPORT_KIT_KEY = "elementor_import_kit"; |
| 7311 |
EXPORT_KIT_KEY = "elementor_export_kit"; |
| 7312 |
RUN_RUNNER_KEY = "elementor_import_kit__runner"; |
| 7313 |
__name(useKit$1, "useKit"); |
| 7314 |
})); |
| 7315 |
|
| 7316 |
//#endregion |
| 7317 |
//#region app/modules/import-export/assets/js/shared/process-failed-dialog/process-failed-dialog.js |
| 7318 |
init_es$1(); |
| 7319 |
init_use_query_params(); |
| 7320 |
init_use_action(); |
| 7321 |
init_use_kit$1(); |
| 7322 |
init_redirect(); |
| 7323 |
var messagesContent$1 = { |
| 7324 |
general: { |
| 7325 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 7326 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("We couldn’t download the Website Template due to technical difficulties on our part. Try again and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(InlineLink, { url: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 7327 |
}, |
| 7328 |
"zip-archive-module-missing": { |
| 7329 |
title: (0, _wordpress_i18n.__)("Couldn’t handle the Website Template", "elementor"), |
| 7330 |
text: (0, _wordpress_i18n.__)("Seems like your server is missing the PHP zip module. Install it on your server or contact your site host for further instructions.", "elementor") |
| 7331 |
}, |
| 7332 |
"invalid-zip-file": { |
| 7333 |
title: (0, _wordpress_i18n.__)("Couldn’t use the .zip file", "elementor"), |
| 7334 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Seems like there is a problem with the zip’s files. Try installing again and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(InlineLink, { url: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 7335 |
}, |
| 7336 |
timeout: { |
| 7337 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 7338 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("It took too much time to download your Website Template and we were unable to complete the process. If all the Website Template’s parts don’t appear in ", "elementor"), /*#__PURE__*/ react.default.createElement(InlineLink, { url: elementorAppConfig.pages_url }, (0, _wordpress_i18n.__)("Pages", "elementor")), (0, _wordpress_i18n.__)(", try again and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(InlineLink, { url: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 7339 |
}, |
| 7340 |
"invalid-kit-library-zip-error": { |
| 7341 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 7342 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("We couldn’t download the Website Template due to technical difficulty on our part. Try again in a few minutes and if the problem persists contact", "elementor"), /*#__PURE__*/ react.default.createElement(InlineLink, { url: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 7343 |
}, |
| 7344 |
"no-write-permissions": { |
| 7345 |
title: (0, _wordpress_i18n.__)("Couldn’t access the file", "elementor"), |
| 7346 |
text: (0, _wordpress_i18n.__)("Seems like Elementor isn’t authorized to access relevant files for installing this Website Template. Contact your site host to get permission.", "elementor") |
| 7347 |
}, |
| 7348 |
"plugin-installation-permissions-error": { |
| 7349 |
title: (0, _wordpress_i18n.__)("Couldn’t install the Website Template", "elementor"), |
| 7350 |
text: (0, _wordpress_i18n.__)("The Website Template includes plugins you don’t have permission to install. Contact your site admin to change your permissions.", "elementor") |
| 7351 |
}, |
| 7352 |
"third-party-error": { |
| 7353 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 7354 |
text: (0, _wordpress_i18n.__)("This is due to a conflict with one or more third-party plugins already active on your site. Try disabling them, and then give the download another go.", "elementor") |
| 7355 |
}, |
| 7356 |
"domdocument-missing": { |
| 7357 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 7358 |
text: (0, _wordpress_i18n.__)("This download requires the 'DOMDocument' PHP extension, which we couldn’t detect on your server. Enable this extension, or get in touch with your hosting service for support, and then give the download another go.", "elementor") |
| 7359 |
}, |
| 7360 |
"insufficient-quota": { |
| 7361 |
title: (0, _wordpress_i18n.__)("Couldn’t Export the Website Template", "elementor"), |
| 7362 |
text: (0, _wordpress_i18n.__)("The export failed because it will pass the maximum Website Templates you can export.", "elementor") |
| 7363 |
}, |
| 7364 |
"failed-to-fetch-quota": { |
| 7365 |
title: (0, _wordpress_i18n.__)("Couldn’t fetch quota", "elementor"), |
| 7366 |
text: (0, _wordpress_i18n.__)("Failed to fetch quota.", "elementor") |
| 7367 |
}, |
| 7368 |
"insufficient-storage-quota": { |
| 7369 |
title: (0, _wordpress_i18n.__)("Couldn’t Export the Website Template", "elementor"), |
| 7370 |
text: (0, _wordpress_i18n.__)("The export failed because it will pass the maximum Website Templates storage you have available.", "elementor") |
| 7371 |
} |
| 7372 |
}; |
| 7373 |
function ProcessFailedDialog(_ref) { |
| 7374 |
var errorType = _ref.errorType; |
| 7375 |
var onApprove = _ref.onApprove; |
| 7376 |
var onDismiss = _ref.onDismiss; |
| 7377 |
var approveButton = _ref.approveButton; |
| 7378 |
var dismissButton = _ref.dismissButton; |
| 7379 |
var onModalClose = _ref.onModalClose; |
| 7380 |
var onError = _ref.onError; |
| 7381 |
var onLearnMore = _ref.onLearnMore; |
| 7382 |
var action = useAction(); |
| 7383 |
var returnTo = ((0, react.useContext)(SharedContext).data || {}).returnTo; |
| 7384 |
var navigate = useNavigate(); |
| 7385 |
var _useQueryParams$getAl = useQueryParams().getAll(); |
| 7386 |
var referrer = _useQueryParams$getAl.referrer; |
| 7387 |
var source = _useQueryParams$getAl.source; |
| 7388 |
var error = "string" === typeof errorType && messagesContent$1[errorType] ? errorType : "general"; |
| 7389 |
var _messagesContent$erro = messagesContent$1[error]; |
| 7390 |
var title = _messagesContent$erro.title; |
| 7391 |
var text = _messagesContent$erro.text; |
| 7392 |
var tryAgainText = (0, _wordpress_i18n.__)("Try Again", "elementor"); |
| 7393 |
var isTryAgainAction = "general" === error && onApprove; |
| 7394 |
var handleOnApprove = function handleOnApprove() { |
| 7395 |
if (isTryAgainAction) onApprove(); |
| 7396 |
else window.open("https://go.elementor.com/app-import-download-failed", "_blank"); |
| 7397 |
onLearnMore === null || onLearnMore === void 0 || onLearnMore(); |
| 7398 |
}; |
| 7399 |
var handleOnDismiss = function handleOnDismiss(event) { |
| 7400 |
var isLoadingKitFromCloud = KIT_SOURCE_MAP.CLOUD === source; |
| 7401 |
if (returnTo && safeRedirect$1(returnTo)) return; |
| 7402 |
if ("general" === error && onDismiss) onDismiss(); |
| 7403 |
else if ("kit-library" === referrer) { |
| 7404 |
onModalClose === null || onModalClose === void 0 || onModalClose(event); |
| 7405 |
navigate("/kit-library".concat(isLoadingKitFromCloud ? "/cloud" : "")); |
| 7406 |
} else action.backToDashboard(); |
| 7407 |
}; |
| 7408 |
(0, react.useEffect)(function() { |
| 7409 |
onError === null || onError === void 0 || onError(); |
| 7410 |
}, []); |
| 7411 |
return /*#__PURE__*/ react.default.createElement(Dialog$9, { |
| 7412 |
title, |
| 7413 |
text, |
| 7414 |
approveButtonColor: "link", |
| 7415 |
approveButtonText: isTryAgainAction ? tryAgainText : approveButton, |
| 7416 |
approveButtonOnClick: handleOnApprove, |
| 7417 |
dismissButtonText: dismissButton, |
| 7418 |
dismissButtonOnClick: function dismissButtonOnClick(event) { |
| 7419 |
return handleOnDismiss(event); |
| 7420 |
}, |
| 7421 |
onClose: handleOnDismiss |
| 7422 |
}); |
| 7423 |
} |
| 7424 |
ProcessFailedDialog.propTypes = { |
| 7425 |
onApprove: import_prop_types$55.default.func, |
| 7426 |
onDismiss: import_prop_types$55.default.func, |
| 7427 |
errorType: import_prop_types$55.default.string, |
| 7428 |
approveButton: import_prop_types$55.default.string, |
| 7429 |
dismissButton: import_prop_types$55.default.string, |
| 7430 |
onModalClose: import_prop_types$55.default.func, |
| 7431 |
onError: import_prop_types$55.default.func, |
| 7432 |
onLearnMore: import_prop_types$55.default.func |
| 7433 |
}; |
| 7434 |
ProcessFailedDialog.defaultProps = { |
| 7435 |
errorType: "general", |
| 7436 |
approveButton: (0, _wordpress_i18n.__)("Learn More", "elementor"), |
| 7437 |
dismissButton: (0, _wordpress_i18n.__)("Close", "elementor") |
| 7438 |
}; |
| 7439 |
|
| 7440 |
//#endregion |
| 7441 |
//#region app/assets/js/ui/molecules/notice.js |
| 7442 |
init_utils$4(); |
| 7443 |
init_icon(); |
| 7444 |
var iconsClassesMap = { |
| 7445 |
danger: "eicon-warning", |
| 7446 |
info: "eicon-info-circle-o", |
| 7447 |
warning: "eicon-warning" |
| 7448 |
}; |
| 7449 |
function Notice(props) { |
| 7450 |
var baseClassName = "eps-notice"; |
| 7451 |
var classes = [baseClassName, props.className]; |
| 7452 |
if (props.color) classes.push(baseClassName + "-semantic", baseClassName + "--" + props.color); |
| 7453 |
return /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 7454 |
className: arrayToClassName(classes), |
| 7455 |
container: true, |
| 7456 |
noWrap: true, |
| 7457 |
alignItems: "center", |
| 7458 |
justify: "space-between" |
| 7459 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 7460 |
item: true, |
| 7461 |
container: true, |
| 7462 |
alignItems: "start", |
| 7463 |
noWrap: true |
| 7464 |
}, props.withIcon && props.color && /*#__PURE__*/ react.default.createElement(Icon$2, { className: arrayToClassName(["eps-notice__icon", iconsClassesMap[props.color]]) }), /*#__PURE__*/ react.default.createElement(Text$11, { |
| 7465 |
variant: "xs", |
| 7466 |
className: "eps-notice__text" |
| 7467 |
}, props.label && /*#__PURE__*/ react.default.createElement("strong", null, props.label + " "), props.children)), props.button && /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 7468 |
item: true, |
| 7469 |
container: true, |
| 7470 |
justify: "end", |
| 7471 |
className: baseClassName + "__button-container" |
| 7472 |
}, props.button)); |
| 7473 |
} |
| 7474 |
Notice.propTypes = { |
| 7475 |
className: import_prop_types$55.default.string, |
| 7476 |
color: import_prop_types$55.default.string, |
| 7477 |
label: import_prop_types$55.default.string, |
| 7478 |
children: import_prop_types$55.default.any.isRequired, |
| 7479 |
icon: import_prop_types$55.default.string, |
| 7480 |
withIcon: import_prop_types$55.default.bool, |
| 7481 |
button: import_prop_types$55.default.object |
| 7482 |
}; |
| 7483 |
Notice.defaultProps = { |
| 7484 |
className: "", |
| 7485 |
withIcon: true, |
| 7486 |
button: null |
| 7487 |
}; |
| 7488 |
|
| 7489 |
//#endregion |
| 7490 |
//#region app/assets/js/molecules/upload-file.js |
| 7491 |
init_button(); |
| 7492 |
init_utils$4(); |
| 7493 |
function UploadFile(props) { |
| 7494 |
var fileInput = (0, react.useRef)(null); |
| 7495 |
var classes = ["e-app-upload-file", props.className]; |
| 7496 |
var frame; |
| 7497 |
return /*#__PURE__*/ react.default.createElement("div", { className: arrayToClassName(classes) }, /*#__PURE__*/ react.default.createElement("input", { |
| 7498 |
ref: fileInput, |
| 7499 |
type: "file", |
| 7500 |
accept: props.filetypes.map(function(type) { |
| 7501 |
return "." + type; |
| 7502 |
}).join(", "), |
| 7503 |
className: "e-app-upload-file__input", |
| 7504 |
onChange: function onChange(event) { |
| 7505 |
var file = event.target.files[0]; |
| 7506 |
if (file && isOneOf(file.type, props.filetypes)) props.onFileSelect(file, event, "browse"); |
| 7507 |
else { |
| 7508 |
fileInput.current.value = ""; |
| 7509 |
props.onError({ |
| 7510 |
id: "file_not_allowed", |
| 7511 |
message: (0, _wordpress_i18n.__)("This file type is not allowed", "elementor") |
| 7512 |
}); |
| 7513 |
} |
| 7514 |
} |
| 7515 |
}), /*#__PURE__*/ react.default.createElement(Button$29, { |
| 7516 |
className: "e-app-upload-file__button", |
| 7517 |
text: props.text, |
| 7518 |
variant: props.variant, |
| 7519 |
color: props.color, |
| 7520 |
size: "lg", |
| 7521 |
hideText: props.isLoading, |
| 7522 |
icon: props.isLoading ? "eicon-loading eicon-animation-spin" : "", |
| 7523 |
onClick: function onClick() { |
| 7524 |
if (props.onFileChoose) props.onFileChoose(); |
| 7525 |
if (!props.isLoading) { |
| 7526 |
if (props.onButtonClick) props.onButtonClick(); |
| 7527 |
if ("file-explorer" === props.type) fileInput.current.click(); |
| 7528 |
else if ("wp-media" === props.type) { |
| 7529 |
if (frame) { |
| 7530 |
frame.open(); |
| 7531 |
return; |
| 7532 |
} |
| 7533 |
frame = wp.media({ |
| 7534 |
multiple: false, |
| 7535 |
library: { type: ["image", "image/svg+xml"] } |
| 7536 |
}); |
| 7537 |
frame.on("select", function() { |
| 7538 |
if (props.onWpMediaSelect) props.onWpMediaSelect(frame); |
| 7539 |
}); |
| 7540 |
frame.open(); |
| 7541 |
} |
| 7542 |
} |
| 7543 |
} |
| 7544 |
})); |
| 7545 |
} |
| 7546 |
UploadFile.propTypes = { |
| 7547 |
className: import_prop_types$55.default.string, |
| 7548 |
type: import_prop_types$55.default.string, |
| 7549 |
onWpMediaSelect: import_prop_types$55.default.func, |
| 7550 |
text: import_prop_types$55.default.string, |
| 7551 |
onFileSelect: import_prop_types$55.default.func, |
| 7552 |
isLoading: import_prop_types$55.default.bool, |
| 7553 |
filetypes: import_prop_types$55.default.array.isRequired, |
| 7554 |
onError: import_prop_types$55.default.func, |
| 7555 |
variant: import_prop_types$55.default.string, |
| 7556 |
color: import_prop_types$55.default.string, |
| 7557 |
onButtonClick: import_prop_types$55.default.func, |
| 7558 |
onFileChoose: import_prop_types$55.default.func |
| 7559 |
}; |
| 7560 |
UploadFile.defaultProps = { |
| 7561 |
className: "", |
| 7562 |
type: "file-explorer", |
| 7563 |
text: (0, _wordpress_i18n.__)("Select File", "elementor"), |
| 7564 |
onError: function onError() {}, |
| 7565 |
variant: "contained", |
| 7566 |
color: "primary" |
| 7567 |
}; |
| 7568 |
|
| 7569 |
//#endregion |
| 7570 |
//#region app/assets/js/ui/atoms/drag-drop.js |
| 7571 |
init_extends(); |
| 7572 |
init_slicedToArray(); |
| 7573 |
init_utils$4(); |
| 7574 |
function DragDrop(props) { |
| 7575 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 7576 |
var isDragOver = _useState2[0]; |
| 7577 |
var setIsDragOver = _useState2[1]; |
| 7578 |
var getClassName = function getClassName() { |
| 7579 |
var baseClassName = "e-app-drag-drop"; |
| 7580 |
var classes = [baseClassName, props.className]; |
| 7581 |
if (isDragOver && !props.isLoading) classes.push(baseClassName + "--drag-over"); |
| 7582 |
return arrayToClassName(classes); |
| 7583 |
}; |
| 7584 |
var onDragDropActions = function onDragDropActions(event) { |
| 7585 |
event.preventDefault(); |
| 7586 |
event.stopPropagation(); |
| 7587 |
}; |
| 7588 |
return /*#__PURE__*/ react.default.createElement("div", _extends({}, { |
| 7589 |
onDrop: function onDrop(event) { |
| 7590 |
onDragDropActions(event); |
| 7591 |
setIsDragOver(false); |
| 7592 |
if (props.onDrop) props.onDrop(event); |
| 7593 |
}, |
| 7594 |
onDragOver: function onDragOver(event) { |
| 7595 |
onDragDropActions(event); |
| 7596 |
setIsDragOver(true); |
| 7597 |
if (props.onDragOver) props.onDragOver(event); |
| 7598 |
}, |
| 7599 |
onDragLeave: function onDragLeave(event) { |
| 7600 |
onDragDropActions(event); |
| 7601 |
setIsDragOver(false); |
| 7602 |
if (props.onDragLeave) props.onDragLeave(event); |
| 7603 |
} |
| 7604 |
}, { className: getClassName() }), props.children); |
| 7605 |
} |
| 7606 |
DragDrop.propTypes = { |
| 7607 |
className: import_prop_types$55.default.string, |
| 7608 |
children: import_prop_types$55.default.any, |
| 7609 |
onDrop: import_prop_types$55.default.func, |
| 7610 |
onDragLeave: import_prop_types$55.default.func, |
| 7611 |
onDragOver: import_prop_types$55.default.func, |
| 7612 |
isLoading: import_prop_types$55.default.bool |
| 7613 |
}; |
| 7614 |
DragDrop.defaultProps = { className: "" }; |
| 7615 |
|
| 7616 |
//#endregion |
| 7617 |
//#region app/assets/js/organisms/drop-zone.js |
| 7618 |
init_extends(); |
| 7619 |
init_utils$4(); |
| 7620 |
init_icon(); |
| 7621 |
function DropZone$1(props) { |
| 7622 |
var classes = ["e-app-drop-zone", props.className]; |
| 7623 |
return /*#__PURE__*/ react.default.createElement("section", { className: arrayToClassName(classes) }, /*#__PURE__*/ react.default.createElement(DragDrop, _extends({}, { onDrop: function onDrop(event) { |
| 7624 |
if (!props.isLoading) { |
| 7625 |
var file = event.dataTransfer.files[0]; |
| 7626 |
if (file && isOneOf(file.type, props.filetypes)) props.onFileSelect(file, event, "drop"); |
| 7627 |
else props.onError({ |
| 7628 |
id: "file_not_allowed", |
| 7629 |
message: (0, _wordpress_i18n.__)("This file type is not allowed", "elementor") |
| 7630 |
}); |
| 7631 |
} |
| 7632 |
} }, { isLoading: props.isLoading }), props.icon && /*#__PURE__*/ react.default.createElement(Icon$2, { className: "e-app-drop-zone__icon ".concat(props.icon) }), props.heading && /*#__PURE__*/ react.default.createElement(Heading$11, { variant: "display-3" }, props.heading), props.text && /*#__PURE__*/ react.default.createElement(Text$11, { |
| 7633 |
variant: "xl", |
| 7634 |
className: "e-app-drop-zone__text" |
| 7635 |
}, props.text), props.secondaryText && /*#__PURE__*/ react.default.createElement(Text$11, { |
| 7636 |
variant: "xl", |
| 7637 |
className: "e-app-drop-zone__secondary-text" |
| 7638 |
}, props.secondaryText), props.showButton && /*#__PURE__*/ react.default.createElement(UploadFile, { |
| 7639 |
isLoading: props.isLoading, |
| 7640 |
type: props.type, |
| 7641 |
onButtonClick: props.onButtonClick, |
| 7642 |
onFileSelect: props.onFileSelect, |
| 7643 |
onWpMediaSelect: function onWpMediaSelect(frame) { |
| 7644 |
return props.onWpMediaSelect(frame); |
| 7645 |
}, |
| 7646 |
onError: function onError(error) { |
| 7647 |
return props.onError(error); |
| 7648 |
}, |
| 7649 |
text: props.buttonText, |
| 7650 |
filetypes: props.filetypes, |
| 7651 |
variant: props.buttonVariant, |
| 7652 |
color: props.buttonColor, |
| 7653 |
onFileChoose: props.onFileChoose |
| 7654 |
}), props.description && /*#__PURE__*/ react.default.createElement(Text$11, { |
| 7655 |
variant: "xl", |
| 7656 |
className: "e-app-drop-zone__description" |
| 7657 |
}, props.description))); |
| 7658 |
} |
| 7659 |
__name(DropZone$1, "DropZone"); |
| 7660 |
DropZone$1.propTypes = { |
| 7661 |
className: import_prop_types$55.default.string, |
| 7662 |
children: import_prop_types$55.default.any, |
| 7663 |
type: import_prop_types$55.default.string, |
| 7664 |
onFileSelect: import_prop_types$55.default.func.isRequired, |
| 7665 |
onWpMediaSelect: import_prop_types$55.default.func, |
| 7666 |
heading: import_prop_types$55.default.string, |
| 7667 |
text: import_prop_types$55.default.string, |
| 7668 |
secondaryText: import_prop_types$55.default.string, |
| 7669 |
buttonText: import_prop_types$55.default.string, |
| 7670 |
buttonVariant: import_prop_types$55.default.string, |
| 7671 |
buttonColor: import_prop_types$55.default.string, |
| 7672 |
icon: import_prop_types$55.default.string, |
| 7673 |
showButton: import_prop_types$55.default.bool, |
| 7674 |
showIcon: import_prop_types$55.default.bool, |
| 7675 |
isLoading: import_prop_types$55.default.bool, |
| 7676 |
filetypes: import_prop_types$55.default.array.isRequired, |
| 7677 |
onError: import_prop_types$55.default.func, |
| 7678 |
description: import_prop_types$55.default.string, |
| 7679 |
onButtonClick: import_prop_types$55.default.func, |
| 7680 |
onFileChoose: import_prop_types$55.default.func |
| 7681 |
}; |
| 7682 |
DropZone$1.defaultProps = { |
| 7683 |
className: "", |
| 7684 |
type: "file-explorer", |
| 7685 |
icon: "eicon-library-upload", |
| 7686 |
showButton: true, |
| 7687 |
showIcon: true, |
| 7688 |
onError: function onError() {} |
| 7689 |
}; |
| 7690 |
|
| 7691 |
//#endregion |
| 7692 |
//#region app/assets/js/molecules/elementor-loading.js |
| 7693 |
function ElementorLoading(props) { |
| 7694 |
return /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loading" }, /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loader-wrapper" }, /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loader" }, /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loader-boxes" }, /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loader-box" }), /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loader-box" }), /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loader-box" }), /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loader-box" }))), /*#__PURE__*/ react.default.createElement("div", { className: "elementor-loading-title" }, props.loadingText))); |
| 7695 |
} |
| 7696 |
var import_prop_types$48; |
| 7697 |
var init_elementor_loading = __esmMin((() => { |
| 7698 |
import_prop_types$48 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 7699 |
ElementorLoading.propTypes = { loadingText: import_prop_types$48.default.string }; |
| 7700 |
ElementorLoading.defaultProps = { loadingText: (0, _wordpress_i18n.__)("Loading", "elementor") }; |
| 7701 |
})); |
| 7702 |
|
| 7703 |
//#endregion |
| 7704 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/assets/js/ui/atoms/checkbox.scss |
| 7705 |
init_elementor_loading(); |
| 7706 |
|
| 7707 |
//#endregion |
| 7708 |
//#region app/assets/js/ui/atoms/checkbox.js |
| 7709 |
init_utils$4(); |
| 7710 |
function Checkbox$5(_ref) { |
| 7711 |
var className = _ref.className; |
| 7712 |
var checked = _ref.checked; |
| 7713 |
var rounded = _ref.rounded; |
| 7714 |
var indeterminate = _ref.indeterminate; |
| 7715 |
var error = _ref.error; |
| 7716 |
var disabled = _ref.disabled; |
| 7717 |
var onChange = _ref.onChange; |
| 7718 |
var id = _ref.id; |
| 7719 |
var baseClassName = "eps-checkbox"; |
| 7720 |
var classes = [baseClassName, className]; |
| 7721 |
if (rounded) classes.push(baseClassName + "--rounded"); |
| 7722 |
if (indeterminate) classes.push(baseClassName + "--indeterminate"); |
| 7723 |
if (error) classes.push(baseClassName + "--error"); |
| 7724 |
return /*#__PURE__*/ react.default.createElement("input", { |
| 7725 |
className: arrayToClassName(classes), |
| 7726 |
type: "checkbox", |
| 7727 |
checked, |
| 7728 |
disabled, |
| 7729 |
onChange, |
| 7730 |
id |
| 7731 |
}); |
| 7732 |
} |
| 7733 |
__name(Checkbox$5, "Checkbox"); |
| 7734 |
Checkbox$5.propTypes = { |
| 7735 |
className: import_prop_types$55.default.string, |
| 7736 |
checked: import_prop_types$55.default.bool, |
| 7737 |
disabled: import_prop_types$55.default.bool, |
| 7738 |
indeterminate: import_prop_types$55.default.bool, |
| 7739 |
rounded: import_prop_types$55.default.bool, |
| 7740 |
error: import_prop_types$55.default.bool, |
| 7741 |
onChange: import_prop_types$55.default.func, |
| 7742 |
id: import_prop_types$55.default.string |
| 7743 |
}; |
| 7744 |
Checkbox$5.defaultProps = { |
| 7745 |
className: "", |
| 7746 |
checked: null, |
| 7747 |
disabled: false, |
| 7748 |
indeterminate: false, |
| 7749 |
error: false, |
| 7750 |
onChange: function onChange() {} |
| 7751 |
}; |
| 7752 |
|
| 7753 |
//#endregion |
| 7754 |
//#region app/modules/import-export/assets/js/pages/import/import-kit/import-kit.js |
| 7755 |
init_slicedToArray(); |
| 7756 |
init_es$1(); |
| 7757 |
init_use_query_params(); |
| 7758 |
init_button(); |
| 7759 |
init_apps_event_tracking(); |
| 7760 |
init_use_kit$1(); |
| 7761 |
function ImportKit$1() { |
| 7762 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 7763 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 7764 |
var navigate = useNavigate(); |
| 7765 |
var _useKit = useKit$1(); |
| 7766 |
var kitState = _useKit.kitState; |
| 7767 |
var kitActions = _useKit.kitActions; |
| 7768 |
var KIT_STATUS_MAP = _useKit.KIT_STATUS_MAP; |
| 7769 |
var _useState2 = _slicedToArray((0, react.useState)(""), 2); |
| 7770 |
var errorType = _useState2[0]; |
| 7771 |
var setErrorType = _useState2[1]; |
| 7772 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 7773 |
var isLoading = _useState4[0]; |
| 7774 |
var setIsLoading = _useState4[1]; |
| 7775 |
var _sharedContext$data = sharedContext.data; |
| 7776 |
var referrer = _sharedContext$data.referrer; |
| 7777 |
var currentPage = _sharedContext$data.currentPage; |
| 7778 |
var resetImportProcess = function resetImportProcess() { |
| 7779 |
importContext.dispatch({ |
| 7780 |
type: "SET_FILE", |
| 7781 |
payload: null |
| 7782 |
}); |
| 7783 |
setErrorType(null); |
| 7784 |
setIsLoading(false); |
| 7785 |
kitActions.reset(); |
| 7786 |
}; |
| 7787 |
var eventTracking = function eventTracking(command) { |
| 7788 |
var event = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 7789 |
var eventType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click"; |
| 7790 |
var error = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 7791 |
var modalType = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null; |
| 7792 |
var uploadMethod = arguments.length > 5 ? arguments[5] : void 0; |
| 7793 |
if ("kit-library" === referrer) { |
| 7794 |
var uploadMethodName = null; |
| 7795 |
if (uploadMethod) uploadMethodName = "drop" === uploadMethod ? "drag-drop" : "browse"; |
| 7796 |
var element = null; |
| 7797 |
if (event && "eps-button eps-dialog__button" === event.currentTarget.className.trim()) element = "close button"; |
| 7798 |
else if (event && "eps-button eps-dialog__close-button" === event.currentTarget.className.trim()) element = "x"; |
| 7799 |
appsEventTrackingDispatch(command, { |
| 7800 |
element, |
| 7801 |
page_source: "import", |
| 7802 |
event_type: eventType, |
| 7803 |
step: currentPage, |
| 7804 |
error: "general" === error ? "unknown" : error, |
| 7805 |
modal_type: modalType, |
| 7806 |
method: uploadMethodName |
| 7807 |
}); |
| 7808 |
} |
| 7809 |
}; |
| 7810 |
var getLearnMoreLink = function getLearnMoreLink() { |
| 7811 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 7812 |
url: "https://go.elementor.com/app-what-are-kits", |
| 7813 |
key: "learn-more-link", |
| 7814 |
italic: true, |
| 7815 |
onClick: function onClick() { |
| 7816 |
return eventTracking("kit-library/seek-more-info", null, "click"); |
| 7817 |
} |
| 7818 |
}, (0, _wordpress_i18n.__)("Learn More", "elementor")); |
| 7819 |
}; |
| 7820 |
var _useConfirmAction = (0, _elementor_hooks.useConfirmAction)({ |
| 7821 |
doNotShowAgainKey: "upload_json_warning_generic_message", |
| 7822 |
action: function action(file, e) { |
| 7823 |
setIsLoading(true); |
| 7824 |
importContext.dispatch({ |
| 7825 |
type: "SET_FILE", |
| 7826 |
payload: file |
| 7827 |
}); |
| 7828 |
eventTracking("kit-library/file-upload", null, "feedback", null, null, e.type); |
| 7829 |
} |
| 7830 |
}); |
| 7831 |
var uploadFile = _useConfirmAction.runAction; |
| 7832 |
var dialog = _useConfirmAction.dialog; |
| 7833 |
var checkbox = _useConfirmAction.checkbox; |
| 7834 |
var _useQueryParams$getAl = useQueryParams().getAll(); |
| 7835 |
var source = _useQueryParams$getAl.source; |
| 7836 |
var kitId = _useQueryParams$getAl.kit_id; |
| 7837 |
var isLoadingKitFromCloud = [importContext.data.source, source].includes(KIT_SOURCE_MAP.CLOUD); |
| 7838 |
(0, react.useEffect)(function() { |
| 7839 |
sharedContext.dispatch({ |
| 7840 |
type: "SET_INCLUDES", |
| 7841 |
payload: [] |
| 7842 |
}); |
| 7843 |
importContext.dispatch({ |
| 7844 |
type: "SET_KIT_SOURCE", |
| 7845 |
payload: source |
| 7846 |
}); |
| 7847 |
sharedContext.dispatch({ |
| 7848 |
type: "SET_CURRENT_PAGE_NAME", |
| 7849 |
payload: ImportKit$1.name |
| 7850 |
}); |
| 7851 |
}, []); |
| 7852 |
(0, react.useEffect)(function() { |
| 7853 |
if (importContext.data.file) kitActions.upload({ file: importContext.data.file }); |
| 7854 |
}, [importContext.data.file]); |
| 7855 |
(0, react.useEffect)(function() { |
| 7856 |
if (KIT_STATUS_MAP.UPLOADED === kitState.status) { |
| 7857 |
importContext.dispatch({ |
| 7858 |
type: "SET_UPLOADED_DATA", |
| 7859 |
payload: kitState.data |
| 7860 |
}); |
| 7861 |
if (isLoadingKitFromCloud && kitState.data.uploaded_kit) importContext.dispatch({ |
| 7862 |
type: "SET_FILE", |
| 7863 |
payload: kitState.data.uploaded_kit |
| 7864 |
}); |
| 7865 |
} else if ("error" === kitState.status) setErrorType(kitState.data); |
| 7866 |
}, [kitState.status]); |
| 7867 |
(0, react.useEffect)(function() { |
| 7868 |
if (importContext.data.uploadedData && importContext.data.file) navigate(importContext.data.uploadedData.manifest.plugins ? "/import/plugins" : "/import/content"); |
| 7869 |
}, [importContext.data.uploadedData]); |
| 7870 |
(0, react.useEffect)(function() { |
| 7871 |
if (KIT_SOURCE_MAP.CLOUD === source && kitId) kitActions.upload({ |
| 7872 |
source, |
| 7873 |
kitId |
| 7874 |
}); |
| 7875 |
}, [source, kitId]); |
| 7876 |
return /*#__PURE__*/ react.default.createElement(Layout, { type: "import" }, /*#__PURE__*/ react.default.createElement("section", { className: "e-app-import" }, isLoadingKitFromCloud ? /*#__PURE__*/ react.default.createElement(ElementorLoading, null) : /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, "kit-library" === referrer && /*#__PURE__*/ react.default.createElement(Button$29, { |
| 7877 |
className: "e-app-import__back-to-library", |
| 7878 |
icon: "eicon-chevron-left", |
| 7879 |
text: (0, _wordpress_i18n.__)("Back to Website Templates", "elementor"), |
| 7880 |
url: isLoading ? "" : "/kit-library".concat(isLoadingKitFromCloud ? "/cloud" : "") |
| 7881 |
}), /*#__PURE__*/ react.default.createElement(PageHeader$1, { |
| 7882 |
heading: (0, _wordpress_i18n.__)("Import a Website Template", "elementor"), |
| 7883 |
description: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Upload a .zip file with style, site settings, content, etc. Then, we’ll apply them to your site.", "elementor"), " ", getLearnMoreLink()) |
| 7884 |
}), /*#__PURE__*/ react.default.createElement(Notice, { |
| 7885 |
label: (0, _wordpress_i18n.__)("Heads up!", "elementor"), |
| 7886 |
color: "warning", |
| 7887 |
className: "e-app-import__notice" |
| 7888 |
}, (0, _wordpress_i18n.__)("Before applying a new template, we recommend backing up your site so you can roll back any undesired changes.", "elementor")), /*#__PURE__*/ react.default.createElement(DropZone$1, { |
| 7889 |
className: "e-app-import__drop-zone", |
| 7890 |
heading: (0, _wordpress_i18n.__)("Choose a file to import", "elementor"), |
| 7891 |
text: (0, _wordpress_i18n.__)("Drag & drop the .zip file with your website template", "elementor"), |
| 7892 |
secondaryText: (0, _wordpress_i18n.__)("Or", "elementor"), |
| 7893 |
filetypes: ["zip"], |
| 7894 |
onFileChoose: function onFileChoose() { |
| 7895 |
return eventTracking("kit-library/choose-file"); |
| 7896 |
}, |
| 7897 |
onFileSelect: uploadFile, |
| 7898 |
onError: function onError() { |
| 7899 |
return setErrorType("general"); |
| 7900 |
}, |
| 7901 |
isLoading, |
| 7902 |
buttonText: (0, _wordpress_i18n.__)("Import from files", "elementor") |
| 7903 |
}), dialog.isOpen && /*#__PURE__*/ react.default.createElement(Dialog$9, { |
| 7904 |
title: (0, _wordpress_i18n.__)("Warning: JSON or ZIP files may be unsafe", "elementor"), |
| 7905 |
text: (0, _wordpress_i18n.__)("Uploading JSON or ZIP files from unknown sources can be harmful and put your site at risk. For maximum safety, upload only JSON or ZIP files from trusted sources.", "elementor"), |
| 7906 |
approveButtonColor: "link", |
| 7907 |
approveButtonText: (0, _wordpress_i18n.__)("Continue", "elementor"), |
| 7908 |
approveButtonOnClick: dialog.approve, |
| 7909 |
dismissButtonText: (0, _wordpress_i18n.__)("Cancel", "elementor"), |
| 7910 |
dismissButtonOnClick: dialog.dismiss, |
| 7911 |
onClose: dialog.dismiss |
| 7912 |
}, /*#__PURE__*/ react.default.createElement("label", { |
| 7913 |
htmlFor: "do-not-show-upload-json-warning-again", |
| 7914 |
style: { |
| 7915 |
display: "flex", |
| 7916 |
alignItems: "center", |
| 7917 |
gap: "5px" |
| 7918 |
} |
| 7919 |
}, /*#__PURE__*/ react.default.createElement(Checkbox$5, { |
| 7920 |
id: "do-not-show-upload-json-warning-again", |
| 7921 |
type: "checkbox", |
| 7922 |
value: checkbox.isChecked, |
| 7923 |
onChange: function onChange(event) { |
| 7924 |
return checkbox.setIsChecked(!!event.target.checked); |
| 7925 |
} |
| 7926 |
}), (0, _wordpress_i18n.__)("Do not show this message again", "elementor")))), errorType && /*#__PURE__*/ react.default.createElement(ProcessFailedDialog, { |
| 7927 |
errorType, |
| 7928 |
onApprove: resetImportProcess, |
| 7929 |
onModalClose: function onModalClose(event) { |
| 7930 |
return eventTracking("kit-library/modal-close", event, "load", null, "error"); |
| 7931 |
}, |
| 7932 |
onError: function onError() { |
| 7933 |
return eventTracking("kit-library/modal-open", null, "load", errorType, "error"); |
| 7934 |
}, |
| 7935 |
onLearnMore: function onLearnMore() { |
| 7936 |
return eventTracking("kit-library/seek-more-info", null, "click", null, "error"); |
| 7937 |
} |
| 7938 |
}))); |
| 7939 |
} |
| 7940 |
__name(ImportKit$1, "ImportKit"); |
| 7941 |
|
| 7942 |
//#endregion |
| 7943 |
//#region \0vite/preload-helper.js |
| 7944 |
var scriptRel, assetsURL, seen, __vitePreload; |
| 7945 |
var init_preload_helper = __esmMin((() => { |
| 7946 |
scriptRel = "modulepreload"; |
| 7947 |
assetsURL = function(dep) { |
| 7948 |
return "/" + dep; |
| 7949 |
}; |
| 7950 |
seen = {}; |
| 7951 |
__vitePreload = function preload(baseModule, deps, importerUrl) { |
| 7952 |
let promise = Promise.resolve(); |
| 7953 |
if (false && deps && deps.length > 0) { |
| 7954 |
const links = document.getElementsByTagName("link"); |
| 7955 |
const cspNonceMeta = document.querySelector("meta[property=csp-nonce]"); |
| 7956 |
const cspNonce = (cspNonceMeta === null || cspNonceMeta === void 0 ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta === null || cspNonceMeta === void 0 ? void 0 : cspNonceMeta.getAttribute("nonce")); |
| 7957 |
function allSettled(promises) { |
| 7958 |
return Promise.all(promises.map((p) => Promise.resolve(p).then((value) => ({ |
| 7959 |
status: "fulfilled", |
| 7960 |
value |
| 7961 |
}), (reason) => ({ |
| 7962 |
status: "rejected", |
| 7963 |
reason |
| 7964 |
})))); |
| 7965 |
} |
| 7966 |
function importMetaResolve(specifier) { |
| 7967 |
if ({}.resolve) return {}.resolve(specifier); |
| 7968 |
return new URL( |
| 7969 |
specifier, |
| 7970 |
/** #__KEEP__ */ |
| 7971 |
{}.url |
| 7972 |
).href; |
| 7973 |
} |
| 7974 |
promise = allSettled(deps.map((dep) => { |
| 7975 |
dep = assetsURL(dep, importerUrl); |
| 7976 |
dep = importMetaResolve(dep); |
| 7977 |
if (dep in seen) return; |
| 7978 |
seen[dep] = true; |
| 7979 |
const isCss = dep.endsWith(".css"); |
| 7980 |
for (let i = links.length - 1; i >= 0; i--) { |
| 7981 |
const link = links[i]; |
| 7982 |
if (link.href === dep && (!isCss || link.rel === "stylesheet")) return; |
| 7983 |
} |
| 7984 |
const link = document.createElement("link"); |
| 7985 |
link.rel = isCss ? "stylesheet" : scriptRel; |
| 7986 |
if (!isCss) link.as = "script"; |
| 7987 |
link.crossOrigin = ""; |
| 7988 |
link.href = dep; |
| 7989 |
if (cspNonce) link.setAttribute("nonce", cspNonce); |
| 7990 |
document.head.appendChild(link); |
| 7991 |
if (isCss) return new Promise((res, rej) => { |
| 7992 |
link.addEventListener("load", res); |
| 7993 |
link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`))); |
| 7994 |
}); |
| 7995 |
})); |
| 7996 |
} |
| 7997 |
function handlePreloadError(err) { |
| 7998 |
const e = new Event("vite:preloadError", { cancelable: true }); |
| 7999 |
e.payload = err; |
| 8000 |
window.dispatchEvent(e); |
| 8001 |
if (!e.defaultPrevented) throw err; |
| 8002 |
} |
| 8003 |
return promise.then((res) => { |
| 8004 |
for (const item of res || []) { |
| 8005 |
if (item.status !== "rejected") continue; |
| 8006 |
handlePreloadError(item.reason); |
| 8007 |
} |
| 8008 |
return baseModule().catch(handlePreloadError); |
| 8009 |
}); |
| 8010 |
}; |
| 8011 |
})); |
| 8012 |
|
| 8013 |
//#endregion |
| 8014 |
//#region app/assets/js/molecules/tooltip.js |
| 8015 |
function Tooltip$2(props) { |
| 8016 |
var classes = ["e-app-tooltip", props.className]; |
| 8017 |
var childRef = (0, react.useRef)(null); |
| 8018 |
var isAborted = (0, react.useRef)(false); |
| 8019 |
var isManualControl = Object.prototype.hasOwnProperty.call(props, "show"); |
| 8020 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 8021 |
var isLibraryLoaded = _useState2[0]; |
| 8022 |
var setIsLibraryLoaded = _useState2[1]; |
| 8023 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 8024 |
var showTooltip = _useState4[0]; |
| 8025 |
var setShowTooltip = _useState4[1]; |
| 8026 |
var tipsyConfig = { |
| 8027 |
trigger: isManualControl ? "manual" : "hover", |
| 8028 |
gravity: { |
| 8029 |
top: "s", |
| 8030 |
right: "w", |
| 8031 |
down: "n", |
| 8032 |
left: "e" |
| 8033 |
}[props.direction], |
| 8034 |
offset: props.offset, |
| 8035 |
title: function title() { |
| 8036 |
return props.title; |
| 8037 |
} |
| 8038 |
}; |
| 8039 |
var setTipsy = function setTipsy() { |
| 8040 |
var $tooltipContainer = jQuery(childRef.current); |
| 8041 |
$tooltipContainer.tipsy(tipsyConfig); |
| 8042 |
if (isManualControl) { |
| 8043 |
var displayMode = showTooltip ? "show" : "hide"; |
| 8044 |
$tooltipContainer.tipsy(displayMode); |
| 8045 |
} |
| 8046 |
}; |
| 8047 |
(0, react.useEffect)(function() { |
| 8048 |
if (!props.disabled) { |
| 8049 |
isAborted.current = false; |
| 8050 |
__vitePreload(() => import( |
| 8051 |
/* webpackIgnore: true */ |
| 8052 |
"".concat(elementorCommon.config.urls.assets, "lib/tipsy/tipsy.min.js?ver=1.0.0") |
| 8053 |
).then(function() { |
| 8054 |
if (!isAborted.current) if (isLibraryLoaded) setTipsy(); |
| 8055 |
else setIsLibraryLoaded(true); |
| 8056 |
}), void 0); |
| 8057 |
} |
| 8058 |
return function() { |
| 8059 |
if (!props.disabled) { |
| 8060 |
isAborted.current = true; |
| 8061 |
var nodes = document.querySelectorAll(".tipsy"); |
| 8062 |
if (!nodes.length) return; |
| 8063 |
nodes[nodes.length - 1].remove(); |
| 8064 |
} |
| 8065 |
}; |
| 8066 |
}, [props.disabled]); |
| 8067 |
(0, react.useEffect)(function() { |
| 8068 |
if (isLibraryLoaded) setTipsy(); |
| 8069 |
}, [isLibraryLoaded, showTooltip]); |
| 8070 |
(0, react.useEffect)(function() { |
| 8071 |
if (!props.disabled && props.show !== showTooltip) setShowTooltip(props.show); |
| 8072 |
}, [props.show]); |
| 8073 |
return /*#__PURE__*/ react.default.createElement(props.tag, { |
| 8074 |
className: arrayToClassName(classes), |
| 8075 |
ref: childRef |
| 8076 |
}, props.children); |
| 8077 |
} |
| 8078 |
var import_prop_types$47; |
| 8079 |
var init_tooltip = __esmMin((() => { |
| 8080 |
import_prop_types$47 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 8081 |
init_slicedToArray(); |
| 8082 |
init_utils$4(); |
| 8083 |
init_preload_helper(); |
| 8084 |
__name(Tooltip$2, "Tooltip"); |
| 8085 |
Tooltip$2.propTypes = { |
| 8086 |
className: import_prop_types$47.default.string, |
| 8087 |
offset: import_prop_types$47.default.number, |
| 8088 |
show: import_prop_types$47.default.bool, |
| 8089 |
direction: import_prop_types$47.default.oneOf([ |
| 8090 |
"top", |
| 8091 |
"right", |
| 8092 |
"left", |
| 8093 |
"down" |
| 8094 |
]), |
| 8095 |
tag: import_prop_types$47.default.string.isRequired, |
| 8096 |
title: import_prop_types$47.default.string.isRequired, |
| 8097 |
disabled: import_prop_types$47.default.bool, |
| 8098 |
children: import_prop_types$47.default.any |
| 8099 |
}; |
| 8100 |
Tooltip$2.defaultProps = { |
| 8101 |
className: "", |
| 8102 |
offset: 10, |
| 8103 |
direction: "top", |
| 8104 |
disabled: false |
| 8105 |
}; |
| 8106 |
})); |
| 8107 |
|
| 8108 |
//#endregion |
| 8109 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/import-export/assets/js/shared/kit-content/components/templates-features/templates-features.scss |
| 8110 |
init_tooltip(); |
| 8111 |
|
| 8112 |
//#endregion |
| 8113 |
//#region app/modules/import-export/assets/js/shared/kit-content/components/templates-features/templates-features.js |
| 8114 |
function TemplatesFeatures(props) { |
| 8115 |
var _props$features$locke; |
| 8116 |
var isLockedFeatures = (_props$features$locke = props.features.locked) === null || _props$features$locke === void 0 ? void 0 : _props$features$locke.length; |
| 8117 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, function getOpenFeatures() { |
| 8118 |
var _props$features$open; |
| 8119 |
return (_props$features$open = props.features.open) === null || _props$features$open === void 0 ? void 0 : _props$features$open.join(", "); |
| 8120 |
}(), function getLockedFeatures() { |
| 8121 |
if (!isLockedFeatures) return; |
| 8122 |
return /*#__PURE__*/ react.default.createElement(Tooltip$2, { |
| 8123 |
tag: "span", |
| 8124 |
offset: 19, |
| 8125 |
show: props.showTooltip, |
| 8126 |
title: props.features.tooltip, |
| 8127 |
disabled: !props.isLocked, |
| 8128 |
className: props.isLocked ? "e-app-export-templates-features__locked" : "" |
| 8129 |
}, ", " + props.features.locked.join(", ")); |
| 8130 |
}()); |
| 8131 |
} |
| 8132 |
TemplatesFeatures.propTypes = { |
| 8133 |
features: import_prop_types$55.default.object, |
| 8134 |
isLocked: import_prop_types$55.default.bool, |
| 8135 |
showTooltip: import_prop_types$55.default.bool |
| 8136 |
}; |
| 8137 |
TemplatesFeatures.defaultProps = { showTooltip: false }; |
| 8138 |
|
| 8139 |
//#endregion |
| 8140 |
//#region app/modules/import-export/assets/js/shared/kit-content/components/kit-content-checkbox/kit-content-checkbox.js |
| 8141 |
function KitContentCheckbox(props) { |
| 8142 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 8143 |
var isSelected = function isSelected() { |
| 8144 |
return sharedContext.data.includes.includes(props.type); |
| 8145 |
}; |
| 8146 |
var setIncludes = function setIncludes(event) { |
| 8147 |
var _props$onCheck; |
| 8148 |
var actionType = event.target.checked ? "ADD_INCLUDE" : "REMOVE_INCLUDE"; |
| 8149 |
(_props$onCheck = props.onCheck) === null || _props$onCheck === void 0 || _props$onCheck.call(props, event, props.type); |
| 8150 |
sharedContext.dispatch({ |
| 8151 |
type: actionType, |
| 8152 |
payload: props.type |
| 8153 |
}); |
| 8154 |
}; |
| 8155 |
(0, react.useEffect)(function() { |
| 8156 |
if (!sharedContext.data.includes.length) sharedContext.dispatch({ |
| 8157 |
type: "ADD_INCLUDE", |
| 8158 |
payload: props.type |
| 8159 |
}); |
| 8160 |
}, []); |
| 8161 |
return (0, react.useMemo)(function() { |
| 8162 |
return /*#__PURE__*/ react.default.createElement(Checkbox$5, { |
| 8163 |
checked: isSelected(), |
| 8164 |
onChange: setIncludes, |
| 8165 |
className: props.className |
| 8166 |
}); |
| 8167 |
}, [sharedContext.data.includes]); |
| 8168 |
} |
| 8169 |
KitContentCheckbox.propTypes = { |
| 8170 |
className: import_prop_types$55.default.string, |
| 8171 |
type: import_prop_types$55.default.string.isRequired |
| 8172 |
}; |
| 8173 |
KitContentCheckbox.defaultProps = { className: "" }; |
| 8174 |
|
| 8175 |
//#endregion |
| 8176 |
//#region app/assets/js/ui/atoms/select.js |
| 8177 |
function Select$2(props) { |
| 8178 |
return /*#__PURE__*/ react.default.createElement("select", { |
| 8179 |
multiple: props.multiple, |
| 8180 |
className: props.className, |
| 8181 |
value: props.value, |
| 8182 |
onChange: props.onChange, |
| 8183 |
ref: props.elRef, |
| 8184 |
onClick: function onClick() { |
| 8185 |
var _props$onClick; |
| 8186 |
return (_props$onClick = props.onClick) === null || _props$onClick === void 0 ? void 0 : _props$onClick.call(props); |
| 8187 |
} |
| 8188 |
}, props.options.map(function(option) { |
| 8189 |
return option.children ? /*#__PURE__*/ react.default.createElement("optgroup", { |
| 8190 |
label: option.label, |
| 8191 |
key: option.label |
| 8192 |
}, option.children.map(function(childOption) { |
| 8193 |
return /*#__PURE__*/ react.default.createElement("option", { |
| 8194 |
key: childOption.value, |
| 8195 |
value: childOption.value |
| 8196 |
}, childOption.label); |
| 8197 |
})) : /*#__PURE__*/ react.default.createElement("option", { |
| 8198 |
key: option.value, |
| 8199 |
value: option.value |
| 8200 |
}, option.label); |
| 8201 |
})); |
| 8202 |
} |
| 8203 |
__name(Select$2, "Select"); |
| 8204 |
Select$2.propTypes = { |
| 8205 |
className: import_prop_types$55.default.string, |
| 8206 |
onChange: import_prop_types$55.default.func, |
| 8207 |
options: import_prop_types$55.default.array, |
| 8208 |
elRef: import_prop_types$55.default.object, |
| 8209 |
multiple: import_prop_types$55.default.bool, |
| 8210 |
value: import_prop_types$55.default.oneOfType([import_prop_types$55.default.array, import_prop_types$55.default.string]), |
| 8211 |
onClick: import_prop_types$55.default.func |
| 8212 |
}; |
| 8213 |
Select$2.defaultProps = { |
| 8214 |
className: "", |
| 8215 |
options: [] |
| 8216 |
}; |
| 8217 |
|
| 8218 |
//#endregion |
| 8219 |
//#region app/assets/js/ui/molecules/select2.js |
| 8220 |
init_defineProperty$1(); |
| 8221 |
function ownKeys$27(e, r) { |
| 8222 |
var t = Object.keys(e); |
| 8223 |
if (Object.getOwnPropertySymbols) { |
| 8224 |
var o = Object.getOwnPropertySymbols(e); |
| 8225 |
r && (o = o.filter(function(r) { |
| 8226 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 8227 |
})), t.push.apply(t, o); |
| 8228 |
} |
| 8229 |
return t; |
| 8230 |
} |
| 8231 |
__name(ownKeys$27, "ownKeys"); |
| 8232 |
function _objectSpread$26(e) { |
| 8233 |
for (var r = 1; r < arguments.length; r++) { |
| 8234 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 8235 |
r % 2 ? ownKeys$27(Object(t), !0).forEach(function(r) { |
| 8236 |
_defineProperty$1(e, r, t[r]); |
| 8237 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$27(Object(t)).forEach(function(r) { |
| 8238 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 8239 |
}); |
| 8240 |
} |
| 8241 |
return e; |
| 8242 |
} |
| 8243 |
__name(_objectSpread$26, "_objectSpread"); |
| 8244 |
/** |
| 8245 |
* Default settings of the select 2 |
| 8246 |
* |
| 8247 |
* @return {{placeholder: string, allowClear: boolean, dir: string}} |
| 8248 |
*/ |
| 8249 |
var getDefaultSettings = function getDefaultSettings() { |
| 8250 |
return { |
| 8251 |
allowClear: true, |
| 8252 |
placeholder: "", |
| 8253 |
dir: elementorCommon.config.isRTL ? "rtl" : "ltr" |
| 8254 |
}; |
| 8255 |
}; |
| 8256 |
/** |
| 8257 |
* Main component |
| 8258 |
* |
| 8259 |
* @param {*} props |
| 8260 |
* @return {*} component |
| 8261 |
* @function Object() { [native code] } |
| 8262 |
*/ |
| 8263 |
function Select2(props) { |
| 8264 |
var ref = react.default.useRef(null); |
| 8265 |
react.default.useEffect(function() { |
| 8266 |
var $select2 = jQuery(ref.current).select2(_objectSpread$26(_objectSpread$26(_objectSpread$26({}, getDefaultSettings()), props.settings), {}, { placeholder: props.placeholder })).on("select2:select select2:unselect", props.onChange); |
| 8267 |
if (props.onReady) props.onReady($select2); |
| 8268 |
return function() { |
| 8269 |
$select2.select2("destroy").off("select2:select select2:unselect"); |
| 8270 |
}; |
| 8271 |
}, [props.settings, props.options]); |
| 8272 |
react.default.useEffect(function() { |
| 8273 |
jQuery(ref.current).val(props.value).trigger("change"); |
| 8274 |
}, [props.value]); |
| 8275 |
return /*#__PURE__*/ react.default.createElement(Select$2, { |
| 8276 |
multiple: props.multiple, |
| 8277 |
value: props.value, |
| 8278 |
onChange: props.onChange, |
| 8279 |
elRef: ref, |
| 8280 |
options: props.options, |
| 8281 |
placeholder: props.placeholder |
| 8282 |
}); |
| 8283 |
} |
| 8284 |
Select2.propTypes = { |
| 8285 |
value: import_prop_types$55.default.oneOfType([import_prop_types$55.default.array, import_prop_types$55.default.string]), |
| 8286 |
onChange: import_prop_types$55.default.func, |
| 8287 |
onReady: import_prop_types$55.default.func, |
| 8288 |
options: import_prop_types$55.default.array, |
| 8289 |
settings: import_prop_types$55.default.object, |
| 8290 |
multiple: import_prop_types$55.default.bool, |
| 8291 |
placeholder: import_prop_types$55.default.string |
| 8292 |
}; |
| 8293 |
Select2.defaultProps = { |
| 8294 |
settings: {}, |
| 8295 |
options: [], |
| 8296 |
dependencies: [], |
| 8297 |
placeholder: "" |
| 8298 |
}; |
| 8299 |
|
| 8300 |
//#endregion |
| 8301 |
//#region app/assets/js/ui/atoms/text-field.js |
| 8302 |
init_extends(); |
| 8303 |
init_defineProperty$1(); |
| 8304 |
init_utils$4(); |
| 8305 |
function ownKeys$26(e, r) { |
| 8306 |
var t = Object.keys(e); |
| 8307 |
if (Object.getOwnPropertySymbols) { |
| 8308 |
var o = Object.getOwnPropertySymbols(e); |
| 8309 |
r && (o = o.filter(function(r) { |
| 8310 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 8311 |
})), t.push.apply(t, o); |
| 8312 |
} |
| 8313 |
return t; |
| 8314 |
} |
| 8315 |
__name(ownKeys$26, "ownKeys"); |
| 8316 |
function _objectSpread$25(e) { |
| 8317 |
for (var r = 1; r < arguments.length; r++) { |
| 8318 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 8319 |
r % 2 ? ownKeys$26(Object(t), !0).forEach(function(r) { |
| 8320 |
_defineProperty$1(e, r, t[r]); |
| 8321 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$26(Object(t)).forEach(function(r) { |
| 8322 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 8323 |
}); |
| 8324 |
} |
| 8325 |
return e; |
| 8326 |
} |
| 8327 |
__name(_objectSpread$25, "_objectSpread"); |
| 8328 |
function TextField(props) { |
| 8329 |
var classNameBase = "eps-text-field"; |
| 8330 |
var classes = [ |
| 8331 |
classNameBase, |
| 8332 |
props.className, |
| 8333 |
_defineProperty$1({}, classNameBase + "--outlined", "outlined" === props.variant), |
| 8334 |
_defineProperty$1({}, classNameBase + "--standard", "standard" === props.variant) |
| 8335 |
]; |
| 8336 |
var validProps = _objectSpread$25(_objectSpread$25({}, props), {}, { className: arrayToClassName(classes) }); |
| 8337 |
if (validProps.multiline) { |
| 8338 |
delete validProps.multiline; |
| 8339 |
return /*#__PURE__*/ react.default.createElement("textarea", validProps); |
| 8340 |
} |
| 8341 |
return /*#__PURE__*/ react.default.createElement("input", _extends({}, validProps, { type: "text" })); |
| 8342 |
} |
| 8343 |
TextField.propTypes = { |
| 8344 |
className: import_prop_types$55.default.string, |
| 8345 |
multiline: import_prop_types$55.default.bool, |
| 8346 |
variant: import_prop_types$55.default.oneOf(["standard", "outlined"]), |
| 8347 |
children: import_prop_types$55.default.string |
| 8348 |
}; |
| 8349 |
TextField.defaultProps = { |
| 8350 |
className: "", |
| 8351 |
variant: "standard" |
| 8352 |
}; |
| 8353 |
|
| 8354 |
//#endregion |
| 8355 |
//#region app/modules/import-export/assets/js/shared/cpt-select-box/cpt-select-box.js |
| 8356 |
init_slicedToArray(); |
| 8357 |
function CptSelectBox() { |
| 8358 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 8359 |
var customPostTypes = (sharedContext.data || []).customPostTypes; |
| 8360 |
var _useState2 = _slicedToArray((0, react.useState)([]), 2); |
| 8361 |
var selected = _useState2[0]; |
| 8362 |
var setSelected = _useState2[1]; |
| 8363 |
(0, react.useEffect)(function() { |
| 8364 |
setSelected(arrayValueIterator(customPostTypes)); |
| 8365 |
}, [customPostTypes]); |
| 8366 |
(0, react.useEffect)(function() { |
| 8367 |
sharedContext.dispatch({ |
| 8368 |
type: "SET_SELECTED_CPT", |
| 8369 |
payload: selected |
| 8370 |
}); |
| 8371 |
}, [selected]); |
| 8372 |
var arrayValueIterator = function arrayValueIterator(array) { |
| 8373 |
return array.map(function(_ref2) { |
| 8374 |
return _ref2.value; |
| 8375 |
}); |
| 8376 |
}; |
| 8377 |
var selectedCpt = function selectedCpt(selectedValue) { |
| 8378 |
setSelected(arrayValueIterator(Array.from(selectedValue))); |
| 8379 |
}; |
| 8380 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(Text$11, { |
| 8381 |
variant: "sm", |
| 8382 |
tag: "p", |
| 8383 |
className: "e-app-export-kit-content__description" |
| 8384 |
}, (0, _wordpress_i18n.__)("Custom Post Type", "elementor")), customPostTypes.length > 0 ? /*#__PURE__*/ react.default.createElement(Select2, { |
| 8385 |
multiple: true, |
| 8386 |
settings: { width: "100%" }, |
| 8387 |
options: customPostTypes, |
| 8388 |
onChange: function onChange(e) { |
| 8389 |
return selectedCpt(e.target.selectedOptions); |
| 8390 |
}, |
| 8391 |
value: selected, |
| 8392 |
placeholder: (0, _wordpress_i18n.__)("Click to select custom post types", "elementor") |
| 8393 |
}) : /*#__PURE__*/ react.default.createElement(TextField, { |
| 8394 |
variant: "outlined", |
| 8395 |
placeholder: (0, _wordpress_i18n.__)("No custom post types in your site...", "elementor"), |
| 8396 |
className: "e-app-export-kit-content__disabled" |
| 8397 |
}), /*#__PURE__*/ react.default.createElement(Text$11, { |
| 8398 |
variant: "sm", |
| 8399 |
tag: "span", |
| 8400 |
className: "e-app-export-kit-content__small-notice" |
| 8401 |
}, (0, _wordpress_i18n.__)("Add the custom posts types to export. The latest 20 items from each type will be included.", "elementor"))); |
| 8402 |
} |
| 8403 |
|
| 8404 |
//#endregion |
| 8405 |
//#region app/assets/js/molecules/go-pro-button.js |
| 8406 |
init_extends(); |
| 8407 |
init_button(); |
| 8408 |
init_utils$4(); |
| 8409 |
function GoProButton(props) { |
| 8410 |
var classes = ["e-app-go-pro-button", props.className]; |
| 8411 |
return /*#__PURE__*/ react.default.createElement(Button$29, _extends({}, props, { |
| 8412 |
className: arrayToClassName(classes), |
| 8413 |
text: props.text |
| 8414 |
})); |
| 8415 |
} |
| 8416 |
GoProButton.propTypes = { |
| 8417 |
className: import_prop_types$55.default.string, |
| 8418 |
text: import_prop_types$55.default.string |
| 8419 |
}; |
| 8420 |
GoProButton.defaultProps = { |
| 8421 |
className: "", |
| 8422 |
variant: "outlined", |
| 8423 |
size: "sm", |
| 8424 |
color: "cta", |
| 8425 |
target: "_blank", |
| 8426 |
rel: "noopener noreferrer", |
| 8427 |
text: (0, _wordpress_i18n.__)("Upgrade Now", "elementor") |
| 8428 |
}; |
| 8429 |
|
| 8430 |
//#endregion |
| 8431 |
//#region app/assets/js/ui/atoms/box.js |
| 8432 |
init_utils$4(); |
| 8433 |
function Box$22(props) { |
| 8434 |
var baseClassName = "eps-box"; |
| 8435 |
var classes = [baseClassName, props.className]; |
| 8436 |
var style = {}; |
| 8437 |
if (Object.prototype.hasOwnProperty.call(props, "padding")) { |
| 8438 |
style["--eps-box-padding"] = pxToRem(props.padding); |
| 8439 |
classes.push(baseClassName + "--padding"); |
| 8440 |
} |
| 8441 |
return /*#__PURE__*/ react.default.createElement("div", { |
| 8442 |
style, |
| 8443 |
className: arrayToClassName(classes) |
| 8444 |
}, props.children); |
| 8445 |
} |
| 8446 |
__name(Box$22, "Box"); |
| 8447 |
Box$22.propTypes = { |
| 8448 |
className: import_prop_types$55.default.string, |
| 8449 |
padding: import_prop_types$55.default.string, |
| 8450 |
children: import_prop_types$55.default.oneOfType([ |
| 8451 |
import_prop_types$55.default.string, |
| 8452 |
import_prop_types$55.default.object, |
| 8453 |
import_prop_types$55.default.arrayOf(import_prop_types$55.default.object) |
| 8454 |
]).isRequired |
| 8455 |
}; |
| 8456 |
Box$22.defaultProps = { className: "" }; |
| 8457 |
|
| 8458 |
//#endregion |
| 8459 |
//#region app/assets/js/ui/molecules/list-item.js |
| 8460 |
init_utils$4(); |
| 8461 |
function ListItem(props) { |
| 8462 |
var baseClassName = "eps-list__item"; |
| 8463 |
var classes = [baseClassName, props.className]; |
| 8464 |
var style; |
| 8465 |
if (Object.prototype.hasOwnProperty.call(props, "padding")) { |
| 8466 |
style = { "--eps-list-item-padding": pxToRem(props.padding) }; |
| 8467 |
classes.push(baseClassName + "--padding"); |
| 8468 |
} |
| 8469 |
return /*#__PURE__*/ react.default.createElement("li", { |
| 8470 |
style, |
| 8471 |
className: arrayToClassName(classes) |
| 8472 |
}, props.children); |
| 8473 |
} |
| 8474 |
ListItem.propTypes = { |
| 8475 |
className: import_prop_types$55.default.string, |
| 8476 |
padding: import_prop_types$55.default.string, |
| 8477 |
children: import_prop_types$55.default.any.isRequired |
| 8478 |
}; |
| 8479 |
ListItem.defaultProps = { className: "" }; |
| 8480 |
|
| 8481 |
//#endregion |
| 8482 |
//#region app/assets/js/ui/molecules/list.js |
| 8483 |
init_utils$4(); |
| 8484 |
function List(props) { |
| 8485 |
var baseClassName = "eps-list"; |
| 8486 |
var classes = [baseClassName, props.className]; |
| 8487 |
var style; |
| 8488 |
if (Object.prototype.hasOwnProperty.call(props, "padding")) { |
| 8489 |
style = { "--eps-list-padding": pxToRem(props.padding) }; |
| 8490 |
classes.push(baseClassName + "--padding"); |
| 8491 |
} |
| 8492 |
if (props.separated) classes.push(baseClassName + "--separated"); |
| 8493 |
return /*#__PURE__*/ react.default.createElement("ul", { |
| 8494 |
style, |
| 8495 |
className: arrayToClassName(classes) |
| 8496 |
}, props.children); |
| 8497 |
} |
| 8498 |
List.propTypes = { |
| 8499 |
className: import_prop_types$55.default.string, |
| 8500 |
divided: import_prop_types$55.default.any, |
| 8501 |
separated: import_prop_types$55.default.any, |
| 8502 |
padding: import_prop_types$55.default.string, |
| 8503 |
children: import_prop_types$55.default.oneOfType([import_prop_types$55.default.object, import_prop_types$55.default.arrayOf(import_prop_types$55.default.object)]).isRequired |
| 8504 |
}; |
| 8505 |
List.defaultProps = { className: "" }; |
| 8506 |
List.Item = ListItem; |
| 8507 |
|
| 8508 |
//#endregion |
| 8509 |
//#region app/modules/import-export/assets/js/shared/kit-content/kit-content.js |
| 8510 |
init_defineProperty$1(); |
| 8511 |
init_slicedToArray(); |
| 8512 |
init_apps_event_tracking(); |
| 8513 |
function ownKeys$25(e, r) { |
| 8514 |
var t = Object.keys(e); |
| 8515 |
if (Object.getOwnPropertySymbols) { |
| 8516 |
var o = Object.getOwnPropertySymbols(e); |
| 8517 |
r && (o = o.filter(function(r) { |
| 8518 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 8519 |
})), t.push.apply(t, o); |
| 8520 |
} |
| 8521 |
return t; |
| 8522 |
} |
| 8523 |
__name(ownKeys$25, "ownKeys"); |
| 8524 |
function _objectSpread$24(e) { |
| 8525 |
for (var r = 1; r < arguments.length; r++) { |
| 8526 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 8527 |
r % 2 ? ownKeys$25(Object(t), !0).forEach(function(r) { |
| 8528 |
_defineProperty$1(e, r, t[r]); |
| 8529 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$25(Object(t)).forEach(function(r) { |
| 8530 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 8531 |
}); |
| 8532 |
} |
| 8533 |
return e; |
| 8534 |
} |
| 8535 |
__name(_objectSpread$24, "_objectSpread"); |
| 8536 |
function KitContent(_ref) { |
| 8537 |
var contentData = _ref.contentData; |
| 8538 |
var hasPro = _ref.hasPro; |
| 8539 |
var _useState2 = _slicedToArray((0, react.useState)({}), 2); |
| 8540 |
var containerHover = _useState2[0]; |
| 8541 |
var setContainerHover = _useState2[1]; |
| 8542 |
var _sharedContext$data = (0, react.useContext)(SharedContext).data; |
| 8543 |
var referrer = _sharedContext$data.referrer; |
| 8544 |
var currentPage = _sharedContext$data.currentPage; |
| 8545 |
var isProExist = hasPro || elementorAppConfig.hasPro; |
| 8546 |
var getTemplateFeatures = function getTemplateFeatures(features, index) { |
| 8547 |
if (!features) return; |
| 8548 |
return /*#__PURE__*/ react.default.createElement(TemplatesFeatures, { |
| 8549 |
features, |
| 8550 |
isLocked: !isProExist, |
| 8551 |
showTooltip: containerHover[index] |
| 8552 |
}); |
| 8553 |
}; |
| 8554 |
var setContainerHoverState = function setContainerHoverState(index, state) { |
| 8555 |
setContainerHover(function(prevState) { |
| 8556 |
return _objectSpread$24(_objectSpread$24({}, prevState), {}, _defineProperty$1({}, index, state)); |
| 8557 |
}); |
| 8558 |
}; |
| 8559 |
var eventTracking = function eventTracking(event, chosenPart) { |
| 8560 |
if ("kit-library" === referrer) { |
| 8561 |
var command = event.target.checked && event.target.checked ? "check" : "uncheck"; |
| 8562 |
appsEventTrackingDispatch("kit-library/".concat(command), { |
| 8563 |
page_source: "import", |
| 8564 |
step: currentPage, |
| 8565 |
event_type: "click", |
| 8566 |
site_part: chosenPart |
| 8567 |
}); |
| 8568 |
} |
| 8569 |
}; |
| 8570 |
if (!contentData.length) return null; |
| 8571 |
return /*#__PURE__*/ react.default.createElement(Box$22, null, /*#__PURE__*/ react.default.createElement(List, { |
| 8572 |
separated: true, |
| 8573 |
className: "e-app-export-kit-content" |
| 8574 |
}, contentData.map(function(_ref2, index) { |
| 8575 |
var _data$features; |
| 8576 |
var type = _ref2.type; |
| 8577 |
var data = _ref2.data; |
| 8578 |
var isLockedFeaturesNoPro = ((_data$features = data.features) === null || _data$features === void 0 ? void 0 : _data$features.locked) && !isProExist; |
| 8579 |
return /*#__PURE__*/ react.default.createElement(List.Item, { |
| 8580 |
padding: "20", |
| 8581 |
key: type, |
| 8582 |
className: "e-app-export-kit-content__item" |
| 8583 |
}, /*#__PURE__*/ react.default.createElement("div", { |
| 8584 |
onMouseEnter: function onMouseEnter() { |
| 8585 |
return isLockedFeaturesNoPro && setContainerHoverState(index, true); |
| 8586 |
}, |
| 8587 |
onMouseLeave: function onMouseLeave() { |
| 8588 |
return isLockedFeaturesNoPro && setContainerHoverState(index, false); |
| 8589 |
} |
| 8590 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 8591 |
container: true, |
| 8592 |
noWrap: true |
| 8593 |
}, /*#__PURE__*/ react.default.createElement(KitContentCheckbox, { |
| 8594 |
type, |
| 8595 |
className: "e-app-export-kit-content__checkbox", |
| 8596 |
onCheck: function onCheck(event, chosenPart) { |
| 8597 |
eventTracking(event, chosenPart); |
| 8598 |
} |
| 8599 |
}), /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 8600 |
item: true, |
| 8601 |
container: true |
| 8602 |
}, /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 8603 |
variant: "h4", |
| 8604 |
tag: "h3", |
| 8605 |
className: "e-app-export-kit-content__title" |
| 8606 |
}, data.title), /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 8607 |
item: true, |
| 8608 |
container: true, |
| 8609 |
direction: isLockedFeaturesNoPro ? "row" : "column", |
| 8610 |
alignItems: "baseline" |
| 8611 |
}, /*#__PURE__*/ react.default.createElement(Text$11, { |
| 8612 |
variant: "sm", |
| 8613 |
tag: "p", |
| 8614 |
className: "e-app-export-kit-content__description" |
| 8615 |
}, data.description || getTemplateFeatures(data.features, index)), "content" === type && /*#__PURE__*/ react.default.createElement(CptSelectBox, null), isLockedFeaturesNoPro && /*#__PURE__*/ react.default.createElement(GoProButton, { |
| 8616 |
className: "e-app-export-kit-content__go-pro-button", |
| 8617 |
url: "https://go.elementor.com/go-pro-import-export" |
| 8618 |
})))))); |
| 8619 |
}))); |
| 8620 |
} |
| 8621 |
KitContent.propTypes = { |
| 8622 |
className: import_prop_types$55.default.string, |
| 8623 |
contentData: import_prop_types$55.default.array.isRequired, |
| 8624 |
hasPro: import_prop_types$55.default.bool |
| 8625 |
}; |
| 8626 |
KitContent.defaultProps = { className: "" }; |
| 8627 |
|
| 8628 |
//#endregion |
| 8629 |
//#region app/modules/import-export/assets/js/shared/cpt-select-box/cpt-object-to-options-array.js |
| 8630 |
var cptObjectToOptionsArray = function cptObjectToOptionsArray(cptObject) { |
| 8631 |
var label = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "label"; |
| 8632 |
var cptOptionsArray = []; |
| 8633 |
if (cptObject && label) Object.keys(cptObject).forEach(function(key) { |
| 8634 |
return cptOptionsArray.push({ |
| 8635 |
label: cptObject[key][label], |
| 8636 |
value: key |
| 8637 |
}); |
| 8638 |
}); |
| 8639 |
return cptOptionsArray; |
| 8640 |
}; |
| 8641 |
|
| 8642 |
//#endregion |
| 8643 |
//#region app/modules/import-export/assets/js/pages/import/import-content/components/import-content-display/import-content-display.js |
| 8644 |
function ImportContentDisplay(_ref) { |
| 8645 |
var manifest = _ref.manifest; |
| 8646 |
var hasPro = _ref.hasPro; |
| 8647 |
var hasPlugins = _ref.hasPlugins; |
| 8648 |
var isAllRequiredPluginsSelected = _ref.isAllRequiredPluginsSelected; |
| 8649 |
var onResetProcess = _ref.onResetProcess; |
| 8650 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 8651 |
var kitData = kitContentData$1.filter(function(_ref2) { |
| 8652 |
var type = _ref2.type; |
| 8653 |
var data = manifest === null || manifest === void 0 ? void 0 : manifest["settings" === type ? "site-settings" : type]; |
| 8654 |
return !!(Array.isArray(data) ? data.length : data); |
| 8655 |
}); |
| 8656 |
(0, react.useEffect)(function() { |
| 8657 |
sharedContext.dispatch({ |
| 8658 |
type: "SET_CPT", |
| 8659 |
payload: cptObjectToOptionsArray(manifest === null || manifest === void 0 ? void 0 : manifest["custom-post-type-title"], "label") |
| 8660 |
}); |
| 8661 |
}, []); |
| 8662 |
if (!kitData.length && hasPlugins) return /*#__PURE__*/ react.default.createElement(Notice, { |
| 8663 |
color: "info", |
| 8664 |
label: (0, _wordpress_i18n.__)("Note:", "elementor") |
| 8665 |
}, (0, _wordpress_i18n.__)("The Website Kit you’re using contains plugins for functionality, but no content or pages, etc.", "elementor")); |
| 8666 |
if (!kitData.length) return /*#__PURE__*/ react.default.createElement(Notice, { color: "danger" }, (0, _wordpress_i18n.__)("You can’t use this Website Kit because it doesn’t contain any content, pages, etc. Try again with a different file.", "elementor"), " ", /*#__PURE__*/ react.default.createElement(InlineLink, { onClick: onResetProcess }, (0, _wordpress_i18n.__)("Go Back", "elementor"))); |
| 8667 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, !isAllRequiredPluginsSelected && /*#__PURE__*/ react.default.createElement(Notice, { |
| 8668 |
color: "warning", |
| 8669 |
label: (0, _wordpress_i18n.__)("Required plugins are still missing.", "elementor"), |
| 8670 |
className: "e-app-import-content__plugins-notice" |
| 8671 |
}, (0, _wordpress_i18n.__)("If you don't include them, this kit may not work properly.", "elementor"), " ", /*#__PURE__*/ react.default.createElement(InlineLink, { url: "/import/plugins" }, (0, _wordpress_i18n.__)("Go Back", "elementor"))), /*#__PURE__*/ react.default.createElement(KitContent, { |
| 8672 |
contentData: kitData, |
| 8673 |
hasPro |
| 8674 |
})); |
| 8675 |
} |
| 8676 |
ImportContentDisplay.propTypes = { |
| 8677 |
manifest: import_prop_types$55.default.object, |
| 8678 |
hasPro: import_prop_types$55.default.bool, |
| 8679 |
hasPlugins: import_prop_types$55.default.bool, |
| 8680 |
isAllRequiredPluginsSelected: import_prop_types$55.default.bool, |
| 8681 |
onResetProcess: import_prop_types$55.default.func |
| 8682 |
}; |
| 8683 |
|
| 8684 |
//#endregion |
| 8685 |
//#region app/assets/js/organisms/wizard-footer.js |
| 8686 |
init_extends(); |
| 8687 |
init_utils$4(); |
| 8688 |
function WizardFooter(props) { |
| 8689 |
var baseClassName = "e-app-wizard-footer"; |
| 8690 |
var classes = [baseClassName, props.className]; |
| 8691 |
if (props.separator) classes.push(baseClassName + "__separator"); |
| 8692 |
return /*#__PURE__*/ react.default.createElement(Grid$14, _extends({ container: true }, props, { className: arrayToClassName(classes) }), props.children); |
| 8693 |
} |
| 8694 |
WizardFooter.propTypes = { |
| 8695 |
className: import_prop_types$55.default.string, |
| 8696 |
justify: import_prop_types$55.default.any, |
| 8697 |
separator: import_prop_types$55.default.any, |
| 8698 |
children: import_prop_types$55.default.oneOfType([ |
| 8699 |
import_prop_types$55.default.string, |
| 8700 |
import_prop_types$55.default.object, |
| 8701 |
import_prop_types$55.default.arrayOf(import_prop_types$55.default.object) |
| 8702 |
]).isRequired |
| 8703 |
}; |
| 8704 |
WizardFooter.defaultProps = { className: "" }; |
| 8705 |
|
| 8706 |
//#endregion |
| 8707 |
//#region app/modules/import-export/assets/js/shared/actions-footer/actions-footer.js |
| 8708 |
function ActionsFooter(props) { |
| 8709 |
return /*#__PURE__*/ react.default.createElement(WizardFooter, { |
| 8710 |
separator: true, |
| 8711 |
justify: "end", |
| 8712 |
className: props.className |
| 8713 |
}, props.children); |
| 8714 |
} |
| 8715 |
ActionsFooter.propTypes = { |
| 8716 |
children: import_prop_types$55.default.any, |
| 8717 |
className: import_prop_types$55.default.string |
| 8718 |
}; |
| 8719 |
|
| 8720 |
//#endregion |
| 8721 |
//#region app/modules/import-export/assets/js/pages/import/import-content/components/import-content-footer/import-content-footer.js |
| 8722 |
init_es$1(); |
| 8723 |
init_button(); |
| 8724 |
function ImportContentFooter(_ref) { |
| 8725 |
var hasPlugins = _ref.hasPlugins; |
| 8726 |
var hasConflicts = _ref.hasConflicts; |
| 8727 |
var isImportAllowed = _ref.isImportAllowed; |
| 8728 |
var onResetProcess = _ref.onResetProcess; |
| 8729 |
var onPreviousClick = _ref.onPreviousClick; |
| 8730 |
var onImportClick = _ref.onImportClick; |
| 8731 |
var navigate = useNavigate(); |
| 8732 |
var getNextPageUrl = function getNextPageUrl() { |
| 8733 |
if (hasConflicts) return "import/resolver"; |
| 8734 |
else if (hasPlugins) return "import/plugins-activation"; |
| 8735 |
return "import/process"; |
| 8736 |
}; |
| 8737 |
return /*#__PURE__*/ react.default.createElement(ActionsFooter, null, /*#__PURE__*/ react.default.createElement(Button$29, { |
| 8738 |
text: (0, _wordpress_i18n.__)("Previous", "elementor"), |
| 8739 |
variant: "contained", |
| 8740 |
onClick: function onClick() { |
| 8741 |
onPreviousClick === null || onPreviousClick === void 0 || onPreviousClick(); |
| 8742 |
if (hasPlugins) navigate("import/plugins/"); |
| 8743 |
else onResetProcess(); |
| 8744 |
} |
| 8745 |
}), /*#__PURE__*/ react.default.createElement(Button$29, { |
| 8746 |
variant: "contained", |
| 8747 |
text: (0, _wordpress_i18n.__)("Import", "elementor"), |
| 8748 |
color: isImportAllowed ? "primary" : "disabled", |
| 8749 |
onClick: function onClick() { |
| 8750 |
onImportClick === null || onImportClick === void 0 || onImportClick(); |
| 8751 |
return isImportAllowed && navigate(getNextPageUrl()); |
| 8752 |
} |
| 8753 |
})); |
| 8754 |
} |
| 8755 |
ImportContentFooter.propTypes = { |
| 8756 |
hasPlugins: import_prop_types$55.default.bool, |
| 8757 |
hasConflicts: import_prop_types$55.default.bool, |
| 8758 |
isImportAllowed: import_prop_types$55.default.bool, |
| 8759 |
onResetProcess: import_prop_types$55.default.func.isRequired, |
| 8760 |
onPreviousClick: import_prop_types$55.default.func, |
| 8761 |
onImportClick: import_prop_types$55.default.func |
| 8762 |
}; |
| 8763 |
|
| 8764 |
//#endregion |
| 8765 |
//#region app/modules/import-export/assets/js/pages/import/hooks/use-import-actions.js |
| 8766 |
init_es$1(); |
| 8767 |
init_use_action(); |
| 8768 |
function useImportActions() { |
| 8769 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 8770 |
var navigate = useNavigate(); |
| 8771 |
var backToDashboard = useAction().backToDashboard; |
| 8772 |
var isStartedFromKitLibrary = "kit-library" === sharedContext.data.referrer; |
| 8773 |
return { |
| 8774 |
navigateToMainScreen: function navigateToMainScreen() { |
| 8775 |
navigate(isStartedFromKitLibrary ? "/kit-library" : "/import"); |
| 8776 |
}, |
| 8777 |
closeApp: function closeApp() { |
| 8778 |
if (isStartedFromKitLibrary) navigate("/kit-library"); |
| 8779 |
else backToDashboard(); |
| 8780 |
} |
| 8781 |
}; |
| 8782 |
} |
| 8783 |
|
| 8784 |
//#endregion |
| 8785 |
//#region app/modules/import-export/assets/js/pages/import/import-content/import-content.js |
| 8786 |
init_apps_event_tracking(); |
| 8787 |
function ImportContent() { |
| 8788 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 8789 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 8790 |
var _sharedContext$data = sharedContext.data; |
| 8791 |
var referrer = _sharedContext$data.referrer; |
| 8792 |
var includes = _sharedContext$data.includes; |
| 8793 |
var currentPage = _sharedContext$data.currentPage; |
| 8794 |
var _importContext$data = importContext.data; |
| 8795 |
var plugins = _importContext$data.plugins; |
| 8796 |
var requiredPlugins = _importContext$data.requiredPlugins; |
| 8797 |
var uploadedData = _importContext$data.uploadedData; |
| 8798 |
var file = _importContext$data.file; |
| 8799 |
var isProInstalledDuringProcess = _importContext$data.isProInstalledDuringProcess; |
| 8800 |
var navigateToMainScreen = useImportActions().navigateToMainScreen; |
| 8801 |
var handleResetProcess = function handleResetProcess() { |
| 8802 |
return importContext.dispatch({ |
| 8803 |
type: "SET_FILE", |
| 8804 |
payload: null |
| 8805 |
}); |
| 8806 |
}; |
| 8807 |
var eventTracking = function eventTracking(command) { |
| 8808 |
if ("kit-library" === referrer) appsEventTrackingDispatch(command, { |
| 8809 |
page_source: "import", |
| 8810 |
step: currentPage, |
| 8811 |
event_type: "click" |
| 8812 |
}); |
| 8813 |
}; |
| 8814 |
var getFooter = function getFooter() { |
| 8815 |
return /*#__PURE__*/ react.default.createElement(ImportContentFooter, { |
| 8816 |
hasPlugins: !!plugins.length, |
| 8817 |
hasConflicts: !!(includes.includes("templates") && uploadedData !== null && uploadedData !== void 0 && uploadedData.conflicts && Object.keys(uploadedData.conflicts).length), |
| 8818 |
isImportAllowed: !!(plugins.length || includes.length), |
| 8819 |
onResetProcess: handleResetProcess, |
| 8820 |
onPreviousClick: function onPreviousClick() { |
| 8821 |
return eventTracking("kit-library/go-back"); |
| 8822 |
}, |
| 8823 |
onImportClick: function onImportClick() { |
| 8824 |
return eventTracking("kit-library/approve-import"); |
| 8825 |
} |
| 8826 |
}); |
| 8827 |
}; |
| 8828 |
(0, react.useEffect)(function() { |
| 8829 |
sharedContext.dispatch({ |
| 8830 |
type: "SET_CURRENT_PAGE_NAME", |
| 8831 |
payload: ImportContent.name |
| 8832 |
}); |
| 8833 |
}, []); |
| 8834 |
(0, react.useEffect)(function() { |
| 8835 |
if (!file) navigateToMainScreen(); |
| 8836 |
}, [file]); |
| 8837 |
return /*#__PURE__*/ react.default.createElement(Layout, { |
| 8838 |
type: "import", |
| 8839 |
footer: getFooter() |
| 8840 |
}, /*#__PURE__*/ react.default.createElement("section", { className: "e-app-import-content" }, /*#__PURE__*/ react.default.createElement(PageHeader$1, { |
| 8841 |
heading: (0, _wordpress_i18n.__)("Select which parts you want to apply", "elementor"), |
| 8842 |
description: (0, _wordpress_i18n.__)("All items are already selected by default. Uncheck the ones you don't want.", "elementor") |
| 8843 |
}), /*#__PURE__*/ react.default.createElement(ImportContentDisplay, { |
| 8844 |
manifest: uploadedData === null || uploadedData === void 0 ? void 0 : uploadedData.manifest, |
| 8845 |
hasPro: isProInstalledDuringProcess, |
| 8846 |
hasPlugins: !!requiredPlugins.length, |
| 8847 |
isAllRequiredPluginsSelected: requiredPlugins.length === plugins.length, |
| 8848 |
onResetProcess: handleResetProcess |
| 8849 |
}))); |
| 8850 |
} |
| 8851 |
|
| 8852 |
//#endregion |
| 8853 |
//#region app/modules/import-export/assets/js/pages/import/import-resolver/components/conflict/components/conflict-checkbox/conflict-checkbox.js |
| 8854 |
function ConflictCheckbox(props) { |
| 8855 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 8856 |
var isSelected = function isSelected() { |
| 8857 |
return importContext.data.overrideConditions.includes(props.id); |
| 8858 |
}; |
| 8859 |
var updateOverrideCondition = function updateOverrideCondition(event) { |
| 8860 |
var isChecked = event.target.checked; |
| 8861 |
var actionType = isChecked ? "ADD_OVERRIDE_CONDITION" : "REMOVE_OVERRIDE_CONDITION"; |
| 8862 |
if (props.onCheck) props.onCheck(isChecked); |
| 8863 |
importContext.dispatch({ |
| 8864 |
type: actionType, |
| 8865 |
payload: props.id |
| 8866 |
}); |
| 8867 |
}; |
| 8868 |
(0, react.useEffect)(function() { |
| 8869 |
if (!importContext.data.overrideConditions.length) importContext.dispatch({ |
| 8870 |
type: "ADD_OVERRIDE_CONDITION", |
| 8871 |
payload: props.id |
| 8872 |
}); |
| 8873 |
}, []); |
| 8874 |
return /*#__PURE__*/ react.default.createElement(Checkbox$5, { |
| 8875 |
checked: isSelected(), |
| 8876 |
onChange: updateOverrideCondition, |
| 8877 |
className: props.className |
| 8878 |
}); |
| 8879 |
} |
| 8880 |
ConflictCheckbox.propTypes = { |
| 8881 |
className: import_prop_types$55.default.string, |
| 8882 |
id: import_prop_types$55.default.number.isRequired, |
| 8883 |
onCheck: import_prop_types$55.default.func |
| 8884 |
}; |
| 8885 |
ConflictCheckbox.defaultProps = { className: "" }; |
| 8886 |
|
| 8887 |
//#endregion |
| 8888 |
//#region app/modules/import-export/assets/js/pages/import/import-resolver/components/conflict/conflict.js |
| 8889 |
init_button(); |
| 8890 |
init_apps_event_tracking(); |
| 8891 |
function Conflict(props) { |
| 8892 |
var _importContext$data$u; |
| 8893 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 8894 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 8895 |
var manifest = (_importContext$data$u = importContext.data.uploadedData) === null || _importContext$data$u === void 0 ? void 0 : _importContext$data$u.manifest; |
| 8896 |
var currentPage = sharedContext.data.currentPage; |
| 8897 |
var getConflictTitle = function getConflictTitle(id) { |
| 8898 |
var _elementorAppConfig$i; |
| 8899 |
var templateType = manifest.templates[id].doc_type; |
| 8900 |
var summaryTitle = (_elementorAppConfig$i = elementorAppConfig["import-export"].summaryTitles.templates) === null || _elementorAppConfig$i === void 0 ? void 0 : _elementorAppConfig$i[templateType]; |
| 8901 |
return (summaryTitle === null || summaryTitle === void 0 ? void 0 : summaryTitle.single) || templateType; |
| 8902 |
}; |
| 8903 |
var getEditTemplateButton = function getEditTemplateButton(editUrl, title) { |
| 8904 |
return /*#__PURE__*/ react.default.createElement(Button$29, { |
| 8905 |
className: "e-app-import-resolver-conflicts__edit-template", |
| 8906 |
url: editUrl, |
| 8907 |
target: "_blank", |
| 8908 |
icon: "eicon-editor-external-link", |
| 8909 |
text: (0, _wordpress_i18n.__)("Edit Template", "elementor"), |
| 8910 |
hideText: true, |
| 8911 |
onClick: function onClick() { |
| 8912 |
if (props.onClick) props.onClick(title); |
| 8913 |
} |
| 8914 |
}); |
| 8915 |
}; |
| 8916 |
var isImportedAssetSelected = function isImportedAssetSelected(importedAssetId) { |
| 8917 |
return importContext.data.overrideConditions.includes(importedAssetId); |
| 8918 |
}; |
| 8919 |
var getAssetClassName = function getAssetClassName(isActive) { |
| 8920 |
var classes = ["e-app-import-resolver-conflicts__asset"]; |
| 8921 |
if (isActive) classes.push("active"); |
| 8922 |
return classes.join(" "); |
| 8923 |
}; |
| 8924 |
var getImportedAssetClasses = function getImportedAssetClasses(importedAssetId) { |
| 8925 |
return getAssetClassName(isImportedAssetSelected(importedAssetId)); |
| 8926 |
}; |
| 8927 |
var getExistingAssetClasses = function getExistingAssetClasses(importedAssetId) { |
| 8928 |
return getAssetClassName(!isImportedAssetSelected(importedAssetId)); |
| 8929 |
}; |
| 8930 |
var eventTracking = function eventTracking(command, title) { |
| 8931 |
return appsEventTrackingDispatch("kit-library/".concat(command), { |
| 8932 |
item: title, |
| 8933 |
page_source: "import", |
| 8934 |
step: currentPage, |
| 8935 |
event_type: "click" |
| 8936 |
}); |
| 8937 |
}; |
| 8938 |
return /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 8939 |
container: true, |
| 8940 |
noWrap: true |
| 8941 |
}, /*#__PURE__*/ react.default.createElement(ConflictCheckbox, { |
| 8942 |
id: props.importedId, |
| 8943 |
type: "main-type", |
| 8944 |
className: "e-app-import-resolver-conflicts__checkbox", |
| 8945 |
onCheck: function onCheck(isChecked) { |
| 8946 |
eventTracking(isChecked && isChecked ? "check" : "uncheck", props.conflictData.template_title); |
| 8947 |
} |
| 8948 |
}), /*#__PURE__*/ react.default.createElement(Grid$14, { item: true }, /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 8949 |
variant: "h5", |
| 8950 |
tag: "h4", |
| 8951 |
className: "e-app-import-resolver-conflicts__title" |
| 8952 |
}, getConflictTitle(props.importedId)), /*#__PURE__*/ react.default.createElement(Grid$14, { item: true }, /*#__PURE__*/ react.default.createElement(Text$11, { |
| 8953 |
variant: "sm", |
| 8954 |
tag: "span", |
| 8955 |
className: getImportedAssetClasses(props.importedId) |
| 8956 |
}, (0, _wordpress_i18n.__)("Imported", "elementor"), ": ", manifest.templates[props.importedId].title), /*#__PURE__*/ react.default.createElement(Text$11, { |
| 8957 |
style: true, |
| 8958 |
variant: "sm", |
| 8959 |
tag: "span", |
| 8960 |
className: getExistingAssetClasses(props.importedId) |
| 8961 |
}, (0, _wordpress_i18n.__)("Existing", "elementor"), ": ", props.conflictData.template_title, " ", getEditTemplateButton(props.conflictData.edit_url, props.conflictData.template_title))))); |
| 8962 |
} |
| 8963 |
Conflict.propTypes = { |
| 8964 |
importedId: import_prop_types$55.default.number, |
| 8965 |
conflictData: import_prop_types$55.default.object, |
| 8966 |
onClick: import_prop_types$55.default.func |
| 8967 |
}; |
| 8968 |
|
| 8969 |
//#endregion |
| 8970 |
//#region app/assets/js/ui/card/card-header.js |
| 8971 |
init_utils$4(); |
| 8972 |
function CardHeader$4(props) { |
| 8973 |
var classNameBase = "eps-card__header"; |
| 8974 |
var classes = [classNameBase, props.className]; |
| 8975 |
var style = {}; |
| 8976 |
if (Object.prototype.hasOwnProperty.call(props, "padding")) { |
| 8977 |
style["--eps-card-header-padding"] = pxToRem(props.padding); |
| 8978 |
classes.push(classNameBase + "--padding"); |
| 8979 |
} |
| 8980 |
return /*#__PURE__*/ react.default.createElement("header", { |
| 8981 |
className: arrayToClassName(classes), |
| 8982 |
style |
| 8983 |
}, props.children); |
| 8984 |
} |
| 8985 |
__name(CardHeader$4, "CardHeader"); |
| 8986 |
CardHeader$4.propTypes = { |
| 8987 |
className: import_prop_types$55.default.string, |
| 8988 |
padding: import_prop_types$55.default.string, |
| 8989 |
passive: import_prop_types$55.default.bool, |
| 8990 |
active: import_prop_types$55.default.bool, |
| 8991 |
children: import_prop_types$55.default.any.isRequired |
| 8992 |
}; |
| 8993 |
CardHeader$4.defaultProps = { className: "" }; |
| 8994 |
|
| 8995 |
//#endregion |
| 8996 |
//#region app/assets/js/ui/card/card-body.js |
| 8997 |
init_utils$4(); |
| 8998 |
function CardBody$4(props) { |
| 8999 |
var classNameBase = "eps-card__body"; |
| 9000 |
var classes = [classNameBase, props.className]; |
| 9001 |
var style = {}; |
| 9002 |
if (Object.prototype.hasOwnProperty.call(props, "padding")) { |
| 9003 |
style["--eps-card-body-padding"] = pxToRem(props.padding); |
| 9004 |
classes.push(classNameBase + "--padding"); |
| 9005 |
} |
| 9006 |
return /*#__PURE__*/ react.default.createElement("main", { |
| 9007 |
className: arrayToClassName(classes), |
| 9008 |
style |
| 9009 |
}, props.children); |
| 9010 |
} |
| 9011 |
__name(CardBody$4, "CardBody"); |
| 9012 |
CardBody$4.propTypes = { |
| 9013 |
className: import_prop_types$55.default.string, |
| 9014 |
padding: import_prop_types$55.default.string, |
| 9015 |
passive: import_prop_types$55.default.bool, |
| 9016 |
active: import_prop_types$55.default.bool, |
| 9017 |
children: import_prop_types$55.default.any.isRequired |
| 9018 |
}; |
| 9019 |
CardBody$4.defaultProps = { className: "" }; |
| 9020 |
|
| 9021 |
//#endregion |
| 9022 |
//#region app/assets/js/ui/card/card-image.js |
| 9023 |
function CardImage$5(props) { |
| 9024 |
var image = /*#__PURE__*/ react.default.createElement("img", { |
| 9025 |
src: props.src, |
| 9026 |
alt: props.alt, |
| 9027 |
className: "eps-card__image", |
| 9028 |
loading: "lazy", |
| 9029 |
onError: props.onError |
| 9030 |
}); |
| 9031 |
return /*#__PURE__*/ react.default.createElement("figure", { className: "eps-card__figure ".concat(props.className) }, image, props.children); |
| 9032 |
} |
| 9033 |
__name(CardImage$5, "CardImage"); |
| 9034 |
CardImage$5.propTypes = { |
| 9035 |
className: import_prop_types$55.default.string, |
| 9036 |
src: import_prop_types$55.default.string.isRequired, |
| 9037 |
alt: import_prop_types$55.default.string.isRequired, |
| 9038 |
children: import_prop_types$55.default.any, |
| 9039 |
onError: import_prop_types$55.default.func |
| 9040 |
}; |
| 9041 |
CardImage$5.defaultProps = { |
| 9042 |
className: "", |
| 9043 |
onError: function onError() {} |
| 9044 |
}; |
| 9045 |
|
| 9046 |
//#endregion |
| 9047 |
//#region app/assets/js/ui/card/card-overlay.js |
| 9048 |
function CardOverlay$4(props) { |
| 9049 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-card__image-overlay ".concat(props.className) }, props.children); |
| 9050 |
} |
| 9051 |
__name(CardOverlay$4, "CardOverlay"); |
| 9052 |
CardOverlay$4.propTypes = { |
| 9053 |
className: import_prop_types$55.default.string, |
| 9054 |
children: import_prop_types$55.default.object.isRequired |
| 9055 |
}; |
| 9056 |
CardOverlay$4.defaultProps = { className: "" }; |
| 9057 |
|
| 9058 |
//#endregion |
| 9059 |
//#region app/assets/js/ui/card/card-footer.js |
| 9060 |
init_utils$4(); |
| 9061 |
function CardFooter(props) { |
| 9062 |
var classNameBase = "eps-card__footer"; |
| 9063 |
var classes = [classNameBase, props.className]; |
| 9064 |
var style = {}; |
| 9065 |
if (Object.prototype.hasOwnProperty.call(props, "padding")) { |
| 9066 |
style["--eps-card-footer-padding"] = pxToRem(props.padding); |
| 9067 |
classes.push(classNameBase + "--padding"); |
| 9068 |
} |
| 9069 |
return /*#__PURE__*/ react.default.createElement("footer", { |
| 9070 |
className: arrayToClassName(classes), |
| 9071 |
style |
| 9072 |
}, props.children); |
| 9073 |
} |
| 9074 |
CardFooter.propTypes = { |
| 9075 |
className: import_prop_types$55.default.string, |
| 9076 |
padding: import_prop_types$55.default.string, |
| 9077 |
passive: import_prop_types$55.default.bool, |
| 9078 |
active: import_prop_types$55.default.bool, |
| 9079 |
children: import_prop_types$55.default.object.isRequired |
| 9080 |
}; |
| 9081 |
CardFooter.defaultProps = { className: "" }; |
| 9082 |
|
| 9083 |
//#endregion |
| 9084 |
//#region app/assets/js/ui/card/card-headline.js |
| 9085 |
init_utils$4(); |
| 9086 |
function CardHeadline(props) { |
| 9087 |
var classes = ["eps-card__headline", props.className]; |
| 9088 |
return /*#__PURE__*/ react.default.createElement("h4", { className: arrayToClassName(classes) }, props.children); |
| 9089 |
} |
| 9090 |
CardHeadline.propTypes = { |
| 9091 |
className: import_prop_types$55.default.string, |
| 9092 |
children: import_prop_types$55.default.any.isRequired |
| 9093 |
}; |
| 9094 |
CardHeadline.defaultProps = { className: "" }; |
| 9095 |
|
| 9096 |
//#endregion |
| 9097 |
//#region app/assets/js/ui/card/card-divider.js |
| 9098 |
init_utils$4(); |
| 9099 |
function CardDivider(props) { |
| 9100 |
var classes = ["eps-card__divider", props.className]; |
| 9101 |
return /*#__PURE__*/ react.default.createElement("hr", { className: arrayToClassName(classes) }); |
| 9102 |
} |
| 9103 |
CardDivider.propTypes = { className: import_prop_types$55.default.string }; |
| 9104 |
CardDivider.defaultProps = { className: "" }; |
| 9105 |
|
| 9106 |
//#endregion |
| 9107 |
//#region app/assets/js/ui/card/card.js |
| 9108 |
var Card$4 = react.default.forwardRef(function(props, ref) { |
| 9109 |
return /*#__PURE__*/ react.default.createElement("article", { |
| 9110 |
className: "eps-card ".concat(props.className), |
| 9111 |
ref |
| 9112 |
}, props.children); |
| 9113 |
}); |
| 9114 |
Card$4.propTypes = { |
| 9115 |
type: import_prop_types$55.default.string, |
| 9116 |
className: import_prop_types$55.default.string, |
| 9117 |
children: import_prop_types$55.default.any |
| 9118 |
}; |
| 9119 |
Card$4.defaultProps = { className: "" }; |
| 9120 |
Card$4.displayName = "Card"; |
| 9121 |
Card$4.Header = CardHeader$4; |
| 9122 |
Card$4.Body = CardBody$4; |
| 9123 |
Card$4.Image = CardImage$5; |
| 9124 |
Card$4.Overlay = CardOverlay$4; |
| 9125 |
Card$4.Footer = CardFooter; |
| 9126 |
Card$4.Headline = CardHeadline; |
| 9127 |
Card$4.Divider = CardDivider; |
| 9128 |
|
| 9129 |
//#endregion |
| 9130 |
//#region app/assets/js/molecules/collapse-context.js |
| 9131 |
var CollapseContext = react.default.createContext(); |
| 9132 |
|
| 9133 |
//#endregion |
| 9134 |
//#region app/assets/js/molecules/collapse-toggle.js |
| 9135 |
init_defineProperty$1(); |
| 9136 |
init_utils$4(); |
| 9137 |
function CollapseToggle(props) { |
| 9138 |
var context = (0, react.useContext)(CollapseContext); |
| 9139 |
var style = { "--e-app-collapse-toggle-icon-spacing": pxToRem(props.iconSpacing) }; |
| 9140 |
var classNameBase = "e-app-collapse-toggle"; |
| 9141 |
var attrs = { |
| 9142 |
style, |
| 9143 |
className: arrayToClassName([classNameBase, _defineProperty$1({}, classNameBase + "--active", props.active)]) |
| 9144 |
}; |
| 9145 |
if (props.active) attrs.onClick = function() { |
| 9146 |
return context.toggle(); |
| 9147 |
}; |
| 9148 |
return /*#__PURE__*/ react.default.createElement("div", attrs, props.children, props.active && props.showIcon && /*#__PURE__*/ react.default.createElement("i", { className: "eicon-caret-down e-app-collapse-toggle__icon" })); |
| 9149 |
} |
| 9150 |
CollapseToggle.propTypes = { |
| 9151 |
className: import_prop_types$55.default.string, |
| 9152 |
iconSpacing: import_prop_types$55.default.number, |
| 9153 |
showIcon: import_prop_types$55.default.bool, |
| 9154 |
active: import_prop_types$55.default.bool, |
| 9155 |
children: import_prop_types$55.default.any |
| 9156 |
}; |
| 9157 |
CollapseToggle.defaultProps = { |
| 9158 |
className: "", |
| 9159 |
iconSpacing: 20, |
| 9160 |
showIcon: true, |
| 9161 |
active: true |
| 9162 |
}; |
| 9163 |
|
| 9164 |
//#endregion |
| 9165 |
//#region app/assets/js/molecules/collapse-content.js |
| 9166 |
function CollapseContent(props) { |
| 9167 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-app-collapse-content" }, props.children); |
| 9168 |
} |
| 9169 |
CollapseContent.propTypes = { |
| 9170 |
className: import_prop_types$55.default.string, |
| 9171 |
children: import_prop_types$55.default.any |
| 9172 |
}; |
| 9173 |
CollapseContent.defaultProps = { className: "" }; |
| 9174 |
|
| 9175 |
//#endregion |
| 9176 |
//#region app/assets/js/molecules/collapse.js |
| 9177 |
init_defineProperty$1(); |
| 9178 |
init_slicedToArray(); |
| 9179 |
init_utils$4(); |
| 9180 |
function Collapse$1(props) { |
| 9181 |
var _useState2 = _slicedToArray((0, react.useState)(props.isOpened), 2); |
| 9182 |
var isOpened = _useState2[0]; |
| 9183 |
var setIsOpened = _useState2[1]; |
| 9184 |
var classNameBase = "e-app-collapse"; |
| 9185 |
var classes = [ |
| 9186 |
classNameBase, |
| 9187 |
props.className, |
| 9188 |
_defineProperty$1({}, classNameBase + "--opened", isOpened) |
| 9189 |
]; |
| 9190 |
var toggle = function toggle() { |
| 9191 |
return setIsOpened(function(prevState) { |
| 9192 |
return !prevState; |
| 9193 |
}); |
| 9194 |
}; |
| 9195 |
(0, react.useEffect)(function() { |
| 9196 |
if (props.isOpened !== isOpened) setIsOpened(props.isOpened); |
| 9197 |
}, [props.isOpened]); |
| 9198 |
(0, react.useEffect)(function() { |
| 9199 |
if (props.onChange) props.onChange(isOpened); |
| 9200 |
}, [isOpened]); |
| 9201 |
return /*#__PURE__*/ react.default.createElement(CollapseContext.Provider, { value: { toggle } }, /*#__PURE__*/ react.default.createElement("div", { className: arrayToClassName(classes) }, props.children)); |
| 9202 |
} |
| 9203 |
__name(Collapse$1, "Collapse"); |
| 9204 |
Collapse$1.propTypes = { |
| 9205 |
className: import_prop_types$55.default.string, |
| 9206 |
isOpened: import_prop_types$55.default.bool, |
| 9207 |
onChange: import_prop_types$55.default.func, |
| 9208 |
children: import_prop_types$55.default.oneOfType([import_prop_types$55.default.node, import_prop_types$55.default.arrayOf(import_prop_types$55.default.node)]) |
| 9209 |
}; |
| 9210 |
Collapse$1.defaultProps = { |
| 9211 |
className: "", |
| 9212 |
isOpened: false |
| 9213 |
}; |
| 9214 |
Collapse$1.Toggle = CollapseToggle; |
| 9215 |
Collapse$1.Content = CollapseContent; |
| 9216 |
|
| 9217 |
//#endregion |
| 9218 |
//#region app/assets/js/ui/panel/panel-header.js |
| 9219 |
init_utils$4(); |
| 9220 |
function PanelHeader(props) { |
| 9221 |
return /*#__PURE__*/ react.default.createElement(Collapse$1.Toggle, { |
| 9222 |
active: props.toggle, |
| 9223 |
showIcon: props.showIcon |
| 9224 |
}, /*#__PURE__*/ react.default.createElement(Card$4.Header, { |
| 9225 |
padding: "20", |
| 9226 |
className: arrayToClassName(["eps-panel__header", props.className]) |
| 9227 |
}, props.children)); |
| 9228 |
} |
| 9229 |
PanelHeader.propTypes = { |
| 9230 |
className: import_prop_types$55.default.string, |
| 9231 |
padding: import_prop_types$55.default.string, |
| 9232 |
toggle: import_prop_types$55.default.bool, |
| 9233 |
showIcon: import_prop_types$55.default.bool, |
| 9234 |
children: import_prop_types$55.default.any.isRequired |
| 9235 |
}; |
| 9236 |
PanelHeader.defaultProps = { |
| 9237 |
className: "", |
| 9238 |
padding: "20", |
| 9239 |
toggle: true, |
| 9240 |
showIcon: true |
| 9241 |
}; |
| 9242 |
|
| 9243 |
//#endregion |
| 9244 |
//#region app/assets/js/ui/panel/panel-headline.js |
| 9245 |
init_utils$4(); |
| 9246 |
function PanelHeadline(props) { |
| 9247 |
return /*#__PURE__*/ react.default.createElement(Card$4.Headline, { className: arrayToClassName(["eps-panel__headline", props.className]) }, props.children); |
| 9248 |
} |
| 9249 |
PanelHeadline.propTypes = { |
| 9250 |
className: import_prop_types$55.default.string, |
| 9251 |
children: import_prop_types$55.default.any.isRequired |
| 9252 |
}; |
| 9253 |
PanelHeadline.defaultProps = { className: "" }; |
| 9254 |
|
| 9255 |
//#endregion |
| 9256 |
//#region app/assets/js/ui/panel/panel-body.js |
| 9257 |
init_utils$4(); |
| 9258 |
function PanelBody(props) { |
| 9259 |
return /*#__PURE__*/ react.default.createElement(Collapse$1.Content, null, /*#__PURE__*/ react.default.createElement(Card$4.Body, { |
| 9260 |
padding: props.padding, |
| 9261 |
className: arrayToClassName(["eps-panel__body", props.className]) |
| 9262 |
}, props.children)); |
| 9263 |
} |
| 9264 |
PanelBody.propTypes = { |
| 9265 |
className: import_prop_types$55.default.string, |
| 9266 |
padding: import_prop_types$55.default.string, |
| 9267 |
children: import_prop_types$55.default.any.isRequired |
| 9268 |
}; |
| 9269 |
PanelBody.defaultProps = { |
| 9270 |
className: "", |
| 9271 |
padding: "0" |
| 9272 |
}; |
| 9273 |
|
| 9274 |
//#endregion |
| 9275 |
//#region app/assets/js/ui/panel/panel.js |
| 9276 |
init_utils$4(); |
| 9277 |
function Panel$1(props) { |
| 9278 |
return /*#__PURE__*/ react.default.createElement(Collapse$1, { isOpened: props.isOpened }, /*#__PURE__*/ react.default.createElement(Card$4, { className: arrayToClassName(["eps-panel", props.className]) }, props.children)); |
| 9279 |
} |
| 9280 |
__name(Panel$1, "Panel"); |
| 9281 |
Panel$1.propTypes = { |
| 9282 |
className: import_prop_types$55.default.string, |
| 9283 |
isOpened: import_prop_types$55.default.bool, |
| 9284 |
children: import_prop_types$55.default.any.isRequired |
| 9285 |
}; |
| 9286 |
Panel$1.defaultProps = { |
| 9287 |
className: "", |
| 9288 |
isOpened: false |
| 9289 |
}; |
| 9290 |
Panel$1.Header = PanelHeader; |
| 9291 |
Panel$1.Headline = PanelHeadline; |
| 9292 |
Panel$1.Body = PanelBody; |
| 9293 |
|
| 9294 |
//#endregion |
| 9295 |
//#region app/modules/import-export/assets/js/pages/import/import-resolver/import-resolver.js |
| 9296 |
init_slicedToArray(); |
| 9297 |
init_es$1(); |
| 9298 |
init_button(); |
| 9299 |
init_apps_event_tracking(); |
| 9300 |
function ImportResolver() { |
| 9301 |
var _importContext$data; |
| 9302 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 9303 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 9304 |
var navigate = useNavigate(); |
| 9305 |
var conflicts = ((_importContext$data = importContext.data) === null || _importContext$data === void 0 || (_importContext$data = _importContext$data.uploadedData) === null || _importContext$data === void 0 ? void 0 : _importContext$data.conflicts) || {}; |
| 9306 |
var _ref = sharedContext.data || {}; |
| 9307 |
var referrer = _ref.referrer; |
| 9308 |
var currentPage = _ref.currentPage; |
| 9309 |
var eventTracking = function eventTracking(command) { |
| 9310 |
var sitePart = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 9311 |
if ("kit-library" === referrer) appsEventTrackingDispatch(command, { |
| 9312 |
site_part: sitePart, |
| 9313 |
page_source: "import", |
| 9314 |
step: currentPage, |
| 9315 |
event_type: "click" |
| 9316 |
}); |
| 9317 |
}; |
| 9318 |
var getFooter = function getFooter() { |
| 9319 |
return /*#__PURE__*/ react.default.createElement(ActionsFooter, null, /*#__PURE__*/ react.default.createElement(Button$29, { |
| 9320 |
text: (0, _wordpress_i18n.__)("Previous", "elementor"), |
| 9321 |
variant: "contained", |
| 9322 |
onClick: function onClick() { |
| 9323 |
eventTracking("kit-library/go-back"); |
| 9324 |
navigate("import/content"); |
| 9325 |
} |
| 9326 |
}), /*#__PURE__*/ react.default.createElement(Button$29, { |
| 9327 |
text: (0, _wordpress_i18n.__)("Next", "elementor"), |
| 9328 |
variant: "contained", |
| 9329 |
color: "primary", |
| 9330 |
onClick: function onClick() { |
| 9331 |
eventTracking("kit-library/approve-selection"); |
| 9332 |
var url = importContext.data.plugins.length ? "import/plugins-activation" : "import/process"; |
| 9333 |
importContext.dispatch({ |
| 9334 |
type: "SET_IS_RESOLVED", |
| 9335 |
payload: true |
| 9336 |
}); |
| 9337 |
navigate(url); |
| 9338 |
} |
| 9339 |
})); |
| 9340 |
}; |
| 9341 |
var getLearnMoreLink = function getLearnMoreLink() { |
| 9342 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 9343 |
url: "https://go.elementor.com/app-what-are-kits", |
| 9344 |
italic: true, |
| 9345 |
onClick: function onClick() { |
| 9346 |
return eventTracking("kit-library/seek-more-info"); |
| 9347 |
} |
| 9348 |
}, (0, _wordpress_i18n.__)("Learn More", "elementor")); |
| 9349 |
}; |
| 9350 |
var isHomePageOverride = function isHomePageOverride() { |
| 9351 |
if (sharedContext.data.includes.includes("content")) { |
| 9352 |
var _importContext$data2; |
| 9353 |
var pages = ((_importContext$data2 = importContext.data) === null || _importContext$data2 === void 0 || (_importContext$data2 = _importContext$data2.uploadedData) === null || _importContext$data2 === void 0 || (_importContext$data2 = _importContext$data2.manifest.content) === null || _importContext$data2 === void 0 ? void 0 : _importContext$data2.page) || {}; |
| 9354 |
return Object.entries(pages).find(function(pageData) { |
| 9355 |
return pageData[1].show_on_front; |
| 9356 |
}); |
| 9357 |
} |
| 9358 |
return false; |
| 9359 |
}; |
| 9360 |
(0, react.useEffect)(function() { |
| 9361 |
if (!importContext.data.uploadedData) navigate("import"); |
| 9362 |
sharedContext.dispatch({ |
| 9363 |
type: "SET_CURRENT_PAGE_NAME", |
| 9364 |
payload: ImportResolver.name |
| 9365 |
}); |
| 9366 |
}, []); |
| 9367 |
return /*#__PURE__*/ react.default.createElement(Layout, { |
| 9368 |
type: "import", |
| 9369 |
footer: getFooter() |
| 9370 |
}, /*#__PURE__*/ react.default.createElement("section", { className: "e-app-import-resolver" }, /*#__PURE__*/ react.default.createElement(PageHeader$1, { |
| 9371 |
heading: (0, _wordpress_i18n.__)("Import a Website Kit to your site", "elementor"), |
| 9372 |
description: [/*#__PURE__*/ react.default.createElement(react.default.Fragment, { key: "description-first-line" }, (0, _wordpress_i18n.__)("Parts of this kit overlap with your site’s templates, design and settings. The items you leave checked on this list will replace your current design.", "elementor"), " ", getLearnMoreLink())] |
| 9373 |
}), isHomePageOverride() && /*#__PURE__*/ react.default.createElement(Notice, { |
| 9374 |
className: "e-app-import-resolver__notice", |
| 9375 |
label: (0, _wordpress_i18n.__)("Note:", "elementor"), |
| 9376 |
color: "warning" |
| 9377 |
}, (0, _wordpress_i18n.__)("Your site's homepage will be determined by the kit. You can change this later.", "elementor")), /*#__PURE__*/ react.default.createElement(Panel$1, { isOpened: true }, /*#__PURE__*/ react.default.createElement(Panel$1.Header, { toggle: false }, /*#__PURE__*/ react.default.createElement(Panel$1.Headline, null, (0, _wordpress_i18n.__)("Select the items you want to keep and apply:", "elementor"))), /*#__PURE__*/ react.default.createElement(Panel$1.Body, { padding: "20" }, /*#__PURE__*/ react.default.createElement(Box$22, { className: "e-app-import-resolver-conflicts__container" }, /*#__PURE__*/ react.default.createElement(List, { |
| 9378 |
separated: true, |
| 9379 |
className: "e-app-import-resolver-conflicts" |
| 9380 |
}, Object.entries(conflicts).map(function(_ref2, index) { |
| 9381 |
var _ref3 = _slicedToArray(_ref2, 2); |
| 9382 |
var id = _ref3[0]; |
| 9383 |
var conflict = _ref3[1]; |
| 9384 |
return /*#__PURE__*/ react.default.createElement(List.Item, { |
| 9385 |
padding: "20", |
| 9386 |
key: index, |
| 9387 |
className: "e-app-import-resolver-conflicts__item" |
| 9388 |
}, /*#__PURE__*/ react.default.createElement(Conflict, { |
| 9389 |
importedId: parseInt(id), |
| 9390 |
conflictData: conflict[0], |
| 9391 |
onClick: function onClick(title) { |
| 9392 |
return eventTracking("kit-library/check-item", title); |
| 9393 |
} |
| 9394 |
})); |
| 9395 |
}))))))); |
| 9396 |
} |
| 9397 |
|
| 9398 |
//#endregion |
| 9399 |
//#region app/modules/import-export/assets/js/ui/wizard-step/wizard-step.js |
| 9400 |
init_utils$4(); |
| 9401 |
init_icon(); |
| 9402 |
function WizardStep(props) { |
| 9403 |
var classes = ["e-app-import-export-wizard-step", props.className]; |
| 9404 |
return /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 9405 |
className: arrayToClassName(classes), |
| 9406 |
justify: "center", |
| 9407 |
container: true |
| 9408 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { item: true }, (props.image || props.icon) && /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 9409 |
className: "e-app-import-export-wizard-step__media-container", |
| 9410 |
justify: "center", |
| 9411 |
alignItems: "end", |
| 9412 |
container: true |
| 9413 |
}, props.image && /*#__PURE__*/ react.default.createElement("img", { |
| 9414 |
className: "e-app-import-export-wizard-step__image", |
| 9415 |
src: props.image |
| 9416 |
}), props.icon && /*#__PURE__*/ react.default.createElement(Icon$2, { className: "e-app-import-export-wizard-step__icon ".concat(props.icon) })), props.heading && /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 9417 |
variant: "display-3", |
| 9418 |
className: "e-app-import-export-wizard-step__heading" |
| 9419 |
}, props.heading), props.description && /*#__PURE__*/ react.default.createElement(Text$11, { |
| 9420 |
variant: "xl", |
| 9421 |
className: "e-app-import-export-wizard-step__description" |
| 9422 |
}, props.description), props.info && /*#__PURE__*/ react.default.createElement(Text$11, { |
| 9423 |
variant: "xl", |
| 9424 |
className: "e-app-import-export-wizard-step__info" |
| 9425 |
}, props.info), props.children && /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 9426 |
item: true, |
| 9427 |
className: "e-app-import-export-wizard-step__content" |
| 9428 |
}, props.children), props.notice && /*#__PURE__*/ react.default.createElement(Text$11, { |
| 9429 |
variant: "xs", |
| 9430 |
className: "e-app-import-export-wizard-step__notice" |
| 9431 |
}, props.notice))); |
| 9432 |
} |
| 9433 |
WizardStep.propTypes = { |
| 9434 |
className: import_prop_types$55.default.string, |
| 9435 |
image: import_prop_types$55.default.string, |
| 9436 |
icon: import_prop_types$55.default.string, |
| 9437 |
heading: import_prop_types$55.default.string, |
| 9438 |
description: import_prop_types$55.default.oneOfType([import_prop_types$55.default.string, import_prop_types$55.default.object]), |
| 9439 |
info: import_prop_types$55.default.oneOfType([import_prop_types$55.default.string, import_prop_types$55.default.object]), |
| 9440 |
notice: import_prop_types$55.default.oneOfType([import_prop_types$55.default.string, import_prop_types$55.default.object]), |
| 9441 |
children: import_prop_types$55.default.any |
| 9442 |
}; |
| 9443 |
WizardStep.defaultProps = { className: "" }; |
| 9444 |
|
| 9445 |
//#endregion |
| 9446 |
//#region app/modules/import-export/assets/js/shared/file-process/file-process.js |
| 9447 |
init_utils$4(); |
| 9448 |
function FileProcess(props) { |
| 9449 |
return /*#__PURE__*/ react.default.createElement(WizardStep, { |
| 9450 |
className: arrayToClassName(["e-app-import-export-file-process", props.className]), |
| 9451 |
icon: "eicon-loading eicon-animation-spin", |
| 9452 |
heading: (0, _wordpress_i18n.__)("Setting up your website template...", "elementor"), |
| 9453 |
description: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("This usually takes a few moments.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), (0, _wordpress_i18n.__)("Don't close this window until the process is finished.", "elementor")), |
| 9454 |
info: props.info |
| 9455 |
}, !!props.errorType && /*#__PURE__*/ react.default.createElement(ProcessFailedDialog, { |
| 9456 |
onApprove: props.onDialogApprove, |
| 9457 |
onDismiss: props.onDialogDismiss, |
| 9458 |
errorType: props.errorType |
| 9459 |
})); |
| 9460 |
} |
| 9461 |
FileProcess.propTypes = { |
| 9462 |
className: import_prop_types$55.default.string, |
| 9463 |
onDialogApprove: import_prop_types$55.default.func, |
| 9464 |
onDialogDismiss: import_prop_types$55.default.func, |
| 9465 |
errorType: import_prop_types$55.default.string, |
| 9466 |
info: import_prop_types$55.default.string |
| 9467 |
}; |
| 9468 |
FileProcess.defaultProps = { className: "" }; |
| 9469 |
|
| 9470 |
//#endregion |
| 9471 |
//#region app/modules/import-export/assets/js/hooks/use-plugins.js |
| 9472 |
init_slicedToArray(); |
| 9473 |
var PLUGINS_RESPONSE_MAP = Object.freeze({ |
| 9474 |
INITIAL: "initial", |
| 9475 |
SUCCESS: "success", |
| 9476 |
ERROR: "error" |
| 9477 |
}); |
| 9478 |
var PLUGIN_STATUS_MAP = Object.freeze({ |
| 9479 |
ACTIVE: "active", |
| 9480 |
MULTISITE_ACTIVE: "network-active", |
| 9481 |
INACTIVE: "inactive", |
| 9482 |
NOT_INSTALLED: "Not Installed" |
| 9483 |
}); |
| 9484 |
var baseEndpoint = elementorCommon.config.urls.rest + "wp/v2/plugins/"; |
| 9485 |
var getInitialState$1 = function getInitialState() { |
| 9486 |
return { |
| 9487 |
status: PLUGINS_RESPONSE_MAP.INITIAL, |
| 9488 |
data: null |
| 9489 |
}; |
| 9490 |
}; |
| 9491 |
function usePlugins() { |
| 9492 |
var _useState2 = _slicedToArray((0, react.useState)(function() { |
| 9493 |
return getInitialState$1(); |
| 9494 |
}), 2); |
| 9495 |
var response = _useState2[0]; |
| 9496 |
var setResponse = _useState2[1]; |
| 9497 |
var allowResponseUpdate = (0, react.useRef)(true); |
| 9498 |
var fetchRest = function fetchRest(_ref) { |
| 9499 |
var body = _ref.body; |
| 9500 |
var method = _ref.method; |
| 9501 |
var _ref$endpoint = _ref.endpoint; |
| 9502 |
var endpoint = _ref$endpoint === void 0 ? "" : _ref$endpoint; |
| 9503 |
var data = { |
| 9504 |
method, |
| 9505 |
headers: { |
| 9506 |
"Content-Type": "application/json; charset=utf-8", |
| 9507 |
"X-WP-Nonce": wpApiSettings.nonce, |
| 9508 |
"X-Elementor-Action": "import-plugins" |
| 9509 |
} |
| 9510 |
}; |
| 9511 |
if (body) data.body = JSON.stringify(body); |
| 9512 |
if (response.data) reset(); |
| 9513 |
return new Promise(function(resolve, reject) { |
| 9514 |
fetch(baseEndpoint + endpoint, data).then(function(res) { |
| 9515 |
return res.json(); |
| 9516 |
}).then(function(res) { |
| 9517 |
if (allowResponseUpdate.current) setResponse({ |
| 9518 |
status: PLUGINS_RESPONSE_MAP.SUCCESS, |
| 9519 |
data: res |
| 9520 |
}); |
| 9521 |
resolve(res); |
| 9522 |
}).catch(function(error) { |
| 9523 |
setResponse({ |
| 9524 |
status: PLUGINS_RESPONSE_MAP.ERROR, |
| 9525 |
data: error |
| 9526 |
}); |
| 9527 |
reject(error); |
| 9528 |
}); |
| 9529 |
}); |
| 9530 |
}; |
| 9531 |
var fetchData = function fetchData(slug) { |
| 9532 |
return fetchRest({ |
| 9533 |
method: "GET", |
| 9534 |
endpoint: slug |
| 9535 |
}); |
| 9536 |
}; |
| 9537 |
var install = function install(slug) { |
| 9538 |
slug = slug.split("/")[0]; |
| 9539 |
return fetchRest({ |
| 9540 |
method: "POST", |
| 9541 |
body: { slug } |
| 9542 |
}); |
| 9543 |
}; |
| 9544 |
var activate = function activate(slug) { |
| 9545 |
return fetchRest({ |
| 9546 |
endpoint: slug, |
| 9547 |
method: "PUT", |
| 9548 |
body: { status: PLUGIN_STATUS_MAP.ACTIVE } |
| 9549 |
}); |
| 9550 |
}; |
| 9551 |
var deactivate = function deactivate(slug) { |
| 9552 |
return fetchRest({ |
| 9553 |
endpoint: slug, |
| 9554 |
method: "PUT", |
| 9555 |
body: { status: PLUGIN_STATUS_MAP.INACTIVE } |
| 9556 |
}); |
| 9557 |
}; |
| 9558 |
var remove = function remove(slug) { |
| 9559 |
return fetchRest({ |
| 9560 |
endpoint: slug, |
| 9561 |
method: "DELETE" |
| 9562 |
}); |
| 9563 |
}; |
| 9564 |
var reset = function reset() { |
| 9565 |
return setResponse(getInitialState$1()); |
| 9566 |
}; |
| 9567 |
(0, react.useEffect)(function() { |
| 9568 |
fetchData(); |
| 9569 |
return function() { |
| 9570 |
allowResponseUpdate.current = false; |
| 9571 |
}; |
| 9572 |
}, []); |
| 9573 |
return { |
| 9574 |
response, |
| 9575 |
pluginsActions: { |
| 9576 |
fetch: fetchData, |
| 9577 |
install, |
| 9578 |
activate, |
| 9579 |
deactivate, |
| 9580 |
remove, |
| 9581 |
reset |
| 9582 |
} |
| 9583 |
}; |
| 9584 |
} |
| 9585 |
|
| 9586 |
//#endregion |
| 9587 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins-activation/components/plugin-status-item/plugin-status-item.js |
| 9588 |
var ACTIVE = PLUGIN_STATUS_MAP.ACTIVE; |
| 9589 |
var INACTIVE = PLUGIN_STATUS_MAP.INACTIVE; |
| 9590 |
var NOT_INSTALLED = PLUGIN_STATUS_MAP.NOT_INSTALLED; |
| 9591 |
function PluginStatusItem$1(_ref) { |
| 9592 |
var name = _ref.name; |
| 9593 |
var status = _ref.status; |
| 9594 |
if (NOT_INSTALLED === status) return null; |
| 9595 |
else if (INACTIVE === status) status = "installed"; |
| 9596 |
else if (ACTIVE === status) status = "activated"; |
| 9597 |
return /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 9598 |
container: true, |
| 9599 |
alignItems: "center", |
| 9600 |
key: name |
| 9601 |
}, /*#__PURE__*/ react.default.createElement(Checkbox$5, { |
| 9602 |
rounded: true, |
| 9603 |
checked: true, |
| 9604 |
error: "failed" === status || null, |
| 9605 |
onChange: function onChange() {} |
| 9606 |
}), /*#__PURE__*/ react.default.createElement(Text$11, { |
| 9607 |
tag: "span", |
| 9608 |
variant: "xs", |
| 9609 |
className: "e-app-import-plugins-activation__plugin-name" |
| 9610 |
}, name + " " + status)); |
| 9611 |
} |
| 9612 |
__name(PluginStatusItem$1, "PluginStatusItem"); |
| 9613 |
PluginStatusItem$1.propTypes = { |
| 9614 |
name: import_prop_types$55.default.string.isRequired, |
| 9615 |
status: import_prop_types$55.default.string.isRequired |
| 9616 |
}; |
| 9617 |
|
| 9618 |
//#endregion |
| 9619 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins-activation/hooks/use-install-plugins.js |
| 9620 |
init_toConsumableArray(); |
| 9621 |
init_defineProperty$1(); |
| 9622 |
init_slicedToArray(); |
| 9623 |
function ownKeys$24(e, r) { |
| 9624 |
var t = Object.keys(e); |
| 9625 |
if (Object.getOwnPropertySymbols) { |
| 9626 |
var o = Object.getOwnPropertySymbols(e); |
| 9627 |
r && (o = o.filter(function(r) { |
| 9628 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 9629 |
})), t.push.apply(t, o); |
| 9630 |
} |
| 9631 |
return t; |
| 9632 |
} |
| 9633 |
__name(ownKeys$24, "ownKeys"); |
| 9634 |
function _objectSpread$23(e) { |
| 9635 |
for (var r = 1; r < arguments.length; r++) { |
| 9636 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 9637 |
r % 2 ? ownKeys$24(Object(t), !0).forEach(function(r) { |
| 9638 |
_defineProperty$1(e, r, t[r]); |
| 9639 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$24(Object(t)).forEach(function(r) { |
| 9640 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 9641 |
}); |
| 9642 |
} |
| 9643 |
return e; |
| 9644 |
} |
| 9645 |
__name(_objectSpread$23, "_objectSpread"); |
| 9646 |
var ACTION_STATUS_MAP = Object.freeze({ |
| 9647 |
ACTIVATED: "activated", |
| 9648 |
INSTALLED: "installed", |
| 9649 |
FAILED: "failed" |
| 9650 |
}); |
| 9651 |
function useInstallPlugins(_ref) { |
| 9652 |
var _ref$plugins = _ref.plugins; |
| 9653 |
var plugins = _ref$plugins === void 0 ? [] : _ref$plugins; |
| 9654 |
var _ref$bulkMaxItems = _ref.bulkMaxItems; |
| 9655 |
var bulkMaxItems = _ref$bulkMaxItems === void 0 ? 5 : _ref$bulkMaxItems; |
| 9656 |
var _usePlugins = usePlugins(); |
| 9657 |
var response = _usePlugins.response; |
| 9658 |
var pluginsActions = _usePlugins.pluginsActions; |
| 9659 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 9660 |
var isPluginsFetched = _useState2[0]; |
| 9661 |
var setIsPluginsFetched = _useState2[1]; |
| 9662 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 9663 |
var isDone = _useState4[0]; |
| 9664 |
var setIsDone = _useState4[1]; |
| 9665 |
var _useState6 = _slicedToArray((0, react.useState)([]), 2); |
| 9666 |
var bulk = _useState6[0]; |
| 9667 |
var setBulk = _useState6[1]; |
| 9668 |
var _useState8 = _slicedToArray((0, react.useState)([]), 2); |
| 9669 |
var ready = _useState8[0]; |
| 9670 |
var setReady = _useState8[1]; |
| 9671 |
var _useState0 = _slicedToArray((0, react.useState)(""), 2); |
| 9672 |
var actionStatus = _useState0[0]; |
| 9673 |
var setActionStatus = _useState0[1]; |
| 9674 |
var _useState10 = _slicedToArray((0, react.useState)(null), 2); |
| 9675 |
var currentPlugin = _useState10[0]; |
| 9676 |
var setCurrentPlugin = _useState10[1]; |
| 9677 |
var isError = PLUGINS_RESPONSE_MAP.ERROR === response.status; |
| 9678 |
var getBulk = function getBulk() { |
| 9679 |
if (bulk.length > bulkMaxItems) return bulk.slice(bulk.length - bulkMaxItems, bulk.length); |
| 9680 |
return bulk; |
| 9681 |
}; |
| 9682 |
(0, react.useEffect)(function() { |
| 9683 |
if (plugins.length) { |
| 9684 |
if (ready.length === plugins.length) setIsDone(true); |
| 9685 |
else if (isPluginsFetched) { |
| 9686 |
var nextPluginToInstallIndex = ready.length; |
| 9687 |
setCurrentPlugin(plugins[nextPluginToInstallIndex]); |
| 9688 |
} |
| 9689 |
} |
| 9690 |
}, [ready, isPluginsFetched]); |
| 9691 |
(0, react.useEffect)(function() { |
| 9692 |
if (currentPlugin) (PLUGIN_STATUS_MAP.INACTIVE === currentPlugin.status ? pluginsActions.activate : pluginsActions.install)(currentPlugin.plugin); |
| 9693 |
}, [currentPlugin]); |
| 9694 |
(0, react.useEffect)(function() { |
| 9695 |
if (PLUGINS_RESPONSE_MAP.SUCCESS === response.status) { |
| 9696 |
var data = response.data; |
| 9697 |
if (Array.isArray(data)) setIsPluginsFetched(true); |
| 9698 |
else if (!Object.prototype.hasOwnProperty.call(data, "plugin")) setActionStatus(ACTION_STATUS_MAP.FAILED); |
| 9699 |
else if (PLUGIN_STATUS_MAP.ACTIVE === data.status) setActionStatus(ACTION_STATUS_MAP.ACTIVATED); |
| 9700 |
else if (PLUGIN_STATUS_MAP.INACTIVE === data.status) setActionStatus(ACTION_STATUS_MAP.INSTALLED); |
| 9701 |
} else if (PLUGINS_RESPONSE_MAP.ERROR === response.status) setActionStatus(ACTION_STATUS_MAP.FAILED); |
| 9702 |
}, [response.status]); |
| 9703 |
(0, react.useEffect)(function() { |
| 9704 |
if (actionStatus) { |
| 9705 |
var pluginData = ACTION_STATUS_MAP.FAILED === actionStatus ? _objectSpread$23(_objectSpread$23({}, currentPlugin), {}, { status: ACTION_STATUS_MAP.FAILED }) : response.data; |
| 9706 |
setBulk(function(prevState) { |
| 9707 |
var processedPlugins = _toConsumableArray(prevState); |
| 9708 |
processedPlugins[ready.length] = pluginData; |
| 9709 |
return processedPlugins; |
| 9710 |
}); |
| 9711 |
if (ACTION_STATUS_MAP.ACTIVATED === actionStatus || ACTION_STATUS_MAP.FAILED === actionStatus) setReady(function(prevState) { |
| 9712 |
return [].concat(_toConsumableArray(prevState), [pluginData]); |
| 9713 |
}); |
| 9714 |
else if (ACTION_STATUS_MAP.INSTALLED === actionStatus) setCurrentPlugin(pluginData); |
| 9715 |
setActionStatus(""); |
| 9716 |
} |
| 9717 |
}, [actionStatus]); |
| 9718 |
return { |
| 9719 |
isDone, |
| 9720 |
ready, |
| 9721 |
bulk: (0, react.useMemo)(function() { |
| 9722 |
return getBulk(); |
| 9723 |
}, [bulk]), |
| 9724 |
isError |
| 9725 |
}; |
| 9726 |
} |
| 9727 |
|
| 9728 |
//#endregion |
| 9729 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins-activation/import-plugins-activation.js |
| 9730 |
init_es$1(); |
| 9731 |
function ImportPluginsActivation() { |
| 9732 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 9733 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 9734 |
var navigate = useNavigate(); |
| 9735 |
var _useInstallPlugins = useInstallPlugins({ plugins: importContext.data.plugins }); |
| 9736 |
var bulk = _useInstallPlugins.bulk; |
| 9737 |
var ready = _useInstallPlugins.ready; |
| 9738 |
var isDone = _useInstallPlugins.isDone; |
| 9739 |
(0, react.useEffect)(function() { |
| 9740 |
if (!importContext.data.plugins.length) navigate("/import/"); |
| 9741 |
}, [importContext.data.plugins]); |
| 9742 |
(0, react.useEffect)(function() { |
| 9743 |
if (isDone) { |
| 9744 |
importContext.dispatch({ |
| 9745 |
type: "SET_IMPORTED_PLUGINS", |
| 9746 |
payload: ready |
| 9747 |
}); |
| 9748 |
importContext.dispatch({ |
| 9749 |
type: "SET_PLUGINS_STATE", |
| 9750 |
payload: "success" |
| 9751 |
}); |
| 9752 |
sharedContext.dispatch({ |
| 9753 |
type: "SET_CURRENT_PAGE_NAME", |
| 9754 |
payload: ImportPluginsActivation.name |
| 9755 |
}); |
| 9756 |
} |
| 9757 |
}, [isDone]); |
| 9758 |
(0, react.useEffect)(function() { |
| 9759 |
if (importContext.data.importedPlugins.length) navigate("/import/process"); |
| 9760 |
}, [importContext.data.importedPlugins]); |
| 9761 |
return /*#__PURE__*/ react.default.createElement(Layout, { type: "import" }, /*#__PURE__*/ react.default.createElement("section", { className: "e-app-import-plugins-activation" }, /*#__PURE__*/ react.default.createElement(FileProcess, { info: (0, _wordpress_i18n.__)("Activating plugins:", "elementor") }), /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 9762 |
container: true, |
| 9763 |
justify: "center" |
| 9764 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 9765 |
item: true, |
| 9766 |
className: "e-app-import-plugins-activation__installing-plugins" |
| 9767 |
}, !!(bulk !== null && bulk !== void 0 && bulk.length) && /*#__PURE__*/ react.default.createElement(List, null, bulk.map(function(plugin) { |
| 9768 |
return /*#__PURE__*/ react.default.createElement(List.Item, { |
| 9769 |
className: "e-app-import-plugins-activation__plugin-status-item", |
| 9770 |
key: plugin.name |
| 9771 |
}, /*#__PURE__*/ react.default.createElement(PluginStatusItem$1, { |
| 9772 |
name: plugin.name, |
| 9773 |
status: plugin.status |
| 9774 |
})); |
| 9775 |
})))))); |
| 9776 |
} |
| 9777 |
|
| 9778 |
//#endregion |
| 9779 |
//#region app/assets/js/organisms/unfiltered-files-dialog.js |
| 9780 |
init_slicedToArray(); |
| 9781 |
init_use_ajax(); |
| 9782 |
function UnfilteredFilesDialog(props) { |
| 9783 |
var show = props.show; |
| 9784 |
var setShow = props.setShow; |
| 9785 |
var onReady = props.onReady; |
| 9786 |
var onCancel = props.onCancel; |
| 9787 |
var onDismiss = props.onDismiss; |
| 9788 |
var onLoad = props.onLoad; |
| 9789 |
var onEnable = props.onEnable; |
| 9790 |
var onClose = props.onClose; |
| 9791 |
var _useAjax = useAjax(); |
| 9792 |
var ajaxState = _useAjax.ajaxState; |
| 9793 |
var setAjax = _useAjax.setAjax; |
| 9794 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 9795 |
var enableUnfilteredFiles = _useState2[0]; |
| 9796 |
var setEnableUnfilteredFiles = _useState2[1]; |
| 9797 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 9798 |
var isEnableError = _useState4[0]; |
| 9799 |
var setIsEnableError = _useState4[1]; |
| 9800 |
(0, react.useEffect)(function() { |
| 9801 |
if (enableUnfilteredFiles) { |
| 9802 |
setShow(false); |
| 9803 |
setAjax({ data: { |
| 9804 |
action: "elementor_ajax", |
| 9805 |
actions: JSON.stringify({ enable_unfiltered_files_upload: { action: "enable_unfiltered_files_upload" } }) |
| 9806 |
} }); |
| 9807 |
if (onEnable) onEnable(); |
| 9808 |
} |
| 9809 |
}, [enableUnfilteredFiles]); |
| 9810 |
(0, react.useEffect)(function() { |
| 9811 |
switch (ajaxState.status) { |
| 9812 |
case "success": |
| 9813 |
onReady(); |
| 9814 |
break; |
| 9815 |
case "error": |
| 9816 |
setIsEnableError(true); |
| 9817 |
setShow(true); |
| 9818 |
break; |
| 9819 |
} |
| 9820 |
}, [ajaxState]); |
| 9821 |
(0, react.useEffect)(function() { |
| 9822 |
if (show && onLoad) onLoad(); |
| 9823 |
}, [show]); |
| 9824 |
if (!show) return null; |
| 9825 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, isEnableError ? /*#__PURE__*/ react.default.createElement(Dialog$9, { |
| 9826 |
title: (0, _wordpress_i18n.__)("Something went wrong.", "elementor"), |
| 9827 |
text: props.errorModalText, |
| 9828 |
approveButtonColor: "link", |
| 9829 |
approveButtonText: (0, _wordpress_i18n.__)("Continue", "elementor"), |
| 9830 |
approveButtonOnClick: onReady, |
| 9831 |
dismissButtonText: (0, _wordpress_i18n.__)("Go Back", "elementor"), |
| 9832 |
dismissButtonOnClick: onCancel, |
| 9833 |
onClose: onCancel |
| 9834 |
}) : /*#__PURE__*/ react.default.createElement(Dialog$9, { |
| 9835 |
title: (0, _wordpress_i18n.__)("First, enable unfiltered file uploads.", "elementor"), |
| 9836 |
text: props.confirmModalText, |
| 9837 |
approveButtonColor: "link", |
| 9838 |
approveButtonText: (0, _wordpress_i18n.__)("Enable", "elementor"), |
| 9839 |
approveButtonOnClick: function approveButtonOnClick() { |
| 9840 |
return setEnableUnfilteredFiles(true); |
| 9841 |
}, |
| 9842 |
dismissButtonText: (0, _wordpress_i18n.__)("Skip", "elementor"), |
| 9843 |
dismissButtonOnClick: onDismiss || onReady, |
| 9844 |
onClose: onClose || onDismiss || onReady |
| 9845 |
})); |
| 9846 |
} |
| 9847 |
UnfilteredFilesDialog.propTypes = { |
| 9848 |
show: import_prop_types$55.default.bool, |
| 9849 |
setShow: import_prop_types$55.default.func.isRequired, |
| 9850 |
onReady: import_prop_types$55.default.func.isRequired, |
| 9851 |
onCancel: import_prop_types$55.default.func.isRequired, |
| 9852 |
onDismiss: import_prop_types$55.default.func, |
| 9853 |
confirmModalText: import_prop_types$55.default.string.isRequired, |
| 9854 |
errorModalText: import_prop_types$55.default.string.isRequired, |
| 9855 |
onLoad: import_prop_types$55.default.func, |
| 9856 |
onEnable: import_prop_types$55.default.func, |
| 9857 |
onClose: import_prop_types$55.default.func |
| 9858 |
}; |
| 9859 |
UnfilteredFilesDialog.defaultProps = { |
| 9860 |
show: false, |
| 9861 |
onReady: function onReady() {}, |
| 9862 |
onCancel: function onCancel() {} |
| 9863 |
}; |
| 9864 |
|
| 9865 |
//#endregion |
| 9866 |
//#region app/modules/import-export/assets/js/hooks/use-plugins-data.js |
| 9867 |
var PLUGINS_KEYS = Object.freeze({ |
| 9868 |
ELEMENTOR: "Elementor", |
| 9869 |
ELEMENTOR_PRO: "Elementor Pro" |
| 9870 |
}); |
| 9871 |
function usePluginsData(plugins) { |
| 9872 |
var getPluginsData = function getPluginsData() { |
| 9873 |
if (!plugins) return []; |
| 9874 |
var elementorPlugins = []; |
| 9875 |
var generalPlugins = []; |
| 9876 |
plugins.forEach(function(plugin) { |
| 9877 |
switch (plugin.name) { |
| 9878 |
case PLUGINS_KEYS.ELEMENTOR: |
| 9879 |
elementorPlugins.unshift(plugin); |
| 9880 |
break; |
| 9881 |
case PLUGINS_KEYS.ELEMENTOR_PRO: |
| 9882 |
elementorPlugins.push(plugin); |
| 9883 |
break; |
| 9884 |
default: generalPlugins.push(plugin); |
| 9885 |
} |
| 9886 |
}); |
| 9887 |
return elementorPlugins.concat(generalPlugins); |
| 9888 |
}; |
| 9889 |
return { pluginsData: (0, react.useMemo)(function() { |
| 9890 |
return getPluginsData(); |
| 9891 |
}, [plugins]) }; |
| 9892 |
} |
| 9893 |
|
| 9894 |
//#endregion |
| 9895 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins/hooks/use-import-plugins-data.js |
| 9896 |
init_defineProperty$1(); |
| 9897 |
init_utils$4(); |
| 9898 |
function ownKeys$23(e, r) { |
| 9899 |
var t = Object.keys(e); |
| 9900 |
if (Object.getOwnPropertySymbols) { |
| 9901 |
var o = Object.getOwnPropertySymbols(e); |
| 9902 |
r && (o = o.filter(function(r) { |
| 9903 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 9904 |
})), t.push.apply(t, o); |
| 9905 |
} |
| 9906 |
return t; |
| 9907 |
} |
| 9908 |
__name(ownKeys$23, "ownKeys"); |
| 9909 |
function _objectSpread$22(e) { |
| 9910 |
for (var r = 1; r < arguments.length; r++) { |
| 9911 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 9912 |
r % 2 ? ownKeys$23(Object(t), !0).forEach(function(r) { |
| 9913 |
_defineProperty$1(e, r, t[r]); |
| 9914 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$23(Object(t)).forEach(function(r) { |
| 9915 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 9916 |
}); |
| 9917 |
} |
| 9918 |
return e; |
| 9919 |
} |
| 9920 |
__name(_objectSpread$22, "_objectSpread"); |
| 9921 |
var MISSING_PLUGINS_KEY = "missing"; |
| 9922 |
var EXISTING_PLUGINS_KEY = "existing"; |
| 9923 |
var ELEMENTOR_PRO_PLUGIN_KEY = "Elementor Pro"; |
| 9924 |
function useImportPluginsData(pluginsToInstall, existingPlugins) { |
| 9925 |
var getIsMinVersionExist = function getIsMinVersionExist(installedPluginVersion, kitPluginVersion) { |
| 9926 |
return installedPluginVersion.localeCompare(kitPluginVersion) > -1; |
| 9927 |
}; |
| 9928 |
var getClassifiedPlugins = function getClassifiedPlugins() { |
| 9929 |
var data = { |
| 9930 |
missing: [], |
| 9931 |
existing: [], |
| 9932 |
minVersionMissing: [], |
| 9933 |
proData: null |
| 9934 |
}; |
| 9935 |
var installedPluginsMap = arrayToObjectByKey(existingPlugins, "name"); |
| 9936 |
pluginsToInstall.forEach(function(plugin) { |
| 9937 |
var installedPluginData = installedPluginsMap[plugin.name]; |
| 9938 |
var group = PLUGIN_STATUS_MAP.ACTIVE === (installedPluginData === null || installedPluginData === void 0 ? void 0 : installedPluginData.status) ? EXISTING_PLUGINS_KEY : MISSING_PLUGINS_KEY; |
| 9939 |
var pluginData = installedPluginData || _objectSpread$22(_objectSpread$22({}, plugin), {}, { status: PLUGIN_STATUS_MAP.NOT_INSTALLED }); |
| 9940 |
if (installedPluginData && !getIsMinVersionExist(installedPluginData.version, plugin.version)) data.minVersionMissing.push(plugin); |
| 9941 |
if (ELEMENTOR_PRO_PLUGIN_KEY === pluginData.name) data.proData = pluginData; |
| 9942 |
data[group].push(pluginData); |
| 9943 |
}); |
| 9944 |
return data; |
| 9945 |
}; |
| 9946 |
var classifiedPlugins = (0, react.useMemo)(function() { |
| 9947 |
return getClassifiedPlugins(); |
| 9948 |
}, [pluginsToInstall, existingPlugins]); |
| 9949 |
return { importPluginsData: pluginsToInstall.length && existingPlugins.length ? classifiedPlugins : null }; |
| 9950 |
} |
| 9951 |
|
| 9952 |
//#endregion |
| 9953 |
//#region app/modules/import-export/assets/js/pages/import/import-kit/hooks/use-import-kit-library-apply-all-plugins.js |
| 9954 |
init_slicedToArray(); |
| 9955 |
function useImportKitLibraryApplyAllPlugins(plugins) { |
| 9956 |
var _useState2 = _slicedToArray((0, react.useState)(), 2); |
| 9957 |
var missingPlugins = _useState2[0]; |
| 9958 |
var setMissingPlugins = _useState2[1]; |
| 9959 |
var response = usePlugins().response; |
| 9960 |
var pluginsData = usePluginsData(response.data).pluginsData; |
| 9961 |
var missing = (useImportPluginsData(plugins, pluginsData).importPluginsData || {}).missing; |
| 9962 |
(0, react.useEffect)(function() { |
| 9963 |
if (plugins && !plugins.length) return; |
| 9964 |
setMissingPlugins(missing); |
| 9965 |
}, [plugins, missing]); |
| 9966 |
return missingPlugins; |
| 9967 |
} |
| 9968 |
|
| 9969 |
//#endregion |
| 9970 |
//#region app/modules/import-export/assets/js/pages/import/import-process/import-process.js |
| 9971 |
init_slicedToArray(); |
| 9972 |
init_es$1(); |
| 9973 |
init_apps_event_tracking(); |
| 9974 |
init_use_query_params(); |
| 9975 |
init_use_kit$1(); |
| 9976 |
init_redirect(); |
| 9977 |
function ImportProcess$1() { |
| 9978 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 9979 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 9980 |
var navigate = useNavigate(); |
| 9981 |
var _useState2 = _slicedToArray((0, react.useState)(""), 2); |
| 9982 |
var errorType = _useState2[0]; |
| 9983 |
var setErrorType = _useState2[1]; |
| 9984 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 9985 |
var showUnfilteredFilesDialog = _useState4[0]; |
| 9986 |
var setShowUnfilteredFilesDialog = _useState4[1]; |
| 9987 |
var _useState6 = _slicedToArray((0, react.useState)(false), 2); |
| 9988 |
var startImport = _useState6[0]; |
| 9989 |
var setStartImport = _useState6[1]; |
| 9990 |
var _useState8 = _slicedToArray((0, react.useState)([]), 2); |
| 9991 |
var plugins = _useState8[0]; |
| 9992 |
var setPlugins = _useState8[1]; |
| 9993 |
var missing = useImportKitLibraryApplyAllPlugins(plugins); |
| 9994 |
var _useKit = useKit$1(); |
| 9995 |
var kitState = _useKit.kitState; |
| 9996 |
var kitActions = _useKit.kitActions; |
| 9997 |
var KIT_STATUS_MAP = _useKit.KIT_STATUS_MAP; |
| 9998 |
var _useQueryParams$getAl = useQueryParams().getAll(); |
| 9999 |
var id = _useQueryParams$getAl.id; |
| 10000 |
var referrer = _useQueryParams$getAl.referrer; |
| 10001 |
var fileURL = _useQueryParams$getAl.file_url; |
| 10002 |
var actionType = _useQueryParams$getAl.action_type; |
| 10003 |
var nonce = _useQueryParams$getAl.nonce; |
| 10004 |
var returnToParam = _useQueryParams$getAl.return_to; |
| 10005 |
var _ref = sharedContext.data || {}; |
| 10006 |
var includes = _ref.includes; |
| 10007 |
var selectedCustomPostTypes = _ref.selectedCustomPostTypes; |
| 10008 |
var currentPage = _ref.currentPage; |
| 10009 |
var returnTo = _ref.returnTo; |
| 10010 |
var _ref2 = importContext.data || {}; |
| 10011 |
var file = _ref2.file; |
| 10012 |
var uploadedData = _ref2.uploadedData; |
| 10013 |
var importedData = _ref2.importedData; |
| 10014 |
var overrideConditions = _ref2.overrideConditions; |
| 10015 |
var isResolvedData = _ref2.isResolvedData; |
| 10016 |
var isKitHasSvgAssets = (0, react.useMemo)(function() { |
| 10017 |
return includes.some(function(item) { |
| 10018 |
return ["templates", "content"].includes(item); |
| 10019 |
}); |
| 10020 |
}, [includes]); |
| 10021 |
var navigateToMainScreen = useImportActions().navigateToMainScreen; |
| 10022 |
var uploadKit = function uploadKit() { |
| 10023 |
var decodedFileURL = decodeURIComponent(fileURL); |
| 10024 |
importContext.dispatch({ |
| 10025 |
type: "SET_ID", |
| 10026 |
payload: id |
| 10027 |
}); |
| 10028 |
importContext.dispatch({ |
| 10029 |
type: "SET_FILE", |
| 10030 |
payload: decodedFileURL |
| 10031 |
}); |
| 10032 |
kitActions.upload({ |
| 10033 |
kitId: id, |
| 10034 |
file: decodedFileURL, |
| 10035 |
kitLibraryNonce: nonce |
| 10036 |
}); |
| 10037 |
}; |
| 10038 |
var importKit = function importKit() { |
| 10039 |
if (elementorAppConfig["import-export"].isUnfilteredFilesEnabled || !isKitHasSvgAssets) setStartImport(true); |
| 10040 |
else setShowUnfilteredFilesDialog(true); |
| 10041 |
}; |
| 10042 |
var applyAllSetCpt = function applyAllSetCpt() { |
| 10043 |
var _kitState$data; |
| 10044 |
var _importContext$data; |
| 10045 |
var cpt = ((_kitState$data = kitState.data) === null || _kitState$data === void 0 ? void 0 : _kitState$data.manifest["custom-post-type-title"]) || ((_importContext$data = importContext.data) === null || _importContext$data === void 0 || (_importContext$data = _importContext$data.uploadedData) === null || _importContext$data === void 0 ? void 0 : _importContext$data.manifest["custom-post-type-title"]); |
| 10046 |
if (cpt) { |
| 10047 |
var cptArray = Object.keys(cpt); |
| 10048 |
sharedContext.dispatch({ |
| 10049 |
type: "SET_SELECTED_CPT", |
| 10050 |
payload: cptArray |
| 10051 |
}); |
| 10052 |
} |
| 10053 |
}; |
| 10054 |
var applyAllImportPlugins = function applyAllImportPlugins() { |
| 10055 |
var _kitState$data2; |
| 10056 |
setPlugins(((_kitState$data2 = kitState.data) === null || _kitState$data2 === void 0 || (_kitState$data2 = _kitState$data2.manifest) === null || _kitState$data2 === void 0 ? void 0 : _kitState$data2.plugins) || importContext.data.uploadedData.manifest.plugins); |
| 10057 |
}; |
| 10058 |
var onCancelProcess = function onCancelProcess() { |
| 10059 |
importContext.dispatch({ |
| 10060 |
type: "SET_FILE", |
| 10061 |
payload: null |
| 10062 |
}); |
| 10063 |
navigateToMainScreen(); |
| 10064 |
}; |
| 10065 |
var _onReady = function onReady() { |
| 10066 |
setShowUnfilteredFilesDialog(false); |
| 10067 |
setStartImport(true); |
| 10068 |
}; |
| 10069 |
var eventTracking = function eventTracking(command) { |
| 10070 |
var eventType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "click"; |
| 10071 |
if ("kit-library" === sharedContext.data.referrer) appsEventTrackingDispatch(command, { |
| 10072 |
page_source: "import", |
| 10073 |
step: currentPage, |
| 10074 |
modal_type: "unfiltered_file", |
| 10075 |
event_type: eventType |
| 10076 |
}); |
| 10077 |
}; |
| 10078 |
(0, react.useEffect)(function() { |
| 10079 |
if (referrer) sharedContext.dispatch({ |
| 10080 |
type: "SET_REFERRER", |
| 10081 |
payload: referrer |
| 10082 |
}); |
| 10083 |
if (actionType) importContext.dispatch({ |
| 10084 |
type: "SET_ACTION_TYPE", |
| 10085 |
payload: actionType |
| 10086 |
}); |
| 10087 |
if (returnToParam) sharedContext.dispatch({ |
| 10088 |
type: "SET_RETURN_TO", |
| 10089 |
payload: returnToParam |
| 10090 |
}); |
| 10091 |
if (fileURL && !file) uploadKit(); |
| 10092 |
else if (uploadedData) importKit(); |
| 10093 |
else navigate("import"); |
| 10094 |
sharedContext.dispatch({ |
| 10095 |
type: "SET_CURRENT_PAGE_NAME", |
| 10096 |
payload: ImportProcess$1.name |
| 10097 |
}); |
| 10098 |
}, []); |
| 10099 |
(0, react.useEffect)(function() { |
| 10100 |
if (startImport) { |
| 10101 |
var data = importContext.data; |
| 10102 |
var isImportFromCloud = KIT_SOURCE_MAP.CLOUD === data.source; |
| 10103 |
var kitId = isImportFromCloud ? data.file.id : data.id; |
| 10104 |
var importReferrer = isImportFromCloud ? data.source : referrer; |
| 10105 |
kitActions.import({ |
| 10106 |
id: kitId, |
| 10107 |
session: uploadedData.session, |
| 10108 |
include: includes, |
| 10109 |
overrideConditions, |
| 10110 |
referrer: importReferrer, |
| 10111 |
selectedCustomPostTypes |
| 10112 |
}); |
| 10113 |
} |
| 10114 |
}, [startImport]); |
| 10115 |
(0, react.useEffect)(function() { |
| 10116 |
if (KIT_STATUS_MAP.INITIAL !== kitState.status) switch (kitState.status) { |
| 10117 |
case KIT_STATUS_MAP.IMPORTED: |
| 10118 |
importContext.dispatch({ |
| 10119 |
type: "SET_IMPORTED_DATA", |
| 10120 |
payload: kitState.data |
| 10121 |
}); |
| 10122 |
break; |
| 10123 |
case KIT_STATUS_MAP.UPLOADED: |
| 10124 |
importContext.dispatch({ |
| 10125 |
type: "SET_UPLOADED_DATA", |
| 10126 |
payload: kitState.data |
| 10127 |
}); |
| 10128 |
break; |
| 10129 |
case KIT_STATUS_MAP.ERROR: |
| 10130 |
setErrorType(kitState.data); |
| 10131 |
break; |
| 10132 |
} |
| 10133 |
}, [kitState.status]); |
| 10134 |
(0, react.useEffect)(function() { |
| 10135 |
if (KIT_STATUS_MAP.INITIAL !== kitState.status || isResolvedData && "apply-all" === importContext.data.actionType) if (importedData) { |
| 10136 |
if (returnTo && safeRedirect$1(returnTo)) return; |
| 10137 |
navigate("/import/complete"); |
| 10138 |
} else if ("apply-all" === importContext.data.actionType) { |
| 10139 |
var _kitState$data3; |
| 10140 |
var _importContext$data$u; |
| 10141 |
if ((_kitState$data3 = kitState.data) !== null && _kitState$data3 !== void 0 && (_kitState$data3 = _kitState$data3.manifest) !== null && _kitState$data3 !== void 0 && _kitState$data3.plugins || (_importContext$data$u = importContext.data.uploadedData) !== null && _importContext$data$u !== void 0 && _importContext$data$u.manifest.plugins) importContext.dispatch({ |
| 10142 |
type: "SET_PLUGINS_STATE", |
| 10143 |
payload: "have" |
| 10144 |
}); |
| 10145 |
if (uploadedData.conflicts && Object.keys(uploadedData.conflicts).length && !isResolvedData) navigate("/import/resolver"); |
| 10146 |
else { |
| 10147 |
kitActions.reset(); |
| 10148 |
if ("have" === importContext.data.pluginsState) applyAllImportPlugins(); |
| 10149 |
if ("" === importContext.data.pluginsState || "success" === importContext.data.pluginsState) { |
| 10150 |
applyAllSetCpt(); |
| 10151 |
importKit(); |
| 10152 |
} |
| 10153 |
} |
| 10154 |
} else navigate("/import/plugins"); |
| 10155 |
}, [ |
| 10156 |
uploadedData, |
| 10157 |
importedData, |
| 10158 |
importContext.data.pluginsState, |
| 10159 |
returnTo |
| 10160 |
]); |
| 10161 |
(0, react.useEffect)(function() { |
| 10162 |
if ((missing === null || missing === void 0 ? void 0 : missing.length) > 0) { |
| 10163 |
importContext.dispatch({ |
| 10164 |
type: "SET_PLUGINS", |
| 10165 |
payload: missing |
| 10166 |
}); |
| 10167 |
navigate("import/plugins-activation"); |
| 10168 |
} |
| 10169 |
}, [missing]); |
| 10170 |
return /*#__PURE__*/ react.default.createElement(Layout, { type: "import" }, /*#__PURE__*/ react.default.createElement("section", null, /*#__PURE__*/ react.default.createElement(FileProcess, { |
| 10171 |
info: uploadedData && (0, _wordpress_i18n.__)("Importing your content, templates and site settings", "elementor"), |
| 10172 |
errorType, |
| 10173 |
onDialogApprove: onCancelProcess, |
| 10174 |
onDialogDismiss: onCancelProcess |
| 10175 |
}), /*#__PURE__*/ react.default.createElement(UnfilteredFilesDialog, { |
| 10176 |
show: showUnfilteredFilesDialog, |
| 10177 |
setShow: setShowUnfilteredFilesDialog, |
| 10178 |
confirmModalText: (0, _wordpress_i18n.__)("This allows Elementor to scan your SVGs for malicious content. Otherwise, you can skip any SVGs in this import.", "elementor"), |
| 10179 |
errorModalText: (0, _wordpress_i18n.__)("Nothing to worry about, just continue without importing SVGs or go back and start the import again.", "elementor"), |
| 10180 |
onReady: function onReady() { |
| 10181 |
return _onReady(); |
| 10182 |
}, |
| 10183 |
onCancel: function onCancel() { |
| 10184 |
setShowUnfilteredFilesDialog(false); |
| 10185 |
onCancelProcess(); |
| 10186 |
}, |
| 10187 |
onLoad: function onLoad() { |
| 10188 |
return eventTracking("kit-library/modal-load", "load"); |
| 10189 |
}, |
| 10190 |
onClose: function onClose() { |
| 10191 |
eventTracking("kit-library/close"); |
| 10192 |
_onReady(); |
| 10193 |
}, |
| 10194 |
onDismiss: function onDismiss() { |
| 10195 |
_onReady(); |
| 10196 |
eventTracking("kit-library/skip"); |
| 10197 |
}, |
| 10198 |
onEnable: function onEnable() { |
| 10199 |
return eventTracking("kit-library/enable"); |
| 10200 |
} |
| 10201 |
}))); |
| 10202 |
} |
| 10203 |
__name(ImportProcess$1, "ImportProcess"); |
| 10204 |
|
| 10205 |
//#endregion |
| 10206 |
//#region app/modules/import-export/assets/js/shared/kit-data/components/site-area/site-area.js |
| 10207 |
init_icon(); |
| 10208 |
init_apps_event_tracking(); |
| 10209 |
function SiteArea(_ref) { |
| 10210 |
var text = _ref.text; |
| 10211 |
var link = _ref.link; |
| 10212 |
var eventTracking = function eventTracking(command) { |
| 10213 |
appsEventTrackingDispatch(command, { |
| 10214 |
site_area: text, |
| 10215 |
page_source: "import complete", |
| 10216 |
event_type: arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "click" |
| 10217 |
}); |
| 10218 |
}; |
| 10219 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 10220 |
url: link, |
| 10221 |
color: "secondary", |
| 10222 |
underline: "none", |
| 10223 |
onClick: function onClick() { |
| 10224 |
return eventTracking("kit-library/open-site-area"); |
| 10225 |
} |
| 10226 |
}, /*#__PURE__*/ react.default.createElement(Text$11, { className: "e-app-import-export-kit-data__site-area" }, text, " ", link && /*#__PURE__*/ react.default.createElement(Icon$2, { className: "eicon-editor-external-link" }))); |
| 10227 |
} |
| 10228 |
SiteArea.propTypes = { |
| 10229 |
text: import_prop_types$55.default.string, |
| 10230 |
link: import_prop_types$55.default.string |
| 10231 |
}; |
| 10232 |
|
| 10233 |
//#endregion |
| 10234 |
//#region app/modules/import-export/assets/js/shared/kit-data/components/included/included.js |
| 10235 |
function Included(_ref) { |
| 10236 |
var data = _ref.data; |
| 10237 |
return /*#__PURE__*/ react.default.createElement(Text$11, { className: "e-app-import-export-kit-data__included" }, data.filter(function(value) { |
| 10238 |
return value; |
| 10239 |
}).join(" | ")); |
| 10240 |
} |
| 10241 |
Included.propTypes = { data: import_prop_types$55.default.array }; |
| 10242 |
|
| 10243 |
//#endregion |
| 10244 |
//#region app/assets/js/ui/table/table-context.js |
| 10245 |
var Context = react.default.createContext(); |
| 10246 |
|
| 10247 |
//#endregion |
| 10248 |
//#region app/assets/js/ui/table/table.head.js |
| 10249 |
init_utils$4(); |
| 10250 |
function TableHead(props) { |
| 10251 |
return /*#__PURE__*/ react.default.createElement("thead", { className: arrayToClassName(["eps-table__head", props.className]) }, props.children); |
| 10252 |
} |
| 10253 |
TableHead.propTypes = { |
| 10254 |
children: import_prop_types$55.default.any.isRequired, |
| 10255 |
className: import_prop_types$55.default.string |
| 10256 |
}; |
| 10257 |
|
| 10258 |
//#endregion |
| 10259 |
//#region app/assets/js/ui/table/table-body.js |
| 10260 |
init_utils$4(); |
| 10261 |
function TableBody(props) { |
| 10262 |
return /*#__PURE__*/ react.default.createElement("tbody", { className: arrayToClassName(["eps-table__body", props.className]) }, props.children); |
| 10263 |
} |
| 10264 |
TableBody.propTypes = { |
| 10265 |
children: import_prop_types$55.default.any.isRequired, |
| 10266 |
className: import_prop_types$55.default.string |
| 10267 |
}; |
| 10268 |
|
| 10269 |
//#endregion |
| 10270 |
//#region app/assets/js/ui/table/table-row.js |
| 10271 |
init_utils$4(); |
| 10272 |
function TableRow(props) { |
| 10273 |
return /*#__PURE__*/ react.default.createElement("tr", { className: arrayToClassName(["eps-table__row", props.className]) }, props.children); |
| 10274 |
} |
| 10275 |
TableRow.propTypes = { |
| 10276 |
children: import_prop_types$55.default.any.isRequired, |
| 10277 |
className: import_prop_types$55.default.string |
| 10278 |
}; |
| 10279 |
|
| 10280 |
//#endregion |
| 10281 |
//#region app/assets/js/ui/table/table-cell.js |
| 10282 |
init_utils$4(); |
| 10283 |
function TableCell(props) { |
| 10284 |
return /*#__PURE__*/ react.default.createElement(function Element() { |
| 10285 |
return react.default.createElement(props.tag, { |
| 10286 |
className: arrayToClassName(["eps-table__cell", props.className]), |
| 10287 |
colSpan: props.colSpan || null |
| 10288 |
}, props.children); |
| 10289 |
}, null); |
| 10290 |
} |
| 10291 |
TableCell.propTypes = { |
| 10292 |
children: import_prop_types$55.default.any, |
| 10293 |
className: import_prop_types$55.default.string, |
| 10294 |
colSpan: import_prop_types$55.default.oneOfType([import_prop_types$55.default.number, import_prop_types$55.default.string]), |
| 10295 |
tag: import_prop_types$55.default.oneOf(["td", "th"]).isRequired |
| 10296 |
}; |
| 10297 |
|
| 10298 |
//#endregion |
| 10299 |
//#region app/assets/js/ui/table/table-checkbox.js |
| 10300 |
init_toConsumableArray(); |
| 10301 |
init_utils$4(); |
| 10302 |
function TableCheckbox(props) { |
| 10303 |
var _ref = (0, react.useContext)(Context) || {}; |
| 10304 |
var selected = _ref.selected; |
| 10305 |
var disabled = _ref.disabled; |
| 10306 |
var setSelected = _ref.setSelected; |
| 10307 |
var isSelectAllCheckbox = Object.prototype.hasOwnProperty.call(props, "allSelectedCount"); |
| 10308 |
var isAllSelected = selected.length === props.allSelectedCount; |
| 10309 |
var isIndeterminate = isSelectAllCheckbox ? !!(selected.length - disabled.length && !isAllSelected) : false; |
| 10310 |
var isSelected = isSelectAllCheckbox ? isAllSelected : selected.includes(props.index); |
| 10311 |
var isDisabled = !isSelectAllCheckbox ? disabled.includes(props.index) : null; |
| 10312 |
var onSelectAll = function onSelectAll() { |
| 10313 |
setSelected(function() { |
| 10314 |
if (isAllSelected || isIndeterminate) return disabled.length ? _toConsumableArray(disabled) : []; |
| 10315 |
return Array(props.allSelectedCount).fill(true).map(function(value, index) { |
| 10316 |
return index; |
| 10317 |
}); |
| 10318 |
}); |
| 10319 |
}; |
| 10320 |
var onSelectRow = function onSelectRow() { |
| 10321 |
setSelected(function(prevState) { |
| 10322 |
var currentSelections = _toConsumableArray(prevState); |
| 10323 |
var currentIndexPosition = currentSelections.indexOf(props.index); |
| 10324 |
if (currentIndexPosition > -1) currentSelections.splice(currentIndexPosition, 1); |
| 10325 |
else currentSelections.push(props.index); |
| 10326 |
return currentSelections; |
| 10327 |
}); |
| 10328 |
}; |
| 10329 |
return /*#__PURE__*/ react.default.createElement(Checkbox$5, { |
| 10330 |
checked: isSelected, |
| 10331 |
indeterminate: isIndeterminate, |
| 10332 |
onChange: function onChange() { |
| 10333 |
return isSelectAllCheckbox ? onSelectAll() : onSelectRow(); |
| 10334 |
}, |
| 10335 |
disabled: isDisabled, |
| 10336 |
className: arrayToClassName(["eps-table__checkbox", props.className]) |
| 10337 |
}); |
| 10338 |
} |
| 10339 |
TableCheckbox.propTypes = { |
| 10340 |
className: import_prop_types$55.default.string, |
| 10341 |
index: import_prop_types$55.default.number, |
| 10342 |
initialChecked: import_prop_types$55.default.bool, |
| 10343 |
allSelectedCount: import_prop_types$55.default.number |
| 10344 |
}; |
| 10345 |
|
| 10346 |
//#endregion |
| 10347 |
//#region app/assets/js/ui/table/table.js |
| 10348 |
init_defineProperty$1(); |
| 10349 |
init_slicedToArray(); |
| 10350 |
init_utils$4(); |
| 10351 |
function Table(_ref) { |
| 10352 |
var className = _ref.className; |
| 10353 |
var initialSelected = _ref.initialSelected; |
| 10354 |
var initialDisabled = _ref.initialDisabled; |
| 10355 |
var selection = _ref.selection; |
| 10356 |
var children = _ref.children; |
| 10357 |
var onSelect = _ref.onSelect; |
| 10358 |
var _useState2 = _slicedToArray((0, react.useState)(initialSelected), 2); |
| 10359 |
var selected = _useState2[0]; |
| 10360 |
var setSelected = _useState2[1]; |
| 10361 |
var _useState4 = _slicedToArray((0, react.useState)(initialDisabled), 2); |
| 10362 |
var disabled = _useState4[0]; |
| 10363 |
var setDisabled = _useState4[1]; |
| 10364 |
var classNameBase = "eps-table"; |
| 10365 |
var classes = [ |
| 10366 |
classNameBase, |
| 10367 |
_defineProperty$1({}, classNameBase + "--selection", selection), |
| 10368 |
className |
| 10369 |
]; |
| 10370 |
(0, react.useEffect)(function() { |
| 10371 |
if (onSelect) onSelect(selected); |
| 10372 |
}, [selected]); |
| 10373 |
return /*#__PURE__*/ react.default.createElement(Context.Provider, { value: { |
| 10374 |
selected, |
| 10375 |
setSelected, |
| 10376 |
disabled, |
| 10377 |
setDisabled |
| 10378 |
} }, /*#__PURE__*/ react.default.createElement("table", { className: arrayToClassName(classes) }, selection && /*#__PURE__*/ react.default.createElement("colgroup", null, /*#__PURE__*/ react.default.createElement("col", { className: classNameBase + "__checkboxes-column" })), children)); |
| 10379 |
} |
| 10380 |
Table.Head = TableHead; |
| 10381 |
Table.Body = TableBody; |
| 10382 |
Table.Row = TableRow; |
| 10383 |
Table.Cell = TableCell; |
| 10384 |
Table.Checkbox = TableCheckbox; |
| 10385 |
Table.propTypes = { |
| 10386 |
children: import_prop_types$55.default.any.isRequired, |
| 10387 |
className: import_prop_types$55.default.string, |
| 10388 |
headers: import_prop_types$55.default.array, |
| 10389 |
initialDisabled: import_prop_types$55.default.array, |
| 10390 |
initialSelected: import_prop_types$55.default.array, |
| 10391 |
rows: import_prop_types$55.default.array, |
| 10392 |
selection: import_prop_types$55.default.bool, |
| 10393 |
onSelect: import_prop_types$55.default.func |
| 10394 |
}; |
| 10395 |
Table.defaultProps = { |
| 10396 |
selection: false, |
| 10397 |
initialDisabled: [], |
| 10398 |
initialSelected: [] |
| 10399 |
}; |
| 10400 |
|
| 10401 |
//#endregion |
| 10402 |
//#region app/assets/js/molecules/data-table.js |
| 10403 |
init_utils$4(); |
| 10404 |
function DataTable(_ref) { |
| 10405 |
var className = _ref.className; |
| 10406 |
var onSelect = _ref.onSelect; |
| 10407 |
var initialSelected = _ref.initialSelected; |
| 10408 |
var initialDisabled = _ref.initialDisabled; |
| 10409 |
var headers = _ref.headers; |
| 10410 |
var layout = _ref.layout; |
| 10411 |
var rows = _ref.rows; |
| 10412 |
var selection = _ref.selection; |
| 10413 |
return /*#__PURE__*/ react.default.createElement(Table, { |
| 10414 |
selection, |
| 10415 |
onSelect, |
| 10416 |
initialSelected, |
| 10417 |
initialDisabled, |
| 10418 |
className: arrayToClassName(["e-app-data-table", className]) |
| 10419 |
}, !!headers.length && /*#__PURE__*/ react.default.createElement(Table.Head, null, /*#__PURE__*/ react.default.createElement(Table.Row, null, selection && /*#__PURE__*/ react.default.createElement(Table.Cell, { tag: "th" }, /*#__PURE__*/ react.default.createElement(Table.Checkbox, { allSelectedCount: rows.length })), headers.map(function(header, index) { |
| 10420 |
return /*#__PURE__*/ react.default.createElement(Table.Cell, { |
| 10421 |
tag: "th", |
| 10422 |
colSpan: layout && layout[index], |
| 10423 |
key: index |
| 10424 |
}, header); |
| 10425 |
}))), /*#__PURE__*/ react.default.createElement(Table.Body, null, rows.map(function(row, rowIndex) { |
| 10426 |
return /*#__PURE__*/ react.default.createElement(Table.Row, { key: rowIndex }, selection && /*#__PURE__*/ react.default.createElement(Table.Cell, { tag: "td" }, /*#__PURE__*/ react.default.createElement(Table.Checkbox, { index: rowIndex })), row.map(function(cell, cellIndex) { |
| 10427 |
return /*#__PURE__*/ react.default.createElement(Table.Cell, { |
| 10428 |
tag: "td", |
| 10429 |
colSpan: layout && layout[cellIndex], |
| 10430 |
key: cellIndex |
| 10431 |
}, cell); |
| 10432 |
})); |
| 10433 |
}))); |
| 10434 |
} |
| 10435 |
DataTable.propTypes = { |
| 10436 |
className: import_prop_types$55.default.string, |
| 10437 |
headers: import_prop_types$55.default.array, |
| 10438 |
rows: import_prop_types$55.default.array, |
| 10439 |
initialDisabled: import_prop_types$55.default.array, |
| 10440 |
initialSelected: import_prop_types$55.default.array, |
| 10441 |
layout: import_prop_types$55.default.array, |
| 10442 |
onSelect: import_prop_types$55.default.func, |
| 10443 |
selection: import_prop_types$55.default.bool, |
| 10444 |
withHeader: import_prop_types$55.default.bool |
| 10445 |
}; |
| 10446 |
DataTable.defaultProps = { |
| 10447 |
className: "", |
| 10448 |
headers: [], |
| 10449 |
rows: [], |
| 10450 |
initialDisabled: [], |
| 10451 |
initialSelected: [], |
| 10452 |
selection: false |
| 10453 |
}; |
| 10454 |
|
| 10455 |
//#endregion |
| 10456 |
//#region app/modules/import-export/assets/js/shared/kit-data/hooks/use-kit-data.js |
| 10457 |
init_defineProperty$1(); |
| 10458 |
init_slicedToArray(); |
| 10459 |
function ownKeys$22(e, r) { |
| 10460 |
var t = Object.keys(e); |
| 10461 |
if (Object.getOwnPropertySymbols) { |
| 10462 |
var o = Object.getOwnPropertySymbols(e); |
| 10463 |
r && (o = o.filter(function(r) { |
| 10464 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 10465 |
})), t.push.apply(t, o); |
| 10466 |
} |
| 10467 |
return t; |
| 10468 |
} |
| 10469 |
__name(ownKeys$22, "ownKeys"); |
| 10470 |
function _objectSpread$21(e) { |
| 10471 |
for (var r = 1; r < arguments.length; r++) { |
| 10472 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 10473 |
r % 2 ? ownKeys$22(Object(t), !0).forEach(function(r) { |
| 10474 |
_defineProperty$1(e, r, t[r]); |
| 10475 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$22(Object(t)).forEach(function(r) { |
| 10476 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 10477 |
}); |
| 10478 |
} |
| 10479 |
return e; |
| 10480 |
} |
| 10481 |
__name(_objectSpread$21, "_objectSpread"); |
| 10482 |
function useKitData(kitData) { |
| 10483 |
var getLabel = function getLabel(type, key, amount) { |
| 10484 |
var _kitData$configData; |
| 10485 |
var label = ((kitData === null || kitData === void 0 || (_kitData$configData = kitData.configData) === null || _kitData$configData === void 0 ? void 0 : _kitData$configData.summaryTitles) || elementorAppConfig["import-export"].summaryTitles)[type][key]; |
| 10486 |
if (label !== null && label !== void 0 && label.single) { |
| 10487 |
if (!amount) return ""; |
| 10488 |
var title = amount > 1 ? label.plural : label.single; |
| 10489 |
return amount + " " + title; |
| 10490 |
} |
| 10491 |
return label; |
| 10492 |
}; |
| 10493 |
var getTemplates = function getTemplates() { |
| 10494 |
var templates = {}; |
| 10495 |
for (var key in kitData === null || kitData === void 0 ? void 0 : kitData.templates) { |
| 10496 |
var type = kitData.templates[key].doc_type; |
| 10497 |
if (!templates[type]) templates[type] = 0; |
| 10498 |
templates[type]++; |
| 10499 |
} |
| 10500 |
return Object.entries(templates).map(function(_ref) { |
| 10501 |
var _ref2 = _slicedToArray(_ref, 2); |
| 10502 |
var key = _ref2[0]; |
| 10503 |
var amount = _ref2[1]; |
| 10504 |
return getLabel("templates", key, amount); |
| 10505 |
}).filter(function(value) { |
| 10506 |
return value; |
| 10507 |
}); |
| 10508 |
}; |
| 10509 |
var getSiteSettings = function getSiteSettings() { |
| 10510 |
var siteSettings = (kitData === null || kitData === void 0 ? void 0 : kitData["site-settings"]) || {}; |
| 10511 |
return Object.values(siteSettings).map(function(item) { |
| 10512 |
return getLabel("site-settings", item); |
| 10513 |
}); |
| 10514 |
}; |
| 10515 |
var getContent = function getContent() { |
| 10516 |
var content = (kitData === null || kitData === void 0 ? void 0 : kitData.content) || {}; |
| 10517 |
var wpContent = (kitData === null || kitData === void 0 ? void 0 : kitData["wp-content"]) || {}; |
| 10518 |
var mergedContent = _objectSpread$21({}, content); |
| 10519 |
for (var key in mergedContent) mergedContent[key] = Object.keys(mergedContent[key]).concat(wpContent[key] || []); |
| 10520 |
mergedContent = _objectSpread$21(_objectSpread$21({}, wpContent), mergedContent); |
| 10521 |
return Object.entries(mergedContent).map(function(_ref3) { |
| 10522 |
var _ref4 = _slicedToArray(_ref3, 2); |
| 10523 |
var key = _ref4[0]; |
| 10524 |
var data = _ref4[1]; |
| 10525 |
return getLabel("content", key, data.length); |
| 10526 |
}).filter(function(value) { |
| 10527 |
return value; |
| 10528 |
}); |
| 10529 |
}; |
| 10530 |
var getPlugins = function getPlugins() { |
| 10531 |
return kitData !== null && kitData !== void 0 && kitData.plugins ? kitData.plugins.map(function(_ref5) { |
| 10532 |
return _ref5.name; |
| 10533 |
}) : []; |
| 10534 |
}; |
| 10535 |
return (0, react.useMemo)(function() { |
| 10536 |
return { |
| 10537 |
templates: getTemplates(), |
| 10538 |
siteSettings: getSiteSettings(), |
| 10539 |
content: getContent(), |
| 10540 |
plugins: getPlugins() |
| 10541 |
}; |
| 10542 |
}, [kitData]); |
| 10543 |
} |
| 10544 |
|
| 10545 |
//#endregion |
| 10546 |
//#region app/modules/import-export/assets/js/shared/kit-data/kit-data.js |
| 10547 |
var siteEditorPath = elementorAppConfig.hasPro ? "#/site-editor" : "#/site-editor/promotion"; |
| 10548 |
function KitData(_ref) { |
| 10549 |
var data = _ref.data; |
| 10550 |
var _useKitData = useKitData(data); |
| 10551 |
var templates = _useKitData.templates; |
| 10552 |
var siteSettings = _useKitData.siteSettings; |
| 10553 |
var content = _useKitData.content; |
| 10554 |
var plugins = _useKitData.plugins; |
| 10555 |
var _ref2 = (data === null || data === void 0 ? void 0 : data.configData) || elementorAppConfig["import-export"]; |
| 10556 |
var elementorHomePageUrl = _ref2.elementorHomePageUrl; |
| 10557 |
var recentlyEditedElementorPageUrl = _ref2.recentlyEditedElementorPageUrl; |
| 10558 |
var siteSettingsUrl = elementorHomePageUrl || recentlyEditedElementorPageUrl; |
| 10559 |
var headers = [(0, _wordpress_i18n.__)("Site Area", "elementor"), (0, _wordpress_i18n.__)("Included", "elementor")]; |
| 10560 |
var rows = [ |
| 10561 |
{ |
| 10562 |
siteArea: (0, _wordpress_i18n.__)("Elementor Templates", "elementor"), |
| 10563 |
link: elementorAppConfig.base_url + siteEditorPath, |
| 10564 |
included: templates |
| 10565 |
}, |
| 10566 |
{ |
| 10567 |
siteArea: (0, _wordpress_i18n.__)("Site Settings", "elementor"), |
| 10568 |
link: siteSettingsUrl ? siteSettingsUrl + "#e:run:panel/global/open" : "", |
| 10569 |
included: siteSettings |
| 10570 |
}, |
| 10571 |
{ |
| 10572 |
siteArea: (0, _wordpress_i18n.__)("Content", "elementor"), |
| 10573 |
link: elementorAppConfig.admin_url + "edit.php?post_type=page", |
| 10574 |
included: content |
| 10575 |
}, |
| 10576 |
{ |
| 10577 |
siteArea: (0, _wordpress_i18n.__)("Plugins", "elementor"), |
| 10578 |
link: elementorAppConfig.admin_url + "plugins.php", |
| 10579 |
included: plugins |
| 10580 |
} |
| 10581 |
].map(function(_ref3) { |
| 10582 |
var siteArea = _ref3.siteArea; |
| 10583 |
var included = _ref3.included; |
| 10584 |
var link = _ref3.link; |
| 10585 |
if (!included.length) return; |
| 10586 |
return [/*#__PURE__*/ react.default.createElement(SiteArea, { |
| 10587 |
key: siteArea, |
| 10588 |
text: siteArea, |
| 10589 |
link |
| 10590 |
}), /*#__PURE__*/ react.default.createElement(Included, { |
| 10591 |
key: included, |
| 10592 |
data: included |
| 10593 |
})]; |
| 10594 |
}).filter(function(row) { |
| 10595 |
return row; |
| 10596 |
}); |
| 10597 |
if (!rows.length) return null; |
| 10598 |
return /*#__PURE__*/ react.default.createElement(DataTable, { |
| 10599 |
className: "e-app-import-export-kit-data", |
| 10600 |
headers, |
| 10601 |
rows, |
| 10602 |
layout: [1, 3] |
| 10603 |
}); |
| 10604 |
} |
| 10605 |
KitData.propTypes = { data: import_prop_types$55.default.object }; |
| 10606 |
var kit_data_default = (0, react.memo)(KitData); |
| 10607 |
|
| 10608 |
//#endregion |
| 10609 |
//#region app/modules/import-export/assets/js/pages/import/import-complete/components/failed-plugins-notice/failed-plugins-notice.js |
| 10610 |
init_button(); |
| 10611 |
function FailedPluginsNotice(_ref) { |
| 10612 |
var failedPlugins = _ref.failedPlugins; |
| 10613 |
return /*#__PURE__*/ react.default.createElement(Notice, { |
| 10614 |
className: "e-app-import-failed-plugins-notice", |
| 10615 |
label: (0, _wordpress_i18n.__)("Important:", "elementor"), |
| 10616 |
color: "warning", |
| 10617 |
button: function getButton() { |
| 10618 |
return /*#__PURE__*/ react.default.createElement(Button$29, { |
| 10619 |
text: (0, _wordpress_i18n.__)("Learn more", "elementor"), |
| 10620 |
variant: "outlined", |
| 10621 |
color: "secondary", |
| 10622 |
size: "sm", |
| 10623 |
target: "_blank", |
| 10624 |
url: "https://go.elementor.com/app-import-plugin-installation-failed/" |
| 10625 |
}); |
| 10626 |
}() |
| 10627 |
}, (0, _wordpress_i18n.__)("There are few plugins that we couldn't install:", "elementor") + " " + failedPlugins.map(function(_ref2) { |
| 10628 |
return _ref2.name; |
| 10629 |
}).join(" | ")); |
| 10630 |
} |
| 10631 |
FailedPluginsNotice.propTypes = { failedPlugins: import_prop_types$55.default.array }; |
| 10632 |
|
| 10633 |
//#endregion |
| 10634 |
//#region app/modules/import-export/assets/js/pages/import/import-complete/components/connect-pro-notice/connect-pro-notice.js |
| 10635 |
init_button(); |
| 10636 |
function ConnectProNotice() { |
| 10637 |
return /*#__PURE__*/ react.default.createElement(Notice, { |
| 10638 |
className: "e-app-import-connect-pro-notice", |
| 10639 |
label: (0, _wordpress_i18n.__)("Tip:", "elementor"), |
| 10640 |
color: "info", |
| 10641 |
button: function getButton() { |
| 10642 |
return /*#__PURE__*/ react.default.createElement(Button$29, { |
| 10643 |
text: (0, _wordpress_i18n.__)("Let’s do it", "elementor"), |
| 10644 |
variant: "outlined", |
| 10645 |
color: "secondary", |
| 10646 |
size: "sm", |
| 10647 |
target: "_blank", |
| 10648 |
url: elementorAppConfig.admin_url + "admin.php?page=elementor-license" |
| 10649 |
}); |
| 10650 |
}() |
| 10651 |
}, (0, _wordpress_i18n.__)("Make sure your Elementor Pro account is connected", "elementor")); |
| 10652 |
} |
| 10653 |
|
| 10654 |
//#endregion |
| 10655 |
//#region app/modules/import-export/assets/js/pages/import/import-complete/components/import-complete-footer/import-complete-footer.js |
| 10656 |
init_button(); |
| 10657 |
init_use_action(); |
| 10658 |
init_apps_event_tracking(); |
| 10659 |
function ImportCompleteFooter(_ref) { |
| 10660 |
var seeItLiveUrl = _ref.seeItLiveUrl; |
| 10661 |
var referrer = _ref.referrer; |
| 10662 |
var action = useAction(); |
| 10663 |
var eventTracking = function eventTracking(command) { |
| 10664 |
var eventType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "click"; |
| 10665 |
if ("kit-library" === referrer) appsEventTrackingDispatch(command, { |
| 10666 |
page_source: "kit is live", |
| 10667 |
element_location: "app_wizard_footer", |
| 10668 |
event_type: eventType |
| 10669 |
}); |
| 10670 |
}; |
| 10671 |
return /*#__PURE__*/ react.default.createElement(ActionsFooter, null, seeItLiveUrl && /*#__PURE__*/ react.default.createElement(Button$29, { |
| 10672 |
text: (0, _wordpress_i18n.__)("See It Live", "elementor"), |
| 10673 |
variant: "contained", |
| 10674 |
onClick: function onClick() { |
| 10675 |
eventTracking("kit-library/see-it-live"); |
| 10676 |
window.open(seeItLiveUrl, "_blank"); |
| 10677 |
} |
| 10678 |
}), /*#__PURE__*/ react.default.createElement(Button$29, { |
| 10679 |
text: (0, _wordpress_i18n.__)("Got It", "elementor"), |
| 10680 |
variant: "contained", |
| 10681 |
color: "primary", |
| 10682 |
onClick: function onClick() { |
| 10683 |
eventTracking("kit-library/close"); |
| 10684 |
action.backToDashboard(); |
| 10685 |
} |
| 10686 |
})); |
| 10687 |
} |
| 10688 |
ImportCompleteFooter.propTypes = { |
| 10689 |
seeItLiveUrl: import_prop_types$55.default.string, |
| 10690 |
referrer: import_prop_types$55.default.string |
| 10691 |
}; |
| 10692 |
|
| 10693 |
//#endregion |
| 10694 |
//#region app/modules/import-export/assets/js/pages/import/import-complete/hooks/use-imported-kit-data.js |
| 10695 |
function useImportedKitData() { |
| 10696 |
return { |
| 10697 |
getTemplates: function getTemplates(templates, importedData) { |
| 10698 |
var kitTemplates = {}; |
| 10699 |
for (var key in importedData === null || importedData === void 0 || (_importedData$templat = importedData.templates) === null || _importedData$templat === void 0 ? void 0 : _importedData$templat.succeed) { |
| 10700 |
var _importedData$templat; |
| 10701 |
kitTemplates[key] = templates[key]; |
| 10702 |
} |
| 10703 |
return kitTemplates; |
| 10704 |
}, |
| 10705 |
getContent: function getContent(content, importedData) { |
| 10706 |
var kitContent = {}; |
| 10707 |
for (var contentType in importedData === null || importedData === void 0 ? void 0 : importedData.content) { |
| 10708 |
kitContent[contentType] = {}; |
| 10709 |
for (var key in (_importedData$content = importedData.content[contentType]) === null || _importedData$content === void 0 ? void 0 : _importedData$content.succeed) { |
| 10710 |
var _importedData$content; |
| 10711 |
kitContent[contentType][key] = content[contentType][key]; |
| 10712 |
} |
| 10713 |
} |
| 10714 |
return kitContent; |
| 10715 |
}, |
| 10716 |
getWPContent: function getWPContent(content, importedData) { |
| 10717 |
var kitWPContent = {}; |
| 10718 |
for (var contentType in importedData === null || importedData === void 0 ? void 0 : importedData["wp-content"]) { |
| 10719 |
var _importedData$wpCont; |
| 10720 |
var succeededItems = (_importedData$wpCont = importedData["wp-content"][contentType]) === null || _importedData$wpCont === void 0 ? void 0 : _importedData$wpCont.succeed; |
| 10721 |
kitWPContent[contentType] = succeededItems ? Object.keys(succeededItems) : []; |
| 10722 |
} |
| 10723 |
return kitWPContent; |
| 10724 |
}, |
| 10725 |
getPlugins: function getPlugins(importedPlugins) { |
| 10726 |
var plugins = { |
| 10727 |
activePlugins: [], |
| 10728 |
failedPlugins: [] |
| 10729 |
}; |
| 10730 |
importedPlugins.forEach(function(plugin) { |
| 10731 |
plugins[PLUGIN_STATUS_MAP.ACTIVE === plugin.status ? "activePlugins" : "failedPlugins"].push(plugin); |
| 10732 |
}); |
| 10733 |
return plugins; |
| 10734 |
} |
| 10735 |
}; |
| 10736 |
} |
| 10737 |
|
| 10738 |
//#endregion |
| 10739 |
//#region app/modules/import-export/assets/js/pages/import/import-complete/import-complete.js |
| 10740 |
init_es$1(); |
| 10741 |
init_apps_event_tracking(); |
| 10742 |
function ImportComplete$1() { |
| 10743 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 10744 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 10745 |
var navigate = useNavigate(); |
| 10746 |
var _ref = importContext.data || {}; |
| 10747 |
var importedPlugins = _ref.importedPlugins; |
| 10748 |
var uploadedData = _ref.uploadedData; |
| 10749 |
var importedData = _ref.importedData; |
| 10750 |
var isProInstalledDuringProcess = _ref.isProInstalledDuringProcess; |
| 10751 |
var referrer = (sharedContext.data || {}).referrer; |
| 10752 |
var _useImportedKitData = useImportedKitData(); |
| 10753 |
var getTemplates = _useImportedKitData.getTemplates; |
| 10754 |
var getContent = _useImportedKitData.getContent; |
| 10755 |
var getWPContent = _useImportedKitData.getWPContent; |
| 10756 |
var getPlugins = _useImportedKitData.getPlugins; |
| 10757 |
var _getPlugins = getPlugins(importedPlugins); |
| 10758 |
var activePlugins = _getPlugins.activePlugins; |
| 10759 |
var failedPlugins = _getPlugins.failedPlugins; |
| 10760 |
var _ref3 = (importedData === null || importedData === void 0 ? void 0 : importedData.configData) || {}; |
| 10761 |
var elementorHomePageUrl = _ref3.elementorHomePageUrl; |
| 10762 |
var recentlyEditedElementorPageUrl = _ref3.recentlyEditedElementorPageUrl; |
| 10763 |
var seeItLiveUrl = elementorHomePageUrl || recentlyEditedElementorPageUrl || null; |
| 10764 |
var getKitData = function getKitData() { |
| 10765 |
if (!uploadedData || !importedData) return {}; |
| 10766 |
var manifest = uploadedData.manifest; |
| 10767 |
return { |
| 10768 |
templates: getTemplates(manifest.templates, importedData), |
| 10769 |
content: getContent(manifest.content, importedData), |
| 10770 |
"wp-content": getWPContent(manifest["wp-content"], importedData), |
| 10771 |
"site-settings": sharedContext.data.includes.includes("settings") ? manifest["site-settings"] : {}, |
| 10772 |
plugins: activePlugins, |
| 10773 |
configData: importedData.configData |
| 10774 |
}; |
| 10775 |
}; |
| 10776 |
var eventTracking = function eventTracking(command, source) { |
| 10777 |
var eventType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click"; |
| 10778 |
var elementLocation = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 10779 |
if ("kit-library" === referrer) appsEventTrackingDispatch(command, { |
| 10780 |
page_source: source, |
| 10781 |
event_type: eventType, |
| 10782 |
element_location: elementLocation |
| 10783 |
}); |
| 10784 |
}; |
| 10785 |
var kitData = (0, react.useMemo)(function() { |
| 10786 |
return getKitData(); |
| 10787 |
}, []); |
| 10788 |
(0, react.useEffect)(function() { |
| 10789 |
if (!uploadedData) navigate("/import"); |
| 10790 |
if (uploadedData) eventTracking("kit-library/kit-is-live-load", "kit is live", "load"); |
| 10791 |
sharedContext.dispatch({ |
| 10792 |
type: "SET_CURRENT_PAGE_NAME", |
| 10793 |
payload: ImportComplete$1.name |
| 10794 |
}); |
| 10795 |
}, []); |
| 10796 |
return /*#__PURE__*/ react.default.createElement(Layout, { |
| 10797 |
type: "import", |
| 10798 |
footer: /*#__PURE__*/ react.default.createElement(ImportCompleteFooter, { |
| 10799 |
seeItLiveUrl, |
| 10800 |
referrer |
| 10801 |
}) |
| 10802 |
}, /*#__PURE__*/ react.default.createElement(WizardStep, { |
| 10803 |
image: elementorAppConfig.assets_url + "images/kit-is-live.svg", |
| 10804 |
heading: (0, _wordpress_i18n.__)("We applied your template and your site is online!", "elementor"), |
| 10805 |
description: (0, _wordpress_i18n.__)("You've imported and applied the following to your site:", "elementor"), |
| 10806 |
notice: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 10807 |
url: "https://go.elementor.com/app-what-are-kits", |
| 10808 |
italic: true, |
| 10809 |
onClick: function onClick() { |
| 10810 |
return eventTracking("kit-library/seek-more-info", "kit is live", "click", "app_header"); |
| 10811 |
} |
| 10812 |
}, (0, _wordpress_i18n.__)("Click here", "elementor")), " ", (0, _wordpress_i18n.__)("to learn more about building your site with Elementor Website Templates", "elementor")) |
| 10813 |
}, !!failedPlugins.length && /*#__PURE__*/ react.default.createElement(FailedPluginsNotice, { failedPlugins }), isProInstalledDuringProcess && /*#__PURE__*/ react.default.createElement(ConnectProNotice, null), /*#__PURE__*/ react.default.createElement(kit_data_default, { data: kitData }))); |
| 10814 |
} |
| 10815 |
__name(ImportComplete$1, "ImportComplete"); |
| 10816 |
|
| 10817 |
//#endregion |
| 10818 |
//#region app/modules/import-export/assets/js/shared/plugins-selection/components/plugins-table.js |
| 10819 |
init_icon(); |
| 10820 |
function PluginsTable(_ref) { |
| 10821 |
var plugins = _ref.plugins; |
| 10822 |
var layout = _ref.layout; |
| 10823 |
var withHeader = _ref.withHeader; |
| 10824 |
var withStatus = _ref.withStatus; |
| 10825 |
var onSelect = _ref.onSelect; |
| 10826 |
var initialSelected = _ref.initialSelected; |
| 10827 |
var initialDisabled = _ref.initialDisabled; |
| 10828 |
var CellText = function CellText(cellTextProps) { |
| 10829 |
return /*#__PURE__*/ react.default.createElement(Text$11, { className: "e-app-import-export-plugins-table__cell-content" }, cellTextProps.text); |
| 10830 |
}; |
| 10831 |
var CellLink = function CellLink(cellLinkProps) { |
| 10832 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 10833 |
url: cellLinkProps.url, |
| 10834 |
underline: "none" |
| 10835 |
}, "".concat((0, _wordpress_i18n.__)("Version"), " ").concat(cellLinkProps.text), " ", /*#__PURE__*/ react.default.createElement(Icon$2, { className: "eicon-editor-external-link" })); |
| 10836 |
}; |
| 10837 |
var getHeaders = function getHeaders() { |
| 10838 |
if (!withHeader) return []; |
| 10839 |
var headers = ["Plugin Name", "Version"]; |
| 10840 |
if (withStatus) headers.splice(1, 0, "Status"); |
| 10841 |
return headers; |
| 10842 |
}; |
| 10843 |
var rows = plugins.map(function(_ref2) { |
| 10844 |
var name = _ref2.name; |
| 10845 |
var status = _ref2.status; |
| 10846 |
var version = _ref2.version; |
| 10847 |
var pluginUrl = _ref2.plugin_uri; |
| 10848 |
var row = [/*#__PURE__*/ react.default.createElement(CellText, { |
| 10849 |
text: name, |
| 10850 |
key: name |
| 10851 |
}), /*#__PURE__*/ react.default.createElement(CellLink, { |
| 10852 |
text: version, |
| 10853 |
url: pluginUrl, |
| 10854 |
key: name |
| 10855 |
})]; |
| 10856 |
if (withStatus) row.splice(1, 0, /*#__PURE__*/ react.default.createElement(CellText, { |
| 10857 |
text: status, |
| 10858 |
key: name |
| 10859 |
})); |
| 10860 |
return row; |
| 10861 |
}); |
| 10862 |
return /*#__PURE__*/ react.default.createElement(DataTable, { |
| 10863 |
selection: true, |
| 10864 |
headers: getHeaders(), |
| 10865 |
rows, |
| 10866 |
onSelect, |
| 10867 |
initialSelected, |
| 10868 |
initialDisabled, |
| 10869 |
layout, |
| 10870 |
className: "e-app-import-export-plugins-table" |
| 10871 |
}); |
| 10872 |
} |
| 10873 |
PluginsTable.propTypes = { |
| 10874 |
onSelect: import_prop_types$55.default.func, |
| 10875 |
initialDisabled: import_prop_types$55.default.array, |
| 10876 |
initialSelected: import_prop_types$55.default.array, |
| 10877 |
plugins: import_prop_types$55.default.array, |
| 10878 |
withHeader: import_prop_types$55.default.bool, |
| 10879 |
withStatus: import_prop_types$55.default.bool, |
| 10880 |
layout: import_prop_types$55.default.array |
| 10881 |
}; |
| 10882 |
PluginsTable.defaultProps = { |
| 10883 |
initialDisabled: [], |
| 10884 |
initialSelected: [], |
| 10885 |
plugins: [], |
| 10886 |
withHeader: true, |
| 10887 |
withStatus: true |
| 10888 |
}; |
| 10889 |
var plugins_table_default = (0, react.memo)(PluginsTable); |
| 10890 |
|
| 10891 |
//#endregion |
| 10892 |
//#region app/modules/import-export/assets/js/shared/plugins-selection/plugins-selection.js |
| 10893 |
function PluginsSelection(_ref) { |
| 10894 |
var plugins = _ref.plugins; |
| 10895 |
var initialSelected = _ref.initialSelected; |
| 10896 |
var initialDisabled = _ref.initialDisabled; |
| 10897 |
var withHeader = _ref.withHeader; |
| 10898 |
var withStatus = _ref.withStatus; |
| 10899 |
var layout = _ref.layout; |
| 10900 |
var onSelect = _ref.onSelect; |
| 10901 |
if (!plugins.length) return null; |
| 10902 |
var cachedPlugins = (0, react.useMemo)(function() { |
| 10903 |
return plugins; |
| 10904 |
}, [plugins]); |
| 10905 |
var cachedInitialSelected = (0, react.useMemo)(function() { |
| 10906 |
return initialSelected; |
| 10907 |
}, [plugins]); |
| 10908 |
var cachedInitialDisabled = (0, react.useMemo)(function() { |
| 10909 |
return initialDisabled; |
| 10910 |
}, [plugins]); |
| 10911 |
return /*#__PURE__*/ react.default.createElement(plugins_table_default, { |
| 10912 |
plugins: cachedPlugins, |
| 10913 |
initialDisabled: cachedInitialDisabled, |
| 10914 |
initialSelected: cachedInitialSelected, |
| 10915 |
onSelect: function handleOnSelect(selectedIndexes) { |
| 10916 |
if (!onSelect) return; |
| 10917 |
onSelect(selectedIndexes.map(function(pluginIndex) { |
| 10918 |
return plugins[pluginIndex]; |
| 10919 |
})); |
| 10920 |
}, |
| 10921 |
withHeader, |
| 10922 |
withStatus, |
| 10923 |
layout |
| 10924 |
}); |
| 10925 |
} |
| 10926 |
PluginsSelection.propTypes = { |
| 10927 |
initialDisabled: import_prop_types$55.default.array, |
| 10928 |
initialSelected: import_prop_types$55.default.array, |
| 10929 |
layout: import_prop_types$55.default.array, |
| 10930 |
onSelect: import_prop_types$55.default.func, |
| 10931 |
plugins: import_prop_types$55.default.array, |
| 10932 |
selection: import_prop_types$55.default.bool, |
| 10933 |
withHeader: import_prop_types$55.default.bool, |
| 10934 |
withStatus: import_prop_types$55.default.bool |
| 10935 |
}; |
| 10936 |
PluginsSelection.defaultProps = { |
| 10937 |
initialDisabled: [], |
| 10938 |
initialSelected: [], |
| 10939 |
plugins: [], |
| 10940 |
selection: true, |
| 10941 |
withHeader: true, |
| 10942 |
withStatus: true |
| 10943 |
}; |
| 10944 |
var plugins_selection_default = (0, react.memo)(PluginsSelection); |
| 10945 |
|
| 10946 |
//#endregion |
| 10947 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins/components/plugins-to-import/plugins-to-import.js |
| 10948 |
var layout$2 = [ |
| 10949 |
3, |
| 10950 |
1, |
| 10951 |
1 |
| 10952 |
]; |
| 10953 |
function PluginsToImport(_ref) { |
| 10954 |
var plugins = _ref.plugins; |
| 10955 |
if (!(plugins !== null && plugins !== void 0 && plugins.length)) return null; |
| 10956 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 10957 |
var getPluginsToImport = function getPluginsToImport() { |
| 10958 |
var _plugins$ = plugins[0]; |
| 10959 |
var name = _plugins$.name; |
| 10960 |
var status = _plugins$.status; |
| 10961 |
if (PLUGINS_KEYS.ELEMENTOR_PRO === name && PLUGIN_STATUS_MAP.INACTIVE !== status) return plugins.splice(1); |
| 10962 |
return plugins; |
| 10963 |
}; |
| 10964 |
var handleOnSelect = (0, react.useCallback)(function(selectedPlugins) { |
| 10965 |
return importContext.dispatch({ |
| 10966 |
type: "SET_PLUGINS", |
| 10967 |
payload: selectedPlugins |
| 10968 |
}); |
| 10969 |
}, []); |
| 10970 |
var pluginsToImport = (0, react.useMemo)(function() { |
| 10971 |
return getPluginsToImport(); |
| 10972 |
}, [plugins]); |
| 10973 |
var initialSelected = (0, react.useMemo)(function() { |
| 10974 |
return pluginsToImport.map(function(plugin, index) { |
| 10975 |
return index; |
| 10976 |
}); |
| 10977 |
}, [plugins]); |
| 10978 |
var isAllRequiredPluginsSelected = pluginsToImport.length === importContext.data.plugins.length; |
| 10979 |
if (!pluginsToImport.length) return null; |
| 10980 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-app-import-plugins__section" }, /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 10981 |
variant: "h5", |
| 10982 |
tag: "h3", |
| 10983 |
className: "e-app-import-plugins__section-heading" |
| 10984 |
}, isAllRequiredPluginsSelected ? (0, _wordpress_i18n.__)("Plugins to add:", "elementor") : (0, _wordpress_i18n.__)("Missing Required Plugins:", "elementor")), /*#__PURE__*/ react.default.createElement(plugins_selection_default, { |
| 10985 |
plugins: pluginsToImport, |
| 10986 |
initialSelected, |
| 10987 |
onSelect: handleOnSelect, |
| 10988 |
layout: layout$2 |
| 10989 |
})); |
| 10990 |
} |
| 10991 |
PluginsToImport.propTypes = { plugins: import_prop_types$55.default.array }; |
| 10992 |
|
| 10993 |
//#endregion |
| 10994 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins/components/existing-plugins/existing-plugins.js |
| 10995 |
var layout$1 = [4, 1]; |
| 10996 |
function ExistingPlugins(_ref) { |
| 10997 |
var plugins = _ref.plugins; |
| 10998 |
if (!(plugins !== null && plugins !== void 0 && plugins.length)) return null; |
| 10999 |
var existingPlugins = (0, react.useMemo)(function() { |
| 11000 |
return plugins; |
| 11001 |
}, []); |
| 11002 |
var initialSelected = (0, react.useMemo)(function() { |
| 11003 |
return plugins.map(function(plugin, index) { |
| 11004 |
return index; |
| 11005 |
}); |
| 11006 |
}, []); |
| 11007 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-app-import-plugins__section" }, /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 11008 |
variant: "h5", |
| 11009 |
tag: "h3", |
| 11010 |
className: "e-app-import-plugins__section-heading" |
| 11011 |
}, (0, _wordpress_i18n.__)("Plugins you already have:", "elementor")), /*#__PURE__*/ react.default.createElement(plugins_selection_default, { |
| 11012 |
withHeader: false, |
| 11013 |
withStatus: false, |
| 11014 |
plugins: existingPlugins, |
| 11015 |
initialSelected, |
| 11016 |
initialDisabled: initialSelected, |
| 11017 |
excludeSelections: initialSelected, |
| 11018 |
layout: layout$1 |
| 11019 |
})); |
| 11020 |
} |
| 11021 |
ExistingPlugins.propTypes = { plugins: import_prop_types$55.default.array }; |
| 11022 |
|
| 11023 |
//#endregion |
| 11024 |
//#region app/modules/import-export/assets/js/ui/message-banner/message-banner.js |
| 11025 |
function MessageBanner(_ref) { |
| 11026 |
var heading = _ref.heading; |
| 11027 |
var description = _ref.description; |
| 11028 |
var button = _ref.button; |
| 11029 |
return /*#__PURE__*/ react.default.createElement(Box$22, { |
| 11030 |
className: "e-app-import-export-message-banner", |
| 11031 |
padding: "20" |
| 11032 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 11033 |
container: true, |
| 11034 |
alignItems: "center", |
| 11035 |
justify: "space-between" |
| 11036 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { item: true }, heading && /*#__PURE__*/ react.default.createElement(Heading$11, { |
| 11037 |
className: "e-app-import-export-message-banner__heading", |
| 11038 |
variant: "h3", |
| 11039 |
tag: "h3" |
| 11040 |
}, heading), description && /*#__PURE__*/ react.default.createElement(Text$11, { className: "e-app-import-export-message-banner__description" }, function getDescriptionContent() { |
| 11041 |
if (Array.isArray(description)) return description.join(/*#__PURE__*/ react.default.createElement("br", null)); |
| 11042 |
return description; |
| 11043 |
}())), button && /*#__PURE__*/ react.default.createElement(Grid$14, { item: true }, button))); |
| 11044 |
} |
| 11045 |
MessageBanner.propTypes = { |
| 11046 |
heading: import_prop_types$55.default.string, |
| 11047 |
description: import_prop_types$55.default.oneOfType([import_prop_types$55.default.string, import_prop_types$55.default.array]), |
| 11048 |
button: import_prop_types$55.default.object |
| 11049 |
}; |
| 11050 |
|
| 11051 |
//#endregion |
| 11052 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins/components/pro-banner/pro-banner.js |
| 11053 |
init_slicedToArray(); |
| 11054 |
function ProBanner(_ref) { |
| 11055 |
var onRefresh = _ref.onRefresh; |
| 11056 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 11057 |
var showInfoDialog = _useState2[0]; |
| 11058 |
var setShowInfoDialog = _useState2[1]; |
| 11059 |
var openGoProExternalPage = function openGoProExternalPage() { |
| 11060 |
return window.open("https://go.elementor.com/go-pro-import-export/", "_blank"); |
| 11061 |
}; |
| 11062 |
var onDialogDismiss = function onDialogDismiss() { |
| 11063 |
return setShowInfoDialog(false); |
| 11064 |
}; |
| 11065 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(MessageBanner, { |
| 11066 |
heading: (0, _wordpress_i18n.__)("Install Elementor Pro", "elementor"), |
| 11067 |
description: (0, _wordpress_i18n.__)("Without Elementor Pro, importing components like templates, widgets and popups won't work.", "elementor"), |
| 11068 |
button: /*#__PURE__*/ react.default.createElement(GoProButton, { onClick: function handleGoPro() { |
| 11069 |
setShowInfoDialog(true); |
| 11070 |
openGoProExternalPage(); |
| 11071 |
} }) |
| 11072 |
}), showInfoDialog && /*#__PURE__*/ react.default.createElement(Dialog$9, { |
| 11073 |
title: (0, _wordpress_i18n.__)("Is your Elementor Pro ready?", "elementor"), |
| 11074 |
text: (0, _wordpress_i18n.__)("If you’ve purchased, installed & activated Elementor Pro, we can continue importing all the parts of this site.", "elementor"), |
| 11075 |
approveButtonColor: "primary", |
| 11076 |
approveButtonText: (0, _wordpress_i18n.__)("Yes", "elementor"), |
| 11077 |
approveButtonOnClick: function onDialogApprove() { |
| 11078 |
setShowInfoDialog(false); |
| 11079 |
onRefresh(); |
| 11080 |
}, |
| 11081 |
dismissButtonText: (0, _wordpress_i18n.__)("Not yet", "elementor"), |
| 11082 |
dismissButtonOnClick: onDialogDismiss, |
| 11083 |
onClose: onDialogDismiss |
| 11084 |
})); |
| 11085 |
} |
| 11086 |
ProBanner.propTypes = { |
| 11087 |
status: import_prop_types$55.default.string, |
| 11088 |
onRefresh: import_prop_types$55.default.func |
| 11089 |
}; |
| 11090 |
ProBanner.defaultProps = { status: "" }; |
| 11091 |
|
| 11092 |
//#endregion |
| 11093 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins/components/import-plugins-footer/import-plugins-footer.js |
| 11094 |
init_button(); |
| 11095 |
function ImportPluginsFooter(props) { |
| 11096 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 11097 |
var navigateToMainScreen = useImportActions().navigateToMainScreen; |
| 11098 |
return /*#__PURE__*/ react.default.createElement(ActionsFooter, null, /*#__PURE__*/ react.default.createElement(Button$29, { |
| 11099 |
text: (0, _wordpress_i18n.__)("Previous", "elementor"), |
| 11100 |
variant: "contained", |
| 11101 |
onClick: function onClick() { |
| 11102 |
var _props$onPreviousClic; |
| 11103 |
importContext.dispatch({ |
| 11104 |
type: "SET_FILE", |
| 11105 |
payload: null |
| 11106 |
}); |
| 11107 |
(_props$onPreviousClic = props.onPreviousClick) === null || _props$onPreviousClic === void 0 || _props$onPreviousClic.call(props); |
| 11108 |
navigateToMainScreen(); |
| 11109 |
} |
| 11110 |
}), /*#__PURE__*/ react.default.createElement(Button$29, { |
| 11111 |
variant: "contained", |
| 11112 |
text: (0, _wordpress_i18n.__)("Next", "elementor"), |
| 11113 |
color: "primary", |
| 11114 |
url: "/import/content", |
| 11115 |
onClick: function onClick() { |
| 11116 |
var _props$onNextClick; |
| 11117 |
(_props$onNextClick = props.onNextClick) === null || _props$onNextClick === void 0 || _props$onNextClick.call(props); |
| 11118 |
} |
| 11119 |
})); |
| 11120 |
} |
| 11121 |
ImportPluginsFooter.propTypes = { |
| 11122 |
onPreviousClick: import_prop_types$55.default.func, |
| 11123 |
onNextClick: import_prop_types$55.default.func |
| 11124 |
}; |
| 11125 |
|
| 11126 |
//#endregion |
| 11127 |
//#region app/modules/import-export/assets/js/ui/loader/loader.js |
| 11128 |
init_utils$4(); |
| 11129 |
init_icon(); |
| 11130 |
function Loader(_ref) { |
| 11131 |
var absoluteCenter = _ref.absoluteCenter; |
| 11132 |
var baseClassName = "e-app-import-export-loader"; |
| 11133 |
var classes = [baseClassName, "eicon-loading eicon-animation-spin"]; |
| 11134 |
if (absoluteCenter) classes.push(baseClassName + "--absolute-center"); |
| 11135 |
return /*#__PURE__*/ react.default.createElement(Icon$2, { className: arrayToClassName(classes) }); |
| 11136 |
} |
| 11137 |
Loader.propTypes = { absoluteCenter: import_prop_types$55.default.bool }; |
| 11138 |
Loader.defaultProps = { absoluteCenter: false }; |
| 11139 |
|
| 11140 |
//#endregion |
| 11141 |
//#region app/modules/import-export/assets/js/pages/import/import-plugins/import-plugins.js |
| 11142 |
init_es$1(); |
| 11143 |
init_apps_event_tracking(); |
| 11144 |
function ImportPlugins() { |
| 11145 |
var _importContext$data$u; |
| 11146 |
var importContext = (0, react.useContext)(ImportContext$1); |
| 11147 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 11148 |
var navigate = useNavigate(); |
| 11149 |
var kitPlugins = ((_importContext$data$u = importContext.data.uploadedData) === null || _importContext$data$u === void 0 || (_importContext$data$u = _importContext$data$u.manifest) === null || _importContext$data$u === void 0 ? void 0 : _importContext$data$u.plugins) || []; |
| 11150 |
var _usePlugins = usePlugins(); |
| 11151 |
var response = _usePlugins.response; |
| 11152 |
var pluginsActions = _usePlugins.pluginsActions; |
| 11153 |
var pluginsData = usePluginsData(response.data).pluginsData; |
| 11154 |
var importPluginsData = useImportPluginsData(kitPlugins, pluginsData).importPluginsData; |
| 11155 |
var _ref = importPluginsData || {}; |
| 11156 |
var missing = _ref.missing; |
| 11157 |
var existing = _ref.existing; |
| 11158 |
var minVersionMissing = _ref.minVersionMissing; |
| 11159 |
var proData = _ref.proData; |
| 11160 |
var _ref2 = sharedContext.data || {}; |
| 11161 |
var referrer = _ref2.referrer; |
| 11162 |
var currentPage = _ref2.currentPage; |
| 11163 |
var handleRequiredPlugins = function handleRequiredPlugins() { |
| 11164 |
if (missing.length) importContext.dispatch({ |
| 11165 |
type: "SET_REQUIRED_PLUGINS", |
| 11166 |
payload: missing |
| 11167 |
}); |
| 11168 |
}; |
| 11169 |
var handleRefresh = function handleRefresh() { |
| 11170 |
importContext.dispatch({ |
| 11171 |
type: "SET_REQUIRED_PLUGINS", |
| 11172 |
payload: [] |
| 11173 |
}); |
| 11174 |
pluginsActions.fetch(); |
| 11175 |
}; |
| 11176 |
var handleProInstallationStatus = function handleProInstallationStatus() { |
| 11177 |
if (proData && !elementorAppConfig.hasPro) importContext.dispatch({ |
| 11178 |
type: "SET_IS_PRO_INSTALLED_DURING_PROCESS", |
| 11179 |
payload: true |
| 11180 |
}); |
| 11181 |
}; |
| 11182 |
var eventTracking = function eventTracking(command) { |
| 11183 |
if ("kit-library" === referrer) appsEventTrackingDispatch(command, { |
| 11184 |
page_source: "import", |
| 11185 |
step: currentPage, |
| 11186 |
event_type: "click" |
| 11187 |
}); |
| 11188 |
}; |
| 11189 |
(0, react.useEffect)(function() { |
| 11190 |
if (!kitPlugins.length) navigate("import/content"); |
| 11191 |
sharedContext.dispatch({ |
| 11192 |
type: "SET_CURRENT_PAGE_NAME", |
| 11193 |
payload: ImportPlugins.name |
| 11194 |
}); |
| 11195 |
}, []); |
| 11196 |
(0, react.useEffect)(function() { |
| 11197 |
if (importPluginsData && !importContext.data.requiredPlugins.length) { |
| 11198 |
handleRequiredPlugins(); |
| 11199 |
handleProInstallationStatus(); |
| 11200 |
} |
| 11201 |
}, [importPluginsData]); |
| 11202 |
return /*#__PURE__*/ react.default.createElement(Layout, { |
| 11203 |
type: "import", |
| 11204 |
footer: /*#__PURE__*/ react.default.createElement(ImportPluginsFooter, { |
| 11205 |
onPreviousClick: function onPreviousClick() { |
| 11206 |
return eventTracking("kit-library/go-back"); |
| 11207 |
}, |
| 11208 |
onNextClick: function onNextClick() { |
| 11209 |
return eventTracking("kit-library/approve-selection"); |
| 11210 |
} |
| 11211 |
}) |
| 11212 |
}, /*#__PURE__*/ react.default.createElement("section", { className: "e-app-import-plugins" }, !importPluginsData && /*#__PURE__*/ react.default.createElement(Loader, { absoluteCenter: true }), /*#__PURE__*/ react.default.createElement(PageHeader$1, { |
| 11213 |
heading: (0, _wordpress_i18n.__)("Select which plugins to include", "elementor"), |
| 11214 |
description: (0, _wordpress_i18n.__)("All items are already selected by default. Uncheck the ones you don't want.", "elementor") |
| 11215 |
}), !!(minVersionMissing !== null && minVersionMissing !== void 0 && minVersionMissing.length) && /*#__PURE__*/ react.default.createElement(Notice, { |
| 11216 |
label: (0, _wordpress_i18n.__)(" Recommended:", "elementor"), |
| 11217 |
className: "e-app-import-plugins__versions-notice", |
| 11218 |
color: "warning" |
| 11219 |
}, (0, _wordpress_i18n.__)("Head over to Updates and make sure that your plugins are updated to the latest version.", "elementor"), " ", /*#__PURE__*/ react.default.createElement(InlineLink, { url: elementorAppConfig.admin_url + "update-core.php" }, (0, _wordpress_i18n.__)("Take me there", "elementor"))), PLUGIN_STATUS_MAP.NOT_INSTALLED === (proData === null || proData === void 0 ? void 0 : proData.status) && /*#__PURE__*/ react.default.createElement(ProBanner, { onRefresh: handleRefresh }), /*#__PURE__*/ react.default.createElement(PluginsToImport, { plugins: missing }), /*#__PURE__*/ react.default.createElement(ExistingPlugins, { plugins: existing }))); |
| 11220 |
} |
| 11221 |
|
| 11222 |
//#endregion |
| 11223 |
//#region app/modules/import-export/assets/js/import.js |
| 11224 |
init_es$1(); |
| 11225 |
function Import$1() { |
| 11226 |
return /*#__PURE__*/ react.default.createElement(SharedContextProvider, null, /*#__PURE__*/ react.default.createElement(ImportContextProvider$1, null, /*#__PURE__*/ react.default.createElement(LocationProvider, { history: _elementor_router.default.appHistory }, /*#__PURE__*/ react.default.createElement(Router, null, /*#__PURE__*/ react.default.createElement(ImportComplete$1, { path: "complete" }), /*#__PURE__*/ react.default.createElement(ImportProcess$1, { path: "process" }), /*#__PURE__*/ react.default.createElement(ImportResolver, { path: "resolver" }), /*#__PURE__*/ react.default.createElement(ImportContent, { path: "content" }), /*#__PURE__*/ react.default.createElement(ImportPlugins, { path: "plugins" }), /*#__PURE__*/ react.default.createElement(ImportPluginsActivation, { path: "plugins-activation" }), /*#__PURE__*/ react.default.createElement(ImportKit$1, { default: true }))))); |
| 11227 |
} |
| 11228 |
__name(Import$1, "Import"); |
| 11229 |
|
| 11230 |
//#endregion |
| 11231 |
//#region app/modules/import-export/assets/js/context/export-context/export-context-reducer.js |
| 11232 |
init_defineProperty$1(); |
| 11233 |
function ownKeys$21(e, r) { |
| 11234 |
var t = Object.keys(e); |
| 11235 |
if (Object.getOwnPropertySymbols) { |
| 11236 |
var o = Object.getOwnPropertySymbols(e); |
| 11237 |
r && (o = o.filter(function(r) { |
| 11238 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 11239 |
})), t.push.apply(t, o); |
| 11240 |
} |
| 11241 |
return t; |
| 11242 |
} |
| 11243 |
__name(ownKeys$21, "ownKeys"); |
| 11244 |
function _objectSpread$20(e) { |
| 11245 |
for (var r = 1; r < arguments.length; r++) { |
| 11246 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 11247 |
r % 2 ? ownKeys$21(Object(t), !0).forEach(function(r) { |
| 11248 |
_defineProperty$1(e, r, t[r]); |
| 11249 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$21(Object(t)).forEach(function(r) { |
| 11250 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 11251 |
}); |
| 11252 |
} |
| 11253 |
return e; |
| 11254 |
} |
| 11255 |
__name(_objectSpread$20, "_objectSpread"); |
| 11256 |
var reducer$1 = function reducer(state, _ref) { |
| 11257 |
var type = _ref.type; |
| 11258 |
var payload = _ref.payload; |
| 11259 |
switch (type) { |
| 11260 |
case "SET_DOWNLOAD_URL": return _objectSpread$20(_objectSpread$20({}, state), {}, { downloadUrl: payload }); |
| 11261 |
case "SET_EXPORTED_DATA": return _objectSpread$20(_objectSpread$20({}, state), {}, { exportedData: payload }); |
| 11262 |
case "SET_PLUGINS": return _objectSpread$20(_objectSpread$20({}, state), {}, { plugins: payload }); |
| 11263 |
case "SET_IS_EXPORT_PROCESS_STARTED": return _objectSpread$20(_objectSpread$20({}, state), {}, { isExportProcessStarted: payload }); |
| 11264 |
case "SET_KIT_TITLE": return _objectSpread$20(_objectSpread$20({}, state), {}, { kitInfo: _objectSpread$20(_objectSpread$20({}, state.kitInfo), {}, { title: payload }) }); |
| 11265 |
case "SET_KIT_DESCRIPTION": return _objectSpread$20(_objectSpread$20({}, state), {}, { kitInfo: _objectSpread$20(_objectSpread$20({}, state.kitInfo), {}, { description: payload }) }); |
| 11266 |
case "SET_KIT_SAVE_SOURCE": return _objectSpread$20(_objectSpread$20({}, state), {}, { kitInfo: _objectSpread$20(_objectSpread$20({}, state.kitInfo), {}, { source: payload }) }); |
| 11267 |
default: return state; |
| 11268 |
} |
| 11269 |
}; |
| 11270 |
|
| 11271 |
//#endregion |
| 11272 |
//#region app/modules/import-export/assets/js/context/export-context/export-context-provider.js |
| 11273 |
init_slicedToArray(); |
| 11274 |
var ExportContext$1 = react.default.createContext(); |
| 11275 |
function ExportContextProvider$1(props) { |
| 11276 |
var _useReducer2 = _slicedToArray((0, react.useReducer)(reducer$1, { |
| 11277 |
downloadUrl: "", |
| 11278 |
exportedData: null, |
| 11279 |
isExportProcessStarted: false, |
| 11280 |
plugins: [], |
| 11281 |
kitInfo: { |
| 11282 |
title: null, |
| 11283 |
description: null, |
| 11284 |
source: null |
| 11285 |
} |
| 11286 |
}), 2); |
| 11287 |
var data = _useReducer2[0]; |
| 11288 |
var dispatch = _useReducer2[1]; |
| 11289 |
return /*#__PURE__*/ react.default.createElement(ExportContext$1.Provider, { value: { |
| 11290 |
data, |
| 11291 |
dispatch |
| 11292 |
} }, props.children); |
| 11293 |
} |
| 11294 |
__name(ExportContextProvider$1, "ExportContextProvider"); |
| 11295 |
ExportContextProvider$1.propTypes = { children: import_prop_types$55.default.object.isRequired }; |
| 11296 |
|
| 11297 |
//#endregion |
| 11298 |
//#region app/modules/import-export/assets/js/context/connect-state-context.js |
| 11299 |
init_slicedToArray(); |
| 11300 |
var ConnectStateContext$1 = (0, react.createContext)(); |
| 11301 |
function ConnectStateProvider$1(_ref) { |
| 11302 |
var children = _ref.children; |
| 11303 |
var _useState2 = _slicedToArray((0, react.useState)(elementorCommon.config.library_connect.is_connected), 2); |
| 11304 |
var isConnected = _useState2[0]; |
| 11305 |
var setIsConnected = _useState2[1]; |
| 11306 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 11307 |
var isConnecting = _useState4[0]; |
| 11308 |
var setIsConnecting = _useState4[1]; |
| 11309 |
var handleConnectSuccess = (0, react.useCallback)(function(callback) { |
| 11310 |
setIsConnecting(true); |
| 11311 |
setIsConnected(true); |
| 11312 |
elementorCommon.config.library_connect.is_connected = true; |
| 11313 |
if (callback) callback(); |
| 11314 |
}, []); |
| 11315 |
var handleConnectError = (0, react.useCallback)(function(callback) { |
| 11316 |
setIsConnected(false); |
| 11317 |
setIsConnecting(false); |
| 11318 |
elementorCommon.config.library_connect.is_connected = false; |
| 11319 |
if (callback) callback(); |
| 11320 |
}, []); |
| 11321 |
var value = { |
| 11322 |
isConnected, |
| 11323 |
isConnecting, |
| 11324 |
setConnecting: (0, react.useCallback)(function(connecting) { |
| 11325 |
setIsConnecting(connecting); |
| 11326 |
}, []), |
| 11327 |
handleConnectSuccess, |
| 11328 |
handleConnectError |
| 11329 |
}; |
| 11330 |
return /*#__PURE__*/ react.default.createElement(ConnectStateContext$1.Provider, { value }, children); |
| 11331 |
} |
| 11332 |
__name(ConnectStateProvider$1, "ConnectStateProvider"); |
| 11333 |
ConnectStateProvider$1.propTypes = { children: import_prop_types$55.default.node.isRequired }; |
| 11334 |
|
| 11335 |
//#endregion |
| 11336 |
//#region node_modules/@babel/runtime/helpers/esm/inheritsLoose.js |
| 11337 |
function _inheritsLoose(t, o) { |
| 11338 |
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o); |
| 11339 |
} |
| 11340 |
var init_inheritsLoose = __esmMin((() => { |
| 11341 |
init_setPrototypeOf(); |
| 11342 |
})); |
| 11343 |
|
| 11344 |
//#endregion |
| 11345 |
//#region node_modules/react-query/es/core/subscribable.js |
| 11346 |
var Subscribable; |
| 11347 |
var init_subscribable = __esmMin((() => { |
| 11348 |
Subscribable = /*#__PURE__*/ function() { |
| 11349 |
function Subscribable() { |
| 11350 |
this.listeners = []; |
| 11351 |
} |
| 11352 |
var _proto = Subscribable.prototype; |
| 11353 |
_proto.subscribe = function subscribe(listener) { |
| 11354 |
var _this = this; |
| 11355 |
var callback = listener || function() {}; |
| 11356 |
this.listeners.push(callback); |
| 11357 |
this.onSubscribe(); |
| 11358 |
return function() { |
| 11359 |
_this.listeners = _this.listeners.filter(function(x) { |
| 11360 |
return x !== callback; |
| 11361 |
}); |
| 11362 |
_this.onUnsubscribe(); |
| 11363 |
}; |
| 11364 |
}; |
| 11365 |
_proto.hasListeners = function hasListeners() { |
| 11366 |
return this.listeners.length > 0; |
| 11367 |
}; |
| 11368 |
_proto.onSubscribe = function onSubscribe() {}; |
| 11369 |
_proto.onUnsubscribe = function onUnsubscribe() {}; |
| 11370 |
return Subscribable; |
| 11371 |
}(); |
| 11372 |
})); |
| 11373 |
|
| 11374 |
//#endregion |
| 11375 |
//#region node_modules/react-query/es/core/utils.js |
| 11376 |
function noop() {} |
| 11377 |
function functionalUpdate(updater, input) { |
| 11378 |
return typeof updater === "function" ? updater(input) : updater; |
| 11379 |
} |
| 11380 |
function isValidTimeout(value) { |
| 11381 |
return typeof value === "number" && value >= 0 && value !== Infinity; |
| 11382 |
} |
| 11383 |
function ensureQueryKeyArray(value) { |
| 11384 |
return Array.isArray(value) ? value : [value]; |
| 11385 |
} |
| 11386 |
function timeUntilStale(updatedAt, staleTime) { |
| 11387 |
return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0); |
| 11388 |
} |
| 11389 |
function parseQueryArgs(arg1, arg2, arg3) { |
| 11390 |
if (!isQueryKey(arg1)) return arg1; |
| 11391 |
if (typeof arg2 === "function") return _extends({}, arg3, { |
| 11392 |
queryKey: arg1, |
| 11393 |
queryFn: arg2 |
| 11394 |
}); |
| 11395 |
return _extends({}, arg2, { queryKey: arg1 }); |
| 11396 |
} |
| 11397 |
function parseMutationArgs(arg1, arg2, arg3) { |
| 11398 |
if (isQueryKey(arg1)) { |
| 11399 |
if (typeof arg2 === "function") return _extends({}, arg3, { |
| 11400 |
mutationKey: arg1, |
| 11401 |
mutationFn: arg2 |
| 11402 |
}); |
| 11403 |
return _extends({}, arg2, { mutationKey: arg1 }); |
| 11404 |
} |
| 11405 |
if (typeof arg1 === "function") return _extends({}, arg2, { mutationFn: arg1 }); |
| 11406 |
return _extends({}, arg1); |
| 11407 |
} |
| 11408 |
function parseFilterArgs(arg1, arg2, arg3) { |
| 11409 |
return isQueryKey(arg1) ? [_extends({}, arg2, { queryKey: arg1 }), arg3] : [arg1 || {}, arg2]; |
| 11410 |
} |
| 11411 |
function mapQueryStatusFilter(active, inactive) { |
| 11412 |
if (active === true && inactive === true || active == null && inactive == null) return "all"; |
| 11413 |
else if (active === false && inactive === false) return "none"; |
| 11414 |
else return (active != null ? active : !inactive) ? "active" : "inactive"; |
| 11415 |
} |
| 11416 |
function matchQuery(filters, query) { |
| 11417 |
var active = filters.active; |
| 11418 |
var exact = filters.exact; |
| 11419 |
var fetching = filters.fetching; |
| 11420 |
var inactive = filters.inactive; |
| 11421 |
var predicate = filters.predicate; |
| 11422 |
var queryKey = filters.queryKey; |
| 11423 |
var stale = filters.stale; |
| 11424 |
if (isQueryKey(queryKey)) { |
| 11425 |
if (exact) { |
| 11426 |
if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) return false; |
| 11427 |
} else if (!partialMatchKey(query.queryKey, queryKey)) return false; |
| 11428 |
} |
| 11429 |
var queryStatusFilter = mapQueryStatusFilter(active, inactive); |
| 11430 |
if (queryStatusFilter === "none") return false; |
| 11431 |
else if (queryStatusFilter !== "all") { |
| 11432 |
var isActive = query.isActive(); |
| 11433 |
if (queryStatusFilter === "active" && !isActive) return false; |
| 11434 |
if (queryStatusFilter === "inactive" && isActive) return false; |
| 11435 |
} |
| 11436 |
if (typeof stale === "boolean" && query.isStale() !== stale) return false; |
| 11437 |
if (typeof fetching === "boolean" && query.isFetching() !== fetching) return false; |
| 11438 |
if (predicate && !predicate(query)) return false; |
| 11439 |
return true; |
| 11440 |
} |
| 11441 |
function matchMutation(filters, mutation) { |
| 11442 |
var exact = filters.exact; |
| 11443 |
var fetching = filters.fetching; |
| 11444 |
var predicate = filters.predicate; |
| 11445 |
var mutationKey = filters.mutationKey; |
| 11446 |
if (isQueryKey(mutationKey)) { |
| 11447 |
if (!mutation.options.mutationKey) return false; |
| 11448 |
if (exact) { |
| 11449 |
if (hashQueryKey(mutation.options.mutationKey) !== hashQueryKey(mutationKey)) return false; |
| 11450 |
} else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) return false; |
| 11451 |
} |
| 11452 |
if (typeof fetching === "boolean" && mutation.state.status === "loading" !== fetching) return false; |
| 11453 |
if (predicate && !predicate(mutation)) return false; |
| 11454 |
return true; |
| 11455 |
} |
| 11456 |
function hashQueryKeyByOptions(queryKey, options) { |
| 11457 |
return ((options == null ? void 0 : options.queryKeyHashFn) || hashQueryKey)(queryKey); |
| 11458 |
} |
| 11459 |
/** |
| 11460 |
* Default query keys hash function. |
| 11461 |
*/ |
| 11462 |
function hashQueryKey(queryKey) { |
| 11463 |
return stableValueHash(ensureQueryKeyArray(queryKey)); |
| 11464 |
} |
| 11465 |
/** |
| 11466 |
* Hashes the value into a stable hash. |
| 11467 |
*/ |
| 11468 |
function stableValueHash(value) { |
| 11469 |
return JSON.stringify(value, function(_, val) { |
| 11470 |
return isPlainObject(val) ? Object.keys(val).sort().reduce(function(result, key) { |
| 11471 |
result[key] = val[key]; |
| 11472 |
return result; |
| 11473 |
}, {}) : val; |
| 11474 |
}); |
| 11475 |
} |
| 11476 |
/** |
| 11477 |
* Checks if key `b` partially matches with key `a`. |
| 11478 |
*/ |
| 11479 |
function partialMatchKey(a, b) { |
| 11480 |
return partialDeepEqual(ensureQueryKeyArray(a), ensureQueryKeyArray(b)); |
| 11481 |
} |
| 11482 |
/** |
| 11483 |
* Checks if `b` partially matches with `a`. |
| 11484 |
*/ |
| 11485 |
function partialDeepEqual(a, b) { |
| 11486 |
if (a === b) return true; |
| 11487 |
if (typeof a !== typeof b) return false; |
| 11488 |
if (a && b && typeof a === "object" && typeof b === "object") return !Object.keys(b).some(function(key) { |
| 11489 |
return !partialDeepEqual(a[key], b[key]); |
| 11490 |
}); |
| 11491 |
return false; |
| 11492 |
} |
| 11493 |
/** |
| 11494 |
* This function returns `a` if `b` is deeply equal. |
| 11495 |
* If not, it will replace any deeply equal children of `b` with those of `a`. |
| 11496 |
* This can be used for structural sharing between JSON values for example. |
| 11497 |
*/ |
| 11498 |
function replaceEqualDeep(a, b) { |
| 11499 |
if (a === b) return a; |
| 11500 |
var array = Array.isArray(a) && Array.isArray(b); |
| 11501 |
if (array || isPlainObject(a) && isPlainObject(b)) { |
| 11502 |
var aSize = array ? a.length : Object.keys(a).length; |
| 11503 |
var bItems = array ? b : Object.keys(b); |
| 11504 |
var bSize = bItems.length; |
| 11505 |
var copy = array ? [] : {}; |
| 11506 |
var equalItems = 0; |
| 11507 |
for (var i = 0; i < bSize; i++) { |
| 11508 |
var key = array ? i : bItems[i]; |
| 11509 |
copy[key] = replaceEqualDeep(a[key], b[key]); |
| 11510 |
if (copy[key] === a[key]) equalItems++; |
| 11511 |
} |
| 11512 |
return aSize === bSize && equalItems === aSize ? a : copy; |
| 11513 |
} |
| 11514 |
return b; |
| 11515 |
} |
| 11516 |
/** |
| 11517 |
* Shallow compare objects. Only works with objects that always have the same properties. |
| 11518 |
*/ |
| 11519 |
function shallowEqualObjects(a, b) { |
| 11520 |
if (a && !b || b && !a) return false; |
| 11521 |
for (var key in a) if (a[key] !== b[key]) return false; |
| 11522 |
return true; |
| 11523 |
} |
| 11524 |
function isPlainObject(o) { |
| 11525 |
if (!hasObjectPrototype(o)) return false; |
| 11526 |
var ctor = o.constructor; |
| 11527 |
if (typeof ctor === "undefined") return true; |
| 11528 |
var prot = ctor.prototype; |
| 11529 |
if (!hasObjectPrototype(prot)) return false; |
| 11530 |
if (!prot.hasOwnProperty("isPrototypeOf")) return false; |
| 11531 |
return true; |
| 11532 |
} |
| 11533 |
function hasObjectPrototype(o) { |
| 11534 |
return Object.prototype.toString.call(o) === "[object Object]"; |
| 11535 |
} |
| 11536 |
function isQueryKey(value) { |
| 11537 |
return typeof value === "string" || Array.isArray(value); |
| 11538 |
} |
| 11539 |
function sleep(timeout) { |
| 11540 |
return new Promise(function(resolve) { |
| 11541 |
setTimeout(resolve, timeout); |
| 11542 |
}); |
| 11543 |
} |
| 11544 |
/** |
| 11545 |
* Schedules a microtask. |
| 11546 |
* This can be useful to schedule state updates after rendering. |
| 11547 |
*/ |
| 11548 |
function scheduleMicrotask$1(callback) { |
| 11549 |
Promise.resolve().then(callback).catch(function(error) { |
| 11550 |
return setTimeout(function() { |
| 11551 |
throw error; |
| 11552 |
}); |
| 11553 |
}); |
| 11554 |
} |
| 11555 |
function getAbortController() { |
| 11556 |
if (typeof AbortController === "function") return new AbortController(); |
| 11557 |
} |
| 11558 |
var isServer$2; |
| 11559 |
var init_utils$3 = __esmMin((() => { |
| 11560 |
init_extends(); |
| 11561 |
isServer$2 = typeof window === "undefined"; |
| 11562 |
__name(scheduleMicrotask$1, "scheduleMicrotask"); |
| 11563 |
})); |
| 11564 |
|
| 11565 |
//#endregion |
| 11566 |
//#region node_modules/react-query/es/core/focusManager.js |
| 11567 |
var FocusManager, focusManager; |
| 11568 |
var init_focusManager = __esmMin((() => { |
| 11569 |
init_inheritsLoose(); |
| 11570 |
init_subscribable(); |
| 11571 |
init_utils$3(); |
| 11572 |
FocusManager = /*#__PURE__*/ function(_Subscribable) { |
| 11573 |
_inheritsLoose(FocusManager, _Subscribable); |
| 11574 |
function FocusManager() { |
| 11575 |
var _this = _Subscribable.call(this) || this; |
| 11576 |
_this.setup = function(onFocus) { |
| 11577 |
var _window; |
| 11578 |
if (!isServer$2 && ((_window = window) == null ? void 0 : _window.addEventListener)) { |
| 11579 |
var listener = function listener() { |
| 11580 |
return onFocus(); |
| 11581 |
}; |
| 11582 |
window.addEventListener("visibilitychange", listener, false); |
| 11583 |
window.addEventListener("focus", listener, false); |
| 11584 |
return function() { |
| 11585 |
window.removeEventListener("visibilitychange", listener); |
| 11586 |
window.removeEventListener("focus", listener); |
| 11587 |
}; |
| 11588 |
} |
| 11589 |
}; |
| 11590 |
return _this; |
| 11591 |
} |
| 11592 |
var _proto = FocusManager.prototype; |
| 11593 |
_proto.onSubscribe = function onSubscribe() { |
| 11594 |
if (!this.cleanup) this.setEventListener(this.setup); |
| 11595 |
}; |
| 11596 |
_proto.onUnsubscribe = function onUnsubscribe() { |
| 11597 |
if (!this.hasListeners()) { |
| 11598 |
var _this$cleanup; |
| 11599 |
(_this$cleanup = this.cleanup) == null || _this$cleanup.call(this); |
| 11600 |
this.cleanup = void 0; |
| 11601 |
} |
| 11602 |
}; |
| 11603 |
_proto.setEventListener = function setEventListener(setup) { |
| 11604 |
var _this$cleanup2; |
| 11605 |
var _this2 = this; |
| 11606 |
this.setup = setup; |
| 11607 |
(_this$cleanup2 = this.cleanup) == null || _this$cleanup2.call(this); |
| 11608 |
this.cleanup = setup(function(focused) { |
| 11609 |
if (typeof focused === "boolean") _this2.setFocused(focused); |
| 11610 |
else _this2.onFocus(); |
| 11611 |
}); |
| 11612 |
}; |
| 11613 |
_proto.setFocused = function setFocused(focused) { |
| 11614 |
this.focused = focused; |
| 11615 |
if (focused) this.onFocus(); |
| 11616 |
}; |
| 11617 |
_proto.onFocus = function onFocus() { |
| 11618 |
this.listeners.forEach(function(listener) { |
| 11619 |
listener(); |
| 11620 |
}); |
| 11621 |
}; |
| 11622 |
_proto.isFocused = function isFocused() { |
| 11623 |
if (typeof this.focused === "boolean") return this.focused; |
| 11624 |
if (typeof document === "undefined") return true; |
| 11625 |
return [ |
| 11626 |
void 0, |
| 11627 |
"visible", |
| 11628 |
"prerender" |
| 11629 |
].includes(document.visibilityState); |
| 11630 |
}; |
| 11631 |
return FocusManager; |
| 11632 |
}(Subscribable); |
| 11633 |
focusManager = new FocusManager(); |
| 11634 |
})); |
| 11635 |
|
| 11636 |
//#endregion |
| 11637 |
//#region node_modules/react-query/es/core/onlineManager.js |
| 11638 |
var OnlineManager, onlineManager; |
| 11639 |
var init_onlineManager = __esmMin((() => { |
| 11640 |
init_inheritsLoose(); |
| 11641 |
init_subscribable(); |
| 11642 |
init_utils$3(); |
| 11643 |
OnlineManager = /*#__PURE__*/ function(_Subscribable) { |
| 11644 |
_inheritsLoose(OnlineManager, _Subscribable); |
| 11645 |
function OnlineManager() { |
| 11646 |
var _this = _Subscribable.call(this) || this; |
| 11647 |
_this.setup = function(onOnline) { |
| 11648 |
var _window; |
| 11649 |
if (!isServer$2 && ((_window = window) == null ? void 0 : _window.addEventListener)) { |
| 11650 |
var listener = function listener() { |
| 11651 |
return onOnline(); |
| 11652 |
}; |
| 11653 |
window.addEventListener("online", listener, false); |
| 11654 |
window.addEventListener("offline", listener, false); |
| 11655 |
return function() { |
| 11656 |
window.removeEventListener("online", listener); |
| 11657 |
window.removeEventListener("offline", listener); |
| 11658 |
}; |
| 11659 |
} |
| 11660 |
}; |
| 11661 |
return _this; |
| 11662 |
} |
| 11663 |
var _proto = OnlineManager.prototype; |
| 11664 |
_proto.onSubscribe = function onSubscribe() { |
| 11665 |
if (!this.cleanup) this.setEventListener(this.setup); |
| 11666 |
}; |
| 11667 |
_proto.onUnsubscribe = function onUnsubscribe() { |
| 11668 |
if (!this.hasListeners()) { |
| 11669 |
var _this$cleanup; |
| 11670 |
(_this$cleanup = this.cleanup) == null || _this$cleanup.call(this); |
| 11671 |
this.cleanup = void 0; |
| 11672 |
} |
| 11673 |
}; |
| 11674 |
_proto.setEventListener = function setEventListener(setup) { |
| 11675 |
var _this$cleanup2; |
| 11676 |
var _this2 = this; |
| 11677 |
this.setup = setup; |
| 11678 |
(_this$cleanup2 = this.cleanup) == null || _this$cleanup2.call(this); |
| 11679 |
this.cleanup = setup(function(online) { |
| 11680 |
if (typeof online === "boolean") _this2.setOnline(online); |
| 11681 |
else _this2.onOnline(); |
| 11682 |
}); |
| 11683 |
}; |
| 11684 |
_proto.setOnline = function setOnline(online) { |
| 11685 |
this.online = online; |
| 11686 |
if (online) this.onOnline(); |
| 11687 |
}; |
| 11688 |
_proto.onOnline = function onOnline() { |
| 11689 |
this.listeners.forEach(function(listener) { |
| 11690 |
listener(); |
| 11691 |
}); |
| 11692 |
}; |
| 11693 |
_proto.isOnline = function isOnline() { |
| 11694 |
if (typeof this.online === "boolean") return this.online; |
| 11695 |
if (typeof navigator === "undefined" || typeof navigator.onLine === "undefined") return true; |
| 11696 |
return navigator.onLine; |
| 11697 |
}; |
| 11698 |
return OnlineManager; |
| 11699 |
}(Subscribable); |
| 11700 |
onlineManager = new OnlineManager(); |
| 11701 |
})); |
| 11702 |
|
| 11703 |
//#endregion |
| 11704 |
//#region node_modules/react-query/es/core/retryer.js |
| 11705 |
function defaultRetryDelay(failureCount) { |
| 11706 |
return Math.min(1e3 * Math.pow(2, failureCount), 3e4); |
| 11707 |
} |
| 11708 |
function isCancelable(value) { |
| 11709 |
return typeof (value == null ? void 0 : value.cancel) === "function"; |
| 11710 |
} |
| 11711 |
function isCancelledError(value) { |
| 11712 |
return value instanceof CancelledError; |
| 11713 |
} |
| 11714 |
var CancelledError, Retryer; |
| 11715 |
var init_retryer = __esmMin((() => { |
| 11716 |
init_focusManager(); |
| 11717 |
init_onlineManager(); |
| 11718 |
init_utils$3(); |
| 11719 |
CancelledError = function CancelledError(options) { |
| 11720 |
this.revert = options == null ? void 0 : options.revert; |
| 11721 |
this.silent = options == null ? void 0 : options.silent; |
| 11722 |
}; |
| 11723 |
Retryer = function Retryer(config) { |
| 11724 |
var _this = this; |
| 11725 |
var cancelRetry = false; |
| 11726 |
var cancelFn; |
| 11727 |
var continueFn; |
| 11728 |
var promiseResolve; |
| 11729 |
var promiseReject; |
| 11730 |
this.abort = config.abort; |
| 11731 |
this.cancel = function(cancelOptions) { |
| 11732 |
return cancelFn == null ? void 0 : cancelFn(cancelOptions); |
| 11733 |
}; |
| 11734 |
this.cancelRetry = function() { |
| 11735 |
cancelRetry = true; |
| 11736 |
}; |
| 11737 |
this.continueRetry = function() { |
| 11738 |
cancelRetry = false; |
| 11739 |
}; |
| 11740 |
this.continue = function() { |
| 11741 |
return continueFn == null ? void 0 : continueFn(); |
| 11742 |
}; |
| 11743 |
this.failureCount = 0; |
| 11744 |
this.isPaused = false; |
| 11745 |
this.isResolved = false; |
| 11746 |
this.isTransportCancelable = false; |
| 11747 |
this.promise = new Promise(function(outerResolve, outerReject) { |
| 11748 |
promiseResolve = outerResolve; |
| 11749 |
promiseReject = outerReject; |
| 11750 |
}); |
| 11751 |
var resolve = function resolve(value) { |
| 11752 |
if (!_this.isResolved) { |
| 11753 |
_this.isResolved = true; |
| 11754 |
config.onSuccess == null || config.onSuccess(value); |
| 11755 |
continueFn == null || continueFn(); |
| 11756 |
promiseResolve(value); |
| 11757 |
} |
| 11758 |
}; |
| 11759 |
var reject = function reject(value) { |
| 11760 |
if (!_this.isResolved) { |
| 11761 |
_this.isResolved = true; |
| 11762 |
config.onError == null || config.onError(value); |
| 11763 |
continueFn == null || continueFn(); |
| 11764 |
promiseReject(value); |
| 11765 |
} |
| 11766 |
}; |
| 11767 |
var pause = function pause() { |
| 11768 |
return new Promise(function(continueResolve) { |
| 11769 |
continueFn = continueResolve; |
| 11770 |
_this.isPaused = true; |
| 11771 |
config.onPause == null || config.onPause(); |
| 11772 |
}).then(function() { |
| 11773 |
continueFn = void 0; |
| 11774 |
_this.isPaused = false; |
| 11775 |
config.onContinue == null || config.onContinue(); |
| 11776 |
}); |
| 11777 |
}; |
| 11778 |
(function run() { |
| 11779 |
if (_this.isResolved) return; |
| 11780 |
var promiseOrValue; |
| 11781 |
try { |
| 11782 |
promiseOrValue = config.fn(); |
| 11783 |
} catch (error) { |
| 11784 |
promiseOrValue = Promise.reject(error); |
| 11785 |
} |
| 11786 |
cancelFn = function cancelFn(cancelOptions) { |
| 11787 |
if (!_this.isResolved) { |
| 11788 |
reject(new CancelledError(cancelOptions)); |
| 11789 |
_this.abort == null || _this.abort(); |
| 11790 |
if (isCancelable(promiseOrValue)) try { |
| 11791 |
promiseOrValue.cancel(); |
| 11792 |
} catch (_unused) {} |
| 11793 |
} |
| 11794 |
}; |
| 11795 |
_this.isTransportCancelable = isCancelable(promiseOrValue); |
| 11796 |
Promise.resolve(promiseOrValue).then(resolve).catch(function(error) { |
| 11797 |
var _config$retry; |
| 11798 |
var _config$retryDelay; |
| 11799 |
if (_this.isResolved) return; |
| 11800 |
var retry = (_config$retry = config.retry) != null ? _config$retry : 3; |
| 11801 |
var retryDelay = (_config$retryDelay = config.retryDelay) != null ? _config$retryDelay : defaultRetryDelay; |
| 11802 |
var delay = typeof retryDelay === "function" ? retryDelay(_this.failureCount, error) : retryDelay; |
| 11803 |
var shouldRetry = retry === true || typeof retry === "number" && _this.failureCount < retry || typeof retry === "function" && retry(_this.failureCount, error); |
| 11804 |
if (cancelRetry || !shouldRetry) { |
| 11805 |
reject(error); |
| 11806 |
return; |
| 11807 |
} |
| 11808 |
_this.failureCount++; |
| 11809 |
config.onFail == null || config.onFail(_this.failureCount, error); |
| 11810 |
sleep(delay).then(function() { |
| 11811 |
if (!focusManager.isFocused() || !onlineManager.isOnline()) return pause(); |
| 11812 |
}).then(function() { |
| 11813 |
if (cancelRetry) reject(error); |
| 11814 |
else run(); |
| 11815 |
}); |
| 11816 |
}); |
| 11817 |
})(); |
| 11818 |
}; |
| 11819 |
})); |
| 11820 |
|
| 11821 |
//#endregion |
| 11822 |
//#region node_modules/react-query/es/core/notifyManager.js |
| 11823 |
var NotifyManager, notifyManager; |
| 11824 |
var init_notifyManager = __esmMin((() => { |
| 11825 |
init_utils$3(); |
| 11826 |
NotifyManager = /*#__PURE__*/ function() { |
| 11827 |
function NotifyManager() { |
| 11828 |
this.queue = []; |
| 11829 |
this.transactions = 0; |
| 11830 |
this.notifyFn = function(callback) { |
| 11831 |
callback(); |
| 11832 |
}; |
| 11833 |
this.batchNotifyFn = function(callback) { |
| 11834 |
callback(); |
| 11835 |
}; |
| 11836 |
} |
| 11837 |
var _proto = NotifyManager.prototype; |
| 11838 |
_proto.batch = function batch(callback) { |
| 11839 |
var result; |
| 11840 |
this.transactions++; |
| 11841 |
try { |
| 11842 |
result = callback(); |
| 11843 |
} finally { |
| 11844 |
this.transactions--; |
| 11845 |
if (!this.transactions) this.flush(); |
| 11846 |
} |
| 11847 |
return result; |
| 11848 |
}; |
| 11849 |
_proto.schedule = function schedule(callback) { |
| 11850 |
var _this = this; |
| 11851 |
if (this.transactions) this.queue.push(callback); |
| 11852 |
else scheduleMicrotask$1(function() { |
| 11853 |
_this.notifyFn(callback); |
| 11854 |
}); |
| 11855 |
}; |
| 11856 |
_proto.batchCalls = function batchCalls(callback) { |
| 11857 |
var _this2 = this; |
| 11858 |
return function() { |
| 11859 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 11860 |
_this2.schedule(function() { |
| 11861 |
callback.apply(void 0, args); |
| 11862 |
}); |
| 11863 |
}; |
| 11864 |
}; |
| 11865 |
_proto.flush = function flush() { |
| 11866 |
var _this3 = this; |
| 11867 |
var queue = this.queue; |
| 11868 |
this.queue = []; |
| 11869 |
if (queue.length) scheduleMicrotask$1(function() { |
| 11870 |
_this3.batchNotifyFn(function() { |
| 11871 |
queue.forEach(function(callback) { |
| 11872 |
_this3.notifyFn(callback); |
| 11873 |
}); |
| 11874 |
}); |
| 11875 |
}); |
| 11876 |
}; |
| 11877 |
_proto.setNotifyFunction = function setNotifyFunction(fn) { |
| 11878 |
this.notifyFn = fn; |
| 11879 |
}; |
| 11880 |
_proto.setBatchNotifyFunction = function setBatchNotifyFunction(fn) { |
| 11881 |
this.batchNotifyFn = fn; |
| 11882 |
}; |
| 11883 |
return NotifyManager; |
| 11884 |
}(); |
| 11885 |
notifyManager = new NotifyManager(); |
| 11886 |
})); |
| 11887 |
|
| 11888 |
//#endregion |
| 11889 |
//#region node_modules/react-query/es/core/logger.js |
| 11890 |
function getLogger() { |
| 11891 |
return logger$1; |
| 11892 |
} |
| 11893 |
function setLogger(newLogger) { |
| 11894 |
logger$1 = newLogger; |
| 11895 |
} |
| 11896 |
var logger$1; |
| 11897 |
var init_logger$1 = __esmMin((() => { |
| 11898 |
logger$1 = console; |
| 11899 |
})); |
| 11900 |
|
| 11901 |
//#endregion |
| 11902 |
//#region node_modules/react-query/es/core/query.js |
| 11903 |
var Query; |
| 11904 |
var init_query = __esmMin((() => { |
| 11905 |
init_extends(); |
| 11906 |
init_utils$3(); |
| 11907 |
init_notifyManager(); |
| 11908 |
init_logger$1(); |
| 11909 |
init_retryer(); |
| 11910 |
Query = /*#__PURE__*/ function() { |
| 11911 |
function Query(config) { |
| 11912 |
this.abortSignalConsumed = false; |
| 11913 |
this.hadObservers = false; |
| 11914 |
this.defaultOptions = config.defaultOptions; |
| 11915 |
this.setOptions(config.options); |
| 11916 |
this.observers = []; |
| 11917 |
this.cache = config.cache; |
| 11918 |
this.queryKey = config.queryKey; |
| 11919 |
this.queryHash = config.queryHash; |
| 11920 |
this.initialState = config.state || this.getDefaultState(this.options); |
| 11921 |
this.state = this.initialState; |
| 11922 |
this.meta = config.meta; |
| 11923 |
this.scheduleGc(); |
| 11924 |
} |
| 11925 |
var _proto = Query.prototype; |
| 11926 |
_proto.setOptions = function setOptions(options) { |
| 11927 |
var _this$options$cacheTi; |
| 11928 |
this.options = _extends({}, this.defaultOptions, options); |
| 11929 |
this.meta = options == null ? void 0 : options.meta; |
| 11930 |
this.cacheTime = Math.max(this.cacheTime || 0, (_this$options$cacheTi = this.options.cacheTime) != null ? _this$options$cacheTi : 300 * 1e3); |
| 11931 |
}; |
| 11932 |
_proto.setDefaultOptions = function setDefaultOptions(options) { |
| 11933 |
this.defaultOptions = options; |
| 11934 |
}; |
| 11935 |
_proto.scheduleGc = function scheduleGc() { |
| 11936 |
var _this = this; |
| 11937 |
this.clearGcTimeout(); |
| 11938 |
if (isValidTimeout(this.cacheTime)) this.gcTimeout = setTimeout(function() { |
| 11939 |
_this.optionalRemove(); |
| 11940 |
}, this.cacheTime); |
| 11941 |
}; |
| 11942 |
_proto.clearGcTimeout = function clearGcTimeout() { |
| 11943 |
if (this.gcTimeout) { |
| 11944 |
clearTimeout(this.gcTimeout); |
| 11945 |
this.gcTimeout = void 0; |
| 11946 |
} |
| 11947 |
}; |
| 11948 |
_proto.optionalRemove = function optionalRemove() { |
| 11949 |
if (!this.observers.length) if (this.state.isFetching) { |
| 11950 |
if (this.hadObservers) this.scheduleGc(); |
| 11951 |
} else this.cache.remove(this); |
| 11952 |
}; |
| 11953 |
_proto.setData = function setData(updater, options) { |
| 11954 |
var _this$options$isDataE; |
| 11955 |
var _this$options; |
| 11956 |
var prevData = this.state.data; |
| 11957 |
var data = functionalUpdate(updater, prevData); |
| 11958 |
if ((_this$options$isDataE = (_this$options = this.options).isDataEqual) == null ? void 0 : _this$options$isDataE.call(_this$options, prevData, data)) data = prevData; |
| 11959 |
else if (this.options.structuralSharing !== false) data = replaceEqualDeep(prevData, data); |
| 11960 |
this.dispatch({ |
| 11961 |
data, |
| 11962 |
type: "success", |
| 11963 |
dataUpdatedAt: options == null ? void 0 : options.updatedAt |
| 11964 |
}); |
| 11965 |
return data; |
| 11966 |
}; |
| 11967 |
_proto.setState = function setState(state, setStateOptions) { |
| 11968 |
this.dispatch({ |
| 11969 |
type: "setState", |
| 11970 |
state, |
| 11971 |
setStateOptions |
| 11972 |
}); |
| 11973 |
}; |
| 11974 |
_proto.cancel = function cancel(options) { |
| 11975 |
var _this$retryer; |
| 11976 |
var promise = this.promise; |
| 11977 |
(_this$retryer = this.retryer) == null || _this$retryer.cancel(options); |
| 11978 |
return promise ? promise.then(noop).catch(noop) : Promise.resolve(); |
| 11979 |
}; |
| 11980 |
_proto.destroy = function destroy() { |
| 11981 |
this.clearGcTimeout(); |
| 11982 |
this.cancel({ silent: true }); |
| 11983 |
}; |
| 11984 |
_proto.reset = function reset() { |
| 11985 |
this.destroy(); |
| 11986 |
this.setState(this.initialState); |
| 11987 |
}; |
| 11988 |
_proto.isActive = function isActive() { |
| 11989 |
return this.observers.some(function(observer) { |
| 11990 |
return observer.options.enabled !== false; |
| 11991 |
}); |
| 11992 |
}; |
| 11993 |
_proto.isFetching = function isFetching() { |
| 11994 |
return this.state.isFetching; |
| 11995 |
}; |
| 11996 |
_proto.isStale = function isStale() { |
| 11997 |
return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(function(observer) { |
| 11998 |
return observer.getCurrentResult().isStale; |
| 11999 |
}); |
| 12000 |
}; |
| 12001 |
_proto.isStaleByTime = function isStaleByTime(staleTime) { |
| 12002 |
if (staleTime === void 0) staleTime = 0; |
| 12003 |
return this.state.isInvalidated || !this.state.dataUpdatedAt || !timeUntilStale(this.state.dataUpdatedAt, staleTime); |
| 12004 |
}; |
| 12005 |
_proto.onFocus = function onFocus() { |
| 12006 |
var _this$retryer2; |
| 12007 |
var observer = this.observers.find(function(x) { |
| 12008 |
return x.shouldFetchOnWindowFocus(); |
| 12009 |
}); |
| 12010 |
if (observer) observer.refetch(); |
| 12011 |
(_this$retryer2 = this.retryer) == null || _this$retryer2.continue(); |
| 12012 |
}; |
| 12013 |
_proto.onOnline = function onOnline() { |
| 12014 |
var _this$retryer3; |
| 12015 |
var observer = this.observers.find(function(x) { |
| 12016 |
return x.shouldFetchOnReconnect(); |
| 12017 |
}); |
| 12018 |
if (observer) observer.refetch(); |
| 12019 |
(_this$retryer3 = this.retryer) == null || _this$retryer3.continue(); |
| 12020 |
}; |
| 12021 |
_proto.addObserver = function addObserver(observer) { |
| 12022 |
if (this.observers.indexOf(observer) === -1) { |
| 12023 |
this.observers.push(observer); |
| 12024 |
this.hadObservers = true; |
| 12025 |
this.clearGcTimeout(); |
| 12026 |
this.cache.notify({ |
| 12027 |
type: "observerAdded", |
| 12028 |
query: this, |
| 12029 |
observer |
| 12030 |
}); |
| 12031 |
} |
| 12032 |
}; |
| 12033 |
_proto.removeObserver = function removeObserver(observer) { |
| 12034 |
if (this.observers.indexOf(observer) !== -1) { |
| 12035 |
this.observers = this.observers.filter(function(x) { |
| 12036 |
return x !== observer; |
| 12037 |
}); |
| 12038 |
if (!this.observers.length) { |
| 12039 |
if (this.retryer) if (this.retryer.isTransportCancelable || this.abortSignalConsumed) this.retryer.cancel({ revert: true }); |
| 12040 |
else this.retryer.cancelRetry(); |
| 12041 |
if (this.cacheTime) this.scheduleGc(); |
| 12042 |
else this.cache.remove(this); |
| 12043 |
} |
| 12044 |
this.cache.notify({ |
| 12045 |
type: "observerRemoved", |
| 12046 |
query: this, |
| 12047 |
observer |
| 12048 |
}); |
| 12049 |
} |
| 12050 |
}; |
| 12051 |
_proto.getObserversCount = function getObserversCount() { |
| 12052 |
return this.observers.length; |
| 12053 |
}; |
| 12054 |
_proto.invalidate = function invalidate() { |
| 12055 |
if (!this.state.isInvalidated) this.dispatch({ type: "invalidate" }); |
| 12056 |
}; |
| 12057 |
_proto.fetch = function fetch(options, fetchOptions) { |
| 12058 |
var _this2 = this; |
| 12059 |
var _this$options$behavio; |
| 12060 |
var _context$fetchOptions; |
| 12061 |
var _abortController$abor; |
| 12062 |
if (this.state.isFetching) { |
| 12063 |
if (this.state.dataUpdatedAt && (fetchOptions == null ? void 0 : fetchOptions.cancelRefetch)) this.cancel({ silent: true }); |
| 12064 |
else if (this.promise) { |
| 12065 |
var _this$retryer4; |
| 12066 |
(_this$retryer4 = this.retryer) == null || _this$retryer4.continueRetry(); |
| 12067 |
return this.promise; |
| 12068 |
} |
| 12069 |
} |
| 12070 |
if (options) this.setOptions(options); |
| 12071 |
if (!this.options.queryFn) { |
| 12072 |
var observer = this.observers.find(function(x) { |
| 12073 |
return x.options.queryFn; |
| 12074 |
}); |
| 12075 |
if (observer) this.setOptions(observer.options); |
| 12076 |
} |
| 12077 |
var queryKey = ensureQueryKeyArray(this.queryKey); |
| 12078 |
var abortController = getAbortController(); |
| 12079 |
var queryFnContext = { |
| 12080 |
queryKey, |
| 12081 |
pageParam: void 0, |
| 12082 |
meta: this.meta |
| 12083 |
}; |
| 12084 |
Object.defineProperty(queryFnContext, "signal", { |
| 12085 |
enumerable: true, |
| 12086 |
get: function get() { |
| 12087 |
if (abortController) { |
| 12088 |
_this2.abortSignalConsumed = true; |
| 12089 |
return abortController.signal; |
| 12090 |
} |
| 12091 |
} |
| 12092 |
}); |
| 12093 |
var context = { |
| 12094 |
fetchOptions, |
| 12095 |
options: this.options, |
| 12096 |
queryKey, |
| 12097 |
state: this.state, |
| 12098 |
fetchFn: function fetchFn() { |
| 12099 |
if (!_this2.options.queryFn) return Promise.reject("Missing queryFn"); |
| 12100 |
_this2.abortSignalConsumed = false; |
| 12101 |
return _this2.options.queryFn(queryFnContext); |
| 12102 |
}, |
| 12103 |
meta: this.meta |
| 12104 |
}; |
| 12105 |
if ((_this$options$behavio = this.options.behavior) == null ? void 0 : _this$options$behavio.onFetch) { |
| 12106 |
var _this$options$behavio2; |
| 12107 |
(_this$options$behavio2 = this.options.behavior) == null || _this$options$behavio2.onFetch(context); |
| 12108 |
} |
| 12109 |
this.revertState = this.state; |
| 12110 |
if (!this.state.isFetching || this.state.fetchMeta !== ((_context$fetchOptions = context.fetchOptions) == null ? void 0 : _context$fetchOptions.meta)) { |
| 12111 |
var _context$fetchOptions2; |
| 12112 |
this.dispatch({ |
| 12113 |
type: "fetch", |
| 12114 |
meta: (_context$fetchOptions2 = context.fetchOptions) == null ? void 0 : _context$fetchOptions2.meta |
| 12115 |
}); |
| 12116 |
} |
| 12117 |
this.retryer = new Retryer({ |
| 12118 |
fn: context.fetchFn, |
| 12119 |
abort: abortController == null ? void 0 : (_abortController$abor = abortController.abort) == null ? void 0 : _abortController$abor.bind(abortController), |
| 12120 |
onSuccess: function onSuccess(data) { |
| 12121 |
_this2.setData(data); |
| 12122 |
_this2.cache.config.onSuccess == null || _this2.cache.config.onSuccess(data, _this2); |
| 12123 |
if (_this2.cacheTime === 0) _this2.optionalRemove(); |
| 12124 |
}, |
| 12125 |
onError: function onError(error) { |
| 12126 |
if (!(isCancelledError(error) && error.silent)) _this2.dispatch({ |
| 12127 |
type: "error", |
| 12128 |
error |
| 12129 |
}); |
| 12130 |
if (!isCancelledError(error)) { |
| 12131 |
_this2.cache.config.onError == null || _this2.cache.config.onError(error, _this2); |
| 12132 |
getLogger().error(error); |
| 12133 |
} |
| 12134 |
if (_this2.cacheTime === 0) _this2.optionalRemove(); |
| 12135 |
}, |
| 12136 |
onFail: function onFail() { |
| 12137 |
_this2.dispatch({ type: "failed" }); |
| 12138 |
}, |
| 12139 |
onPause: function onPause() { |
| 12140 |
_this2.dispatch({ type: "pause" }); |
| 12141 |
}, |
| 12142 |
onContinue: function onContinue() { |
| 12143 |
_this2.dispatch({ type: "continue" }); |
| 12144 |
}, |
| 12145 |
retry: context.options.retry, |
| 12146 |
retryDelay: context.options.retryDelay |
| 12147 |
}); |
| 12148 |
this.promise = this.retryer.promise; |
| 12149 |
return this.promise; |
| 12150 |
}; |
| 12151 |
_proto.dispatch = function dispatch(action) { |
| 12152 |
var _this3 = this; |
| 12153 |
this.state = this.reducer(this.state, action); |
| 12154 |
notifyManager.batch(function() { |
| 12155 |
_this3.observers.forEach(function(observer) { |
| 12156 |
observer.onQueryUpdate(action); |
| 12157 |
}); |
| 12158 |
_this3.cache.notify({ |
| 12159 |
query: _this3, |
| 12160 |
type: "queryUpdated", |
| 12161 |
action |
| 12162 |
}); |
| 12163 |
}); |
| 12164 |
}; |
| 12165 |
_proto.getDefaultState = function getDefaultState(options) { |
| 12166 |
var data = typeof options.initialData === "function" ? options.initialData() : options.initialData; |
| 12167 |
var initialDataUpdatedAt = typeof options.initialData !== "undefined" ? typeof options.initialDataUpdatedAt === "function" ? options.initialDataUpdatedAt() : options.initialDataUpdatedAt : 0; |
| 12168 |
var hasData = typeof data !== "undefined"; |
| 12169 |
return { |
| 12170 |
data, |
| 12171 |
dataUpdateCount: 0, |
| 12172 |
dataUpdatedAt: hasData ? initialDataUpdatedAt != null ? initialDataUpdatedAt : Date.now() : 0, |
| 12173 |
error: null, |
| 12174 |
errorUpdateCount: 0, |
| 12175 |
errorUpdatedAt: 0, |
| 12176 |
fetchFailureCount: 0, |
| 12177 |
fetchMeta: null, |
| 12178 |
isFetching: false, |
| 12179 |
isInvalidated: false, |
| 12180 |
isPaused: false, |
| 12181 |
status: hasData ? "success" : "idle" |
| 12182 |
}; |
| 12183 |
}; |
| 12184 |
_proto.reducer = function reducer(state, action) { |
| 12185 |
var _action$meta; |
| 12186 |
var _action$dataUpdatedAt; |
| 12187 |
switch (action.type) { |
| 12188 |
case "failed": return _extends({}, state, { fetchFailureCount: state.fetchFailureCount + 1 }); |
| 12189 |
case "pause": return _extends({}, state, { isPaused: true }); |
| 12190 |
case "continue": return _extends({}, state, { isPaused: false }); |
| 12191 |
case "fetch": return _extends({}, state, { |
| 12192 |
fetchFailureCount: 0, |
| 12193 |
fetchMeta: (_action$meta = action.meta) != null ? _action$meta : null, |
| 12194 |
isFetching: true, |
| 12195 |
isPaused: false |
| 12196 |
}, !state.dataUpdatedAt && { |
| 12197 |
error: null, |
| 12198 |
status: "loading" |
| 12199 |
}); |
| 12200 |
case "success": return _extends({}, state, { |
| 12201 |
data: action.data, |
| 12202 |
dataUpdateCount: state.dataUpdateCount + 1, |
| 12203 |
dataUpdatedAt: (_action$dataUpdatedAt = action.dataUpdatedAt) != null ? _action$dataUpdatedAt : Date.now(), |
| 12204 |
error: null, |
| 12205 |
fetchFailureCount: 0, |
| 12206 |
isFetching: false, |
| 12207 |
isInvalidated: false, |
| 12208 |
isPaused: false, |
| 12209 |
status: "success" |
| 12210 |
}); |
| 12211 |
case "error": |
| 12212 |
var error = action.error; |
| 12213 |
if (isCancelledError(error) && error.revert && this.revertState) return _extends({}, this.revertState); |
| 12214 |
return _extends({}, state, { |
| 12215 |
error, |
| 12216 |
errorUpdateCount: state.errorUpdateCount + 1, |
| 12217 |
errorUpdatedAt: Date.now(), |
| 12218 |
fetchFailureCount: state.fetchFailureCount + 1, |
| 12219 |
isFetching: false, |
| 12220 |
isPaused: false, |
| 12221 |
status: "error" |
| 12222 |
}); |
| 12223 |
case "invalidate": return _extends({}, state, { isInvalidated: true }); |
| 12224 |
case "setState": return _extends({}, state, action.state); |
| 12225 |
default: return state; |
| 12226 |
} |
| 12227 |
}; |
| 12228 |
return Query; |
| 12229 |
}(); |
| 12230 |
})); |
| 12231 |
|
| 12232 |
//#endregion |
| 12233 |
//#region node_modules/react-query/es/core/queryCache.js |
| 12234 |
var QueryCache; |
| 12235 |
var init_queryCache = __esmMin((() => { |
| 12236 |
init_inheritsLoose(); |
| 12237 |
init_utils$3(); |
| 12238 |
init_query(); |
| 12239 |
init_notifyManager(); |
| 12240 |
init_subscribable(); |
| 12241 |
QueryCache = /*#__PURE__*/ function(_Subscribable) { |
| 12242 |
_inheritsLoose(QueryCache, _Subscribable); |
| 12243 |
function QueryCache(config) { |
| 12244 |
var _this = _Subscribable.call(this) || this; |
| 12245 |
_this.config = config || {}; |
| 12246 |
_this.queries = []; |
| 12247 |
_this.queriesMap = {}; |
| 12248 |
return _this; |
| 12249 |
} |
| 12250 |
var _proto = QueryCache.prototype; |
| 12251 |
_proto.build = function build(client, options, state) { |
| 12252 |
var _options$queryHash; |
| 12253 |
var queryKey = options.queryKey; |
| 12254 |
var queryHash = (_options$queryHash = options.queryHash) != null ? _options$queryHash : hashQueryKeyByOptions(queryKey, options); |
| 12255 |
var query = this.get(queryHash); |
| 12256 |
if (!query) { |
| 12257 |
query = new Query({ |
| 12258 |
cache: this, |
| 12259 |
queryKey, |
| 12260 |
queryHash, |
| 12261 |
options: client.defaultQueryOptions(options), |
| 12262 |
state, |
| 12263 |
defaultOptions: client.getQueryDefaults(queryKey), |
| 12264 |
meta: options.meta |
| 12265 |
}); |
| 12266 |
this.add(query); |
| 12267 |
} |
| 12268 |
return query; |
| 12269 |
}; |
| 12270 |
_proto.add = function add(query) { |
| 12271 |
if (!this.queriesMap[query.queryHash]) { |
| 12272 |
this.queriesMap[query.queryHash] = query; |
| 12273 |
this.queries.push(query); |
| 12274 |
this.notify({ |
| 12275 |
type: "queryAdded", |
| 12276 |
query |
| 12277 |
}); |
| 12278 |
} |
| 12279 |
}; |
| 12280 |
_proto.remove = function remove(query) { |
| 12281 |
var queryInMap = this.queriesMap[query.queryHash]; |
| 12282 |
if (queryInMap) { |
| 12283 |
query.destroy(); |
| 12284 |
this.queries = this.queries.filter(function(x) { |
| 12285 |
return x !== query; |
| 12286 |
}); |
| 12287 |
if (queryInMap === query) delete this.queriesMap[query.queryHash]; |
| 12288 |
this.notify({ |
| 12289 |
type: "queryRemoved", |
| 12290 |
query |
| 12291 |
}); |
| 12292 |
} |
| 12293 |
}; |
| 12294 |
_proto.clear = function clear() { |
| 12295 |
var _this2 = this; |
| 12296 |
notifyManager.batch(function() { |
| 12297 |
_this2.queries.forEach(function(query) { |
| 12298 |
_this2.remove(query); |
| 12299 |
}); |
| 12300 |
}); |
| 12301 |
}; |
| 12302 |
_proto.get = function get(queryHash) { |
| 12303 |
return this.queriesMap[queryHash]; |
| 12304 |
}; |
| 12305 |
_proto.getAll = function getAll() { |
| 12306 |
return this.queries; |
| 12307 |
}; |
| 12308 |
_proto.find = function find(arg1, arg2) { |
| 12309 |
var filters = parseFilterArgs(arg1, arg2)[0]; |
| 12310 |
if (typeof filters.exact === "undefined") filters.exact = true; |
| 12311 |
return this.queries.find(function(query) { |
| 12312 |
return matchQuery(filters, query); |
| 12313 |
}); |
| 12314 |
}; |
| 12315 |
_proto.findAll = function findAll(arg1, arg2) { |
| 12316 |
var filters = parseFilterArgs(arg1, arg2)[0]; |
| 12317 |
return Object.keys(filters).length > 0 ? this.queries.filter(function(query) { |
| 12318 |
return matchQuery(filters, query); |
| 12319 |
}) : this.queries; |
| 12320 |
}; |
| 12321 |
_proto.notify = function notify(event) { |
| 12322 |
var _this3 = this; |
| 12323 |
notifyManager.batch(function() { |
| 12324 |
_this3.listeners.forEach(function(listener) { |
| 12325 |
listener(event); |
| 12326 |
}); |
| 12327 |
}); |
| 12328 |
}; |
| 12329 |
_proto.onFocus = function onFocus() { |
| 12330 |
var _this4 = this; |
| 12331 |
notifyManager.batch(function() { |
| 12332 |
_this4.queries.forEach(function(query) { |
| 12333 |
query.onFocus(); |
| 12334 |
}); |
| 12335 |
}); |
| 12336 |
}; |
| 12337 |
_proto.onOnline = function onOnline() { |
| 12338 |
var _this5 = this; |
| 12339 |
notifyManager.batch(function() { |
| 12340 |
_this5.queries.forEach(function(query) { |
| 12341 |
query.onOnline(); |
| 12342 |
}); |
| 12343 |
}); |
| 12344 |
}; |
| 12345 |
return QueryCache; |
| 12346 |
}(Subscribable); |
| 12347 |
})); |
| 12348 |
|
| 12349 |
//#endregion |
| 12350 |
//#region node_modules/react-query/es/core/mutation.js |
| 12351 |
function getDefaultState() { |
| 12352 |
return { |
| 12353 |
context: void 0, |
| 12354 |
data: void 0, |
| 12355 |
error: null, |
| 12356 |
failureCount: 0, |
| 12357 |
isPaused: false, |
| 12358 |
status: "idle", |
| 12359 |
variables: void 0 |
| 12360 |
}; |
| 12361 |
} |
| 12362 |
function reducer(state, action) { |
| 12363 |
switch (action.type) { |
| 12364 |
case "failed": return _extends({}, state, { failureCount: state.failureCount + 1 }); |
| 12365 |
case "pause": return _extends({}, state, { isPaused: true }); |
| 12366 |
case "continue": return _extends({}, state, { isPaused: false }); |
| 12367 |
case "loading": return _extends({}, state, { |
| 12368 |
context: action.context, |
| 12369 |
data: void 0, |
| 12370 |
error: null, |
| 12371 |
isPaused: false, |
| 12372 |
status: "loading", |
| 12373 |
variables: action.variables |
| 12374 |
}); |
| 12375 |
case "success": return _extends({}, state, { |
| 12376 |
data: action.data, |
| 12377 |
error: null, |
| 12378 |
status: "success", |
| 12379 |
isPaused: false |
| 12380 |
}); |
| 12381 |
case "error": return _extends({}, state, { |
| 12382 |
data: void 0, |
| 12383 |
error: action.error, |
| 12384 |
failureCount: state.failureCount + 1, |
| 12385 |
isPaused: false, |
| 12386 |
status: "error" |
| 12387 |
}); |
| 12388 |
case "setState": return _extends({}, state, action.state); |
| 12389 |
default: return state; |
| 12390 |
} |
| 12391 |
} |
| 12392 |
var Mutation; |
| 12393 |
var init_mutation = __esmMin((() => { |
| 12394 |
init_extends(); |
| 12395 |
init_logger$1(); |
| 12396 |
init_notifyManager(); |
| 12397 |
init_retryer(); |
| 12398 |
init_utils$3(); |
| 12399 |
Mutation = /*#__PURE__*/ function() { |
| 12400 |
function Mutation(config) { |
| 12401 |
this.options = _extends({}, config.defaultOptions, config.options); |
| 12402 |
this.mutationId = config.mutationId; |
| 12403 |
this.mutationCache = config.mutationCache; |
| 12404 |
this.observers = []; |
| 12405 |
this.state = config.state || getDefaultState(); |
| 12406 |
this.meta = config.meta; |
| 12407 |
} |
| 12408 |
var _proto = Mutation.prototype; |
| 12409 |
_proto.setState = function setState(state) { |
| 12410 |
this.dispatch({ |
| 12411 |
type: "setState", |
| 12412 |
state |
| 12413 |
}); |
| 12414 |
}; |
| 12415 |
_proto.addObserver = function addObserver(observer) { |
| 12416 |
if (this.observers.indexOf(observer) === -1) this.observers.push(observer); |
| 12417 |
}; |
| 12418 |
_proto.removeObserver = function removeObserver(observer) { |
| 12419 |
this.observers = this.observers.filter(function(x) { |
| 12420 |
return x !== observer; |
| 12421 |
}); |
| 12422 |
}; |
| 12423 |
_proto.cancel = function cancel() { |
| 12424 |
if (this.retryer) { |
| 12425 |
this.retryer.cancel(); |
| 12426 |
return this.retryer.promise.then(noop).catch(noop); |
| 12427 |
} |
| 12428 |
return Promise.resolve(); |
| 12429 |
}; |
| 12430 |
_proto.continue = function _continue() { |
| 12431 |
if (this.retryer) { |
| 12432 |
this.retryer.continue(); |
| 12433 |
return this.retryer.promise; |
| 12434 |
} |
| 12435 |
return this.execute(); |
| 12436 |
}; |
| 12437 |
_proto.execute = function execute() { |
| 12438 |
var _this = this; |
| 12439 |
var data; |
| 12440 |
var restored = this.state.status === "loading"; |
| 12441 |
var promise = Promise.resolve(); |
| 12442 |
if (!restored) { |
| 12443 |
this.dispatch({ |
| 12444 |
type: "loading", |
| 12445 |
variables: this.options.variables |
| 12446 |
}); |
| 12447 |
promise = promise.then(function() { |
| 12448 |
_this.mutationCache.config.onMutate == null || _this.mutationCache.config.onMutate(_this.state.variables, _this); |
| 12449 |
}).then(function() { |
| 12450 |
return _this.options.onMutate == null ? void 0 : _this.options.onMutate(_this.state.variables); |
| 12451 |
}).then(function(context) { |
| 12452 |
if (context !== _this.state.context) _this.dispatch({ |
| 12453 |
type: "loading", |
| 12454 |
context, |
| 12455 |
variables: _this.state.variables |
| 12456 |
}); |
| 12457 |
}); |
| 12458 |
} |
| 12459 |
return promise.then(function() { |
| 12460 |
return _this.executeMutation(); |
| 12461 |
}).then(function(result) { |
| 12462 |
data = result; |
| 12463 |
_this.mutationCache.config.onSuccess == null || _this.mutationCache.config.onSuccess(data, _this.state.variables, _this.state.context, _this); |
| 12464 |
}).then(function() { |
| 12465 |
return _this.options.onSuccess == null ? void 0 : _this.options.onSuccess(data, _this.state.variables, _this.state.context); |
| 12466 |
}).then(function() { |
| 12467 |
return _this.options.onSettled == null ? void 0 : _this.options.onSettled(data, null, _this.state.variables, _this.state.context); |
| 12468 |
}).then(function() { |
| 12469 |
_this.dispatch({ |
| 12470 |
type: "success", |
| 12471 |
data |
| 12472 |
}); |
| 12473 |
return data; |
| 12474 |
}).catch(function(error) { |
| 12475 |
_this.mutationCache.config.onError == null || _this.mutationCache.config.onError(error, _this.state.variables, _this.state.context, _this); |
| 12476 |
getLogger().error(error); |
| 12477 |
return Promise.resolve().then(function() { |
| 12478 |
return _this.options.onError == null ? void 0 : _this.options.onError(error, _this.state.variables, _this.state.context); |
| 12479 |
}).then(function() { |
| 12480 |
return _this.options.onSettled == null ? void 0 : _this.options.onSettled(void 0, error, _this.state.variables, _this.state.context); |
| 12481 |
}).then(function() { |
| 12482 |
_this.dispatch({ |
| 12483 |
type: "error", |
| 12484 |
error |
| 12485 |
}); |
| 12486 |
throw error; |
| 12487 |
}); |
| 12488 |
}); |
| 12489 |
}; |
| 12490 |
_proto.executeMutation = function executeMutation() { |
| 12491 |
var _this2 = this; |
| 12492 |
var _this$options$retry; |
| 12493 |
this.retryer = new Retryer({ |
| 12494 |
fn: function fn() { |
| 12495 |
if (!_this2.options.mutationFn) return Promise.reject("No mutationFn found"); |
| 12496 |
return _this2.options.mutationFn(_this2.state.variables); |
| 12497 |
}, |
| 12498 |
onFail: function onFail() { |
| 12499 |
_this2.dispatch({ type: "failed" }); |
| 12500 |
}, |
| 12501 |
onPause: function onPause() { |
| 12502 |
_this2.dispatch({ type: "pause" }); |
| 12503 |
}, |
| 12504 |
onContinue: function onContinue() { |
| 12505 |
_this2.dispatch({ type: "continue" }); |
| 12506 |
}, |
| 12507 |
retry: (_this$options$retry = this.options.retry) != null ? _this$options$retry : 0, |
| 12508 |
retryDelay: this.options.retryDelay |
| 12509 |
}); |
| 12510 |
return this.retryer.promise; |
| 12511 |
}; |
| 12512 |
_proto.dispatch = function dispatch(action) { |
| 12513 |
var _this3 = this; |
| 12514 |
this.state = reducer(this.state, action); |
| 12515 |
notifyManager.batch(function() { |
| 12516 |
_this3.observers.forEach(function(observer) { |
| 12517 |
observer.onMutationUpdate(action); |
| 12518 |
}); |
| 12519 |
_this3.mutationCache.notify(_this3); |
| 12520 |
}); |
| 12521 |
}; |
| 12522 |
return Mutation; |
| 12523 |
}(); |
| 12524 |
})); |
| 12525 |
|
| 12526 |
//#endregion |
| 12527 |
//#region node_modules/react-query/es/core/mutationCache.js |
| 12528 |
var MutationCache; |
| 12529 |
var init_mutationCache = __esmMin((() => { |
| 12530 |
init_inheritsLoose(); |
| 12531 |
init_notifyManager(); |
| 12532 |
init_mutation(); |
| 12533 |
init_utils$3(); |
| 12534 |
init_subscribable(); |
| 12535 |
MutationCache = /*#__PURE__*/ function(_Subscribable) { |
| 12536 |
_inheritsLoose(MutationCache, _Subscribable); |
| 12537 |
function MutationCache(config) { |
| 12538 |
var _this = _Subscribable.call(this) || this; |
| 12539 |
_this.config = config || {}; |
| 12540 |
_this.mutations = []; |
| 12541 |
_this.mutationId = 0; |
| 12542 |
return _this; |
| 12543 |
} |
| 12544 |
var _proto = MutationCache.prototype; |
| 12545 |
_proto.build = function build(client, options, state) { |
| 12546 |
var mutation = new Mutation({ |
| 12547 |
mutationCache: this, |
| 12548 |
mutationId: ++this.mutationId, |
| 12549 |
options: client.defaultMutationOptions(options), |
| 12550 |
state, |
| 12551 |
defaultOptions: options.mutationKey ? client.getMutationDefaults(options.mutationKey) : void 0, |
| 12552 |
meta: options.meta |
| 12553 |
}); |
| 12554 |
this.add(mutation); |
| 12555 |
return mutation; |
| 12556 |
}; |
| 12557 |
_proto.add = function add(mutation) { |
| 12558 |
this.mutations.push(mutation); |
| 12559 |
this.notify(mutation); |
| 12560 |
}; |
| 12561 |
_proto.remove = function remove(mutation) { |
| 12562 |
this.mutations = this.mutations.filter(function(x) { |
| 12563 |
return x !== mutation; |
| 12564 |
}); |
| 12565 |
mutation.cancel(); |
| 12566 |
this.notify(mutation); |
| 12567 |
}; |
| 12568 |
_proto.clear = function clear() { |
| 12569 |
var _this2 = this; |
| 12570 |
notifyManager.batch(function() { |
| 12571 |
_this2.mutations.forEach(function(mutation) { |
| 12572 |
_this2.remove(mutation); |
| 12573 |
}); |
| 12574 |
}); |
| 12575 |
}; |
| 12576 |
_proto.getAll = function getAll() { |
| 12577 |
return this.mutations; |
| 12578 |
}; |
| 12579 |
_proto.find = function find(filters) { |
| 12580 |
if (typeof filters.exact === "undefined") filters.exact = true; |
| 12581 |
return this.mutations.find(function(mutation) { |
| 12582 |
return matchMutation(filters, mutation); |
| 12583 |
}); |
| 12584 |
}; |
| 12585 |
_proto.findAll = function findAll(filters) { |
| 12586 |
return this.mutations.filter(function(mutation) { |
| 12587 |
return matchMutation(filters, mutation); |
| 12588 |
}); |
| 12589 |
}; |
| 12590 |
_proto.notify = function notify(mutation) { |
| 12591 |
var _this3 = this; |
| 12592 |
notifyManager.batch(function() { |
| 12593 |
_this3.listeners.forEach(function(listener) { |
| 12594 |
listener(mutation); |
| 12595 |
}); |
| 12596 |
}); |
| 12597 |
}; |
| 12598 |
_proto.onFocus = function onFocus() { |
| 12599 |
this.resumePausedMutations(); |
| 12600 |
}; |
| 12601 |
_proto.onOnline = function onOnline() { |
| 12602 |
this.resumePausedMutations(); |
| 12603 |
}; |
| 12604 |
_proto.resumePausedMutations = function resumePausedMutations() { |
| 12605 |
var pausedMutations = this.mutations.filter(function(x) { |
| 12606 |
return x.state.isPaused; |
| 12607 |
}); |
| 12608 |
return notifyManager.batch(function() { |
| 12609 |
return pausedMutations.reduce(function(promise, mutation) { |
| 12610 |
return promise.then(function() { |
| 12611 |
return mutation.continue().catch(noop); |
| 12612 |
}); |
| 12613 |
}, Promise.resolve()); |
| 12614 |
}); |
| 12615 |
}; |
| 12616 |
return MutationCache; |
| 12617 |
}(Subscribable); |
| 12618 |
})); |
| 12619 |
|
| 12620 |
//#endregion |
| 12621 |
//#region node_modules/react-query/es/core/infiniteQueryBehavior.js |
| 12622 |
function infiniteQueryBehavior() { |
| 12623 |
return { onFetch: function onFetch(context) { |
| 12624 |
context.fetchFn = function() { |
| 12625 |
var _context$fetchOptions; |
| 12626 |
var _context$fetchOptions2; |
| 12627 |
var _context$fetchOptions3; |
| 12628 |
var _context$fetchOptions4; |
| 12629 |
var _context$state$data; |
| 12630 |
var _context$state$data2; |
| 12631 |
var refetchPage = (_context$fetchOptions = context.fetchOptions) == null ? void 0 : (_context$fetchOptions2 = _context$fetchOptions.meta) == null ? void 0 : _context$fetchOptions2.refetchPage; |
| 12632 |
var fetchMore = (_context$fetchOptions3 = context.fetchOptions) == null ? void 0 : (_context$fetchOptions4 = _context$fetchOptions3.meta) == null ? void 0 : _context$fetchOptions4.fetchMore; |
| 12633 |
var pageParam = fetchMore == null ? void 0 : fetchMore.pageParam; |
| 12634 |
var isFetchingNextPage = (fetchMore == null ? void 0 : fetchMore.direction) === "forward"; |
| 12635 |
var isFetchingPreviousPage = (fetchMore == null ? void 0 : fetchMore.direction) === "backward"; |
| 12636 |
var oldPages = ((_context$state$data = context.state.data) == null ? void 0 : _context$state$data.pages) || []; |
| 12637 |
var oldPageParams = ((_context$state$data2 = context.state.data) == null ? void 0 : _context$state$data2.pageParams) || []; |
| 12638 |
var abortController = getAbortController(); |
| 12639 |
var abortSignal = abortController == null ? void 0 : abortController.signal; |
| 12640 |
var newPageParams = oldPageParams; |
| 12641 |
var cancelled = false; |
| 12642 |
var queryFn = context.options.queryFn || function() { |
| 12643 |
return Promise.reject("Missing queryFn"); |
| 12644 |
}; |
| 12645 |
var buildNewPages = function buildNewPages(pages, param, page, previous) { |
| 12646 |
newPageParams = previous ? [param].concat(newPageParams) : [].concat(newPageParams, [param]); |
| 12647 |
return previous ? [page].concat(pages) : [].concat(pages, [page]); |
| 12648 |
}; |
| 12649 |
var fetchPage = function fetchPage(pages, manual, param, previous) { |
| 12650 |
if (cancelled) return Promise.reject("Cancelled"); |
| 12651 |
if (typeof param === "undefined" && !manual && pages.length) return Promise.resolve(pages); |
| 12652 |
var queryFnResult = queryFn({ |
| 12653 |
queryKey: context.queryKey, |
| 12654 |
signal: abortSignal, |
| 12655 |
pageParam: param, |
| 12656 |
meta: context.meta |
| 12657 |
}); |
| 12658 |
var promise = Promise.resolve(queryFnResult).then(function(page) { |
| 12659 |
return buildNewPages(pages, param, page, previous); |
| 12660 |
}); |
| 12661 |
if (isCancelable(queryFnResult)) { |
| 12662 |
var promiseAsAny = promise; |
| 12663 |
promiseAsAny.cancel = queryFnResult.cancel; |
| 12664 |
} |
| 12665 |
return promise; |
| 12666 |
}; |
| 12667 |
var promise; |
| 12668 |
if (!oldPages.length) promise = fetchPage([]); |
| 12669 |
else if (isFetchingNextPage) { |
| 12670 |
var manual = typeof pageParam !== "undefined"; |
| 12671 |
promise = fetchPage(oldPages, manual, manual ? pageParam : getNextPageParam(context.options, oldPages)); |
| 12672 |
} else if (isFetchingPreviousPage) { |
| 12673 |
var _manual = typeof pageParam !== "undefined"; |
| 12674 |
promise = fetchPage(oldPages, _manual, _manual ? pageParam : getPreviousPageParam(context.options, oldPages), true); |
| 12675 |
} else (function() { |
| 12676 |
newPageParams = []; |
| 12677 |
var manual = typeof context.options.getNextPageParam === "undefined"; |
| 12678 |
promise = (refetchPage && oldPages[0] ? refetchPage(oldPages[0], 0, oldPages) : true) ? fetchPage([], manual, oldPageParams[0]) : Promise.resolve(buildNewPages([], oldPageParams[0], oldPages[0])); |
| 12679 |
var _loop = function _loop(i) { |
| 12680 |
promise = promise.then(function(pages) { |
| 12681 |
if (refetchPage && oldPages[i] ? refetchPage(oldPages[i], i, oldPages) : true) return fetchPage(pages, manual, manual ? oldPageParams[i] : getNextPageParam(context.options, pages)); |
| 12682 |
return Promise.resolve(buildNewPages(pages, oldPageParams[i], oldPages[i])); |
| 12683 |
}); |
| 12684 |
}; |
| 12685 |
for (var i = 1; i < oldPages.length; i++) _loop(i); |
| 12686 |
})(); |
| 12687 |
var finalPromise = promise.then(function(pages) { |
| 12688 |
return { |
| 12689 |
pages, |
| 12690 |
pageParams: newPageParams |
| 12691 |
}; |
| 12692 |
}); |
| 12693 |
var finalPromiseAsAny = finalPromise; |
| 12694 |
finalPromiseAsAny.cancel = function() { |
| 12695 |
cancelled = true; |
| 12696 |
abortController == null || abortController.abort(); |
| 12697 |
if (isCancelable(promise)) promise.cancel(); |
| 12698 |
}; |
| 12699 |
return finalPromise; |
| 12700 |
}; |
| 12701 |
} }; |
| 12702 |
} |
| 12703 |
function getNextPageParam(options, pages) { |
| 12704 |
return options.getNextPageParam == null ? void 0 : options.getNextPageParam(pages[pages.length - 1], pages); |
| 12705 |
} |
| 12706 |
function getPreviousPageParam(options, pages) { |
| 12707 |
return options.getPreviousPageParam == null ? void 0 : options.getPreviousPageParam(pages[0], pages); |
| 12708 |
} |
| 12709 |
var init_infiniteQueryBehavior = __esmMin((() => { |
| 12710 |
init_retryer(); |
| 12711 |
init_utils$3(); |
| 12712 |
})); |
| 12713 |
|
| 12714 |
//#endregion |
| 12715 |
//#region node_modules/react-query/es/core/queryClient.js |
| 12716 |
var QueryClient; |
| 12717 |
var init_queryClient = __esmMin((() => { |
| 12718 |
init_extends(); |
| 12719 |
init_utils$3(); |
| 12720 |
init_queryCache(); |
| 12721 |
init_mutationCache(); |
| 12722 |
init_focusManager(); |
| 12723 |
init_onlineManager(); |
| 12724 |
init_notifyManager(); |
| 12725 |
init_infiniteQueryBehavior(); |
| 12726 |
QueryClient = /*#__PURE__*/ function() { |
| 12727 |
function QueryClient(config) { |
| 12728 |
if (config === void 0) config = {}; |
| 12729 |
this.queryCache = config.queryCache || new QueryCache(); |
| 12730 |
this.mutationCache = config.mutationCache || new MutationCache(); |
| 12731 |
this.defaultOptions = config.defaultOptions || {}; |
| 12732 |
this.queryDefaults = []; |
| 12733 |
this.mutationDefaults = []; |
| 12734 |
} |
| 12735 |
var _proto = QueryClient.prototype; |
| 12736 |
_proto.mount = function mount() { |
| 12737 |
var _this = this; |
| 12738 |
this.unsubscribeFocus = focusManager.subscribe(function() { |
| 12739 |
if (focusManager.isFocused() && onlineManager.isOnline()) { |
| 12740 |
_this.mutationCache.onFocus(); |
| 12741 |
_this.queryCache.onFocus(); |
| 12742 |
} |
| 12743 |
}); |
| 12744 |
this.unsubscribeOnline = onlineManager.subscribe(function() { |
| 12745 |
if (focusManager.isFocused() && onlineManager.isOnline()) { |
| 12746 |
_this.mutationCache.onOnline(); |
| 12747 |
_this.queryCache.onOnline(); |
| 12748 |
} |
| 12749 |
}); |
| 12750 |
}; |
| 12751 |
_proto.unmount = function unmount() { |
| 12752 |
var _this$unsubscribeFocu; |
| 12753 |
var _this$unsubscribeOnli; |
| 12754 |
(_this$unsubscribeFocu = this.unsubscribeFocus) == null || _this$unsubscribeFocu.call(this); |
| 12755 |
(_this$unsubscribeOnli = this.unsubscribeOnline) == null || _this$unsubscribeOnli.call(this); |
| 12756 |
}; |
| 12757 |
_proto.isFetching = function isFetching(arg1, arg2) { |
| 12758 |
var filters = parseFilterArgs(arg1, arg2)[0]; |
| 12759 |
filters.fetching = true; |
| 12760 |
return this.queryCache.findAll(filters).length; |
| 12761 |
}; |
| 12762 |
_proto.isMutating = function isMutating(filters) { |
| 12763 |
return this.mutationCache.findAll(_extends({}, filters, { fetching: true })).length; |
| 12764 |
}; |
| 12765 |
_proto.getQueryData = function getQueryData(queryKey, filters) { |
| 12766 |
var _this$queryCache$find; |
| 12767 |
return (_this$queryCache$find = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find.state.data; |
| 12768 |
}; |
| 12769 |
_proto.getQueriesData = function getQueriesData(queryKeyOrFilters) { |
| 12770 |
return this.getQueryCache().findAll(queryKeyOrFilters).map(function(_ref) { |
| 12771 |
return [_ref.queryKey, _ref.state.data]; |
| 12772 |
}); |
| 12773 |
}; |
| 12774 |
_proto.setQueryData = function setQueryData(queryKey, updater, options) { |
| 12775 |
var parsedOptions = parseQueryArgs(queryKey); |
| 12776 |
var defaultedOptions = this.defaultQueryOptions(parsedOptions); |
| 12777 |
return this.queryCache.build(this, defaultedOptions).setData(updater, options); |
| 12778 |
}; |
| 12779 |
_proto.setQueriesData = function setQueriesData(queryKeyOrFilters, updater, options) { |
| 12780 |
var _this2 = this; |
| 12781 |
return notifyManager.batch(function() { |
| 12782 |
return _this2.getQueryCache().findAll(queryKeyOrFilters).map(function(_ref2) { |
| 12783 |
var queryKey = _ref2.queryKey; |
| 12784 |
return [queryKey, _this2.setQueryData(queryKey, updater, options)]; |
| 12785 |
}); |
| 12786 |
}); |
| 12787 |
}; |
| 12788 |
_proto.getQueryState = function getQueryState(queryKey, filters) { |
| 12789 |
var _this$queryCache$find2; |
| 12790 |
return (_this$queryCache$find2 = this.queryCache.find(queryKey, filters)) == null ? void 0 : _this$queryCache$find2.state; |
| 12791 |
}; |
| 12792 |
_proto.removeQueries = function removeQueries(arg1, arg2) { |
| 12793 |
var filters = parseFilterArgs(arg1, arg2)[0]; |
| 12794 |
var queryCache = this.queryCache; |
| 12795 |
notifyManager.batch(function() { |
| 12796 |
queryCache.findAll(filters).forEach(function(query) { |
| 12797 |
queryCache.remove(query); |
| 12798 |
}); |
| 12799 |
}); |
| 12800 |
}; |
| 12801 |
_proto.resetQueries = function resetQueries(arg1, arg2, arg3) { |
| 12802 |
var _this3 = this; |
| 12803 |
var _parseFilterArgs3 = parseFilterArgs(arg1, arg2, arg3); |
| 12804 |
var filters = _parseFilterArgs3[0]; |
| 12805 |
var options = _parseFilterArgs3[1]; |
| 12806 |
var queryCache = this.queryCache; |
| 12807 |
var refetchFilters = _extends({}, filters, { active: true }); |
| 12808 |
return notifyManager.batch(function() { |
| 12809 |
queryCache.findAll(filters).forEach(function(query) { |
| 12810 |
query.reset(); |
| 12811 |
}); |
| 12812 |
return _this3.refetchQueries(refetchFilters, options); |
| 12813 |
}); |
| 12814 |
}; |
| 12815 |
_proto.cancelQueries = function cancelQueries(arg1, arg2, arg3) { |
| 12816 |
var _this4 = this; |
| 12817 |
var _parseFilterArgs4 = parseFilterArgs(arg1, arg2, arg3); |
| 12818 |
var filters = _parseFilterArgs4[0]; |
| 12819 |
var _parseFilterArgs4$ = _parseFilterArgs4[1]; |
| 12820 |
var cancelOptions = _parseFilterArgs4$ === void 0 ? {} : _parseFilterArgs4$; |
| 12821 |
if (typeof cancelOptions.revert === "undefined") cancelOptions.revert = true; |
| 12822 |
var promises = notifyManager.batch(function() { |
| 12823 |
return _this4.queryCache.findAll(filters).map(function(query) { |
| 12824 |
return query.cancel(cancelOptions); |
| 12825 |
}); |
| 12826 |
}); |
| 12827 |
return Promise.all(promises).then(noop).catch(noop); |
| 12828 |
}; |
| 12829 |
_proto.invalidateQueries = function invalidateQueries(arg1, arg2, arg3) { |
| 12830 |
var _ref3; |
| 12831 |
var _filters$refetchActiv; |
| 12832 |
var _filters$refetchInact; |
| 12833 |
var _this5 = this; |
| 12834 |
var _parseFilterArgs5 = parseFilterArgs(arg1, arg2, arg3); |
| 12835 |
var filters = _parseFilterArgs5[0]; |
| 12836 |
var options = _parseFilterArgs5[1]; |
| 12837 |
var refetchFilters = _extends({}, filters, { |
| 12838 |
active: (_ref3 = (_filters$refetchActiv = filters.refetchActive) != null ? _filters$refetchActiv : filters.active) != null ? _ref3 : true, |
| 12839 |
inactive: (_filters$refetchInact = filters.refetchInactive) != null ? _filters$refetchInact : false |
| 12840 |
}); |
| 12841 |
return notifyManager.batch(function() { |
| 12842 |
_this5.queryCache.findAll(filters).forEach(function(query) { |
| 12843 |
query.invalidate(); |
| 12844 |
}); |
| 12845 |
return _this5.refetchQueries(refetchFilters, options); |
| 12846 |
}); |
| 12847 |
}; |
| 12848 |
_proto.refetchQueries = function refetchQueries(arg1, arg2, arg3) { |
| 12849 |
var _this6 = this; |
| 12850 |
var _parseFilterArgs6 = parseFilterArgs(arg1, arg2, arg3); |
| 12851 |
var filters = _parseFilterArgs6[0]; |
| 12852 |
var options = _parseFilterArgs6[1]; |
| 12853 |
var promises = notifyManager.batch(function() { |
| 12854 |
return _this6.queryCache.findAll(filters).map(function(query) { |
| 12855 |
return query.fetch(void 0, _extends({}, options, { meta: { refetchPage: filters == null ? void 0 : filters.refetchPage } })); |
| 12856 |
}); |
| 12857 |
}); |
| 12858 |
var promise = Promise.all(promises).then(noop); |
| 12859 |
if (!(options == null ? void 0 : options.throwOnError)) promise = promise.catch(noop); |
| 12860 |
return promise; |
| 12861 |
}; |
| 12862 |
_proto.fetchQuery = function fetchQuery(arg1, arg2, arg3) { |
| 12863 |
var parsedOptions = parseQueryArgs(arg1, arg2, arg3); |
| 12864 |
var defaultedOptions = this.defaultQueryOptions(parsedOptions); |
| 12865 |
if (typeof defaultedOptions.retry === "undefined") defaultedOptions.retry = false; |
| 12866 |
var query = this.queryCache.build(this, defaultedOptions); |
| 12867 |
return query.isStaleByTime(defaultedOptions.staleTime) ? query.fetch(defaultedOptions) : Promise.resolve(query.state.data); |
| 12868 |
}; |
| 12869 |
_proto.prefetchQuery = function prefetchQuery(arg1, arg2, arg3) { |
| 12870 |
return this.fetchQuery(arg1, arg2, arg3).then(noop).catch(noop); |
| 12871 |
}; |
| 12872 |
_proto.fetchInfiniteQuery = function fetchInfiniteQuery(arg1, arg2, arg3) { |
| 12873 |
var parsedOptions = parseQueryArgs(arg1, arg2, arg3); |
| 12874 |
parsedOptions.behavior = infiniteQueryBehavior(); |
| 12875 |
return this.fetchQuery(parsedOptions); |
| 12876 |
}; |
| 12877 |
_proto.prefetchInfiniteQuery = function prefetchInfiniteQuery(arg1, arg2, arg3) { |
| 12878 |
return this.fetchInfiniteQuery(arg1, arg2, arg3).then(noop).catch(noop); |
| 12879 |
}; |
| 12880 |
_proto.cancelMutations = function cancelMutations() { |
| 12881 |
var _this7 = this; |
| 12882 |
var promises = notifyManager.batch(function() { |
| 12883 |
return _this7.mutationCache.getAll().map(function(mutation) { |
| 12884 |
return mutation.cancel(); |
| 12885 |
}); |
| 12886 |
}); |
| 12887 |
return Promise.all(promises).then(noop).catch(noop); |
| 12888 |
}; |
| 12889 |
_proto.resumePausedMutations = function resumePausedMutations() { |
| 12890 |
return this.getMutationCache().resumePausedMutations(); |
| 12891 |
}; |
| 12892 |
_proto.executeMutation = function executeMutation(options) { |
| 12893 |
return this.mutationCache.build(this, options).execute(); |
| 12894 |
}; |
| 12895 |
_proto.getQueryCache = function getQueryCache() { |
| 12896 |
return this.queryCache; |
| 12897 |
}; |
| 12898 |
_proto.getMutationCache = function getMutationCache() { |
| 12899 |
return this.mutationCache; |
| 12900 |
}; |
| 12901 |
_proto.getDefaultOptions = function getDefaultOptions() { |
| 12902 |
return this.defaultOptions; |
| 12903 |
}; |
| 12904 |
_proto.setDefaultOptions = function setDefaultOptions(options) { |
| 12905 |
this.defaultOptions = options; |
| 12906 |
}; |
| 12907 |
_proto.setQueryDefaults = function setQueryDefaults(queryKey, options) { |
| 12908 |
var result = this.queryDefaults.find(function(x) { |
| 12909 |
return hashQueryKey(queryKey) === hashQueryKey(x.queryKey); |
| 12910 |
}); |
| 12911 |
if (result) result.defaultOptions = options; |
| 12912 |
else this.queryDefaults.push({ |
| 12913 |
queryKey, |
| 12914 |
defaultOptions: options |
| 12915 |
}); |
| 12916 |
}; |
| 12917 |
_proto.getQueryDefaults = function getQueryDefaults(queryKey) { |
| 12918 |
var _this$queryDefaults$f; |
| 12919 |
return queryKey ? (_this$queryDefaults$f = this.queryDefaults.find(function(x) { |
| 12920 |
return partialMatchKey(queryKey, x.queryKey); |
| 12921 |
})) == null ? void 0 : _this$queryDefaults$f.defaultOptions : void 0; |
| 12922 |
}; |
| 12923 |
_proto.setMutationDefaults = function setMutationDefaults(mutationKey, options) { |
| 12924 |
var result = this.mutationDefaults.find(function(x) { |
| 12925 |
return hashQueryKey(mutationKey) === hashQueryKey(x.mutationKey); |
| 12926 |
}); |
| 12927 |
if (result) result.defaultOptions = options; |
| 12928 |
else this.mutationDefaults.push({ |
| 12929 |
mutationKey, |
| 12930 |
defaultOptions: options |
| 12931 |
}); |
| 12932 |
}; |
| 12933 |
_proto.getMutationDefaults = function getMutationDefaults(mutationKey) { |
| 12934 |
var _this$mutationDefault; |
| 12935 |
return mutationKey ? (_this$mutationDefault = this.mutationDefaults.find(function(x) { |
| 12936 |
return partialMatchKey(mutationKey, x.mutationKey); |
| 12937 |
})) == null ? void 0 : _this$mutationDefault.defaultOptions : void 0; |
| 12938 |
}; |
| 12939 |
_proto.defaultQueryOptions = function defaultQueryOptions(options) { |
| 12940 |
if (options == null ? void 0 : options._defaulted) return options; |
| 12941 |
var defaultedOptions = _extends({}, this.defaultOptions.queries, this.getQueryDefaults(options == null ? void 0 : options.queryKey), options, { _defaulted: true }); |
| 12942 |
if (!defaultedOptions.queryHash && defaultedOptions.queryKey) defaultedOptions.queryHash = hashQueryKeyByOptions(defaultedOptions.queryKey, defaultedOptions); |
| 12943 |
return defaultedOptions; |
| 12944 |
}; |
| 12945 |
_proto.defaultQueryObserverOptions = function defaultQueryObserverOptions(options) { |
| 12946 |
return this.defaultQueryOptions(options); |
| 12947 |
}; |
| 12948 |
_proto.defaultMutationOptions = function defaultMutationOptions(options) { |
| 12949 |
if (options == null ? void 0 : options._defaulted) return options; |
| 12950 |
return _extends({}, this.defaultOptions.mutations, this.getMutationDefaults(options == null ? void 0 : options.mutationKey), options, { _defaulted: true }); |
| 12951 |
}; |
| 12952 |
_proto.clear = function clear() { |
| 12953 |
this.queryCache.clear(); |
| 12954 |
this.mutationCache.clear(); |
| 12955 |
}; |
| 12956 |
return QueryClient; |
| 12957 |
}(); |
| 12958 |
})); |
| 12959 |
|
| 12960 |
//#endregion |
| 12961 |
//#region node_modules/react-query/es/core/queryObserver.js |
| 12962 |
function shouldLoadOnMount(query, options) { |
| 12963 |
return options.enabled !== false && !query.state.dataUpdatedAt && !(query.state.status === "error" && options.retryOnMount === false); |
| 12964 |
} |
| 12965 |
function shouldFetchOnMount(query, options) { |
| 12966 |
return shouldLoadOnMount(query, options) || query.state.dataUpdatedAt > 0 && shouldFetchOn(query, options, options.refetchOnMount); |
| 12967 |
} |
| 12968 |
function shouldFetchOn(query, options, field) { |
| 12969 |
if (options.enabled !== false) { |
| 12970 |
var value = typeof field === "function" ? field(query) : field; |
| 12971 |
return value === "always" || value !== false && isStale(query, options); |
| 12972 |
} |
| 12973 |
return false; |
| 12974 |
} |
| 12975 |
function shouldFetchOptionally(query, prevQuery, options, prevOptions) { |
| 12976 |
return options.enabled !== false && (query !== prevQuery || prevOptions.enabled === false) && (!options.suspense || query.state.status !== "error") && isStale(query, options); |
| 12977 |
} |
| 12978 |
function isStale(query, options) { |
| 12979 |
return query.isStaleByTime(options.staleTime); |
| 12980 |
} |
| 12981 |
var QueryObserver; |
| 12982 |
var init_queryObserver = __esmMin((() => { |
| 12983 |
init_extends(); |
| 12984 |
init_inheritsLoose(); |
| 12985 |
init_utils$3(); |
| 12986 |
init_notifyManager(); |
| 12987 |
init_focusManager(); |
| 12988 |
init_subscribable(); |
| 12989 |
init_logger$1(); |
| 12990 |
init_retryer(); |
| 12991 |
QueryObserver = /*#__PURE__*/ function(_Subscribable) { |
| 12992 |
_inheritsLoose(QueryObserver, _Subscribable); |
| 12993 |
function QueryObserver(client, options) { |
| 12994 |
var _this = _Subscribable.call(this) || this; |
| 12995 |
_this.client = client; |
| 12996 |
_this.options = options; |
| 12997 |
_this.trackedProps = []; |
| 12998 |
_this.selectError = null; |
| 12999 |
_this.bindMethods(); |
| 13000 |
_this.setOptions(options); |
| 13001 |
return _this; |
| 13002 |
} |
| 13003 |
var _proto = QueryObserver.prototype; |
| 13004 |
_proto.bindMethods = function bindMethods() { |
| 13005 |
this.remove = this.remove.bind(this); |
| 13006 |
this.refetch = this.refetch.bind(this); |
| 13007 |
}; |
| 13008 |
_proto.onSubscribe = function onSubscribe() { |
| 13009 |
if (this.listeners.length === 1) { |
| 13010 |
this.currentQuery.addObserver(this); |
| 13011 |
if (shouldFetchOnMount(this.currentQuery, this.options)) this.executeFetch(); |
| 13012 |
this.updateTimers(); |
| 13013 |
} |
| 13014 |
}; |
| 13015 |
_proto.onUnsubscribe = function onUnsubscribe() { |
| 13016 |
if (!this.listeners.length) this.destroy(); |
| 13017 |
}; |
| 13018 |
_proto.shouldFetchOnReconnect = function shouldFetchOnReconnect() { |
| 13019 |
return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnReconnect); |
| 13020 |
}; |
| 13021 |
_proto.shouldFetchOnWindowFocus = function shouldFetchOnWindowFocus() { |
| 13022 |
return shouldFetchOn(this.currentQuery, this.options, this.options.refetchOnWindowFocus); |
| 13023 |
}; |
| 13024 |
_proto.destroy = function destroy() { |
| 13025 |
this.listeners = []; |
| 13026 |
this.clearTimers(); |
| 13027 |
this.currentQuery.removeObserver(this); |
| 13028 |
}; |
| 13029 |
_proto.setOptions = function setOptions(options, notifyOptions) { |
| 13030 |
var prevOptions = this.options; |
| 13031 |
var prevQuery = this.currentQuery; |
| 13032 |
this.options = this.client.defaultQueryObserverOptions(options); |
| 13033 |
if (typeof this.options.enabled !== "undefined" && typeof this.options.enabled !== "boolean") throw new Error("Expected enabled to be a boolean"); |
| 13034 |
if (!this.options.queryKey) this.options.queryKey = prevOptions.queryKey; |
| 13035 |
this.updateQuery(); |
| 13036 |
var mounted = this.hasListeners(); |
| 13037 |
if (mounted && shouldFetchOptionally(this.currentQuery, prevQuery, this.options, prevOptions)) this.executeFetch(); |
| 13038 |
this.updateResult(notifyOptions); |
| 13039 |
if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || this.options.staleTime !== prevOptions.staleTime)) this.updateStaleTimeout(); |
| 13040 |
var nextRefetchInterval = this.computeRefetchInterval(); |
| 13041 |
if (mounted && (this.currentQuery !== prevQuery || this.options.enabled !== prevOptions.enabled || nextRefetchInterval !== this.currentRefetchInterval)) this.updateRefetchInterval(nextRefetchInterval); |
| 13042 |
}; |
| 13043 |
_proto.getOptimisticResult = function getOptimisticResult(options) { |
| 13044 |
var defaultedOptions = this.client.defaultQueryObserverOptions(options); |
| 13045 |
var query = this.client.getQueryCache().build(this.client, defaultedOptions); |
| 13046 |
return this.createResult(query, defaultedOptions); |
| 13047 |
}; |
| 13048 |
_proto.getCurrentResult = function getCurrentResult() { |
| 13049 |
return this.currentResult; |
| 13050 |
}; |
| 13051 |
_proto.trackResult = function trackResult(result, defaultedOptions) { |
| 13052 |
var _this2 = this; |
| 13053 |
var trackedResult = {}; |
| 13054 |
var trackProp = function trackProp(key) { |
| 13055 |
if (!_this2.trackedProps.includes(key)) _this2.trackedProps.push(key); |
| 13056 |
}; |
| 13057 |
Object.keys(result).forEach(function(key) { |
| 13058 |
Object.defineProperty(trackedResult, key, { |
| 13059 |
configurable: false, |
| 13060 |
enumerable: true, |
| 13061 |
get: function get() { |
| 13062 |
trackProp(key); |
| 13063 |
return result[key]; |
| 13064 |
} |
| 13065 |
}); |
| 13066 |
}); |
| 13067 |
if (defaultedOptions.useErrorBoundary || defaultedOptions.suspense) trackProp("error"); |
| 13068 |
return trackedResult; |
| 13069 |
}; |
| 13070 |
_proto.getNextResult = function getNextResult(options) { |
| 13071 |
var _this3 = this; |
| 13072 |
return new Promise(function(resolve, reject) { |
| 13073 |
var unsubscribe = _this3.subscribe(function(result) { |
| 13074 |
if (!result.isFetching) { |
| 13075 |
unsubscribe(); |
| 13076 |
if (result.isError && (options == null ? void 0 : options.throwOnError)) reject(result.error); |
| 13077 |
else resolve(result); |
| 13078 |
} |
| 13079 |
}); |
| 13080 |
}); |
| 13081 |
}; |
| 13082 |
_proto.getCurrentQuery = function getCurrentQuery() { |
| 13083 |
return this.currentQuery; |
| 13084 |
}; |
| 13085 |
_proto.remove = function remove() { |
| 13086 |
this.client.getQueryCache().remove(this.currentQuery); |
| 13087 |
}; |
| 13088 |
_proto.refetch = function refetch(options) { |
| 13089 |
return this.fetch(_extends({}, options, { meta: { refetchPage: options == null ? void 0 : options.refetchPage } })); |
| 13090 |
}; |
| 13091 |
_proto.fetchOptimistic = function fetchOptimistic(options) { |
| 13092 |
var _this4 = this; |
| 13093 |
var defaultedOptions = this.client.defaultQueryObserverOptions(options); |
| 13094 |
var query = this.client.getQueryCache().build(this.client, defaultedOptions); |
| 13095 |
return query.fetch().then(function() { |
| 13096 |
return _this4.createResult(query, defaultedOptions); |
| 13097 |
}); |
| 13098 |
}; |
| 13099 |
_proto.fetch = function fetch(fetchOptions) { |
| 13100 |
var _this5 = this; |
| 13101 |
return this.executeFetch(fetchOptions).then(function() { |
| 13102 |
_this5.updateResult(); |
| 13103 |
return _this5.currentResult; |
| 13104 |
}); |
| 13105 |
}; |
| 13106 |
_proto.executeFetch = function executeFetch(fetchOptions) { |
| 13107 |
this.updateQuery(); |
| 13108 |
var promise = this.currentQuery.fetch(this.options, fetchOptions); |
| 13109 |
if (!(fetchOptions == null ? void 0 : fetchOptions.throwOnError)) promise = promise.catch(noop); |
| 13110 |
return promise; |
| 13111 |
}; |
| 13112 |
_proto.updateStaleTimeout = function updateStaleTimeout() { |
| 13113 |
var _this6 = this; |
| 13114 |
this.clearStaleTimeout(); |
| 13115 |
if (isServer$2 || this.currentResult.isStale || !isValidTimeout(this.options.staleTime)) return; |
| 13116 |
var timeout = timeUntilStale(this.currentResult.dataUpdatedAt, this.options.staleTime) + 1; |
| 13117 |
this.staleTimeoutId = setTimeout(function() { |
| 13118 |
if (!_this6.currentResult.isStale) _this6.updateResult(); |
| 13119 |
}, timeout); |
| 13120 |
}; |
| 13121 |
_proto.computeRefetchInterval = function computeRefetchInterval() { |
| 13122 |
var _this$options$refetch; |
| 13123 |
return typeof this.options.refetchInterval === "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (_this$options$refetch = this.options.refetchInterval) != null ? _this$options$refetch : false; |
| 13124 |
}; |
| 13125 |
_proto.updateRefetchInterval = function updateRefetchInterval(nextInterval) { |
| 13126 |
var _this7 = this; |
| 13127 |
this.clearRefetchInterval(); |
| 13128 |
this.currentRefetchInterval = nextInterval; |
| 13129 |
if (isServer$2 || this.options.enabled === false || !isValidTimeout(this.currentRefetchInterval) || this.currentRefetchInterval === 0) return; |
| 13130 |
this.refetchIntervalId = setInterval(function() { |
| 13131 |
if (_this7.options.refetchIntervalInBackground || focusManager.isFocused()) _this7.executeFetch(); |
| 13132 |
}, this.currentRefetchInterval); |
| 13133 |
}; |
| 13134 |
_proto.updateTimers = function updateTimers() { |
| 13135 |
this.updateStaleTimeout(); |
| 13136 |
this.updateRefetchInterval(this.computeRefetchInterval()); |
| 13137 |
}; |
| 13138 |
_proto.clearTimers = function clearTimers() { |
| 13139 |
this.clearStaleTimeout(); |
| 13140 |
this.clearRefetchInterval(); |
| 13141 |
}; |
| 13142 |
_proto.clearStaleTimeout = function clearStaleTimeout() { |
| 13143 |
if (this.staleTimeoutId) { |
| 13144 |
clearTimeout(this.staleTimeoutId); |
| 13145 |
this.staleTimeoutId = void 0; |
| 13146 |
} |
| 13147 |
}; |
| 13148 |
_proto.clearRefetchInterval = function clearRefetchInterval() { |
| 13149 |
if (this.refetchIntervalId) { |
| 13150 |
clearInterval(this.refetchIntervalId); |
| 13151 |
this.refetchIntervalId = void 0; |
| 13152 |
} |
| 13153 |
}; |
| 13154 |
_proto.createResult = function createResult(query, options) { |
| 13155 |
var prevQuery = this.currentQuery; |
| 13156 |
var prevOptions = this.options; |
| 13157 |
var prevResult = this.currentResult; |
| 13158 |
var prevResultState = this.currentResultState; |
| 13159 |
var prevResultOptions = this.currentResultOptions; |
| 13160 |
var queryChange = query !== prevQuery; |
| 13161 |
var queryInitialState = queryChange ? query.state : this.currentQueryInitialState; |
| 13162 |
var prevQueryResult = queryChange ? this.currentResult : this.previousQueryResult; |
| 13163 |
var state = query.state; |
| 13164 |
var dataUpdatedAt = state.dataUpdatedAt; |
| 13165 |
var error = state.error; |
| 13166 |
var errorUpdatedAt = state.errorUpdatedAt; |
| 13167 |
var isFetching = state.isFetching; |
| 13168 |
var status = state.status; |
| 13169 |
var isPreviousData = false; |
| 13170 |
var isPlaceholderData = false; |
| 13171 |
var data; |
| 13172 |
if (options.optimisticResults) { |
| 13173 |
var mounted = this.hasListeners(); |
| 13174 |
var fetchOnMount = !mounted && shouldFetchOnMount(query, options); |
| 13175 |
var fetchOptionally = mounted && shouldFetchOptionally(query, prevQuery, options, prevOptions); |
| 13176 |
if (fetchOnMount || fetchOptionally) { |
| 13177 |
isFetching = true; |
| 13178 |
if (!dataUpdatedAt) status = "loading"; |
| 13179 |
} |
| 13180 |
} |
| 13181 |
if (options.keepPreviousData && !state.dataUpdateCount && (prevQueryResult == null ? void 0 : prevQueryResult.isSuccess) && status !== "error") { |
| 13182 |
data = prevQueryResult.data; |
| 13183 |
dataUpdatedAt = prevQueryResult.dataUpdatedAt; |
| 13184 |
status = prevQueryResult.status; |
| 13185 |
isPreviousData = true; |
| 13186 |
} else if (options.select && typeof state.data !== "undefined") if (prevResult && state.data === (prevResultState == null ? void 0 : prevResultState.data) && options.select === this.selectFn) data = this.selectResult; |
| 13187 |
else try { |
| 13188 |
this.selectFn = options.select; |
| 13189 |
data = options.select(state.data); |
| 13190 |
if (options.structuralSharing !== false) data = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, data); |
| 13191 |
this.selectResult = data; |
| 13192 |
this.selectError = null; |
| 13193 |
} catch (selectError) { |
| 13194 |
getLogger().error(selectError); |
| 13195 |
this.selectError = selectError; |
| 13196 |
} |
| 13197 |
else data = state.data; |
| 13198 |
if (typeof options.placeholderData !== "undefined" && typeof data === "undefined" && (status === "loading" || status === "idle")) { |
| 13199 |
var placeholderData; |
| 13200 |
if ((prevResult == null ? void 0 : prevResult.isPlaceholderData) && options.placeholderData === (prevResultOptions == null ? void 0 : prevResultOptions.placeholderData)) placeholderData = prevResult.data; |
| 13201 |
else { |
| 13202 |
placeholderData = typeof options.placeholderData === "function" ? options.placeholderData() : options.placeholderData; |
| 13203 |
if (options.select && typeof placeholderData !== "undefined") try { |
| 13204 |
placeholderData = options.select(placeholderData); |
| 13205 |
if (options.structuralSharing !== false) placeholderData = replaceEqualDeep(prevResult == null ? void 0 : prevResult.data, placeholderData); |
| 13206 |
this.selectError = null; |
| 13207 |
} catch (selectError) { |
| 13208 |
getLogger().error(selectError); |
| 13209 |
this.selectError = selectError; |
| 13210 |
} |
| 13211 |
} |
| 13212 |
if (typeof placeholderData !== "undefined") { |
| 13213 |
status = "success"; |
| 13214 |
data = placeholderData; |
| 13215 |
isPlaceholderData = true; |
| 13216 |
} |
| 13217 |
} |
| 13218 |
if (this.selectError) { |
| 13219 |
error = this.selectError; |
| 13220 |
data = this.selectResult; |
| 13221 |
errorUpdatedAt = Date.now(); |
| 13222 |
status = "error"; |
| 13223 |
} |
| 13224 |
return { |
| 13225 |
status, |
| 13226 |
isLoading: status === "loading", |
| 13227 |
isSuccess: status === "success", |
| 13228 |
isError: status === "error", |
| 13229 |
isIdle: status === "idle", |
| 13230 |
data, |
| 13231 |
dataUpdatedAt, |
| 13232 |
error, |
| 13233 |
errorUpdatedAt, |
| 13234 |
failureCount: state.fetchFailureCount, |
| 13235 |
errorUpdateCount: state.errorUpdateCount, |
| 13236 |
isFetched: state.dataUpdateCount > 0 || state.errorUpdateCount > 0, |
| 13237 |
isFetchedAfterMount: state.dataUpdateCount > queryInitialState.dataUpdateCount || state.errorUpdateCount > queryInitialState.errorUpdateCount, |
| 13238 |
isFetching, |
| 13239 |
isRefetching: isFetching && status !== "loading", |
| 13240 |
isLoadingError: status === "error" && state.dataUpdatedAt === 0, |
| 13241 |
isPlaceholderData, |
| 13242 |
isPreviousData, |
| 13243 |
isRefetchError: status === "error" && state.dataUpdatedAt !== 0, |
| 13244 |
isStale: isStale(query, options), |
| 13245 |
refetch: this.refetch, |
| 13246 |
remove: this.remove |
| 13247 |
}; |
| 13248 |
}; |
| 13249 |
_proto.shouldNotifyListeners = function shouldNotifyListeners(result, prevResult) { |
| 13250 |
if (!prevResult) return true; |
| 13251 |
var _this$options = this.options; |
| 13252 |
var notifyOnChangeProps = _this$options.notifyOnChangeProps; |
| 13253 |
var notifyOnChangePropsExclusions = _this$options.notifyOnChangePropsExclusions; |
| 13254 |
if (!notifyOnChangeProps && !notifyOnChangePropsExclusions) return true; |
| 13255 |
if (notifyOnChangeProps === "tracked" && !this.trackedProps.length) return true; |
| 13256 |
var includedProps = notifyOnChangeProps === "tracked" ? this.trackedProps : notifyOnChangeProps; |
| 13257 |
return Object.keys(result).some(function(key) { |
| 13258 |
var typedKey = key; |
| 13259 |
var changed = result[typedKey] !== prevResult[typedKey]; |
| 13260 |
var isIncluded = includedProps == null ? void 0 : includedProps.some(function(x) { |
| 13261 |
return x === key; |
| 13262 |
}); |
| 13263 |
var isExcluded = notifyOnChangePropsExclusions == null ? void 0 : notifyOnChangePropsExclusions.some(function(x) { |
| 13264 |
return x === key; |
| 13265 |
}); |
| 13266 |
return changed && !isExcluded && (!includedProps || isIncluded); |
| 13267 |
}); |
| 13268 |
}; |
| 13269 |
_proto.updateResult = function updateResult(notifyOptions) { |
| 13270 |
var prevResult = this.currentResult; |
| 13271 |
this.currentResult = this.createResult(this.currentQuery, this.options); |
| 13272 |
this.currentResultState = this.currentQuery.state; |
| 13273 |
this.currentResultOptions = this.options; |
| 13274 |
if (shallowEqualObjects(this.currentResult, prevResult)) return; |
| 13275 |
var defaultNotifyOptions = { cache: true }; |
| 13276 |
if ((notifyOptions == null ? void 0 : notifyOptions.listeners) !== false && this.shouldNotifyListeners(this.currentResult, prevResult)) defaultNotifyOptions.listeners = true; |
| 13277 |
this.notify(_extends({}, defaultNotifyOptions, notifyOptions)); |
| 13278 |
}; |
| 13279 |
_proto.updateQuery = function updateQuery() { |
| 13280 |
var query = this.client.getQueryCache().build(this.client, this.options); |
| 13281 |
if (query === this.currentQuery) return; |
| 13282 |
var prevQuery = this.currentQuery; |
| 13283 |
this.currentQuery = query; |
| 13284 |
this.currentQueryInitialState = query.state; |
| 13285 |
this.previousQueryResult = this.currentResult; |
| 13286 |
if (this.hasListeners()) { |
| 13287 |
prevQuery == null || prevQuery.removeObserver(this); |
| 13288 |
query.addObserver(this); |
| 13289 |
} |
| 13290 |
}; |
| 13291 |
_proto.onQueryUpdate = function onQueryUpdate(action) { |
| 13292 |
var notifyOptions = {}; |
| 13293 |
if (action.type === "success") notifyOptions.onSuccess = true; |
| 13294 |
else if (action.type === "error" && !isCancelledError(action.error)) notifyOptions.onError = true; |
| 13295 |
this.updateResult(notifyOptions); |
| 13296 |
if (this.hasListeners()) this.updateTimers(); |
| 13297 |
}; |
| 13298 |
_proto.notify = function notify(notifyOptions) { |
| 13299 |
var _this8 = this; |
| 13300 |
notifyManager.batch(function() { |
| 13301 |
if (notifyOptions.onSuccess) { |
| 13302 |
_this8.options.onSuccess == null || _this8.options.onSuccess(_this8.currentResult.data); |
| 13303 |
_this8.options.onSettled == null || _this8.options.onSettled(_this8.currentResult.data, null); |
| 13304 |
} else if (notifyOptions.onError) { |
| 13305 |
_this8.options.onError == null || _this8.options.onError(_this8.currentResult.error); |
| 13306 |
_this8.options.onSettled == null || _this8.options.onSettled(void 0, _this8.currentResult.error); |
| 13307 |
} |
| 13308 |
if (notifyOptions.listeners) _this8.listeners.forEach(function(listener) { |
| 13309 |
listener(_this8.currentResult); |
| 13310 |
}); |
| 13311 |
if (notifyOptions.cache) _this8.client.getQueryCache().notify({ |
| 13312 |
query: _this8.currentQuery, |
| 13313 |
type: "observerResultsUpdated" |
| 13314 |
}); |
| 13315 |
}); |
| 13316 |
}; |
| 13317 |
return QueryObserver; |
| 13318 |
}(Subscribable); |
| 13319 |
})); |
| 13320 |
|
| 13321 |
//#endregion |
| 13322 |
//#region node_modules/react-query/es/core/mutationObserver.js |
| 13323 |
var MutationObserver; |
| 13324 |
var init_mutationObserver = __esmMin((() => { |
| 13325 |
init_extends(); |
| 13326 |
init_inheritsLoose(); |
| 13327 |
init_mutation(); |
| 13328 |
init_notifyManager(); |
| 13329 |
init_subscribable(); |
| 13330 |
MutationObserver = /*#__PURE__*/ function(_Subscribable) { |
| 13331 |
_inheritsLoose(MutationObserver, _Subscribable); |
| 13332 |
function MutationObserver(client, options) { |
| 13333 |
var _this = _Subscribable.call(this) || this; |
| 13334 |
_this.client = client; |
| 13335 |
_this.setOptions(options); |
| 13336 |
_this.bindMethods(); |
| 13337 |
_this.updateResult(); |
| 13338 |
return _this; |
| 13339 |
} |
| 13340 |
var _proto = MutationObserver.prototype; |
| 13341 |
_proto.bindMethods = function bindMethods() { |
| 13342 |
this.mutate = this.mutate.bind(this); |
| 13343 |
this.reset = this.reset.bind(this); |
| 13344 |
}; |
| 13345 |
_proto.setOptions = function setOptions(options) { |
| 13346 |
this.options = this.client.defaultMutationOptions(options); |
| 13347 |
}; |
| 13348 |
_proto.onUnsubscribe = function onUnsubscribe() { |
| 13349 |
if (!this.listeners.length) { |
| 13350 |
var _this$currentMutation; |
| 13351 |
(_this$currentMutation = this.currentMutation) == null || _this$currentMutation.removeObserver(this); |
| 13352 |
} |
| 13353 |
}; |
| 13354 |
_proto.onMutationUpdate = function onMutationUpdate(action) { |
| 13355 |
this.updateResult(); |
| 13356 |
var notifyOptions = { listeners: true }; |
| 13357 |
if (action.type === "success") notifyOptions.onSuccess = true; |
| 13358 |
else if (action.type === "error") notifyOptions.onError = true; |
| 13359 |
this.notify(notifyOptions); |
| 13360 |
}; |
| 13361 |
_proto.getCurrentResult = function getCurrentResult() { |
| 13362 |
return this.currentResult; |
| 13363 |
}; |
| 13364 |
_proto.reset = function reset() { |
| 13365 |
this.currentMutation = void 0; |
| 13366 |
this.updateResult(); |
| 13367 |
this.notify({ listeners: true }); |
| 13368 |
}; |
| 13369 |
_proto.mutate = function mutate(variables, options) { |
| 13370 |
this.mutateOptions = options; |
| 13371 |
if (this.currentMutation) this.currentMutation.removeObserver(this); |
| 13372 |
this.currentMutation = this.client.getMutationCache().build(this.client, _extends({}, this.options, { variables: typeof variables !== "undefined" ? variables : this.options.variables })); |
| 13373 |
this.currentMutation.addObserver(this); |
| 13374 |
return this.currentMutation.execute(); |
| 13375 |
}; |
| 13376 |
_proto.updateResult = function updateResult() { |
| 13377 |
var state = this.currentMutation ? this.currentMutation.state : getDefaultState(); |
| 13378 |
var result = _extends({}, state, { |
| 13379 |
isLoading: state.status === "loading", |
| 13380 |
isSuccess: state.status === "success", |
| 13381 |
isError: state.status === "error", |
| 13382 |
isIdle: state.status === "idle", |
| 13383 |
mutate: this.mutate, |
| 13384 |
reset: this.reset |
| 13385 |
}); |
| 13386 |
this.currentResult = result; |
| 13387 |
}; |
| 13388 |
_proto.notify = function notify(options) { |
| 13389 |
var _this2 = this; |
| 13390 |
notifyManager.batch(function() { |
| 13391 |
if (_this2.mutateOptions) { |
| 13392 |
if (options.onSuccess) { |
| 13393 |
_this2.mutateOptions.onSuccess == null || _this2.mutateOptions.onSuccess(_this2.currentResult.data, _this2.currentResult.variables, _this2.currentResult.context); |
| 13394 |
_this2.mutateOptions.onSettled == null || _this2.mutateOptions.onSettled(_this2.currentResult.data, null, _this2.currentResult.variables, _this2.currentResult.context); |
| 13395 |
} else if (options.onError) { |
| 13396 |
_this2.mutateOptions.onError == null || _this2.mutateOptions.onError(_this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context); |
| 13397 |
_this2.mutateOptions.onSettled == null || _this2.mutateOptions.onSettled(void 0, _this2.currentResult.error, _this2.currentResult.variables, _this2.currentResult.context); |
| 13398 |
} |
| 13399 |
} |
| 13400 |
if (options.listeners) _this2.listeners.forEach(function(listener) { |
| 13401 |
listener(_this2.currentResult); |
| 13402 |
}); |
| 13403 |
}); |
| 13404 |
}; |
| 13405 |
return MutationObserver; |
| 13406 |
}(Subscribable); |
| 13407 |
})); |
| 13408 |
|
| 13409 |
//#endregion |
| 13410 |
//#region node_modules/react-query/es/core/types.js |
| 13411 |
var init_types$1 = __esmMin((() => {})); |
| 13412 |
|
| 13413 |
//#endregion |
| 13414 |
//#region node_modules/react-query/es/core/index.js |
| 13415 |
var init_core = __esmMin((() => { |
| 13416 |
init_retryer(); |
| 13417 |
init_queryCache(); |
| 13418 |
init_queryClient(); |
| 13419 |
init_queryObserver(); |
| 13420 |
init_inheritsLoose(); |
| 13421 |
init_utils$3(); |
| 13422 |
init_notifyManager(); |
| 13423 |
init_subscribable(); |
| 13424 |
init_extends(); |
| 13425 |
init_infiniteQueryBehavior(); |
| 13426 |
init_mutationCache(); |
| 13427 |
init_mutationObserver(); |
| 13428 |
init_logger$1(); |
| 13429 |
init_focusManager(); |
| 13430 |
init_onlineManager(); |
| 13431 |
init_types$1(); |
| 13432 |
})); |
| 13433 |
|
| 13434 |
//#endregion |
| 13435 |
//#region node_modules/react-query/es/react/reactBatchedUpdates.js |
| 13436 |
var unstable_batchedUpdates; |
| 13437 |
var init_reactBatchedUpdates = __esmMin((() => { |
| 13438 |
unstable_batchedUpdates = react_dom.default.unstable_batchedUpdates; |
| 13439 |
})); |
| 13440 |
|
| 13441 |
//#endregion |
| 13442 |
//#region node_modules/react-query/es/react/setBatchUpdatesFn.js |
| 13443 |
var init_setBatchUpdatesFn = __esmMin((() => { |
| 13444 |
init_core(); |
| 13445 |
init_reactBatchedUpdates(); |
| 13446 |
notifyManager.setBatchNotifyFunction(unstable_batchedUpdates); |
| 13447 |
})); |
| 13448 |
|
| 13449 |
//#endregion |
| 13450 |
//#region node_modules/react-query/es/react/logger.js |
| 13451 |
var logger; |
| 13452 |
var init_logger = __esmMin((() => { |
| 13453 |
logger = console; |
| 13454 |
})); |
| 13455 |
|
| 13456 |
//#endregion |
| 13457 |
//#region node_modules/react-query/es/react/setLogger.js |
| 13458 |
var init_setLogger = __esmMin((() => { |
| 13459 |
init_core(); |
| 13460 |
init_logger(); |
| 13461 |
setLogger(logger); |
| 13462 |
})); |
| 13463 |
|
| 13464 |
//#endregion |
| 13465 |
//#region node_modules/react-query/es/react/QueryClientProvider.js |
| 13466 |
function getQueryClientContext(contextSharing) { |
| 13467 |
if (contextSharing && typeof window !== "undefined") { |
| 13468 |
if (!window.ReactQueryClientContext) window.ReactQueryClientContext = defaultContext; |
| 13469 |
return window.ReactQueryClientContext; |
| 13470 |
} |
| 13471 |
return defaultContext; |
| 13472 |
} |
| 13473 |
var defaultContext, QueryClientSharingContext, useQueryClient, QueryClientProvider; |
| 13474 |
var init_QueryClientProvider = __esmMin((() => { |
| 13475 |
defaultContext = /*#__PURE__*/ react.default.createContext(void 0); |
| 13476 |
QueryClientSharingContext = /*#__PURE__*/ react.default.createContext(false); |
| 13477 |
useQueryClient = function useQueryClient() { |
| 13478 |
var queryClient = react.default.useContext(getQueryClientContext(react.default.useContext(QueryClientSharingContext))); |
| 13479 |
if (!queryClient) throw new Error("No QueryClient set, use QueryClientProvider to set one"); |
| 13480 |
return queryClient; |
| 13481 |
}; |
| 13482 |
QueryClientProvider = function QueryClientProvider(_ref) { |
| 13483 |
var client = _ref.client; |
| 13484 |
var _ref$contextSharing = _ref.contextSharing; |
| 13485 |
var contextSharing = _ref$contextSharing === void 0 ? false : _ref$contextSharing; |
| 13486 |
var children = _ref.children; |
| 13487 |
react.default.useEffect(function() { |
| 13488 |
client.mount(); |
| 13489 |
return function() { |
| 13490 |
client.unmount(); |
| 13491 |
}; |
| 13492 |
}, [client]); |
| 13493 |
var Context = getQueryClientContext(contextSharing); |
| 13494 |
return /*#__PURE__*/ react.default.createElement(QueryClientSharingContext.Provider, { value: contextSharing }, /*#__PURE__*/ react.default.createElement(Context.Provider, { value: client }, children)); |
| 13495 |
}; |
| 13496 |
})); |
| 13497 |
|
| 13498 |
//#endregion |
| 13499 |
//#region node_modules/react-query/es/react/QueryErrorResetBoundary.js |
| 13500 |
function createValue() { |
| 13501 |
var _isReset = false; |
| 13502 |
return { |
| 13503 |
clearReset: function clearReset() { |
| 13504 |
_isReset = false; |
| 13505 |
}, |
| 13506 |
reset: function reset() { |
| 13507 |
_isReset = true; |
| 13508 |
}, |
| 13509 |
isReset: function isReset() { |
| 13510 |
return _isReset; |
| 13511 |
} |
| 13512 |
}; |
| 13513 |
} |
| 13514 |
var QueryErrorResetBoundaryContext, useQueryErrorResetBoundary; |
| 13515 |
var init_QueryErrorResetBoundary = __esmMin((() => { |
| 13516 |
QueryErrorResetBoundaryContext = /*#__PURE__*/ react.default.createContext(createValue()); |
| 13517 |
useQueryErrorResetBoundary = function useQueryErrorResetBoundary() { |
| 13518 |
return react.default.useContext(QueryErrorResetBoundaryContext); |
| 13519 |
}; |
| 13520 |
})); |
| 13521 |
|
| 13522 |
//#endregion |
| 13523 |
//#region node_modules/react-query/es/react/utils.js |
| 13524 |
function shouldThrowError(suspense, _useErrorBoundary, params) { |
| 13525 |
if (typeof _useErrorBoundary === "function") return _useErrorBoundary.apply(void 0, params); |
| 13526 |
if (typeof _useErrorBoundary === "boolean") return _useErrorBoundary; |
| 13527 |
return !!suspense; |
| 13528 |
} |
| 13529 |
var init_utils$2 = __esmMin((() => {})); |
| 13530 |
|
| 13531 |
//#endregion |
| 13532 |
//#region node_modules/react-query/es/react/useMutation.js |
| 13533 |
function useMutation(arg1, arg2, arg3) { |
| 13534 |
var mountedRef = react.default.useRef(false); |
| 13535 |
var forceUpdate = react.default.useState(0)[1]; |
| 13536 |
var options = parseMutationArgs(arg1, arg2, arg3); |
| 13537 |
var queryClient = useQueryClient(); |
| 13538 |
var obsRef = react.default.useRef(); |
| 13539 |
if (!obsRef.current) obsRef.current = new MutationObserver(queryClient, options); |
| 13540 |
else obsRef.current.setOptions(options); |
| 13541 |
var currentResult = obsRef.current.getCurrentResult(); |
| 13542 |
react.default.useEffect(function() { |
| 13543 |
mountedRef.current = true; |
| 13544 |
var unsubscribe = obsRef.current.subscribe(notifyManager.batchCalls(function() { |
| 13545 |
if (mountedRef.current) forceUpdate(function(x) { |
| 13546 |
return x + 1; |
| 13547 |
}); |
| 13548 |
})); |
| 13549 |
return function() { |
| 13550 |
mountedRef.current = false; |
| 13551 |
unsubscribe(); |
| 13552 |
}; |
| 13553 |
}, []); |
| 13554 |
var mutate = react.default.useCallback(function(variables, mutateOptions) { |
| 13555 |
obsRef.current.mutate(variables, mutateOptions).catch(noop); |
| 13556 |
}, []); |
| 13557 |
if (currentResult.error && shouldThrowError(void 0, obsRef.current.options.useErrorBoundary, [currentResult.error])) throw currentResult.error; |
| 13558 |
return _extends({}, currentResult, { |
| 13559 |
mutate, |
| 13560 |
mutateAsync: currentResult.mutate |
| 13561 |
}); |
| 13562 |
} |
| 13563 |
var init_useMutation = __esmMin((() => { |
| 13564 |
init_extends(); |
| 13565 |
init_notifyManager(); |
| 13566 |
init_utils$3(); |
| 13567 |
init_mutationObserver(); |
| 13568 |
init_QueryClientProvider(); |
| 13569 |
init_utils$2(); |
| 13570 |
})); |
| 13571 |
|
| 13572 |
//#endregion |
| 13573 |
//#region node_modules/react-query/es/react/useBaseQuery.js |
| 13574 |
function useBaseQuery(options, Observer) { |
| 13575 |
var mountedRef = react.default.useRef(false); |
| 13576 |
var forceUpdate = react.default.useState(0)[1]; |
| 13577 |
var queryClient = useQueryClient(); |
| 13578 |
var errorResetBoundary = useQueryErrorResetBoundary(); |
| 13579 |
var defaultedOptions = queryClient.defaultQueryObserverOptions(options); |
| 13580 |
defaultedOptions.optimisticResults = true; |
| 13581 |
if (defaultedOptions.onError) defaultedOptions.onError = notifyManager.batchCalls(defaultedOptions.onError); |
| 13582 |
if (defaultedOptions.onSuccess) defaultedOptions.onSuccess = notifyManager.batchCalls(defaultedOptions.onSuccess); |
| 13583 |
if (defaultedOptions.onSettled) defaultedOptions.onSettled = notifyManager.batchCalls(defaultedOptions.onSettled); |
| 13584 |
if (defaultedOptions.suspense) { |
| 13585 |
if (typeof defaultedOptions.staleTime !== "number") defaultedOptions.staleTime = 1e3; |
| 13586 |
if (defaultedOptions.cacheTime === 0) defaultedOptions.cacheTime = 1; |
| 13587 |
} |
| 13588 |
if (defaultedOptions.suspense || defaultedOptions.useErrorBoundary) { |
| 13589 |
if (!errorResetBoundary.isReset()) defaultedOptions.retryOnMount = false; |
| 13590 |
} |
| 13591 |
var observer = react.default.useState(function() { |
| 13592 |
return new Observer(queryClient, defaultedOptions); |
| 13593 |
})[0]; |
| 13594 |
var result = observer.getOptimisticResult(defaultedOptions); |
| 13595 |
react.default.useEffect(function() { |
| 13596 |
mountedRef.current = true; |
| 13597 |
errorResetBoundary.clearReset(); |
| 13598 |
var unsubscribe = observer.subscribe(notifyManager.batchCalls(function() { |
| 13599 |
if (mountedRef.current) forceUpdate(function(x) { |
| 13600 |
return x + 1; |
| 13601 |
}); |
| 13602 |
})); |
| 13603 |
observer.updateResult(); |
| 13604 |
return function() { |
| 13605 |
mountedRef.current = false; |
| 13606 |
unsubscribe(); |
| 13607 |
}; |
| 13608 |
}, [errorResetBoundary, observer]); |
| 13609 |
react.default.useEffect(function() { |
| 13610 |
observer.setOptions(defaultedOptions, { listeners: false }); |
| 13611 |
}, [defaultedOptions, observer]); |
| 13612 |
if (defaultedOptions.suspense && result.isLoading) throw observer.fetchOptimistic(defaultedOptions).then(function(_ref) { |
| 13613 |
var data = _ref.data; |
| 13614 |
defaultedOptions.onSuccess == null || defaultedOptions.onSuccess(data); |
| 13615 |
defaultedOptions.onSettled == null || defaultedOptions.onSettled(data, null); |
| 13616 |
}).catch(function(error) { |
| 13617 |
errorResetBoundary.clearReset(); |
| 13618 |
defaultedOptions.onError == null || defaultedOptions.onError(error); |
| 13619 |
defaultedOptions.onSettled == null || defaultedOptions.onSettled(void 0, error); |
| 13620 |
}); |
| 13621 |
if (result.isError && !errorResetBoundary.isReset() && !result.isFetching && shouldThrowError(defaultedOptions.suspense, defaultedOptions.useErrorBoundary, [result.error, observer.getCurrentQuery()])) throw result.error; |
| 13622 |
if (defaultedOptions.notifyOnChangeProps === "tracked") result = observer.trackResult(result, defaultedOptions); |
| 13623 |
return result; |
| 13624 |
} |
| 13625 |
var init_useBaseQuery = __esmMin((() => { |
| 13626 |
init_notifyManager(); |
| 13627 |
init_QueryErrorResetBoundary(); |
| 13628 |
init_QueryClientProvider(); |
| 13629 |
init_utils$2(); |
| 13630 |
})); |
| 13631 |
|
| 13632 |
//#endregion |
| 13633 |
//#region node_modules/react-query/es/react/useQuery.js |
| 13634 |
function useQuery(arg1, arg2, arg3) { |
| 13635 |
return useBaseQuery(parseQueryArgs(arg1, arg2, arg3), QueryObserver); |
| 13636 |
} |
| 13637 |
var init_useQuery = __esmMin((() => { |
| 13638 |
init_core(); |
| 13639 |
init_utils$3(); |
| 13640 |
init_useBaseQuery(); |
| 13641 |
})); |
| 13642 |
|
| 13643 |
//#endregion |
| 13644 |
//#region node_modules/react-query/es/react/types.js |
| 13645 |
var init_types = __esmMin((() => {})); |
| 13646 |
|
| 13647 |
//#endregion |
| 13648 |
//#region node_modules/react-query/es/react/index.js |
| 13649 |
var init_react = __esmMin((() => { |
| 13650 |
init_setBatchUpdatesFn(); |
| 13651 |
init_setLogger(); |
| 13652 |
init_QueryClientProvider(); |
| 13653 |
init_QueryErrorResetBoundary(); |
| 13654 |
init_notifyManager(); |
| 13655 |
init_utils$3(); |
| 13656 |
init_useMutation(); |
| 13657 |
init_useQuery(); |
| 13658 |
init_inheritsLoose(); |
| 13659 |
init_queryObserver(); |
| 13660 |
init_subscribable(); |
| 13661 |
init_extends(); |
| 13662 |
init_infiniteQueryBehavior(); |
| 13663 |
init_useBaseQuery(); |
| 13664 |
init_core(); |
| 13665 |
init_types(); |
| 13666 |
})); |
| 13667 |
|
| 13668 |
//#endregion |
| 13669 |
//#region node_modules/react-query/es/index.js |
| 13670 |
var init_es = __esmMin((() => { |
| 13671 |
init_core(); |
| 13672 |
init_react(); |
| 13673 |
})); |
| 13674 |
|
| 13675 |
//#endregion |
| 13676 |
//#region app/modules/import-export/assets/js/pages/export/export-kit/components/kit-information/components/kit-name/kit-name.js |
| 13677 |
init_es(); |
| 13678 |
init_slicedToArray(); |
| 13679 |
function KitName() { |
| 13680 |
var _exportContext$data$k; |
| 13681 |
var exportContext = (0, react.useContext)(ExportContext$1); |
| 13682 |
var _useState2 = _slicedToArray((0, react.useState)(null), 2); |
| 13683 |
var error = _useState2[0]; |
| 13684 |
var setError = _useState2[1]; |
| 13685 |
var validateKitName = function validateKitName(value) { |
| 13686 |
if (!value || 0 === value.trim().length) return (0, _wordpress_i18n.__)("Must add a name", "elementor"); |
| 13687 |
return null; |
| 13688 |
}; |
| 13689 |
var handleChange = function handleChange(event) { |
| 13690 |
var value = event.target.value; |
| 13691 |
exportContext.dispatch({ |
| 13692 |
type: "SET_KIT_TITLE", |
| 13693 |
payload: value |
| 13694 |
}); |
| 13695 |
validateAndShowError(value); |
| 13696 |
}; |
| 13697 |
var validateAndShowError = function validateAndShowError(value) { |
| 13698 |
var validationError = validateKitName(value); |
| 13699 |
setError(validationError); |
| 13700 |
return validationError; |
| 13701 |
}; |
| 13702 |
return /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 13703 |
container: true, |
| 13704 |
direction: "column" |
| 13705 |
}, /*#__PURE__*/ react.default.createElement(Text$11, { |
| 13706 |
tag: "span", |
| 13707 |
variant: "xs" |
| 13708 |
}, (0, _wordpress_i18n.__)("Name", "elementor")), /*#__PURE__*/ react.default.createElement(TextField, { |
| 13709 |
placeholder: (0, _wordpress_i18n.__)("Type name here...", "elementor"), |
| 13710 |
onChange: handleChange, |
| 13711 |
onBlur: handleChange, |
| 13712 |
className: error ? "e-app-export-kit-information__field--error" : "", |
| 13713 |
title: error || "", |
| 13714 |
value: ((_exportContext$data$k = exportContext.data.kitInfo) === null || _exportContext$data$k === void 0 ? void 0 : _exportContext$data$k.title) || "", |
| 13715 |
autoFocus: true |
| 13716 |
}), /*#__PURE__*/ react.default.createElement("div", { className: "e-app-export-kit-information__error-container" }, error && /*#__PURE__*/ react.default.createElement(Text$11, { |
| 13717 |
variant: "xs", |
| 13718 |
className: "e-app-export-kit-information__validation-error" |
| 13719 |
}, error))); |
| 13720 |
} |
| 13721 |
|
| 13722 |
//#endregion |
| 13723 |
//#region app/modules/import-export/assets/js/pages/export/export-kit/components/kit-information/components/kit-description/kit-description.js |
| 13724 |
function KitDescription() { |
| 13725 |
var exportContext = (0, react.useContext)(ExportContext$1); |
| 13726 |
return /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 13727 |
container: true, |
| 13728 |
direction: "column" |
| 13729 |
}, /*#__PURE__*/ react.default.createElement(Text$11, { |
| 13730 |
tag: "span", |
| 13731 |
variant: "xs" |
| 13732 |
}, (0, _wordpress_i18n.__)("Description (Optional)", "elementor")), /*#__PURE__*/ react.default.createElement(TextField, { |
| 13733 |
placeholder: (0, _wordpress_i18n.__)("Type description here...", "elementor"), |
| 13734 |
onChange: function onChange(event) { |
| 13735 |
exportContext.dispatch({ |
| 13736 |
type: "SET_KIT_DESCRIPTION", |
| 13737 |
payload: event.target.value |
| 13738 |
}); |
| 13739 |
} |
| 13740 |
})); |
| 13741 |
} |
| 13742 |
|
| 13743 |
//#endregion |
| 13744 |
//#region app/modules/import-export/assets/js/pages/export/export-kit/components/kit-information/kit-information.js |
| 13745 |
function KitInformation() { |
| 13746 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(Box$22, null, /*#__PURE__*/ react.default.createElement(List, { |
| 13747 |
padding: "24 40", |
| 13748 |
separated: true, |
| 13749 |
className: "e-app-export-kit-information" |
| 13750 |
}, /*#__PURE__*/ react.default.createElement(List.Item, null, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 13751 |
container: true, |
| 13752 |
noWrap: true, |
| 13753 |
direction: "column", |
| 13754 |
className: "e-app-export-kit-information__content" |
| 13755 |
}, /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 13756 |
item: true, |
| 13757 |
container: true |
| 13758 |
}, /*#__PURE__*/ react.default.createElement(KitName, null)), /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 13759 |
item: true, |
| 13760 |
container: true |
| 13761 |
}, /*#__PURE__*/ react.default.createElement(KitDescription, null))))))); |
| 13762 |
} |
| 13763 |
|
| 13764 |
//#endregion |
| 13765 |
//#region app/modules/import-export/assets/js/pages/export/export-kit/export-kit.js |
| 13766 |
init_button(); |
| 13767 |
function ExportKit$1() { |
| 13768 |
var exportContext = (0, react.useContext)(ExportContext$1); |
| 13769 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 13770 |
var getFooter = function getFooter() { |
| 13771 |
return /*#__PURE__*/ react.default.createElement(ActionsFooter, null, /*#__PURE__*/ react.default.createElement(Button$29, { |
| 13772 |
variant: "contained", |
| 13773 |
text: (0, _wordpress_i18n.__)("Next", "elementor"), |
| 13774 |
color: exportContext.data.kitInfo.title ? "primary" : "disabled", |
| 13775 |
url: exportContext.data.kitInfo.title ? "/export/plugins" : "" |
| 13776 |
})); |
| 13777 |
}; |
| 13778 |
var getLearnMoreLink = function getLearnMoreLink() { |
| 13779 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 13780 |
url: "https://go.elementor.com/app-what-are-kits", |
| 13781 |
italic: true |
| 13782 |
}, (0, _wordpress_i18n.__)("Learn More", "elementor")); |
| 13783 |
}; |
| 13784 |
(0, react.useEffect)(function() { |
| 13785 |
var _elementorAppConfig$i; |
| 13786 |
exportContext.dispatch({ |
| 13787 |
type: "SET_IS_EXPORT_PROCESS_STARTED", |
| 13788 |
payload: true |
| 13789 |
}); |
| 13790 |
sharedContext.dispatch({ |
| 13791 |
type: "SET_CPT", |
| 13792 |
payload: cptObjectToOptionsArray((_elementorAppConfig$i = elementorAppConfig["import-export"].summaryTitles.content) === null || _elementorAppConfig$i === void 0 ? void 0 : _elementorAppConfig$i.customPostTypes, "plural") |
| 13793 |
}); |
| 13794 |
}, []); |
| 13795 |
return /*#__PURE__*/ react.default.createElement(Layout, { |
| 13796 |
type: "export", |
| 13797 |
footer: getFooter() |
| 13798 |
}, /*#__PURE__*/ react.default.createElement("section", { className: "e-app-export-kit" }, /*#__PURE__*/ react.default.createElement(PageHeader$1, { |
| 13799 |
heading: (0, _wordpress_i18n.__)("Select which items to export", "elementor"), |
| 13800 |
description: [(0, _wordpress_i18n.__)("You can export the content, site settings, and templates as a Website Template to be reused in the future.", "elementor"), /*#__PURE__*/ react.default.createElement(react.default.Fragment, { key: "description-secondary-line" }, (0, _wordpress_i18n.__)("Uncheck the items you don't want to include.", "elementor"), " ", getLearnMoreLink())] |
| 13801 |
}), /*#__PURE__*/ react.default.createElement(Grid$14, { |
| 13802 |
container: true, |
| 13803 |
direction: "column", |
| 13804 |
className: "e-app-export-kit__content" |
| 13805 |
}, /*#__PURE__*/ react.default.createElement(KitInformation, null), /*#__PURE__*/ react.default.createElement(KitContent, { contentData: kitContentData$1 })))); |
| 13806 |
} |
| 13807 |
__name(ExportKit$1, "ExportKit"); |
| 13808 |
|
| 13809 |
//#endregion |
| 13810 |
//#region app/assets/js/molecules/dashboard-button.js |
| 13811 |
init_extends(); |
| 13812 |
init_button(); |
| 13813 |
init_use_action(); |
| 13814 |
init_utils$4(); |
| 13815 |
function DashboardButton(props) { |
| 13816 |
var action = useAction(); |
| 13817 |
var classes = ["e-app-dashboard-button", props.className]; |
| 13818 |
return /*#__PURE__*/ react.default.createElement(Button$29, _extends({}, props, { |
| 13819 |
className: arrayToClassName(classes), |
| 13820 |
text: props.text, |
| 13821 |
onClick: action.backToDashboard |
| 13822 |
})); |
| 13823 |
} |
| 13824 |
DashboardButton.propTypes = { |
| 13825 |
className: import_prop_types$55.default.string, |
| 13826 |
text: import_prop_types$55.default.string |
| 13827 |
}; |
| 13828 |
DashboardButton.defaultProps = { |
| 13829 |
className: "", |
| 13830 |
variant: "contained", |
| 13831 |
color: "primary", |
| 13832 |
text: (0, _wordpress_i18n.__)("Back to dashboard", "elementor") |
| 13833 |
}; |
| 13834 |
|
| 13835 |
//#endregion |
| 13836 |
//#region app/modules/import-export/assets/js/pages/export/export-complete/export-complete.js |
| 13837 |
init_es$1(); |
| 13838 |
init_use_kit$1(); |
| 13839 |
init_button(); |
| 13840 |
var INVALID_FILENAME_CHARS$1 = /[<>:"/\\|?*]/g; |
| 13841 |
function ExportComplete$1() { |
| 13842 |
var _exportContext$data; |
| 13843 |
var exportContext = (0, react.useContext)(ExportContext$1); |
| 13844 |
var isSavedToCloud = KIT_SOURCE_MAP.CLOUD === exportContext.data.kitInfo.source; |
| 13845 |
var navigate = useNavigate(); |
| 13846 |
var downloadLink = (0, react.useRef)(null); |
| 13847 |
var getFooter = function getFooter() { |
| 13848 |
return /*#__PURE__*/ react.default.createElement(ActionsFooter, null, isSavedToCloud ? /*#__PURE__*/ react.default.createElement(Button$29, { |
| 13849 |
text: (0, _wordpress_i18n.__)("Open library", "elementor"), |
| 13850 |
variant: "contained", |
| 13851 |
color: "primary", |
| 13852 |
url: "/kit-library/cloud" |
| 13853 |
}) : /*#__PURE__*/ react.default.createElement(DashboardButton, { text: (0, _wordpress_i18n.__)("Done", "elementor") })); |
| 13854 |
}; |
| 13855 |
var downloadFile = function downloadFile() { |
| 13856 |
if (!downloadLink.current) { |
| 13857 |
var _exportContext$data$k; |
| 13858 |
var link = document.createElement("a"); |
| 13859 |
var defaultKitName = "elementor-kit"; |
| 13860 |
var fileName = (((_exportContext$data$k = exportContext.data.kitInfo) === null || _exportContext$data$k === void 0 ? void 0 : _exportContext$data$k.title) || defaultKitName).replace(INVALID_FILENAME_CHARS$1, "").trim() || defaultKitName; |
| 13861 |
link.href = "data:text/plain;base64," + exportContext.data.exportedData.file; |
| 13862 |
link.download = fileName + ".zip"; |
| 13863 |
downloadLink.current = link; |
| 13864 |
} |
| 13865 |
downloadLink.current.click(); |
| 13866 |
}; |
| 13867 |
var getDownloadLink = function getDownloadLink() { |
| 13868 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 13869 |
onClick: downloadFile, |
| 13870 |
italic: true |
| 13871 |
}, (0, _wordpress_i18n.__)("Download manually", "elementor")); |
| 13872 |
}; |
| 13873 |
var getShowMeHowLink = function getShowMeHowLink() { |
| 13874 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 13875 |
url: "https://go.elementor.com/app-what-are-kits", |
| 13876 |
italic: true |
| 13877 |
}, (0, _wordpress_i18n.__)("Show me how", "elementor")); |
| 13878 |
}; |
| 13879 |
var getTakeMeThereLink = function getTakeMeThereLink() { |
| 13880 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 13881 |
url: "/kit-library/cloud", |
| 13882 |
italic: true |
| 13883 |
}, (0, _wordpress_i18n.__)("Take me there", "elementor")); |
| 13884 |
}; |
| 13885 |
(0, react.useEffect)(function() { |
| 13886 |
if (!exportContext.data.exportedData) return navigate("/export"); |
| 13887 |
if (!isSavedToCloud) downloadFile(); |
| 13888 |
}, [exportContext.data.downloadUrl, isSavedToCloud]); |
| 13889 |
var heading = (0, react.useMemo)(function() { |
| 13890 |
return isSavedToCloud ? (0, _wordpress_i18n.__)("Your website template is now saved to the library!", "elementor") : (0, _wordpress_i18n.__)("Your .zip file is ready", "elementor"); |
| 13891 |
}, [isSavedToCloud]); |
| 13892 |
var description = (0, react.useMemo)(function() { |
| 13893 |
return isSavedToCloud ? /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("You can find it in the My Website Templates tab.", "elementor"), " ", getTakeMeThereLink()) : (0, _wordpress_i18n.__)("Once the download is complete, you can upload it to be used for other sites.", "elementor"); |
| 13894 |
}, [isSavedToCloud]); |
| 13895 |
return /*#__PURE__*/ react.default.createElement(Layout, { |
| 13896 |
type: "export", |
| 13897 |
footer: getFooter() |
| 13898 |
}, /*#__PURE__*/ react.default.createElement(WizardStep, { |
| 13899 |
image: elementorAppConfig.assets_url + "images/go-pro.svg", |
| 13900 |
heading, |
| 13901 |
description, |
| 13902 |
notice: function getNotice() { |
| 13903 |
return isSavedToCloud ? /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Build sites faster with Website Templates.", "elementor"), " ", getShowMeHowLink()) : /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Is the automatic download not starting?", "elementor"), " ", getDownloadLink()); |
| 13904 |
}() |
| 13905 |
}, /*#__PURE__*/ react.default.createElement(kit_data_default, { data: (_exportContext$data = exportContext.data) === null || _exportContext$data === void 0 || (_exportContext$data = _exportContext$data.exportedData) === null || _exportContext$data === void 0 ? void 0 : _exportContext$data.manifest }))); |
| 13906 |
} |
| 13907 |
__name(ExportComplete$1, "ExportComplete"); |
| 13908 |
|
| 13909 |
//#endregion |
| 13910 |
//#region app/modules/import-export/assets/js/pages/export/export-plugins/components/export-plugins-selection/export-plugins-selection.js |
| 13911 |
var layout = [3, 1]; |
| 13912 |
var initialDisabled = [0]; |
| 13913 |
function ExportPluginsSelection(_ref) { |
| 13914 |
var onSelect = _ref.onSelect; |
| 13915 |
var response = usePlugins().response; |
| 13916 |
var activePlugins = usePluginsData(response.data).pluginsData.filter(function(_ref2) { |
| 13917 |
var status = _ref2.status; |
| 13918 |
return PLUGIN_STATUS_MAP.ACTIVE === status || PLUGIN_STATUS_MAP.MULTISITE_ACTIVE === status; |
| 13919 |
}); |
| 13920 |
var getInitialSelected = function getInitialSelected() { |
| 13921 |
var initialSelected = [0]; |
| 13922 |
if (activePlugins.length > 1 && PLUGINS_KEYS.ELEMENTOR_PRO === activePlugins[1].name) initialSelected.push(1); |
| 13923 |
return initialSelected; |
| 13924 |
}; |
| 13925 |
if (!response.data) return /*#__PURE__*/ react.default.createElement(Loader, { absoluteCenter: true }); |
| 13926 |
return /*#__PURE__*/ react.default.createElement(plugins_selection_default, { |
| 13927 |
plugins: activePlugins, |
| 13928 |
initialSelected: getInitialSelected(), |
| 13929 |
initialDisabled, |
| 13930 |
layout, |
| 13931 |
withStatus: false, |
| 13932 |
onSelect |
| 13933 |
}); |
| 13934 |
} |
| 13935 |
ExportPluginsSelection.propTypes = { onSelect: import_prop_types$55.default.func.isRequired }; |
| 13936 |
var export_plugins_selection_default = (0, react.memo)(ExportPluginsSelection); |
| 13937 |
|
| 13938 |
//#endregion |
| 13939 |
//#region app/assets/js/utils/cloud-kits.js |
| 13940 |
/** |
| 13941 |
* Fetch cloud kits availability from WordPress backend |
| 13942 |
* |
| 13943 |
* @return {Promise<boolean>} Whether cloud kits should be available |
| 13944 |
*/ |
| 13945 |
function fetchCloudKitsEligibility() { |
| 13946 |
return _fetchCloudKitsEligibility.apply(this, arguments); |
| 13947 |
} |
| 13948 |
/** |
| 13949 |
* Fetch cloud kits quota from WordPress backend |
| 13950 |
* |
| 13951 |
* @return {Promise<Object>} Quota data including storage information |
| 13952 |
*/ |
| 13953 |
function _fetchCloudKitsEligibility() { |
| 13954 |
_fetchCloudKitsEligibility = _asyncToGenerator(/*#__PURE__*/ import_regenerator$2.default.mark(function _callee() { |
| 13955 |
var response; |
| 13956 |
return import_regenerator$2.default.wrap(function(_context) { |
| 13957 |
while (1) switch (_context.prev = _context.next) { |
| 13958 |
case 0: |
| 13959 |
_context.next = 1; |
| 13960 |
return $e.data.get("cloud-kits/eligibility", {}, { refresh: true }); |
| 13961 |
case 1: |
| 13962 |
response = _context.sent; |
| 13963 |
return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data); |
| 13964 |
case 2: |
| 13965 |
case "end": return _context.stop(); |
| 13966 |
} |
| 13967 |
}, _callee); |
| 13968 |
})); |
| 13969 |
return _fetchCloudKitsEligibility.apply(this, arguments); |
| 13970 |
} |
| 13971 |
function fetchCloudKitsQuota() { |
| 13972 |
return _fetchCloudKitsQuota.apply(this, arguments); |
| 13973 |
} |
| 13974 |
function _fetchCloudKitsQuota() { |
| 13975 |
_fetchCloudKitsQuota = _asyncToGenerator(/*#__PURE__*/ import_regenerator$2.default.mark(function _callee2() { |
| 13976 |
var response; |
| 13977 |
return import_regenerator$2.default.wrap(function(_context2) { |
| 13978 |
while (1) switch (_context2.prev = _context2.next) { |
| 13979 |
case 0: |
| 13980 |
_context2.next = 1; |
| 13981 |
return $e.data.get("cloud-kits/quota", {}, { refresh: true }); |
| 13982 |
case 1: |
| 13983 |
response = _context2.sent; |
| 13984 |
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data); |
| 13985 |
case 2: |
| 13986 |
case "end": return _context2.stop(); |
| 13987 |
} |
| 13988 |
}, _callee2); |
| 13989 |
})); |
| 13990 |
return _fetchCloudKitsQuota.apply(this, arguments); |
| 13991 |
} |
| 13992 |
var import_regenerator$2; |
| 13993 |
var init_cloud_kits = __esmMin((() => { |
| 13994 |
init_asyncToGenerator(); |
| 13995 |
import_regenerator$2 = /* @__PURE__ */ __toESM(require_regenerator()); |
| 13996 |
})); |
| 13997 |
|
| 13998 |
//#endregion |
| 13999 |
//#region app/assets/js/hooks/use-cloud-kits-eligibility.js |
| 14000 |
/** |
| 14001 |
* Hook to check if cloud kits should be available |
| 14002 |
* |
| 14003 |
* @param {Object} options - React Query options |
| 14004 |
* @return {Object} Query result with availability status |
| 14005 |
*/ |
| 14006 |
function useCloudKitsEligibility() { |
| 14007 |
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; |
| 14008 |
return useQuery([KEY$6], fetchCloudKitsEligibility, options); |
| 14009 |
} |
| 14010 |
var KEY$6; |
| 14011 |
var init_use_cloud_kits_eligibility = __esmMin((() => { |
| 14012 |
init_cloud_kits(); |
| 14013 |
KEY$6 = "cloud-kits-availability"; |
| 14014 |
})); |
| 14015 |
|
| 14016 |
//#endregion |
| 14017 |
//#region app/modules/import-export/assets/js/hooks/use-connect-state.js |
| 14018 |
init_use_cloud_kits_eligibility(); |
| 14019 |
function useConnectState$2() { |
| 14020 |
var context = (0, react.useContext)(ConnectStateContext$1); |
| 14021 |
if (!context) throw new Error("useConnectState must be used within a ConnectStateProvider"); |
| 14022 |
return context; |
| 14023 |
} |
| 14024 |
__name(useConnectState$2, "useConnectState"); |
| 14025 |
|
| 14026 |
//#endregion |
| 14027 |
//#region app/modules/import-export/assets/js/pages/export/export-plugins/components/export-plugins-footer/export-plugins-footer.js |
| 14028 |
init_use_kit$1(); |
| 14029 |
init_button(); |
| 14030 |
function ExportPluginsFooter(_ref) { |
| 14031 |
var isKitReady = _ref.isKitReady; |
| 14032 |
var exportContext = (0, react.useContext)(ExportContext$1); |
| 14033 |
var _useConnectState = useConnectState$2(); |
| 14034 |
var isConnected = _useConnectState.isConnected; |
| 14035 |
var isConnecting = _useConnectState.isConnecting; |
| 14036 |
var setConnecting = _useConnectState.setConnecting; |
| 14037 |
var handleConnectSuccess = _useConnectState.handleConnectSuccess; |
| 14038 |
var handleConnectError = _useConnectState.handleConnectError; |
| 14039 |
var connectButtonRef = (0, react.useRef)(); |
| 14040 |
var _useCloudKitsEligibil = useCloudKitsEligibility({ enabled: isConnected }); |
| 14041 |
var cloudKitsData = _useCloudKitsEligibil.data; |
| 14042 |
var isCheckingEligibility = _useCloudKitsEligibil.isLoading; |
| 14043 |
var refetchEligibility = _useCloudKitsEligibil.refetch; |
| 14044 |
var isCloudKitsEligible = (cloudKitsData === null || cloudKitsData === void 0 ? void 0 : cloudKitsData.is_eligible) || false; |
| 14045 |
(0, react.useEffect)(function() { |
| 14046 |
if (!connectButtonRef.current) return; |
| 14047 |
jQuery(connectButtonRef.current).elementorConnect({ |
| 14048 |
popup: { |
| 14049 |
width: 600, |
| 14050 |
height: 700 |
| 14051 |
}, |
| 14052 |
success: function success() { |
| 14053 |
handleConnectSuccess(); |
| 14054 |
setConnecting(true); |
| 14055 |
refetchEligibility(); |
| 14056 |
}, |
| 14057 |
error: function error() { |
| 14058 |
handleConnectError(); |
| 14059 |
} |
| 14060 |
}); |
| 14061 |
}, [ |
| 14062 |
handleConnectSuccess, |
| 14063 |
handleConnectError, |
| 14064 |
setConnecting, |
| 14065 |
refetchEligibility |
| 14066 |
]); |
| 14067 |
(0, react.useEffect)(function() { |
| 14068 |
if (!isConnecting || isCheckingEligibility) return; |
| 14069 |
if (!isCloudKitsEligible) window.location.href = elementorAppConfig.base_url + "#/kit-library/cloud"; |
| 14070 |
else { |
| 14071 |
exportContext.dispatch({ |
| 14072 |
type: "SET_KIT_SAVE_SOURCE", |
| 14073 |
payload: KIT_SOURCE_MAP.CLOUD |
| 14074 |
}); |
| 14075 |
window.location.href = elementorAppConfig.base_url + "#/export/process"; |
| 14076 |
} |
| 14077 |
}, [ |
| 14078 |
isConnecting, |
| 14079 |
isCheckingEligibility, |
| 14080 |
isCloudKitsEligible, |
| 14081 |
exportContext |
| 14082 |
]); |
| 14083 |
(0, react.useEffect)(function() { |
| 14084 |
if (isConnecting && !isCheckingEligibility) setConnecting(false); |
| 14085 |
}, [ |
| 14086 |
isConnecting, |
| 14087 |
isCheckingEligibility, |
| 14088 |
setConnecting |
| 14089 |
]); |
| 14090 |
var handleUpgradeClick = function handleUpgradeClick() { |
| 14091 |
window.location.href = elementorAppConfig.base_url + "#/kit-library/cloud"; |
| 14092 |
}; |
| 14093 |
var handleUploadClick = function handleUploadClick() { |
| 14094 |
exportContext.dispatch({ |
| 14095 |
type: "SET_KIT_SAVE_SOURCE", |
| 14096 |
payload: KIT_SOURCE_MAP.CLOUD |
| 14097 |
}); |
| 14098 |
}; |
| 14099 |
return /*#__PURE__*/ react.default.createElement(ActionsFooter, { className: "e-app-export-actions-container" }, /*#__PURE__*/ react.default.createElement(Button$29, { |
| 14100 |
text: (0, _wordpress_i18n.__)("Back", "elementor"), |
| 14101 |
variant: "contained", |
| 14102 |
url: "/export" |
| 14103 |
}), function renderCloudButton() { |
| 14104 |
if (!isConnected) { |
| 14105 |
var _elementorAppConfig; |
| 14106 |
return /*#__PURE__*/ react.default.createElement(Button$29, { |
| 14107 |
elRef: connectButtonRef, |
| 14108 |
text: (0, _wordpress_i18n.__)("Save to library", "elementor"), |
| 14109 |
variant: "outlined", |
| 14110 |
color: "secondary", |
| 14111 |
url: ((_elementorAppConfig = elementorAppConfig) === null || _elementorAppConfig === void 0 || (_elementorAppConfig = _elementorAppConfig["cloud-library"]) === null || _elementorAppConfig === void 0 || (_elementorAppConfig = _elementorAppConfig.library_connect_url) === null || _elementorAppConfig === void 0 ? void 0 : _elementorAppConfig.replace(/&/g, "&")) || "#" |
| 14112 |
}); |
| 14113 |
} |
| 14114 |
if (isConnecting || isCheckingEligibility) return /*#__PURE__*/ react.default.createElement(Button$29, { |
| 14115 |
variant: "outlined", |
| 14116 |
color: "secondary", |
| 14117 |
icon: "eicon-loading eicon-animation-spin" |
| 14118 |
}); |
| 14119 |
if (!isCloudKitsEligible) return /*#__PURE__*/ react.default.createElement(Button$29, { |
| 14120 |
text: (0, _wordpress_i18n.__)("Save to library", "elementor"), |
| 14121 |
variant: "outlined", |
| 14122 |
color: "secondary", |
| 14123 |
onClick: handleUpgradeClick |
| 14124 |
}); |
| 14125 |
return /*#__PURE__*/ react.default.createElement(Button$29, { |
| 14126 |
text: (0, _wordpress_i18n.__)("Save to library", "elementor"), |
| 14127 |
variant: "outlined", |
| 14128 |
color: "secondary", |
| 14129 |
url: "/export/process", |
| 14130 |
onClick: handleUploadClick |
| 14131 |
}); |
| 14132 |
}(), /*#__PURE__*/ react.default.createElement(Button$29, { |
| 14133 |
text: (0, _wordpress_i18n.__)("Export as .zip", "elementor"), |
| 14134 |
variant: "contained", |
| 14135 |
color: isKitReady && !isCheckingEligibility ? "primary" : "disabled", |
| 14136 |
url: isKitReady && !isCheckingEligibility ? "/export/process" : "", |
| 14137 |
hideText: isCheckingEligibility, |
| 14138 |
icon: isCheckingEligibility ? "eicon-loading eicon-animation-spin" : "", |
| 14139 |
onClick: function onClick() { |
| 14140 |
exportContext.dispatch({ |
| 14141 |
type: "SET_KIT_SAVE_SOURCE", |
| 14142 |
payload: KIT_SOURCE_MAP.FILE |
| 14143 |
}); |
| 14144 |
} |
| 14145 |
})); |
| 14146 |
} |
| 14147 |
ExportPluginsFooter.propTypes = { isKitReady: import_prop_types$55.default.bool.isRequired }; |
| 14148 |
|
| 14149 |
//#endregion |
| 14150 |
//#region app/modules/import-export/assets/js/pages/export/export-plugins/export-plugins.js |
| 14151 |
init_slicedToArray(); |
| 14152 |
init_es$1(); |
| 14153 |
function ExportPlugins() { |
| 14154 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 14155 |
var exportContext = (0, react.useContext)(ExportContext$1); |
| 14156 |
var navigate = useNavigate(); |
| 14157 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 14158 |
var isKitReady = _useState2[0]; |
| 14159 |
var setIsKitReady = _useState2[1]; |
| 14160 |
var _ref = exportContext.data || []; |
| 14161 |
var plugins = _ref.plugins; |
| 14162 |
var isExportProcessStarted = _ref.isExportProcessStarted; |
| 14163 |
var hasIncludes = !!sharedContext.data.includes.length; |
| 14164 |
var handleOnSelect = (0, react.useCallback)(function(selectedPlugins) { |
| 14165 |
return exportContext.dispatch({ |
| 14166 |
type: "SET_PLUGINS", |
| 14167 |
payload: selectedPlugins |
| 14168 |
}); |
| 14169 |
}, []); |
| 14170 |
var getLearnMoreLink = function getLearnMoreLink() { |
| 14171 |
return /*#__PURE__*/ react.default.createElement(InlineLink, { |
| 14172 |
url: "https://go.elementor.com/app-what-are-kits", |
| 14173 |
italic: true |
| 14174 |
}, (0, _wordpress_i18n.__)("Learn More", "elementor")); |
| 14175 |
}; |
| 14176 |
(0, react.useEffect)(function() { |
| 14177 |
if (!isExportProcessStarted) navigate("/export"); |
| 14178 |
}, []); |
| 14179 |
(0, react.useEffect)(function() { |
| 14180 |
if (hasIncludes && plugins.length) setIsKitReady(true); |
| 14181 |
else setIsKitReady(plugins.length > 1); |
| 14182 |
}, [plugins]); |
| 14183 |
return /*#__PURE__*/ react.default.createElement(Layout, { |
| 14184 |
type: "export", |
| 14185 |
footer: /*#__PURE__*/ react.default.createElement(ExportPluginsFooter, { isKitReady }) |
| 14186 |
}, /*#__PURE__*/ react.default.createElement("section", { className: "e-app-export-plugins" }, /*#__PURE__*/ react.default.createElement(PageHeader$1, { |
| 14187 |
heading: (0, _wordpress_i18n.__)("Select which plugins to export", "elementor"), |
| 14188 |
description: [(0, _wordpress_i18n.__)("Your Website Template may not work as expected if key plugins are missing.", "elementor"), /*#__PURE__*/ react.default.createElement(react.default.Fragment, { key: "description-secondary-line" }, (0, _wordpress_i18n.__)("By default, we’ll include everything in your file. Uncheck the items you don't want.", "elementor"), " ", getLearnMoreLink())] |
| 14189 |
}), /*#__PURE__*/ react.default.createElement(export_plugins_selection_default, { onSelect: handleOnSelect }))); |
| 14190 |
} |
| 14191 |
|
| 14192 |
//#endregion |
| 14193 |
//#region app/modules/import-export/assets/js/pages/export/export-process/hooks/use-export-plugins-data.js |
| 14194 |
function useExportPluginsData(plugins) { |
| 14195 |
var getData = function getData() { |
| 14196 |
var pluginsData = []; |
| 14197 |
plugins.forEach(function(pluginData) { |
| 14198 |
var name = pluginData.name; |
| 14199 |
var plugin = pluginData.plugin; |
| 14200 |
var pluginUri = pluginData.plugin_uri; |
| 14201 |
var version = pluginData.version; |
| 14202 |
pluginsData.push({ |
| 14203 |
name, |
| 14204 |
plugin, |
| 14205 |
pluginUri, |
| 14206 |
version |
| 14207 |
}); |
| 14208 |
}); |
| 14209 |
return pluginsData; |
| 14210 |
}; |
| 14211 |
return { pluginsData: (0, react.useMemo)(function() { |
| 14212 |
return getData(); |
| 14213 |
}, [plugins]) }; |
| 14214 |
} |
| 14215 |
|
| 14216 |
//#endregion |
| 14217 |
//#region app/modules/import-export/assets/js/pages/export/export-process/export-process.js |
| 14218 |
init_toConsumableArray(); |
| 14219 |
init_asyncToGenerator(); |
| 14220 |
init_slicedToArray(); |
| 14221 |
var import_regenerator$1 = /* @__PURE__ */ __toESM(require_regenerator()); |
| 14222 |
init_es$1(); |
| 14223 |
init_use_kit$1(); |
| 14224 |
function ExportProcess$1() { |
| 14225 |
var sharedContext = (0, react.useContext)(SharedContext); |
| 14226 |
var exportContext = (0, react.useContext)(ExportContext$1); |
| 14227 |
var navigate = useNavigate(); |
| 14228 |
var _useKit = useKit$1(); |
| 14229 |
var kitState = _useKit.kitState; |
| 14230 |
var kitActions = _useKit.kitActions; |
| 14231 |
var KIT_STATUS_MAP = _useKit.KIT_STATUS_MAP; |
| 14232 |
var _useState2 = _slicedToArray((0, react.useState)(""), 2); |
| 14233 |
var errorType = _useState2[0]; |
| 14234 |
var setErrorType = _useState2[1]; |
| 14235 |
var _ref = exportContext.data || {}; |
| 14236 |
var plugins = _ref.plugins; |
| 14237 |
var exportedData = _ref.exportedData; |
| 14238 |
var kitInfo = _ref.kitInfo; |
| 14239 |
var isExportProcessStarted = _ref.isExportProcessStarted; |
| 14240 |
var pluginsData = useExportPluginsData(plugins).pluginsData; |
| 14241 |
var onDialogDismiss = function onDialogDismiss() { |
| 14242 |
exportContext.dispatch({ |
| 14243 |
type: "SET_DOWNLOAD_URL", |
| 14244 |
payload: "" |
| 14245 |
}); |
| 14246 |
navigate("export"); |
| 14247 |
}; |
| 14248 |
var generateScreenshot = function generateScreenshot() { |
| 14249 |
return new Promise(function(resolve) { |
| 14250 |
var iframe = document.createElement("iframe"); |
| 14251 |
iframe.style = "visibility: hidden;"; |
| 14252 |
iframe.width = "1200"; |
| 14253 |
iframe.height = "1000"; |
| 14254 |
var _messageHandler = function messageHandler(event) { |
| 14255 |
if ("kit-screenshot-done" === event.data.name) { |
| 14256 |
window.removeEventListener("message", _messageHandler); |
| 14257 |
document.body.removeChild(iframe); |
| 14258 |
resolve(event.data.imageUrl || null); |
| 14259 |
window.removeEventListener("message", _messageHandler); |
| 14260 |
} |
| 14261 |
}; |
| 14262 |
window.addEventListener("message", _messageHandler); |
| 14263 |
var previewUrl = new URL(window.location.origin); |
| 14264 |
previewUrl.searchParams.set("kit_thumbnail", "1"); |
| 14265 |
previewUrl.searchParams.set("nonce", elementorAppConfig["import-export"].kitPreviewNonce); |
| 14266 |
document.body.appendChild(iframe); |
| 14267 |
iframe.src = previewUrl.toString(); |
| 14268 |
}); |
| 14269 |
}; |
| 14270 |
var exportKit = /*#__PURE__*/ function() { |
| 14271 |
var _ref2 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee() { |
| 14272 |
var _sharedContext$data; |
| 14273 |
var includes; |
| 14274 |
var selectedCustomPostTypes; |
| 14275 |
var kitData; |
| 14276 |
var scr; |
| 14277 |
return import_regenerator$1.default.wrap(function(_context) { |
| 14278 |
while (1) switch (_context.prev = _context.next) { |
| 14279 |
case 0: |
| 14280 |
_sharedContext$data = sharedContext.data, includes = _sharedContext$data.includes, selectedCustomPostTypes = _sharedContext$data.selectedCustomPostTypes; |
| 14281 |
kitData = { |
| 14282 |
include: [].concat(_toConsumableArray(includes), ["plugins"]), |
| 14283 |
kitInfo, |
| 14284 |
plugins: pluginsData, |
| 14285 |
selectedCustomPostTypes |
| 14286 |
}; |
| 14287 |
if (!(KIT_SOURCE_MAP.CLOUD === exportContext.data.kitInfo.source)) { |
| 14288 |
_context.next = 2; |
| 14289 |
break; |
| 14290 |
} |
| 14291 |
_context.next = 1; |
| 14292 |
return generateScreenshot(); |
| 14293 |
case 1: |
| 14294 |
scr = _context.sent; |
| 14295 |
kitData.screenShotBlob = scr; |
| 14296 |
case 2: kitActions.export(kitData); |
| 14297 |
case 3: |
| 14298 |
case "end": return _context.stop(); |
| 14299 |
} |
| 14300 |
}, _callee); |
| 14301 |
})); |
| 14302 |
return function exportKit() { |
| 14303 |
return _ref2.apply(this, arguments); |
| 14304 |
}; |
| 14305 |
}(); |
| 14306 |
(0, react.useEffect)(function() { |
| 14307 |
if (isExportProcessStarted) exportKit(); |
| 14308 |
else navigate("/export"); |
| 14309 |
}, []); |
| 14310 |
(0, react.useEffect)(function() { |
| 14311 |
switch (kitState.status) { |
| 14312 |
case KIT_STATUS_MAP.EXPORTED: |
| 14313 |
exportContext.dispatch({ |
| 14314 |
type: "SET_EXPORTED_DATA", |
| 14315 |
payload: kitState.data |
| 14316 |
}); |
| 14317 |
break; |
| 14318 |
case KIT_STATUS_MAP.ERROR: |
| 14319 |
setErrorType(kitState.data); |
| 14320 |
break; |
| 14321 |
} |
| 14322 |
}, [kitState.status]); |
| 14323 |
(0, react.useEffect)(function() { |
| 14324 |
if (exportedData) navigate("export/complete"); |
| 14325 |
}, [exportedData]); |
| 14326 |
return /*#__PURE__*/ react.default.createElement(Layout, { type: "export" }, /*#__PURE__*/ react.default.createElement(FileProcess, { |
| 14327 |
errorType, |
| 14328 |
onDialogApprove: onDialogDismiss, |
| 14329 |
onDialogDismiss |
| 14330 |
})); |
| 14331 |
} |
| 14332 |
__name(ExportProcess$1, "ExportProcess"); |
| 14333 |
|
| 14334 |
//#endregion |
| 14335 |
//#region app/modules/import-export/assets/js/export.js |
| 14336 |
init_es(); |
| 14337 |
init_es$1(); |
| 14338 |
var queryClient$2 = new QueryClient({ defaultOptions: { queries: { |
| 14339 |
refetchOnWindowFocus: false, |
| 14340 |
retry: false, |
| 14341 |
staleTime: 1e3 * 60 * 30 |
| 14342 |
} } }); |
| 14343 |
function Export$1() { |
| 14344 |
return /*#__PURE__*/ react.default.createElement(QueryClientProvider, { client: queryClient$2 }, /*#__PURE__*/ react.default.createElement(SharedContextProvider, null, /*#__PURE__*/ react.default.createElement(ConnectStateProvider$1, null, /*#__PURE__*/ react.default.createElement(ExportContextProvider$1, null, /*#__PURE__*/ react.default.createElement(LocationProvider, { history: _elementor_router.default.appHistory }, /*#__PURE__*/ react.default.createElement(Router, null, /*#__PURE__*/ react.default.createElement(ExportComplete$1, { path: "complete" }), /*#__PURE__*/ react.default.createElement(ExportPlugins, { path: "plugins" }), /*#__PURE__*/ react.default.createElement(ExportProcess$1, { path: "process" }), /*#__PURE__*/ react.default.createElement(ExportKit$1, { default: true }))))))); |
| 14345 |
} |
| 14346 |
__name(Export$1, "Export"); |
| 14347 |
|
| 14348 |
//#endregion |
| 14349 |
//#region app/modules/import-export/assets/js/module.js |
| 14350 |
init_createClass(); |
| 14351 |
init_classCallCheck(); |
| 14352 |
init_defineProperty$1(); |
| 14353 |
function _createForOfIteratorHelper$2(r, e) { |
| 14354 |
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 14355 |
if (!t) { |
| 14356 |
if (Array.isArray(r) || (t = _unsupportedIterableToArray$2(r)) || e && r && "number" == typeof r.length) { |
| 14357 |
t && (r = t); |
| 14358 |
var _n = 0; |
| 14359 |
var F = function F() {}; |
| 14360 |
return { |
| 14361 |
s: F, |
| 14362 |
n: function n() { |
| 14363 |
return _n >= r.length ? { done: !0 } : { |
| 14364 |
done: !1, |
| 14365 |
value: r[_n++] |
| 14366 |
}; |
| 14367 |
}, |
| 14368 |
e: function e(r) { |
| 14369 |
throw r; |
| 14370 |
}, |
| 14371 |
f: F |
| 14372 |
}; |
| 14373 |
} |
| 14374 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 14375 |
} |
| 14376 |
var o; |
| 14377 |
var a = !0; |
| 14378 |
var u = !1; |
| 14379 |
return { |
| 14380 |
s: function s() { |
| 14381 |
t = t.call(r); |
| 14382 |
}, |
| 14383 |
n: function n() { |
| 14384 |
var r = t.next(); |
| 14385 |
return a = r.done, r; |
| 14386 |
}, |
| 14387 |
e: function e(r) { |
| 14388 |
u = !0, o = r; |
| 14389 |
}, |
| 14390 |
f: function f() { |
| 14391 |
try { |
| 14392 |
a || null == t.return || t.return(); |
| 14393 |
} finally { |
| 14394 |
if (u) throw o; |
| 14395 |
} |
| 14396 |
} |
| 14397 |
}; |
| 14398 |
} |
| 14399 |
__name(_createForOfIteratorHelper$2, "_createForOfIteratorHelper"); |
| 14400 |
function _unsupportedIterableToArray$2(r, a) { |
| 14401 |
if (r) { |
| 14402 |
if ("string" == typeof r) return _arrayLikeToArray$2(r, a); |
| 14403 |
var t = {}.toString.call(r).slice(8, -1); |
| 14404 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; |
| 14405 |
} |
| 14406 |
} |
| 14407 |
__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray"); |
| 14408 |
function _arrayLikeToArray$2(r, a) { |
| 14409 |
(null == a || a > r.length) && (a = r.length); |
| 14410 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 14411 |
return n; |
| 14412 |
} |
| 14413 |
__name(_arrayLikeToArray$2, "_arrayLikeToArray"); |
| 14414 |
var ImportExport = /*#__PURE__*/ _createClass(function ImportExport() { |
| 14415 |
_classCallCheck(this, ImportExport); |
| 14416 |
_defineProperty$1(this, "routes", [{ |
| 14417 |
path: "/import/*", |
| 14418 |
component: Import$1 |
| 14419 |
}, { |
| 14420 |
path: "/export/*", |
| 14421 |
component: Export$1 |
| 14422 |
}]); |
| 14423 |
var _iterator = _createForOfIteratorHelper$2(this.routes); |
| 14424 |
var _step; |
| 14425 |
try { |
| 14426 |
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 14427 |
var route = _step.value; |
| 14428 |
_elementor_router.default.addRoute(route); |
| 14429 |
} |
| 14430 |
} catch (err) { |
| 14431 |
_iterator.e(err); |
| 14432 |
} finally { |
| 14433 |
_iterator.f(); |
| 14434 |
} |
| 14435 |
}); |
| 14436 |
|
| 14437 |
//#endregion |
| 14438 |
//#region app/modules/import-export-customization/assets/js/export/context/export-context.js |
| 14439 |
init_slicedToArray(); |
| 14440 |
init_defineProperty$1(); |
| 14441 |
init_toConsumableArray(); |
| 14442 |
function ownKeys$20(e, r) { |
| 14443 |
var t = Object.keys(e); |
| 14444 |
if (Object.getOwnPropertySymbols) { |
| 14445 |
var o = Object.getOwnPropertySymbols(e); |
| 14446 |
r && (o = o.filter(function(r) { |
| 14447 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 14448 |
})), t.push.apply(t, o); |
| 14449 |
} |
| 14450 |
return t; |
| 14451 |
} |
| 14452 |
__name(ownKeys$20, "ownKeys"); |
| 14453 |
function _objectSpread$19(e) { |
| 14454 |
for (var r = 1; r < arguments.length; r++) { |
| 14455 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 14456 |
r % 2 ? ownKeys$20(Object(t), !0).forEach(function(r) { |
| 14457 |
_defineProperty$1(e, r, t[r]); |
| 14458 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$20(Object(t)).forEach(function(r) { |
| 14459 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 14460 |
}); |
| 14461 |
} |
| 14462 |
return e; |
| 14463 |
} |
| 14464 |
__name(_objectSpread$19, "_objectSpread"); |
| 14465 |
var ExportContext = (0, react.createContext)(); |
| 14466 |
var EXPORT_STATUS = { |
| 14467 |
PENDING: "PENDING", |
| 14468 |
EXPORTING: "EXPORTING", |
| 14469 |
COMPLETED: "COMPLETED" |
| 14470 |
}; |
| 14471 |
var initialState$1 = { |
| 14472 |
downloadUrl: "", |
| 14473 |
exportedData: null, |
| 14474 |
exportStatus: EXPORT_STATUS.PENDING, |
| 14475 |
plugins: [], |
| 14476 |
customization: { |
| 14477 |
settings: null, |
| 14478 |
templates: null, |
| 14479 |
content: null, |
| 14480 |
plugins: null |
| 14481 |
}, |
| 14482 |
includes: ["content"].concat(_toConsumableArray(elementorAppConfig.hasPro ? ["templates"] : []), ["settings", "plugins"]), |
| 14483 |
kitInfo: { |
| 14484 |
title: null, |
| 14485 |
description: null, |
| 14486 |
source: null |
| 14487 |
}, |
| 14488 |
analytics: { customization: { |
| 14489 |
settings: null, |
| 14490 |
templates: null, |
| 14491 |
content: null, |
| 14492 |
plugins: null |
| 14493 |
} }, |
| 14494 |
showMediaFormatValidation: false, |
| 14495 |
validationErrors: { |
| 14496 |
name: null, |
| 14497 |
description: null |
| 14498 |
} |
| 14499 |
}; |
| 14500 |
function exportReducer(state, _ref) { |
| 14501 |
var _state$analytics; |
| 14502 |
var type = _ref.type; |
| 14503 |
var payload = _ref.payload; |
| 14504 |
switch (type) { |
| 14505 |
case "SET_DOWNLOAD_URL": return _objectSpread$19(_objectSpread$19({}, state), {}, { downloadUrl: payload }); |
| 14506 |
case "SET_EXPORTED_DATA": return _objectSpread$19(_objectSpread$19({}, state), {}, { exportedData: payload }); |
| 14507 |
case "SET_PLUGINS": return _objectSpread$19(_objectSpread$19({}, state), {}, { plugins: payload }); |
| 14508 |
case "SET_EXPORT_STATUS": return _objectSpread$19(_objectSpread$19({}, state), {}, { exportStatus: payload }); |
| 14509 |
case "SET_KIT_TITLE": return _objectSpread$19(_objectSpread$19({}, state), {}, { kitInfo: _objectSpread$19(_objectSpread$19({}, state.kitInfo), {}, { title: payload }) }); |
| 14510 |
case "SET_KIT_DESCRIPTION": return _objectSpread$19(_objectSpread$19({}, state), {}, { kitInfo: _objectSpread$19(_objectSpread$19({}, state.kitInfo), {}, { description: payload }) }); |
| 14511 |
case "SET_KIT_SAVE_SOURCE": return _objectSpread$19(_objectSpread$19({}, state), {}, { kitInfo: _objectSpread$19(_objectSpread$19({}, state.kitInfo), {}, { source: payload }) }); |
| 14512 |
case "ADD_INCLUDE": return _objectSpread$19(_objectSpread$19({}, state), {}, { includes: state.includes.includes(payload) ? state.includes : [].concat(_toConsumableArray(state.includes), [payload]) }); |
| 14513 |
case "REMOVE_INCLUDE": return _objectSpread$19(_objectSpread$19({}, state), {}, { |
| 14514 |
includes: state.includes.filter(function(item) { |
| 14515 |
return item !== payload; |
| 14516 |
}), |
| 14517 |
customization: _objectSpread$19(_objectSpread$19({}, state.customization), {}, _defineProperty$1({}, payload, null)) |
| 14518 |
}); |
| 14519 |
case "SET_CUSTOMIZATION": return _objectSpread$19(_objectSpread$19({}, state), {}, { customization: _objectSpread$19(_objectSpread$19({}, state.customization), {}, _defineProperty$1({}, payload.key, payload.value)) }); |
| 14520 |
case "SET_DATA_FOR_ANALYTICS": return _objectSpread$19(_objectSpread$19({}, state), {}, { analytics: { customization: _objectSpread$19(_objectSpread$19({}, (_state$analytics = state.analytics) === null || _state$analytics === void 0 ? void 0 : _state$analytics.customization), {}, _defineProperty$1({}, payload.key, payload.value)) } }); |
| 14521 |
case "SET_MEDIA_FORMAT_VALIDATION": return _objectSpread$19(_objectSpread$19({}, state), {}, { showMediaFormatValidation: payload }); |
| 14522 |
case "SET_VALIDATION_ERRORS": return _objectSpread$19(_objectSpread$19({}, state), {}, { validationErrors: _objectSpread$19(_objectSpread$19({}, state.validationErrors), payload) }); |
| 14523 |
case "RESET_STATE": return _objectSpread$19({}, initialState$1); |
| 14524 |
default: return state; |
| 14525 |
} |
| 14526 |
} |
| 14527 |
function ExportContextProvider(_ref2) { |
| 14528 |
var _data$kitInfo$title; |
| 14529 |
var children = _ref2.children; |
| 14530 |
var _useReducer2 = _slicedToArray((0, react.useReducer)(exportReducer, initialState$1), 2); |
| 14531 |
var data = _useReducer2[0]; |
| 14532 |
var dispatch = _useReducer2[1]; |
| 14533 |
var isNameEmpty = !(((_data$kitInfo$title = data.kitInfo.title) === null || _data$kitInfo$title === void 0 ? void 0 : _data$kitInfo$title.trim()) || "").length; |
| 14534 |
var hasNameError = data.validationErrors.name || isNameEmpty; |
| 14535 |
var hasDescriptionError = data.validationErrors.description; |
| 14536 |
var value = { |
| 14537 |
data, |
| 14538 |
dispatch, |
| 14539 |
hasValidationErrors: !!(hasNameError || hasDescriptionError), |
| 14540 |
isExporting: data.exportStatus === EXPORT_STATUS.EXPORTING, |
| 14541 |
isCompleted: data.exportStatus === EXPORT_STATUS.COMPLETED, |
| 14542 |
isPending: data.exportStatus === EXPORT_STATUS.PENDING |
| 14543 |
}; |
| 14544 |
return /*#__PURE__*/ react.default.createElement(ExportContext.Provider, { value }, children); |
| 14545 |
} |
| 14546 |
ExportContextProvider.propTypes = { children: import_prop_types$55.default.node.isRequired }; |
| 14547 |
function useExportContext() { |
| 14548 |
var context = (0, react.useContext)(ExportContext); |
| 14549 |
if (!context) throw new Error("useExportContext must be used within an ExportContextProvider"); |
| 14550 |
return context; |
| 14551 |
} |
| 14552 |
|
| 14553 |
//#endregion |
| 14554 |
//#region app/modules/import-export-customization/assets/js/shared/components/layout/base-layout.js |
| 14555 |
init_extends(); |
| 14556 |
init_defineProperty$1(); |
| 14557 |
init_objectWithoutProperties(); |
| 14558 |
var _excluded$3 = [ |
| 14559 |
"children", |
| 14560 |
"topBar", |
| 14561 |
"footer", |
| 14562 |
"sx" |
| 14563 |
]; |
| 14564 |
function ownKeys$19(e, r) { |
| 14565 |
var t = Object.keys(e); |
| 14566 |
if (Object.getOwnPropertySymbols) { |
| 14567 |
var o = Object.getOwnPropertySymbols(e); |
| 14568 |
r && (o = o.filter(function(r) { |
| 14569 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 14570 |
})), t.push.apply(t, o); |
| 14571 |
} |
| 14572 |
return t; |
| 14573 |
} |
| 14574 |
__name(ownKeys$19, "ownKeys"); |
| 14575 |
function _objectSpread$18(e) { |
| 14576 |
for (var r = 1; r < arguments.length; r++) { |
| 14577 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 14578 |
r % 2 ? ownKeys$19(Object(t), !0).forEach(function(r) { |
| 14579 |
_defineProperty$1(e, r, t[r]); |
| 14580 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$19(Object(t)).forEach(function(r) { |
| 14581 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 14582 |
}); |
| 14583 |
} |
| 14584 |
return e; |
| 14585 |
} |
| 14586 |
__name(_objectSpread$18, "_objectSpread"); |
| 14587 |
function BaseLayout(props) { |
| 14588 |
var _elementorAppConfig$i; |
| 14589 |
var _elementorCommon; |
| 14590 |
var children = props.children; |
| 14591 |
var topBar = props.topBar; |
| 14592 |
var footer = props.footer; |
| 14593 |
var _props$sx = props.sx; |
| 14594 |
var sx = _props$sx === void 0 ? {} : _props$sx; |
| 14595 |
var rest = _objectWithoutProperties(props, _excluded$3); |
| 14596 |
var uiTheme = ((_elementorAppConfig$i = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i === void 0 ? void 0 : _elementorAppConfig$i.uiTheme) || "auto"; |
| 14597 |
var colorScheme = "dark" === uiTheme || "auto" === uiTheme && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; |
| 14598 |
var isRTL = ((_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 || (_elementorCommon = _elementorCommon.config) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.isRTL) || false; |
| 14599 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.DirectionProvider, { rtl: isRTL }, /*#__PURE__*/ react.default.createElement(_elementor_ui.ThemeProvider, { colorScheme }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, _extends({ sx: _objectSpread$18({ |
| 14600 |
height: "100vh", |
| 14601 |
display: "flex", |
| 14602 |
flexDirection: "column", |
| 14603 |
overflow: "hidden" |
| 14604 |
}, sx) }, rest), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 14605 |
position: "sticky", |
| 14606 |
top: 0 |
| 14607 |
} }, topBar), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 14608 |
component: "main", |
| 14609 |
sx: { |
| 14610 |
flex: 1, |
| 14611 |
overflow: "auto", |
| 14612 |
display: "flex", |
| 14613 |
flexDirection: "column" |
| 14614 |
} |
| 14615 |
}, children), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 14616 |
position: "sticky", |
| 14617 |
bottom: 0 |
| 14618 |
} }, footer)))); |
| 14619 |
} |
| 14620 |
BaseLayout.propTypes = { |
| 14621 |
children: import_prop_types$55.default.node.isRequired, |
| 14622 |
topBar: import_prop_types$55.default.node, |
| 14623 |
footer: import_prop_types$55.default.node, |
| 14624 |
sx: import_prop_types$55.default.object |
| 14625 |
}; |
| 14626 |
|
| 14627 |
//#endregion |
| 14628 |
//#region app/modules/import-export-customization/assets/js/shared/components/layout/centered-content.js |
| 14629 |
var DEFAULT_OFFSET_WITHOUT_FOOTER = 120; |
| 14630 |
var DEFAULT_OFFSET_WITH_FOOTER = 180; |
| 14631 |
function CenteredContent(_ref) { |
| 14632 |
var children = _ref.children; |
| 14633 |
var _ref$hasFooter = _ref.hasFooter; |
| 14634 |
var hasFooter = _ref$hasFooter === void 0 ? false : _ref$hasFooter; |
| 14635 |
var offsetHeight = _ref.offsetHeight; |
| 14636 |
var _ref$maxWidth = _ref.maxWidth; |
| 14637 |
var maxWidth = _ref$maxWidth === void 0 ? "600px" : _ref$maxWidth; |
| 14638 |
var calculatedOffset = offsetHeight || (hasFooter ? DEFAULT_OFFSET_WITH_FOOTER : DEFAULT_OFFSET_WITHOUT_FOOTER); |
| 14639 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 14640 |
display: "flex", |
| 14641 |
alignItems: "center", |
| 14642 |
justifyContent: "center", |
| 14643 |
minHeight: "calc(100vh - ".concat(calculatedOffset, "px)"), |
| 14644 |
p: 3 |
| 14645 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 14646 |
maxWidth, |
| 14647 |
textAlign: "center", |
| 14648 |
width: "100%" |
| 14649 |
} }, children)); |
| 14650 |
} |
| 14651 |
CenteredContent.propTypes = { |
| 14652 |
children: import_prop_types$55.default.node.isRequired, |
| 14653 |
hasFooter: import_prop_types$55.default.bool, |
| 14654 |
offsetHeight: import_prop_types$55.default.number, |
| 14655 |
maxWidth: import_prop_types$55.default.string |
| 14656 |
}; |
| 14657 |
|
| 14658 |
//#endregion |
| 14659 |
//#region app/modules/import-export-customization/assets/js/shared/components/layout/footer.js |
| 14660 |
init_extends(); |
| 14661 |
init_defineProperty$1(); |
| 14662 |
init_objectWithoutProperties(); |
| 14663 |
var _excluded$2 = ["children", "sx"]; |
| 14664 |
function ownKeys$18(e, r) { |
| 14665 |
var t = Object.keys(e); |
| 14666 |
if (Object.getOwnPropertySymbols) { |
| 14667 |
var o = Object.getOwnPropertySymbols(e); |
| 14668 |
r && (o = o.filter(function(r) { |
| 14669 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 14670 |
})), t.push.apply(t, o); |
| 14671 |
} |
| 14672 |
return t; |
| 14673 |
} |
| 14674 |
__name(ownKeys$18, "ownKeys"); |
| 14675 |
function _objectSpread$17(e) { |
| 14676 |
for (var r = 1; r < arguments.length; r++) { |
| 14677 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 14678 |
r % 2 ? ownKeys$18(Object(t), !0).forEach(function(r) { |
| 14679 |
_defineProperty$1(e, r, t[r]); |
| 14680 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$18(Object(t)).forEach(function(r) { |
| 14681 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 14682 |
}); |
| 14683 |
} |
| 14684 |
return e; |
| 14685 |
} |
| 14686 |
__name(_objectSpread$17, "_objectSpread"); |
| 14687 |
function Footer(props) { |
| 14688 |
var children = props.children; |
| 14689 |
var _props$sx = props.sx; |
| 14690 |
var sx = _props$sx === void 0 ? {} : _props$sx; |
| 14691 |
var rest = _objectWithoutProperties(props, _excluded$2); |
| 14692 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, _extends({ |
| 14693 |
component: "footer", |
| 14694 |
sx: _objectSpread$17({ |
| 14695 |
mt: "auto", |
| 14696 |
py: 2, |
| 14697 |
px: 3, |
| 14698 |
borderTop: 1, |
| 14699 |
borderColor: "divider", |
| 14700 |
display: "flex", |
| 14701 |
justifyContent: "flex-end", |
| 14702 |
alignItems: "center" |
| 14703 |
}, sx) |
| 14704 |
}, rest), children); |
| 14705 |
} |
| 14706 |
Footer.propTypes = { |
| 14707 |
children: import_prop_types$55.default.node, |
| 14708 |
sx: import_prop_types$55.default.object |
| 14709 |
}; |
| 14710 |
|
| 14711 |
//#endregion |
| 14712 |
//#region app/modules/import-export-customization/assets/js/import/utils/version-utils.js |
| 14713 |
/** |
| 14714 |
* Compare two semantic versions. |
| 14715 |
* |
| 14716 |
* @param {string|number} a - First version to compare |
| 14717 |
* @param {string|number} b - Second version to compare |
| 14718 |
* @return {number} - Negative if a < b, positive if a > b, zero if equal |
| 14719 |
* |
| 14720 |
* @example |
| 14721 |
* compareVersions('3.9.1', '3.33.0') // -1 (3.9.1 is older) |
| 14722 |
* compareVersions('3.33.1', '3.33.0') // 1 (3.33.1 is newer) |
| 14723 |
* compareVersions('3.33.0', '3.33.0') // 0 (equal) |
| 14724 |
*/ |
| 14725 |
var compareVersions = function compareVersions(a, b) { |
| 14726 |
var aParts = String(a || "0.0.0").split(".").map(Number); |
| 14727 |
var bParts = String(b || "0.0.0").split(".").map(Number); |
| 14728 |
for (var i = 0; i < Math.max(aParts.length, bParts.length); i++) { |
| 14729 |
var aVal = aParts[i] || 0; |
| 14730 |
var bVal = bParts[i] || 0; |
| 14731 |
if (aVal !== bVal) return aVal - bVal; |
| 14732 |
} |
| 14733 |
return 0; |
| 14734 |
}; |
| 14735 |
/** |
| 14736 |
* Check if version A is less than version B. |
| 14737 |
* |
| 14738 |
* @param {string|number} a - First version |
| 14739 |
* @param {string|number} b - Second version |
| 14740 |
* @return {boolean} - True if a < b |
| 14741 |
* |
| 14742 |
* @example |
| 14743 |
* isVersionLessThan('3.9.1', '3.33.0') // true |
| 14744 |
* isVersionLessThan('3.33.1', '3.33.0') // false |
| 14745 |
*/ |
| 14746 |
var isVersionLessThan = function isVersionLessThan(a, b) { |
| 14747 |
return compareVersions(a, b) < 0; |
| 14748 |
}; |
| 14749 |
|
| 14750 |
//#endregion |
| 14751 |
//#region app/modules/import-export-customization/assets/js/import/context/import-context.js |
| 14752 |
init_slicedToArray(); |
| 14753 |
init_toConsumableArray(); |
| 14754 |
init_defineProperty$1(); |
| 14755 |
function ownKeys$17(e, r) { |
| 14756 |
var t = Object.keys(e); |
| 14757 |
if (Object.getOwnPropertySymbols) { |
| 14758 |
var o = Object.getOwnPropertySymbols(e); |
| 14759 |
r && (o = o.filter(function(r) { |
| 14760 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 14761 |
})), t.push.apply(t, o); |
| 14762 |
} |
| 14763 |
return t; |
| 14764 |
} |
| 14765 |
__name(ownKeys$17, "ownKeys"); |
| 14766 |
function _objectSpread$16(e) { |
| 14767 |
for (var r = 1; r < arguments.length; r++) { |
| 14768 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 14769 |
r % 2 ? ownKeys$17(Object(t), !0).forEach(function(r) { |
| 14770 |
_defineProperty$1(e, r, t[r]); |
| 14771 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$17(Object(t)).forEach(function(r) { |
| 14772 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 14773 |
}); |
| 14774 |
} |
| 14775 |
return e; |
| 14776 |
} |
| 14777 |
__name(_objectSpread$16, "_objectSpread"); |
| 14778 |
var IMPORT_STATUS = { |
| 14779 |
PENDING: "PENDING", |
| 14780 |
UPLOADING: "UPLOADING", |
| 14781 |
CUSTOMIZING: "CUSTOMIZING", |
| 14782 |
IMPORTING: "IMPORTING", |
| 14783 |
COMPLETED: "COMPLETED" |
| 14784 |
}; |
| 14785 |
var ACTION_TYPE = { APPLY_ALL: "apply-all" }; |
| 14786 |
var importReducer = function importReducer(state, _ref) { |
| 14787 |
var type = _ref.type; |
| 14788 |
var payload = _ref.payload; |
| 14789 |
switch (type) { |
| 14790 |
case "SET_IMPORT_STATUS": return _objectSpread$16(_objectSpread$16({}, state), {}, { importStatus: payload }); |
| 14791 |
case "SET_FILE": return _objectSpread$16(_objectSpread$16({}, state), {}, { file: payload }); |
| 14792 |
case "SET_UPLOADED_DATA": return _objectSpread$16(_objectSpread$16({}, state), {}, { uploadedData: payload }); |
| 14793 |
case "SET_IMPORTED_DATA": return _objectSpread$16(_objectSpread$16({}, state), {}, { importedData: payload }); |
| 14794 |
case "SET_KIT_UPLOAD_PARAMS": return _objectSpread$16(_objectSpread$16({}, state), {}, { kitUploadParams: payload }); |
| 14795 |
case "SET_ACTION_TYPE": return _objectSpread$16(_objectSpread$16({}, state), {}, { actionType: payload }); |
| 14796 |
case "SET_RETURN_TO": return _objectSpread$16(_objectSpread$16({}, state), {}, { returnTo: payload }); |
| 14797 |
case "SET_NO_AUTOMATIC_REDIRECT": return _objectSpread$16(_objectSpread$16({}, state), {}, { noAutomaticRedirect: payload }); |
| 14798 |
case "SET_RUNNERS_STATE": return _objectSpread$16(_objectSpread$16({}, state), {}, { runnersState: _objectSpread$16(_objectSpread$16({}, state.runnersState), payload) }); |
| 14799 |
case "ADD_INCLUDE": return _objectSpread$16(_objectSpread$16({}, state), {}, { includes: state.includes.includes(payload) ? state.includes : [].concat(_toConsumableArray(state.includes), [payload]) }); |
| 14800 |
case "ADD_INCLUDES": return _objectSpread$16(_objectSpread$16({}, state), {}, { includes: Array.from(new Set([].concat(_toConsumableArray(state.includes), _toConsumableArray(payload)))) }); |
| 14801 |
case "REMOVE_INCLUDE": return _objectSpread$16(_objectSpread$16({}, state), {}, { |
| 14802 |
includes: state.includes.filter(function(item) { |
| 14803 |
return item !== payload; |
| 14804 |
}), |
| 14805 |
customization: _objectSpread$16(_objectSpread$16({}, state.customization), {}, _defineProperty$1({}, payload, null)) |
| 14806 |
}); |
| 14807 |
case "RESET_STATE": return _objectSpread$16({}, initialState); |
| 14808 |
case "SET_CUSTOMIZATION": return _objectSpread$16(_objectSpread$16({}, state), {}, { customization: _objectSpread$16(_objectSpread$16({}, state.customization), {}, _defineProperty$1({}, payload.key, payload.value)) }); |
| 14809 |
case "SET_DURATION": return _objectSpread$16(_objectSpread$16({}, state), {}, { duration: payload }); |
| 14810 |
default: return state; |
| 14811 |
} |
| 14812 |
}; |
| 14813 |
var ImportContext = (0, react.createContext)(); |
| 14814 |
var initialState = { |
| 14815 |
file: null, |
| 14816 |
uploadedData: null, |
| 14817 |
importedData: null, |
| 14818 |
kitUploadParams: null, |
| 14819 |
actionType: null, |
| 14820 |
returnTo: null, |
| 14821 |
noAutomaticRedirect: false, |
| 14822 |
plugins: [], |
| 14823 |
includes: ["plugins"], |
| 14824 |
importStatus: IMPORT_STATUS.PENDING, |
| 14825 |
runnersState: {}, |
| 14826 |
customization: { |
| 14827 |
settings: null, |
| 14828 |
templates: null, |
| 14829 |
content: null, |
| 14830 |
plugins: null |
| 14831 |
}, |
| 14832 |
duration: null |
| 14833 |
}; |
| 14834 |
function ImportContextProvider(props) { |
| 14835 |
var _data$uploadedData; |
| 14836 |
var _data$uploadedData2; |
| 14837 |
var _useReducer2 = _slicedToArray((0, react.useReducer)(importReducer, initialState), 2); |
| 14838 |
var data = _useReducer2[0]; |
| 14839 |
var dispatch = _useReducer2[1]; |
| 14840 |
var isOldExport = isVersionLessThan((_data$uploadedData = data.uploadedData) === null || _data$uploadedData === void 0 || (_data$uploadedData = _data$uploadedData.manifest) === null || _data$uploadedData === void 0 ? void 0 : _data$uploadedData.version, elementorAppConfig["import-export-customization"].manifestVersion); |
| 14841 |
var isOldElementorVersion = isVersionLessThan(elementorAppConfig["import-export-customization"].elementorVersion, (_data$uploadedData2 = data.uploadedData) === null || _data$uploadedData2 === void 0 || (_data$uploadedData2 = _data$uploadedData2.manifest) === null || _data$uploadedData2 === void 0 ? void 0 : _data$uploadedData2.elementor_version); |
| 14842 |
return /*#__PURE__*/ react.default.createElement(ImportContext.Provider, { value: { |
| 14843 |
data, |
| 14844 |
dispatch, |
| 14845 |
runnersState: data.runnersState, |
| 14846 |
isUploading: data.importStatus === IMPORT_STATUS.UPLOADING, |
| 14847 |
isCustomizing: data.importStatus === IMPORT_STATUS.CUSTOMIZING, |
| 14848 |
isProcessing: data.importStatus === IMPORT_STATUS.IMPORTING, |
| 14849 |
isCompleted: data.importStatus === IMPORT_STATUS.COMPLETED, |
| 14850 |
isOldExport, |
| 14851 |
isOldElementorVersion |
| 14852 |
} }, props.children); |
| 14853 |
} |
| 14854 |
ImportContextProvider.propTypes = { children: import_prop_types$55.default.node.isRequired }; |
| 14855 |
function useImportContext() { |
| 14856 |
var context = (0, react.useContext)(ImportContext); |
| 14857 |
if (!context) throw new Error("useImportContext must be used within an ImportContextProvider"); |
| 14858 |
return context; |
| 14859 |
} |
| 14860 |
|
| 14861 |
//#endregion |
| 14862 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-context-detection.js |
| 14863 |
function useContextDetection() { |
| 14864 |
var importContext = (0, react.useContext)(ImportContext); |
| 14865 |
var exportContext = (0, react.useContext)(ExportContext); |
| 14866 |
if (importContext) return { |
| 14867 |
isImport: true, |
| 14868 |
contextData: importContext |
| 14869 |
}; |
| 14870 |
if (exportContext) return { |
| 14871 |
isImport: false, |
| 14872 |
contextData: exportContext |
| 14873 |
}; |
| 14874 |
throw new Error("useContextDetection must be used within either an ImportContextProvider or ExportContextProvider"); |
| 14875 |
} |
| 14876 |
|
| 14877 |
//#endregion |
| 14878 |
//#region app/modules/import-export-customization/assets/js/shared/components/layout/page-header.js |
| 14879 |
init_extends(); |
| 14880 |
var StyledElementorLogo = (0, _elementor_ui.styled)(function ElementorLogo(props) { |
| 14881 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 32 32" }, props), /*#__PURE__*/ react.default.createElement("path", { |
| 14882 |
fillRule: "evenodd", |
| 14883 |
clipRule: "evenodd", |
| 14884 |
d: "M2.69648 24.8891C0.938383 22.2579 0 19.1645 0 16C0 11.7566 1.68571 7.68687 4.68629 4.68629C7.68687 1.68571 11.7566 0 16 0C19.1645 0 22.2579 0.938383 24.8891 2.69648C27.5203 4.45459 29.5711 6.95344 30.7821 9.87706C31.9931 12.8007 32.3099 16.0177 31.6926 19.1214C31.0752 22.2251 29.5514 25.0761 27.3137 27.3137C25.0761 29.5514 22.2251 31.0752 19.1214 31.6926C16.0177 32.3099 12.8007 31.9931 9.87706 30.7821C6.95344 29.5711 4.45459 27.5203 2.69648 24.8891ZM12.0006 9.33281H9.33437V22.6665H12.0006V9.33281ZM22.6657 9.33281H14.6669V11.9991H22.6657V9.33281ZM22.6657 14.6654H14.6669V17.3316H22.6657V14.6654ZM22.6657 20.0003H14.6669V22.6665H22.6657V20.0003Z" |
| 14885 |
})); |
| 14886 |
})(function(_ref) { |
| 14887 |
var theme = _ref.theme; |
| 14888 |
return { |
| 14889 |
width: theme.spacing(4), |
| 14890 |
height: theme.spacing(4), |
| 14891 |
"& path": { fill: theme.palette.text.primary } |
| 14892 |
}; |
| 14893 |
}); |
| 14894 |
function PageHeader(_ref2) { |
| 14895 |
var _ref2$title = _ref2.title; |
| 14896 |
var title = _ref2$title === void 0 ? (0, _wordpress_i18n.__)("Export", "elementor") : _ref2$title; |
| 14897 |
var _useContextDetection = useContextDetection(); |
| 14898 |
var isImport = _useContextDetection.isImport; |
| 14899 |
var contextData = _useContextDetection.contextData; |
| 14900 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 14901 |
direction: "row", |
| 14902 |
spacing: 2, |
| 14903 |
alignItems: "center" |
| 14904 |
}, /*#__PURE__*/ react.default.createElement(StyledElementorLogo, { sx: { mr: 1 } }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 14905 |
variant: "h6", |
| 14906 |
component: "h1", |
| 14907 |
color: "text.primary", |
| 14908 |
sx: { fontWeight: 600 } |
| 14909 |
}, title)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 14910 |
direction: "row", |
| 14911 |
spacing: 1, |
| 14912 |
alignItems: "center" |
| 14913 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { |
| 14914 |
onClick: function handleClose() { |
| 14915 |
var path = "admin.php?page=elementor-tools#tab-import-export-kit"; |
| 14916 |
if (isImport) { |
| 14917 |
var _contextData$data; |
| 14918 |
var _contextData$data2; |
| 14919 |
if ("cloud" === (contextData === null || contextData === void 0 || (_contextData$data = contextData.data) === null || _contextData$data === void 0 || (_contextData$data = _contextData$data.kitUploadParams) === null || _contextData$data === void 0 ? void 0 : _contextData$data.source)) path = "admin.php?page=elementor-app&source=kit_import#kit-library/cloud"; |
| 14920 |
else if ("kit-library" === (contextData === null || contextData === void 0 || (_contextData$data2 = contextData.data) === null || _contextData$data2 === void 0 || (_contextData$data2 = _contextData$data2.kitUploadParams) === null || _contextData$data2 === void 0 ? void 0 : _contextData$data2.source)) path = "admin.php?page=elementor-app&source=kit_import#kit-library"; |
| 14921 |
} |
| 14922 |
window.top.location = elementorAppConfig.admin_url + path; |
| 14923 |
}, |
| 14924 |
"aria-label": (0, _wordpress_i18n.__)("Close", "elementor") |
| 14925 |
}, /*#__PURE__*/ react.default.createElement(_elementor_icons.XIcon, null)))); |
| 14926 |
} |
| 14927 |
PageHeader.propTypes = { title: import_prop_types$55.default.string }; |
| 14928 |
|
| 14929 |
//#endregion |
| 14930 |
//#region app/modules/import-export-customization/assets/js/shared/components/layout/top-bar.js |
| 14931 |
init_extends(); |
| 14932 |
init_defineProperty$1(); |
| 14933 |
init_objectWithoutProperties(); |
| 14934 |
var _excluded$1 = ["children", "sx"]; |
| 14935 |
function ownKeys$16(e, r) { |
| 14936 |
var t = Object.keys(e); |
| 14937 |
if (Object.getOwnPropertySymbols) { |
| 14938 |
var o = Object.getOwnPropertySymbols(e); |
| 14939 |
r && (o = o.filter(function(r) { |
| 14940 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 14941 |
})), t.push.apply(t, o); |
| 14942 |
} |
| 14943 |
return t; |
| 14944 |
} |
| 14945 |
__name(ownKeys$16, "ownKeys"); |
| 14946 |
function _objectSpread$15(e) { |
| 14947 |
for (var r = 1; r < arguments.length; r++) { |
| 14948 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 14949 |
r % 2 ? ownKeys$16(Object(t), !0).forEach(function(r) { |
| 14950 |
_defineProperty$1(e, r, t[r]); |
| 14951 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$16(Object(t)).forEach(function(r) { |
| 14952 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 14953 |
}); |
| 14954 |
} |
| 14955 |
return e; |
| 14956 |
} |
| 14957 |
__name(_objectSpread$15, "_objectSpread"); |
| 14958 |
function TopBar(props) { |
| 14959 |
var children = props.children; |
| 14960 |
var _props$sx = props.sx; |
| 14961 |
var sx = _props$sx === void 0 ? {} : _props$sx; |
| 14962 |
var rest = _objectWithoutProperties(props, _excluded$1); |
| 14963 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.AppBar, _extends({ |
| 14964 |
position: "static", |
| 14965 |
elevation: 0, |
| 14966 |
sx: _objectSpread$15({ backgroundColor: "background.default" }, sx) |
| 14967 |
}, rest), /*#__PURE__*/ react.default.createElement(_elementor_ui.Toolbar, { sx: { |
| 14968 |
minHeight: { |
| 14969 |
xs: 56, |
| 14970 |
sm: 64 |
| 14971 |
}, |
| 14972 |
px: 3, |
| 14973 |
justifyContent: "space-between" |
| 14974 |
} }, children)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, null)); |
| 14975 |
} |
| 14976 |
TopBar.propTypes = { |
| 14977 |
children: import_prop_types$55.default.node, |
| 14978 |
sx: import_prop_types$55.default.object |
| 14979 |
}; |
| 14980 |
|
| 14981 |
//#endregion |
| 14982 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-kit-plugins.js |
| 14983 |
init_asyncToGenerator(); |
| 14984 |
init_slicedToArray(); |
| 14985 |
function useKitPlugins(_ref) { |
| 14986 |
var open = _ref.open; |
| 14987 |
var _useState2 = _slicedToArray((0, react.useState)({}), 2); |
| 14988 |
var pluginsList = _useState2[0]; |
| 14989 |
var setPluginsList = _useState2[1]; |
| 14990 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 14991 |
var isLoading = _useState4[0]; |
| 14992 |
var setIsLoading = _useState4[1]; |
| 14993 |
var fetchPlugins = (0, react.useCallback)(/*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee() { |
| 14994 |
var _window$wpApiSettings; |
| 14995 |
var requestUrl; |
| 14996 |
var response; |
| 14997 |
var result; |
| 14998 |
var errorMessage; |
| 14999 |
var pluginsObject; |
| 15000 |
return import_regenerator$1.default.wrap(function(_context) { |
| 15001 |
while (1) switch (_context.prev = _context.next) { |
| 15002 |
case 0: |
| 15003 |
setIsLoading(true); |
| 15004 |
_context.prev = 1; |
| 15005 |
requestUrl = "".concat(elementorCommon.config.urls.rest, "wp/v2/plugins/"); |
| 15006 |
_context.next = 2; |
| 15007 |
return fetch(requestUrl, { |
| 15008 |
method: "GET", |
| 15009 |
headers: { |
| 15010 |
"Content-Type": "application/json", |
| 15011 |
"X-WP-Nonce": ((_window$wpApiSettings = window.wpApiSettings) === null || _window$wpApiSettings === void 0 ? void 0 : _window$wpApiSettings.nonce) || "" |
| 15012 |
} |
| 15013 |
}); |
| 15014 |
case 2: |
| 15015 |
response = _context.sent; |
| 15016 |
_context.next = 3; |
| 15017 |
return response.json(); |
| 15018 |
case 3: |
| 15019 |
result = _context.sent; |
| 15020 |
if (response.ok) { |
| 15021 |
_context.next = 4; |
| 15022 |
break; |
| 15023 |
} |
| 15024 |
errorMessage = (result === null || result === void 0 ? void 0 : result.message) || "HTTP error! Status: ".concat(response.status); |
| 15025 |
throw new Error(errorMessage); |
| 15026 |
case 4: |
| 15027 |
if (Array.isArray(result)) { |
| 15028 |
_context.next = 5; |
| 15029 |
break; |
| 15030 |
} |
| 15031 |
return _context.abrupt("return"); |
| 15032 |
case 5: |
| 15033 |
pluginsObject = {}; |
| 15034 |
result.forEach(function(plugin) { |
| 15035 |
pluginsObject[plugin.plugin] = { |
| 15036 |
name: plugin.name, |
| 15037 |
plugin: plugin.plugin, |
| 15038 |
pluginUri: plugin.plugin_uri, |
| 15039 |
version: plugin.version |
| 15040 |
}; |
| 15041 |
}); |
| 15042 |
setPluginsList(pluginsObject); |
| 15043 |
_context.next = 7; |
| 15044 |
break; |
| 15045 |
case 6: |
| 15046 |
_context.prev = 6; |
| 15047 |
_context["catch"](1); |
| 15048 |
setPluginsList({}); |
| 15049 |
case 7: |
| 15050 |
_context.prev = 7; |
| 15051 |
setIsLoading(false); |
| 15052 |
return _context.finish(7); |
| 15053 |
case 8: |
| 15054 |
case "end": return _context.stop(); |
| 15055 |
} |
| 15056 |
}, _callee, null, [[ |
| 15057 |
1, |
| 15058 |
6, |
| 15059 |
7, |
| 15060 |
8 |
| 15061 |
]]); |
| 15062 |
})), []); |
| 15063 |
(0, react.useEffect)(function() { |
| 15064 |
if (open) fetchPlugins(); |
| 15065 |
}, [open, fetchPlugins]); |
| 15066 |
return { |
| 15067 |
pluginsList, |
| 15068 |
isLoading |
| 15069 |
}; |
| 15070 |
} |
| 15071 |
|
| 15072 |
//#endregion |
| 15073 |
//#region app/modules/import-export-customization/assets/js/shared/components/upgrade-version-banner.js |
| 15074 |
function UpgradeVersionBanner() { |
| 15075 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Paper, { |
| 15076 |
color: "info", |
| 15077 |
elevation: 0, |
| 15078 |
variant: "elevation" |
| 15079 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 15080 |
direction: "row", |
| 15081 |
sx: { |
| 15082 |
alignItems: "center", |
| 15083 |
justifyContent: "space-between", |
| 15084 |
gap: "5px", |
| 15085 |
py: 1.5, |
| 15086 |
px: 2.5 |
| 15087 |
} |
| 15088 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 15089 |
direction: "row", |
| 15090 |
sx: { |
| 15091 |
alignItems: "center", |
| 15092 |
gap: "5px" |
| 15093 |
} |
| 15094 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, { |
| 15095 |
viewBox: "0 0 22 22", |
| 15096 |
sx: { |
| 15097 |
fontSize: 16, |
| 15098 |
color: "info.light" |
| 15099 |
} |
| 15100 |
}, /*#__PURE__*/ react.default.createElement("path", { |
| 15101 |
fillRule: "evenodd", |
| 15102 |
clipRule: "evenodd", |
| 15103 |
d: "M4.58268 4.35352C4.5219 4.35352 4.46361 4.37766 4.42064 4.42064C4.37766 4.46361 4.35352 4.5219 4.35352 4.58268V6.64518H6.64518V4.35352H4.58268ZM4.58268 2.97852C4.15723 2.97852 3.7492 3.14753 3.44837 3.44837C3.14753 3.7492 2.97852 4.15723 2.97852 4.58268V17.416C2.97852 17.8415 3.14753 18.2495 3.44837 18.5503C3.74921 18.8512 4.15723 19.0202 4.58268 19.0202H17.416C17.8415 19.0202 18.2495 18.8512 18.5503 18.5503C18.8512 18.2495 19.0202 17.8415 19.0202 17.416V4.58268C19.0202 4.15723 18.8512 3.74921 18.5503 3.44837C18.2495 3.14753 17.8415 2.97852 17.416 2.97852H4.58268ZM8.02018 4.35352V6.64518H17.6452V4.58268C17.6452 4.5219 17.621 4.46361 17.5781 4.42064C17.5351 4.37766 17.4768 4.35352 17.416 4.35352H8.02018ZM17.6452 8.02018H4.35352V17.416C4.35352 17.4768 4.37766 17.5351 4.42064 17.5781C4.46361 17.621 4.5219 17.6452 4.58268 17.6452H17.416C17.4768 17.6452 17.5351 17.621 17.5781 17.5781C17.621 17.5351 17.6452 17.4768 17.6452 17.416V8.02018Z", |
| 15104 |
fill: "currentColor" |
| 15105 |
})), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.__)("You’re using an older Elementor version. Update for full customization.", "elementor"))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 15106 |
variant: "outlined", |
| 15107 |
onClick: function onClick() { |
| 15108 |
var _elementorAppConfig$i; |
| 15109 |
return window.open((_elementorAppConfig$i = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i === void 0 ? void 0 : _elementorAppConfig$i.upgradeVersionUrl, "_blank"); |
| 15110 |
}, |
| 15111 |
color: "info" |
| 15112 |
}, (0, _wordpress_i18n.__)("Update version", "elementor")))); |
| 15113 |
} |
| 15114 |
|
| 15115 |
//#endregion |
| 15116 |
//#region app/modules/import-export-customization/assets/js/shared/utils/analytics-transformer.js |
| 15117 |
init_typeof$1(); |
| 15118 |
var ANALYTICS_TRANSFORM_RULES = { |
| 15119 |
STRING: function STRING(value) { |
| 15120 |
return value; |
| 15121 |
}, |
| 15122 |
BOOLEAN: function BOOLEAN(value) { |
| 15123 |
return value; |
| 15124 |
}, |
| 15125 |
EMPTY_ARRAY: function EMPTY_ARRAY() { |
| 15126 |
return "None"; |
| 15127 |
}, |
| 15128 |
FULL_ARRAY: function FULL_ARRAY() { |
| 15129 |
return "All"; |
| 15130 |
}, |
| 15131 |
PARTIAL_ARRAY: function PARTIAL_ARRAY() { |
| 15132 |
return "Partial"; |
| 15133 |
} |
| 15134 |
}; |
| 15135 |
var getTotalAvailableCount = function getTotalAvailableCount(key, optionsArray) { |
| 15136 |
return optionsArray.reduce(function(map, _ref) { |
| 15137 |
var optionKey = _ref.key; |
| 15138 |
map[optionKey] = _ref.options.length; |
| 15139 |
return map; |
| 15140 |
}, {})[key] || 0; |
| 15141 |
}; |
| 15142 |
var transformValueForAnalytics = function transformValueForAnalytics(key, value, optionsArray) { |
| 15143 |
if ("string" === typeof value || "boolean" === typeof value) return ANALYTICS_TRANSFORM_RULES[_typeof$1(value).toUpperCase()](value); |
| 15144 |
if ("object" === _typeof$1(value) && value !== null && !Array.isArray(value) && "enabled" in value) return value.enabled; |
| 15145 |
if (Array.isArray(value)) { |
| 15146 |
if (0 === value.length) return ANALYTICS_TRANSFORM_RULES.EMPTY_ARRAY(); |
| 15147 |
var totalAvailable = getTotalAvailableCount(key, optionsArray); |
| 15148 |
return value.length === totalAvailable ? ANALYTICS_TRANSFORM_RULES.FULL_ARRAY() : ANALYTICS_TRANSFORM_RULES.PARTIAL_ARRAY(); |
| 15149 |
} |
| 15150 |
return value; |
| 15151 |
}; |
| 15152 |
|
| 15153 |
//#endregion |
| 15154 |
//#region app/modules/import-export-customization/assets/js/shared/components/kit-plugins-customization-dialog.js |
| 15155 |
init_defineProperty$1(); |
| 15156 |
init_slicedToArray(); |
| 15157 |
init_apps_event_tracking(); |
| 15158 |
function ownKeys$15(e, r) { |
| 15159 |
var t = Object.keys(e); |
| 15160 |
if (Object.getOwnPropertySymbols) { |
| 15161 |
var o = Object.getOwnPropertySymbols(e); |
| 15162 |
r && (o = o.filter(function(r) { |
| 15163 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 15164 |
})), t.push.apply(t, o); |
| 15165 |
} |
| 15166 |
return t; |
| 15167 |
} |
| 15168 |
__name(ownKeys$15, "ownKeys"); |
| 15169 |
function _objectSpread$14(e) { |
| 15170 |
for (var r = 1; r < arguments.length; r++) { |
| 15171 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 15172 |
r % 2 ? ownKeys$15(Object(t), !0).forEach(function(r) { |
| 15173 |
_defineProperty$1(e, r, t[r]); |
| 15174 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$15(Object(t)).forEach(function(r) { |
| 15175 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 15176 |
}); |
| 15177 |
} |
| 15178 |
return e; |
| 15179 |
} |
| 15180 |
__name(_objectSpread$14, "_objectSpread"); |
| 15181 |
var transformAnalyticsData$2 = function transformAnalyticsData(payload) { |
| 15182 |
var transformed = {}; |
| 15183 |
for (var _i = 0, _Object$entries = Object.entries(payload); _i < _Object$entries.length; _i++) { |
| 15184 |
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2); |
| 15185 |
var key = _Object$entries$_i[0]; |
| 15186 |
var value = _Object$entries$_i[1]; |
| 15187 |
transformed[key] = transformValueForAnalytics(key, value, []); |
| 15188 |
} |
| 15189 |
return transformed; |
| 15190 |
}; |
| 15191 |
var REQUIRED_PLUGINS = ["elementor/elementor"]; |
| 15192 |
function KitPluginsCustomizationDialog(_ref) { |
| 15193 |
var _useContextDetection; |
| 15194 |
var _data$uploadedData2; |
| 15195 |
var _data$includes; |
| 15196 |
var _data$customization2; |
| 15197 |
var open = _ref.open; |
| 15198 |
var handleClose = _ref.handleClose; |
| 15199 |
var handleSaveChanges = _ref.handleSaveChanges; |
| 15200 |
var _ref2 = (_useContextDetection = useContextDetection()) !== null && _useContextDetection !== void 0 ? _useContextDetection : {}; |
| 15201 |
var _ref2$isImport = _ref2.isImport; |
| 15202 |
var isImport = _ref2$isImport === void 0 ? false : _ref2$isImport; |
| 15203 |
var _ref2$contextData = _ref2.contextData; |
| 15204 |
var contextData = _ref2$contextData === void 0 ? {} : _ref2$contextData; |
| 15205 |
var _contextData$data = contextData.data; |
| 15206 |
var data = _contextData$data === void 0 ? null : _contextData$data; |
| 15207 |
var _contextData$isOldEle = contextData.isOldElementorVersion; |
| 15208 |
var isOldElementorVersion = _contextData$isOldEle === void 0 ? false : _contextData$isOldEle; |
| 15209 |
var _useKitPlugins = useKitPlugins({ open: open && !isImport }); |
| 15210 |
var fetchedPluginsList = _useKitPlugins.pluginsList; |
| 15211 |
var fetchIsLoading = _useKitPlugins.isLoading; |
| 15212 |
var pluginsList = (0, react.useMemo)(function() { |
| 15213 |
if (isImport) { |
| 15214 |
var _data$uploadedData; |
| 15215 |
return ((data === null || data === void 0 || (_data$uploadedData = data.uploadedData) === null || _data$uploadedData === void 0 || (_data$uploadedData = _data$uploadedData.manifest) === null || _data$uploadedData === void 0 ? void 0 : _data$uploadedData.plugins) || []).reduce(function(acc, plugin) { |
| 15216 |
acc[plugin.plugin] = plugin; |
| 15217 |
return acc; |
| 15218 |
}, {}); |
| 15219 |
} |
| 15220 |
return fetchedPluginsList; |
| 15221 |
}, [ |
| 15222 |
isImport, |
| 15223 |
data === null || data === void 0 || (_data$uploadedData2 = data.uploadedData) === null || _data$uploadedData2 === void 0 || (_data$uploadedData2 = _data$uploadedData2.manifest) === null || _data$uploadedData2 === void 0 ? void 0 : _data$uploadedData2.plugins, |
| 15224 |
fetchedPluginsList |
| 15225 |
]); |
| 15226 |
var isLoading = isImport ? false : fetchIsLoading; |
| 15227 |
var _useState2 = _slicedToArray((0, react.useState)({}), 2); |
| 15228 |
var plugins = _useState2[0]; |
| 15229 |
var setPlugins = _useState2[1]; |
| 15230 |
var initialState = (data === null || data === void 0 || (_data$includes = data.includes) === null || _data$includes === void 0 ? void 0 : _data$includes.includes("plugins")) || false; |
| 15231 |
(0, react.useEffect)(function() { |
| 15232 |
var _data$customization; |
| 15233 |
if (0 === Object.keys(pluginsList).length) return; |
| 15234 |
var initialPluginsState = {}; |
| 15235 |
if (data !== null && data !== void 0 && (_data$customization = data.customization) !== null && _data$customization !== void 0 && _data$customization.plugins) initialPluginsState = data.customization.plugins; |
| 15236 |
else Object.keys(pluginsList).forEach(function(pluginKey) { |
| 15237 |
initialPluginsState[pluginKey] = initialState; |
| 15238 |
}); |
| 15239 |
REQUIRED_PLUGINS.forEach(function(pluginKey) { |
| 15240 |
if (initialPluginsState.hasOwnProperty(pluginKey)) initialPluginsState[pluginKey] = true; |
| 15241 |
}); |
| 15242 |
setPlugins(initialPluginsState); |
| 15243 |
}, [ |
| 15244 |
pluginsList, |
| 15245 |
data === null || data === void 0 || (_data$customization2 = data.customization) === null || _data$customization2 === void 0 ? void 0 : _data$customization2.plugins, |
| 15246 |
initialState |
| 15247 |
]); |
| 15248 |
var isRequiredPlugin = (0, react.useCallback)(function(pluginKey) { |
| 15249 |
return REQUIRED_PLUGINS.includes(pluginKey); |
| 15250 |
}, []); |
| 15251 |
var nonRequiredPlugins = (0, react.useMemo)(function() { |
| 15252 |
return Object.keys(plugins).filter(function(pluginKey) { |
| 15253 |
return !isRequiredPlugin(pluginKey); |
| 15254 |
}); |
| 15255 |
}, [plugins, isRequiredPlugin]); |
| 15256 |
var isAllSelected = (0, react.useMemo)(function() { |
| 15257 |
return nonRequiredPlugins.length > 0 && nonRequiredPlugins.every(function(pluginKey) { |
| 15258 |
return plugins[pluginKey]; |
| 15259 |
}); |
| 15260 |
}, [nonRequiredPlugins, plugins]); |
| 15261 |
var isIndeterminate = (0, react.useMemo)(function() { |
| 15262 |
return nonRequiredPlugins.some(function(pluginKey) { |
| 15263 |
return plugins[pluginKey]; |
| 15264 |
}) && !isAllSelected; |
| 15265 |
}, [ |
| 15266 |
nonRequiredPlugins, |
| 15267 |
plugins, |
| 15268 |
isAllSelected |
| 15269 |
]); |
| 15270 |
var handleToggleChange = (0, react.useCallback)(function(settingKey) { |
| 15271 |
if (isRequiredPlugin(settingKey)) return; |
| 15272 |
setPlugins(function(prev) { |
| 15273 |
return _objectSpread$14(_objectSpread$14({}, prev), {}, _defineProperty$1({}, settingKey, !prev[settingKey])); |
| 15274 |
}); |
| 15275 |
}, [isRequiredPlugin]); |
| 15276 |
var handleSelectAll = (0, react.useCallback)(function() { |
| 15277 |
var allNonRequiredSelected = nonRequiredPlugins.every(function(pluginKey) { |
| 15278 |
return plugins[pluginKey]; |
| 15279 |
}); |
| 15280 |
var newState = _objectSpread$14({}, plugins); |
| 15281 |
nonRequiredPlugins.forEach(function(pluginKey) { |
| 15282 |
newState[pluginKey] = !allNonRequiredSelected; |
| 15283 |
}); |
| 15284 |
REQUIRED_PLUGINS.forEach(function(pluginKey) { |
| 15285 |
if (newState.hasOwnProperty(pluginKey)) newState[pluginKey] = true; |
| 15286 |
}); |
| 15287 |
setPlugins(newState); |
| 15288 |
}, [plugins, nonRequiredPlugins]); |
| 15289 |
var getPluginsSelection = (0, react.useCallback)(function() { |
| 15290 |
var selectedPlugins = {}; |
| 15291 |
Object.entries(plugins).forEach(function(_ref3) { |
| 15292 |
var _ref4 = _slicedToArray(_ref3, 2); |
| 15293 |
var pluginKey = _ref4[0]; |
| 15294 |
selectedPlugins[pluginKey] = _ref4[1]; |
| 15295 |
}); |
| 15296 |
return selectedPlugins; |
| 15297 |
}, [plugins]); |
| 15298 |
(0, react.useEffect)(function() { |
| 15299 |
if (open) AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitExportCustomizationEdit); |
| 15300 |
}, [open]); |
| 15301 |
var SettingSection = function SettingSection(_ref5) { |
| 15302 |
var title = _ref5.title; |
| 15303 |
var description = _ref5.description; |
| 15304 |
var children = _ref5.children; |
| 15305 |
var settingKey = _ref5.settingKey; |
| 15306 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 15307 |
key: settingKey, |
| 15308 |
sx: { |
| 15309 |
mb: 3, |
| 15310 |
border: 1, |
| 15311 |
borderRadius: 1, |
| 15312 |
borderColor: "action.focus", |
| 15313 |
p: 2.5 |
| 15314 |
} |
| 15315 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 15316 |
display: "flex", |
| 15317 |
justifyContent: "space-between", |
| 15318 |
alignItems: "center" |
| 15319 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "h6" }, title), description && /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15320 |
variant: "body1", |
| 15321 |
color: "text.secondary" |
| 15322 |
}, description))), children && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { mt: 2 } }, children)); |
| 15323 |
}; |
| 15324 |
SettingSection.propTypes = { |
| 15325 |
title: import_prop_types$55.default.string.isRequired, |
| 15326 |
description: import_prop_types$55.default.string, |
| 15327 |
children: import_prop_types$55.default.node, |
| 15328 |
settingKey: import_prop_types$55.default.string |
| 15329 |
}; |
| 15330 |
var SubSetting = function SubSetting(_ref6) { |
| 15331 |
var label = _ref6.label; |
| 15332 |
var settingKey = _ref6.settingKey; |
| 15333 |
var version = _ref6.version; |
| 15334 |
var pluginUri = _ref6.pluginUri; |
| 15335 |
var isRequired = isRequiredPlugin(settingKey); |
| 15336 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { py: 1.5 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { |
| 15337 |
control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { |
| 15338 |
checked: plugins[settingKey], |
| 15339 |
onChange: function onChange() { |
| 15340 |
return handleToggleChange(settingKey); |
| 15341 |
}, |
| 15342 |
color: "info", |
| 15343 |
size: "medium", |
| 15344 |
sx: { py: 0 }, |
| 15345 |
disabled: isRequired |
| 15346 |
}), |
| 15347 |
label: /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15348 |
variant: "body1", |
| 15349 |
sx: { |
| 15350 |
fontWeight: 400, |
| 15351 |
color: isRequired ? "text.disabled" : "inherit" |
| 15352 |
} |
| 15353 |
}, label) |
| 15354 |
}), version && /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15355 |
variant: "body1", |
| 15356 |
color: "text.secondary", |
| 15357 |
sx: { |
| 15358 |
fontWeight: 400, |
| 15359 |
ml: 4 |
| 15360 |
} |
| 15361 |
}, pluginUri ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 15362 |
href: pluginUri, |
| 15363 |
target: "_blank", |
| 15364 |
rel: "noopener noreferrer", |
| 15365 |
color: "info.light", |
| 15366 |
underline: "hover", |
| 15367 |
sx: { |
| 15368 |
display: "inline-flex", |
| 15369 |
alignItems: "center", |
| 15370 |
gap: .5 |
| 15371 |
} |
| 15372 |
}, (0, _wordpress_i18n.__)("Version", "elementor"), " ", version, /*#__PURE__*/ react.default.createElement(_elementor_icons.ExternalLinkIcon, null)) : /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Version", "elementor"), " ", version))); |
| 15373 |
}; |
| 15374 |
SubSetting.propTypes = { |
| 15375 |
label: import_prop_types$55.default.string.isRequired, |
| 15376 |
settingKey: import_prop_types$55.default.string.isRequired, |
| 15377 |
version: import_prop_types$55.default.string, |
| 15378 |
pluginUri: import_prop_types$55.default.string |
| 15379 |
}; |
| 15380 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, { |
| 15381 |
open, |
| 15382 |
onClose: handleClose, |
| 15383 |
maxWidth: "md", |
| 15384 |
fullWidth: true, |
| 15385 |
PaperProps: { sx: { minHeight: "600px" } } |
| 15386 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogHeader, { onClose: handleClose }, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogTitle, null, (0, _wordpress_i18n.__)("Edit plugins", "elementor"))), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, { |
| 15387 |
dividers: true, |
| 15388 |
sx: { p: 3 } |
| 15389 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { gap: 2 }, isOldElementorVersion && /*#__PURE__*/ react.default.createElement(UpgradeVersionBanner, null), isLoading ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 15390 |
spacing: 3, |
| 15391 |
alignItems: "center", |
| 15392 |
sx: { py: 8 } |
| 15393 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { size: 30 })) : /*#__PURE__*/ react.default.createElement(SettingSection, { title: (0, _wordpress_i18n.__)("Plugin name and version", "elementor") }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { py: 1.5 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { |
| 15394 |
control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { |
| 15395 |
checked: isAllSelected, |
| 15396 |
indeterminate: isIndeterminate, |
| 15397 |
onChange: handleSelectAll, |
| 15398 |
color: "info", |
| 15399 |
size: "medium", |
| 15400 |
sx: { py: 0 } |
| 15401 |
}), |
| 15402 |
label: /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15403 |
variant: "body1", |
| 15404 |
sx: { fontWeight: 500 } |
| 15405 |
}, (0, _wordpress_i18n.__)("All plugins", "elementor")) |
| 15406 |
})), Object.entries(pluginsList).map(function(_ref7) { |
| 15407 |
var _ref8 = _slicedToArray(_ref7, 2); |
| 15408 |
var pluginKey = _ref8[0]; |
| 15409 |
var pluginData = _ref8[1]; |
| 15410 |
return /*#__PURE__*/ react.default.createElement(SubSetting, { |
| 15411 |
key: pluginKey, |
| 15412 |
label: pluginData.name, |
| 15413 |
settingKey: pluginKey, |
| 15414 |
version: pluginData.version, |
| 15415 |
pluginUri: pluginData.pluginUri |
| 15416 |
}); |
| 15417 |
}))))), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogActions, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 15418 |
onClick: handleClose, |
| 15419 |
color: "secondary" |
| 15420 |
}, (0, _wordpress_i18n.__)("Cancel", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 15421 |
onClick: function onClick() { |
| 15422 |
var pluginsSelection = getPluginsSelection(); |
| 15423 |
handleSaveChanges("plugins", pluginsSelection, Object.values(pluginsSelection).some(Boolean), transformAnalyticsData$2(pluginsSelection)); |
| 15424 |
handleClose(); |
| 15425 |
}, |
| 15426 |
variant: "contained", |
| 15427 |
color: "primary", |
| 15428 |
disabled: isLoading |
| 15429 |
}, (0, _wordpress_i18n.__)("Save changes", "elementor")))); |
| 15430 |
} |
| 15431 |
KitPluginsCustomizationDialog.propTypes = { |
| 15432 |
open: import_prop_types$55.default.bool.isRequired, |
| 15433 |
handleClose: import_prop_types$55.default.func.isRequired, |
| 15434 |
handleSaveChanges: import_prop_types$55.default.func.isRequired |
| 15435 |
}; |
| 15436 |
|
| 15437 |
//#endregion |
| 15438 |
//#region app/modules/import-export-customization/assets/js/shared/components/kit-customization-dialog.js |
| 15439 |
function KitCustomizationDialog(_ref) { |
| 15440 |
var open = _ref.open; |
| 15441 |
var title = _ref.title; |
| 15442 |
var handleClose = _ref.handleClose; |
| 15443 |
var handleSaveChanges = _ref.handleSaveChanges; |
| 15444 |
var children = _ref.children; |
| 15445 |
var _ref$saveDisabled = _ref.saveDisabled; |
| 15446 |
var saveDisabled = _ref$saveDisabled === void 0 ? false : _ref$saveDisabled; |
| 15447 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, { |
| 15448 |
open, |
| 15449 |
onClose: function handleDialogClose(_event, reason) { |
| 15450 |
if ("escapeKeyDown" === reason) handleClose(); |
| 15451 |
}, |
| 15452 |
maxWidth: "md", |
| 15453 |
fullWidth: true |
| 15454 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogHeader, { onClose: handleClose }, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogTitle, null, title)), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, { |
| 15455 |
dividers: true, |
| 15456 |
sx: { p: 3 } |
| 15457 |
}, children), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogActions, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 15458 |
onClick: handleClose, |
| 15459 |
color: "secondary" |
| 15460 |
}, (0, _wordpress_i18n.__)("Cancel", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 15461 |
disabled: saveDisabled, |
| 15462 |
onClick: handleSaveChanges, |
| 15463 |
variant: "contained", |
| 15464 |
color: "primary" |
| 15465 |
}, (0, _wordpress_i18n.__)("Save changes", "elementor")))); |
| 15466 |
} |
| 15467 |
KitCustomizationDialog.propTypes = { |
| 15468 |
open: import_prop_types$55.default.bool.isRequired, |
| 15469 |
handleClose: import_prop_types$55.default.func.isRequired, |
| 15470 |
handleSaveChanges: import_prop_types$55.default.func.isRequired, |
| 15471 |
children: import_prop_types$55.default.node.isRequired, |
| 15472 |
title: import_prop_types$55.default.string.isRequired, |
| 15473 |
saveDisabled: import_prop_types$55.default.bool |
| 15474 |
}; |
| 15475 |
|
| 15476 |
//#endregion |
| 15477 |
//#region app/modules/import-export-customization/assets/js/shared/components/customization-list-setting-section.js |
| 15478 |
init_toConsumableArray(); |
| 15479 |
init_slicedToArray(); |
| 15480 |
init_utils$4(); |
| 15481 |
var DEFAULT_VISIBLE_ITEMS_COUNT = 16; |
| 15482 |
function ListSettingSection(_ref) { |
| 15483 |
var items = _ref.items; |
| 15484 |
var title = _ref.title; |
| 15485 |
var loading = _ref.loading; |
| 15486 |
var settings = _ref.settings; |
| 15487 |
var onSettingChange = _ref.onSettingChange; |
| 15488 |
var settingKey = _ref.settingKey; |
| 15489 |
var _ref$disabled = _ref.disabled; |
| 15490 |
var disabled = _ref$disabled === void 0 ? false : _ref$disabled; |
| 15491 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 15492 |
var showMore = _useState2[0]; |
| 15493 |
var setShowMore = _useState2[1]; |
| 15494 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 15495 |
key: settingKey, |
| 15496 |
sx: { |
| 15497 |
border: 1, |
| 15498 |
borderRadius: 1, |
| 15499 |
borderColor: "action.focus", |
| 15500 |
p: 2.5 |
| 15501 |
} |
| 15502 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { spacing: 2 }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "h6" }, title), /*#__PURE__*/ react.default.createElement(_elementor_ui.Grid, { |
| 15503 |
container: true, |
| 15504 |
spacing: 1, |
| 15505 |
alignItems: "start" |
| 15506 |
}, loading ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Grid, { |
| 15507 |
item: true, |
| 15508 |
xs: 12, |
| 15509 |
sx: { |
| 15510 |
p: 1, |
| 15511 |
alignItems: "center", |
| 15512 |
textAlign: "center" |
| 15513 |
} |
| 15514 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { size: 30 })) : /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Grid, { |
| 15515 |
key: "all", |
| 15516 |
item: true, |
| 15517 |
xs: 12, |
| 15518 |
sx: { |
| 15519 |
py: 1, |
| 15520 |
px: 0 |
| 15521 |
} |
| 15522 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { |
| 15523 |
control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { |
| 15524 |
color: "info", |
| 15525 |
checked: settings.length === items.length, |
| 15526 |
indeterminate: settings.length > 0 && settings.length !== items.length, |
| 15527 |
onChange: function onChange(e, checked) { |
| 15528 |
if (checked) onSettingChange(items.map(function(_ref2) { |
| 15529 |
return _ref2.value; |
| 15530 |
}), true); |
| 15531 |
else onSettingChange([], true); |
| 15532 |
}, |
| 15533 |
disabled, |
| 15534 |
sx: { p: 0 } |
| 15535 |
}), |
| 15536 |
sx: { gap: 1 }, |
| 15537 |
slotProps: { typography: { sx: { fontWeight: 500 } } }, |
| 15538 |
label: "".concat((0, _wordpress_i18n.__)("All", "elementor-pro"), " ").concat(title.toLowerCase()) |
| 15539 |
})), (showMore ? items : items.slice(0, DEFAULT_VISIBLE_ITEMS_COUNT)).map(function(item) { |
| 15540 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Grid, { |
| 15541 |
key: item.value, |
| 15542 |
item: true, |
| 15543 |
xs: 3, |
| 15544 |
sx: { |
| 15545 |
py: 1, |
| 15546 |
px: 0 |
| 15547 |
} |
| 15548 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { |
| 15549 |
sx: { |
| 15550 |
maxWidth: "100%", |
| 15551 |
gap: 1 |
| 15552 |
}, |
| 15553 |
control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { |
| 15554 |
color: "info", |
| 15555 |
checked: settings.includes(item.value), |
| 15556 |
onChange: function onChange(e, checked) { |
| 15557 |
if (checked) onSettingChange([].concat(_toConsumableArray(settings), [item.value])); |
| 15558 |
else onSettingChange(settings.filter(function(setting) { |
| 15559 |
return setting !== item.value; |
| 15560 |
})); |
| 15561 |
}, |
| 15562 |
sx: { p: 0 }, |
| 15563 |
disabled |
| 15564 |
}), |
| 15565 |
slotProps: { typography: { sx: { |
| 15566 |
maxWidth: "100%", |
| 15567 |
overflow: "hidden", |
| 15568 |
textOverflow: "ellipsis", |
| 15569 |
whiteSpace: "nowrap" |
| 15570 |
} } }, |
| 15571 |
label: htmlDecodeTextContent(item.label) |
| 15572 |
})); |
| 15573 |
})))), items.length > DEFAULT_VISIBLE_ITEMS_COUNT && /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 15574 |
variant: "text", |
| 15575 |
color: "info", |
| 15576 |
onClick: function onClick() { |
| 15577 |
return setShowMore(!showMore); |
| 15578 |
} |
| 15579 |
}, showMore ? (0, _wordpress_i18n.__)("Show less", "elementor") : (0, _wordpress_i18n.__)("Show more", "elementor"))); |
| 15580 |
} |
| 15581 |
ListSettingSection.propTypes = { |
| 15582 |
title: import_prop_types$55.string.isRequired, |
| 15583 |
children: import_prop_types$55.node, |
| 15584 |
loading: import_prop_types$55.bool, |
| 15585 |
disabled: import_prop_types$55.bool, |
| 15586 |
checked: import_prop_types$55.bool, |
| 15587 |
settingKey: import_prop_types$55.string, |
| 15588 |
onSettingChange: import_prop_types$55.func.isRequired, |
| 15589 |
items: import_prop_types$55.arrayOf(import_prop_types$55.shape({ |
| 15590 |
label: import_prop_types$55.string.isRequired, |
| 15591 |
value: import_prop_types$55.oneOfType([import_prop_types$55.string, import_prop_types$55.number]) |
| 15592 |
})), |
| 15593 |
settings: import_prop_types$55.arrayOf(import_prop_types$55.oneOfType([import_prop_types$55.string, import_prop_types$55.number])) |
| 15594 |
}; |
| 15595 |
|
| 15596 |
//#endregion |
| 15597 |
//#region app/modules/import-export-customization/assets/js/shared/components/customization-setting-section.js |
| 15598 |
var SettingSection = function SettingSection(_ref) { |
| 15599 |
var _ref$checked = _ref.checked; |
| 15600 |
var checked = _ref$checked === void 0 ? false : _ref$checked; |
| 15601 |
var title = _ref.title; |
| 15602 |
var description = _ref.description; |
| 15603 |
var children = _ref.children; |
| 15604 |
var settingKey = _ref.settingKey; |
| 15605 |
var onSettingChange = _ref.onSettingChange; |
| 15606 |
var _ref$hasToggle = _ref.hasToggle; |
| 15607 |
var hasToggle = _ref$hasToggle === void 0 ? true : _ref$hasToggle; |
| 15608 |
var _ref$disabled = _ref.disabled; |
| 15609 |
var disabled = _ref$disabled === void 0 ? false : _ref$disabled; |
| 15610 |
var _ref$notExported = _ref.notExported; |
| 15611 |
var notExported = _ref$notExported === void 0 ? false : _ref$notExported; |
| 15612 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 15613 |
key: settingKey, |
| 15614 |
sx: { |
| 15615 |
mb: 3, |
| 15616 |
border: 1, |
| 15617 |
borderRadius: 1, |
| 15618 |
borderColor: "action.focus", |
| 15619 |
p: 2.5 |
| 15620 |
} |
| 15621 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 15622 |
display: "flex", |
| 15623 |
justifyContent: "space-between", |
| 15624 |
alignItems: "center" |
| 15625 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { spacing: 1 }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "h6" }, title), description && /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15626 |
"data-testid": "".concat(settingKey, "-description"), |
| 15627 |
variant: "body1", |
| 15628 |
color: "text.secondary" |
| 15629 |
}, description)), function getToggle() { |
| 15630 |
if (notExported) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15631 |
"data-testid": "".concat(settingKey, "-description"), |
| 15632 |
variant: "body1", |
| 15633 |
color: "text.secondary" |
| 15634 |
}, (0, _wordpress_i18n.__)("Not exported", "elementor")); |
| 15635 |
if (!hasToggle) return null; |
| 15636 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Switch, { |
| 15637 |
"data-testid": "".concat(settingKey, "-switch"), |
| 15638 |
checked, |
| 15639 |
onChange: function onChange(e, isChecked) { |
| 15640 |
return onSettingChange && onSettingChange(settingKey, isChecked); |
| 15641 |
}, |
| 15642 |
color: "info", |
| 15643 |
size: "medium", |
| 15644 |
sx: { alignSelf: "center" }, |
| 15645 |
disabled |
| 15646 |
}); |
| 15647 |
}()), children && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { mt: 1 } }, children)); |
| 15648 |
}; |
| 15649 |
SettingSection.propTypes = { |
| 15650 |
title: import_prop_types$55.string.isRequired, |
| 15651 |
description: import_prop_types$55.string, |
| 15652 |
children: import_prop_types$55.node, |
| 15653 |
hasToggle: import_prop_types$55.bool, |
| 15654 |
checked: import_prop_types$55.bool, |
| 15655 |
disabled: import_prop_types$55.bool, |
| 15656 |
settingKey: import_prop_types$55.string, |
| 15657 |
onSettingChange: import_prop_types$55.func, |
| 15658 |
notExported: import_prop_types$55.bool |
| 15659 |
}; |
| 15660 |
|
| 15661 |
//#endregion |
| 15662 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-custom-post-types.js |
| 15663 |
init_slicedToArray(); |
| 15664 |
function useCustomPostTypes() { |
| 15665 |
var _ref$include = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}).include; |
| 15666 |
var include = _ref$include === void 0 ? [] : _ref$include; |
| 15667 |
var _useState2 = _slicedToArray((0, react.useState)([]), 2); |
| 15668 |
var customPostTypes = _useState2[0]; |
| 15669 |
var setCustomPostTypes = _useState2[1]; |
| 15670 |
(0, react.useEffect)(function() { |
| 15671 |
var _elementorAppConfig$i; |
| 15672 |
var cpt = Object.assign({}, ((_elementorAppConfig$i = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i === void 0 || (_elementorAppConfig$i = _elementorAppConfig$i.summaryTitles) === null || _elementorAppConfig$i === void 0 || (_elementorAppConfig$i = _elementorAppConfig$i.content) === null || _elementorAppConfig$i === void 0 ? void 0 : _elementorAppConfig$i.customPostTypes) || {}); |
| 15673 |
if (include.length) { |
| 15674 |
var _elementorAppConfig$i2; |
| 15675 |
Object.entries(((_elementorAppConfig$i2 = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i2 === void 0 || (_elementorAppConfig$i2 = _elementorAppConfig$i2.summaryTitles) === null || _elementorAppConfig$i2 === void 0 ? void 0 : _elementorAppConfig$i2.content) || {}).forEach(function(_ref2) { |
| 15676 |
var _ref3 = _slicedToArray(_ref2, 2); |
| 15677 |
var postType = _ref3[0]; |
| 15678 |
var post = _ref3[1]; |
| 15679 |
if (include.includes(postType)) cpt[postType] = post; |
| 15680 |
}); |
| 15681 |
} |
| 15682 |
if (Object.keys(cpt).length) setCustomPostTypes(Object.entries(cpt).map(function(_ref4) { |
| 15683 |
var _ref5 = _slicedToArray(_ref4, 2); |
| 15684 |
return { |
| 15685 |
value: _ref5[0], |
| 15686 |
label: _ref5[1].single |
| 15687 |
}; |
| 15688 |
})); |
| 15689 |
}, []); |
| 15690 |
return { customPostTypes }; |
| 15691 |
} |
| 15692 |
|
| 15693 |
//#endregion |
| 15694 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-kit-customization-custom-post-types.js |
| 15695 |
init_typeof$1(); |
| 15696 |
function useKitCustomizationCustomPostTypes(_ref) { |
| 15697 |
var data = _ref.data; |
| 15698 |
var isImport = data === null || data === void 0 ? void 0 : data.hasOwnProperty("uploadedData"); |
| 15699 |
var builtInCustomPostTypes = useCustomPostTypes({ include: ["post"] }).customPostTypes; |
| 15700 |
return { customPostTypes: (0, react.useMemo)(function() { |
| 15701 |
var _data$uploadedData; |
| 15702 |
var _data$uploadedData2; |
| 15703 |
var _data$uploadedData3; |
| 15704 |
if (!isImport) return builtInCustomPostTypes; |
| 15705 |
var customPostTypesTitles = Object.values((data === null || data === void 0 || (_data$uploadedData = data.uploadedData) === null || _data$uploadedData === void 0 || (_data$uploadedData = _data$uploadedData.manifest) === null || _data$uploadedData === void 0 ? void 0 : _data$uploadedData["custom-post-type-title"]) || {}).map(function(postType) { |
| 15706 |
return { |
| 15707 |
value: postType.name, |
| 15708 |
label: postType.label |
| 15709 |
}; |
| 15710 |
}); |
| 15711 |
if (!customPostTypesTitles.some(function(postType) { |
| 15712 |
return "post" === postType.value; |
| 15713 |
})) customPostTypesTitles.push({ |
| 15714 |
value: "post", |
| 15715 |
label: "Post" |
| 15716 |
}); |
| 15717 |
var wpContent = (data === null || data === void 0 || (_data$uploadedData2 = data.uploadedData) === null || _data$uploadedData2 === void 0 || (_data$uploadedData2 = _data$uploadedData2.manifest) === null || _data$uploadedData2 === void 0 ? void 0 : _data$uploadedData2["wp-content"]) || {}; |
| 15718 |
var content = (data === null || data === void 0 || (_data$uploadedData3 = data.uploadedData) === null || _data$uploadedData3 === void 0 || (_data$uploadedData3 = _data$uploadedData3.manifest) === null || _data$uploadedData3 === void 0 ? void 0 : _data$uploadedData3.content) || {}; |
| 15719 |
return customPostTypesTitles.filter(function(postType) { |
| 15720 |
var postTypeValue = postType.value; |
| 15721 |
var wpContentObject = wpContent[postTypeValue]; |
| 15722 |
var isInWpContent = wpContentObject && "object" === _typeof$1(wpContentObject) && Object.keys(wpContentObject).length > 0; |
| 15723 |
var contentObject = content[postTypeValue]; |
| 15724 |
var isInElementorContent = contentObject && "object" === _typeof$1(contentObject) && Object.keys(contentObject).length > 0; |
| 15725 |
return isInWpContent || isInElementorContent; |
| 15726 |
}); |
| 15727 |
}, [ |
| 15728 |
isImport, |
| 15729 |
data === null || data === void 0 ? void 0 : data.uploadedData, |
| 15730 |
builtInCustomPostTypes |
| 15731 |
]) }; |
| 15732 |
} |
| 15733 |
|
| 15734 |
//#endregion |
| 15735 |
//#region app/modules/import-export-customization/assets/js/shared/components/kit-content-customization-dialog.js |
| 15736 |
init_defineProperty$1(); |
| 15737 |
init_slicedToArray(); |
| 15738 |
init_apps_event_tracking(); |
| 15739 |
function ownKeys$14(e, r) { |
| 15740 |
var t = Object.keys(e); |
| 15741 |
if (Object.getOwnPropertySymbols) { |
| 15742 |
var o = Object.getOwnPropertySymbols(e); |
| 15743 |
r && (o = o.filter(function(r) { |
| 15744 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 15745 |
})), t.push.apply(t, o); |
| 15746 |
} |
| 15747 |
return t; |
| 15748 |
} |
| 15749 |
__name(ownKeys$14, "ownKeys"); |
| 15750 |
function _objectSpread$13(e) { |
| 15751 |
for (var r = 1; r < arguments.length; r++) { |
| 15752 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 15753 |
r % 2 ? ownKeys$14(Object(t), !0).forEach(function(r) { |
| 15754 |
_defineProperty$1(e, r, t[r]); |
| 15755 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$14(Object(t)).forEach(function(r) { |
| 15756 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 15757 |
}); |
| 15758 |
} |
| 15759 |
return e; |
| 15760 |
} |
| 15761 |
__name(_objectSpread$13, "_objectSpread"); |
| 15762 |
var transformAnalyticsData$1 = function transformAnalyticsData(payload, customPostTypes) { |
| 15763 |
var optionsArray = [{ |
| 15764 |
key: "customPostTypes", |
| 15765 |
options: customPostTypes |
| 15766 |
}]; |
| 15767 |
var transformed = {}; |
| 15768 |
for (var _i = 0, _Object$entries = Object.entries(payload); _i < _Object$entries.length; _i++) { |
| 15769 |
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2); |
| 15770 |
var key = _Object$entries$_i[0]; |
| 15771 |
var value = _Object$entries$_i[1]; |
| 15772 |
transformed[key] = transformValueForAnalytics(key, value, optionsArray); |
| 15773 |
} |
| 15774 |
return transformed; |
| 15775 |
}; |
| 15776 |
var MEDIA_FORMAT_OPTIONS = { |
| 15777 |
LINK: "link", |
| 15778 |
CLOUD: "cloud" |
| 15779 |
}; |
| 15780 |
var MEDIA_FORMAT_CONFIG = [{ |
| 15781 |
value: MEDIA_FORMAT_OPTIONS.LINK, |
| 15782 |
title: (0, _wordpress_i18n.__)("Link to media", "elementor"), |
| 15783 |
description: (0, _wordpress_i18n.__)("Stores only the URLs. The export stays light, but files load only while the original site is online.", "elementor") |
| 15784 |
}, { |
| 15785 |
value: MEDIA_FORMAT_OPTIONS.CLOUD, |
| 15786 |
title: (0, _wordpress_i18n.__)("Save media to the cloud", "elementor"), |
| 15787 |
description: (0, _wordpress_i18n.__)("All images and files are stored with the template. Keeps everything intact, but the file is larger.", "elementor") |
| 15788 |
}]; |
| 15789 |
function KitContentCustomizationDialog(_ref) { |
| 15790 |
var _useContextDetection; |
| 15791 |
var _data$customization$c2; |
| 15792 |
var open = _ref.open; |
| 15793 |
var handleClose = _ref.handleClose; |
| 15794 |
var _handleSaveChanges = _ref.handleSaveChanges; |
| 15795 |
var _ref$isCloudKitsEligi = _ref.isCloudKitsEligible; |
| 15796 |
var isCloudKitsEligible = _ref$isCloudKitsEligi === void 0 ? false : _ref$isCloudKitsEligi; |
| 15797 |
var _ref$showMediaFormatV = _ref.showMediaFormatValidation; |
| 15798 |
var showMediaFormatValidation = _ref$showMediaFormatV === void 0 ? false : _ref$showMediaFormatV; |
| 15799 |
var _ref2 = (_useContextDetection = useContextDetection()) !== null && _useContextDetection !== void 0 ? _useContextDetection : {}; |
| 15800 |
var _ref2$isImport = _ref2.isImport; |
| 15801 |
var isImport = _ref2$isImport === void 0 ? false : _ref2$isImport; |
| 15802 |
var _ref2$contextData = _ref2.contextData; |
| 15803 |
var contextData = _ref2$contextData === void 0 ? {} : _ref2$contextData; |
| 15804 |
var _contextData$data = contextData.data; |
| 15805 |
var data = _contextData$data === void 0 ? null : _contextData$data; |
| 15806 |
var _contextData$isOldEle = contextData.isOldElementorVersion; |
| 15807 |
var isOldElementorVersion = _contextData$isOldEle === void 0 ? false : _contextData$isOldEle; |
| 15808 |
var customPostTypes = useKitCustomizationCustomPostTypes({ data }).customPostTypes; |
| 15809 |
var alertRef = (0, react.useRef)(null); |
| 15810 |
var mediaFormatSectionRef = (0, react.useRef)(null); |
| 15811 |
var _useState2 = _slicedToArray((0, react.useState)(function() { |
| 15812 |
if (data.customization.content) return data.customization.content; |
| 15813 |
return { |
| 15814 |
customPostTypes: [], |
| 15815 |
mediaFormat: MEDIA_FORMAT_OPTIONS.LINK |
| 15816 |
}; |
| 15817 |
}), 2); |
| 15818 |
var settings = _useState2[0]; |
| 15819 |
var setSettings = _useState2[1]; |
| 15820 |
(0, react.useEffect)(function() { |
| 15821 |
if (customPostTypes) setSettings(function(prevSettings) { |
| 15822 |
var _data$customization$c; |
| 15823 |
return _objectSpread$13(_objectSpread$13({}, prevSettings), {}, { customPostTypes: ((_data$customization$c = data.customization.content) === null || _data$customization$c === void 0 ? void 0 : _data$customization$c.customPostTypes) || customPostTypes.map(function(_ref3) { |
| 15824 |
return _ref3.value; |
| 15825 |
}) }); |
| 15826 |
}); |
| 15827 |
}, [customPostTypes, (_data$customization$c2 = data.customization.content) === null || _data$customization$c2 === void 0 ? void 0 : _data$customization$c2.customPostTypes]); |
| 15828 |
(0, react.useEffect)(function() { |
| 15829 |
if (open) setSettings(function(prevState) { |
| 15830 |
if (!data.includes.includes("content")) return { |
| 15831 |
customPostTypes: [], |
| 15832 |
mediaFormat: MEDIA_FORMAT_OPTIONS.LINK |
| 15833 |
}; |
| 15834 |
return prevState; |
| 15835 |
}); |
| 15836 |
}, [ |
| 15837 |
open, |
| 15838 |
data, |
| 15839 |
setSettings |
| 15840 |
]); |
| 15841 |
(0, react.useEffect)(function() { |
| 15842 |
if (open) AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitExportCustomizationEdit); |
| 15843 |
}, [open]); |
| 15844 |
(0, react.useEffect)(function() { |
| 15845 |
if (showMediaFormatValidation) setTimeout(function() { |
| 15846 |
var targetElement = alertRef.current || mediaFormatSectionRef.current; |
| 15847 |
if (targetElement) targetElement.scrollIntoView({ |
| 15848 |
behavior: "smooth", |
| 15849 |
block: "center" |
| 15850 |
}); |
| 15851 |
}); |
| 15852 |
}, [showMediaFormatValidation]); |
| 15853 |
var handleSettingsChange = function handleSettingsChange(settingKey, payload) { |
| 15854 |
setSettings(function(prev) { |
| 15855 |
return _objectSpread$13(_objectSpread$13({}, prev), {}, _defineProperty$1({}, settingKey, payload)); |
| 15856 |
}); |
| 15857 |
}; |
| 15858 |
return /*#__PURE__*/ react.default.createElement(KitCustomizationDialog, { |
| 15859 |
open, |
| 15860 |
title: (0, _wordpress_i18n.__)("Edit content", "elementor"), |
| 15861 |
handleClose, |
| 15862 |
handleSaveChanges: function handleSaveChanges() { |
| 15863 |
_handleSaveChanges("content", settings, true, transformAnalyticsData$1(settings, customPostTypes)); |
| 15864 |
handleClose(); |
| 15865 |
} |
| 15866 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { gap: 2 }, isOldElementorVersion && /*#__PURE__*/ react.default.createElement(UpgradeVersionBanner, null), isImport && !(customPostTypes !== null && customPostTypes !== void 0 && customPostTypes.length) ? /*#__PURE__*/ react.default.createElement(SettingSection, { |
| 15867 |
title: (0, _wordpress_i18n.__)("Custom post types", "elementor"), |
| 15868 |
settingKey: "customPostTypes", |
| 15869 |
notExported: true |
| 15870 |
}) : /*#__PURE__*/ react.default.createElement(ListSettingSection, { |
| 15871 |
settingKey: "customPostTypes", |
| 15872 |
title: (0, _wordpress_i18n.__)("Custom post types", "elementor"), |
| 15873 |
onSettingChange: function onSettingChange(selectedCustomPostTypes) { |
| 15874 |
handleSettingsChange("customPostTypes", selectedCustomPostTypes); |
| 15875 |
}, |
| 15876 |
settings: settings.customPostTypes, |
| 15877 |
items: customPostTypes |
| 15878 |
}), function renderMediaFormatSection() { |
| 15879 |
if (isImport) return /*#__PURE__*/ react.default.createElement(SettingSection, { |
| 15880 |
title: (0, _wordpress_i18n.__)("Media format", "elementor"), |
| 15881 |
settingKey: "mediaFormat", |
| 15882 |
hasToggle: false |
| 15883 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Alert, { |
| 15884 |
icon: /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, { |
| 15885 |
color: "info", |
| 15886 |
viewBox: "0 0 24 24" |
| 15887 |
}, /*#__PURE__*/ react.default.createElement("path", { |
| 15888 |
d: "M11.8623 14.7549C12.3665 14.8061 12.7598 15.2322 12.7598 15.75C12.7598 16.2678 12.3665 16.6939 11.8623 16.7451L11.7598 16.75H11.75C11.1977 16.75 10.75 16.3023 10.75 15.75C10.75 15.1977 11.1977 14.75 11.75 14.75H11.7598L11.8623 14.7549Z", |
| 15889 |
fill: "currentColor" |
| 15890 |
}), /*#__PURE__*/ react.default.createElement("path", { |
| 15891 |
d: "M11.75 7C12.1642 7 12.5 7.33579 12.5 7.75V12.75C12.5 13.1642 12.1642 13.5 11.75 13.5C11.3358 13.5 11 13.1642 11 12.75V7.75C11 7.33579 11.3358 7 11.75 7Z", |
| 15892 |
fill: "currentColor" |
| 15893 |
}), /*#__PURE__*/ react.default.createElement("path", { |
| 15894 |
fillRule: "evenodd", |
| 15895 |
clipRule: "evenodd", |
| 15896 |
d: "M11.75 2C17.1348 2 21.5 6.36522 21.5 11.75C21.5 17.1348 17.1348 21.5 11.75 21.5C6.36522 21.5 2 17.1348 2 11.75C2 6.36522 6.36522 2 11.75 2ZM11.75 3.5C7.19365 3.5 3.5 7.19365 3.5 11.75C3.5 16.3063 7.19365 20 11.75 20C16.3063 20 20 16.3063 20 11.75C20 7.19365 16.3063 3.5 11.75 3.5Z", |
| 15897 |
fill: "currentColor" |
| 15898 |
})), |
| 15899 |
sx: { |
| 15900 |
backgroundColor: "transparent", |
| 15901 |
p: 0 |
| 15902 |
} |
| 15903 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15904 |
variant: "body2", |
| 15905 |
color: "text.primary" |
| 15906 |
}, /*#__PURE__*/ react.default.createElement("strong", null, (0, _wordpress_i18n.__)("Note:", "elementor")), " ", (0, _wordpress_i18n.__)("The media will be uploaded automatically, just as it was saved during export", "elementor")))); |
| 15907 |
if (!isImport && !isCloudKitsEligible) return null; |
| 15908 |
return /*#__PURE__*/ react.default.createElement(SettingSection, { |
| 15909 |
ref: mediaFormatSectionRef, |
| 15910 |
description: (0, _wordpress_i18n.__)("Select how do you want to save & export the media files.", "elementor"), |
| 15911 |
title: (0, _wordpress_i18n.__)("Media format", "elementor"), |
| 15912 |
settingKey: "mediaFormat", |
| 15913 |
hasToggle: false |
| 15914 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { pt: 2.5 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControl, { |
| 15915 |
component: "fieldset", |
| 15916 |
sx: { width: "100%" } |
| 15917 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.RadioGroup, { |
| 15918 |
value: settings.mediaFormat, |
| 15919 |
onChange: function onChange(event) { |
| 15920 |
handleSettingsChange("mediaFormat", event.target.value); |
| 15921 |
}, |
| 15922 |
sx: { width: "100%" } |
| 15923 |
}, MEDIA_FORMAT_CONFIG.map(function(option, index) { |
| 15924 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 15925 |
key: option.value, |
| 15926 |
sx: { |
| 15927 |
border: 1, |
| 15928 |
borderColor: settings.mediaFormat === option.value ? "info.light" : "divider", |
| 15929 |
borderRadius: 2, |
| 15930 |
p: 1, |
| 15931 |
mb: index < MEDIA_FORMAT_CONFIG.length - 1 ? 1.5 : 0, |
| 15932 |
width: "100%" |
| 15933 |
} |
| 15934 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { |
| 15935 |
value: option.value, |
| 15936 |
control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Radio, { |
| 15937 |
color: "info", |
| 15938 |
"data-testid": "media-format-".concat(option.value) |
| 15939 |
}), |
| 15940 |
label: /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15941 |
variant: "body2", |
| 15942 |
sx: { mb: .25 } |
| 15943 |
}, option.title), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15944 |
variant: "body2", |
| 15945 |
color: "text.secondary" |
| 15946 |
}, option.description)), |
| 15947 |
sx: { |
| 15948 |
alignItems: "flex-start", |
| 15949 |
m: 0, |
| 15950 |
width: "100%" |
| 15951 |
} |
| 15952 |
})); |
| 15953 |
}))), showMediaFormatValidation && /*#__PURE__*/ react.default.createElement(_elementor_ui.Alert, { |
| 15954 |
ref: alertRef, |
| 15955 |
icon: /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, { |
| 15956 |
color: "error", |
| 15957 |
viewBox: "0 0 24 24" |
| 15958 |
}, /*#__PURE__*/ react.default.createElement("path", { |
| 15959 |
d: "M11.8623 14.7549C12.3665 14.8061 12.7598 15.2322 12.7598 15.75C12.7598 16.2678 12.3665 16.6939 11.8623 16.7451L11.7598 16.75H11.75C11.1977 16.75 10.75 16.3023 10.75 15.75C10.75 15.1977 11.1977 14.75 11.75 14.75H11.7598L11.8623 14.7549Z", |
| 15960 |
fill: "currentColor" |
| 15961 |
}), /*#__PURE__*/ react.default.createElement("path", { |
| 15962 |
d: "M11.75 7C12.1642 7 12.5 7.33579 12.5 7.75V12.75C12.5 13.1642 12.1642 13.5 11.75 13.5C11.3358 13.5 11 13.1642 11 12.75V7.75C11 7.33579 11.3358 7 11.75 7Z", |
| 15963 |
fill: "currentColor" |
| 15964 |
}), /*#__PURE__*/ react.default.createElement("path", { |
| 15965 |
fillRule: "evenodd", |
| 15966 |
clipRule: "evenodd", |
| 15967 |
d: "M11.75 2C17.1348 2 21.5 6.36522 21.5 11.75C21.5 17.1348 17.1348 21.5 11.75 21.5C6.36522 21.5 2 17.1348 2 11.75C2 6.36522 6.36522 2 11.75 2ZM11.75 3.5C7.19365 3.5 3.5 7.19365 3.5 11.75C3.5 16.3063 7.19365 20 11.75 20C16.3063 20 20 16.3063 20 11.75C20 7.19365 16.3063 3.5 11.75 3.5Z", |
| 15968 |
fill: "currentColor" |
| 15969 |
})), |
| 15970 |
sx: { |
| 15971 |
mt: 2, |
| 15972 |
ml: 1, |
| 15973 |
backgroundColor: "transparent", |
| 15974 |
p: 0 |
| 15975 |
} |
| 15976 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 15977 |
variant: "body2", |
| 15978 |
color: "text.primary" |
| 15979 |
}, /*#__PURE__*/ react.default.createElement("strong", null, (0, _wordpress_i18n.__)("Note:", "elementor")), " ", (0, _wordpress_i18n.__)("To export a ZIP, go to Edit Content, choose 'Link to Media', then Export as ZIP.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), (0, _wordpress_i18n.__)("Or, save this template to the cloud instead.", "elementor"))))); |
| 15980 |
}())); |
| 15981 |
} |
| 15982 |
KitContentCustomizationDialog.propTypes = { |
| 15983 |
open: import_prop_types$55.default.bool.isRequired, |
| 15984 |
handleClose: import_prop_types$55.default.func.isRequired, |
| 15985 |
handleSaveChanges: import_prop_types$55.default.func.isRequired, |
| 15986 |
isCloudKitsEligible: import_prop_types$55.default.bool, |
| 15987 |
showMediaFormatValidation: import_prop_types$55.default.bool |
| 15988 |
}; |
| 15989 |
|
| 15990 |
//#endregion |
| 15991 |
//#region app/modules/import-export-customization/assets/js/shared/components/classes-variables-section.js |
| 15992 |
init_slicedToArray(); |
| 15993 |
var SubSettingRow = function SubSettingRow(_ref) { |
| 15994 |
var label = _ref.label; |
| 15995 |
var checked = _ref.checked; |
| 15996 |
var _onChange = _ref.onChange; |
| 15997 |
var _ref$disabled = _ref.disabled; |
| 15998 |
var disabled = _ref$disabled === void 0 ? false : _ref$disabled; |
| 15999 |
var _ref$limitExceeded = _ref.limitExceeded; |
| 16000 |
var limitExceeded = _ref$limitExceeded === void 0 ? false : _ref$limitExceeded; |
| 16001 |
var _ref$overLimitCount = _ref.overLimitCount; |
| 16002 |
var overLimitCount = _ref$overLimitCount === void 0 ? 0 : _ref$overLimitCount; |
| 16003 |
var onReviewClick = _ref.onReviewClick; |
| 16004 |
var _ref$overrideAll = _ref.overrideAll; |
| 16005 |
var overrideAll = _ref$overrideAll === void 0 ? false : _ref$overrideAll; |
| 16006 |
var onOverrideAllChange = _ref.onOverrideAllChange; |
| 16007 |
var _ref$showOverrideOpti = _ref.showOverrideOption; |
| 16008 |
var showOverrideOption = _ref$showOverrideOpti === void 0 ? false : _ref$showOverrideOpti; |
| 16009 |
var _ref$notExported = _ref.notExported; |
| 16010 |
if (_ref$notExported === void 0 ? false : _ref$notExported) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 16011 |
display: "flex", |
| 16012 |
justifyContent: "space-between", |
| 16013 |
alignItems: "center", |
| 16014 |
px: 1.25 |
| 16015 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 16016 |
variant: "body1", |
| 16017 |
color: "text.primary" |
| 16018 |
}, label), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 16019 |
variant: "body1", |
| 16020 |
color: "text.secondary" |
| 16021 |
}, (0, _wordpress_i18n.__)("Not exported", "elementor"))); |
| 16022 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 16023 |
display: "flex", |
| 16024 |
justifyContent: "space-between", |
| 16025 |
alignItems: "center", |
| 16026 |
px: 1.25 |
| 16027 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 16028 |
direction: "row", |
| 16029 |
alignItems: "center", |
| 16030 |
spacing: 1, |
| 16031 |
sx: { flex: 1 } |
| 16032 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 16033 |
variant: "body1", |
| 16034 |
color: "text.primary" |
| 16035 |
}, label), limitExceeded && overLimitCount > 0 && /*#__PURE__*/ react.default.createElement(_elementor_ui.Chip, { |
| 16036 |
label: "".concat(overLimitCount, " ").concat((0, _wordpress_i18n.__)("over limit", "elementor")), |
| 16037 |
size: "tiny", |
| 16038 |
sx: { |
| 16039 |
height: 20, |
| 16040 |
borderColor: "warning.main", |
| 16041 |
color: "warning.main", |
| 16042 |
backgroundColor: "transparent", |
| 16043 |
"& .MuiChip-label": { |
| 16044 |
px: .75, |
| 16045 |
fontSize: 12 |
| 16046 |
} |
| 16047 |
}, |
| 16048 |
variant: "outlined" |
| 16049 |
}), limitExceeded && onReviewClick && /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 16050 |
component: "button", |
| 16051 |
variant: "body2", |
| 16052 |
color: "info.main", |
| 16053 |
onClick: onReviewClick, |
| 16054 |
sx: { |
| 16055 |
display: "flex", |
| 16056 |
alignItems: "center", |
| 16057 |
gap: .5, |
| 16058 |
textDecoration: "none", |
| 16059 |
"&:hover": { textDecoration: "underline" } |
| 16060 |
} |
| 16061 |
}, (0, _wordpress_i18n.__)("Review", "elementor"), /*#__PURE__*/ react.default.createElement(_elementor_icons.ExternalLinkIcon, { sx: { fontSize: 16 } }))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 16062 |
direction: "row", |
| 16063 |
alignItems: "center", |
| 16064 |
spacing: 1 |
| 16065 |
}, showOverrideOption && limitExceeded && /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 16066 |
direction: "row", |
| 16067 |
alignItems: "center", |
| 16068 |
spacing: .5 |
| 16069 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { |
| 16070 |
control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { |
| 16071 |
checked: overrideAll, |
| 16072 |
onChange: function onChange(e) { |
| 16073 |
return onOverrideAllChange === null || onOverrideAllChange === void 0 ? void 0 : onOverrideAllChange(e.target.checked); |
| 16074 |
}, |
| 16075 |
color: "info", |
| 16076 |
size: "small", |
| 16077 |
sx: { p: 0 } |
| 16078 |
}), |
| 16079 |
label: (0, _wordpress_i18n.__)("Override all", "elementor"), |
| 16080 |
sx: { |
| 16081 |
gap: 1, |
| 16082 |
mr: 0, |
| 16083 |
"& .MuiFormControlLabel-label": { fontSize: 14 } |
| 16084 |
} |
| 16085 |
}), /*#__PURE__*/ react.default.createElement(_elementor_ui.Tooltip, { |
| 16086 |
title: (0, _wordpress_i18n.__)("This will delete all existing items and replace them with the imported ones", "elementor"), |
| 16087 |
placement: "top", |
| 16088 |
arrow: true |
| 16089 |
}, /*#__PURE__*/ react.default.createElement(_elementor_icons.AlertTriangleFilledIcon, { sx: { |
| 16090 |
fontSize: 16, |
| 16091 |
color: "warning.main", |
| 16092 |
cursor: "pointer" |
| 16093 |
} }))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Switch, { |
| 16094 |
checked, |
| 16095 |
onChange: function onChange(e, isChecked) { |
| 16096 |
return _onChange === null || _onChange === void 0 ? void 0 : _onChange(isChecked); |
| 16097 |
}, |
| 16098 |
color: "info", |
| 16099 |
size: "medium", |
| 16100 |
disabled: disabled || limitExceeded && !overrideAll |
| 16101 |
}))); |
| 16102 |
}; |
| 16103 |
SubSettingRow.propTypes = { |
| 16104 |
label: import_prop_types$55.default.string.isRequired, |
| 16105 |
checked: import_prop_types$55.default.bool, |
| 16106 |
onChange: import_prop_types$55.default.func, |
| 16107 |
disabled: import_prop_types$55.default.bool, |
| 16108 |
limitExceeded: import_prop_types$55.default.bool, |
| 16109 |
overLimitCount: import_prop_types$55.default.number, |
| 16110 |
onReviewClick: import_prop_types$55.default.func, |
| 16111 |
overrideAll: import_prop_types$55.default.bool, |
| 16112 |
onOverrideAllChange: import_prop_types$55.default.func, |
| 16113 |
showOverrideOption: import_prop_types$55.default.bool, |
| 16114 |
notExported: import_prop_types$55.default.bool |
| 16115 |
}; |
| 16116 |
function ClassesVariablesSection(_ref2) { |
| 16117 |
var _settings$classesOver; |
| 16118 |
var _settings$variablesOv; |
| 16119 |
var _settings$classes; |
| 16120 |
var _settings$variables; |
| 16121 |
var settings = _ref2.settings; |
| 16122 |
var onSettingChange = _ref2.onSettingChange; |
| 16123 |
var _ref2$isImport = _ref2.isImport; |
| 16124 |
var isImport = _ref2$isImport === void 0 ? false : _ref2$isImport; |
| 16125 |
var _ref2$classesExported = _ref2.classesExported; |
| 16126 |
var classesExported = _ref2$classesExported === void 0 ? true : _ref2$classesExported; |
| 16127 |
var _ref2$variablesExport = _ref2.variablesExported; |
| 16128 |
var variablesExported = _ref2$variablesExport === void 0 ? true : _ref2$variablesExport; |
| 16129 |
var _ref2$classesLimitExc = _ref2.classesLimitExceeded; |
| 16130 |
var classesLimitExceeded = _ref2$classesLimitExc === void 0 ? false : _ref2$classesLimitExc; |
| 16131 |
var _ref2$variablesLimitE = _ref2.variablesLimitExceeded; |
| 16132 |
var variablesLimitExceeded = _ref2$variablesLimitE === void 0 ? false : _ref2$variablesLimitE; |
| 16133 |
var _ref2$classesOverLimi = _ref2.classesOverLimitCount; |
| 16134 |
var classesOverLimitCount = _ref2$classesOverLimi === void 0 ? 0 : _ref2$classesOverLimi; |
| 16135 |
var _ref2$variablesOverLi = _ref2.variablesOverLimitCount; |
| 16136 |
var variablesOverLimitCount = _ref2$variablesOverLi === void 0 ? 0 : _ref2$variablesOverLi; |
| 16137 |
var onClassesReviewClick = _ref2.onClassesReviewClick; |
| 16138 |
var onVariablesReviewClick = _ref2.onVariablesReviewClick; |
| 16139 |
var _ref2$disabled = _ref2.disabled; |
| 16140 |
var disabled = _ref2$disabled === void 0 ? false : _ref2$disabled; |
| 16141 |
var _ref2$notExported = _ref2.notExported; |
| 16142 |
var notExported = _ref2$notExported === void 0 ? false : _ref2$notExported; |
| 16143 |
var _useState2 = _slicedToArray((0, react.useState)((_settings$classesOver = settings.classesOverrideAll) !== null && _settings$classesOver !== void 0 ? _settings$classesOver : false), 2); |
| 16144 |
var classesOverrideAll = _useState2[0]; |
| 16145 |
var setClassesOverrideAll = _useState2[1]; |
| 16146 |
var _useState4 = _slicedToArray((0, react.useState)((_settings$variablesOv = settings.variablesOverrideAll) !== null && _settings$variablesOv !== void 0 ? _settings$variablesOv : false), 2); |
| 16147 |
var variablesOverrideAll = _useState4[0]; |
| 16148 |
var setVariablesOverrideAll = _useState4[1]; |
| 16149 |
var hasLimitWarning = isImport && (classesLimitExceeded || variablesLimitExceeded); |
| 16150 |
var classesNotExported = isImport && !classesExported; |
| 16151 |
var variablesNotExported = isImport && !variablesExported; |
| 16152 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 16153 |
mb: 3, |
| 16154 |
border: 1, |
| 16155 |
borderRadius: 1, |
| 16156 |
borderColor: "action.focus", |
| 16157 |
p: 2.5 |
| 16158 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { spacing: 2.5 }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 16159 |
display: "flex", |
| 16160 |
justifyContent: "space-between", |
| 16161 |
alignItems: "center" |
| 16162 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "h6" }, (0, _wordpress_i18n.__)("Classes & variables", "elementor"))), hasLimitWarning && !notExported && /*#__PURE__*/ react.default.createElement(_elementor_ui.Alert, { |
| 16163 |
severity: "warning", |
| 16164 |
icon: /*#__PURE__*/ react.default.createElement(_elementor_icons.AlertTriangleFilledIcon, { sx: { color: "warning.main" } }), |
| 16165 |
sx: { |
| 16166 |
alignItems: "center", |
| 16167 |
backgroundColor: "warning.background", |
| 16168 |
"& .MuiAlert-message": { |
| 16169 |
display: "flex", |
| 16170 |
alignItems: "center", |
| 16171 |
gap: .75 |
| 16172 |
} |
| 16173 |
} |
| 16174 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 16175 |
variant: "body2", |
| 16176 |
component: "span", |
| 16177 |
sx: { fontWeight: 500 }, |
| 16178 |
color: "text.secondary" |
| 16179 |
}, (0, _wordpress_i18n.__)("Import limit reached.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 16180 |
variant: "body2", |
| 16181 |
component: "span", |
| 16182 |
color: "text.secondary" |
| 16183 |
}, (0, _wordpress_i18n.__)("To resolve this, review existing items or choose to override", "elementor"))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { spacing: 1.5 }, /*#__PURE__*/ react.default.createElement(SubSettingRow, { |
| 16184 |
label: (0, _wordpress_i18n.__)("Classes", "elementor"), |
| 16185 |
checked: (_settings$classes = settings.classes) !== null && _settings$classes !== void 0 ? _settings$classes : false, |
| 16186 |
onChange: function onChange(isChecked) { |
| 16187 |
return onSettingChange("classes", isChecked); |
| 16188 |
}, |
| 16189 |
disabled, |
| 16190 |
limitExceeded: isImport && classesLimitExceeded && !classesNotExported, |
| 16191 |
overLimitCount: classesOverLimitCount, |
| 16192 |
onReviewClick: onClassesReviewClick, |
| 16193 |
overrideAll: classesOverrideAll, |
| 16194 |
onOverrideAllChange: function onOverrideAllChange(checked) { |
| 16195 |
setClassesOverrideAll(checked); |
| 16196 |
onSettingChange("classesOverrideAll", checked); |
| 16197 |
}, |
| 16198 |
showOverrideOption: isImport && !classesNotExported, |
| 16199 |
notExported: classesNotExported |
| 16200 |
}), /*#__PURE__*/ react.default.createElement(SubSettingRow, { |
| 16201 |
label: (0, _wordpress_i18n.__)("Variables", "elementor"), |
| 16202 |
checked: (_settings$variables = settings.variables) !== null && _settings$variables !== void 0 ? _settings$variables : false, |
| 16203 |
onChange: function onChange(isChecked) { |
| 16204 |
return onSettingChange("variables", isChecked); |
| 16205 |
}, |
| 16206 |
disabled, |
| 16207 |
limitExceeded: isImport && variablesLimitExceeded && !variablesNotExported, |
| 16208 |
overLimitCount: variablesOverLimitCount, |
| 16209 |
onReviewClick: onVariablesReviewClick, |
| 16210 |
overrideAll: variablesOverrideAll, |
| 16211 |
onOverrideAllChange: function onOverrideAllChange(checked) { |
| 16212 |
setVariablesOverrideAll(checked); |
| 16213 |
onSettingChange("variablesOverrideAll", checked); |
| 16214 |
}, |
| 16215 |
showOverrideOption: isImport && !variablesNotExported, |
| 16216 |
notExported: variablesNotExported |
| 16217 |
})))); |
| 16218 |
} |
| 16219 |
ClassesVariablesSection.propTypes = { |
| 16220 |
settings: import_prop_types$55.default.shape({ |
| 16221 |
classes: import_prop_types$55.default.bool, |
| 16222 |
variables: import_prop_types$55.default.bool, |
| 16223 |
classesOverrideAll: import_prop_types$55.default.bool, |
| 16224 |
variablesOverrideAll: import_prop_types$55.default.bool |
| 16225 |
}).isRequired, |
| 16226 |
onSettingChange: import_prop_types$55.default.func.isRequired, |
| 16227 |
isImport: import_prop_types$55.default.bool, |
| 16228 |
classesExported: import_prop_types$55.default.bool, |
| 16229 |
variablesExported: import_prop_types$55.default.bool, |
| 16230 |
classesLimitExceeded: import_prop_types$55.default.bool, |
| 16231 |
variablesLimitExceeded: import_prop_types$55.default.bool, |
| 16232 |
classesOverLimitCount: import_prop_types$55.default.number, |
| 16233 |
variablesOverLimitCount: import_prop_types$55.default.number, |
| 16234 |
onClassesReviewClick: import_prop_types$55.default.func, |
| 16235 |
onVariablesReviewClick: import_prop_types$55.default.func, |
| 16236 |
disabled: import_prop_types$55.default.bool, |
| 16237 |
notExported: import_prop_types$55.default.bool |
| 16238 |
}; |
| 16239 |
|
| 16240 |
//#endregion |
| 16241 |
//#region app/modules/import-export-customization/assets/js/shared/components/override-confirmation-dialog.js |
| 16242 |
var getDialogContent = function getDialogContent(type) { |
| 16243 |
switch (type) { |
| 16244 |
case "both": return { |
| 16245 |
title: (0, _wordpress_i18n.__)("Override all classes and variables?", "elementor"), |
| 16246 |
description: (0, _wordpress_i18n.__)("This will delete all existing classes and variables and replace them with the imported ones. This action cannot be undone.", "elementor") |
| 16247 |
}; |
| 16248 |
case "variables": return { |
| 16249 |
title: (0, _wordpress_i18n.__)("Override all variables?", "elementor"), |
| 16250 |
description: (0, _wordpress_i18n.__)("This will delete all existing variables and replace them with the imported ones. This action cannot be undone.", "elementor") |
| 16251 |
}; |
| 16252 |
default: return { |
| 16253 |
title: (0, _wordpress_i18n.__)("Override all classes?", "elementor"), |
| 16254 |
description: (0, _wordpress_i18n.__)("This will delete all existing classes and replace them with the imported ones. This action cannot be undone.", "elementor") |
| 16255 |
}; |
| 16256 |
} |
| 16257 |
}; |
| 16258 |
function OverrideConfirmationDialog(_ref) { |
| 16259 |
var open = _ref.open; |
| 16260 |
var onClose = _ref.onClose; |
| 16261 |
var onConfirm = _ref.onConfirm; |
| 16262 |
var _ref$type = _ref.type; |
| 16263 |
var _getDialogContent = getDialogContent(_ref$type === void 0 ? "classes" : _ref$type); |
| 16264 |
var title = _getDialogContent.title; |
| 16265 |
var description = _getDialogContent.description; |
| 16266 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, { |
| 16267 |
open, |
| 16268 |
onClose, |
| 16269 |
maxWidth: "xs", |
| 16270 |
fullWidth: true |
| 16271 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, { sx: { |
| 16272 |
pt: 2, |
| 16273 |
pb: 1.5 |
| 16274 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { spacing: 1.5 }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 16275 |
direction: "row", |
| 16276 |
justifyContent: "space-between", |
| 16277 |
alignItems: "flex-start" |
| 16278 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 16279 |
direction: "row", |
| 16280 |
spacing: 1.5, |
| 16281 |
alignItems: "flex-start", |
| 16282 |
sx: { flex: 1 } |
| 16283 |
}, /*#__PURE__*/ react.default.createElement(_elementor_icons.AlertTriangleFilledIcon, { sx: { |
| 16284 |
color: "warning.dark", |
| 16285 |
fontSize: 24, |
| 16286 |
flexShrink: 0 |
| 16287 |
} }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 16288 |
variant: "subtitle1", |
| 16289 |
sx: { fontWeight: 500 } |
| 16290 |
}, title)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 16291 |
onClick: onClose, |
| 16292 |
sx: { |
| 16293 |
minWidth: "auto", |
| 16294 |
p: .5, |
| 16295 |
color: "text.primary" |
| 16296 |
} |
| 16297 |
}, /*#__PURE__*/ react.default.createElement(_elementor_icons.XIcon, { sx: { fontSize: 20 } }))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 16298 |
variant: "body2", |
| 16299 |
color: "text.secondary", |
| 16300 |
sx: { pr: 1 } |
| 16301 |
}, description))), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogActions, { sx: { |
| 16302 |
px: 3, |
| 16303 |
pb: 2 |
| 16304 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 16305 |
onClick: onClose, |
| 16306 |
color: "secondary", |
| 16307 |
variant: "text" |
| 16308 |
}, (0, _wordpress_i18n.__)("Cancel", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 16309 |
onClick: onConfirm, |
| 16310 |
variant: "contained", |
| 16311 |
sx: { |
| 16312 |
color: "white", |
| 16313 |
backgroundColor: "warning.main", |
| 16314 |
"&:hover": { backgroundColor: "warning.dark" } |
| 16315 |
} |
| 16316 |
}, (0, _wordpress_i18n.__)("Save and override", "elementor")))); |
| 16317 |
} |
| 16318 |
OverrideConfirmationDialog.propTypes = { |
| 16319 |
open: import_prop_types$55.default.bool.isRequired, |
| 16320 |
onClose: import_prop_types$55.default.func.isRequired, |
| 16321 |
onConfirm: import_prop_types$55.default.func.isRequired, |
| 16322 |
type: import_prop_types$55.default.oneOf([ |
| 16323 |
"classes", |
| 16324 |
"variables", |
| 16325 |
"both" |
| 16326 |
]) |
| 16327 |
}; |
| 16328 |
|
| 16329 |
//#endregion |
| 16330 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-tab-focus.js |
| 16331 |
function useTabFocus(callback) { |
| 16332 |
(0, react.useEffect)(function() { |
| 16333 |
var handleVisibilityChange = function handleVisibilityChange() { |
| 16334 |
if ("visible" === document.visibilityState) callback(); |
| 16335 |
}; |
| 16336 |
document.addEventListener("visibilitychange", handleVisibilityChange); |
| 16337 |
return function() { |
| 16338 |
return document.removeEventListener("visibilitychange", handleVisibilityChange); |
| 16339 |
}; |
| 16340 |
}, [callback]); |
| 16341 |
} |
| 16342 |
|
| 16343 |
//#endregion |
| 16344 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-classes-variables-limits.js |
| 16345 |
init_asyncToGenerator(); |
| 16346 |
init_slicedToArray(); |
| 16347 |
var DEFAULT_CLASSES_LIMIT = 100; |
| 16348 |
var DEFAULT_VARIABLES_LIMIT = 100; |
| 16349 |
function getLimitsFromConfig() { |
| 16350 |
var _window$elementorAppC; |
| 16351 |
var _config$limits$classe; |
| 16352 |
var _config$limits; |
| 16353 |
var _config$limits$variab; |
| 16354 |
var _config$limits2; |
| 16355 |
var config = (_window$elementorAppC = window.elementorAppConfig) === null || _window$elementorAppC === void 0 ? void 0 : _window$elementorAppC["import-export-customization"]; |
| 16356 |
return { |
| 16357 |
classes: (_config$limits$classe = config === null || config === void 0 || (_config$limits = config.limits) === null || _config$limits === void 0 ? void 0 : _config$limits.classes) !== null && _config$limits$classe !== void 0 ? _config$limits$classe : DEFAULT_CLASSES_LIMIT, |
| 16358 |
variables: (_config$limits$variab = config === null || config === void 0 || (_config$limits2 = config.limits) === null || _config$limits2 === void 0 ? void 0 : _config$limits2.variables) !== null && _config$limits$variab !== void 0 ? _config$limits$variab : DEFAULT_VARIABLES_LIMIT |
| 16359 |
}; |
| 16360 |
} |
| 16361 |
function useClassesVariablesLimits(_ref) { |
| 16362 |
var open = _ref.open; |
| 16363 |
var isImport = _ref.isImport; |
| 16364 |
var _useState2 = _slicedToArray((0, react.useState)(0), 2); |
| 16365 |
var existingClassesCount = _useState2[0]; |
| 16366 |
var setExistingClassesCount = _useState2[1]; |
| 16367 |
var _useState4 = _slicedToArray((0, react.useState)(0), 2); |
| 16368 |
var existingVariablesCount = _useState4[0]; |
| 16369 |
var setExistingVariablesCount = _useState4[1]; |
| 16370 |
var _useState6 = _slicedToArray((0, react.useState)(false), 2); |
| 16371 |
var isLoading = _useState6[0]; |
| 16372 |
var setIsLoading = _useState6[1]; |
| 16373 |
var _useState8 = _slicedToArray((0, react.useState)(null), 2); |
| 16374 |
var error = _useState8[0]; |
| 16375 |
var setError = _useState8[1]; |
| 16376 |
var limits = (0, react.useMemo)(function() { |
| 16377 |
return getLimitsFromConfig(); |
| 16378 |
}, []); |
| 16379 |
var fetchCounts = (0, react.useCallback)(/*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee() { |
| 16380 |
var _window$wpApiSettings; |
| 16381 |
var _window$wpApiSettings2; |
| 16382 |
var baseUrl; |
| 16383 |
var nonce; |
| 16384 |
var _yield$Promise$all; |
| 16385 |
var _yield$Promise$all2; |
| 16386 |
var classesResponse; |
| 16387 |
var variablesResponse; |
| 16388 |
var classesData; |
| 16389 |
var classesCount; |
| 16390 |
var _variablesData$data; |
| 16391 |
var variablesData; |
| 16392 |
var variablesCount; |
| 16393 |
var _t; |
| 16394 |
return import_regenerator$1.default.wrap(function(_context) { |
| 16395 |
while (1) switch (_context.prev = _context.next) { |
| 16396 |
case 0: |
| 16397 |
if (!(!open || !isImport)) { |
| 16398 |
_context.next = 1; |
| 16399 |
break; |
| 16400 |
} |
| 16401 |
return _context.abrupt("return"); |
| 16402 |
case 1: |
| 16403 |
setIsLoading(true); |
| 16404 |
setError(null); |
| 16405 |
_context.prev = 2; |
| 16406 |
baseUrl = ((_window$wpApiSettings = window.wpApiSettings) === null || _window$wpApiSettings === void 0 ? void 0 : _window$wpApiSettings.root) || "/wp-json/"; |
| 16407 |
nonce = ((_window$wpApiSettings2 = window.wpApiSettings) === null || _window$wpApiSettings2 === void 0 ? void 0 : _window$wpApiSettings2.nonce) || ""; |
| 16408 |
_context.next = 3; |
| 16409 |
return Promise.all([fetch("".concat(baseUrl, "elementor/v1/global-classes"), { headers: { "X-WP-Nonce": nonce } }), fetch("".concat(baseUrl, "elementor/v1/variables/list"), { headers: { "X-WP-Nonce": nonce } })]); |
| 16410 |
case 3: |
| 16411 |
_yield$Promise$all = _context.sent; |
| 16412 |
_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2); |
| 16413 |
classesResponse = _yield$Promise$all2[0]; |
| 16414 |
variablesResponse = _yield$Promise$all2[1]; |
| 16415 |
if (!classesResponse.ok) { |
| 16416 |
_context.next = 5; |
| 16417 |
break; |
| 16418 |
} |
| 16419 |
_context.next = 4; |
| 16420 |
return classesResponse.json(); |
| 16421 |
case 4: |
| 16422 |
classesData = _context.sent; |
| 16423 |
classesCount = Object.keys((classesData === null || classesData === void 0 ? void 0 : classesData.data) || {}).length; |
| 16424 |
setExistingClassesCount(classesCount); |
| 16425 |
case 5: |
| 16426 |
if (!variablesResponse.ok) { |
| 16427 |
_context.next = 7; |
| 16428 |
break; |
| 16429 |
} |
| 16430 |
_context.next = 6; |
| 16431 |
return variablesResponse.json(); |
| 16432 |
case 6: |
| 16433 |
variablesData = _context.sent; |
| 16434 |
variablesCount = (variablesData === null || variablesData === void 0 || (_variablesData$data = variablesData.data) === null || _variablesData$data === void 0 ? void 0 : _variablesData$data.total) || 0; |
| 16435 |
setExistingVariablesCount(variablesCount); |
| 16436 |
case 7: |
| 16437 |
_context.next = 9; |
| 16438 |
break; |
| 16439 |
case 8: |
| 16440 |
_context.prev = 8; |
| 16441 |
_t = _context["catch"](2); |
| 16442 |
setError(_t); |
| 16443 |
case 9: |
| 16444 |
_context.prev = 9; |
| 16445 |
setIsLoading(false); |
| 16446 |
return _context.finish(9); |
| 16447 |
case 10: |
| 16448 |
case "end": return _context.stop(); |
| 16449 |
} |
| 16450 |
}, _callee, null, [[ |
| 16451 |
2, |
| 16452 |
8, |
| 16453 |
9, |
| 16454 |
10 |
| 16455 |
]]); |
| 16456 |
})), [open, isImport]); |
| 16457 |
(0, react.useEffect)(function() { |
| 16458 |
fetchCounts(); |
| 16459 |
}, [fetchCounts]); |
| 16460 |
useTabFocus(fetchCounts); |
| 16461 |
var calculateLimitInfo = (0, react.useCallback)(function(existingCount, importedCount, limit) { |
| 16462 |
var totalAfterImport = existingCount + importedCount; |
| 16463 |
var isExceeded = totalAfterImport > limit; |
| 16464 |
return { |
| 16465 |
isExceeded, |
| 16466 |
overLimitCount: isExceeded ? totalAfterImport - limit : 0, |
| 16467 |
totalAfterImport |
| 16468 |
}; |
| 16469 |
}, []); |
| 16470 |
return { |
| 16471 |
existingClassesCount, |
| 16472 |
existingVariablesCount, |
| 16473 |
classesLimit: limits.classes, |
| 16474 |
variablesLimit: limits.variables, |
| 16475 |
isLoading, |
| 16476 |
error, |
| 16477 |
calculateLimitInfo, |
| 16478 |
refetch: fetchCounts |
| 16479 |
}; |
| 16480 |
} |
| 16481 |
|
| 16482 |
//#endregion |
| 16483 |
//#region app/modules/import-export-customization/assets/js/shared/components/kit-settings-customization-dialog.js |
| 16484 |
init_defineProperty$1(); |
| 16485 |
init_asyncToGenerator(); |
| 16486 |
init_slicedToArray(); |
| 16487 |
init_apps_event_tracking(); |
| 16488 |
function ownKeys$13(e, r) { |
| 16489 |
var t = Object.keys(e); |
| 16490 |
if (Object.getOwnPropertySymbols) { |
| 16491 |
var o = Object.getOwnPropertySymbols(e); |
| 16492 |
r && (o = o.filter(function(r) { |
| 16493 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 16494 |
})), t.push.apply(t, o); |
| 16495 |
} |
| 16496 |
return t; |
| 16497 |
} |
| 16498 |
__name(ownKeys$13, "ownKeys"); |
| 16499 |
function _objectSpread$12(e) { |
| 16500 |
for (var r = 1; r < arguments.length; r++) { |
| 16501 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 16502 |
r % 2 ? ownKeys$13(Object(t), !0).forEach(function(r) { |
| 16503 |
_defineProperty$1(e, r, t[r]); |
| 16504 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$13(Object(t)).forEach(function(r) { |
| 16505 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 16506 |
}); |
| 16507 |
} |
| 16508 |
return e; |
| 16509 |
} |
| 16510 |
__name(_objectSpread$12, "_objectSpread"); |
| 16511 |
function isExperimentActive$1(experimentName) { |
| 16512 |
var _elementorCommon; |
| 16513 |
return !!((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.config) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.experimentalFeatures) !== null && _elementorCommon !== void 0 && _elementorCommon[experimentName]); |
| 16514 |
} |
| 16515 |
__name(isExperimentActive$1, "isExperimentActive"); |
| 16516 |
function isClassesFeatureActive$1() { |
| 16517 |
return isExperimentActive$1("e_atomic_elements"); |
| 16518 |
} |
| 16519 |
__name(isClassesFeatureActive$1, "isClassesFeatureActive"); |
| 16520 |
function isVariablesFeatureActive$1() { |
| 16521 |
return isExperimentActive$1("e_atomic_elements"); |
| 16522 |
} |
| 16523 |
__name(isVariablesFeatureActive$1, "isVariablesFeatureActive"); |
| 16524 |
var transformAnalyticsData = function transformAnalyticsData(payload) { |
| 16525 |
var transformed = {}; |
| 16526 |
for (var _i = 0, _Object$entries = Object.entries(payload); _i < _Object$entries.length; _i++) { |
| 16527 |
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2); |
| 16528 |
var key = _Object$entries$_i[0]; |
| 16529 |
var value = _Object$entries$_i[1]; |
| 16530 |
transformed[key] = transformValueForAnalytics(key, value, []); |
| 16531 |
} |
| 16532 |
return transformed; |
| 16533 |
}; |
| 16534 |
function fetchManagerUrl(_x) { |
| 16535 |
return _fetchManagerUrl.apply(this, arguments); |
| 16536 |
} |
| 16537 |
function _fetchManagerUrl() { |
| 16538 |
_fetchManagerUrl = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee2(panelId) { |
| 16539 |
var _window$wpApiSettings; |
| 16540 |
var _window$wpApiSettings2; |
| 16541 |
var _data$data; |
| 16542 |
var baseUrl; |
| 16543 |
var nonce; |
| 16544 |
var response; |
| 16545 |
var data; |
| 16546 |
return import_regenerator$1.default.wrap(function(_context2) { |
| 16547 |
while (1) switch (_context2.prev = _context2.next) { |
| 16548 |
case 0: |
| 16549 |
baseUrl = ((_window$wpApiSettings = window.wpApiSettings) === null || _window$wpApiSettings === void 0 ? void 0 : _window$wpApiSettings.root) || "/wp-json/"; |
| 16550 |
nonce = ((_window$wpApiSettings2 = window.wpApiSettings) === null || _window$wpApiSettings2 === void 0 ? void 0 : _window$wpApiSettings2.nonce) || ""; |
| 16551 |
_context2.next = 1; |
| 16552 |
return fetch("".concat(baseUrl, "elementor/v1/import-export-customization/manager-url?panel=").concat(panelId), { headers: { "X-WP-Nonce": nonce } }); |
| 16553 |
case 1: |
| 16554 |
response = _context2.sent; |
| 16555 |
if (response.ok) { |
| 16556 |
_context2.next = 2; |
| 16557 |
break; |
| 16558 |
} |
| 16559 |
throw new Error("Failed to fetch manager URL"); |
| 16560 |
case 2: |
| 16561 |
_context2.next = 3; |
| 16562 |
return response.json(); |
| 16563 |
case 3: |
| 16564 |
data = _context2.sent; |
| 16565 |
return _context2.abrupt("return", ((_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.url) || data.url); |
| 16566 |
case 4: |
| 16567 |
case "end": return _context2.stop(); |
| 16568 |
} |
| 16569 |
}, _callee2); |
| 16570 |
})); |
| 16571 |
return _fetchManagerUrl.apply(this, arguments); |
| 16572 |
} |
| 16573 |
function getInitialState(contextData, isImport) { |
| 16574 |
var _data$uploadedData; |
| 16575 |
var data = contextData.data; |
| 16576 |
var initialState = data.includes.includes("settings"); |
| 16577 |
if (isImport && !(contextData !== null && contextData !== void 0 && contextData.isOldExport) && !(data !== null && data !== void 0 && (_data$uploadedData = data.uploadedData) !== null && _data$uploadedData !== void 0 && (_data$uploadedData = _data$uploadedData.manifest) !== null && _data$uploadedData !== void 0 && (_data$uploadedData = _data$uploadedData["site-settings"]) !== null && _data$uploadedData !== void 0 && _data$uploadedData.theme)) initialState = false; |
| 16578 |
return initialState; |
| 16579 |
} |
| 16580 |
function isExported(contextData) { |
| 16581 |
var _contextData$data2; |
| 16582 |
if (contextData !== null && contextData !== void 0 && contextData.isOldExport) { |
| 16583 |
var _contextData$data; |
| 16584 |
return contextData === null || contextData === void 0 || (_contextData$data = contextData.data) === null || _contextData$data === void 0 || (_contextData$data = _contextData$data.uploadedData) === null || _contextData$data === void 0 || (_contextData$data = _contextData$data.manifest) === null || _contextData$data === void 0 ? void 0 : _contextData$data.theme; |
| 16585 |
} |
| 16586 |
return contextData === null || contextData === void 0 || (_contextData$data2 = contextData.data) === null || _contextData$data2 === void 0 || (_contextData$data2 = _contextData$data2.uploadedData) === null || _contextData$data2 === void 0 || (_contextData$data2 = _contextData$data2.manifest) === null || _contextData$data2 === void 0 || (_contextData$data2 = _contextData$data2["site-settings"]) === null || _contextData$data2 === void 0 ? void 0 : _contextData$data2.theme; |
| 16587 |
} |
| 16588 |
function isClassesExported(contextData) { |
| 16589 |
var _contextData$data3; |
| 16590 |
return !!(contextData !== null && contextData !== void 0 && (_contextData$data3 = contextData.data) !== null && _contextData$data3 !== void 0 && (_contextData$data3 = _contextData$data3.uploadedData) !== null && _contextData$data3 !== void 0 && (_contextData$data3 = _contextData$data3.manifest) !== null && _contextData$data3 !== void 0 && (_contextData$data3 = _contextData$data3["site-settings"]) !== null && _contextData$data3 !== void 0 && _contextData$data3.classes); |
| 16591 |
} |
| 16592 |
function isVariablesExported(contextData) { |
| 16593 |
var _contextData$data4; |
| 16594 |
return !!(contextData !== null && contextData !== void 0 && (_contextData$data4 = contextData.data) !== null && _contextData$data4 !== void 0 && (_contextData$data4 = _contextData$data4.uploadedData) !== null && _contextData$data4 !== void 0 && (_contextData$data4 = _contextData$data4.manifest) !== null && _contextData$data4 !== void 0 && (_contextData$data4 = _contextData$data4["site-settings"]) !== null && _contextData$data4 !== void 0 && _contextData$data4.variables); |
| 16595 |
} |
| 16596 |
function getClassesVariablesInitialState(contextData, isImport) { |
| 16597 |
var _contextData$data5; |
| 16598 |
var includesSettings = contextData === null || contextData === void 0 || (_contextData$data5 = contextData.data) === null || _contextData$data5 === void 0 || (_contextData$data5 = _contextData$data5.includes) === null || _contextData$data5 === void 0 ? void 0 : _contextData$data5.includes("settings"); |
| 16599 |
return { |
| 16600 |
classes: includesSettings && (!isImport || isClassesExported(contextData)), |
| 16601 |
variables: includesSettings && (!isImport || isVariablesExported(contextData)), |
| 16602 |
classesOverrideAll: false, |
| 16603 |
variablesOverrideAll: false |
| 16604 |
}; |
| 16605 |
} |
| 16606 |
function KitSettingsCustomizationDialog(_ref) { |
| 16607 |
var _useContextDetection; |
| 16608 |
var _contextData$data7; |
| 16609 |
var _contextData$data8; |
| 16610 |
var _contextData$data9; |
| 16611 |
var _contextData$data0; |
| 16612 |
var _contextData$data$upl; |
| 16613 |
var _contextData$data1; |
| 16614 |
var _contextData$data$upl2; |
| 16615 |
var _contextData$data10; |
| 16616 |
var _contextData$data11; |
| 16617 |
var _settings$classes; |
| 16618 |
var _settings$variables; |
| 16619 |
var _settings$classesOver; |
| 16620 |
var _settings$variablesOv; |
| 16621 |
var open = _ref.open; |
| 16622 |
var handleClose = _ref.handleClose; |
| 16623 |
var handleSaveChanges = _ref.handleSaveChanges; |
| 16624 |
var _ref2 = (_useContextDetection = useContextDetection()) !== null && _useContextDetection !== void 0 ? _useContextDetection : {}; |
| 16625 |
var _ref2$isImport = _ref2.isImport; |
| 16626 |
var isImport = _ref2$isImport === void 0 ? false : _ref2$isImport; |
| 16627 |
var _ref2$contextData = _ref2.contextData; |
| 16628 |
var contextData = _ref2$contextData === void 0 ? {} : _ref2$contextData; |
| 16629 |
var _contextData$data6 = contextData.data; |
| 16630 |
var data = _contextData$data6 === void 0 ? null : _contextData$data6; |
| 16631 |
var showClassesSection = isClassesFeatureActive$1(); |
| 16632 |
var showVariablesSection = isVariablesFeatureActive$1(); |
| 16633 |
var showClassesVariablesSection = showClassesSection || showVariablesSection; |
| 16634 |
var initialState = (0, react.useMemo)(function() { |
| 16635 |
return getInitialState(contextData, isImport); |
| 16636 |
}, [ |
| 16637 |
contextData === null || contextData === void 0 || (_contextData$data7 = contextData.data) === null || _contextData$data7 === void 0 ? void 0 : _contextData$data7.includes, |
| 16638 |
contextData === null || contextData === void 0 ? void 0 : contextData.isOldExport, |
| 16639 |
contextData === null || contextData === void 0 || (_contextData$data8 = contextData.data) === null || _contextData$data8 === void 0 || (_contextData$data8 = _contextData$data8.uploadedData) === null || _contextData$data8 === void 0 ? void 0 : _contextData$data8.manifest, |
| 16640 |
isImport |
| 16641 |
]); |
| 16642 |
var classesVariablesInitialState = (0, react.useMemo)(function() { |
| 16643 |
return getClassesVariablesInitialState(contextData, isImport); |
| 16644 |
}, [ |
| 16645 |
contextData === null || contextData === void 0 || (_contextData$data9 = contextData.data) === null || _contextData$data9 === void 0 ? void 0 : _contextData$data9.includes, |
| 16646 |
contextData === null || contextData === void 0 || (_contextData$data0 = contextData.data) === null || _contextData$data0 === void 0 || (_contextData$data0 = _contextData$data0.uploadedData) === null || _contextData$data0 === void 0 ? void 0 : _contextData$data0.manifest, |
| 16647 |
isImport |
| 16648 |
]); |
| 16649 |
var _useClassesVariablesL = useClassesVariablesLimits({ |
| 16650 |
open, |
| 16651 |
isImport |
| 16652 |
}); |
| 16653 |
var existingClassesCount = _useClassesVariablesL.existingClassesCount; |
| 16654 |
var existingVariablesCount = _useClassesVariablesL.existingVariablesCount; |
| 16655 |
var classesLimit = _useClassesVariablesL.classesLimit; |
| 16656 |
var variablesLimit = _useClassesVariablesL.variablesLimit; |
| 16657 |
var calculateLimitInfo = _useClassesVariablesL.calculateLimitInfo; |
| 16658 |
var importedClassesCount = (_contextData$data$upl = contextData === null || contextData === void 0 || (_contextData$data1 = contextData.data) === null || _contextData$data1 === void 0 || (_contextData$data1 = _contextData$data1.uploadedData) === null || _contextData$data1 === void 0 || (_contextData$data1 = _contextData$data1.manifest) === null || _contextData$data1 === void 0 || (_contextData$data1 = _contextData$data1["site-settings"]) === null || _contextData$data1 === void 0 ? void 0 : _contextData$data1.classesCount) !== null && _contextData$data$upl !== void 0 ? _contextData$data$upl : 0; |
| 16659 |
var importedVariablesCount = (_contextData$data$upl2 = contextData === null || contextData === void 0 || (_contextData$data10 = contextData.data) === null || _contextData$data10 === void 0 || (_contextData$data10 = _contextData$data10.uploadedData) === null || _contextData$data10 === void 0 || (_contextData$data10 = _contextData$data10.manifest) === null || _contextData$data10 === void 0 || (_contextData$data10 = _contextData$data10["site-settings"]) === null || _contextData$data10 === void 0 ? void 0 : _contextData$data10.variablesCount) !== null && _contextData$data$upl2 !== void 0 ? _contextData$data$upl2 : 0; |
| 16660 |
var classesLimitInfo = (0, react.useMemo)(function() { |
| 16661 |
return calculateLimitInfo(existingClassesCount, importedClassesCount, classesLimit); |
| 16662 |
}, [ |
| 16663 |
existingClassesCount, |
| 16664 |
importedClassesCount, |
| 16665 |
classesLimit, |
| 16666 |
calculateLimitInfo |
| 16667 |
]); |
| 16668 |
var variablesLimitInfo = (0, react.useMemo)(function() { |
| 16669 |
return calculateLimitInfo(existingVariablesCount, importedVariablesCount, variablesLimit); |
| 16670 |
}, [ |
| 16671 |
existingVariablesCount, |
| 16672 |
importedVariablesCount, |
| 16673 |
variablesLimit, |
| 16674 |
calculateLimitInfo |
| 16675 |
]); |
| 16676 |
var _useState2 = _slicedToArray((0, react.useState)(function() { |
| 16677 |
if (data.customization.settings) return _objectSpread$12({}, data.customization.settings); |
| 16678 |
return _objectSpread$12({ theme: initialState }, showClassesVariablesSection ? classesVariablesInitialState : {}); |
| 16679 |
}), 2); |
| 16680 |
var settings = _useState2[0]; |
| 16681 |
var setSettings = _useState2[1]; |
| 16682 |
(0, react.useEffect)(function() { |
| 16683 |
if (open) if (data.customization.settings) setSettings(_objectSpread$12({}, data.customization.settings)); |
| 16684 |
else setSettings(_objectSpread$12({ theme: initialState }, showClassesVariablesSection ? classesVariablesInitialState : {})); |
| 16685 |
}, [open]); |
| 16686 |
(0, react.useEffect)(function() { |
| 16687 |
if (open) AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitExportCustomizationEdit); |
| 16688 |
}, [open]); |
| 16689 |
var handleToggleChange = function handleToggleChange(settingKey) { |
| 16690 |
setSettings(function(prev) { |
| 16691 |
return _objectSpread$12(_objectSpread$12({}, prev), {}, _defineProperty$1({}, settingKey, !prev[settingKey])); |
| 16692 |
}); |
| 16693 |
}; |
| 16694 |
var handleClassesVariablesChange = function handleClassesVariablesChange(settingKey, value) { |
| 16695 |
setSettings(function(prev) { |
| 16696 |
return _objectSpread$12(_objectSpread$12({}, prev), {}, _defineProperty$1({}, settingKey, value)); |
| 16697 |
}); |
| 16698 |
}; |
| 16699 |
var handleReviewClick = (0, react.useCallback)(/*#__PURE__*/ function() { |
| 16700 |
var _ref3 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee(panelId) { |
| 16701 |
var transformedAnalytics; |
| 16702 |
var url; |
| 16703 |
var _t; |
| 16704 |
return import_regenerator$1.default.wrap(function(_context) { |
| 16705 |
while (1) switch (_context.prev = _context.next) { |
| 16706 |
case 0: |
| 16707 |
transformedAnalytics = transformAnalyticsData(settings); |
| 16708 |
handleSaveChanges("settings", settings, true, transformedAnalytics); |
| 16709 |
handleClose(); |
| 16710 |
_context.prev = 1; |
| 16711 |
_context.next = 2; |
| 16712 |
return fetchManagerUrl(panelId); |
| 16713 |
case 2: |
| 16714 |
url = _context.sent; |
| 16715 |
window.open(url, "_blank"); |
| 16716 |
_context.next = 4; |
| 16717 |
break; |
| 16718 |
case 3: |
| 16719 |
_context.prev = 3; |
| 16720 |
_t = _context["catch"](1); |
| 16721 |
console.error("Failed to open ".concat(panelId, ":"), _t); |
| 16722 |
case 4: |
| 16723 |
case "end": return _context.stop(); |
| 16724 |
} |
| 16725 |
}, _callee, null, [[1, 3]]); |
| 16726 |
})); |
| 16727 |
return function(_x2) { |
| 16728 |
return _ref3.apply(this, arguments); |
| 16729 |
}; |
| 16730 |
}(), [ |
| 16731 |
settings, |
| 16732 |
handleSaveChanges, |
| 16733 |
handleClose |
| 16734 |
]); |
| 16735 |
var handleClassesReviewClick = (0, react.useCallback)(function() { |
| 16736 |
handleReviewClick("global-classes-manager"); |
| 16737 |
}, [handleReviewClick]); |
| 16738 |
var handleVariablesReviewClick = (0, react.useCallback)(function() { |
| 16739 |
handleReviewClick("variables-manager"); |
| 16740 |
}, [handleReviewClick]); |
| 16741 |
var classesNotExported = isImport && !isClassesExported(contextData); |
| 16742 |
var variablesNotExported = isImport && !isVariablesExported(contextData); |
| 16743 |
var classesVariablesNotExported = classesNotExported && variablesNotExported; |
| 16744 |
var classesLimitExceeded = isImport && classesLimitInfo.isExceeded; |
| 16745 |
var variablesLimitExceeded = isImport && variablesLimitInfo.isExceeded; |
| 16746 |
var classesOverLimitCount = classesLimitInfo.overLimitCount; |
| 16747 |
var variablesOverLimitCount = variablesLimitInfo.overLimitCount; |
| 16748 |
var _useState4 = _slicedToArray((0, react.useState)({ |
| 16749 |
open: false, |
| 16750 |
type: "classes" |
| 16751 |
}), 2); |
| 16752 |
var confirmationDialog = _useState4[0]; |
| 16753 |
var setConfirmationDialog = _useState4[1]; |
| 16754 |
var performSave = (0, react.useCallback)(function() { |
| 16755 |
handleSaveChanges("settings", settings, true, transformAnalyticsData(settings)); |
| 16756 |
handleClose(); |
| 16757 |
}, [ |
| 16758 |
settings, |
| 16759 |
handleSaveChanges, |
| 16760 |
handleClose |
| 16761 |
]); |
| 16762 |
var handleSaveClick = (0, react.useCallback)(function() { |
| 16763 |
var classesOverrideEnabled = settings.classesOverrideAll && settings.classes; |
| 16764 |
var variablesOverrideEnabled = settings.variablesOverrideAll && settings.variables; |
| 16765 |
if (classesOverrideEnabled && variablesOverrideEnabled) { |
| 16766 |
setConfirmationDialog({ |
| 16767 |
open: true, |
| 16768 |
type: "both" |
| 16769 |
}); |
| 16770 |
return; |
| 16771 |
} |
| 16772 |
if (classesOverrideEnabled) { |
| 16773 |
setConfirmationDialog({ |
| 16774 |
open: true, |
| 16775 |
type: "classes" |
| 16776 |
}); |
| 16777 |
return; |
| 16778 |
} |
| 16779 |
if (variablesOverrideEnabled) { |
| 16780 |
setConfirmationDialog({ |
| 16781 |
open: true, |
| 16782 |
type: "variables" |
| 16783 |
}); |
| 16784 |
return; |
| 16785 |
} |
| 16786 |
performSave(); |
| 16787 |
}, [settings, performSave]); |
| 16788 |
var handleConfirmationClose = (0, react.useCallback)(function() { |
| 16789 |
setConfirmationDialog({ |
| 16790 |
open: false, |
| 16791 |
type: "" |
| 16792 |
}); |
| 16793 |
}, []); |
| 16794 |
var handleConfirmationConfirm = (0, react.useCallback)(function() { |
| 16795 |
setConfirmationDialog({ |
| 16796 |
open: false, |
| 16797 |
type: "" |
| 16798 |
}); |
| 16799 |
performSave(); |
| 16800 |
}, [performSave]); |
| 16801 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(KitCustomizationDialog, { |
| 16802 |
open, |
| 16803 |
title: (0, _wordpress_i18n.__)("Edit settings & configurations", "elementor"), |
| 16804 |
handleClose, |
| 16805 |
handleSaveChanges: handleSaveClick |
| 16806 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { gap: 2 }, (contextData === null || contextData === void 0 ? void 0 : contextData.isOldElementorVersion) && /*#__PURE__*/ react.default.createElement(UpgradeVersionBanner, null), isImport && !isExported(contextData) ? /*#__PURE__*/ react.default.createElement(SettingSection, { |
| 16807 |
title: (0, _wordpress_i18n.__)("Theme", "elementor"), |
| 16808 |
settingKey: "theme", |
| 16809 |
notExported: true |
| 16810 |
}) : /*#__PURE__*/ react.default.createElement(SettingSection, { |
| 16811 |
key: "theme", |
| 16812 |
checked: settings.theme, |
| 16813 |
title: (0, _wordpress_i18n.__)("Theme", "elementor"), |
| 16814 |
description: (0, _wordpress_i18n.__)("Only public WordPress themes are supported", "elementor"), |
| 16815 |
settingKey: "theme", |
| 16816 |
onSettingChange: handleToggleChange, |
| 16817 |
disabled: isImport && !(contextData !== null && contextData !== void 0 && (_contextData$data11 = contextData.data) !== null && _contextData$data11 !== void 0 && (_contextData$data11 = _contextData$data11.uploadedData) !== null && _contextData$data11 !== void 0 && (_contextData$data11 = _contextData$data11.manifest) !== null && _contextData$data11 !== void 0 && (_contextData$data11 = _contextData$data11["site-settings"]) !== null && _contextData$data11 !== void 0 && _contextData$data11.theme) |
| 16818 |
}), showClassesVariablesSection && /*#__PURE__*/ react.default.createElement(ClassesVariablesSection, { |
| 16819 |
settings: { |
| 16820 |
classes: (_settings$classes = settings.classes) !== null && _settings$classes !== void 0 ? _settings$classes : false, |
| 16821 |
variables: (_settings$variables = settings.variables) !== null && _settings$variables !== void 0 ? _settings$variables : false, |
| 16822 |
classesOverrideAll: (_settings$classesOver = settings.classesOverrideAll) !== null && _settings$classesOver !== void 0 ? _settings$classesOver : false, |
| 16823 |
variablesOverrideAll: (_settings$variablesOv = settings.variablesOverrideAll) !== null && _settings$variablesOv !== void 0 ? _settings$variablesOv : false |
| 16824 |
}, |
| 16825 |
onSettingChange: handleClassesVariablesChange, |
| 16826 |
isImport, |
| 16827 |
classesExported: !classesNotExported && showClassesSection, |
| 16828 |
variablesExported: !variablesNotExported && showVariablesSection, |
| 16829 |
classesLimitExceeded, |
| 16830 |
variablesLimitExceeded, |
| 16831 |
classesOverLimitCount, |
| 16832 |
variablesOverLimitCount, |
| 16833 |
onClassesReviewClick: handleClassesReviewClick, |
| 16834 |
onVariablesReviewClick: handleVariablesReviewClick, |
| 16835 |
notExported: classesVariablesNotExported |
| 16836 |
}))), /*#__PURE__*/ react.default.createElement(OverrideConfirmationDialog, { |
| 16837 |
open: confirmationDialog.open, |
| 16838 |
onClose: handleConfirmationClose, |
| 16839 |
onConfirm: handleConfirmationConfirm, |
| 16840 |
type: confirmationDialog.type |
| 16841 |
})); |
| 16842 |
} |
| 16843 |
KitSettingsCustomizationDialog.propTypes = { |
| 16844 |
open: import_prop_types$55.default.bool.isRequired, |
| 16845 |
handleClose: import_prop_types$55.default.func.isRequired, |
| 16846 |
handleSaveChanges: import_prop_types$55.default.func.isRequired |
| 16847 |
}; |
| 16848 |
|
| 16849 |
//#endregion |
| 16850 |
//#region app/modules/import-export-customization/assets/js/shared/kit-content-data.js |
| 16851 |
var kitContentData = [ |
| 16852 |
{ |
| 16853 |
type: "content", |
| 16854 |
data: { |
| 16855 |
title: (0, _wordpress_i18n.__)("Content", "elementor"), |
| 16856 |
features: { open: [ |
| 16857 |
(0, _wordpress_i18n.__)("Elementor Pages", "elementor"), |
| 16858 |
(0, _wordpress_i18n.__)("Elementor Posts", "elementor"), |
| 16859 |
(0, _wordpress_i18n.__)("WP Pages", "elementor"), |
| 16860 |
(0, _wordpress_i18n.__)("WP Posts", "elementor"), |
| 16861 |
(0, _wordpress_i18n.__)("WP Menus", "elementor"), |
| 16862 |
(0, _wordpress_i18n.__)("Custom Post Types", "elementor") |
| 16863 |
] } |
| 16864 |
}, |
| 16865 |
dialog: KitContentCustomizationDialog, |
| 16866 |
required: false |
| 16867 |
}, |
| 16868 |
{ |
| 16869 |
type: "templates", |
| 16870 |
data: { |
| 16871 |
title: (0, _wordpress_i18n.__)("Templates", "elementor"), |
| 16872 |
features: { |
| 16873 |
open: [(0, _wordpress_i18n.__)("Saved Templates", "elementor")], |
| 16874 |
locked: [ |
| 16875 |
(0, _wordpress_i18n.__)("Headers", "elementor"), |
| 16876 |
(0, _wordpress_i18n.__)("Footers", "elementor"), |
| 16877 |
(0, _wordpress_i18n.__)("Archives", "elementor"), |
| 16878 |
(0, _wordpress_i18n.__)("Single Posts", "elementor"), |
| 16879 |
(0, _wordpress_i18n.__)("Single Pages", "elementor"), |
| 16880 |
(0, _wordpress_i18n.__)("Search Results", "elementor"), |
| 16881 |
(0, _wordpress_i18n.__)("404 Error Page", "elementor"), |
| 16882 |
(0, _wordpress_i18n.__)("Popups", "elementor"), |
| 16883 |
(0, _wordpress_i18n.__)("Global widgets", "elementor") |
| 16884 |
], |
| 16885 |
tooltip: (0, _wordpress_i18n.__)("To import or export these components, you’ll need Elementor Pro.", "elementor") |
| 16886 |
} |
| 16887 |
}, |
| 16888 |
dialog: null, |
| 16889 |
required: false |
| 16890 |
}, |
| 16891 |
{ |
| 16892 |
type: "settings", |
| 16893 |
data: { |
| 16894 |
title: (0, _wordpress_i18n.__)("Settings & configurations", "elementor"), |
| 16895 |
features: { open: [ |
| 16896 |
(0, _wordpress_i18n.__)("Classes", "elementor"), |
| 16897 |
(0, _wordpress_i18n.__)("Variables", "elementor"), |
| 16898 |
(0, _wordpress_i18n.__)("Global Colors", "elementor"), |
| 16899 |
(0, _wordpress_i18n.__)("Global Fonts", "elementor"), |
| 16900 |
(0, _wordpress_i18n.__)("Theme Style Settings", "elementor"), |
| 16901 |
(0, _wordpress_i18n.__)("Layout Settings", "elementor"), |
| 16902 |
(0, _wordpress_i18n.__)("Lightbox Settings", "elementor"), |
| 16903 |
(0, _wordpress_i18n.__)("Background Settings", "elementor"), |
| 16904 |
(0, _wordpress_i18n.__)("Custom Fonts", "elementor"), |
| 16905 |
(0, _wordpress_i18n.__)("Icons", "elementor"), |
| 16906 |
(0, _wordpress_i18n.__)("Code", "elementor") |
| 16907 |
] } |
| 16908 |
}, |
| 16909 |
dialog: KitSettingsCustomizationDialog, |
| 16910 |
required: false |
| 16911 |
}, |
| 16912 |
{ |
| 16913 |
type: "plugins", |
| 16914 |
data: { |
| 16915 |
title: (0, _wordpress_i18n.__)("Plugins", "elementor"), |
| 16916 |
features: { open: [(0, _wordpress_i18n.__)("All plugins are required for this website templates to work", "elementor")] } |
| 16917 |
}, |
| 16918 |
dialog: KitPluginsCustomizationDialog, |
| 16919 |
required: true |
| 16920 |
} |
| 16921 |
]; |
| 16922 |
|
| 16923 |
//#endregion |
| 16924 |
//#region app/modules/import-export-customization/assets/js/shared/components/re-export-banner.js |
| 16925 |
function ReExportBanner() { |
| 16926 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Paper, { |
| 16927 |
color: "secondary", |
| 16928 |
elevation: 0, |
| 16929 |
variant: "elevation" |
| 16930 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 16931 |
direction: "row", |
| 16932 |
sx: { |
| 16933 |
alignItems: "center", |
| 16934 |
justifyContent: "space-between", |
| 16935 |
gap: "5px", |
| 16936 |
p: 2.5 |
| 16937 |
} |
| 16938 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 16939 |
direction: "row", |
| 16940 |
sx: { |
| 16941 |
alignItems: "center", |
| 16942 |
gap: "5px" |
| 16943 |
} |
| 16944 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 16945 |
component: "i", |
| 16946 |
className: "eicon-info-circle" |
| 16947 |
}), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.__)("This website template was exported from an older version of Elementor. If possible, re-export it with the latest version for better capabilities.", "elementor"))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 16948 |
href: "http://go.elementor.com/app-import-export-errors-old-kits", |
| 16949 |
variant: "body2", |
| 16950 |
color: "info.light", |
| 16951 |
underline: "hover", |
| 16952 |
target: "_blank", |
| 16953 |
rel: "noopener noreferrer" |
| 16954 |
}, (0, _wordpress_i18n.__)("Learn more", "elementor")))); |
| 16955 |
} |
| 16956 |
|
| 16957 |
//#endregion |
| 16958 |
//#region app/modules/import-export-customization/assets/js/shared/components/kit-parts-selection.js |
| 16959 |
init_slicedToArray(); |
| 16960 |
init_apps_event_tracking(); |
| 16961 |
function isExperimentActive(experimentName) { |
| 16962 |
var _common$config; |
| 16963 |
var common = typeof globalThis !== "undefined" ? globalThis.elementorCommon : void 0; |
| 16964 |
return !!(common !== null && common !== void 0 && (_common$config = common.config) !== null && _common$config !== void 0 && (_common$config = _common$config.experimentalFeatures) !== null && _common$config !== void 0 && _common$config[experimentName]); |
| 16965 |
} |
| 16966 |
function isClassesFeatureActive() { |
| 16967 |
return isExperimentActive("e_atomic_elements"); |
| 16968 |
} |
| 16969 |
function isVariablesFeatureActive() { |
| 16970 |
return isExperimentActive("e_atomic_elements"); |
| 16971 |
} |
| 16972 |
function KitPartsSelection(_ref) { |
| 16973 |
var _useContextDetection; |
| 16974 |
var _contextData$data$upl; |
| 16975 |
var _contextData$data2; |
| 16976 |
var _contextData$data$upl2; |
| 16977 |
var _contextData$data3; |
| 16978 |
var _contextData$data4; |
| 16979 |
var _contextData$data5; |
| 16980 |
var onCheckboxChange = _ref.onCheckboxChange; |
| 16981 |
var testId = _ref.testId; |
| 16982 |
var handleSaveCustomization = _ref.handleSaveCustomization; |
| 16983 |
var _ref$isCloudKitsEligi = _ref.isCloudKitsEligible; |
| 16984 |
var isCloudKitsEligible = _ref$isCloudKitsEligi === void 0 ? false : _ref$isCloudKitsEligi; |
| 16985 |
var _ref$showMediaFormatV = _ref.showMediaFormatValidation; |
| 16986 |
var showMediaFormatValidation = _ref$showMediaFormatV === void 0 ? false : _ref$showMediaFormatV; |
| 16987 |
var _useState2 = _slicedToArray((0, react.useState)(null), 2); |
| 16988 |
var activeDialog = _useState2[0]; |
| 16989 |
var setActiveDialog = _useState2[1]; |
| 16990 |
var _ref2 = (_useContextDetection = useContextDetection()) !== null && _useContextDetection !== void 0 ? _useContextDetection : {}; |
| 16991 |
var _ref2$isImport = _ref2.isImport; |
| 16992 |
var isImport = _ref2$isImport === void 0 ? false : _ref2$isImport; |
| 16993 |
var _ref2$contextData = _ref2.contextData; |
| 16994 |
var contextData = _ref2$contextData === void 0 ? {} : _ref2$contextData; |
| 16995 |
var _contextData$data = contextData.data; |
| 16996 |
var data = _contextData$data === void 0 ? null : _contextData$data; |
| 16997 |
var showClassesSection = isClassesFeatureActive(); |
| 16998 |
var showVariablesSection = isVariablesFeatureActive(); |
| 16999 |
var _useClassesVariablesL = useClassesVariablesLimits({ |
| 17000 |
open: true, |
| 17001 |
isImport |
| 17002 |
}); |
| 17003 |
var existingClassesCount = _useClassesVariablesL.existingClassesCount; |
| 17004 |
var existingVariablesCount = _useClassesVariablesL.existingVariablesCount; |
| 17005 |
var classesLimit = _useClassesVariablesL.classesLimit; |
| 17006 |
var variablesLimit = _useClassesVariablesL.variablesLimit; |
| 17007 |
var calculateLimitInfo = _useClassesVariablesL.calculateLimitInfo; |
| 17008 |
var importedClassesCount = (_contextData$data$upl = contextData === null || contextData === void 0 || (_contextData$data2 = contextData.data) === null || _contextData$data2 === void 0 || (_contextData$data2 = _contextData$data2.uploadedData) === null || _contextData$data2 === void 0 || (_contextData$data2 = _contextData$data2.manifest) === null || _contextData$data2 === void 0 || (_contextData$data2 = _contextData$data2["site-settings"]) === null || _contextData$data2 === void 0 ? void 0 : _contextData$data2.classesCount) !== null && _contextData$data$upl !== void 0 ? _contextData$data$upl : 0; |
| 17009 |
var importedVariablesCount = (_contextData$data$upl2 = contextData === null || contextData === void 0 || (_contextData$data3 = contextData.data) === null || _contextData$data3 === void 0 || (_contextData$data3 = _contextData$data3.uploadedData) === null || _contextData$data3 === void 0 || (_contextData$data3 = _contextData$data3.manifest) === null || _contextData$data3 === void 0 || (_contextData$data3 = _contextData$data3["site-settings"]) === null || _contextData$data3 === void 0 ? void 0 : _contextData$data3.variablesCount) !== null && _contextData$data$upl2 !== void 0 ? _contextData$data$upl2 : 0; |
| 17010 |
var isClassesExportedInManifest = !!(contextData !== null && contextData !== void 0 && (_contextData$data4 = contextData.data) !== null && _contextData$data4 !== void 0 && (_contextData$data4 = _contextData$data4.uploadedData) !== null && _contextData$data4 !== void 0 && (_contextData$data4 = _contextData$data4.manifest) !== null && _contextData$data4 !== void 0 && (_contextData$data4 = _contextData$data4["site-settings"]) !== null && _contextData$data4 !== void 0 && _contextData$data4.classes); |
| 17011 |
var isVariablesExportedInManifest = !!(contextData !== null && contextData !== void 0 && (_contextData$data5 = contextData.data) !== null && _contextData$data5 !== void 0 && (_contextData$data5 = _contextData$data5.uploadedData) !== null && _contextData$data5 !== void 0 && (_contextData$data5 = _contextData$data5.manifest) !== null && _contextData$data5 !== void 0 && (_contextData$data5 = _contextData$data5["site-settings"]) !== null && _contextData$data5 !== void 0 && _contextData$data5.variables); |
| 17012 |
var classesLimitInfo = (0, react.useMemo)(function() { |
| 17013 |
return calculateLimitInfo(existingClassesCount, importedClassesCount, classesLimit); |
| 17014 |
}, [ |
| 17015 |
existingClassesCount, |
| 17016 |
importedClassesCount, |
| 17017 |
classesLimit, |
| 17018 |
calculateLimitInfo |
| 17019 |
]); |
| 17020 |
var variablesLimitInfo = (0, react.useMemo)(function() { |
| 17021 |
return calculateLimitInfo(existingVariablesCount, importedVariablesCount, variablesLimit); |
| 17022 |
}, [ |
| 17023 |
existingVariablesCount, |
| 17024 |
importedVariablesCount, |
| 17025 |
variablesLimit, |
| 17026 |
calculateLimitInfo |
| 17027 |
]); |
| 17028 |
var hasSettingsLimitWarning = isImport && (showClassesSection && isClassesExportedInManifest && classesLimitInfo.isExceeded || showVariablesSection && isVariablesExportedInManifest && variablesLimitInfo.isExceeded); |
| 17029 |
(0, react.useEffect)(function() { |
| 17030 |
if (showMediaFormatValidation && !isImport) setActiveDialog("content"); |
| 17031 |
}, [showMediaFormatValidation, isImport]); |
| 17032 |
var isSiteSettingsExported = function isSiteSettingsExported() { |
| 17033 |
var _contextData$data6; |
| 17034 |
var siteSettings = contextData === null || contextData === void 0 || (_contextData$data6 = contextData.data) === null || _contextData$data6 === void 0 || (_contextData$data6 = _contextData$data6.uploadedData) === null || _contextData$data6 === void 0 || (_contextData$data6 = _contextData$data6.manifest) === null || _contextData$data6 === void 0 ? void 0 : _contextData$data6["site-settings"]; |
| 17035 |
if (!siteSettings) return false; |
| 17036 |
return Object.values(siteSettings).some(Boolean); |
| 17037 |
}; |
| 17038 |
var isContentSettingsExported = function isContentSettingsExported() { |
| 17039 |
var _contextData$data7; |
| 17040 |
var _contextData$data8; |
| 17041 |
var _contextData$data9; |
| 17042 |
var _contextData$data0; |
| 17043 |
var taxonomies = contextData === null || contextData === void 0 || (_contextData$data7 = contextData.data) === null || _contextData$data7 === void 0 || (_contextData$data7 = _contextData$data7.uploadedData) === null || _contextData$data7 === void 0 || (_contextData$data7 = _contextData$data7.manifest) === null || _contextData$data7 === void 0 ? void 0 : _contextData$data7.taxonomies; |
| 17044 |
var content = contextData === null || contextData === void 0 || (_contextData$data8 = contextData.data) === null || _contextData$data8 === void 0 || (_contextData$data8 = _contextData$data8.uploadedData) === null || _contextData$data8 === void 0 || (_contextData$data8 = _contextData$data8.manifest) === null || _contextData$data8 === void 0 ? void 0 : _contextData$data8.content; |
| 17045 |
var wpContent = contextData === null || contextData === void 0 || (_contextData$data9 = contextData.data) === null || _contextData$data9 === void 0 || (_contextData$data9 = _contextData$data9.uploadedData) === null || _contextData$data9 === void 0 || (_contextData$data9 = _contextData$data9.manifest) === null || _contextData$data9 === void 0 ? void 0 : _contextData$data9["wp-content"]; |
| 17046 |
var customPostTypes = contextData === null || contextData === void 0 || (_contextData$data0 = contextData.data) === null || _contextData$data0 === void 0 || (_contextData$data0 = _contextData$data0.uploadedData) === null || _contextData$data0 === void 0 || (_contextData$data0 = _contextData$data0.manifest) === null || _contextData$data0 === void 0 ? void 0 : _contextData$data0["custom-post-type-title"]; |
| 17047 |
return taxonomies || content || wpContent || customPostTypes; |
| 17048 |
}; |
| 17049 |
var isExported = function isExported(item) { |
| 17050 |
var _contextData$data1; |
| 17051 |
switch (item.type) { |
| 17052 |
case "settings": return isSiteSettingsExported(); |
| 17053 |
case "content": return isContentSettingsExported(); |
| 17054 |
default: return contextData === null || contextData === void 0 || (_contextData$data1 = contextData.data) === null || _contextData$data1 === void 0 || (_contextData$data1 = _contextData$data1.uploadedData) === null || _contextData$data1 === void 0 || (_contextData$data1 = _contextData$data1.manifest) === null || _contextData$data1 === void 0 ? void 0 : _contextData$data1[item.type]; |
| 17055 |
} |
| 17056 |
}; |
| 17057 |
var isDisabled = function isDisabled(item) { |
| 17058 |
var _item$data$features; |
| 17059 |
var _contextData$data10; |
| 17060 |
if ((_item$data$features = item.data.features) !== null && _item$data$features !== void 0 && _item$data$features.locked && !elementorAppConfig.hasPro) return true; |
| 17061 |
if (isImport) return !isExported(item) || item.required; |
| 17062 |
return item.required && (contextData === null || contextData === void 0 || (_contextData$data10 = contextData.data) === null || _contextData$data10 === void 0 || (_contextData$data10 = _contextData$data10.includes) === null || _contextData$data10 === void 0 ? void 0 : _contextData$data10.includes(item.type)); |
| 17063 |
}; |
| 17064 |
var isEditDisabled = function isEditDisabled(item) { |
| 17065 |
if (isImport) { |
| 17066 |
var _contextData$data11; |
| 17067 |
var manifestKey = "settings" === item.type ? "site-settings" : item.type; |
| 17068 |
return !(contextData !== null && contextData !== void 0 && (_contextData$data11 = contextData.data) !== null && _contextData$data11 !== void 0 && (_contextData$data11 = _contextData$data11.uploadedData) !== null && _contextData$data11 !== void 0 && (_contextData$data11 = _contextData$data11.manifest) !== null && _contextData$data11 !== void 0 && _contextData$data11[manifestKey]); |
| 17069 |
} |
| 17070 |
return false; |
| 17071 |
}; |
| 17072 |
var getDialogComponent = function getDialogComponent(item) { |
| 17073 |
var _window$elementorModu; |
| 17074 |
var _reg$get; |
| 17075 |
var reg = (_window$elementorModu = window.elementorModules) === null || _window$elementorModu === void 0 || (_window$elementorModu = _window$elementorModu.importExport) === null || _window$elementorModu === void 0 ? void 0 : _window$elementorModu.customizationDialogsRegistry; |
| 17076 |
var registered = reg === null || reg === void 0 || (_reg$get = reg.get) === null || _reg$get === void 0 ? void 0 : _reg$get.call(reg, item.type); |
| 17077 |
return (registered === null || registered === void 0 ? void 0 : registered.component) || item.dialog; |
| 17078 |
}; |
| 17079 |
var renderFeatureDescription = function renderFeatureDescription(item, isLockedFeaturesNoPro) { |
| 17080 |
var _item$data$features2; |
| 17081 |
var _item$data$features3; |
| 17082 |
var _item$data$features4; |
| 17083 |
var featuresText = [ |
| 17084 |
item.data.features.open.join(", "), |
| 17085 |
((_item$data$features2 = item.data.features) === null || _item$data$features2 === void 0 || (_item$data$features2 = _item$data$features2.locked) === null || _item$data$features2 === void 0 ? void 0 : _item$data$features2.length) > 0 && item.data.features.open.length > 0 ? ", " : "", |
| 17086 |
(_item$data$features3 = item.data.features) === null || _item$data$features3 === void 0 || (_item$data$features3 = _item$data$features3.locked) === null || _item$data$features3 === void 0 ? void 0 : _item$data$features3.join(", ") |
| 17087 |
].join(""); |
| 17088 |
var description = /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17089 |
variant: "body2", |
| 17090 |
color: "text.secondary", |
| 17091 |
sx: { |
| 17092 |
mt: 1, |
| 17093 |
ml: 4 |
| 17094 |
} |
| 17095 |
}, featuresText); |
| 17096 |
return isLockedFeaturesNoPro ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Tooltip, { |
| 17097 |
title: ((_item$data$features4 = item.data.features) === null || _item$data$features4 === void 0 ? void 0 : _item$data$features4.tooltip) || (0, _wordpress_i18n.__)("This feature requires Elementor Pro", "elementor"), |
| 17098 |
arrow: true, |
| 17099 |
placement: "top" |
| 17100 |
}, description) : description; |
| 17101 |
}; |
| 17102 |
var renderCheckboxControl = function renderCheckboxControl(item, disabled) { |
| 17103 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.FormControlLabel, { |
| 17104 |
control: /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { |
| 17105 |
color: "info", |
| 17106 |
checked: data.includes.includes(item.type), |
| 17107 |
onChange: function onChange() { |
| 17108 |
return onCheckboxChange(item.type); |
| 17109 |
}, |
| 17110 |
disabled, |
| 17111 |
sx: { |
| 17112 |
p: 0, |
| 17113 |
mx: 1 |
| 17114 |
}, |
| 17115 |
"data-testid": "KitContentDataSelection-".concat(item.type), |
| 17116 |
"data-type": item.type |
| 17117 |
}), |
| 17118 |
label: /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17119 |
color: "text.primary", |
| 17120 |
variant: "body1", |
| 17121 |
sx: { fontWeight: 500 } |
| 17122 |
}, item.data.title), |
| 17123 |
sx: { "& .MuiFormControlLabel-label.Mui-disabled": { color: "text.primary" } } |
| 17124 |
}); |
| 17125 |
}; |
| 17126 |
var getSectionEditButton = function getSectionEditButton(item, isLockedFeaturesNoPro) { |
| 17127 |
if (isLockedFeaturesNoPro) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17128 |
variant: "contained", |
| 17129 |
color: "promotion", |
| 17130 |
onClick: function onClick() { |
| 17131 |
AppsEventTracking.sendKitsCloudUpgradeClicked(item.type); |
| 17132 |
window.open("https://go.elementor.com/go-pro-import-export", "_blank"); |
| 17133 |
}, |
| 17134 |
startIcon: /*#__PURE__*/ react.default.createElement("span", { className: "eicon-upgrade-crown" }), |
| 17135 |
sx: { alignSelf: "center" }, |
| 17136 |
"data-type": item.type, |
| 17137 |
disabled: isEditDisabled(item) |
| 17138 |
}, (0, _wordpress_i18n.__)("Upgrade", "elementor")); |
| 17139 |
if (!isImport) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17140 |
color: "secondary", |
| 17141 |
onClick: function onClick() { |
| 17142 |
return setActiveDialog(item.type); |
| 17143 |
}, |
| 17144 |
sx: { alignSelf: "center" }, |
| 17145 |
"data-type": item.type, |
| 17146 |
disabled: isEditDisabled(item) |
| 17147 |
}, (0, _wordpress_i18n.__)("Edit", "elementor")); |
| 17148 |
return isExported(item) ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17149 |
color: "secondary", |
| 17150 |
onClick: function onClick() { |
| 17151 |
return setActiveDialog(item.type); |
| 17152 |
}, |
| 17153 |
sx: { alignSelf: "center" }, |
| 17154 |
"data-type": item.type, |
| 17155 |
disabled: isEditDisabled(item) |
| 17156 |
}, (0, _wordpress_i18n.__)("Edit", "elementor")) : /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17157 |
variant: "body1", |
| 17158 |
color: "text.disabled", |
| 17159 |
sx: { alignSelf: "center" } |
| 17160 |
}, (0, _wordpress_i18n.__)("Not exported", "elementor")); |
| 17161 |
}; |
| 17162 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 17163 |
spacing: 2, |
| 17164 |
"data-testid": testId |
| 17165 |
}, (contextData === null || contextData === void 0 ? void 0 : contextData.isOldExport) && /*#__PURE__*/ react.default.createElement(ReExportBanner, null), (contextData === null || contextData === void 0 ? void 0 : contextData.isOldElementorVersion) && /*#__PURE__*/ react.default.createElement(UpgradeVersionBanner, null), kitContentData.map(function(item) { |
| 17166 |
var _item$data$features5; |
| 17167 |
var isLockedFeaturesNoPro = ((_item$data$features5 = item.data.features) === null || _item$data$features5 === void 0 ? void 0 : _item$data$features5.locked) && !elementorAppConfig.hasPro; |
| 17168 |
var disabled = isDisabled(item); |
| 17169 |
var DialogComponent = getDialogComponent(item); |
| 17170 |
return /*#__PURE__*/ react.default.createElement(react.Fragment, { key: item.type }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 17171 |
"data-testid": "KitPartsSelectionRow-".concat(item.type), |
| 17172 |
key: item.type, |
| 17173 |
sx: { |
| 17174 |
mb: 3, |
| 17175 |
border: 1, |
| 17176 |
borderRadius: 1, |
| 17177 |
borderColor: "action.focus", |
| 17178 |
p: 2.5 |
| 17179 |
} |
| 17180 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 17181 |
display: "flex", |
| 17182 |
justifyContent: "space-between", |
| 17183 |
alignItems: "flex-start" |
| 17184 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 17185 |
flex: 1, |
| 17186 |
opacity: isLockedFeaturesNoPro ? .5 : 1 |
| 17187 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 17188 |
display: "flex", |
| 17189 |
alignItems: "center" |
| 17190 |
} }, renderCheckboxControl(item, disabled), "settings" === item.type && hasSettingsLimitWarning && /*#__PURE__*/ react.default.createElement(_elementor_ui.Tooltip, { |
| 17191 |
title: (0, _wordpress_i18n.__)("Limit exceeded. Click 'Edit' to review conflicts or override existing items", "elementor"), |
| 17192 |
placement: "top", |
| 17193 |
arrow: true |
| 17194 |
}, /*#__PURE__*/ react.default.createElement(_elementor_icons.AlertTriangleFilledIcon, { |
| 17195 |
sx: { |
| 17196 |
fontSize: 20, |
| 17197 |
color: "warning.main", |
| 17198 |
ml: .5 |
| 17199 |
}, |
| 17200 |
"aria-hidden": true |
| 17201 |
}))), renderFeatureDescription(item, isLockedFeaturesNoPro)), getSectionEditButton(item, isLockedFeaturesNoPro))), DialogComponent && /*#__PURE__*/ react.default.createElement(DialogComponent, { |
| 17202 |
open: activeDialog === item.type, |
| 17203 |
handleClose: function handleClose() { |
| 17204 |
return setActiveDialog(null); |
| 17205 |
}, |
| 17206 |
data, |
| 17207 |
handleSaveChanges: handleSaveCustomization, |
| 17208 |
isImport, |
| 17209 |
isOldExport: contextData.isOldExport, |
| 17210 |
isOldElementorVersion: contextData.isOldElementorVersion, |
| 17211 |
isCloudKitsEligible, |
| 17212 |
showMediaFormatValidation |
| 17213 |
})); |
| 17214 |
})); |
| 17215 |
} |
| 17216 |
KitPartsSelection.propTypes = { |
| 17217 |
onCheckboxChange: import_prop_types$55.default.func.isRequired, |
| 17218 |
testId: import_prop_types$55.default.string, |
| 17219 |
handleSaveCustomization: import_prop_types$55.default.func.isRequired, |
| 17220 |
isCloudKitsEligible: import_prop_types$55.default.bool, |
| 17221 |
showMediaFormatValidation: import_prop_types$55.default.bool |
| 17222 |
}; |
| 17223 |
|
| 17224 |
//#endregion |
| 17225 |
//#region app/modules/import-export-customization/assets/js/shared/components/complete-icon.js |
| 17226 |
function CompleteIcon(_ref) { |
| 17227 |
var imageSrc = _ref.imageSrc; |
| 17228 |
var altText = _ref.altText; |
| 17229 |
var _ref$width = _ref.width; |
| 17230 |
var width = _ref$width === void 0 ? "200px" : _ref$width; |
| 17231 |
var _ref$marginBottom = _ref.marginBottom; |
| 17232 |
var marginBottom = _ref$marginBottom === void 0 ? 2 : _ref$marginBottom; |
| 17233 |
var _ref$testId = _ref.testId; |
| 17234 |
var testId = _ref$testId === void 0 ? "complete-icon" : _ref$testId; |
| 17235 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 17236 |
sx: { mb: marginBottom }, |
| 17237 |
"data-testid": testId |
| 17238 |
}, /*#__PURE__*/ react.default.createElement("img", { |
| 17239 |
src: imageSrc, |
| 17240 |
alt: altText, |
| 17241 |
style: { width } |
| 17242 |
})); |
| 17243 |
} |
| 17244 |
CompleteIcon.propTypes = { |
| 17245 |
imageSrc: import_prop_types$55.default.string.isRequired, |
| 17246 |
altText: import_prop_types$55.default.string.isRequired, |
| 17247 |
width: import_prop_types$55.default.string, |
| 17248 |
marginBottom: import_prop_types$55.default.number, |
| 17249 |
testId: import_prop_types$55.default.string |
| 17250 |
}; |
| 17251 |
|
| 17252 |
//#endregion |
| 17253 |
//#region app/modules/import-export-customization/assets/js/shared/components/complete-heading.js |
| 17254 |
function CompleteHeading(_ref) { |
| 17255 |
var title = _ref.title; |
| 17256 |
var subtitle = _ref.subtitle; |
| 17257 |
var linkText = _ref.linkText; |
| 17258 |
var linkHref = _ref.linkHref; |
| 17259 |
var linkOnClick = _ref.linkOnClick; |
| 17260 |
var _ref$testId = _ref.testId; |
| 17261 |
var testId = _ref$testId === void 0 ? "complete-heading" : _ref$testId; |
| 17262 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { "data-testid": testId }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17263 |
variant: "h4", |
| 17264 |
color: "text.primary", |
| 17265 |
component: "h2", |
| 17266 |
gutterBottom: true |
| 17267 |
}, title), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17268 |
variant: "body1", |
| 17269 |
color: "text.secondary", |
| 17270 |
sx: { mb: 3 } |
| 17271 |
}, subtitle, linkText && linkHref && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 17272 |
href: linkHref, |
| 17273 |
onClick: linkOnClick, |
| 17274 |
sx: { |
| 17275 |
cursor: "pointer", |
| 17276 |
textDecoration: "underline" |
| 17277 |
}, |
| 17278 |
color: "info.light" |
| 17279 |
}, linkText)))); |
| 17280 |
} |
| 17281 |
CompleteHeading.propTypes = { |
| 17282 |
title: import_prop_types$55.default.string.isRequired, |
| 17283 |
subtitle: import_prop_types$55.default.string.isRequired, |
| 17284 |
linkText: import_prop_types$55.default.string, |
| 17285 |
linkHref: import_prop_types$55.default.string, |
| 17286 |
linkOnClick: import_prop_types$55.default.func, |
| 17287 |
testId: import_prop_types$55.default.string |
| 17288 |
}; |
| 17289 |
|
| 17290 |
//#endregion |
| 17291 |
//#region app/modules/import-export-customization/assets/js/shared/components/summary-section.js |
| 17292 |
function SummarySection(_ref) { |
| 17293 |
var title = _ref.title; |
| 17294 |
var subTitle = _ref.subTitle; |
| 17295 |
var sectionKey = _ref.sectionKey; |
| 17296 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { "data-testid": "summary_section_".concat(sectionKey) }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 17297 |
direction: "row", |
| 17298 |
alignItems: "center", |
| 17299 |
spacing: 1 |
| 17300 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17301 |
variant: "body2", |
| 17302 |
color: "text.primary" |
| 17303 |
}, title)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17304 |
variant: "body2", |
| 17305 |
color: "text.tertiary", |
| 17306 |
"data-testid": "summary_section_".concat(sectionKey, "_subtitle") |
| 17307 |
}, subTitle)); |
| 17308 |
} |
| 17309 |
SummarySection.propTypes = { |
| 17310 |
title: import_prop_types$55.default.string.isRequired, |
| 17311 |
subTitle: import_prop_types$55.default.string.isRequired, |
| 17312 |
sectionKey: import_prop_types$55.default.string.isRequired |
| 17313 |
}; |
| 17314 |
|
| 17315 |
//#endregion |
| 17316 |
//#region app/modules/import-export-customization/assets/js/shared/components/complete-summary.js |
| 17317 |
init_slicedToArray(); |
| 17318 |
function CompleteSummary(_ref) { |
| 17319 |
var summaryData = _ref.summaryData; |
| 17320 |
var _ref$testId = _ref.testId; |
| 17321 |
var testId = _ref$testId === void 0 ? "complete-summary" : _ref$testId; |
| 17322 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 17323 |
sx: { |
| 17324 |
width: "100%", |
| 17325 |
border: 1, |
| 17326 |
borderRadius: 1, |
| 17327 |
borderColor: "action.focus", |
| 17328 |
p: 2.5, |
| 17329 |
textAlign: "start" |
| 17330 |
}, |
| 17331 |
"data-testid": testId |
| 17332 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17333 |
variant: "subtitle1", |
| 17334 |
color: "text.primary", |
| 17335 |
sx: { mb: 2 } |
| 17336 |
}, (0, _wordpress_i18n.__)("What's included:", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 17337 |
spacing: 2, |
| 17338 |
sx: { maxWidth: "1075px" } |
| 17339 |
}, Object.entries(summaryData).map(function(_ref2) { |
| 17340 |
var _ref3 = _slicedToArray(_ref2, 2); |
| 17341 |
var sectionKey = _ref3[0]; |
| 17342 |
var sectionValue = _ref3[1]; |
| 17343 |
return sectionValue ? /*#__PURE__*/ react.default.createElement(SummarySection, { |
| 17344 |
key: sectionKey, |
| 17345 |
sectionKey, |
| 17346 |
title: sectionValue.title, |
| 17347 |
subTitle: sectionValue.subTitle |
| 17348 |
}) : null; |
| 17349 |
}))); |
| 17350 |
} |
| 17351 |
CompleteSummary.propTypes = { |
| 17352 |
summaryData: import_prop_types$55.default.objectOf(import_prop_types$55.default.shape({ |
| 17353 |
title: import_prop_types$55.default.string.isRequired, |
| 17354 |
subTitle: import_prop_types$55.default.string.isRequired |
| 17355 |
})).isRequired, |
| 17356 |
testId: import_prop_types$55.default.string |
| 17357 |
}; |
| 17358 |
|
| 17359 |
//#endregion |
| 17360 |
//#region app/modules/import-export-customization/assets/js/shared/components/download-link.js |
| 17361 |
function DownloadLink$1(_ref) { |
| 17362 |
var message = _ref.message; |
| 17363 |
var linkText = _ref.linkText; |
| 17364 |
var onClick = _ref.onClick; |
| 17365 |
var _ref$testId = _ref.testId; |
| 17366 |
var testId = _ref$testId === void 0 ? "download-link" : _ref$testId; |
| 17367 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17368 |
variant: "body2", |
| 17369 |
color: "text.secondary", |
| 17370 |
"data-testid": testId |
| 17371 |
}, message, " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 17372 |
href: "#", |
| 17373 |
onClick, |
| 17374 |
color: "info.light", |
| 17375 |
sx: { |
| 17376 |
cursor: "pointer", |
| 17377 |
textDecoration: "underline" |
| 17378 |
} |
| 17379 |
}, linkText), ". "); |
| 17380 |
} |
| 17381 |
__name(DownloadLink$1, "DownloadLink"); |
| 17382 |
DownloadLink$1.propTypes = { |
| 17383 |
message: import_prop_types$55.default.string.isRequired, |
| 17384 |
linkText: import_prop_types$55.default.string.isRequired, |
| 17385 |
onClick: import_prop_types$55.default.func.isRequired, |
| 17386 |
testId: import_prop_types$55.default.string |
| 17387 |
}; |
| 17388 |
|
| 17389 |
//#endregion |
| 17390 |
//#region app/modules/import-export-customization/assets/js/export/components/export-intro.js |
| 17391 |
function ExportIntro() { |
| 17392 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { mb: 4 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17393 |
variant: "h4", |
| 17394 |
component: "h2", |
| 17395 |
gutterBottom: true, |
| 17396 |
color: "text.primary" |
| 17397 |
}, (0, _wordpress_i18n.__)("Export a Website template?", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17398 |
variant: "subtitle1", |
| 17399 |
color: "text.secondary" |
| 17400 |
}, (0, _wordpress_i18n.__)("Choose which Elementor components - templates, content and site settings - to include in your website templates file. By default, all of your components will be exported.", "elementor"), " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 17401 |
href: "https://go.elementor.com/app-what-are-kits", |
| 17402 |
color: "info.light", |
| 17403 |
target: "_blank", |
| 17404 |
rel: "noopener noreferrer" |
| 17405 |
}, (0, _wordpress_i18n.__)("Learn more", "elementor")))); |
| 17406 |
} |
| 17407 |
|
| 17408 |
//#endregion |
| 17409 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-connect-state.js |
| 17410 |
init_slicedToArray(); |
| 17411 |
function useConnectState$1() { |
| 17412 |
var _useState2 = _slicedToArray((0, react.useState)(elementorCommon.config.library_connect.is_connected), 2); |
| 17413 |
var isConnected = _useState2[0]; |
| 17414 |
var setIsConnected = _useState2[1]; |
| 17415 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 17416 |
var isConnecting = _useState4[0]; |
| 17417 |
var setIsConnecting = _useState4[1]; |
| 17418 |
var handleConnectSuccess = (0, react.useCallback)(function(callback) { |
| 17419 |
setIsConnecting(true); |
| 17420 |
setIsConnected(true); |
| 17421 |
elementorCommon.config.library_connect.is_connected = true; |
| 17422 |
if (callback) callback(); |
| 17423 |
}, []); |
| 17424 |
var handleConnectError = (0, react.useCallback)(function(callback) { |
| 17425 |
setIsConnected(false); |
| 17426 |
setIsConnecting(false); |
| 17427 |
elementorCommon.config.library_connect.is_connected = false; |
| 17428 |
if (callback) callback(); |
| 17429 |
}, []); |
| 17430 |
return { |
| 17431 |
isConnected, |
| 17432 |
isConnecting, |
| 17433 |
setConnecting: (0, react.useCallback)(function(connecting) { |
| 17434 |
setIsConnecting(connecting); |
| 17435 |
}, []), |
| 17436 |
handleConnectSuccess, |
| 17437 |
handleConnectError |
| 17438 |
}; |
| 17439 |
} |
| 17440 |
__name(useConnectState$1, "useConnectState"); |
| 17441 |
|
| 17442 |
//#endregion |
| 17443 |
//#region app/modules/import-export-customization/assets/js/export/components/export-kit-footer.js |
| 17444 |
init_es$1(); |
| 17445 |
init_use_cloud_kits_eligibility(); |
| 17446 |
init_apps_event_tracking(); |
| 17447 |
function ExportKitFooter() { |
| 17448 |
var connectButtonRef = (0, react.useRef)(); |
| 17449 |
var navigate = useNavigate(); |
| 17450 |
var _useConnectState = useConnectState$1(); |
| 17451 |
var isConnected = _useConnectState.isConnected; |
| 17452 |
var isConnecting = _useConnectState.isConnecting; |
| 17453 |
var setConnecting = _useConnectState.setConnecting; |
| 17454 |
var handleConnectSuccess = _useConnectState.handleConnectSuccess; |
| 17455 |
var handleConnectError = _useConnectState.handleConnectError; |
| 17456 |
var _useExportContext = useExportContext(); |
| 17457 |
var data = _useExportContext.data; |
| 17458 |
var dispatch = _useExportContext.dispatch; |
| 17459 |
var hasValidationErrors = _useExportContext.hasValidationErrors; |
| 17460 |
var isExporting = _useExportContext.isExporting; |
| 17461 |
var _useCloudKitsEligibil = useCloudKitsEligibility({ enabled: isConnected }); |
| 17462 |
var cloudKitsData = _useCloudKitsEligibil.data; |
| 17463 |
var isCheckingEligibility = _useCloudKitsEligibil.isLoading; |
| 17464 |
var refetchEligibility = _useCloudKitsEligibil.refetch; |
| 17465 |
var isCloudKitsEligible = (cloudKitsData === null || cloudKitsData === void 0 ? void 0 : cloudKitsData.is_eligible) || false; |
| 17466 |
(0, react.useEffect)(function() { |
| 17467 |
if (!connectButtonRef.current) return; |
| 17468 |
jQuery(connectButtonRef.current).elementorConnect({ |
| 17469 |
popup: { |
| 17470 |
width: 600, |
| 17471 |
height: 700 |
| 17472 |
}, |
| 17473 |
success: function success() { |
| 17474 |
handleConnectSuccess(); |
| 17475 |
setConnecting(true); |
| 17476 |
refetchEligibility(); |
| 17477 |
}, |
| 17478 |
error: function error() { |
| 17479 |
handleConnectError(); |
| 17480 |
} |
| 17481 |
}); |
| 17482 |
}, [ |
| 17483 |
handleConnectSuccess, |
| 17484 |
handleConnectError, |
| 17485 |
setConnecting, |
| 17486 |
refetchEligibility |
| 17487 |
]); |
| 17488 |
(0, react.useEffect)(function() { |
| 17489 |
if (!isConnecting || isCheckingEligibility) return; |
| 17490 |
if (!isCloudKitsEligible) navigate("/kit-library/cloud"); |
| 17491 |
else { |
| 17492 |
dispatch({ |
| 17493 |
type: "SET_KIT_SAVE_SOURCE", |
| 17494 |
payload: "cloud" |
| 17495 |
}); |
| 17496 |
dispatch({ |
| 17497 |
type: "SET_EXPORT_STATUS", |
| 17498 |
payload: EXPORT_STATUS.EXPORTING |
| 17499 |
}); |
| 17500 |
} |
| 17501 |
}, [ |
| 17502 |
isConnecting, |
| 17503 |
isCheckingEligibility, |
| 17504 |
isCloudKitsEligible, |
| 17505 |
dispatch |
| 17506 |
]); |
| 17507 |
(0, react.useEffect)(function() { |
| 17508 |
if (isConnecting && !isCheckingEligibility) setConnecting(false); |
| 17509 |
}, [ |
| 17510 |
isConnecting, |
| 17511 |
isCheckingEligibility, |
| 17512 |
setConnecting |
| 17513 |
]); |
| 17514 |
(0, react.useEffect)(function() { |
| 17515 |
if (isExporting) navigate("/export-customization/process"); |
| 17516 |
}, [isExporting, navigate]); |
| 17517 |
var handleUpgradeClick = function handleUpgradeClick() { |
| 17518 |
AppsEventTracking.sendKitsCloudUpgradeClicked(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitExportCustomization); |
| 17519 |
navigate("/kit-library/cloud"); |
| 17520 |
}; |
| 17521 |
var handleUploadClick = function handleUploadClick() { |
| 17522 |
if (hasValidationErrors) return; |
| 17523 |
dispatch({ |
| 17524 |
type: "SET_KIT_SAVE_SOURCE", |
| 17525 |
payload: "cloud" |
| 17526 |
}); |
| 17527 |
dispatch({ |
| 17528 |
type: "SET_EXPORT_STATUS", |
| 17529 |
payload: EXPORT_STATUS.EXPORTING |
| 17530 |
}); |
| 17531 |
}; |
| 17532 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 17533 |
direction: "row", |
| 17534 |
spacing: 1 |
| 17535 |
}, function renderSaveToLibraryButton() { |
| 17536 |
if (!isConnected) { |
| 17537 |
var _elementorAppConfig; |
| 17538 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17539 |
ref: connectButtonRef, |
| 17540 |
variant: "outlined", |
| 17541 |
color: "secondary", |
| 17542 |
size: "small", |
| 17543 |
disabled: hasValidationErrors, |
| 17544 |
href: ((_elementorAppConfig = elementorAppConfig) === null || _elementorAppConfig === void 0 || (_elementorAppConfig = _elementorAppConfig["cloud-library"]) === null || _elementorAppConfig === void 0 || (_elementorAppConfig = _elementorAppConfig.library_connect_url) === null || _elementorAppConfig === void 0 ? void 0 : _elementorAppConfig.replace(/&/g, "&")) || "#", |
| 17545 |
"data-testid": "export-kit-footer-save-to-library-button" |
| 17546 |
}, (0, _wordpress_i18n.__)("Save to library", "elementor")); |
| 17547 |
} |
| 17548 |
if (isConnecting || isCheckingEligibility) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17549 |
variant: "outlined", |
| 17550 |
color: "secondary", |
| 17551 |
size: "small", |
| 17552 |
disabled: true, |
| 17553 |
startIcon: /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { size: 16 }), |
| 17554 |
"data-testid": "export-kit-footer-save-to-library-button" |
| 17555 |
}, (0, _wordpress_i18n.__)("Save to library", "elementor")); |
| 17556 |
if (!isCloudKitsEligible) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17557 |
variant: "outlined", |
| 17558 |
color: "secondary", |
| 17559 |
size: "small", |
| 17560 |
disabled: hasValidationErrors, |
| 17561 |
onClick: handleUpgradeClick, |
| 17562 |
"data-testid": "export-kit-footer-save-to-library-button" |
| 17563 |
}, (0, _wordpress_i18n.__)("Save to library", "elementor")); |
| 17564 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17565 |
variant: "outlined", |
| 17566 |
color: "secondary", |
| 17567 |
size: "small", |
| 17568 |
disabled: hasValidationErrors, |
| 17569 |
onClick: handleUploadClick, |
| 17570 |
"data-testid": "export-kit-footer-save-to-library-button" |
| 17571 |
}, (0, _wordpress_i18n.__)("Save to library", "elementor")); |
| 17572 |
}(), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 17573 |
variant: "contained", |
| 17574 |
color: "primary", |
| 17575 |
size: "small", |
| 17576 |
disabled: hasValidationErrors, |
| 17577 |
onClick: function handleExportAsZip() { |
| 17578 |
var _data$customization; |
| 17579 |
if (hasValidationErrors) return; |
| 17580 |
if ("cloud" === ((_data$customization = data.customization) === null || _data$customization === void 0 || (_data$customization = _data$customization.content) === null || _data$customization === void 0 ? void 0 : _data$customization.mediaFormat)) { |
| 17581 |
dispatch({ |
| 17582 |
type: "SET_MEDIA_FORMAT_VALIDATION", |
| 17583 |
payload: true |
| 17584 |
}); |
| 17585 |
return; |
| 17586 |
} |
| 17587 |
dispatch({ |
| 17588 |
type: "SET_KIT_SAVE_SOURCE", |
| 17589 |
payload: "file" |
| 17590 |
}); |
| 17591 |
dispatch({ |
| 17592 |
type: "SET_EXPORT_STATUS", |
| 17593 |
payload: EXPORT_STATUS.EXPORTING |
| 17594 |
}); |
| 17595 |
}, |
| 17596 |
"data-testid": "export-kit-footer-export-zip-button" |
| 17597 |
}, (0, _wordpress_i18n.__)("Export as .zip", "elementor"))); |
| 17598 |
} |
| 17599 |
|
| 17600 |
//#endregion |
| 17601 |
//#region app/modules/import-export-customization/assets/js/export/components/export-kit-parts-selection.js |
| 17602 |
init_use_cloud_kits_eligibility(); |
| 17603 |
function ExportKitPartsSelection() { |
| 17604 |
var _useExportContext = useExportContext(); |
| 17605 |
var data = _useExportContext.data; |
| 17606 |
var dispatch = _useExportContext.dispatch; |
| 17607 |
var cloudKitsData = useCloudKitsEligibility().data; |
| 17608 |
var isCloudKitsEligible = (cloudKitsData === null || cloudKitsData === void 0 ? void 0 : cloudKitsData.is_eligible) || false; |
| 17609 |
return /*#__PURE__*/ react.default.createElement(KitPartsSelection, { |
| 17610 |
onCheckboxChange: function handleCheckboxChange(itemType) { |
| 17611 |
var isChecked = data.includes.includes(itemType); |
| 17612 |
var kitItem = kitContentData.find(function(item) { |
| 17613 |
return item.type === itemType; |
| 17614 |
}); |
| 17615 |
if (isChecked && kitItem !== null && kitItem !== void 0 && kitItem.required) return; |
| 17616 |
dispatch({ |
| 17617 |
type: isChecked ? "REMOVE_INCLUDE" : "ADD_INCLUDE", |
| 17618 |
payload: itemType |
| 17619 |
}); |
| 17620 |
}, |
| 17621 |
handleSaveCustomization: function handleSaveCustomization(key, payload, hasEnabledCustomization, excludedValues) { |
| 17622 |
dispatch({ |
| 17623 |
type: "SET_CUSTOMIZATION", |
| 17624 |
payload: { |
| 17625 |
key, |
| 17626 |
value: payload |
| 17627 |
} |
| 17628 |
}); |
| 17629 |
dispatch({ |
| 17630 |
type: "SET_DATA_FOR_ANALYTICS", |
| 17631 |
payload: { |
| 17632 |
key, |
| 17633 |
value: excludedValues |
| 17634 |
} |
| 17635 |
}); |
| 17636 |
if (hasEnabledCustomization) dispatch({ |
| 17637 |
type: "ADD_INCLUDE", |
| 17638 |
payload: key |
| 17639 |
}); |
| 17640 |
else dispatch({ |
| 17641 |
type: "REMOVE_INCLUDE", |
| 17642 |
payload: key |
| 17643 |
}); |
| 17644 |
if (data.showMediaFormatValidation) dispatch({ |
| 17645 |
type: "SET_MEDIA_FORMAT_VALIDATION", |
| 17646 |
payload: false |
| 17647 |
}); |
| 17648 |
}, |
| 17649 |
isCloudKitsEligible, |
| 17650 |
showMediaFormatValidation: data.showMediaFormatValidation |
| 17651 |
}); |
| 17652 |
} |
| 17653 |
|
| 17654 |
//#endregion |
| 17655 |
//#region app/modules/import-export-customization/assets/js/export/hooks/use-kit-validation.js |
| 17656 |
init_slicedToArray(); |
| 17657 |
function useKitValidation() { |
| 17658 |
var _useExportContext = useExportContext(); |
| 17659 |
var data = _useExportContext.data; |
| 17660 |
var dispatch = _useExportContext.dispatch; |
| 17661 |
var _useState2 = _slicedToArray((0, react.useState)(null), 2); |
| 17662 |
var nameError = _useState2[0]; |
| 17663 |
var setNameError = _useState2[1]; |
| 17664 |
var DESCRIPTION_MAX_LENGTH = 300; |
| 17665 |
var validateKitName = function validateKitName(value) { |
| 17666 |
if (!value || 0 === value.trim().length) return (0, _wordpress_i18n.__)("Must add a website template name", "elementor"); |
| 17667 |
if (/[^\w\s\-_.()]/g.test(value)) return (0, _wordpress_i18n.__)("Use characters only", "elementor"); |
| 17668 |
return null; |
| 17669 |
}; |
| 17670 |
var validateDescription = function validateDescription(value) { |
| 17671 |
if (value.length > DESCRIPTION_MAX_LENGTH) return (0, _wordpress_i18n.__)("Description exceeds 300 characters", "elementor"); |
| 17672 |
return null; |
| 17673 |
}; |
| 17674 |
var templateName = data.kitInfo.title || ""; |
| 17675 |
var description = data.kitInfo.description || ""; |
| 17676 |
var hasDescriptionError = description.length > DESCRIPTION_MAX_LENGTH; |
| 17677 |
var descriptionCounterColor = hasDescriptionError ? "error" : "text.secondary"; |
| 17678 |
(0, react.useEffect)(function() { |
| 17679 |
var nameValidationError = validateKitName(templateName); |
| 17680 |
var descriptionValidationError = validateDescription(description); |
| 17681 |
setNameError(nameValidationError); |
| 17682 |
dispatch({ |
| 17683 |
type: "SET_VALIDATION_ERRORS", |
| 17684 |
payload: { |
| 17685 |
name: nameValidationError, |
| 17686 |
description: descriptionValidationError |
| 17687 |
} |
| 17688 |
}); |
| 17689 |
}, [ |
| 17690 |
templateName, |
| 17691 |
description, |
| 17692 |
dispatch |
| 17693 |
]); |
| 17694 |
return { |
| 17695 |
templateName, |
| 17696 |
description, |
| 17697 |
nameError, |
| 17698 |
hasDescriptionError, |
| 17699 |
descriptionCounterColor, |
| 17700 |
handleNameChange: function handleNameChange(e) { |
| 17701 |
dispatch({ |
| 17702 |
type: "SET_KIT_TITLE", |
| 17703 |
payload: e.target.value || "" |
| 17704 |
}); |
| 17705 |
}, |
| 17706 |
handleDescriptionChange: function handleDescriptionChange(e) { |
| 17707 |
var value = e.target.value || ""; |
| 17708 |
if (value.length <= DESCRIPTION_MAX_LENGTH) dispatch({ |
| 17709 |
type: "SET_KIT_DESCRIPTION", |
| 17710 |
payload: value |
| 17711 |
}); |
| 17712 |
}, |
| 17713 |
DESCRIPTION_MAX_LENGTH, |
| 17714 |
validateKitName, |
| 17715 |
validateDescription |
| 17716 |
}; |
| 17717 |
} |
| 17718 |
|
| 17719 |
//#endregion |
| 17720 |
//#region app/modules/import-export-customization/assets/js/export/components/kit-info.js |
| 17721 |
function KitInfo() { |
| 17722 |
var _useKitValidation = useKitValidation(); |
| 17723 |
var templateName = _useKitValidation.templateName; |
| 17724 |
var description = _useKitValidation.description; |
| 17725 |
var nameError = _useKitValidation.nameError; |
| 17726 |
var hasDescriptionError = _useKitValidation.hasDescriptionError; |
| 17727 |
var descriptionCounterColor = _useKitValidation.descriptionCounterColor; |
| 17728 |
var handleNameChange = _useKitValidation.handleNameChange; |
| 17729 |
var handleDescriptionChange = _useKitValidation.handleDescriptionChange; |
| 17730 |
var DESCRIPTION_MAX_LENGTH = _useKitValidation.DESCRIPTION_MAX_LENGTH; |
| 17731 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 17732 |
mb: 3, |
| 17733 |
border: 1, |
| 17734 |
borderRadius: 1, |
| 17735 |
borderColor: "action.focus", |
| 17736 |
p: 3.5 |
| 17737 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17738 |
variant: "caption", |
| 17739 |
component: "label", |
| 17740 |
color: "text.secondary" |
| 17741 |
}, (0, _wordpress_i18n.__)("Website template name", "elementor"), " *"), /*#__PURE__*/ react.default.createElement(_elementor_ui.Input, { |
| 17742 |
fullWidth: true, |
| 17743 |
required: true, |
| 17744 |
value: templateName, |
| 17745 |
onChange: handleNameChange, |
| 17746 |
placeholder: (0, _wordpress_i18n.__)("Type name here...", "elementor"), |
| 17747 |
inputProps: { maxLength: 75 }, |
| 17748 |
error: !!nameError, |
| 17749 |
sx: { mb: nameError ? 1 : 2 } |
| 17750 |
}), nameError && /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17751 |
color: "error.main", |
| 17752 |
variant: "caption", |
| 17753 |
sx: { |
| 17754 |
mb: 2, |
| 17755 |
display: "block" |
| 17756 |
} |
| 17757 |
}, nameError), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17758 |
variant: "caption", |
| 17759 |
component: "label", |
| 17760 |
color: "text.secondary" |
| 17761 |
}, (0, _wordpress_i18n.__)("Description (Optional)", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Input, { |
| 17762 |
fullWidth: true, |
| 17763 |
multiline: true, |
| 17764 |
value: description, |
| 17765 |
onChange: handleDescriptionChange, |
| 17766 |
placeholder: (0, _wordpress_i18n.__)("Type description here...", "elementor"), |
| 17767 |
inputProps: { maxLength: DESCRIPTION_MAX_LENGTH }, |
| 17768 |
error: hasDescriptionError |
| 17769 |
}), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 17770 |
variant: "caption", |
| 17771 |
color: descriptionCounterColor, |
| 17772 |
sx: { |
| 17773 |
mt: .5, |
| 17774 |
display: "block" |
| 17775 |
} |
| 17776 |
}, description.length, " / ", DESCRIPTION_MAX_LENGTH, " ", (0, _wordpress_i18n.__)("characters", "elementor"))); |
| 17777 |
} |
| 17778 |
|
| 17779 |
//#endregion |
| 17780 |
//#region app/modules/import-export-customization/assets/js/export/pages/export-kit.js |
| 17781 |
init_apps_event_tracking(); |
| 17782 |
function ExportKit() { |
| 17783 |
var dispatch = useExportContext().dispatch; |
| 17784 |
(0, react.useEffect)(function() { |
| 17785 |
dispatch({ type: "RESET_STATE" }); |
| 17786 |
}, [dispatch]); |
| 17787 |
var footerContent = /*#__PURE__*/ react.default.createElement(ExportKitFooter, null); |
| 17788 |
var headerContent = /*#__PURE__*/ react.default.createElement(PageHeader, { title: (0, _wordpress_i18n.__)("Export", "elementor") }); |
| 17789 |
(0, react.useEffect)(function() { |
| 17790 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitExportCustomization); |
| 17791 |
}, []); |
| 17792 |
return /*#__PURE__*/ react.default.createElement(BaseLayout, { |
| 17793 |
topBar: /*#__PURE__*/ react.default.createElement(TopBar, null, headerContent), |
| 17794 |
footer: /*#__PURE__*/ react.default.createElement(Footer, null, footerContent) |
| 17795 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 17796 |
p: 3, |
| 17797 |
mb: 2, |
| 17798 |
maxWidth: "1075px", |
| 17799 |
mx: "auto" |
| 17800 |
} }, /*#__PURE__*/ react.default.createElement(ExportIntro, null), /*#__PURE__*/ react.default.createElement(KitInfo, null), /*#__PURE__*/ react.default.createElement(ExportKitPartsSelection, null))); |
| 17801 |
} |
| 17802 |
|
| 17803 |
//#endregion |
| 17804 |
//#region app/modules/import-export-customization/assets/js/export/utils/screenshot.js |
| 17805 |
var generateScreenshot = function generateScreenshot() { |
| 17806 |
return new Promise(function(resolve) { |
| 17807 |
var iframe = document.createElement("iframe"); |
| 17808 |
iframe.style = "visibility: hidden;"; |
| 17809 |
iframe.width = "1200"; |
| 17810 |
iframe.height = "1000"; |
| 17811 |
var _messageHandler = function messageHandler(event) { |
| 17812 |
if ("kit-screenshot-done" === event.data.name) { |
| 17813 |
window.removeEventListener("message", _messageHandler); |
| 17814 |
document.body.removeChild(iframe); |
| 17815 |
resolve(event.data.imageUrl || null); |
| 17816 |
} |
| 17817 |
}; |
| 17818 |
window.addEventListener("message", _messageHandler); |
| 17819 |
var previewUrl = new URL(window.location.origin); |
| 17820 |
previewUrl.searchParams.set("kit_thumbnail", "1"); |
| 17821 |
previewUrl.searchParams.set("nonce", elementorAppConfig["import-export-customization"].kitPreviewNonce); |
| 17822 |
document.body.appendChild(iframe); |
| 17823 |
iframe.src = previewUrl.toString(); |
| 17824 |
}); |
| 17825 |
}; |
| 17826 |
|
| 17827 |
//#endregion |
| 17828 |
//#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js |
| 17829 |
function _isNativeFunction(t) { |
| 17830 |
try { |
| 17831 |
return -1 !== Function.toString.call(t).indexOf("[native code]"); |
| 17832 |
} catch (n) { |
| 17833 |
return "function" == typeof t; |
| 17834 |
} |
| 17835 |
} |
| 17836 |
|
| 17837 |
//#endregion |
| 17838 |
//#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js |
| 17839 |
function _isNativeReflectConstruct$16() { |
| 17840 |
try { |
| 17841 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 17842 |
} catch (t) {} |
| 17843 |
return (_isNativeReflectConstruct$16 = function _isNativeReflectConstruct() { |
| 17844 |
return !!t; |
| 17845 |
})(); |
| 17846 |
} |
| 17847 |
__name(_isNativeReflectConstruct$16, "_isNativeReflectConstruct"); |
| 17848 |
|
| 17849 |
//#endregion |
| 17850 |
//#region node_modules/@babel/runtime/helpers/esm/construct.js |
| 17851 |
init_setPrototypeOf(); |
| 17852 |
function _construct(t, e, r) { |
| 17853 |
if (_isNativeReflectConstruct$16()) return Reflect.construct.apply(null, arguments); |
| 17854 |
var o = [null]; |
| 17855 |
o.push.apply(o, e); |
| 17856 |
var p = new (t.bind.apply(t, o))(); |
| 17857 |
return r && _setPrototypeOf(p, r.prototype), p; |
| 17858 |
} |
| 17859 |
|
| 17860 |
//#endregion |
| 17861 |
//#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js |
| 17862 |
init_getPrototypeOf(); |
| 17863 |
init_setPrototypeOf(); |
| 17864 |
function _wrapNativeSuper(t) { |
| 17865 |
var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; |
| 17866 |
return _wrapNativeSuper = function _wrapNativeSuper(t) { |
| 17867 |
if (null === t || !_isNativeFunction(t)) return t; |
| 17868 |
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); |
| 17869 |
if (void 0 !== r) { |
| 17870 |
if (r.has(t)) return r.get(t); |
| 17871 |
r.set(t, Wrapper); |
| 17872 |
} |
| 17873 |
function Wrapper() { |
| 17874 |
return _construct(t, arguments, _getPrototypeOf(this).constructor); |
| 17875 |
} |
| 17876 |
return Wrapper.prototype = Object.create(t.prototype, { constructor: { |
| 17877 |
value: Wrapper, |
| 17878 |
enumerable: !1, |
| 17879 |
writable: !0, |
| 17880 |
configurable: !0 |
| 17881 |
} }), _setPrototypeOf(Wrapper, t); |
| 17882 |
}, _wrapNativeSuper(t); |
| 17883 |
} |
| 17884 |
|
| 17885 |
//#endregion |
| 17886 |
//#region app/modules/import-export-customization/assets/js/shared/error/import-export-error.js |
| 17887 |
init_createClass(); |
| 17888 |
init_classCallCheck(); |
| 17889 |
init_possibleConstructorReturn(); |
| 17890 |
init_getPrototypeOf(); |
| 17891 |
init_inherits(); |
| 17892 |
function _callSuper$15(t, o, e) { |
| 17893 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$15() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 17894 |
} |
| 17895 |
__name(_callSuper$15, "_callSuper"); |
| 17896 |
function _isNativeReflectConstruct$15() { |
| 17897 |
try { |
| 17898 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 17899 |
} catch (t) {} |
| 17900 |
return (_isNativeReflectConstruct$15 = function _isNativeReflectConstruct() { |
| 17901 |
return !!t; |
| 17902 |
})(); |
| 17903 |
} |
| 17904 |
__name(_isNativeReflectConstruct$15, "_isNativeReflectConstruct"); |
| 17905 |
var ImportExportError = /*#__PURE__*/ function(_Error) { |
| 17906 |
function ImportExportError(errorMessage, errorCode) { |
| 17907 |
var _this; |
| 17908 |
_classCallCheck(this, ImportExportError); |
| 17909 |
_this = _callSuper$15(this, ImportExportError, ["string" === typeof errorMessage ? errorMessage : ""]); |
| 17910 |
_this.code = errorCode || "general"; |
| 17911 |
_this.details = errorMessage; |
| 17912 |
return _this; |
| 17913 |
} |
| 17914 |
_inherits(ImportExportError, _Error); |
| 17915 |
return _createClass(ImportExportError); |
| 17916 |
}(/*#__PURE__*/ _wrapNativeSuper(Error)); |
| 17917 |
|
| 17918 |
//#endregion |
| 17919 |
//#region app/modules/import-export-customization/assets/js/export/hooks/use-export-kit.js |
| 17920 |
init_typeof$1(); |
| 17921 |
init_asyncToGenerator(); |
| 17922 |
init_slicedToArray(); |
| 17923 |
init_es$1(); |
| 17924 |
var STATUS_PROCESSING = "processing"; |
| 17925 |
var STATUS_PROCESSING_MEDIA = "processing-media"; |
| 17926 |
var STATUS_ERROR = "error"; |
| 17927 |
var useExportKit = function useExportKit(_ref) { |
| 17928 |
var includes = _ref.includes; |
| 17929 |
var kitInfo = _ref.kitInfo; |
| 17930 |
var customization = _ref.customization; |
| 17931 |
var isExporting = _ref.isExporting; |
| 17932 |
var dispatch = _ref.dispatch; |
| 17933 |
var _useState2 = _slicedToArray((0, react.useState)(STATUS_PROCESSING), 2); |
| 17934 |
var status = _useState2[0]; |
| 17935 |
var setStatus = _useState2[1]; |
| 17936 |
var _useState4 = _slicedToArray((0, react.useState)(null), 2); |
| 17937 |
var error = _useState4[0]; |
| 17938 |
var setError = _useState4[1]; |
| 17939 |
var _useState6 = _slicedToArray((0, react.useState)(null), 2); |
| 17940 |
var exportedData = _useState6[0]; |
| 17941 |
var setExportedData = _useState6[1]; |
| 17942 |
var navigate = useNavigate(); |
| 17943 |
var processMedia = (0, react.useCallback)(/*#__PURE__*/ function() { |
| 17944 |
var _ref2 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee(exportData, mediaUrls, kit) { |
| 17945 |
var _window$wpApiSettings; |
| 17946 |
var _mediaResult$data4; |
| 17947 |
var baseUrl; |
| 17948 |
var mediaResponse; |
| 17949 |
var mediaResult; |
| 17950 |
var _mediaResult$data; |
| 17951 |
var _mediaResult$data2; |
| 17952 |
var _mediaResult$data3; |
| 17953 |
var errorMessage; |
| 17954 |
return import_regenerator$1.default.wrap(function(_context) { |
| 17955 |
while (1) switch (_context.prev = _context.next) { |
| 17956 |
case 0: |
| 17957 |
setStatus(STATUS_PROCESSING_MEDIA); |
| 17958 |
baseUrl = elementorAppConfig["import-export-customization"].restApiBaseUrl; |
| 17959 |
_context.next = 1; |
| 17960 |
return fetch("".concat(baseUrl, "/process-media"), { |
| 17961 |
method: "POST", |
| 17962 |
headers: { |
| 17963 |
"Content-Type": "application/json", |
| 17964 |
"X-WP-Nonce": ((_window$wpApiSettings = window.wpApiSettings) === null || _window$wpApiSettings === void 0 ? void 0 : _window$wpApiSettings.nonce) || "" |
| 17965 |
}, |
| 17966 |
body: JSON.stringify({ |
| 17967 |
media_urls: mediaUrls, |
| 17968 |
kit |
| 17969 |
}) |
| 17970 |
}); |
| 17971 |
case 1: |
| 17972 |
mediaResponse = _context.sent; |
| 17973 |
_context.next = 2; |
| 17974 |
return mediaResponse.json(); |
| 17975 |
case 2: |
| 17976 |
mediaResult = _context.sent; |
| 17977 |
if (mediaResponse.ok) { |
| 17978 |
_context.next = 3; |
| 17979 |
break; |
| 17980 |
} |
| 17981 |
errorMessage = (mediaResult === null || mediaResult === void 0 || (_mediaResult$data = mediaResult.data) === null || _mediaResult$data === void 0 ? void 0 : _mediaResult$data.message) || "Media processing error! Code: ".concat(mediaResult === null || mediaResult === void 0 || (_mediaResult$data2 = mediaResult.data) === null || _mediaResult$data2 === void 0 ? void 0 : _mediaResult$data2.code); |
| 17982 |
throw new ImportExportError(errorMessage, mediaResult === null || mediaResult === void 0 || (_mediaResult$data3 = mediaResult.data) === null || _mediaResult$data3 === void 0 ? void 0 : _mediaResult$data3.code); |
| 17983 |
case 3: |
| 17984 |
exportData.media = { |
| 17985 |
processed: true, |
| 17986 |
message: (mediaResult === null || mediaResult === void 0 || (_mediaResult$data4 = mediaResult.data) === null || _mediaResult$data4 === void 0 ? void 0 : _mediaResult$data4.message) || "Media processed successfully" |
| 17987 |
}; |
| 17988 |
return _context.abrupt("return", exportData); |
| 17989 |
case 4: |
| 17990 |
case "end": return _context.stop(); |
| 17991 |
} |
| 17992 |
}, _callee); |
| 17993 |
})); |
| 17994 |
return function(_x, _x2, _x3) { |
| 17995 |
return _ref2.apply(this, arguments); |
| 17996 |
}; |
| 17997 |
}(), []); |
| 17998 |
var deleteKit = (0, react.useCallback)(/*#__PURE__*/ function() { |
| 17999 |
var _ref3 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee2(kitId) { |
| 18000 |
return import_regenerator$1.default.wrap(function(_context2) { |
| 18001 |
while (1) switch (_context2.prev = _context2.next) { |
| 18002 |
case 0: |
| 18003 |
if (kitId) { |
| 18004 |
_context2.next = 1; |
| 18005 |
break; |
| 18006 |
} |
| 18007 |
return _context2.abrupt("return"); |
| 18008 |
case 1: |
| 18009 |
_context2.prev = 1; |
| 18010 |
_context2.next = 2; |
| 18011 |
return $e.data.delete("cloud-kits/index", { id: kitId }); |
| 18012 |
case 2: |
| 18013 |
_context2.next = 4; |
| 18014 |
break; |
| 18015 |
case 3: |
| 18016 |
_context2.prev = 3; |
| 18017 |
_context2["catch"](1); |
| 18018 |
case 4: |
| 18019 |
case "end": return _context2.stop(); |
| 18020 |
} |
| 18021 |
}, _callee2, null, [[1, 3]]); |
| 18022 |
})); |
| 18023 |
return function(_x4) { |
| 18024 |
return _ref3.apply(this, arguments); |
| 18025 |
}; |
| 18026 |
}(), []); |
| 18027 |
var retryMediaProcessing = (0, react.useCallback)(/*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee3() { |
| 18028 |
var updatedExportedData; |
| 18029 |
var _t2; |
| 18030 |
return import_regenerator$1.default.wrap(function(_context3) { |
| 18031 |
while (1) switch (_context3.prev = _context3.next) { |
| 18032 |
case 0: |
| 18033 |
if (exportedData) { |
| 18034 |
_context3.next = 1; |
| 18035 |
break; |
| 18036 |
} |
| 18037 |
throw new ImportExportError("No export data available for media retry"); |
| 18038 |
case 1: |
| 18039 |
_context3.prev = 1; |
| 18040 |
setError(null); |
| 18041 |
_context3.next = 2; |
| 18042 |
return processMedia(exportedData.exportedData, exportedData.mediaUrls, exportedData.kit); |
| 18043 |
case 2: |
| 18044 |
updatedExportedData = _context3.sent; |
| 18045 |
dispatch({ |
| 18046 |
type: "SET_EXPORTED_DATA", |
| 18047 |
payload: updatedExportedData |
| 18048 |
}); |
| 18049 |
dispatch({ |
| 18050 |
type: "SET_EXPORT_STATUS", |
| 18051 |
payload: EXPORT_STATUS.COMPLETED |
| 18052 |
}); |
| 18053 |
navigate("/export-customization/complete"); |
| 18054 |
_context3.next = 4; |
| 18055 |
break; |
| 18056 |
case 3: |
| 18057 |
_context3.prev = 3; |
| 18058 |
_t2 = _context3["catch"](1); |
| 18059 |
setStatus(STATUS_ERROR); |
| 18060 |
setError(_t2 instanceof ImportExportError ? _t2 : new ImportExportError(_t2.message)); |
| 18061 |
case 4: |
| 18062 |
case "end": return _context3.stop(); |
| 18063 |
} |
| 18064 |
}, _callee3, null, [[1, 3]]); |
| 18065 |
})), [ |
| 18066 |
exportedData, |
| 18067 |
processMedia, |
| 18068 |
dispatch, |
| 18069 |
navigate |
| 18070 |
]); |
| 18071 |
var exportKit = (0, react.useCallback)(/*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee4() { |
| 18072 |
var _kitInfo$title; |
| 18073 |
var _kitInfo$description; |
| 18074 |
var _window$wpApiSettings2; |
| 18075 |
var exportData; |
| 18076 |
var isCloudExport; |
| 18077 |
var screenshot; |
| 18078 |
var baseUrl; |
| 18079 |
var exportUrl; |
| 18080 |
var response; |
| 18081 |
var result; |
| 18082 |
var _result$data; |
| 18083 |
var _result$data2; |
| 18084 |
var _result$data3; |
| 18085 |
var rawMessage; |
| 18086 |
var errorMessage; |
| 18087 |
var errorCode; |
| 18088 |
var isExportLocal; |
| 18089 |
var isExportToCloud; |
| 18090 |
var kitExportData; |
| 18091 |
var mediaUrls; |
| 18092 |
var _t3; |
| 18093 |
return import_regenerator$1.default.wrap(function(_context4) { |
| 18094 |
while (1) switch (_context4.prev = _context4.next) { |
| 18095 |
case 0: |
| 18096 |
_context4.prev = 0; |
| 18097 |
setStatus(STATUS_PROCESSING); |
| 18098 |
setError(null); |
| 18099 |
exportData = { |
| 18100 |
kitInfo: { |
| 18101 |
title: ((_kitInfo$title = kitInfo.title) === null || _kitInfo$title === void 0 ? void 0 : _kitInfo$title.trim()) || null, |
| 18102 |
description: ((_kitInfo$description = kitInfo.description) === null || _kitInfo$description === void 0 ? void 0 : _kitInfo$description.trim()) || null, |
| 18103 |
source: kitInfo.source |
| 18104 |
}, |
| 18105 |
include: includes, |
| 18106 |
customization |
| 18107 |
}; |
| 18108 |
isCloudExport = "cloud" === kitInfo.source; |
| 18109 |
if (!isCloudExport) { |
| 18110 |
_context4.next = 2; |
| 18111 |
break; |
| 18112 |
} |
| 18113 |
_context4.next = 1; |
| 18114 |
return generateScreenshot(); |
| 18115 |
case 1: |
| 18116 |
screenshot = _context4.sent; |
| 18117 |
exportData.screenShotBlob = screenshot; |
| 18118 |
case 2: |
| 18119 |
baseUrl = elementorAppConfig["import-export-customization"].restApiBaseUrl; |
| 18120 |
exportUrl = "".concat(baseUrl, "/export"); |
| 18121 |
_context4.next = 3; |
| 18122 |
return fetch(exportUrl, { |
| 18123 |
method: "POST", |
| 18124 |
headers: { |
| 18125 |
"Content-Type": "application/json", |
| 18126 |
"X-WP-Nonce": ((_window$wpApiSettings2 = window.wpApiSettings) === null || _window$wpApiSettings2 === void 0 ? void 0 : _window$wpApiSettings2.nonce) || "" |
| 18127 |
}, |
| 18128 |
body: JSON.stringify(exportData) |
| 18129 |
}); |
| 18130 |
case 3: |
| 18131 |
response = _context4.sent; |
| 18132 |
_context4.next = 4; |
| 18133 |
return response.json(); |
| 18134 |
case 4: |
| 18135 |
result = _context4.sent; |
| 18136 |
if (response.ok) { |
| 18137 |
_context4.next = 5; |
| 18138 |
break; |
| 18139 |
} |
| 18140 |
rawMessage = result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.message; |
| 18141 |
errorMessage = "object" === _typeof$1(rawMessage) ? rawMessage : rawMessage || "HTTP error! with the following code: ".concat(result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.code); |
| 18142 |
errorCode = 408 === (response === null || response === void 0 ? void 0 : response.status) ? "timeout" : result === null || result === void 0 || (_result$data3 = result.data) === null || _result$data3 === void 0 ? void 0 : _result$data3.code; |
| 18143 |
throw new ImportExportError(errorMessage, errorCode); |
| 18144 |
case 5: |
| 18145 |
isExportLocal = "file" === kitInfo.source && result.data && result.data.file; |
| 18146 |
isExportToCloud = "cloud" === kitInfo.source && result.data && result.data.kit; |
| 18147 |
kitExportData = null; |
| 18148 |
if (!isExportLocal) { |
| 18149 |
_context4.next = 6; |
| 18150 |
break; |
| 18151 |
} |
| 18152 |
kitExportData = { |
| 18153 |
file: result.data.file, |
| 18154 |
manifest: result.data.manifest |
| 18155 |
}; |
| 18156 |
dispatch({ |
| 18157 |
type: "SET_EXPORTED_DATA", |
| 18158 |
payload: kitExportData |
| 18159 |
}); |
| 18160 |
dispatch({ |
| 18161 |
type: "SET_EXPORT_STATUS", |
| 18162 |
payload: EXPORT_STATUS.COMPLETED |
| 18163 |
}); |
| 18164 |
navigate("/export-customization/complete"); |
| 18165 |
_context4.next = 9; |
| 18166 |
break; |
| 18167 |
case 6: |
| 18168 |
if (!isExportToCloud) { |
| 18169 |
_context4.next = 8; |
| 18170 |
break; |
| 18171 |
} |
| 18172 |
kitExportData = { |
| 18173 |
kit: result.data.kit, |
| 18174 |
manifest: result.data.manifest |
| 18175 |
}; |
| 18176 |
setExportedData({ |
| 18177 |
exportedData: kitExportData, |
| 18178 |
mediaUrls: result.data.media_urls, |
| 18179 |
kit: result.data.kit |
| 18180 |
}); |
| 18181 |
mediaUrls = result.data.media_urls; |
| 18182 |
if (!(mediaUrls && mediaUrls.length > 0)) { |
| 18183 |
_context4.next = 7; |
| 18184 |
break; |
| 18185 |
} |
| 18186 |
_context4.next = 7; |
| 18187 |
return processMedia(kitExportData, mediaUrls, result.data.kit); |
| 18188 |
case 7: |
| 18189 |
dispatch({ |
| 18190 |
type: "SET_EXPORTED_DATA", |
| 18191 |
payload: kitExportData |
| 18192 |
}); |
| 18193 |
dispatch({ |
| 18194 |
type: "SET_EXPORT_STATUS", |
| 18195 |
payload: EXPORT_STATUS.COMPLETED |
| 18196 |
}); |
| 18197 |
navigate("/export-customization/complete"); |
| 18198 |
_context4.next = 9; |
| 18199 |
break; |
| 18200 |
case 8: throw new ImportExportError("Invalid response format from server"); |
| 18201 |
case 9: |
| 18202 |
_context4.next = 11; |
| 18203 |
break; |
| 18204 |
case 10: |
| 18205 |
_context4.prev = 10; |
| 18206 |
_t3 = _context4["catch"](0); |
| 18207 |
setStatus(STATUS_ERROR); |
| 18208 |
setError(_t3 instanceof ImportExportError ? _t3 : new ImportExportError(_t3.message)); |
| 18209 |
case 11: |
| 18210 |
case "end": return _context4.stop(); |
| 18211 |
} |
| 18212 |
}, _callee4, null, [[0, 10]]); |
| 18213 |
})), [ |
| 18214 |
includes, |
| 18215 |
kitInfo, |
| 18216 |
customization, |
| 18217 |
dispatch, |
| 18218 |
navigate, |
| 18219 |
processMedia |
| 18220 |
]); |
| 18221 |
(0, react.useEffect)(function() { |
| 18222 |
if (isExporting) exportKit(); |
| 18223 |
}, [isExporting, exportKit]); |
| 18224 |
return { |
| 18225 |
status, |
| 18226 |
STATUS_PROCESSING, |
| 18227 |
STATUS_PROCESSING_MEDIA, |
| 18228 |
STATUS_ERROR, |
| 18229 |
error, |
| 18230 |
exportKit, |
| 18231 |
retryMediaProcessing, |
| 18232 |
deleteKit, |
| 18233 |
exportedData |
| 18234 |
}; |
| 18235 |
}; |
| 18236 |
|
| 18237 |
//#endregion |
| 18238 |
//#region app/modules/import-export-customization/assets/js/export/components/export-processing.js |
| 18239 |
function ExportProcessing(_ref) { |
| 18240 |
var statusText = _ref.statusText; |
| 18241 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { size: 20 }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 18242 |
variant: "h5", |
| 18243 |
color: "text.primary", |
| 18244 |
component: "h2" |
| 18245 |
}, statusText), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 18246 |
variant: "body1", |
| 18247 |
color: "text.secondary" |
| 18248 |
}, (0, _wordpress_i18n.__)("This usually takes a few moments.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), (0, _wordpress_i18n.__)("Don't close this window until the process is finished.", "elementor"))); |
| 18249 |
} |
| 18250 |
ExportProcessing.propTypes = { statusText: import_prop_types$55.default.string.isRequired }; |
| 18251 |
|
| 18252 |
//#endregion |
| 18253 |
//#region app/modules/import-export-customization/assets/js/shared/components/error/processing-error-dialog.js |
| 18254 |
init_typeof$1(); |
| 18255 |
init_slicedToArray(); |
| 18256 |
function Link$3(_ref) { |
| 18257 |
var href = _ref.href; |
| 18258 |
var children = _ref.children; |
| 18259 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 18260 |
href, |
| 18261 |
variant: "body2", |
| 18262 |
color: "info.light", |
| 18263 |
underline: "hover", |
| 18264 |
target: "_blank", |
| 18265 |
rel: "noopener noreferrer" |
| 18266 |
}, children); |
| 18267 |
} |
| 18268 |
__name(Link$3, "Link"); |
| 18269 |
Link$3.propTypes = { |
| 18270 |
href: import_prop_types$55.default.string.isRequired, |
| 18271 |
children: import_prop_types$55.default.node.isRequired |
| 18272 |
}; |
| 18273 |
var messagesContent = { |
| 18274 |
general: { |
| 18275 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 18276 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("We couldn’t download the Website Template due to technical difficulties on our part. Try again and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 18277 |
}, |
| 18278 |
"zip-archive-module-missing": { |
| 18279 |
title: (0, _wordpress_i18n.__)("Couldn’t handle the Website Template", "elementor"), |
| 18280 |
text: (0, _wordpress_i18n.__)("Seems like your server is missing the PHP zip module. Install it on your server or contact your site host for further instructions.", "elementor") |
| 18281 |
}, |
| 18282 |
"invalid-zip-file": { |
| 18283 |
title: (0, _wordpress_i18n.__)("Couldn’t use the .zip file", "elementor"), |
| 18284 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Seems like there is a problem with the zip’s files. Try installing again and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 18285 |
}, |
| 18286 |
timeout: { |
| 18287 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 18288 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("It took too much time to download your Website Template and we were unable to complete the process. If all the Website Template’s parts don’t appear in ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: elementorAppConfig.pages_url }, (0, _wordpress_i18n.__)("Pages", "elementor")), (0, _wordpress_i18n.__)(", try again and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 18289 |
}, |
| 18290 |
"invalid-kit-library-zip-error": { |
| 18291 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 18292 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("We couldn’t download the Website Template due to technical difficulty on our part. Try again in a few minutes and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor"))) |
| 18293 |
}, |
| 18294 |
"no-write-permissions": { |
| 18295 |
title: (0, _wordpress_i18n.__)("Couldn’t access the file", "elementor"), |
| 18296 |
text: (0, _wordpress_i18n.__)("Seems like Elementor isn’t authorized to access relevant files for installing this Website Template. Contact your site host to get permission.", "elementor") |
| 18297 |
}, |
| 18298 |
"plugin-installation-permissions-error": { |
| 18299 |
title: (0, _wordpress_i18n.__)("Couldn’t install the Website Template", "elementor"), |
| 18300 |
text: (0, _wordpress_i18n.__)("The Website Template includes plugins you don’t have permission to install. Contact your site admin to change your permissions.", "elementor") |
| 18301 |
}, |
| 18302 |
"third-party-error": { |
| 18303 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 18304 |
text: (0, _wordpress_i18n.__)("This is due to a conflict with one or more third-party plugins already active on your site. Try disabling them, and then give the download another go.", "elementor") |
| 18305 |
}, |
| 18306 |
"domdocument-missing": { |
| 18307 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 18308 |
text: (0, _wordpress_i18n.__)("This download requires the 'DOMDocument' PHP extension, which we couldn’t detect on your server. Enable this extension, or get in touch with your hosting service for support, and then give the download another go.", "elementor") |
| 18309 |
}, |
| 18310 |
"insufficient-quota": { |
| 18311 |
title: (0, _wordpress_i18n.__)("Couldn’t Export the Website Template", "elementor"), |
| 18312 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("The export failed because it will pass the maximum Website Templates you can export. ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://go.elementor.com/app-general-load-issue/" }, (0, _wordpress_i18n.__)("Learn more", "elementor"))) |
| 18313 |
}, |
| 18314 |
"failed-to-fetch-quota": { |
| 18315 |
title: (0, _wordpress_i18n.__)("Couldn’t fetch quota", "elementor"), |
| 18316 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Failed to fetch quota, please try again. If the problem continues, contact ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor")), ". ", /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://go.elementor.com/app-import-export-common-errors" }, (0, _wordpress_i18n.__)("Learn more", "elementor"))) |
| 18317 |
}, |
| 18318 |
"cloud-upload-failed": { |
| 18319 |
title: (0, _wordpress_i18n.__)("Couldn’t Upload to Library", "elementor"), |
| 18320 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("We couldn’t add your export to the library. Try again. ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://go.elementor.com/app-import-export-common-errors" }, (0, _wordpress_i18n.__)("Learn more", "elementor"))) |
| 18321 |
}, |
| 18322 |
"error-loading-resource": { |
| 18323 |
title: (0, _wordpress_i18n.__)("Unable to download the Website Template", "elementor"), |
| 18324 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("We couldn’t download the Website Template due to technical difficulties on our part. Try again and if the problem persists contact ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://my.elementor.com/support-center/" }, (0, _wordpress_i18n.__)("Support", "elementor")), ". ", /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://go.elementor.com/app-import-export-common-errors" }, (0, _wordpress_i18n.__)("Learn more", "elementor"))) |
| 18325 |
}, |
| 18326 |
"media-processing-error": { |
| 18327 |
title: (0, _wordpress_i18n.__)("Couldn’t save media files to the cloud", "elementor"), |
| 18328 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("We ran into a problem while saving your media files to the cloud. Please try again. If the issue persists, edit the Content section and choose \"Link to media\" to save it as a reference. ", "elementor"), /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://go.elementor.com/app-import-export-common-errors" }, (0, _wordpress_i18n.__)("Learn more", "elementor"))) |
| 18329 |
}, |
| 18330 |
"insufficient-storage-quota": { |
| 18331 |
title: (0, _wordpress_i18n.__)("Your library is full", "elementor"), |
| 18332 |
text: function text() { |
| 18333 |
var _ref2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; |
| 18334 |
var _ref2$filename = _ref2.filename; |
| 18335 |
var filename = _ref2$filename === void 0 ? (0, _wordpress_i18n.__)("This file", "elementor") : _ref2$filename; |
| 18336 |
var _ref2$maxSize = _ref2.maxSize; |
| 18337 |
var maxSize = _ref2$maxSize === void 0 ? 0 : _ref2$maxSize; |
| 18338 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 18339 |
variant: "h6", |
| 18340 |
sx: { mb: 2 } |
| 18341 |
}, (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("%s exceeds the library size limit", "elementor"), filename)), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("The maximum website template library size is %s GB. To save this file, you can either export it locally as a .zip file or get more storage by", "elementor"), maxSize), " ", /*#__PURE__*/ react.default.createElement(Link$3, { href: "https://go.elementor.com/go-pro-cloud-website-templates-library-advanced/" }, (0, _wordpress_i18n.__)("Upgrade now", "elementor")), ".")); |
| 18342 |
} |
| 18343 |
} |
| 18344 |
}; |
| 18345 |
function ProcessingErrorDialog(_ref3) { |
| 18346 |
var _messagesContent$erro; |
| 18347 |
var error = _ref3.error; |
| 18348 |
var handleClose = _ref3.handleClose; |
| 18349 |
var handleTryAgain = _ref3.handleTryAgain; |
| 18350 |
var handleExportAsZip = _ref3.handleExportAsZip; |
| 18351 |
var _useState2 = _slicedToArray((0, react.useState)(Boolean(error)), 2); |
| 18352 |
var open = _useState2[0]; |
| 18353 |
var setOpen = _useState2[1]; |
| 18354 |
var errorType = (error === null || error === void 0 ? void 0 : error.code) || "general"; |
| 18355 |
var errorMessageContent = (_messagesContent$erro = messagesContent[errorType]) !== null && _messagesContent$erro !== void 0 ? _messagesContent$erro : messagesContent.general; |
| 18356 |
var resolveText = function resolveText() { |
| 18357 |
var details = (error === null || error === void 0 ? void 0 : error.details) || (error === null || error === void 0 ? void 0 : error.message); |
| 18358 |
var replacements = details && "object" === _typeof$1(details) ? details.replacements : null; |
| 18359 |
var text = errorMessageContent.text; |
| 18360 |
if ("function" === typeof text) return text(replacements); |
| 18361 |
return text; |
| 18362 |
}; |
| 18363 |
var shouldRenderTryAgainButton = function shouldRenderTryAgainButton() { |
| 18364 |
return [ |
| 18365 |
"general", |
| 18366 |
"timeout", |
| 18367 |
"cloud-upload-failed", |
| 18368 |
"third-party-error", |
| 18369 |
"invalid-zip-file", |
| 18370 |
"zip-archive-module-missing", |
| 18371 |
"no-write-permissions", |
| 18372 |
"plugin-installation-permissions-error", |
| 18373 |
"failed-to-fetch-quota", |
| 18374 |
"insufficient-quota", |
| 18375 |
"error-loading-resource", |
| 18376 |
"media-processing-error", |
| 18377 |
"import-runner-error" |
| 18378 |
].includes(errorType); |
| 18379 |
}; |
| 18380 |
var renderButtons = function renderButtons() { |
| 18381 |
var isQuotaError = "insufficient-storage-quota" === errorType; |
| 18382 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 18383 |
onClick: function onClick() { |
| 18384 |
if (handleClose) handleClose(); |
| 18385 |
setOpen(false); |
| 18386 |
}, |
| 18387 |
color: "secondary" |
| 18388 |
}, (0, _wordpress_i18n.__)("Cancel", "elementor")), isQuotaError && handleExportAsZip && /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 18389 |
onClick: function onClick() { |
| 18390 |
handleExportAsZip(); |
| 18391 |
setOpen(false); |
| 18392 |
}, |
| 18393 |
variant: "contained", |
| 18394 |
color: "primary" |
| 18395 |
}, (0, _wordpress_i18n.__)("Export as .zip", "elementor")), shouldRenderTryAgainButton(errorType) && !isQuotaError && /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 18396 |
"data-testid": "try-again-button", |
| 18397 |
onClick: function onClick() { |
| 18398 |
if (handleTryAgain) handleTryAgain(); |
| 18399 |
}, |
| 18400 |
variant: "contained", |
| 18401 |
color: "primary" |
| 18402 |
}, (0, _wordpress_i18n.__)("Try Again", "elementor"))); |
| 18403 |
}; |
| 18404 |
(0, react.useEffect)(function() { |
| 18405 |
setOpen(Boolean(error)); |
| 18406 |
}, [error]); |
| 18407 |
if (!error) return null; |
| 18408 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, { |
| 18409 |
"data-testid": "error-dialog", |
| 18410 |
open, |
| 18411 |
onClose: function onClose() { |
| 18412 |
if (handleClose) handleClose(); |
| 18413 |
setOpen(false); |
| 18414 |
}, |
| 18415 |
maxWidth: "sm" |
| 18416 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogHeader, { onClose: handleClose }, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogTitle, null, errorMessageContent.title)), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, { |
| 18417 |
dividers: true, |
| 18418 |
sx: { p: 3 } |
| 18419 |
}, resolveText()), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogActions, null, renderButtons())); |
| 18420 |
} |
| 18421 |
ProcessingErrorDialog.propTypes = { |
| 18422 |
error: import_prop_types$55.default.any, |
| 18423 |
handleClose: import_prop_types$55.default.func, |
| 18424 |
handleTryAgain: import_prop_types$55.default.func, |
| 18425 |
handleExportAsZip: import_prop_types$55.default.func |
| 18426 |
}; |
| 18427 |
|
| 18428 |
//#endregion |
| 18429 |
//#region app/modules/import-export-customization/assets/js/export/pages/export-process.js |
| 18430 |
init_es$1(); |
| 18431 |
function ExportProcess() { |
| 18432 |
var _useExportContext = useExportContext(); |
| 18433 |
var data = _useExportContext.data; |
| 18434 |
var dispatch = _useExportContext.dispatch; |
| 18435 |
var isExporting = _useExportContext.isExporting; |
| 18436 |
var isPending = _useExportContext.isPending; |
| 18437 |
var kitInfo = data.kitInfo; |
| 18438 |
var includes = data.includes; |
| 18439 |
var customization = data.customization; |
| 18440 |
var _useExportKit = useExportKit({ |
| 18441 |
includes, |
| 18442 |
kitInfo, |
| 18443 |
customization, |
| 18444 |
isExporting, |
| 18445 |
dispatch |
| 18446 |
}); |
| 18447 |
var status = _useExportKit.status; |
| 18448 |
var STATUS_PROCESSING = _useExportKit.STATUS_PROCESSING; |
| 18449 |
var STATUS_PROCESSING_MEDIA = _useExportKit.STATUS_PROCESSING_MEDIA; |
| 18450 |
var STATUS_ERROR = _useExportKit.STATUS_ERROR; |
| 18451 |
var error = _useExportKit.error; |
| 18452 |
var exportKit = _useExportKit.exportKit; |
| 18453 |
var retryMediaProcessing = _useExportKit.retryMediaProcessing; |
| 18454 |
var deleteKit = _useExportKit.deleteKit; |
| 18455 |
var exportedData = _useExportKit.exportedData; |
| 18456 |
if (isPending) return /*#__PURE__*/ react.default.createElement(Redirect, { |
| 18457 |
to: "/export-customization/", |
| 18458 |
replace: true |
| 18459 |
}); |
| 18460 |
var getStatusText = function getStatusText() { |
| 18461 |
if (status === STATUS_PROCESSING) return (0, _wordpress_i18n.__)("Setting up your website template...", "elementor"); |
| 18462 |
if (status === STATUS_PROCESSING_MEDIA) return (0, _wordpress_i18n.__)("Processing media files...", "elementor"); |
| 18463 |
return (0, _wordpress_i18n.__)("Export failed", "elementor"); |
| 18464 |
}; |
| 18465 |
var headerContent = /*#__PURE__*/ react.default.createElement(PageHeader, { title: (0, _wordpress_i18n.__)("Export", "elementor") }); |
| 18466 |
return /*#__PURE__*/ react.default.createElement(BaseLayout, { topBar: /*#__PURE__*/ react.default.createElement(TopBar, null, headerContent) }, /*#__PURE__*/ react.default.createElement(CenteredContent, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 18467 |
spacing: 3, |
| 18468 |
alignItems: "center" |
| 18469 |
}, (status === STATUS_PROCESSING || status === STATUS_PROCESSING_MEDIA) && /*#__PURE__*/ react.default.createElement(ExportProcessing, { statusText: getStatusText() }), status === STATUS_ERROR && /*#__PURE__*/ react.default.createElement(ProcessingErrorDialog, { |
| 18470 |
error, |
| 18471 |
handleClose: function handleCloseError() { |
| 18472 |
var _exportedData$kit; |
| 18473 |
var isMediaError = "media-processing-error" === (error === null || error === void 0 ? void 0 : error.code); |
| 18474 |
dispatch({ |
| 18475 |
type: "SET_EXPORT_STATUS", |
| 18476 |
payload: EXPORT_STATUS.PENDING |
| 18477 |
}); |
| 18478 |
if (isMediaError && exportedData !== null && exportedData !== void 0 && (_exportedData$kit = exportedData.kit) !== null && _exportedData$kit !== void 0 && _exportedData$kit.id) deleteKit(exportedData.kit.id); |
| 18479 |
}, |
| 18480 |
handleTryAgain: function handleTryAgain() { |
| 18481 |
if ("media-processing-error" === (error === null || error === void 0 ? void 0 : error.code)) retryMediaProcessing(); |
| 18482 |
else exportKit(); |
| 18483 |
}, |
| 18484 |
handleExportAsZip: function handleExportAsZip() { |
| 18485 |
dispatch({ |
| 18486 |
type: "SET_KIT_SAVE_SOURCE", |
| 18487 |
payload: "file" |
| 18488 |
}); |
| 18489 |
dispatch({ |
| 18490 |
type: "SET_EXPORT_STATUS", |
| 18491 |
payload: EXPORT_STATUS.EXPORTING |
| 18492 |
}); |
| 18493 |
} |
| 18494 |
})))); |
| 18495 |
} |
| 18496 |
|
| 18497 |
//#endregion |
| 18498 |
//#region app/modules/import-export-customization/assets/js/shared/utils/string.js |
| 18499 |
function formatToTitleCase(str) { |
| 18500 |
return str.replace(/([A-Z])/g, " $1").replace(/^./, function(s) { |
| 18501 |
return s.toUpperCase(); |
| 18502 |
}).trim(); |
| 18503 |
} |
| 18504 |
|
| 18505 |
//#endregion |
| 18506 |
//#region app/modules/import-export-customization/assets/js/shared/utils/utils.js |
| 18507 |
init_slicedToArray(); |
| 18508 |
function buildKitSettingsSummary(siteSettings) { |
| 18509 |
var _Object$entries; |
| 18510 |
var formattedSettings = (Array.isArray(siteSettings) ? siteSettings : (_Object$entries = Object.entries(siteSettings)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.filter(function(_ref) { |
| 18511 |
var _ref2 = _slicedToArray(_ref, 2); |
| 18512 |
_ref2[0]; |
| 18513 |
return _ref2[1]; |
| 18514 |
}).map(function(_ref3) { |
| 18515 |
return _slicedToArray(_ref3, 1)[0]; |
| 18516 |
})).map(function(setting) { |
| 18517 |
return formatToTitleCase(setting); |
| 18518 |
}); |
| 18519 |
return formattedSettings.length > 0 ? formattedSettings.join(" | ") : ""; |
| 18520 |
} |
| 18521 |
|
| 18522 |
//#endregion |
| 18523 |
//#region app/modules/import-export-customization/assets/js/export/pages/export-complete.js |
| 18524 |
init_slicedToArray(); |
| 18525 |
init_es$1(); |
| 18526 |
init_apps_event_tracking(); |
| 18527 |
var INVALID_FILENAME_CHARS = /[<>:"/\\|?*]/g; |
| 18528 |
function ExportComplete() { |
| 18529 |
var navigate = useNavigate(); |
| 18530 |
var _useExportContext = useExportContext(); |
| 18531 |
var data = _useExportContext.data; |
| 18532 |
var isCompleted = _useExportContext.isCompleted; |
| 18533 |
var exportedData = data.exportedData; |
| 18534 |
var kitInfo = data.kitInfo; |
| 18535 |
var includes = data.includes; |
| 18536 |
var analytics = data.analytics; |
| 18537 |
var downloadLink = (0, react.useRef)(null); |
| 18538 |
var downloadFile = function downloadFile(event) { |
| 18539 |
event === null || event === void 0 || event.preventDefault(); |
| 18540 |
if (!downloadLink.current) { |
| 18541 |
var link = document.createElement("a"); |
| 18542 |
var defaultKitName = "elementor-kit"; |
| 18543 |
var fileName = (kitInfo.title || defaultKitName).replace(INVALID_FILENAME_CHARS, "").trim() || defaultKitName; |
| 18544 |
link.href = "data:application/zip;base64," + exportedData.file; |
| 18545 |
link.download = fileName + ".zip"; |
| 18546 |
downloadLink.current = link; |
| 18547 |
} |
| 18548 |
downloadLink.current.click(); |
| 18549 |
}; |
| 18550 |
(0, react.useEffect)(function() { |
| 18551 |
if ("cloud" !== kitInfo.source && exportedData !== null && exportedData !== void 0 && exportedData.file) downloadFile(); |
| 18552 |
}, [exportedData, kitInfo.source]); |
| 18553 |
(0, react.useEffect)(function() { |
| 18554 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitExportSummary); |
| 18555 |
}, []); |
| 18556 |
(0, react.useEffect)(function() { |
| 18557 |
if (exportedData.manifest) { |
| 18558 |
var _exportedData$manifes; |
| 18559 |
var _exportedData$manifes2; |
| 18560 |
var contentCounts = getContentCounts(); |
| 18561 |
AppsEventTracking.sendExportKitCustomization({ |
| 18562 |
kit_export_content: includes.includes("content"), |
| 18563 |
kit_export_templates: includes.includes("templates"), |
| 18564 |
kit_export_settings: includes.includes("settings"), |
| 18565 |
kit_export_plugins: includes.includes("plugins"), |
| 18566 |
kit_export_customization_modals: analytics === null || analytics === void 0 ? void 0 : analytics.customization, |
| 18567 |
kit_description: Boolean(kitInfo.description), |
| 18568 |
kit_page_count: contentCounts.page || 0, |
| 18569 |
kit_post_count: contentCounts.post || 0, |
| 18570 |
kit_post_type_count: (_exportedData$manifes = exportedData.manifest) !== null && _exportedData$manifes !== void 0 && _exportedData$manifes["custom-post-type-title"] ? Object.keys((_exportedData$manifes2 = exportedData.manifest) === null || _exportedData$manifes2 === void 0 ? void 0 : _exportedData$manifes2["custom-post-type-title"]).length : 0, |
| 18571 |
kit_source: kitInfo.source |
| 18572 |
}); |
| 18573 |
} |
| 18574 |
}, [ |
| 18575 |
includes, |
| 18576 |
exportedData === null || exportedData === void 0 ? void 0 : exportedData.manifest, |
| 18577 |
analytics === null || analytics === void 0 ? void 0 : analytics.customization, |
| 18578 |
kitInfo.description |
| 18579 |
]); |
| 18580 |
var handleDone = function handleDone() { |
| 18581 |
window.top.location = elementorAppConfig.admin_url; |
| 18582 |
}; |
| 18583 |
if (!isCompleted) return /*#__PURE__*/ react.default.createElement(Redirect, { |
| 18584 |
to: "/export-customization/", |
| 18585 |
replace: true |
| 18586 |
}); |
| 18587 |
var isCloudExport = "cloud" === kitInfo.source; |
| 18588 |
var footerContent = /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 18589 |
direction: "row", |
| 18590 |
spacing: 1 |
| 18591 |
}, isCloudExport ? /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 18592 |
variant: "contained", |
| 18593 |
color: "primary", |
| 18594 |
size: "small", |
| 18595 |
onClick: function onClick() { |
| 18596 |
return navigate("/kit-library/cloud"); |
| 18597 |
}, |
| 18598 |
"data-testid": "view-in-library-button" |
| 18599 |
}, (0, _wordpress_i18n.__)("View in Library", "elementor")) : /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 18600 |
variant: "contained", |
| 18601 |
color: "primary", |
| 18602 |
size: "small", |
| 18603 |
onClick: handleDone, |
| 18604 |
"data-testid": "done-button" |
| 18605 |
}, (0, _wordpress_i18n.__)("Done", "elementor"))); |
| 18606 |
var headerContent = /*#__PURE__*/ react.default.createElement(PageHeader, { title: (0, _wordpress_i18n.__)("Export", "elementor") }); |
| 18607 |
var getTemplatesSummary = function getTemplatesSummary() { |
| 18608 |
var _exportedData$manifes3; |
| 18609 |
var _elementorAppConfig$i; |
| 18610 |
var templates = exportedData === null || exportedData === void 0 || (_exportedData$manifes3 = exportedData.manifest) === null || _exportedData$manifes3 === void 0 ? void 0 : _exportedData$manifes3.templates; |
| 18611 |
if (!templates) return (0, _wordpress_i18n.__)("No templates exported", "elementor"); |
| 18612 |
var templatesByType = {}; |
| 18613 |
Object.values(templates).forEach(function(template) { |
| 18614 |
var docType = template.doc_type; |
| 18615 |
if (!templatesByType[docType]) templatesByType[docType] = 0; |
| 18616 |
templatesByType[docType]++; |
| 18617 |
}); |
| 18618 |
var summaryTitles = ((_elementorAppConfig$i = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i === void 0 || (_elementorAppConfig$i = _elementorAppConfig$i.summaryTitles) === null || _elementorAppConfig$i === void 0 ? void 0 : _elementorAppConfig$i.templates) || {}; |
| 18619 |
var summaryParts = Object.entries(templatesByType).map(function(_ref) { |
| 18620 |
var _ref2 = _slicedToArray(_ref, 2); |
| 18621 |
var docType = _ref2[0]; |
| 18622 |
var count = _ref2[1]; |
| 18623 |
var label = summaryTitles[docType]; |
| 18624 |
if (!label) return null; |
| 18625 |
var title = count > 1 ? label.plural : label.single; |
| 18626 |
return "".concat(count, " ").concat(title); |
| 18627 |
}).filter(function(part) { |
| 18628 |
return part !== null; |
| 18629 |
}); |
| 18630 |
return summaryParts.length > 0 ? summaryParts.join(" | ") : (0, _wordpress_i18n.__)("No templates exported", "elementor"); |
| 18631 |
}; |
| 18632 |
var getContentCounts = function getContentCounts() { |
| 18633 |
var _exportedData$manifes4; |
| 18634 |
var _exportedData$manifes5; |
| 18635 |
var content = exportedData === null || exportedData === void 0 || (_exportedData$manifes4 = exportedData.manifest) === null || _exportedData$manifes4 === void 0 ? void 0 : _exportedData$manifes4.content; |
| 18636 |
var wpContent = exportedData === null || exportedData === void 0 || (_exportedData$manifes5 = exportedData.manifest) === null || _exportedData$manifes5 === void 0 ? void 0 : _exportedData$manifes5["wp-content"]; |
| 18637 |
var counts = {}; |
| 18638 |
var countItems = function countItems(_ref3) { |
| 18639 |
var _ref4 = _slicedToArray(_ref3, 2); |
| 18640 |
var docType = _ref4[0]; |
| 18641 |
var docs = _ref4[1]; |
| 18642 |
var count = Object.keys(docs).length; |
| 18643 |
if (count > 0) counts[docType] = (counts[docType] || 0) + count; |
| 18644 |
}; |
| 18645 |
Object.entries(content || {}).forEach(countItems); |
| 18646 |
Object.entries(wpContent || {}).forEach(countItems); |
| 18647 |
return counts; |
| 18648 |
}; |
| 18649 |
var summaryData = { |
| 18650 |
content: { |
| 18651 |
title: (0, _wordpress_i18n.__)("Content", "elementor"), |
| 18652 |
subTitle: function getContentSummary() { |
| 18653 |
var _exportedData$manifes6; |
| 18654 |
var _exportedData$manifes7; |
| 18655 |
var _exportedData$manifes8; |
| 18656 |
var _elementorAppConfig$i2; |
| 18657 |
var content = exportedData === null || exportedData === void 0 || (_exportedData$manifes6 = exportedData.manifest) === null || _exportedData$manifes6 === void 0 ? void 0 : _exportedData$manifes6.content; |
| 18658 |
var wpContent = exportedData === null || exportedData === void 0 || (_exportedData$manifes7 = exportedData.manifest) === null || _exportedData$manifes7 === void 0 ? void 0 : _exportedData$manifes7["wp-content"]; |
| 18659 |
var taxonomies = exportedData === null || exportedData === void 0 || (_exportedData$manifes8 = exportedData.manifest) === null || _exportedData$manifes8 === void 0 ? void 0 : _exportedData$manifes8.taxonomies; |
| 18660 |
if (!content && !wpContent && !taxonomies) return (0, _wordpress_i18n.__)("No content exported", "elementor"); |
| 18661 |
var summaryTitles = ((_elementorAppConfig$i2 = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i2 === void 0 || (_elementorAppConfig$i2 = _elementorAppConfig$i2.summaryTitles) === null || _elementorAppConfig$i2 === void 0 ? void 0 : _elementorAppConfig$i2.content) || {}; |
| 18662 |
var counts = getContentCounts(); |
| 18663 |
var summaryPartsMap = {}; |
| 18664 |
Object.entries(counts).forEach(function(_ref5) { |
| 18665 |
var _ref6 = _slicedToArray(_ref5, 2); |
| 18666 |
var docType = _ref6[0]; |
| 18667 |
var count = _ref6[1]; |
| 18668 |
var label = summaryTitles[docType]; |
| 18669 |
if (!label) return; |
| 18670 |
summaryPartsMap[docType] = { |
| 18671 |
count, |
| 18672 |
title: count > 1 ? label.plural : label.single |
| 18673 |
}; |
| 18674 |
}); |
| 18675 |
if (Object.keys(taxonomies || {}).length) { |
| 18676 |
var allTaxonomiesSet = /* @__PURE__ */ new Set(); |
| 18677 |
Object.values(taxonomies).forEach(function(postTypeTaxonomies) { |
| 18678 |
postTypeTaxonomies.forEach(function(taxonomy) { |
| 18679 |
allTaxonomiesSet.add(taxonomy.name); |
| 18680 |
}); |
| 18681 |
}); |
| 18682 |
if (allTaxonomiesSet.size) summaryPartsMap.taxonomies = { |
| 18683 |
count: allTaxonomiesSet.size, |
| 18684 |
title: (0, _wordpress_i18n.__)("Taxonomies", "elementor") |
| 18685 |
}; |
| 18686 |
} |
| 18687 |
var summaryParts = Object.values(summaryPartsMap).map(function(_ref7) { |
| 18688 |
var count = _ref7.count; |
| 18689 |
var title = _ref7.title; |
| 18690 |
return "".concat(count, " ").concat(title); |
| 18691 |
}); |
| 18692 |
return summaryParts.length > 0 ? summaryParts.join(" | ") : (0, _wordpress_i18n.__)("No content exported", "elementor"); |
| 18693 |
}() |
| 18694 |
}, |
| 18695 |
templates: { |
| 18696 |
title: (0, _wordpress_i18n.__)("Templates", "elementor"), |
| 18697 |
subTitle: getTemplatesSummary() |
| 18698 |
}, |
| 18699 |
settings: { |
| 18700 |
title: (0, _wordpress_i18n.__)("Site settings", "elementor"), |
| 18701 |
subTitle: function getSettingsSummary() { |
| 18702 |
var _exportedData$manifes1; |
| 18703 |
var siteSettings = exportedData === null || exportedData === void 0 || (_exportedData$manifes1 = exportedData.manifest) === null || _exportedData$manifes1 === void 0 ? void 0 : _exportedData$manifes1["site-settings"]; |
| 18704 |
if (!siteSettings) return (0, _wordpress_i18n.__)("No settings exported", "elementor"); |
| 18705 |
var summary = buildKitSettingsSummary(siteSettings); |
| 18706 |
return summary.length > 0 ? summary : (0, _wordpress_i18n.__)("No settings exported", "elementor"); |
| 18707 |
}() |
| 18708 |
}, |
| 18709 |
plugins: { |
| 18710 |
title: (0, _wordpress_i18n.__)("Plugins", "elementor"), |
| 18711 |
subTitle: function getPluginsSummary() { |
| 18712 |
var _exportedData$manifes9; |
| 18713 |
var _exportedData$manifes0; |
| 18714 |
return exportedData !== null && exportedData !== void 0 && (_exportedData$manifes9 = exportedData.manifest) !== null && _exportedData$manifes9 !== void 0 && _exportedData$manifes9.plugins ? exportedData === null || exportedData === void 0 || (_exportedData$manifes0 = exportedData.manifest) === null || _exportedData$manifes0 === void 0 ? void 0 : _exportedData$manifes0.plugins.map(function(plugin) { |
| 18715 |
return plugin.name; |
| 18716 |
}).join(" | ") : (0, _wordpress_i18n.__)("No plugins exported", "elementor"); |
| 18717 |
}() |
| 18718 |
} |
| 18719 |
}; |
| 18720 |
return /*#__PURE__*/ react.default.createElement(BaseLayout, { |
| 18721 |
topBar: /*#__PURE__*/ react.default.createElement(TopBar, null, headerContent), |
| 18722 |
footer: /*#__PURE__*/ react.default.createElement(Footer, null, footerContent) |
| 18723 |
}, /*#__PURE__*/ react.default.createElement(CenteredContent, { |
| 18724 |
hasFooter: true, |
| 18725 |
maxWidth: "800px" |
| 18726 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 18727 |
spacing: 3, |
| 18728 |
alignItems: "center", |
| 18729 |
"data-testid": "export-complete-content" |
| 18730 |
}, /*#__PURE__*/ react.default.createElement(CompleteIcon, { |
| 18731 |
imageSrc: elementorAppConfig.assets_url + "images/kit-is-live.svg", |
| 18732 |
altText: "", |
| 18733 |
testId: "export-complete-icon" |
| 18734 |
}), /*#__PURE__*/ react.default.createElement(CompleteHeading, { |
| 18735 |
title: isCloudExport ? (0, _wordpress_i18n.__)("Your website template is now saved to the library!", "elementor") : (0, _wordpress_i18n.__)("Your .zip file is ready", "elementor"), |
| 18736 |
subtitle: isCloudExport ? (0, _wordpress_i18n.__)("You can find it in the My Website Templates tab.", "elementor") : (0, _wordpress_i18n.__)("Once the download is complete, you can upload it to be used for other sites.", "elementor"), |
| 18737 |
linkText: isCloudExport ? (0, _wordpress_i18n.__)("Take me there", "elementor") : void 0, |
| 18738 |
linkHref: isCloudExport ? elementorAppConfig.base_url + "#/kit-library/cloud" : void 0, |
| 18739 |
testId: "export-complete-heading" |
| 18740 |
}), /*#__PURE__*/ react.default.createElement(CompleteSummary, { |
| 18741 |
summaryData, |
| 18742 |
testId: "export-complete-summary" |
| 18743 |
}), !isCloudExport && /*#__PURE__*/ react.default.createElement(DownloadLink$1, { |
| 18744 |
message: (0, _wordpress_i18n.__)("Is the automatic download not starting?", "elementor"), |
| 18745 |
linkText: (0, _wordpress_i18n.__)("Download manually", "elementor"), |
| 18746 |
onClick: downloadFile, |
| 18747 |
testId: "export-complete-download-link" |
| 18748 |
})))); |
| 18749 |
} |
| 18750 |
|
| 18751 |
//#endregion |
| 18752 |
//#region app/modules/import-export-customization/assets/js/export/export.js |
| 18753 |
init_es$1(); |
| 18754 |
init_es(); |
| 18755 |
var queryClient$1 = new QueryClient({ defaultOptions: { queries: { |
| 18756 |
refetchOnWindowFocus: false, |
| 18757 |
retry: false, |
| 18758 |
staleTime: 1e3 * 60 * 30 |
| 18759 |
} } }); |
| 18760 |
function Export() { |
| 18761 |
return /*#__PURE__*/ react.default.createElement(QueryClientProvider, { client: queryClient$1 }, /*#__PURE__*/ react.default.createElement(ExportContextProvider, null, /*#__PURE__*/ react.default.createElement(LocationProvider, { history: _elementor_router.default.appHistory }, /*#__PURE__*/ react.default.createElement(Router, null, /*#__PURE__*/ react.default.createElement(ExportKit, { |
| 18762 |
path: "/", |
| 18763 |
default: true |
| 18764 |
}), /*#__PURE__*/ react.default.createElement(ExportProcess, { path: "/process" }), /*#__PURE__*/ react.default.createElement(ExportComplete, { path: "/complete" }))))); |
| 18765 |
} |
| 18766 |
|
| 18767 |
//#endregion |
| 18768 |
//#region app/modules/import-export-customization/assets/js/import/utils/file-validation.js |
| 18769 |
init_toConsumableArray(); |
| 18770 |
var getMimeTypeToExtensionMap = function getMimeTypeToExtensionMap() { |
| 18771 |
return { |
| 18772 |
"application/zip": ["zip"], |
| 18773 |
"application/json": ["json"], |
| 18774 |
"application/pdf": ["pdf"], |
| 18775 |
"text/plain": ["txt"], |
| 18776 |
"image/jpeg": ["jpg", "jpeg"], |
| 18777 |
"image/png": ["png"], |
| 18778 |
"image/gif": ["gif"], |
| 18779 |
"text/csv": ["csv"], |
| 18780 |
"application/xml": ["xml"], |
| 18781 |
"text/xml": ["xml"] |
| 18782 |
}; |
| 18783 |
}; |
| 18784 |
var getValidExtensions = function getValidExtensions(filetypes) { |
| 18785 |
var mimeToExtMap = getMimeTypeToExtensionMap(); |
| 18786 |
var validExtensions = []; |
| 18787 |
filetypes.forEach(function(mimeType) { |
| 18788 |
if (mimeToExtMap[mimeType]) validExtensions.push.apply(validExtensions, _toConsumableArray(mimeToExtMap[mimeType])); |
| 18789 |
}); |
| 18790 |
return validExtensions; |
| 18791 |
}; |
| 18792 |
var isValidFileType = function isValidFileType(fileType) { |
| 18793 |
var fileName = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; |
| 18794 |
var filetypes = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; |
| 18795 |
if (0 === filetypes.length) return true; |
| 18796 |
if (filetypes.includes(fileType)) return true; |
| 18797 |
var extension = fileName.toLowerCase().split(".").pop(); |
| 18798 |
return getValidExtensions(filetypes).includes(extension); |
| 18799 |
}; |
| 18800 |
var getAcceptedFileTypes = function getAcceptedFileTypes(filetypes) { |
| 18801 |
var acceptTypes = _toConsumableArray(filetypes); |
| 18802 |
getValidExtensions(filetypes).forEach(function(ext) { |
| 18803 |
acceptTypes.push(".".concat(ext)); |
| 18804 |
}); |
| 18805 |
return acceptTypes.join(","); |
| 18806 |
}; |
| 18807 |
|
| 18808 |
//#endregion |
| 18809 |
//#region app/modules/import-export-customization/assets/js/import/hooks/use-drop-zone.js |
| 18810 |
init_slicedToArray(); |
| 18811 |
var useDropZone = function useDropZone(_ref) { |
| 18812 |
var onFileSelect = _ref.onFileSelect; |
| 18813 |
var onError = _ref.onError; |
| 18814 |
var filetypes = _ref.filetypes; |
| 18815 |
var isLoading = _ref.isLoading; |
| 18816 |
var onButtonClick = _ref.onButtonClick; |
| 18817 |
var onFileChoose = _ref.onFileChoose; |
| 18818 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 18819 |
var isDragOver = _useState2[0]; |
| 18820 |
var setIsDragOver = _useState2[1]; |
| 18821 |
var setDragCounter = _slicedToArray((0, react.useState)(0), 2)[1]; |
| 18822 |
var fileInputRef = (0, react.useRef)(null); |
| 18823 |
return { |
| 18824 |
isDragOver, |
| 18825 |
fileInputRef, |
| 18826 |
fileInputId: (0, react.useId)(), |
| 18827 |
handleDragEnter: function handleDragEnter(e) { |
| 18828 |
e.preventDefault(); |
| 18829 |
e.stopPropagation(); |
| 18830 |
setDragCounter(function(prev) { |
| 18831 |
return prev + 1; |
| 18832 |
}); |
| 18833 |
if (e.dataTransfer.items && e.dataTransfer.items.length > 0) setIsDragOver(true); |
| 18834 |
}, |
| 18835 |
handleDragLeave: function handleDragLeave(e) { |
| 18836 |
e.preventDefault(); |
| 18837 |
e.stopPropagation(); |
| 18838 |
setDragCounter(function(prev) { |
| 18839 |
var newCounter = prev - 1; |
| 18840 |
if (newCounter <= 0) setIsDragOver(false); |
| 18841 |
return newCounter; |
| 18842 |
}); |
| 18843 |
}, |
| 18844 |
handleDragOver: function handleDragOver(e) { |
| 18845 |
e.preventDefault(); |
| 18846 |
e.stopPropagation(); |
| 18847 |
}, |
| 18848 |
handleDrop: function handleDrop(e) { |
| 18849 |
e.preventDefault(); |
| 18850 |
e.stopPropagation(); |
| 18851 |
setIsDragOver(false); |
| 18852 |
setDragCounter(0); |
| 18853 |
if (isLoading) return; |
| 18854 |
if (!e.dataTransfer.files || 0 === e.dataTransfer.files.length) return; |
| 18855 |
var file = e.dataTransfer.files[0]; |
| 18856 |
if (file && isValidFileType(file.type, file.name, filetypes)) onFileSelect(file, e, "drop"); |
| 18857 |
else onError({ |
| 18858 |
id: "file_not_allowed", |
| 18859 |
message: (0, _wordpress_i18n.__)("This file type is not allowed", "elementor") |
| 18860 |
}); |
| 18861 |
}, |
| 18862 |
handleFileInputChange: function handleFileInputChange(e) { |
| 18863 |
if (!e.target.files || 0 === e.target.files.length) return; |
| 18864 |
var file = e.target.files[0]; |
| 18865 |
if (!file) return; |
| 18866 |
if (!isValidFileType(file.type, file.name, filetypes)) { |
| 18867 |
onError({ |
| 18868 |
id: "file_not_allowed", |
| 18869 |
message: (0, _wordpress_i18n.__)("This file type is not allowed", "elementor") |
| 18870 |
}); |
| 18871 |
return; |
| 18872 |
} |
| 18873 |
onFileSelect(file, e, "browse"); |
| 18874 |
if (onFileChoose) onFileChoose(file); |
| 18875 |
}, |
| 18876 |
handleUploadClick: function handleUploadClick(e) { |
| 18877 |
if (onButtonClick) onButtonClick(e); |
| 18878 |
if (fileInputRef.current) fileInputRef.current.click(); |
| 18879 |
} |
| 18880 |
}; |
| 18881 |
}; |
| 18882 |
|
| 18883 |
//#endregion |
| 18884 |
//#region app/modules/import-export-customization/assets/js/import/components/drop-zone.js |
| 18885 |
init_extends(); |
| 18886 |
init_objectWithoutProperties(); |
| 18887 |
var _excluded = [ |
| 18888 |
"onFileSelect", |
| 18889 |
"onError", |
| 18890 |
"filetypes", |
| 18891 |
"className", |
| 18892 |
"isLoading", |
| 18893 |
"error", |
| 18894 |
"onButtonClick", |
| 18895 |
"onFileChoose", |
| 18896 |
"helperText" |
| 18897 |
]; |
| 18898 |
var StyledDropZoneBox = (0, _elementor_ui.styled)(_elementor_ui.Box, { shouldForwardProp: function shouldForwardProp(prop) { |
| 18899 |
return !["isDragOver", "isLoading"].includes(prop); |
| 18900 |
} })(function(_ref) { |
| 18901 |
var theme = _ref.theme; |
| 18902 |
var isDragOver = _ref.isDragOver; |
| 18903 |
var isLoading = _ref.isLoading; |
| 18904 |
return { |
| 18905 |
border: 2, |
| 18906 |
borderColor: isDragOver ? theme.palette.primary.main : theme.palette.divider, |
| 18907 |
borderStyle: "dashed", |
| 18908 |
backgroundColor: isDragOver ? theme.palette.action.hover : theme.palette.background.default, |
| 18909 |
transition: "all 0.2s ease-in-out", |
| 18910 |
cursor: isLoading ? "not-allowed" : "normal", |
| 18911 |
position: "relative", |
| 18912 |
borderRadius: theme.spacing(.5) |
| 18913 |
}; |
| 18914 |
}); |
| 18915 |
var StyledContentStack = (0, _elementor_ui.styled)(_elementor_ui.Stack, { shouldForwardProp: function shouldForwardProp(prop) { |
| 18916 |
return prop !== "isLoading"; |
| 18917 |
} })(function(_ref2) { |
| 18918 |
return { |
| 18919 |
opacity: _ref2.isLoading ? .5 : 1, |
| 18920 |
transition: "opacity 0.2s ease-in-out" |
| 18921 |
}; |
| 18922 |
}); |
| 18923 |
var DropZone = function DropZone(_ref3) { |
| 18924 |
var onFileSelect = _ref3.onFileSelect; |
| 18925 |
var _ref3$onError = _ref3.onError; |
| 18926 |
var onError = _ref3$onError === void 0 ? function() {} : _ref3$onError; |
| 18927 |
var _ref3$filetypes = _ref3.filetypes; |
| 18928 |
var filetypes = _ref3$filetypes === void 0 ? ["application/zip"] : _ref3$filetypes; |
| 18929 |
var _ref3$className = _ref3.className; |
| 18930 |
var className = _ref3$className === void 0 ? "" : _ref3$className; |
| 18931 |
var _ref3$isLoading = _ref3.isLoading; |
| 18932 |
var isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading; |
| 18933 |
var error = _ref3.error; |
| 18934 |
var onButtonClick = _ref3.onButtonClick; |
| 18935 |
var onFileChoose = _ref3.onFileChoose; |
| 18936 |
var _ref3$helperText = _ref3.helperText; |
| 18937 |
var helperText = _ref3$helperText === void 0 ? (0, _wordpress_i18n.__)("Upload a .zip file", "elementor") : _ref3$helperText; |
| 18938 |
var props = _objectWithoutProperties(_ref3, _excluded); |
| 18939 |
var _useDropZone = useDropZone({ |
| 18940 |
onFileSelect, |
| 18941 |
onError, |
| 18942 |
filetypes, |
| 18943 |
isLoading, |
| 18944 |
onButtonClick, |
| 18945 |
onFileChoose |
| 18946 |
}); |
| 18947 |
var isDragOver = _useDropZone.isDragOver; |
| 18948 |
var fileInputRef = _useDropZone.fileInputRef; |
| 18949 |
var fileInputId = _useDropZone.fileInputId; |
| 18950 |
var handleDragEnter = _useDropZone.handleDragEnter; |
| 18951 |
var handleDragLeave = _useDropZone.handleDragLeave; |
| 18952 |
var handleDragOver = _useDropZone.handleDragOver; |
| 18953 |
var handleDrop = _useDropZone.handleDrop; |
| 18954 |
var handleFileInputChange = _useDropZone.handleFileInputChange; |
| 18955 |
var handleUploadClick = _useDropZone.handleUploadClick; |
| 18956 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, _extends({ |
| 18957 |
className, |
| 18958 |
onDragEnter: handleDragEnter, |
| 18959 |
onDragLeave: handleDragLeave, |
| 18960 |
onDragOver: handleDragOver, |
| 18961 |
onDrop: handleDrop, |
| 18962 |
"data-testid": "drop-zone" |
| 18963 |
}, props), /*#__PURE__*/ react.default.createElement(StyledDropZoneBox, { |
| 18964 |
isDragOver, |
| 18965 |
isLoading |
| 18966 |
}, /*#__PURE__*/ react.default.createElement(StyledContentStack, { |
| 18967 |
alignItems: "center", |
| 18968 |
justifyContent: "center", |
| 18969 |
gap: 1, |
| 18970 |
p: 6, |
| 18971 |
minHeight: "520px", |
| 18972 |
isLoading |
| 18973 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { "data-testid": "icon-container" }, isLoading ? /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { |
| 18974 |
size: 40, |
| 18975 |
"data-testid": "loading-spinner", |
| 18976 |
sx: { color: "primary.dark" } |
| 18977 |
}) : /*#__PURE__*/ react.default.createElement(_elementor_icons.UploadIcon, { |
| 18978 |
"data-testid": "upload-icon", |
| 18979 |
sx: { |
| 18980 |
fontSize: "40px", |
| 18981 |
color: "text.disabled" |
| 18982 |
} |
| 18983 |
})), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 18984 |
spacing: 2, |
| 18985 |
alignItems: "center", |
| 18986 |
textAlign: "center", |
| 18987 |
"data-testid": "text-container" |
| 18988 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { "data-testid": "main-text" }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 18989 |
variant: "body1", |
| 18990 |
component: "span", |
| 18991 |
onClick: handleUploadClick, |
| 18992 |
"data-testid": "click-to-upload" |
| 18993 |
}, (0, _wordpress_i18n.__)("Click to upload", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 18994 |
variant: "body1", |
| 18995 |
component: "span", |
| 18996 |
color: "text.primary", |
| 18997 |
sx: { marginLeft: .5 } |
| 18998 |
}, (0, _wordpress_i18n.__)("or drag and drop", "elementor"))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 18999 |
variant: "body2", |
| 19000 |
color: error ? "error" : "text.secondary", |
| 19001 |
"data-testid": "helper-text" |
| 19002 |
}, error ? error.message : helperText)), /*#__PURE__*/ react.default.createElement("input", { |
| 19003 |
ref: fileInputRef, |
| 19004 |
id: fileInputId, |
| 19005 |
type: "file", |
| 19006 |
accept: getAcceptedFileTypes(filetypes), |
| 19007 |
onChange: handleFileInputChange, |
| 19008 |
style: { display: "none" }, |
| 19009 |
"data-testid": "file-input" |
| 19010 |
})))); |
| 19011 |
}; |
| 19012 |
DropZone.propTypes = { |
| 19013 |
className: import_prop_types$55.default.string, |
| 19014 |
onFileSelect: import_prop_types$55.default.func.isRequired, |
| 19015 |
onError: import_prop_types$55.default.func, |
| 19016 |
filetypes: import_prop_types$55.default.array, |
| 19017 |
isLoading: import_prop_types$55.default.bool, |
| 19018 |
error: import_prop_types$55.default.shape({ message: import_prop_types$55.default.string.isRequired }), |
| 19019 |
onButtonClick: import_prop_types$55.default.func, |
| 19020 |
onFileChoose: import_prop_types$55.default.func, |
| 19021 |
helperText: import_prop_types$55.default.string |
| 19022 |
}; |
| 19023 |
|
| 19024 |
//#endregion |
| 19025 |
//#region app/modules/import-export-customization/assets/js/import/hooks/use-upload-kit.js |
| 19026 |
init_defineProperty$1(); |
| 19027 |
init_asyncToGenerator(); |
| 19028 |
init_slicedToArray(); |
| 19029 |
init_apps_event_tracking(); |
| 19030 |
function ownKeys$12(e, r) { |
| 19031 |
var t = Object.keys(e); |
| 19032 |
if (Object.getOwnPropertySymbols) { |
| 19033 |
var o = Object.getOwnPropertySymbols(e); |
| 19034 |
r && (o = o.filter(function(r) { |
| 19035 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 19036 |
})), t.push.apply(t, o); |
| 19037 |
} |
| 19038 |
return t; |
| 19039 |
} |
| 19040 |
__name(ownKeys$12, "ownKeys"); |
| 19041 |
function _objectSpread$11(e) { |
| 19042 |
for (var r = 1; r < arguments.length; r++) { |
| 19043 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 19044 |
r % 2 ? ownKeys$12(Object(t), !0).forEach(function(r) { |
| 19045 |
_defineProperty$1(e, r, t[r]); |
| 19046 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$12(Object(t)).forEach(function(r) { |
| 19047 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 19048 |
}); |
| 19049 |
} |
| 19050 |
return e; |
| 19051 |
} |
| 19052 |
__name(_objectSpread$11, "_objectSpread"); |
| 19053 |
function useUploadKit() { |
| 19054 |
var _useImportContext = useImportContext(); |
| 19055 |
var data = _useImportContext.data; |
| 19056 |
var isUploading = _useImportContext.isUploading; |
| 19057 |
var dispatch = _useImportContext.dispatch; |
| 19058 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 19059 |
var uploading = _useState2[0]; |
| 19060 |
var setUploading = _useState2[1]; |
| 19061 |
var _useState4 = _slicedToArray((0, react.useState)(null), 2); |
| 19062 |
var error = _useState4[0]; |
| 19063 |
var setError = _useState4[1]; |
| 19064 |
function uploadKit() { |
| 19065 |
return _uploadKit.apply(this, arguments); |
| 19066 |
} |
| 19067 |
function _uploadKit() { |
| 19068 |
_uploadKit = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee() { |
| 19069 |
var _window$wpApiSettings; |
| 19070 |
var baseUrl; |
| 19071 |
var uploadUrl; |
| 19072 |
var uploadData; |
| 19073 |
var _data$kitUploadParams; |
| 19074 |
var id; |
| 19075 |
var source; |
| 19076 |
var fileUrl; |
| 19077 |
var response; |
| 19078 |
var result; |
| 19079 |
var _result$data; |
| 19080 |
var _result$data2; |
| 19081 |
var _result$data3; |
| 19082 |
var errorMessage; |
| 19083 |
var errorCode; |
| 19084 |
var _t; |
| 19085 |
return import_regenerator$1.default.wrap(function(_context) { |
| 19086 |
while (1) switch (_context.prev = _context.next) { |
| 19087 |
case 0: |
| 19088 |
_context.prev = 0; |
| 19089 |
setUploading(true); |
| 19090 |
setError(null); |
| 19091 |
baseUrl = elementorAppConfig["import-export-customization"].restApiBaseUrl; |
| 19092 |
uploadUrl = "".concat(baseUrl, "/upload"); |
| 19093 |
uploadData = null; |
| 19094 |
if (data.file) { |
| 19095 |
uploadData = new FormData(); |
| 19096 |
uploadData.append("e_import_file", data.file); |
| 19097 |
} |
| 19098 |
if (data.kitUploadParams) { |
| 19099 |
_data$kitUploadParams = data.kitUploadParams, id = _data$kitUploadParams.id, source = _data$kitUploadParams.source, fileUrl = _data$kitUploadParams.fileUrl; |
| 19100 |
uploadData = JSON.stringify({ |
| 19101 |
referrer: source, |
| 19102 |
source, |
| 19103 |
kit_id: id, |
| 19104 |
file_url: fileUrl |
| 19105 |
}); |
| 19106 |
} |
| 19107 |
_context.next = 1; |
| 19108 |
return fetch(uploadUrl, { |
| 19109 |
method: "POST", |
| 19110 |
headers: _objectSpread$11({ "X-WP-Nonce": ((_window$wpApiSettings = window.wpApiSettings) === null || _window$wpApiSettings === void 0 ? void 0 : _window$wpApiSettings.nonce) || "" }, "string" === typeof uploadData ? { "Content-Type": "application/json" } : null), |
| 19111 |
body: uploadData |
| 19112 |
}); |
| 19113 |
case 1: |
| 19114 |
response = _context.sent; |
| 19115 |
_context.next = 2; |
| 19116 |
return response.json(); |
| 19117 |
case 2: |
| 19118 |
result = _context.sent; |
| 19119 |
if (response.ok) { |
| 19120 |
_context.next = 3; |
| 19121 |
break; |
| 19122 |
} |
| 19123 |
errorMessage = (result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.message) || "HTTP error! with the following code: ".concat(result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.code); |
| 19124 |
errorCode = 408 === (response === null || response === void 0 ? void 0 : response.status) ? "timeout" : result === null || result === void 0 || (_result$data3 = result.data) === null || _result$data3 === void 0 ? void 0 : _result$data3.code; |
| 19125 |
throw new ImportExportError(errorMessage, errorCode); |
| 19126 |
case 3: |
| 19127 |
if (data.file) AppsEventTracking.sendKitImportUploadFile("Success"); |
| 19128 |
dispatch({ |
| 19129 |
type: "SET_UPLOADED_DATA", |
| 19130 |
payload: result.data |
| 19131 |
}); |
| 19132 |
_context.next = 5; |
| 19133 |
break; |
| 19134 |
case 4: |
| 19135 |
_context.prev = 4; |
| 19136 |
_t = _context["catch"](0); |
| 19137 |
setError(_t instanceof ImportExportError ? _t : new ImportExportError(_t.message)); |
| 19138 |
AppsEventTracking.sendKitImportUploadFile(_t.message); |
| 19139 |
case 5: |
| 19140 |
_context.prev = 5; |
| 19141 |
setUploading(false); |
| 19142 |
return _context.finish(5); |
| 19143 |
case 6: |
| 19144 |
case "end": return _context.stop(); |
| 19145 |
} |
| 19146 |
}, _callee, null, [[ |
| 19147 |
0, |
| 19148 |
4, |
| 19149 |
5, |
| 19150 |
6 |
| 19151 |
]]); |
| 19152 |
})); |
| 19153 |
return _uploadKit.apply(this, arguments); |
| 19154 |
} |
| 19155 |
(0, react.useEffect)(function() { |
| 19156 |
if (isUploading && (data.file || data.kitUploadParams)) uploadKit(); |
| 19157 |
else setError(null); |
| 19158 |
}, [ |
| 19159 |
isUploading, |
| 19160 |
data.file, |
| 19161 |
data.kitUploadParams |
| 19162 |
]); |
| 19163 |
return { |
| 19164 |
uploading, |
| 19165 |
error, |
| 19166 |
uploadKit |
| 19167 |
}; |
| 19168 |
} |
| 19169 |
|
| 19170 |
//#endregion |
| 19171 |
//#region app/modules/import-export-customization/assets/js/shared/utils/is-valid-redirect-url.js |
| 19172 |
function isValidRedirectUrl(url) { |
| 19173 |
try { |
| 19174 |
var parsedUrl = new URL(url); |
| 19175 |
return parsedUrl.hostname === window.location.hostname && ("http:" === parsedUrl.protocol || "https:" === parsedUrl.protocol); |
| 19176 |
} catch (e) { |
| 19177 |
return false; |
| 19178 |
} |
| 19179 |
} |
| 19180 |
|
| 19181 |
//#endregion |
| 19182 |
//#region app/modules/import-export-customization/assets/js/shared/utils/safe-redirect.js |
| 19183 |
function safeRedirect(url) { |
| 19184 |
try { |
| 19185 |
var decodedUrl = decodeURIComponent(url); |
| 19186 |
if (decodedUrl.startsWith("/")) decodedUrl = window.location.origin + decodedUrl; |
| 19187 |
if (isValidRedirectUrl(decodedUrl)) { |
| 19188 |
window.location.href = decodedUrl; |
| 19189 |
return true; |
| 19190 |
} |
| 19191 |
} catch (e) { |
| 19192 |
return false; |
| 19193 |
} |
| 19194 |
} |
| 19195 |
|
| 19196 |
//#endregion |
| 19197 |
//#region app/modules/import-export-customization/assets/js/shared/hooks/use-return-to-redirect.js |
| 19198 |
function useReturnToRedirect(returnTo) { |
| 19199 |
return { attemptRedirect: (0, react.useCallback)(function(fallbackAction) { |
| 19200 |
if (returnTo && safeRedirect(returnTo)) return true; |
| 19201 |
if (fallbackAction) fallbackAction(); |
| 19202 |
return false; |
| 19203 |
}, [returnTo]) }; |
| 19204 |
} |
| 19205 |
|
| 19206 |
//#endregion |
| 19207 |
//#region app/modules/import-export-customization/assets/js/import/pages/import-kit.js |
| 19208 |
init_es$1(); |
| 19209 |
init_use_query_params(); |
| 19210 |
init_apps_event_tracking(); |
| 19211 |
function ImportKit() { |
| 19212 |
var _useImportContext = useImportContext(); |
| 19213 |
var data = _useImportContext.data; |
| 19214 |
var dispatch = _useImportContext.dispatch; |
| 19215 |
var navigate = useNavigate(); |
| 19216 |
var _useQueryParams$getAl = useQueryParams().getAll(); |
| 19217 |
var id = _useQueryParams$getAl.id; |
| 19218 |
var referrer = _useQueryParams$getAl.referrer; |
| 19219 |
var fileUrl = _useQueryParams$getAl.file_url; |
| 19220 |
var actionType = _useQueryParams$getAl.action_type; |
| 19221 |
var nonce = _useQueryParams$getAl.nonce; |
| 19222 |
var returnToParam = _useQueryParams$getAl.return_to; |
| 19223 |
var noAutomaticRedirectParam = _useQueryParams$getAl.no_automatic_redirect; |
| 19224 |
var _useUploadKit = useUploadKit(); |
| 19225 |
var uploading = _useUploadKit.uploading; |
| 19226 |
var error = _useUploadKit.error; |
| 19227 |
var uploadKit = _useUploadKit.uploadKit; |
| 19228 |
var attemptRedirect = useReturnToRedirect(data.returnTo).attemptRedirect; |
| 19229 |
var headerContent = /*#__PURE__*/ react.default.createElement(PageHeader, { title: (0, _wordpress_i18n.__)("Import", "elementor") }); |
| 19230 |
var onFileSelect = function onFileSelect(file) { |
| 19231 |
dispatch({ |
| 19232 |
type: "SET_IMPORT_STATUS", |
| 19233 |
payload: IMPORT_STATUS.UPLOADING |
| 19234 |
}); |
| 19235 |
dispatch({ |
| 19236 |
type: "SET_FILE", |
| 19237 |
payload: file |
| 19238 |
}); |
| 19239 |
}; |
| 19240 |
var handleTryAgain = function handleTryAgain() { |
| 19241 |
uploadKit(); |
| 19242 |
}; |
| 19243 |
var handleCloseError = function handleCloseError() { |
| 19244 |
var _data$kitUploadParams; |
| 19245 |
var _data$kitUploadParams2; |
| 19246 |
if (attemptRedirect()) return; |
| 19247 |
if (data.file) return dispatch({ |
| 19248 |
type: "SET_EXPORT_STATUS", |
| 19249 |
payload: IMPORT_STATUS.CUSTOMIZING |
| 19250 |
}); |
| 19251 |
var path = "admin.php?page=elementor-tools#tab-import-export-kit"; |
| 19252 |
if ("cloud" === (data === null || data === void 0 || (_data$kitUploadParams = data.kitUploadParams) === null || _data$kitUploadParams === void 0 ? void 0 : _data$kitUploadParams.source)) path = "admin.php?page=elementor-app&source=kit_import#kit-library/cloud"; |
| 19253 |
else if ("kit-library" === (data === null || data === void 0 || (_data$kitUploadParams2 = data.kitUploadParams) === null || _data$kitUploadParams2 === void 0 ? void 0 : _data$kitUploadParams2.source)) path = "admin.php?page=elementor-app&source=kit_import#kit-library"; |
| 19254 |
window.top.location = elementorAppConfig.admin_url + path; |
| 19255 |
}; |
| 19256 |
(0, react.useEffect)(function() { |
| 19257 |
dispatch({ type: "RESET_STATE" }); |
| 19258 |
}, [dispatch]); |
| 19259 |
(0, react.useEffect)(function() { |
| 19260 |
if (data.uploadedData) if (data.actionType === ACTION_TYPE.APPLY_ALL) { |
| 19261 |
var _data$uploadedData; |
| 19262 |
var _data$uploadedData2; |
| 19263 |
var _data$uploadedData3; |
| 19264 |
var _data$uploadedData4; |
| 19265 |
var includes = []; |
| 19266 |
if ((_data$uploadedData = data.uploadedData) !== null && _data$uploadedData !== void 0 && (_data$uploadedData = _data$uploadedData.manifest) !== null && _data$uploadedData !== void 0 && _data$uploadedData["site-settings"]) includes.push("settings"); |
| 19267 |
if (0 < Object.keys(((_data$uploadedData2 = data.uploadedData) === null || _data$uploadedData2 === void 0 || (_data$uploadedData2 = _data$uploadedData2.manifest) === null || _data$uploadedData2 === void 0 ? void 0 : _data$uploadedData2.templates) || {}).length) includes.push("templates"); |
| 19268 |
if ((_data$uploadedData3 = data.uploadedData) !== null && _data$uploadedData3 !== void 0 && (_data$uploadedData3 = _data$uploadedData3.manifest) !== null && _data$uploadedData3 !== void 0 && _data$uploadedData3.content) includes.push("content"); |
| 19269 |
if ((_data$uploadedData4 = data.uploadedData) !== null && _data$uploadedData4 !== void 0 && (_data$uploadedData4 = _data$uploadedData4.manifest) !== null && _data$uploadedData4 !== void 0 && _data$uploadedData4.plugins) includes.push("plugins"); |
| 19270 |
dispatch({ |
| 19271 |
type: "ADD_INCLUDES", |
| 19272 |
payload: includes |
| 19273 |
}); |
| 19274 |
dispatch({ |
| 19275 |
type: "SET_IMPORT_STATUS", |
| 19276 |
payload: IMPORT_STATUS.IMPORTING |
| 19277 |
}); |
| 19278 |
navigate("import-customization/process"); |
| 19279 |
} else { |
| 19280 |
dispatch({ |
| 19281 |
type: "SET_IMPORT_STATUS", |
| 19282 |
payload: IMPORT_STATUS.CUSTOMIZING |
| 19283 |
}); |
| 19284 |
navigate("import-customization/content"); |
| 19285 |
} |
| 19286 |
}, [ |
| 19287 |
data.uploadedData, |
| 19288 |
dispatch, |
| 19289 |
navigate, |
| 19290 |
data.actionType |
| 19291 |
]); |
| 19292 |
(0, react.useEffect)(function() { |
| 19293 |
if (id || fileUrl) { |
| 19294 |
dispatch({ |
| 19295 |
type: "SET_KIT_UPLOAD_PARAMS", |
| 19296 |
payload: { |
| 19297 |
id, |
| 19298 |
source: referrer, |
| 19299 |
fileUrl, |
| 19300 |
nonce |
| 19301 |
} |
| 19302 |
}); |
| 19303 |
if (actionType) dispatch({ |
| 19304 |
type: "SET_ACTION_TYPE", |
| 19305 |
payload: actionType |
| 19306 |
}); |
| 19307 |
if (returnToParam) dispatch({ |
| 19308 |
type: "SET_RETURN_TO", |
| 19309 |
payload: returnToParam |
| 19310 |
}); |
| 19311 |
if ("true" === noAutomaticRedirectParam) dispatch({ |
| 19312 |
type: "SET_NO_AUTOMATIC_REDIRECT", |
| 19313 |
payload: true |
| 19314 |
}); |
| 19315 |
dispatch({ |
| 19316 |
type: "SET_IMPORT_STATUS", |
| 19317 |
payload: IMPORT_STATUS.UPLOADING |
| 19318 |
}); |
| 19319 |
} |
| 19320 |
}, [ |
| 19321 |
id, |
| 19322 |
referrer, |
| 19323 |
fileUrl, |
| 19324 |
actionType, |
| 19325 |
nonce, |
| 19326 |
returnToParam, |
| 19327 |
noAutomaticRedirectParam, |
| 19328 |
dispatch |
| 19329 |
]); |
| 19330 |
(0, react.useEffect)(function() { |
| 19331 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitImportUploadBox); |
| 19332 |
}, []); |
| 19333 |
return /*#__PURE__*/ react.default.createElement(BaseLayout, { topBar: /*#__PURE__*/ react.default.createElement(TopBar, null, headerContent) }, function renderContent() { |
| 19334 |
if (uploading || referrer) return /*#__PURE__*/ react.default.createElement(CenteredContent, { "data-testid": "import-loader" }, /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { size: 30 })); |
| 19335 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19336 |
"data-testid": "content-container", |
| 19337 |
direction: "column", |
| 19338 |
alignItems: "flex-start", |
| 19339 |
justifyContent: "center", |
| 19340 |
sx: { |
| 19341 |
pt: 8, |
| 19342 |
gap: 7, |
| 19343 |
maxWidth: 1080, |
| 19344 |
mx: "auto" |
| 19345 |
} |
| 19346 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19347 |
direction: "column", |
| 19348 |
sx: { gap: 3 } |
| 19349 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 19350 |
variant: "h4", |
| 19351 |
color: "text.primary", |
| 19352 |
"data-testid": "import-title" |
| 19353 |
}, (0, _wordpress_i18n.__)("Import a website template", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 19354 |
variant: "body1", |
| 19355 |
color: "text.secondary", |
| 19356 |
"data-testid": "import-description" |
| 19357 |
}, (0, _wordpress_i18n.__)("Upload a file with templates, site settings, content, etc., and apply them to your site ", "elementor"), /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 19358 |
href: "#", |
| 19359 |
color: "info.light", |
| 19360 |
sx: { |
| 19361 |
ml: 1, |
| 19362 |
textDecoration: "none" |
| 19363 |
}, |
| 19364 |
"data-testid": "import-learn-more-link" |
| 19365 |
}, (0, _wordpress_i18n.__)("Learn more", "elementor")))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19366 |
sx: { width: "100%" }, |
| 19367 |
"data-testid": "import-card" |
| 19368 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 19369 |
sx: { p: 0 }, |
| 19370 |
"data-testid": "import-card-content" |
| 19371 |
}, /*#__PURE__*/ react.default.createElement(DropZone, { onFileSelect })))); |
| 19372 |
}(), /*#__PURE__*/ react.default.createElement(ProcessingErrorDialog, { |
| 19373 |
error, |
| 19374 |
handleClose: handleCloseError, |
| 19375 |
handleTryAgain |
| 19376 |
})); |
| 19377 |
} |
| 19378 |
|
| 19379 |
//#endregion |
| 19380 |
//#region app/modules/import-export-customization/assets/js/import/pages/import-complete.js |
| 19381 |
init_defineProperty$1(); |
| 19382 |
init_slicedToArray(); |
| 19383 |
init_es$1(); |
| 19384 |
init_apps_event_tracking(); |
| 19385 |
function ownKeys$11(e, r) { |
| 19386 |
var t = Object.keys(e); |
| 19387 |
if (Object.getOwnPropertySymbols) { |
| 19388 |
var o = Object.getOwnPropertySymbols(e); |
| 19389 |
r && (o = o.filter(function(r) { |
| 19390 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 19391 |
})), t.push.apply(t, o); |
| 19392 |
} |
| 19393 |
return t; |
| 19394 |
} |
| 19395 |
__name(ownKeys$11, "ownKeys"); |
| 19396 |
function _objectSpread$10(e) { |
| 19397 |
for (var r = 1; r < arguments.length; r++) { |
| 19398 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 19399 |
r % 2 ? ownKeys$11(Object(t), !0).forEach(function(r) { |
| 19400 |
_defineProperty$1(e, r, t[r]); |
| 19401 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$11(Object(t)).forEach(function(r) { |
| 19402 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 19403 |
}); |
| 19404 |
} |
| 19405 |
return e; |
| 19406 |
} |
| 19407 |
__name(_objectSpread$10, "_objectSpread"); |
| 19408 |
function ImportComplete() { |
| 19409 |
var _data$uploadedData; |
| 19410 |
var _data$kitUploadParams; |
| 19411 |
var _runnersState$templat2; |
| 19412 |
var _elementorAppConfig; |
| 19413 |
var _data$kitUploadParams2; |
| 19414 |
var _useImportContext = useImportContext(); |
| 19415 |
var data = _useImportContext.data; |
| 19416 |
var isCompleted = _useImportContext.isCompleted; |
| 19417 |
var runnersState = _useImportContext.runnersState; |
| 19418 |
var includes = data.includes; |
| 19419 |
var analytics = data.analytics; |
| 19420 |
var uploadedData = data.uploadedData; |
| 19421 |
var duration = data.duration; |
| 19422 |
var navigate = useNavigate(); |
| 19423 |
var attemptRedirect = useReturnToRedirect(data.returnTo).attemptRedirect; |
| 19424 |
var handleDone = function handleDone() { |
| 19425 |
if (attemptRedirect()) return; |
| 19426 |
window.top.location = elementorAppConfig.admin_url; |
| 19427 |
}; |
| 19428 |
var title = (data === null || data === void 0 || (_data$uploadedData = data.uploadedData) === null || _data$uploadedData === void 0 || (_data$uploadedData = _data$uploadedData.manifest) === null || _data$uploadedData === void 0 ? void 0 : _data$uploadedData.title) || ""; |
| 19429 |
var kitId = (data === null || data === void 0 || (_data$kitUploadParams = data.kitUploadParams) === null || _data$kitUploadParams === void 0 ? void 0 : _data$kitUploadParams.id) || ""; |
| 19430 |
var getTemplatesSummary = (0, react.useCallback)(function() { |
| 19431 |
var _runnersState$templat; |
| 19432 |
var _elementorAppConfig$i; |
| 19433 |
var templatesSummary = runnersState === null || runnersState === void 0 || (_runnersState$templat = runnersState.templates) === null || _runnersState$templat === void 0 ? void 0 : _runnersState$templat.succeed_summary; |
| 19434 |
if (!templatesSummary) return (0, _wordpress_i18n.__)("No templates imported", "elementor"); |
| 19435 |
var summaryTitles = ((_elementorAppConfig$i = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i === void 0 || (_elementorAppConfig$i = _elementorAppConfig$i.summaryTitles) === null || _elementorAppConfig$i === void 0 ? void 0 : _elementorAppConfig$i.templates) || {}; |
| 19436 |
var summaryParts = Object.entries(templatesSummary).map(function(_ref) { |
| 19437 |
var _ref2 = _slicedToArray(_ref, 2); |
| 19438 |
var docType = _ref2[0]; |
| 19439 |
var count = _ref2[1]; |
| 19440 |
var label = summaryTitles[docType]; |
| 19441 |
if (!label) return null; |
| 19442 |
var itemTitle = count > 1 ? label.plural : label.single; |
| 19443 |
return "".concat(count, " ").concat(itemTitle); |
| 19444 |
}).filter(function(part) { |
| 19445 |
return part !== null; |
| 19446 |
}); |
| 19447 |
return summaryParts.length > 0 ? summaryParts.join(" | ") : (0, _wordpress_i18n.__)("No templates imported", "elementor"); |
| 19448 |
}, [runnersState === null || runnersState === void 0 || (_runnersState$templat2 = runnersState.templates) === null || _runnersState$templat2 === void 0 ? void 0 : _runnersState$templat2.succeed_summary]); |
| 19449 |
var getContentSummary = (0, react.useCallback)(function() { |
| 19450 |
var _elementorAppConfig$i2; |
| 19451 |
var elementorContent = runnersState === null || runnersState === void 0 ? void 0 : runnersState["elementor-content"]; |
| 19452 |
var wpContent = runnersState === null || runnersState === void 0 ? void 0 : runnersState["wp-content"]; |
| 19453 |
var content = runnersState === null || runnersState === void 0 ? void 0 : runnersState.content; |
| 19454 |
var taxonomies = runnersState === null || runnersState === void 0 ? void 0 : runnersState.taxonomies; |
| 19455 |
var contentCounts = {}; |
| 19456 |
var summaryTitles = ((_elementorAppConfig$i2 = elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig$i2 === void 0 || (_elementorAppConfig$i2 = _elementorAppConfig$i2.summaryTitles) === null || _elementorAppConfig$i2 === void 0 ? void 0 : _elementorAppConfig$i2.content) || {}; |
| 19457 |
var countSucceedItems = function countSucceedItems(contentSection) { |
| 19458 |
if (!contentSection) return {}; |
| 19459 |
var counts = {}; |
| 19460 |
Object.entries(contentSection).forEach(function(_ref3) { |
| 19461 |
var _ref4 = _slicedToArray(_ref3, 2); |
| 19462 |
var docType = _ref4[0]; |
| 19463 |
var result = _ref4[1]; |
| 19464 |
if (result !== null && result !== void 0 && result.succeed && Object.keys(result.succeed).length > 0) counts[docType] = (counts[docType] || 0) + Object.keys(result.succeed).length; |
| 19465 |
}); |
| 19466 |
return counts; |
| 19467 |
}; |
| 19468 |
[ |
| 19469 |
countSucceedItems(wpContent), |
| 19470 |
countSucceedItems(content), |
| 19471 |
countSucceedItems(elementorContent) |
| 19472 |
].forEach(function(counts) { |
| 19473 |
Object.entries(counts).forEach(function(_ref5) { |
| 19474 |
var _ref6 = _slicedToArray(_ref5, 2); |
| 19475 |
var docType = _ref6[0]; |
| 19476 |
var count = _ref6[1]; |
| 19477 |
contentCounts[docType] = (contentCounts[docType] || 0) + count; |
| 19478 |
}); |
| 19479 |
}); |
| 19480 |
var totalTaxonomies = 0; |
| 19481 |
if (taxonomies) Object.values(taxonomies).forEach(function(taxonomy) { |
| 19482 |
Object.values(taxonomy).forEach(function(terms) { |
| 19483 |
totalTaxonomies += terms.length; |
| 19484 |
}); |
| 19485 |
}); |
| 19486 |
var totalNavMenuItems = 0; |
| 19487 |
[ |
| 19488 |
wpContent, |
| 19489 |
content, |
| 19490 |
elementorContent |
| 19491 |
].forEach(function(contentSection) { |
| 19492 |
var _contentSection$nav_m; |
| 19493 |
if (contentSection !== null && contentSection !== void 0 && (_contentSection$nav_m = contentSection.nav_menu_item) !== null && _contentSection$nav_m !== void 0 && _contentSection$nav_m.succeed) totalNavMenuItems += Object.keys(contentSection.nav_menu_item.succeed).length; |
| 19494 |
}); |
| 19495 |
if (!(Object.keys(contentCounts).length > 0 || totalTaxonomies > 0 || totalNavMenuItems > 0)) return (0, _wordpress_i18n.__)("No content imported", "elementor"); |
| 19496 |
var summaryParts = []; |
| 19497 |
Object.entries(contentCounts).forEach(function(_ref7) { |
| 19498 |
var _ref8 = _slicedToArray(_ref7, 2); |
| 19499 |
var docType = _ref8[0]; |
| 19500 |
var count = _ref8[1]; |
| 19501 |
var label = summaryTitles[docType]; |
| 19502 |
if (label && count > 0) { |
| 19503 |
var itemTitle = count > 1 ? label.plural : label.single; |
| 19504 |
summaryParts.push("".concat(count, " ").concat(itemTitle)); |
| 19505 |
} |
| 19506 |
}); |
| 19507 |
if (totalTaxonomies > 0) { |
| 19508 |
var taxonomyLabel = totalTaxonomies > 1 ? (0, _wordpress_i18n.__)("Taxonomies", "elementor") : (0, _wordpress_i18n.__)("Taxonomy", "elementor"); |
| 19509 |
summaryParts.push("".concat(totalTaxonomies, " ").concat(taxonomyLabel)); |
| 19510 |
} |
| 19511 |
if (totalNavMenuItems > 0) { |
| 19512 |
var menuLabel = totalNavMenuItems > 1 ? (0, _wordpress_i18n.__)("Menus", "elementor") : (0, _wordpress_i18n.__)("Menu", "elementor"); |
| 19513 |
summaryParts.push("".concat(totalNavMenuItems, " ").concat(menuLabel)); |
| 19514 |
} |
| 19515 |
return summaryParts.length > 0 ? summaryParts.join(" | ") : (0, _wordpress_i18n.__)("No content imported", "elementor"); |
| 19516 |
}, [runnersState]); |
| 19517 |
var getPluginsSummary = (0, react.useCallback)(function() { |
| 19518 |
var plugins = Array.isArray(runnersState === null || runnersState === void 0 ? void 0 : runnersState.plugins) ? runnersState === null || runnersState === void 0 ? void 0 : runnersState.plugins : Object.values((runnersState === null || runnersState === void 0 ? void 0 : runnersState.plugins) || {}); |
| 19519 |
return runnersState !== null && runnersState !== void 0 && runnersState.plugins ? plugins.join(" | ") : (0, _wordpress_i18n.__)("No plugins imported", "elementor"); |
| 19520 |
}, [runnersState === null || runnersState === void 0 ? void 0 : runnersState.plugins]); |
| 19521 |
var getSettingsSummary = (0, react.useCallback)(function() { |
| 19522 |
var _data$customization; |
| 19523 |
var _data$uploadedData2; |
| 19524 |
var siteSettings = data.includes.includes("settings") ? (data === null || data === void 0 || (_data$customization = data.customization) === null || _data$customization === void 0 ? void 0 : _data$customization.settings) || (data === null || data === void 0 || (_data$uploadedData2 = data.uploadedData) === null || _data$uploadedData2 === void 0 ? void 0 : _data$uploadedData2.manifest["site-settings"]) || {} : {}; |
| 19525 |
if (!Object.keys(siteSettings).length || !Object.keys(runnersState["site-settings"] || {}).length) return (0, _wordpress_i18n.__)("No settings imported", "elementor"); |
| 19526 |
var summary = buildKitSettingsSummary(siteSettings); |
| 19527 |
return summary.length > 0 ? summary : (0, _wordpress_i18n.__)("No settings imported", "elementor"); |
| 19528 |
}, [data, runnersState]); |
| 19529 |
var summaryData = (0, react.useMemo)(function() { |
| 19530 |
return { |
| 19531 |
content: { |
| 19532 |
title: (0, _wordpress_i18n.__)("Content", "elementor"), |
| 19533 |
subTitle: getContentSummary() |
| 19534 |
}, |
| 19535 |
templates: { |
| 19536 |
title: (0, _wordpress_i18n.__)("Templates", "elementor"), |
| 19537 |
subTitle: getTemplatesSummary() |
| 19538 |
}, |
| 19539 |
settings: { |
| 19540 |
title: (0, _wordpress_i18n.__)("Site settings", "elementor"), |
| 19541 |
subTitle: getSettingsSummary() |
| 19542 |
}, |
| 19543 |
plugins: { |
| 19544 |
title: (0, _wordpress_i18n.__)("Plugins", "elementor"), |
| 19545 |
subTitle: getPluginsSummary() |
| 19546 |
} |
| 19547 |
}; |
| 19548 |
}, [ |
| 19549 |
getPluginsSummary, |
| 19550 |
getTemplatesSummary, |
| 19551 |
getSettingsSummary, |
| 19552 |
getContentSummary |
| 19553 |
]); |
| 19554 |
(0, react.useEffect)(function() { |
| 19555 |
if (!isCompleted) navigate("/import-customization", { replace: true }); |
| 19556 |
}, [isCompleted, navigate]); |
| 19557 |
var footerContent = /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19558 |
direction: "row", |
| 19559 |
spacing: 1 |
| 19560 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 19561 |
variant: "outlined", |
| 19562 |
color: "secondary", |
| 19563 |
size: "small", |
| 19564 |
"data-testid": "see-it-live-button", |
| 19565 |
href: (_elementorAppConfig = elementorAppConfig) === null || _elementorAppConfig === void 0 ? void 0 : _elementorAppConfig.home_url, |
| 19566 |
target: "_blank" |
| 19567 |
}, (0, _wordpress_i18n.__)("See it Live", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 19568 |
variant: "contained", |
| 19569 |
color: "primary", |
| 19570 |
size: "small", |
| 19571 |
onClick: handleDone, |
| 19572 |
"data-testid": "close-button" |
| 19573 |
}, (0, _wordpress_i18n.__)("Close", "elementor"))); |
| 19574 |
var headerContent = /*#__PURE__*/ react.default.createElement(PageHeader, { title: (0, _wordpress_i18n.__)("Import", "elementor") }); |
| 19575 |
(0, react.useEffect)(function() { |
| 19576 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitImportSummary); |
| 19577 |
}, []); |
| 19578 |
var kitSource = (data === null || data === void 0 || (_data$kitUploadParams2 = data.kitUploadParams) === null || _data$kitUploadParams2 === void 0 ? void 0 : _data$kitUploadParams2.source) || "file"; |
| 19579 |
var isFromKitsLibrary = "kit-library" === kitSource; |
| 19580 |
(0, react.useEffect)(function() { |
| 19581 |
var _uploadedData$manifes; |
| 19582 |
AppsEventTracking.sendImportKitCustomization(_objectSpread$10(_objectSpread$10(_objectSpread$10({ |
| 19583 |
kit_source: kitSource, |
| 19584 |
kit_import_content: includes.includes("content"), |
| 19585 |
kit_import_templates: includes.includes("templates"), |
| 19586 |
kit_import_settings: includes.includes("settings"), |
| 19587 |
kit_import_plugins: includes.includes("plugins"), |
| 19588 |
kit_import_deselected: analytics === null || analytics === void 0 ? void 0 : analytics.customization, |
| 19589 |
kit_description: !!(uploadedData !== null && uploadedData !== void 0 && (_uploadedData$manifes = uploadedData.manifest) !== null && _uploadedData$manifes !== void 0 && _uploadedData$manifes.description) |
| 19590 |
}, kitId && isFromKitsLibrary && { kit_import_id: kitId }), title && isFromKitsLibrary && { kit_import_title: title }), duration && { kit_import_duration: duration })); |
| 19591 |
}, [ |
| 19592 |
includes, |
| 19593 |
analytics, |
| 19594 |
uploadedData, |
| 19595 |
data, |
| 19596 |
kitId, |
| 19597 |
title, |
| 19598 |
duration, |
| 19599 |
kitSource, |
| 19600 |
isFromKitsLibrary |
| 19601 |
]); |
| 19602 |
return /*#__PURE__*/ react.default.createElement(BaseLayout, { |
| 19603 |
topBar: /*#__PURE__*/ react.default.createElement(TopBar, null, headerContent), |
| 19604 |
footer: /*#__PURE__*/ react.default.createElement(Footer, null, footerContent) |
| 19605 |
}, /*#__PURE__*/ react.default.createElement(CenteredContent, { |
| 19606 |
hasFooter: true, |
| 19607 |
maxWidth: "800px" |
| 19608 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19609 |
spacing: 3, |
| 19610 |
alignItems: "center", |
| 19611 |
"data-testid": "import-complete-content" |
| 19612 |
}, /*#__PURE__*/ react.default.createElement(CompleteIcon, { |
| 19613 |
imageSrc: elementorAppConfig.assets_url + "images/kit-is-live.svg", |
| 19614 |
altText: (0, _wordpress_i18n.__)("Kit is live illustration", "elementor"), |
| 19615 |
testId: "import-complete-icon" |
| 19616 |
}), /*#__PURE__*/ react.default.createElement(CompleteHeading, { |
| 19617 |
title: (0, _wordpress_i18n.__)("Your website template is now live on your site!", "elementor"), |
| 19618 |
subtitle: (0, _wordpress_i18n.__)("You've imported and applied the following to your site:", "elementor"), |
| 19619 |
testId: "import-complete-heading" |
| 19620 |
}), /*#__PURE__*/ react.default.createElement(CompleteSummary, { |
| 19621 |
summaryData, |
| 19622 |
testId: "import-complete-summary" |
| 19623 |
}), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { mt: 2 }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19624 |
direction: "row", |
| 19625 |
justifyContent: "center", |
| 19626 |
alignItems: "center", |
| 19627 |
spacing: 3 |
| 19628 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 19629 |
variant: "body2", |
| 19630 |
color: "text.secondary" |
| 19631 |
}, (0, _wordpress_i18n.__)("Build sites faster with Website Templates.", "elementor"), /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { |
| 19632 |
href: "https://go.elementor.com/app-what-are-kits", |
| 19633 |
color: "info.light", |
| 19634 |
target: "_blank", |
| 19635 |
sx: { |
| 19636 |
ml: 1, |
| 19637 |
textDecoration: "none" |
| 19638 |
} |
| 19639 |
}, (0, _wordpress_i18n.__)("Show me how", "elementor")))))))); |
| 19640 |
} |
| 19641 |
|
| 19642 |
//#endregion |
| 19643 |
//#region app/modules/import-export-customization/assets/js/import/components/import-kit-parts-selection.js |
| 19644 |
function ImportKitPartsSelection() { |
| 19645 |
var _useImportContext = useImportContext(); |
| 19646 |
var data = _useImportContext.data; |
| 19647 |
var dispatch = _useImportContext.dispatch; |
| 19648 |
var handleCheckboxChange = function handleCheckboxChange(itemType) { |
| 19649 |
var isChecked = data.includes.includes(itemType); |
| 19650 |
var kitItem = kitContentData.find(function(item) { |
| 19651 |
return item.type === itemType; |
| 19652 |
}); |
| 19653 |
if (isChecked && kitItem !== null && kitItem !== void 0 && kitItem.required) return; |
| 19654 |
dispatch({ |
| 19655 |
type: isChecked ? "REMOVE_INCLUDE" : "ADD_INCLUDE", |
| 19656 |
payload: itemType |
| 19657 |
}); |
| 19658 |
}; |
| 19659 |
var handleSaveCustomization = function handleSaveCustomization(key, payload, hasEnabledCustomization) { |
| 19660 |
dispatch({ |
| 19661 |
type: "SET_CUSTOMIZATION", |
| 19662 |
payload: { |
| 19663 |
key, |
| 19664 |
value: payload |
| 19665 |
} |
| 19666 |
}); |
| 19667 |
if (hasEnabledCustomization) dispatch({ |
| 19668 |
type: "ADD_INCLUDE", |
| 19669 |
payload: key |
| 19670 |
}); |
| 19671 |
else dispatch({ |
| 19672 |
type: "REMOVE_INCLUDE", |
| 19673 |
payload: key |
| 19674 |
}); |
| 19675 |
}; |
| 19676 |
(0, react.useEffect)(function() { |
| 19677 |
if (data.uploadedData) { |
| 19678 |
var _data$uploadedData; |
| 19679 |
var _data$uploadedData2; |
| 19680 |
var _data$uploadedData3; |
| 19681 |
var includes = []; |
| 19682 |
if ((_data$uploadedData = data.uploadedData) !== null && _data$uploadedData !== void 0 && (_data$uploadedData = _data$uploadedData.manifest) !== null && _data$uploadedData !== void 0 && _data$uploadedData["site-settings"]) includes.push("settings"); |
| 19683 |
if (0 < Object.keys(((_data$uploadedData2 = data.uploadedData) === null || _data$uploadedData2 === void 0 || (_data$uploadedData2 = _data$uploadedData2.manifest) === null || _data$uploadedData2 === void 0 ? void 0 : _data$uploadedData2.templates) || {}).length && elementorAppConfig.hasPro) includes.push("templates"); |
| 19684 |
if ((_data$uploadedData3 = data.uploadedData) !== null && _data$uploadedData3 !== void 0 && (_data$uploadedData3 = _data$uploadedData3.manifest) !== null && _data$uploadedData3 !== void 0 && _data$uploadedData3.content) includes.push("content"); |
| 19685 |
dispatch({ |
| 19686 |
type: "ADD_INCLUDES", |
| 19687 |
payload: includes |
| 19688 |
}); |
| 19689 |
} |
| 19690 |
}, [data.uploadedData, dispatch]); |
| 19691 |
return /*#__PURE__*/ react.default.createElement(KitPartsSelection, { |
| 19692 |
onCheckboxChange: handleCheckboxChange, |
| 19693 |
handleSaveCustomization, |
| 19694 |
testId: "import-kit-parts-content" |
| 19695 |
}); |
| 19696 |
} |
| 19697 |
|
| 19698 |
//#endregion |
| 19699 |
//#region app/modules/import-export-customization/assets/js/import/pages/import-customization.js |
| 19700 |
init_es$1(); |
| 19701 |
init_apps_event_tracking(); |
| 19702 |
var headerContent$1 = /*#__PURE__*/ react.default.createElement(PageHeader, { title: (0, _wordpress_i18n.__)("Import", "elementor") }); |
| 19703 |
function ImportCustomization() { |
| 19704 |
var _useImportContext = useImportContext(); |
| 19705 |
var isCustomizing = _useImportContext.isCustomizing; |
| 19706 |
var dispatch = _useImportContext.dispatch; |
| 19707 |
var isProcessing = _useImportContext.isProcessing; |
| 19708 |
var data = _useImportContext.data; |
| 19709 |
var navigate = useNavigate(); |
| 19710 |
(0, react.useEffect)(function() { |
| 19711 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.kitImportCustomization); |
| 19712 |
}, []); |
| 19713 |
var footerContent = /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19714 |
direction: "row", |
| 19715 |
spacing: 1 |
| 19716 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 19717 |
variant: "text", |
| 19718 |
color: "secondary", |
| 19719 |
size: "small", |
| 19720 |
onClick: function onClick() { |
| 19721 |
if (data !== null && data !== void 0 && data.kitUploadParams) { |
| 19722 |
var _data$kitUploadParams; |
| 19723 |
var _data$kitUploadParams2; |
| 19724 |
var url = ""; |
| 19725 |
if ("cloud" === (data === null || data === void 0 || (_data$kitUploadParams = data.kitUploadParams) === null || _data$kitUploadParams === void 0 ? void 0 : _data$kitUploadParams.source)) url = "kit-library/cloud"; |
| 19726 |
else if ("kit-library" === (data === null || data === void 0 || (_data$kitUploadParams2 = data.kitUploadParams) === null || _data$kitUploadParams2 === void 0 ? void 0 : _data$kitUploadParams2.source)) url = "kit-library"; |
| 19727 |
navigate(url, { replace: true }); |
| 19728 |
} else { |
| 19729 |
dispatch({ type: "RESET_STATE" }); |
| 19730 |
dispatch({ |
| 19731 |
type: "SET_IMPORT_STATUS", |
| 19732 |
payload: IMPORT_STATUS.PENDING |
| 19733 |
}); |
| 19734 |
} |
| 19735 |
}, |
| 19736 |
"data-testid": "import-back-button" |
| 19737 |
}, (0, _wordpress_i18n.__)("Back", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { |
| 19738 |
variant: "contained", |
| 19739 |
color: "primary", |
| 19740 |
size: "small", |
| 19741 |
onClick: function onClick() { |
| 19742 |
dispatch({ |
| 19743 |
type: "SET_IMPORT_STATUS", |
| 19744 |
payload: IMPORT_STATUS.IMPORTING |
| 19745 |
}); |
| 19746 |
navigate("import-customization/process"); |
| 19747 |
}, |
| 19748 |
"data-testid": "import-apply-button" |
| 19749 |
}, (0, _wordpress_i18n.__)("Import and apply", "elementor"))); |
| 19750 |
(0, react.useEffect)(function() { |
| 19751 |
if (isProcessing) navigate("import-customization/process"); |
| 19752 |
else if (!isCustomizing) navigate("import-customization", { replace: true }); |
| 19753 |
}, [ |
| 19754 |
isProcessing, |
| 19755 |
isCustomizing, |
| 19756 |
navigate |
| 19757 |
]); |
| 19758 |
return /*#__PURE__*/ react.default.createElement(BaseLayout, { |
| 19759 |
topBar: /*#__PURE__*/ react.default.createElement(TopBar, null, headerContent$1), |
| 19760 |
footer: /*#__PURE__*/ react.default.createElement(Footer, null, footerContent) |
| 19761 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 19762 |
spacing: 4, |
| 19763 |
sx: { |
| 19764 |
mt: 4, |
| 19765 |
mx: "auto" |
| 19766 |
} |
| 19767 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { spacing: 2 }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 19768 |
variant: "h4", |
| 19769 |
component: "h2", |
| 19770 |
gutterBottom: true, |
| 19771 |
color: "text.primary" |
| 19772 |
}, (0, _wordpress_i18n.__)("Select which parts you want to apply", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "subtitle2" }, (0, _wordpress_i18n.__)("These are the templates, content and site settings that come with your website templates.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "subtitle2" }, (0, _wordpress_i18n.__)("All items are already selected by default. Uncheck the ones you don't want.", "elementor")))), /*#__PURE__*/ react.default.createElement(ImportKitPartsSelection, null))); |
| 19773 |
} |
| 19774 |
|
| 19775 |
//#endregion |
| 19776 |
//#region app/modules/import-export-customization/assets/js/import/hooks/use-import-kit.js |
| 19777 |
init_defineProperty$1(); |
| 19778 |
init_slicedToArray(); |
| 19779 |
init_asyncToGenerator(); |
| 19780 |
function _createForOfIteratorHelper$1(r, e) { |
| 19781 |
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 19782 |
if (!t) { |
| 19783 |
if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { |
| 19784 |
t && (r = t); |
| 19785 |
var _n = 0; |
| 19786 |
var F = function F() {}; |
| 19787 |
return { |
| 19788 |
s: F, |
| 19789 |
n: function n() { |
| 19790 |
return _n >= r.length ? { done: !0 } : { |
| 19791 |
done: !1, |
| 19792 |
value: r[_n++] |
| 19793 |
}; |
| 19794 |
}, |
| 19795 |
e: function e(r) { |
| 19796 |
throw r; |
| 19797 |
}, |
| 19798 |
f: F |
| 19799 |
}; |
| 19800 |
} |
| 19801 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 19802 |
} |
| 19803 |
var o; |
| 19804 |
var a = !0; |
| 19805 |
var u = !1; |
| 19806 |
return { |
| 19807 |
s: function s() { |
| 19808 |
t = t.call(r); |
| 19809 |
}, |
| 19810 |
n: function n() { |
| 19811 |
var r = t.next(); |
| 19812 |
return a = r.done, r; |
| 19813 |
}, |
| 19814 |
e: function e(r) { |
| 19815 |
u = !0, o = r; |
| 19816 |
}, |
| 19817 |
f: function f() { |
| 19818 |
try { |
| 19819 |
a || null == t.return || t.return(); |
| 19820 |
} finally { |
| 19821 |
if (u) throw o; |
| 19822 |
} |
| 19823 |
} |
| 19824 |
}; |
| 19825 |
} |
| 19826 |
__name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper"); |
| 19827 |
function _unsupportedIterableToArray$1(r, a) { |
| 19828 |
if (r) { |
| 19829 |
if ("string" == typeof r) return _arrayLikeToArray$1(r, a); |
| 19830 |
var t = {}.toString.call(r).slice(8, -1); |
| 19831 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; |
| 19832 |
} |
| 19833 |
} |
| 19834 |
__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray"); |
| 19835 |
function _arrayLikeToArray$1(r, a) { |
| 19836 |
(null == a || a > r.length) && (a = r.length); |
| 19837 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 19838 |
return n; |
| 19839 |
} |
| 19840 |
__name(_arrayLikeToArray$1, "_arrayLikeToArray"); |
| 19841 |
function request(_x) { |
| 19842 |
return _request.apply(this, arguments); |
| 19843 |
} |
| 19844 |
function _request() { |
| 19845 |
_request = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee3(_ref) { |
| 19846 |
var _window$wpApiSettings; |
| 19847 |
var data; |
| 19848 |
var path; |
| 19849 |
var _ref$method; |
| 19850 |
var method; |
| 19851 |
var baseUrl; |
| 19852 |
var requestUrl; |
| 19853 |
var response; |
| 19854 |
var result; |
| 19855 |
var _result$data; |
| 19856 |
var _result$data2; |
| 19857 |
var _result$data3; |
| 19858 |
var errorMessage; |
| 19859 |
var errorCode; |
| 19860 |
return import_regenerator$1.default.wrap(function(_context3) { |
| 19861 |
while (1) switch (_context3.prev = _context3.next) { |
| 19862 |
case 0: |
| 19863 |
data = _ref.data, path = _ref.path, _ref$method = _ref.method, method = _ref$method === void 0 ? "POST" : _ref$method; |
| 19864 |
baseUrl = elementorAppConfig["import-export-customization"].restApiBaseUrl; |
| 19865 |
requestUrl = "".concat(baseUrl, "/").concat(path); |
| 19866 |
_context3.next = 1; |
| 19867 |
return fetch(requestUrl, { |
| 19868 |
method, |
| 19869 |
headers: { |
| 19870 |
"Content-Type": "application/json", |
| 19871 |
"X-WP-Nonce": ((_window$wpApiSettings = window.wpApiSettings) === null || _window$wpApiSettings === void 0 ? void 0 : _window$wpApiSettings.nonce) || "" |
| 19872 |
}, |
| 19873 |
body: JSON.stringify(data) |
| 19874 |
}); |
| 19875 |
case 1: |
| 19876 |
response = _context3.sent; |
| 19877 |
_context3.next = 2; |
| 19878 |
return response.json(); |
| 19879 |
case 2: |
| 19880 |
result = _context3.sent; |
| 19881 |
if (response.ok) { |
| 19882 |
_context3.next = 3; |
| 19883 |
break; |
| 19884 |
} |
| 19885 |
errorMessage = (result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.message) || "HTTP error! with the following code: ".concat(result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.code); |
| 19886 |
errorCode = 408 === (response === null || response === void 0 ? void 0 : response.status) ? "timeout" : result === null || result === void 0 || (_result$data3 = result.data) === null || _result$data3 === void 0 ? void 0 : _result$data3.code; |
| 19887 |
throw new ImportExportError(errorMessage, errorCode); |
| 19888 |
case 3: return _context3.abrupt("return", result); |
| 19889 |
case 4: |
| 19890 |
case "end": return _context3.stop(); |
| 19891 |
} |
| 19892 |
}, _callee3); |
| 19893 |
})); |
| 19894 |
return _request.apply(this, arguments); |
| 19895 |
} |
| 19896 |
var IMPORT_PROCESSING_STATUS = { |
| 19897 |
PENDING: "PENDING", |
| 19898 |
IN_PROGRESS: "IN_PROGRESS", |
| 19899 |
DONE: "DONE" |
| 19900 |
}; |
| 19901 |
function useImportKit(_ref2) { |
| 19902 |
var data = _ref2.data; |
| 19903 |
var includes = _ref2.includes; |
| 19904 |
var customization = _ref2.customization; |
| 19905 |
var isProcessing = _ref2.isProcessing; |
| 19906 |
var dispatch = _ref2.dispatch; |
| 19907 |
var _useState2 = _slicedToArray((0, react.useState)(IMPORT_PROCESSING_STATUS.PENDING), 2); |
| 19908 |
var status = _useState2[0]; |
| 19909 |
var setImportStatus = _useState2[1]; |
| 19910 |
var _useState4 = _slicedToArray((0, react.useState)(null), 2); |
| 19911 |
var error = _useState4[0]; |
| 19912 |
var setError = _useState4[1]; |
| 19913 |
var _useState6 = _slicedToArray((0, react.useState)(null), 2); |
| 19914 |
var startTime = _useState6[0]; |
| 19915 |
var setStartTime = _useState6[1]; |
| 19916 |
var runImportRunners = /*#__PURE__*/ function() { |
| 19917 |
var _ref3 = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee() { |
| 19918 |
var session; |
| 19919 |
var runners; |
| 19920 |
var stopIterations; |
| 19921 |
var _iterator; |
| 19922 |
var _step; |
| 19923 |
var runner; |
| 19924 |
var _result$data$imported; |
| 19925 |
var result; |
| 19926 |
var runnerKey; |
| 19927 |
var endTime; |
| 19928 |
var millisecondsToSeconds; |
| 19929 |
var importDuration; |
| 19930 |
var _t; |
| 19931 |
var _t2; |
| 19932 |
return import_regenerator$1.default.wrap(function(_context) { |
| 19933 |
while (1) switch (_context.prev = _context.next) { |
| 19934 |
case 0: |
| 19935 |
setImportStatus(IMPORT_PROCESSING_STATUS.IN_PROGRESS); |
| 19936 |
session = data.importedData.session; |
| 19937 |
runners = data.importedData.runners; |
| 19938 |
stopIterations = null; |
| 19939 |
_iterator = _createForOfIteratorHelper$1(runners); |
| 19940 |
_context.prev = 1; |
| 19941 |
_iterator.s(); |
| 19942 |
case 2: |
| 19943 |
if ((_step = _iterator.n()).done) { |
| 19944 |
_context.next = 8; |
| 19945 |
break; |
| 19946 |
} |
| 19947 |
runner = _step.value; |
| 19948 |
_context.prev = 3; |
| 19949 |
if (!stopIterations) { |
| 19950 |
_context.next = 4; |
| 19951 |
break; |
| 19952 |
} |
| 19953 |
return _context.abrupt("continue", 8); |
| 19954 |
case 4: |
| 19955 |
_context.next = 5; |
| 19956 |
return request({ |
| 19957 |
data: { |
| 19958 |
session, |
| 19959 |
runner |
| 19960 |
}, |
| 19961 |
path: "import-runner" |
| 19962 |
}); |
| 19963 |
case 5: |
| 19964 |
result = _context.sent; |
| 19965 |
runnerKey = "elementor-content" === runner ? "content" : runner; |
| 19966 |
dispatch({ |
| 19967 |
type: "SET_RUNNERS_STATE", |
| 19968 |
payload: _defineProperty$1({}, runnerKey, ((_result$data$imported = result.data.imported_data) === null || _result$data$imported === void 0 ? void 0 : _result$data$imported[runnerKey]) || result.data[runnerKey]) |
| 19969 |
}); |
| 19970 |
_context.next = 7; |
| 19971 |
break; |
| 19972 |
case 6: |
| 19973 |
_context.prev = 6; |
| 19974 |
_t = _context["catch"](3); |
| 19975 |
stopIterations = _t; |
| 19976 |
setError(_t); |
| 19977 |
case 7: |
| 19978 |
_context.next = 2; |
| 19979 |
break; |
| 19980 |
case 8: |
| 19981 |
_context.next = 10; |
| 19982 |
break; |
| 19983 |
case 9: |
| 19984 |
_context.prev = 9; |
| 19985 |
_t2 = _context["catch"](1); |
| 19986 |
_iterator.e(_t2); |
| 19987 |
case 10: |
| 19988 |
_context.prev = 10; |
| 19989 |
_iterator.f(); |
| 19990 |
return _context.finish(10); |
| 19991 |
case 11: |
| 19992 |
if (startTime) { |
| 19993 |
endTime = Date.now(); |
| 19994 |
millisecondsToSeconds = 1e3; |
| 19995 |
importDuration = (endTime - startTime) / millisecondsToSeconds; |
| 19996 |
dispatch({ |
| 19997 |
type: "SET_DURATION", |
| 19998 |
payload: Number(importDuration.toFixed(2)) |
| 19999 |
}); |
| 20000 |
} |
| 20001 |
setImportStatus(IMPORT_PROCESSING_STATUS.DONE); |
| 20002 |
if (!stopIterations) dispatch({ |
| 20003 |
type: "SET_IMPORT_STATUS", |
| 20004 |
payload: IMPORT_STATUS.COMPLETED |
| 20005 |
}); |
| 20006 |
case 12: |
| 20007 |
case "end": return _context.stop(); |
| 20008 |
} |
| 20009 |
}, _callee, null, [[ |
| 20010 |
1, |
| 20011 |
9, |
| 20012 |
10, |
| 20013 |
11 |
| 20014 |
], [3, 6]]); |
| 20015 |
})); |
| 20016 |
return function runImportRunners() { |
| 20017 |
return _ref3.apply(this, arguments); |
| 20018 |
}; |
| 20019 |
}(); |
| 20020 |
function importKit() { |
| 20021 |
return _importKit.apply(this, arguments); |
| 20022 |
} |
| 20023 |
function _importKit() { |
| 20024 |
_importKit = _asyncToGenerator(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee2() { |
| 20025 |
var _data$kitUploadParams; |
| 20026 |
var _data$kitUploadParams2; |
| 20027 |
var _data$uploadedData; |
| 20028 |
var importData; |
| 20029 |
var result; |
| 20030 |
var _t3; |
| 20031 |
return import_regenerator$1.default.wrap(function(_context2) { |
| 20032 |
while (1) switch (_context2.prev = _context2.next) { |
| 20033 |
case 0: |
| 20034 |
_context2.prev = 0; |
| 20035 |
setError(null); |
| 20036 |
setStartTime(Date.now()); |
| 20037 |
setImportStatus(IMPORT_PROCESSING_STATUS.IN_PROGRESS); |
| 20038 |
importData = { |
| 20039 |
id: (_data$kitUploadParams = data.kitUploadParams) === null || _data$kitUploadParams === void 0 ? void 0 : _data$kitUploadParams.id, |
| 20040 |
referrer: (_data$kitUploadParams2 = data.kitUploadParams) === null || _data$kitUploadParams2 === void 0 ? void 0 : _data$kitUploadParams2.referrer, |
| 20041 |
session: data === null || data === void 0 || (_data$uploadedData = data.uploadedData) === null || _data$uploadedData === void 0 ? void 0 : _data$uploadedData.session, |
| 20042 |
include: includes, |
| 20043 |
customization |
| 20044 |
}; |
| 20045 |
_context2.next = 1; |
| 20046 |
return request({ |
| 20047 |
data: importData, |
| 20048 |
path: "import" |
| 20049 |
}); |
| 20050 |
case 1: |
| 20051 |
result = _context2.sent; |
| 20052 |
dispatch({ |
| 20053 |
type: "SET_IMPORTED_DATA", |
| 20054 |
payload: result.data |
| 20055 |
}); |
| 20056 |
_context2.next = 3; |
| 20057 |
break; |
| 20058 |
case 2: |
| 20059 |
_context2.prev = 2; |
| 20060 |
_t3 = _context2["catch"](0); |
| 20061 |
setError(_t3); |
| 20062 |
setImportStatus(IMPORT_PROCESSING_STATUS.DONE); |
| 20063 |
case 3: |
| 20064 |
case "end": return _context2.stop(); |
| 20065 |
} |
| 20066 |
}, _callee2, null, [[0, 2]]); |
| 20067 |
})); |
| 20068 |
return _importKit.apply(this, arguments); |
| 20069 |
} |
| 20070 |
(0, react.useEffect)(function() { |
| 20071 |
if (isProcessing && data.includes.length) importKit(); |
| 20072 |
}, [data.includes, isProcessing]); |
| 20073 |
(0, react.useEffect)(function() { |
| 20074 |
if (isProcessing && data.importedData && !error) runImportRunners(); |
| 20075 |
}, [ |
| 20076 |
data.importedData, |
| 20077 |
isProcessing, |
| 20078 |
error |
| 20079 |
]); |
| 20080 |
return { |
| 20081 |
status, |
| 20082 |
error, |
| 20083 |
importKit |
| 20084 |
}; |
| 20085 |
} |
| 20086 |
|
| 20087 |
//#endregion |
| 20088 |
//#region app/modules/import-export-customization/assets/js/import/components/plugin-status-item.js |
| 20089 |
function PluginStatusItem(_ref) { |
| 20090 |
var name = _ref.name; |
| 20091 |
var status = _ref.status; |
| 20092 |
var isActivated = "activated" === status; |
| 20093 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { |
| 20094 |
display: "flex", |
| 20095 |
alignItems: "center", |
| 20096 |
gap: 1.5 |
| 20097 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, { |
| 20098 |
sx: { |
| 20099 |
color: isActivated ? "text.primary" : "text.muted", |
| 20100 |
fontSize: 20 |
| 20101 |
}, |
| 20102 |
viewBox: "0 0 24 24" |
| 20103 |
}, /*#__PURE__*/ react.default.createElement("path", { |
| 20104 |
fillRule: "evenodd", |
| 20105 |
clipRule: "evenodd", |
| 20106 |
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" |
| 20107 |
})), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 20108 |
variant: "body2", |
| 20109 |
color: isActivated ? "text.primary" : "text.muted" |
| 20110 |
}, name, " ", status)); |
| 20111 |
} |
| 20112 |
PluginStatusItem.propTypes = { |
| 20113 |
name: import_prop_types$55.default.string.isRequired, |
| 20114 |
status: import_prop_types$55.default.string |
| 20115 |
}; |
| 20116 |
|
| 20117 |
//#endregion |
| 20118 |
//#region app/modules/import-export-customization/assets/js/import/components/plugin-activation.js |
| 20119 |
init_typeof$1(); |
| 20120 |
function PluginActivation(_ref) { |
| 20121 |
var _data$uploadedData; |
| 20122 |
var plugins = _ref.plugins; |
| 20123 |
var data = useImportContext().data; |
| 20124 |
var pluginsToActivate = ((_data$uploadedData = data.uploadedData) === null || _data$uploadedData === void 0 || (_data$uploadedData = _data$uploadedData.manifest) === null || _data$uploadedData === void 0 || (_data$uploadedData = _data$uploadedData.plugins) === null || _data$uploadedData === void 0 ? void 0 : _data$uploadedData.filter(function(plugin) { |
| 20125 |
var _data$customization; |
| 20126 |
if (data !== null && data !== void 0 && (_data$customization = data.customization) !== null && _data$customization !== void 0 && _data$customization.plugins) return true === data.customization.plugins[plugin.plugin]; |
| 20127 |
return true; |
| 20128 |
})) || []; |
| 20129 |
if (!pluginsToActivate.length) return null; |
| 20130 |
var pluginsArray = []; |
| 20131 |
if (Array.isArray(plugins)) pluginsArray = plugins; |
| 20132 |
else if (plugins && "object" === _typeof$1(plugins)) pluginsArray = Object.values(plugins); |
| 20133 |
return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { |
| 20134 |
variant: "subtitle1", |
| 20135 |
color: "text.secondary", |
| 20136 |
sx: { mb: 2 } |
| 20137 |
}, (0, _wordpress_i18n.__)("Activating plugins:", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { |
| 20138 |
width: "100%", |
| 20139 |
maxWidth: 500, |
| 20140 |
borderRadius: 1, |
| 20141 |
border: 1, |
| 20142 |
borderColor: "action.focus", |
| 20143 |
p: 2.5, |
| 20144 |
maxHeight: 300, |
| 20145 |
overflow: "auto" |
| 20146 |
} }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { spacing: 1.5 }, pluginsToActivate.map(function(plugin) { |
| 20147 |
var isActivated = pluginsArray.includes(plugin.name); |
| 20148 |
return /*#__PURE__*/ react.default.createElement(PluginStatusItem, { |
| 20149 |
key: plugin.name, |
| 20150 |
name: plugin.name, |
| 20151 |
status: isActivated ? "activated" : "activating" |
| 20152 |
}); |
| 20153 |
})))); |
| 20154 |
} |
| 20155 |
PluginActivation.propTypes = { plugins: import_prop_types$55.default.arrayOf(import_prop_types$55.default.string) }; |
| 20156 |
|
| 20157 |
//#endregion |
| 20158 |
//#region app/modules/import-export-customization/assets/js/import/pages/import-process.js |
| 20159 |
init_es$1(); |
| 20160 |
init_apps_event_tracking(); |
| 20161 |
var headerContent = /*#__PURE__*/ react.default.createElement(PageHeader, { title: (0, _wordpress_i18n.__)("Import", "elementor") }); |
| 20162 |
function ImportProcess() { |
| 20163 |
var _useImportContext = useImportContext(); |
| 20164 |
var data = _useImportContext.data; |
| 20165 |
var dispatch = _useImportContext.dispatch; |
| 20166 |
var isProcessing = _useImportContext.isProcessing; |
| 20167 |
var runnersState = _useImportContext.runnersState; |
| 20168 |
var includes = data.includes; |
| 20169 |
var customization = data.customization; |
| 20170 |
var _useImportKit = useImportKit({ |
| 20171 |
data, |
| 20172 |
includes, |
| 20173 |
customization, |
| 20174 |
isProcessing, |
| 20175 |
dispatch |
| 20176 |
}); |
| 20177 |
var status = _useImportKit.status; |
| 20178 |
var error = _useImportKit.error; |
| 20179 |
var importKit = _useImportKit.importKit; |
| 20180 |
var navigate = useNavigate(); |
| 20181 |
var attemptRedirect = useReturnToRedirect(data.returnTo).attemptRedirect; |
| 20182 |
(0, react.useEffect)(function() { |
| 20183 |
if (!error) { |
| 20184 |
if (IMPORT_PROCESSING_STATUS.DONE === status) { |
| 20185 |
AppsEventTracking.sendKitImportStatus(null); |
| 20186 |
if (!data.noAutomaticRedirect && attemptRedirect()) return; |
| 20187 |
navigate("import-customization/complete"); |
| 20188 |
} else if (!isProcessing) navigate("import-customization", { replace: true }); |
| 20189 |
} else AppsEventTracking.sendKitImportStatus(error); |
| 20190 |
}, [ |
| 20191 |
status, |
| 20192 |
error, |
| 20193 |
navigate, |
| 20194 |
isProcessing, |
| 20195 |
attemptRedirect, |
| 20196 |
data.noAutomaticRedirect |
| 20197 |
]); |
| 20198 |
return /*#__PURE__*/ react.default.createElement(BaseLayout, { topBar: /*#__PURE__*/ react.default.createElement(TopBar, null, headerContent) }, /*#__PURE__*/ react.default.createElement(CenteredContent, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 20199 |
spacing: 3, |
| 20200 |
alignItems: "center" |
| 20201 |
}, status === IMPORT_PROCESSING_STATUS.IN_PROGRESS && !error && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { |
| 20202 |
spacing: 3, |
| 20203 |
alignItems: "center" |
| 20204 |
}, /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { size: 30 }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "h5" }, (0, _wordpress_i18n.__)("Setting up your website template...", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "subtitle1" }, (0, _wordpress_i18n.__)("This usually takes a few moments.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "subtitle1" }, (0, _wordpress_i18n.__)("Don't close this window until the process is finished.", "elementor")))), /*#__PURE__*/ react.default.createElement(PluginActivation, { plugins: runnersState === null || runnersState === void 0 ? void 0 : runnersState.plugins })), /*#__PURE__*/ react.default.createElement(ProcessingErrorDialog, { |
| 20205 |
error, |
| 20206 |
handleClose: function handleCloseError() { |
| 20207 |
if (attemptRedirect()) return; |
| 20208 |
dispatch({ |
| 20209 |
type: "SET_IMPORT_STATUS", |
| 20210 |
payload: IMPORT_STATUS.CUSTOMIZING |
| 20211 |
}); |
| 20212 |
navigate("import-customization/content"); |
| 20213 |
}, |
| 20214 |
handleTryAgain: function handleTryAgain() { |
| 20215 |
importKit(); |
| 20216 |
} |
| 20217 |
})))); |
| 20218 |
} |
| 20219 |
|
| 20220 |
//#endregion |
| 20221 |
//#region app/modules/import-export-customization/assets/js/import/import.js |
| 20222 |
init_es$1(); |
| 20223 |
function Import() { |
| 20224 |
return /*#__PURE__*/ react.default.createElement(ImportContextProvider, null, /*#__PURE__*/ react.default.createElement(LocationProvider, { history: _elementor_router.default.appHistory }, /*#__PURE__*/ react.default.createElement(Router, null, /*#__PURE__*/ react.default.createElement(ImportKit, { |
| 20225 |
path: "/", |
| 20226 |
default: true |
| 20227 |
}), /*#__PURE__*/ react.default.createElement(ImportCustomization, { path: "/content" }), /*#__PURE__*/ react.default.createElement(ImportProcess, { path: "/process" }), /*#__PURE__*/ react.default.createElement(ImportComplete, { path: "/complete" })))); |
| 20228 |
} |
| 20229 |
|
| 20230 |
//#endregion |
| 20231 |
//#region app/modules/import-export-customization/assets/js/module.js |
| 20232 |
init_createClass(); |
| 20233 |
init_classCallCheck(); |
| 20234 |
init_defineProperty$1(); |
| 20235 |
function _createForOfIteratorHelper(r, e) { |
| 20236 |
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 20237 |
if (!t) { |
| 20238 |
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { |
| 20239 |
t && (r = t); |
| 20240 |
var _n = 0; |
| 20241 |
var F = function F() {}; |
| 20242 |
return { |
| 20243 |
s: F, |
| 20244 |
n: function n() { |
| 20245 |
return _n >= r.length ? { done: !0 } : { |
| 20246 |
done: !1, |
| 20247 |
value: r[_n++] |
| 20248 |
}; |
| 20249 |
}, |
| 20250 |
e: function e(r) { |
| 20251 |
throw r; |
| 20252 |
}, |
| 20253 |
f: F |
| 20254 |
}; |
| 20255 |
} |
| 20256 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 20257 |
} |
| 20258 |
var o; |
| 20259 |
var a = !0; |
| 20260 |
var u = !1; |
| 20261 |
return { |
| 20262 |
s: function s() { |
| 20263 |
t = t.call(r); |
| 20264 |
}, |
| 20265 |
n: function n() { |
| 20266 |
var r = t.next(); |
| 20267 |
return a = r.done, r; |
| 20268 |
}, |
| 20269 |
e: function e(r) { |
| 20270 |
u = !0, o = r; |
| 20271 |
}, |
| 20272 |
f: function f() { |
| 20273 |
try { |
| 20274 |
a || null == t.return || t.return(); |
| 20275 |
} finally { |
| 20276 |
if (u) throw o; |
| 20277 |
} |
| 20278 |
} |
| 20279 |
}; |
| 20280 |
} |
| 20281 |
function _unsupportedIterableToArray(r, a) { |
| 20282 |
if (r) { |
| 20283 |
if ("string" == typeof r) return _arrayLikeToArray(r, a); |
| 20284 |
var t = {}.toString.call(r).slice(8, -1); |
| 20285 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; |
| 20286 |
} |
| 20287 |
} |
| 20288 |
function _arrayLikeToArray(r, a) { |
| 20289 |
(null == a || a > r.length) && (a = r.length); |
| 20290 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 20291 |
return n; |
| 20292 |
} |
| 20293 |
var ImportExportCustomization = /*#__PURE__*/ _createClass(function ImportExportCustomization() { |
| 20294 |
_classCallCheck(this, ImportExportCustomization); |
| 20295 |
_defineProperty$1(this, "routes", [{ |
| 20296 |
path: "/export-customization/*", |
| 20297 |
component: Export |
| 20298 |
}, { |
| 20299 |
path: "/import-customization/*", |
| 20300 |
component: Import |
| 20301 |
}]); |
| 20302 |
var _iterator = _createForOfIteratorHelper(this.routes); |
| 20303 |
var _step; |
| 20304 |
try { |
| 20305 |
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 20306 |
var route = _step.value; |
| 20307 |
_elementor_router.default.addRoute(route); |
| 20308 |
} |
| 20309 |
} catch (err) { |
| 20310 |
_iterator.e(err); |
| 20311 |
} finally { |
| 20312 |
_iterator.f(); |
| 20313 |
} |
| 20314 |
}); |
| 20315 |
|
| 20316 |
//#endregion |
| 20317 |
//#region app/modules/kit-library/assets/js/data/kits/commands-data/download-link.js |
| 20318 |
init_classCallCheck(); |
| 20319 |
init_createClass(); |
| 20320 |
init_possibleConstructorReturn(); |
| 20321 |
init_getPrototypeOf(); |
| 20322 |
init_inherits(); |
| 20323 |
function _callSuper$14(t, o, e) { |
| 20324 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$14() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20325 |
} |
| 20326 |
__name(_callSuper$14, "_callSuper"); |
| 20327 |
function _isNativeReflectConstruct$14() { |
| 20328 |
try { |
| 20329 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20330 |
} catch (t) {} |
| 20331 |
return (_isNativeReflectConstruct$14 = function _isNativeReflectConstruct() { |
| 20332 |
return !!t; |
| 20333 |
})(); |
| 20334 |
} |
| 20335 |
__name(_isNativeReflectConstruct$14, "_isNativeReflectConstruct"); |
| 20336 |
var DownloadLink = /*#__PURE__*/ function(_$e$modules$CommandDa) { |
| 20337 |
function DownloadLink() { |
| 20338 |
_classCallCheck(this, DownloadLink); |
| 20339 |
return _callSuper$14(this, DownloadLink, arguments); |
| 20340 |
} |
| 20341 |
_inherits(DownloadLink, _$e$modules$CommandDa); |
| 20342 |
return _createClass(DownloadLink, null, [{ |
| 20343 |
key: "getEndpointFormat", |
| 20344 |
value: function getEndpointFormat() { |
| 20345 |
return "kits/download-link/{id}"; |
| 20346 |
} |
| 20347 |
}]); |
| 20348 |
}($e.modules.CommandData); |
| 20349 |
|
| 20350 |
//#endregion |
| 20351 |
//#region app/modules/kit-library/assets/js/data/kits/commands-data/favorites.js |
| 20352 |
init_classCallCheck(); |
| 20353 |
init_createClass(); |
| 20354 |
init_possibleConstructorReturn(); |
| 20355 |
init_getPrototypeOf(); |
| 20356 |
init_inherits(); |
| 20357 |
function _callSuper$13(t, o, e) { |
| 20358 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$13() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20359 |
} |
| 20360 |
__name(_callSuper$13, "_callSuper"); |
| 20361 |
function _isNativeReflectConstruct$13() { |
| 20362 |
try { |
| 20363 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20364 |
} catch (t) {} |
| 20365 |
return (_isNativeReflectConstruct$13 = function _isNativeReflectConstruct() { |
| 20366 |
return !!t; |
| 20367 |
})(); |
| 20368 |
} |
| 20369 |
__name(_isNativeReflectConstruct$13, "_isNativeReflectConstruct"); |
| 20370 |
var Favorites$1 = /*#__PURE__*/ function(_$e$modules$CommandDa) { |
| 20371 |
function Favorites() { |
| 20372 |
_classCallCheck(this, Favorites); |
| 20373 |
return _callSuper$13(this, Favorites, arguments); |
| 20374 |
} |
| 20375 |
_inherits(Favorites, _$e$modules$CommandDa); |
| 20376 |
return _createClass(Favorites, null, [{ |
| 20377 |
key: "getEndpointFormat", |
| 20378 |
value: function getEndpointFormat() { |
| 20379 |
return "kits/favorites/{id}"; |
| 20380 |
} |
| 20381 |
}]); |
| 20382 |
}($e.modules.CommandData); |
| 20383 |
|
| 20384 |
//#endregion |
| 20385 |
//#region app/modules/kit-library/assets/js/data/kits/commands-data/index.js |
| 20386 |
var commands_data_exports$2 = /* @__PURE__ */ __exportAll({ |
| 20387 |
DownloadLink: () => DownloadLink, |
| 20388 |
Favorites: () => Favorites$1, |
| 20389 |
Index: () => Index$4 |
| 20390 |
}); |
| 20391 |
init_classCallCheck(); |
| 20392 |
init_createClass(); |
| 20393 |
init_possibleConstructorReturn(); |
| 20394 |
init_getPrototypeOf(); |
| 20395 |
init_inherits(); |
| 20396 |
function _callSuper$12(t, o, e) { |
| 20397 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$12() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20398 |
} |
| 20399 |
__name(_callSuper$12, "_callSuper"); |
| 20400 |
function _isNativeReflectConstruct$12() { |
| 20401 |
try { |
| 20402 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20403 |
} catch (t) {} |
| 20404 |
return (_isNativeReflectConstruct$12 = function _isNativeReflectConstruct() { |
| 20405 |
return !!t; |
| 20406 |
})(); |
| 20407 |
} |
| 20408 |
__name(_isNativeReflectConstruct$12, "_isNativeReflectConstruct"); |
| 20409 |
var Index$4 = /*#__PURE__*/ function(_$e$modules$CommandDa) { |
| 20410 |
function Index() { |
| 20411 |
_classCallCheck(this, Index); |
| 20412 |
return _callSuper$12(this, Index, arguments); |
| 20413 |
} |
| 20414 |
_inherits(Index, _$e$modules$CommandDa); |
| 20415 |
return _createClass(Index, null, [{ |
| 20416 |
key: "getEndpointFormat", |
| 20417 |
value: function getEndpointFormat() { |
| 20418 |
return "kits/{id}"; |
| 20419 |
} |
| 20420 |
}]); |
| 20421 |
}($e.modules.CommandData); |
| 20422 |
|
| 20423 |
//#endregion |
| 20424 |
//#region app/modules/kit-library/assets/js/data/kits/component.js |
| 20425 |
init_classCallCheck(); |
| 20426 |
init_createClass(); |
| 20427 |
init_possibleConstructorReturn(); |
| 20428 |
init_getPrototypeOf(); |
| 20429 |
init_inherits(); |
| 20430 |
function _callSuper$11(t, o, e) { |
| 20431 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20432 |
} |
| 20433 |
__name(_callSuper$11, "_callSuper"); |
| 20434 |
function _isNativeReflectConstruct$11() { |
| 20435 |
try { |
| 20436 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20437 |
} catch (t) {} |
| 20438 |
return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() { |
| 20439 |
return !!t; |
| 20440 |
})(); |
| 20441 |
} |
| 20442 |
__name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct"); |
| 20443 |
var Component$2 = /*#__PURE__*/ function(_$e$modules$Component) { |
| 20444 |
function Component() { |
| 20445 |
_classCallCheck(this, Component); |
| 20446 |
return _callSuper$11(this, Component, arguments); |
| 20447 |
} |
| 20448 |
_inherits(Component, _$e$modules$Component); |
| 20449 |
return _createClass(Component, [{ |
| 20450 |
key: "getNamespace", |
| 20451 |
value: function getNamespace() { |
| 20452 |
return "kits"; |
| 20453 |
} |
| 20454 |
}, { |
| 20455 |
key: "defaultData", |
| 20456 |
value: function defaultData() { |
| 20457 |
return this.importCommands(commands_data_exports$2); |
| 20458 |
} |
| 20459 |
}]); |
| 20460 |
}($e.modules.ComponentBase); |
| 20461 |
|
| 20462 |
//#endregion |
| 20463 |
//#region app/modules/kit-library/assets/js/data/taxonomies/commands-data/index.js |
| 20464 |
var commands_data_exports$1 = /* @__PURE__ */ __exportAll({ Index: () => Index$3 }); |
| 20465 |
init_classCallCheck(); |
| 20466 |
init_createClass(); |
| 20467 |
init_possibleConstructorReturn(); |
| 20468 |
init_getPrototypeOf(); |
| 20469 |
init_inherits(); |
| 20470 |
function _callSuper$10(t, o, e) { |
| 20471 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20472 |
} |
| 20473 |
__name(_callSuper$10, "_callSuper"); |
| 20474 |
function _isNativeReflectConstruct$10() { |
| 20475 |
try { |
| 20476 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20477 |
} catch (t) {} |
| 20478 |
return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() { |
| 20479 |
return !!t; |
| 20480 |
})(); |
| 20481 |
} |
| 20482 |
__name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct"); |
| 20483 |
var Index$3 = /*#__PURE__*/ function(_$e$modules$CommandDa) { |
| 20484 |
function Index() { |
| 20485 |
_classCallCheck(this, Index); |
| 20486 |
return _callSuper$10(this, Index, arguments); |
| 20487 |
} |
| 20488 |
_inherits(Index, _$e$modules$CommandDa); |
| 20489 |
return _createClass(Index, null, [{ |
| 20490 |
key: "getEndpointFormat", |
| 20491 |
value: function getEndpointFormat() { |
| 20492 |
return "kit-taxonomies/{id}"; |
| 20493 |
} |
| 20494 |
}]); |
| 20495 |
}($e.modules.CommandData); |
| 20496 |
|
| 20497 |
//#endregion |
| 20498 |
//#region app/modules/kit-library/assets/js/data/taxonomies/component.js |
| 20499 |
init_classCallCheck(); |
| 20500 |
init_createClass(); |
| 20501 |
init_possibleConstructorReturn(); |
| 20502 |
init_getPrototypeOf(); |
| 20503 |
init_inherits(); |
| 20504 |
function _callSuper$9(t, o, e) { |
| 20505 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20506 |
} |
| 20507 |
__name(_callSuper$9, "_callSuper"); |
| 20508 |
function _isNativeReflectConstruct$9() { |
| 20509 |
try { |
| 20510 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20511 |
} catch (t) {} |
| 20512 |
return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() { |
| 20513 |
return !!t; |
| 20514 |
})(); |
| 20515 |
} |
| 20516 |
__name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct"); |
| 20517 |
var Component$1 = /*#__PURE__*/ function(_$e$modules$Component) { |
| 20518 |
function Component() { |
| 20519 |
_classCallCheck(this, Component); |
| 20520 |
return _callSuper$9(this, Component, arguments); |
| 20521 |
} |
| 20522 |
_inherits(Component, _$e$modules$Component); |
| 20523 |
return _createClass(Component, [{ |
| 20524 |
key: "getNamespace", |
| 20525 |
value: function getNamespace() { |
| 20526 |
return "kit-taxonomies"; |
| 20527 |
} |
| 20528 |
}, { |
| 20529 |
key: "defaultData", |
| 20530 |
value: function defaultData() { |
| 20531 |
return this.importCommands(commands_data_exports$1); |
| 20532 |
} |
| 20533 |
}]); |
| 20534 |
}($e.modules.ComponentBase); |
| 20535 |
|
| 20536 |
//#endregion |
| 20537 |
//#region app/modules/kit-library/assets/js/e-component.js |
| 20538 |
init_defineProperty$1(); |
| 20539 |
init_classCallCheck(); |
| 20540 |
init_createClass(); |
| 20541 |
init_possibleConstructorReturn(); |
| 20542 |
init_getPrototypeOf(); |
| 20543 |
init_inherits(); |
| 20544 |
function ownKeys$10(e, r) { |
| 20545 |
var t = Object.keys(e); |
| 20546 |
if (Object.getOwnPropertySymbols) { |
| 20547 |
var o = Object.getOwnPropertySymbols(e); |
| 20548 |
r && (o = o.filter(function(r) { |
| 20549 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 20550 |
})), t.push.apply(t, o); |
| 20551 |
} |
| 20552 |
return t; |
| 20553 |
} |
| 20554 |
__name(ownKeys$10, "ownKeys"); |
| 20555 |
function _objectSpread$9(e) { |
| 20556 |
for (var r = 1; r < arguments.length; r++) { |
| 20557 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 20558 |
r % 2 ? ownKeys$10(Object(t), !0).forEach(function(r) { |
| 20559 |
_defineProperty$1(e, r, t[r]); |
| 20560 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$10(Object(t)).forEach(function(r) { |
| 20561 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 20562 |
}); |
| 20563 |
} |
| 20564 |
return e; |
| 20565 |
} |
| 20566 |
__name(_objectSpread$9, "_objectSpread"); |
| 20567 |
function _callSuper$8(t, o, e) { |
| 20568 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20569 |
} |
| 20570 |
__name(_callSuper$8, "_callSuper"); |
| 20571 |
function _isNativeReflectConstruct$8() { |
| 20572 |
try { |
| 20573 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20574 |
} catch (t) {} |
| 20575 |
return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() { |
| 20576 |
return !!t; |
| 20577 |
})(); |
| 20578 |
} |
| 20579 |
__name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct"); |
| 20580 |
var EComponent = /*#__PURE__*/ function(_$e$modules$Component) { |
| 20581 |
function EComponent() { |
| 20582 |
_classCallCheck(this, EComponent); |
| 20583 |
return _callSuper$8(this, EComponent, arguments); |
| 20584 |
} |
| 20585 |
_inherits(EComponent, _$e$modules$Component); |
| 20586 |
return _createClass(EComponent, [{ |
| 20587 |
key: "getNamespace", |
| 20588 |
value: function getNamespace() { |
| 20589 |
return "kit-library"; |
| 20590 |
} |
| 20591 |
}, { |
| 20592 |
key: "defaultCommands", |
| 20593 |
value: function defaultCommands() { |
| 20594 |
return _objectSpread$9({}, [ |
| 20595 |
"apply-kit", |
| 20596 |
"approve-import", |
| 20597 |
"approve-selection", |
| 20598 |
"back-to-library", |
| 20599 |
"browse", |
| 20600 |
"change-sort-direction", |
| 20601 |
"change-sort-type", |
| 20602 |
"change-sort-value", |
| 20603 |
"check", |
| 20604 |
"check-item", |
| 20605 |
"check-out-kit", |
| 20606 |
"checking-a-checkbox", |
| 20607 |
"check-kits-on-theme-forest", |
| 20608 |
"checkbox-filtration", |
| 20609 |
"collapse", |
| 20610 |
"choose-file", |
| 20611 |
"choose-site-parts-to-import", |
| 20612 |
"clear-filter", |
| 20613 |
"close", |
| 20614 |
"drop", |
| 20615 |
"enable", |
| 20616 |
"expand", |
| 20617 |
"file-upload", |
| 20618 |
"filter", |
| 20619 |
"filter-selection", |
| 20620 |
"favorite-icon", |
| 20621 |
"go-back", |
| 20622 |
"go-back-to-view-kits", |
| 20623 |
"kit-free-search", |
| 20624 |
"kit-is-live-load", |
| 20625 |
"kit-import", |
| 20626 |
"logo", |
| 20627 |
"mark-as-favorite", |
| 20628 |
"modal-close", |
| 20629 |
"modal-load", |
| 20630 |
"modal-open", |
| 20631 |
"modal-error", |
| 20632 |
"open-site-area", |
| 20633 |
"refetch", |
| 20634 |
"responsive-controls", |
| 20635 |
"see-it-live", |
| 20636 |
"seek-more-info", |
| 20637 |
"sidebar-tag-filter", |
| 20638 |
"skip", |
| 20639 |
"select-organizing-category", |
| 20640 |
"top-bar-change-view", |
| 20641 |
"uncheck", |
| 20642 |
"unchecking-a-checkbox", |
| 20643 |
"view-demo-page", |
| 20644 |
"view-demo-part", |
| 20645 |
"view-overview-page", |
| 20646 |
"cloud-import", |
| 20647 |
"cloud-delete" |
| 20648 |
].reduce(function(allCommands, command) { |
| 20649 |
return _objectSpread$9(_objectSpread$9({}, allCommands), {}, _defineProperty$1({}, command, function() {})); |
| 20650 |
}, {})); |
| 20651 |
} |
| 20652 |
}]); |
| 20653 |
}($e.modules.ComponentBase); |
| 20654 |
|
| 20655 |
//#endregion |
| 20656 |
//#region app/modules/kit-library/assets/js/data/cloud-kits/commands-data/eligibility.js |
| 20657 |
init_classCallCheck(); |
| 20658 |
init_createClass(); |
| 20659 |
init_possibleConstructorReturn(); |
| 20660 |
init_getPrototypeOf(); |
| 20661 |
init_inherits(); |
| 20662 |
function _callSuper$7(t, o, e) { |
| 20663 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20664 |
} |
| 20665 |
__name(_callSuper$7, "_callSuper"); |
| 20666 |
function _isNativeReflectConstruct$7() { |
| 20667 |
try { |
| 20668 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20669 |
} catch (t) {} |
| 20670 |
return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() { |
| 20671 |
return !!t; |
| 20672 |
})(); |
| 20673 |
} |
| 20674 |
__name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct"); |
| 20675 |
var Eligibility = /*#__PURE__*/ function(_$e$modules$CommandDa) { |
| 20676 |
function Eligibility() { |
| 20677 |
_classCallCheck(this, Eligibility); |
| 20678 |
return _callSuper$7(this, Eligibility, arguments); |
| 20679 |
} |
| 20680 |
_inherits(Eligibility, _$e$modules$CommandDa); |
| 20681 |
return _createClass(Eligibility, null, [{ |
| 20682 |
key: "getEndpointFormat", |
| 20683 |
value: function getEndpointFormat() { |
| 20684 |
return "cloud-kits/eligibility"; |
| 20685 |
} |
| 20686 |
}]); |
| 20687 |
}($e.modules.CommandData); |
| 20688 |
|
| 20689 |
//#endregion |
| 20690 |
//#region app/modules/kit-library/assets/js/data/cloud-kits/commands-data/quota.js |
| 20691 |
init_classCallCheck(); |
| 20692 |
init_createClass(); |
| 20693 |
init_possibleConstructorReturn(); |
| 20694 |
init_getPrototypeOf(); |
| 20695 |
init_inherits(); |
| 20696 |
function _callSuper$6(t, o, e) { |
| 20697 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20698 |
} |
| 20699 |
__name(_callSuper$6, "_callSuper"); |
| 20700 |
function _isNativeReflectConstruct$6() { |
| 20701 |
try { |
| 20702 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20703 |
} catch (t) {} |
| 20704 |
return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { |
| 20705 |
return !!t; |
| 20706 |
})(); |
| 20707 |
} |
| 20708 |
__name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct"); |
| 20709 |
var Quota = /*#__PURE__*/ function(_$e$modules$CommandDa) { |
| 20710 |
function Quota() { |
| 20711 |
_classCallCheck(this, Quota); |
| 20712 |
return _callSuper$6(this, Quota, arguments); |
| 20713 |
} |
| 20714 |
_inherits(Quota, _$e$modules$CommandDa); |
| 20715 |
return _createClass(Quota, null, [{ |
| 20716 |
key: "getEndpointFormat", |
| 20717 |
value: function getEndpointFormat() { |
| 20718 |
return "cloud-kits/quota"; |
| 20719 |
} |
| 20720 |
}]); |
| 20721 |
}($e.modules.CommandData); |
| 20722 |
|
| 20723 |
//#endregion |
| 20724 |
//#region app/modules/kit-library/assets/js/data/cloud-kits/commands-data/index.js |
| 20725 |
var commands_data_exports = /* @__PURE__ */ __exportAll({ |
| 20726 |
Eligibility: () => Eligibility, |
| 20727 |
Index: () => Index$2, |
| 20728 |
Quota: () => Quota |
| 20729 |
}); |
| 20730 |
init_classCallCheck(); |
| 20731 |
init_createClass(); |
| 20732 |
init_possibleConstructorReturn(); |
| 20733 |
init_getPrototypeOf(); |
| 20734 |
init_inherits(); |
| 20735 |
function _callSuper$5(t, o, e) { |
| 20736 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20737 |
} |
| 20738 |
__name(_callSuper$5, "_callSuper"); |
| 20739 |
function _isNativeReflectConstruct$5() { |
| 20740 |
try { |
| 20741 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20742 |
} catch (t) {} |
| 20743 |
return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() { |
| 20744 |
return !!t; |
| 20745 |
})(); |
| 20746 |
} |
| 20747 |
__name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct"); |
| 20748 |
var Index$2 = /*#__PURE__*/ function(_$e$modules$CommandDa) { |
| 20749 |
function Index() { |
| 20750 |
_classCallCheck(this, Index); |
| 20751 |
return _callSuper$5(this, Index, arguments); |
| 20752 |
} |
| 20753 |
_inherits(Index, _$e$modules$CommandDa); |
| 20754 |
return _createClass(Index, null, [{ |
| 20755 |
key: "getEndpointFormat", |
| 20756 |
value: function getEndpointFormat() { |
| 20757 |
return "cloud-kits/{id}"; |
| 20758 |
} |
| 20759 |
}]); |
| 20760 |
}($e.modules.CommandData); |
| 20761 |
|
| 20762 |
//#endregion |
| 20763 |
//#region app/modules/kit-library/assets/js/data/cloud-kits/component.js |
| 20764 |
init_classCallCheck(); |
| 20765 |
init_createClass(); |
| 20766 |
init_possibleConstructorReturn(); |
| 20767 |
init_getPrototypeOf(); |
| 20768 |
init_inherits(); |
| 20769 |
function _callSuper$4(t, o, e) { |
| 20770 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 20771 |
} |
| 20772 |
__name(_callSuper$4, "_callSuper"); |
| 20773 |
function _isNativeReflectConstruct$4() { |
| 20774 |
try { |
| 20775 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 20776 |
} catch (t) {} |
| 20777 |
return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { |
| 20778 |
return !!t; |
| 20779 |
})(); |
| 20780 |
} |
| 20781 |
__name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct"); |
| 20782 |
var Component = /*#__PURE__*/ function(_$e$modules$Component) { |
| 20783 |
function Component() { |
| 20784 |
_classCallCheck(this, Component); |
| 20785 |
return _callSuper$4(this, Component, arguments); |
| 20786 |
} |
| 20787 |
_inherits(Component, _$e$modules$Component); |
| 20788 |
return _createClass(Component, [{ |
| 20789 |
key: "getNamespace", |
| 20790 |
value: function getNamespace() { |
| 20791 |
return "cloud-kits"; |
| 20792 |
} |
| 20793 |
}, { |
| 20794 |
key: "defaultData", |
| 20795 |
value: function defaultData() { |
| 20796 |
return this.importCommands(commands_data_exports); |
| 20797 |
} |
| 20798 |
}]); |
| 20799 |
}($e.modules.ComponentBase); |
| 20800 |
|
| 20801 |
//#endregion |
| 20802 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/envato-promotion.scss |
| 20803 |
var init_envato_promotion$1 = __esmMin((() => {})); |
| 20804 |
|
| 20805 |
//#endregion |
| 20806 |
//#region app/modules/kit-library/assets/js/components/envato-promotion.js |
| 20807 |
function EnvatoPromotion() { |
| 20808 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 20809 |
className: "e-kit-library-promotion", |
| 20810 |
variant: "xl" |
| 20811 |
}, (0, _wordpress_i18n.__)("Looking for more Website Templates?", "elementor"), " ", " ", /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 20812 |
variant: "underlined", |
| 20813 |
color: "link", |
| 20814 |
url: "https://go.elementor.com/app-envato-kits/", |
| 20815 |
target: "_blank", |
| 20816 |
rel: "noreferrer", |
| 20817 |
text: (0, _wordpress_i18n.__)("Check out Elementor Website Templates on ThemeForest", "elementor") |
| 20818 |
})); |
| 20819 |
} |
| 20820 |
var init_envato_promotion = __esmMin((() => { |
| 20821 |
init_envato_promotion$1(); |
| 20822 |
})); |
| 20823 |
|
| 20824 |
//#endregion |
| 20825 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/error-screen.scss |
| 20826 |
var init_error_screen$1 = __esmMin((() => {})); |
| 20827 |
|
| 20828 |
//#endregion |
| 20829 |
//#region app/modules/kit-library/assets/js/components/error-screen.js |
| 20830 |
function ErrorScreen(props) { |
| 20831 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 20832 |
container: true, |
| 20833 |
alignItems: "center", |
| 20834 |
justify: "center", |
| 20835 |
direction: "column", |
| 20836 |
className: "e-kit-library__error-screen" |
| 20837 |
}, /*#__PURE__*/ react.default.createElement("img", { src: "".concat(elementorAppConfig.assets_url, "images/no-search-results.svg") }), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 20838 |
tag: "h3", |
| 20839 |
variant: "display-1", |
| 20840 |
className: "e-kit-library__error-screen-title" |
| 20841 |
}, props.title), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 20842 |
variant: "xl", |
| 20843 |
className: "e-kit-library__error-screen-description" |
| 20844 |
}, props.description, " ", " ", !props.newLineButton && /*#__PURE__*/ react.default.createElement(ErrorScreenButton, props.button)), props.newLineButton && /*#__PURE__*/ react.default.createElement(ErrorScreenButton, props.button)); |
| 20845 |
} |
| 20846 |
var import_prop_types$46, ErrorScreenButton; |
| 20847 |
var init_error_screen = __esmMin((() => { |
| 20848 |
import_prop_types$46 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 20849 |
init_error_screen$1(); |
| 20850 |
ErrorScreenButton = function ErrorScreenButton(props) { |
| 20851 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 20852 |
text: props.text, |
| 20853 |
onClick: function onClick() { |
| 20854 |
if (props.action) props.action(); |
| 20855 |
}, |
| 20856 |
url: props.url, |
| 20857 |
target: props.target, |
| 20858 |
color: props.color || "link", |
| 20859 |
variant: props.variant || "" |
| 20860 |
}); |
| 20861 |
}; |
| 20862 |
ErrorScreenButton.propTypes = { |
| 20863 |
text: import_prop_types$46.default.string, |
| 20864 |
action: import_prop_types$46.default.func, |
| 20865 |
url: import_prop_types$46.default.string, |
| 20866 |
target: import_prop_types$46.default.string, |
| 20867 |
color: import_prop_types$46.default.oneOf([ |
| 20868 |
"primary", |
| 20869 |
"secondary", |
| 20870 |
"cta", |
| 20871 |
"link", |
| 20872 |
"disabled" |
| 20873 |
]), |
| 20874 |
variant: import_prop_types$46.default.oneOf([ |
| 20875 |
"contained", |
| 20876 |
"underlined", |
| 20877 |
"outlined", |
| 20878 |
"" |
| 20879 |
]) |
| 20880 |
}; |
| 20881 |
ErrorScreen.propTypes = { |
| 20882 |
title: import_prop_types$46.default.string, |
| 20883 |
description: import_prop_types$46.default.string, |
| 20884 |
newLineButton: import_prop_types$46.default.bool, |
| 20885 |
button: import_prop_types$46.default.shape({ |
| 20886 |
text: import_prop_types$46.default.string, |
| 20887 |
action: import_prop_types$46.default.func, |
| 20888 |
url: import_prop_types$46.default.string, |
| 20889 |
target: import_prop_types$46.default.string, |
| 20890 |
category: import_prop_types$46.default.string, |
| 20891 |
color: import_prop_types$46.default.oneOf([ |
| 20892 |
"primary", |
| 20893 |
"secondary", |
| 20894 |
"cta", |
| 20895 |
"link", |
| 20896 |
"disabled" |
| 20897 |
]), |
| 20898 |
variant: import_prop_types$46.default.oneOf([ |
| 20899 |
"contained", |
| 20900 |
"underlined", |
| 20901 |
"outlined", |
| 20902 |
"" |
| 20903 |
]) |
| 20904 |
}) |
| 20905 |
}; |
| 20906 |
})); |
| 20907 |
|
| 20908 |
//#endregion |
| 20909 |
//#region app/modules/kit-library/assets/js/hooks/use-selected-taxonomies.js |
| 20910 |
function useSelectedTaxonomies(taxonomiesFilter) { |
| 20911 |
return (0, react.useMemo)(function() { |
| 20912 |
return Object.values(taxonomiesFilter).reduce(function(current, groupedTaxonomies) { |
| 20913 |
return [].concat(_toConsumableArray(current), _toConsumableArray(groupedTaxonomies)); |
| 20914 |
}); |
| 20915 |
}, [taxonomiesFilter]); |
| 20916 |
} |
| 20917 |
var init_use_selected_taxonomies = __esmMin((() => { |
| 20918 |
init_toConsumableArray(); |
| 20919 |
})); |
| 20920 |
|
| 20921 |
//#endregion |
| 20922 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/badge.scss |
| 20923 |
var init_badge$1 = __esmMin((() => {})); |
| 20924 |
|
| 20925 |
//#endregion |
| 20926 |
//#region app/modules/kit-library/assets/js/components/badge.js |
| 20927 |
function Badge(props) { |
| 20928 |
return /*#__PURE__*/ react.default.createElement("span", { |
| 20929 |
className: "eps-badge eps-badge--".concat(props.variant, " ").concat(props.className), |
| 20930 |
style: props.style |
| 20931 |
}, props.children); |
| 20932 |
} |
| 20933 |
var import_prop_types$45; |
| 20934 |
var init_badge = __esmMin((() => { |
| 20935 |
import_prop_types$45 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 20936 |
init_badge$1(); |
| 20937 |
Badge.propTypes = { |
| 20938 |
children: import_prop_types$45.default.node, |
| 20939 |
className: import_prop_types$45.default.string, |
| 20940 |
style: import_prop_types$45.default.object, |
| 20941 |
variant: import_prop_types$45.default.oneOf(["sm", "md"]) |
| 20942 |
}; |
| 20943 |
Badge.defaultProps = { |
| 20944 |
className: "", |
| 20945 |
style: {}, |
| 20946 |
variant: "md" |
| 20947 |
}; |
| 20948 |
})); |
| 20949 |
|
| 20950 |
//#endregion |
| 20951 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/filter-indication-text.scss |
| 20952 |
var init_filter_indication_text$1 = __esmMin((() => {})); |
| 20953 |
|
| 20954 |
//#endregion |
| 20955 |
//#region assets/dev/js/utils/tiers.js |
| 20956 |
var TIERS_PRIORITY, TIERS, isTierAtLeast; |
| 20957 |
var init_tiers = __esmMin((() => { |
| 20958 |
TIERS_PRIORITY = Object.freeze([ |
| 20959 |
"free", |
| 20960 |
"essential", |
| 20961 |
"essential-oct2023", |
| 20962 |
"advanced", |
| 20963 |
"expert", |
| 20964 |
"agency" |
| 20965 |
]); |
| 20966 |
TIERS = Object.freeze(TIERS_PRIORITY.reduce(function(acc, tier) { |
| 20967 |
acc[tier] = tier; |
| 20968 |
return acc; |
| 20969 |
}, {})); |
| 20970 |
isTierAtLeast = function isTierAtLeast(currentTier, expectedTier) { |
| 20971 |
var currentTierIndex = TIERS_PRIORITY.indexOf(currentTier); |
| 20972 |
var expectedTierIndex = TIERS_PRIORITY.indexOf(expectedTier); |
| 20973 |
if (-1 === currentTierIndex || -1 === expectedTierIndex) return false; |
| 20974 |
return currentTierIndex >= expectedTierIndex; |
| 20975 |
}; |
| 20976 |
})); |
| 20977 |
|
| 20978 |
//#endregion |
| 20979 |
//#region app/modules/kit-library/assets/js/models/base-model.js |
| 20980 |
var BaseModel; |
| 20981 |
var init_base_model = __esmMin((() => { |
| 20982 |
init_slicedToArray(); |
| 20983 |
init_classCallCheck(); |
| 20984 |
init_createClass(); |
| 20985 |
BaseModel = /*#__PURE__*/ function() { |
| 20986 |
function BaseModel() { |
| 20987 |
_classCallCheck(this, BaseModel); |
| 20988 |
} |
| 20989 |
return _createClass(BaseModel, [{ |
| 20990 |
key: "clone", |
| 20991 |
value: function clone() { |
| 20992 |
var _this = this; |
| 20993 |
var instance = new this.constructor(); |
| 20994 |
Object.keys(this).forEach(function(key) { |
| 20995 |
instance[key] = _this[key]; |
| 20996 |
}); |
| 20997 |
return instance; |
| 20998 |
} |
| 20999 |
}, { |
| 21000 |
key: "init", |
| 21001 |
value: function init() { |
| 21002 |
var _this2 = this; |
| 21003 |
var data = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; |
| 21004 |
Object.entries(data).forEach(function(_ref) { |
| 21005 |
var _ref2 = _slicedToArray(_ref, 2); |
| 21006 |
var key = _ref2[0]; |
| 21007 |
_this2[key] = _ref2[1]; |
| 21008 |
}); |
| 21009 |
return this; |
| 21010 |
} |
| 21011 |
}]); |
| 21012 |
}(); |
| 21013 |
})); |
| 21014 |
|
| 21015 |
//#endregion |
| 21016 |
//#region app/modules/kit-library/assets/js/models/taxonomy.js |
| 21017 |
function _callSuper$3(t, o, e) { |
| 21018 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 21019 |
} |
| 21020 |
function _isNativeReflectConstruct$3() { |
| 21021 |
try { |
| 21022 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 21023 |
} catch (t) {} |
| 21024 |
return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { |
| 21025 |
return !!t; |
| 21026 |
})(); |
| 21027 |
} |
| 21028 |
var SUBSCRIPTION_PLAN, TaxonomyTypes, Taxonomy; |
| 21029 |
var init_taxonomy = __esmMin((() => { |
| 21030 |
init_classCallCheck(); |
| 21031 |
init_createClass(); |
| 21032 |
init_possibleConstructorReturn(); |
| 21033 |
init_getPrototypeOf(); |
| 21034 |
init_inherits(); |
| 21035 |
init_defineProperty$1(); |
| 21036 |
init_base_model(); |
| 21037 |
__name(_callSuper$3, "_callSuper"); |
| 21038 |
__name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct"); |
| 21039 |
SUBSCRIPTION_PLAN = "subscription_plans"; |
| 21040 |
TaxonomyTypes = [ |
| 21041 |
{ |
| 21042 |
key: "categories", |
| 21043 |
label: (0, _wordpress_i18n.__)("Categories", "elementor"), |
| 21044 |
isOpenByDefault: true, |
| 21045 |
data: [] |
| 21046 |
}, |
| 21047 |
{ |
| 21048 |
key: "tags", |
| 21049 |
label: (0, _wordpress_i18n.__)("Tags", "elementor"), |
| 21050 |
data: [] |
| 21051 |
}, |
| 21052 |
{ |
| 21053 |
key: "features", |
| 21054 |
label: (0, _wordpress_i18n.__)("Features", "elementor"), |
| 21055 |
data: [] |
| 21056 |
}, |
| 21057 |
{ |
| 21058 |
key: SUBSCRIPTION_PLAN, |
| 21059 |
label: (0, _wordpress_i18n.__)("Plan", "elementor"), |
| 21060 |
data: [] |
| 21061 |
} |
| 21062 |
]; |
| 21063 |
Taxonomy = /*#__PURE__*/ function(_BaseModel) { |
| 21064 |
function Taxonomy() { |
| 21065 |
var _this; |
| 21066 |
_classCallCheck(this, Taxonomy); |
| 21067 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 21068 |
_this = _callSuper$3(this, Taxonomy, [].concat(args)); |
| 21069 |
_defineProperty$1(_this, "text", ""); |
| 21070 |
_defineProperty$1(_this, "type", "tag"); |
| 21071 |
_defineProperty$1(_this, "id", null); |
| 21072 |
return _this; |
| 21073 |
} |
| 21074 |
_inherits(Taxonomy, _BaseModel); |
| 21075 |
return _createClass(Taxonomy, null, [{ |
| 21076 |
key: "createFromResponse", |
| 21077 |
value: function createFromResponse(taxonomy) { |
| 21078 |
return new Taxonomy().init({ |
| 21079 |
text: taxonomy.text, |
| 21080 |
type: taxonomy.type, |
| 21081 |
id: taxonomy.id || null |
| 21082 |
}); |
| 21083 |
} |
| 21084 |
}]); |
| 21085 |
}(BaseModel); |
| 21086 |
})); |
| 21087 |
|
| 21088 |
//#endregion |
| 21089 |
//#region app/modules/kit-library/assets/js/models/taxonomy-transformer.js |
| 21090 |
function ownKeys$9(e, r) { |
| 21091 |
var t = Object.keys(e); |
| 21092 |
if (Object.getOwnPropertySymbols) { |
| 21093 |
var o = Object.getOwnPropertySymbols(e); |
| 21094 |
r && (o = o.filter(function(r) { |
| 21095 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 21096 |
})), t.push.apply(t, o); |
| 21097 |
} |
| 21098 |
return t; |
| 21099 |
} |
| 21100 |
function _objectSpread$8(e) { |
| 21101 |
for (var r = 1; r < arguments.length; r++) { |
| 21102 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 21103 |
r % 2 ? ownKeys$9(Object(t), !0).forEach(function(r) { |
| 21104 |
_defineProperty$1(e, r, t[r]); |
| 21105 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function(r) { |
| 21106 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 21107 |
}); |
| 21108 |
} |
| 21109 |
return e; |
| 21110 |
} |
| 21111 |
function getTaxonomyFilterItems(taxonomies) { |
| 21112 |
taxonomies = taxonomies ? _toConsumableArray(taxonomies) : []; |
| 21113 |
var taxonomyFilterItems = taxonomies.reduce(function(map, taxonomy) { |
| 21114 |
var formattedTaxonomy = _getFormattedTaxonomyItem(taxonomy); |
| 21115 |
var taxonomyType = TaxonomyTypes.find(function(_ref) { |
| 21116 |
return _ref.key === formattedTaxonomy.type; |
| 21117 |
}); |
| 21118 |
if (!taxonomyType) return map; |
| 21119 |
if (!map[formattedTaxonomy.type]) map[formattedTaxonomy.type] = _objectSpread$8({}, taxonomyType); |
| 21120 |
if (!map[formattedTaxonomy.type].data.find(function(_ref2) { |
| 21121 |
return _ref2.text === formattedTaxonomy.text; |
| 21122 |
})) map[formattedTaxonomy.type].data.push(formattedTaxonomy); |
| 21123 |
return map; |
| 21124 |
}, {}); |
| 21125 |
return TaxonomyTypes.reduce(function(formattedTaxonomies, taxonomyItem) { |
| 21126 |
var _taxonomyFilterItems$; |
| 21127 |
if ((_taxonomyFilterItems$ = taxonomyFilterItems[taxonomyItem.key]) !== null && _taxonomyFilterItems$ !== void 0 && (_taxonomyFilterItems$ = _taxonomyFilterItems$.data) !== null && _taxonomyFilterItems$ !== void 0 && _taxonomyFilterItems$.length) formattedTaxonomies.push(taxonomyFilterItems[taxonomyItem.key]); |
| 21128 |
return formattedTaxonomies; |
| 21129 |
}, []); |
| 21130 |
} |
| 21131 |
function isKitInTaxonomy(kit, taxonomyType, taxonomies) { |
| 21132 |
return "subscription_plans" === taxonomyType ? taxonomies.includes(TierToKeyMap[kit.accessTier]) : taxonomies.some(function(taxonomy) { |
| 21133 |
return kit.taxonomies.includes(taxonomy); |
| 21134 |
}); |
| 21135 |
} |
| 21136 |
function _getFormattedTaxonomyItem(taxonomy) { |
| 21137 |
switch (taxonomy.type) { |
| 21138 |
case SUBSCRIPTION_PLAN: return _getFormattedSubscriptionByPlanTaxonomy(taxonomy); |
| 21139 |
default: return taxonomy; |
| 21140 |
} |
| 21141 |
} |
| 21142 |
function _getTaxonomyIdByText(taxonomyText) { |
| 21143 |
return Object.keys(OldPlanTexts).find(function(id) { |
| 21144 |
return OldPlanTexts[id] === taxonomyText; |
| 21145 |
}); |
| 21146 |
} |
| 21147 |
function _getFormattedTaxonomyId(taxonomyId) { |
| 21148 |
return TaxonomyTransformMap[taxonomyId] || taxonomyId; |
| 21149 |
} |
| 21150 |
function _getFormattedSubscriptionByPlanTaxonomy(taxonomy) { |
| 21151 |
var transformedTaxonomy = new Taxonomy(); |
| 21152 |
transformedTaxonomy.id = _getFormattedTaxonomyId(_getTaxonomyIdByText(taxonomy.text)); |
| 21153 |
transformedTaxonomy.text = NewPlanTexts[transformedTaxonomy.id] || taxonomy.text; |
| 21154 |
transformedTaxonomy.type = taxonomy.type; |
| 21155 |
return transformedTaxonomy; |
| 21156 |
} |
| 21157 |
var FREE, ESSENTIAL, ADVANCED, PRO, EXPERT, AGENCY, OldPlanTexts, NewPlanTexts, TaxonomyTransformMap, TierToKeyMap, PromotionChipText; |
| 21158 |
var init_taxonomy_transformer = __esmMin((() => { |
| 21159 |
init_toConsumableArray(); |
| 21160 |
init_defineProperty$1(); |
| 21161 |
init_tiers(); |
| 21162 |
init_taxonomy(); |
| 21163 |
__name(ownKeys$9, "ownKeys"); |
| 21164 |
__name(_objectSpread$8, "_objectSpread"); |
| 21165 |
FREE = "free"; |
| 21166 |
ESSENTIAL = "essential"; |
| 21167 |
ADVANCED = "advanced"; |
| 21168 |
PRO = "pro"; |
| 21169 |
EXPERT = "expert,"; |
| 21170 |
AGENCY = "agency"; |
| 21171 |
OldPlanTexts = _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, FREE, (0, _wordpress_i18n.__)("Free", "elementor")), PRO, (0, _wordpress_i18n.__)("Pro", "elementor")), ADVANCED, (0, _wordpress_i18n.__)("Advanced", "elementor")), EXPERT, (0, _wordpress_i18n.__)("Expert", "elementor")), AGENCY, (0, _wordpress_i18n.__)("Agency", "elementor")); |
| 21172 |
NewPlanTexts = _defineProperty$1(_defineProperty$1(_defineProperty$1({}, FREE, (0, _wordpress_i18n.__)("Free", "elementor")), ESSENTIAL, (0, _wordpress_i18n.__)("Essential", "elementor")), ADVANCED, (0, _wordpress_i18n.__)("Advanced & Higher", "elementor")); |
| 21173 |
TaxonomyTransformMap = _defineProperty$1(_defineProperty$1(_defineProperty$1({}, PRO, ESSENTIAL), EXPERT, ADVANCED), AGENCY, ADVANCED); |
| 21174 |
TierToKeyMap = _defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1(_defineProperty$1({}, TIERS.free, FREE), TIERS.essential, ESSENTIAL), TIERS["essential-oct2023"], ADVANCED), TIERS.expert, ADVANCED), TIERS.agency, ADVANCED); |
| 21175 |
PromotionChipText = _defineProperty$1(_defineProperty$1(_defineProperty$1({}, FREE, (0, _wordpress_i18n.__)("Free", "elementor")), ESSENTIAL, (0, _wordpress_i18n.__)("Essential", "elementor")), ADVANCED, (0, _wordpress_i18n.__)("Advanced", "elementor")); |
| 21176 |
})); |
| 21177 |
|
| 21178 |
//#endregion |
| 21179 |
//#region app/modules/kit-library/assets/js/components/filter-indication-text.js |
| 21180 |
function FilterIndicationText(props) { |
| 21181 |
var selectedTaxonomies = useSelectedTaxonomies(props.queryParams.taxonomies); |
| 21182 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 21183 |
container: true, |
| 21184 |
className: "e-kit-library__filter-indication" |
| 21185 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { className: "e-kit-library__filter-indication-text" }, (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n._n)("Showing %s result for", "Showing %s results for", props.resultCount, "elementor"), !props.resultCount ? (0, _wordpress_i18n.__)("no", "elementor") : props.resultCount), " ", props.queryParams.search && "\"".concat(props.queryParams.search, "\""), " ", selectedTaxonomies.length > 0 && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, selectedTaxonomies.map(function(taxonomy) { |
| 21186 |
return /*#__PURE__*/ react.default.createElement(Badge, { |
| 21187 |
key: taxonomy, |
| 21188 |
className: "e-kit-library__filter-indication-badge" |
| 21189 |
}, NewPlanTexts[taxonomy] || taxonomy, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 21190 |
text: (0, _wordpress_i18n.__)("Remove", "elementor"), |
| 21191 |
hideText: true, |
| 21192 |
icon: "eicon-editor-close", |
| 21193 |
className: "e-kit-library__filter-indication-badge-remove", |
| 21194 |
onClick: function onClick() { |
| 21195 |
props.onRemoveTag(taxonomy); |
| 21196 |
} |
| 21197 |
})); |
| 21198 |
}))), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 21199 |
className: "e-kit-library__filter-indication-button", |
| 21200 |
text: (0, _wordpress_i18n.__)("Clear all", "elementor"), |
| 21201 |
variant: "underlined", |
| 21202 |
onClick: function onClick() { |
| 21203 |
props.onClear(); |
| 21204 |
} |
| 21205 |
})); |
| 21206 |
} |
| 21207 |
var import_prop_types$44; |
| 21208 |
var init_filter_indication_text = __esmMin((() => { |
| 21209 |
import_prop_types$44 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 21210 |
init_use_selected_taxonomies(); |
| 21211 |
init_badge(); |
| 21212 |
init_filter_indication_text$1(); |
| 21213 |
init_taxonomy_transformer(); |
| 21214 |
FilterIndicationText.propTypes = { |
| 21215 |
queryParams: import_prop_types$44.default.shape({ |
| 21216 |
search: import_prop_types$44.default.string, |
| 21217 |
taxonomies: import_prop_types$44.default.objectOf(import_prop_types$44.default.arrayOf(import_prop_types$44.default.string)), |
| 21218 |
favorite: import_prop_types$44.default.bool |
| 21219 |
}), |
| 21220 |
resultCount: import_prop_types$44.default.number.isRequired, |
| 21221 |
onClear: import_prop_types$44.default.func.isRequired, |
| 21222 |
onRemoveTag: import_prop_types$44.default.func.isRequired |
| 21223 |
}; |
| 21224 |
})); |
| 21225 |
|
| 21226 |
//#endregion |
| 21227 |
//#region app/modules/kit-library/assets/js/context/return-to-context.js |
| 21228 |
function useReturnTo() { |
| 21229 |
return (0, react.useContext)(ReturnToContext); |
| 21230 |
} |
| 21231 |
function ReturnToProvider(_ref) { |
| 21232 |
var value = _ref.value; |
| 21233 |
var children = _ref.children; |
| 21234 |
return /*#__PURE__*/ react.default.createElement(ReturnToContext.Provider, { value }, children); |
| 21235 |
} |
| 21236 |
var import_prop_types$43, ReturnToContext; |
| 21237 |
var init_return_to_context = __esmMin((() => { |
| 21238 |
import_prop_types$43 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 21239 |
ReturnToContext = (0, react.createContext)(null); |
| 21240 |
ReturnToProvider.propTypes = { |
| 21241 |
children: import_prop_types$43.default.any, |
| 21242 |
value: import_prop_types$43.default.string |
| 21243 |
}; |
| 21244 |
})); |
| 21245 |
|
| 21246 |
//#endregion |
| 21247 |
//#region app/modules/kit-library/assets/js/components/layout/header.js |
| 21248 |
function Header(props) { |
| 21249 |
var returnTo = useReturnTo(); |
| 21250 |
var onClose = (0, react.useCallback)(function() { |
| 21251 |
if (window.top !== window) { |
| 21252 |
window.top.$e.run("app/close"); |
| 21253 |
return; |
| 21254 |
} |
| 21255 |
if (returnTo && safeRedirect$1(returnTo)) return; |
| 21256 |
window.top.location = elementorAppConfig.admin_url; |
| 21257 |
}, [returnTo]); |
| 21258 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 21259 |
container: true, |
| 21260 |
alignItems: "center", |
| 21261 |
justify: "space-between", |
| 21262 |
className: "eps-app__header" |
| 21263 |
}, props.startColumn || /*#__PURE__*/ react.default.createElement("a", { |
| 21264 |
className: "eps-app__logo-title-wrapper", |
| 21265 |
href: "#/kit-library" |
| 21266 |
}, /*#__PURE__*/ react.default.createElement("i", { className: "eps-app__logo eicon-elementor-circle" }), /*#__PURE__*/ react.default.createElement("h1", { className: "eps-app__title" }, (0, _wordpress_i18n.__)("Website Templates", "elementor"))), props.centerColumn || /*#__PURE__*/ react.default.createElement("span", null), props.endColumn || /*#__PURE__*/ react.default.createElement("div", { style: { flex: 1 } }, /*#__PURE__*/ react.default.createElement(HeaderButtons, { |
| 21267 |
buttons: props.buttons, |
| 21268 |
onClose |
| 21269 |
}))); |
| 21270 |
} |
| 21271 |
var import_prop_types$42; |
| 21272 |
var init_header = __esmMin((() => { |
| 21273 |
import_prop_types$42 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 21274 |
init_header_buttons(); |
| 21275 |
init_return_to_context(); |
| 21276 |
init_redirect(); |
| 21277 |
Header.propTypes = { |
| 21278 |
startColumn: import_prop_types$42.default.node, |
| 21279 |
endColumn: import_prop_types$42.default.node, |
| 21280 |
centerColumn: import_prop_types$42.default.node, |
| 21281 |
buttons: import_prop_types$42.default.arrayOf(import_prop_types$42.default.object), |
| 21282 |
kitName: import_prop_types$42.default.string, |
| 21283 |
pageId: import_prop_types$42.default.string |
| 21284 |
}; |
| 21285 |
})); |
| 21286 |
|
| 21287 |
//#endregion |
| 21288 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/pages/index/index-header.scss |
| 21289 |
var init_index_header$1 = __esmMin((() => {})); |
| 21290 |
|
| 21291 |
//#endregion |
| 21292 |
//#region app/modules/kit-library/assets/js/pages/index/index-header.js |
| 21293 |
function IndexHeader(props) { |
| 21294 |
var _elementorAppConfig$u; |
| 21295 |
var _elementorAppConfig$u2; |
| 21296 |
var navigate = useNavigate(); |
| 21297 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 21298 |
var isInfoModalOpen = _useState2[0]; |
| 21299 |
var setIsInfoModalOpen = _useState2[1]; |
| 21300 |
var importRef = (0, react.useRef)(); |
| 21301 |
var shouldShowImportButton = elementorAppConfig.user.is_administrator || ((_elementorAppConfig$u = (_elementorAppConfig$u2 = elementorAppConfig.user.restrictions) === null || _elementorAppConfig$u2 === void 0 ? void 0 : _elementorAppConfig$u2.includes("json-upload")) !== null && _elementorAppConfig$u !== void 0 ? _elementorAppConfig$u : false); |
| 21302 |
var refetch = props.refetch; |
| 21303 |
var isFetching = props.isFetching; |
| 21304 |
var buttons = (0, react.useMemo)(function() { |
| 21305 |
return [ |
| 21306 |
{ |
| 21307 |
id: "info", |
| 21308 |
text: (0, _wordpress_i18n.__)("Info", "elementor"), |
| 21309 |
hideText: true, |
| 21310 |
icon: "eicon-info-circle-o", |
| 21311 |
onClick: function onClick() { |
| 21312 |
setIsInfoModalOpen(true); |
| 21313 |
} |
| 21314 |
}, |
| 21315 |
{ |
| 21316 |
id: "refetch", |
| 21317 |
text: (0, _wordpress_i18n.__)("Refetch", "elementor"), |
| 21318 |
hideText: true, |
| 21319 |
icon: "eicon-sync ".concat(isFetching ? "eicon-animation-spin" : ""), |
| 21320 |
onClick: function onClick() { |
| 21321 |
refetch(); |
| 21322 |
} |
| 21323 |
}, |
| 21324 |
shouldShowImportButton && { |
| 21325 |
id: "import", |
| 21326 |
text: (0, _wordpress_i18n.__)("Import", "elementor"), |
| 21327 |
hideText: true, |
| 21328 |
icon: "eicon-upload-circle-o", |
| 21329 |
elRef: importRef, |
| 21330 |
onClick: function onClick() { |
| 21331 |
navigate("/import-customization"); |
| 21332 |
} |
| 21333 |
} |
| 21334 |
]; |
| 21335 |
}, [ |
| 21336 |
isFetching, |
| 21337 |
refetch, |
| 21338 |
shouldShowImportButton, |
| 21339 |
navigate |
| 21340 |
]); |
| 21341 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(Header, { buttons }), /*#__PURE__*/ react.default.createElement(PopoverDialog, { |
| 21342 |
targetRef: importRef, |
| 21343 |
wrapperClass: "e-kit-library__tooltip" |
| 21344 |
}, (0, _wordpress_i18n.__)("Import Website Template", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.ModalProvider, { |
| 21345 |
title: (0, _wordpress_i18n.__)("Welcome to the Library", "elementor"), |
| 21346 |
show: isInfoModalOpen, |
| 21347 |
setShow: setIsInfoModalOpen |
| 21348 |
}, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library-header-info-modal-container" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 21349 |
tag: "h3", |
| 21350 |
variant: "h3" |
| 21351 |
}, (0, _wordpress_i18n.__)("What's a Website Template?", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, null, (0, _wordpress_i18n.__)("A Website Template is full, ready-made design that you can apply to your site. It includes all the pages, parts, settings and content that you'd expect in a fully functional website.", "elementor"))), /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library-header-info-modal-container" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 21352 |
tag: "h3", |
| 21353 |
variant: "h3" |
| 21354 |
}, (0, _wordpress_i18n.__)("What's going on in the Website Templates Library?", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, null, (0, _wordpress_i18n.__)("Search & filter for website templates by category and tags, or browse through individual website templates to see what's inside.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), (0, _wordpress_i18n.__)("Once you've picked a winner, apply it to your site!", "elementor"))), /*#__PURE__*/ react.default.createElement("div", null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 21355 |
tag: "h3", |
| 21356 |
variant: "h3" |
| 21357 |
}, (0, _wordpress_i18n.__)("Happy browsing!", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 21358 |
url: "https://go.elementor.com/app-kit-library-how-to-use-kits/", |
| 21359 |
target: "_blank", |
| 21360 |
rel: "noreferrer", |
| 21361 |
text: (0, _wordpress_i18n.__)("Learn more", "elementor"), |
| 21362 |
color: "link" |
| 21363 |
}), " ", (0, _wordpress_i18n.__)("about using templates", "elementor"))))); |
| 21364 |
} |
| 21365 |
var import_prop_types$41; |
| 21366 |
var init_index_header = __esmMin((() => { |
| 21367 |
import_prop_types$41 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 21368 |
init_slicedToArray(); |
| 21369 |
init_header(); |
| 21370 |
init_es$1(); |
| 21371 |
init_popover_dialog(); |
| 21372 |
init_index_header$1(); |
| 21373 |
IndexHeader.propTypes = { |
| 21374 |
refetch: import_prop_types$41.default.func.isRequired, |
| 21375 |
isFetching: import_prop_types$41.default.bool |
| 21376 |
}; |
| 21377 |
})); |
| 21378 |
|
| 21379 |
//#endregion |
| 21380 |
//#region app/modules/kit-library/assets/js/pages/index/index-sidebar.js |
| 21381 |
function IndexSidebar(props) { |
| 21382 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, props.menuItems.map(function(item) { |
| 21383 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.MenuItem, { |
| 21384 |
key: item.label, |
| 21385 |
text: item.label, |
| 21386 |
className: "eps-menu-item__link ".concat(item.isActive ? "eps-menu-item--active" : ""), |
| 21387 |
icon: item.icon, |
| 21388 |
url: item.url |
| 21389 |
}); |
| 21390 |
}), props.tagsFilterSlot); |
| 21391 |
} |
| 21392 |
var import_prop_types$40; |
| 21393 |
var init_index_sidebar = __esmMin((() => { |
| 21394 |
import_prop_types$40 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 21395 |
IndexSidebar.propTypes = { |
| 21396 |
tagsFilterSlot: import_prop_types$40.default.node, |
| 21397 |
menuItems: import_prop_types$40.default.arrayOf(import_prop_types$40.default.shape({ |
| 21398 |
label: import_prop_types$40.default.string, |
| 21399 |
icon: import_prop_types$40.default.string, |
| 21400 |
isActive: import_prop_types$40.default.bool, |
| 21401 |
url: import_prop_types$40.default.string |
| 21402 |
})) |
| 21403 |
}; |
| 21404 |
})); |
| 21405 |
|
| 21406 |
//#endregion |
| 21407 |
//#region app/modules/kit-library/assets/js/models/document.js |
| 21408 |
function _callSuper$2(t, o, e) { |
| 21409 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 21410 |
} |
| 21411 |
function _isNativeReflectConstruct$2() { |
| 21412 |
try { |
| 21413 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 21414 |
} catch (t) {} |
| 21415 |
return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { |
| 21416 |
return !!t; |
| 21417 |
})(); |
| 21418 |
} |
| 21419 |
var Document; |
| 21420 |
var init_document = __esmMin((() => { |
| 21421 |
init_classCallCheck(); |
| 21422 |
init_createClass(); |
| 21423 |
init_possibleConstructorReturn(); |
| 21424 |
init_getPrototypeOf(); |
| 21425 |
init_inherits(); |
| 21426 |
init_defineProperty$1(); |
| 21427 |
init_base_model(); |
| 21428 |
__name(_callSuper$2, "_callSuper"); |
| 21429 |
__name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct"); |
| 21430 |
Document = /*#__PURE__*/ function(_BaseModel) { |
| 21431 |
function Document() { |
| 21432 |
var _this; |
| 21433 |
_classCallCheck(this, Document); |
| 21434 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 21435 |
_this = _callSuper$2(this, Document, [].concat(args)); |
| 21436 |
_defineProperty$1(_this, "id", ""); |
| 21437 |
_defineProperty$1(_this, "title", ""); |
| 21438 |
_defineProperty$1(_this, "documentType", ""); |
| 21439 |
_defineProperty$1(_this, "thumbnailUrl", ""); |
| 21440 |
_defineProperty$1(_this, "previewUrl", ""); |
| 21441 |
return _this; |
| 21442 |
} |
| 21443 |
_inherits(Document, _BaseModel); |
| 21444 |
return _createClass(Document, null, [{ |
| 21445 |
key: "createFromResponse", |
| 21446 |
value: function createFromResponse(document) { |
| 21447 |
return new Document().init({ |
| 21448 |
id: document.id, |
| 21449 |
title: document.title, |
| 21450 |
documentType: document.doc_type, |
| 21451 |
thumbnailUrl: document.thumbnail_url, |
| 21452 |
previewUrl: document.preview_url |
| 21453 |
}); |
| 21454 |
} |
| 21455 |
}]); |
| 21456 |
}(BaseModel); |
| 21457 |
})); |
| 21458 |
|
| 21459 |
//#endregion |
| 21460 |
//#region app/modules/kit-library/assets/js/models/kit.js |
| 21461 |
function _callSuper$1(t, o, e) { |
| 21462 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 21463 |
} |
| 21464 |
function _isNativeReflectConstruct$1() { |
| 21465 |
try { |
| 21466 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 21467 |
} catch (t) {} |
| 21468 |
return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { |
| 21469 |
return !!t; |
| 21470 |
})(); |
| 21471 |
} |
| 21472 |
var Kit; |
| 21473 |
var init_kit = __esmMin((() => { |
| 21474 |
init_classCallCheck(); |
| 21475 |
init_createClass(); |
| 21476 |
init_possibleConstructorReturn(); |
| 21477 |
init_getPrototypeOf(); |
| 21478 |
init_inherits(); |
| 21479 |
init_defineProperty$1(); |
| 21480 |
init_base_model(); |
| 21481 |
init_document(); |
| 21482 |
__name(_callSuper$1, "_callSuper"); |
| 21483 |
__name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); |
| 21484 |
Kit = /*#__PURE__*/ function(_BaseModel) { |
| 21485 |
function Kit() { |
| 21486 |
var _this; |
| 21487 |
_classCallCheck(this, Kit); |
| 21488 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 21489 |
_this = _callSuper$1(this, Kit, [].concat(args)); |
| 21490 |
_defineProperty$1(_this, "id", ""); |
| 21491 |
_defineProperty$1(_this, "title", ""); |
| 21492 |
_defineProperty$1(_this, "description", ""); |
| 21493 |
_defineProperty$1(_this, "isFavorite", false); |
| 21494 |
_defineProperty$1(_this, "thumbnailUrl", null); |
| 21495 |
_defineProperty$1(_this, "previewUrl", ""); |
| 21496 |
_defineProperty$1(_this, "accessLevel", 0); |
| 21497 |
_defineProperty$1(_this, "trendIndex", null); |
| 21498 |
_defineProperty$1(_this, "popularityIndex", null); |
| 21499 |
_defineProperty$1(_this, "featuredIndex", null); |
| 21500 |
_defineProperty$1(_this, "createdAt", null); |
| 21501 |
_defineProperty$1(_this, "updatedAt", null); |
| 21502 |
_defineProperty$1(_this, "keywords", []); |
| 21503 |
_defineProperty$1(_this, "taxonomies", []); |
| 21504 |
_defineProperty$1(_this, "documents", []); |
| 21505 |
return _this; |
| 21506 |
} |
| 21507 |
_inherits(Kit, _BaseModel); |
| 21508 |
return _createClass(Kit, [{ |
| 21509 |
key: "getDocumentsByTypes", |
| 21510 |
value: function getDocumentsByTypes(contentTypes) { |
| 21511 |
var _this2 = this; |
| 21512 |
return contentTypes.map(function(contentType) { |
| 21513 |
contentType = contentType.clone(); |
| 21514 |
contentType.documents = _this2.documents.filter(function(document) { |
| 21515 |
return contentType.documentTypes.includes(document.documentType); |
| 21516 |
}); |
| 21517 |
return contentType; |
| 21518 |
}); |
| 21519 |
} |
| 21520 |
}], [{ |
| 21521 |
key: "createFromResponse", |
| 21522 |
value: function createFromResponse(kit) { |
| 21523 |
return new Kit().init({ |
| 21524 |
id: kit.id, |
| 21525 |
title: kit.title, |
| 21526 |
description: kit.description, |
| 21527 |
isFavorite: kit.is_favorite, |
| 21528 |
thumbnailUrl: kit.thumbnail_url, |
| 21529 |
previewUrl: kit.preview_url, |
| 21530 |
accessLevel: kit.access_level, |
| 21531 |
accessTier: kit.access_tier, |
| 21532 |
trendIndex: kit.trend_index, |
| 21533 |
popularityIndex: kit.popularity_index, |
| 21534 |
featuredIndex: kit.featured_index, |
| 21535 |
createdAt: kit.created_at ? new Date(kit.created_at) : null, |
| 21536 |
updatedAt: kit.updated_at ? new Date(kit.updated_at) : null, |
| 21537 |
keywords: kit.keywords, |
| 21538 |
taxonomies: kit.taxonomies, |
| 21539 |
documents: kit.documents ? kit.documents.map(function(document) { |
| 21540 |
return Document.createFromResponse(document); |
| 21541 |
}) : [], |
| 21542 |
status: kit.status || "active" |
| 21543 |
}); |
| 21544 |
} |
| 21545 |
}]); |
| 21546 |
}(BaseModel); |
| 21547 |
})); |
| 21548 |
|
| 21549 |
//#endregion |
| 21550 |
//#region app/modules/kit-library/assets/js/utils.js |
| 21551 |
/** |
| 21552 |
* A util function to transform data throw transform functions |
| 21553 |
* |
| 21554 |
* @param {Array<Function>} functions |
| 21555 |
* @return {function(*=, ...[*]): *} function |
| 21556 |
*/ |
| 21557 |
function pipe() { |
| 21558 |
for (var _len = arguments.length, functions = new Array(_len), _key = 0; _key < _len; _key++) functions[_key] = arguments[_key]; |
| 21559 |
return function(value) { |
| 21560 |
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) args[_key2 - 1] = arguments[_key2]; |
| 21561 |
return functions.reduce(function(currentValue, currentFunction) { |
| 21562 |
return currentFunction.apply(void 0, [currentValue].concat(args)); |
| 21563 |
}, value); |
| 21564 |
}; |
| 21565 |
} |
| 21566 |
/** |
| 21567 |
* Check if cloud kits are deactivated based on storage quota |
| 21568 |
* |
| 21569 |
* @param {Object} quotaData - The quota data from the API |
| 21570 |
* @return {boolean} True if deactivated, false otherwise |
| 21571 |
*/ |
| 21572 |
function isCloudKitsDeactivated(quotaData) { |
| 21573 |
if (!(quotaData !== null && quotaData !== void 0 && quotaData.storage)) return false; |
| 21574 |
var _quotaData$storage = quotaData.storage; |
| 21575 |
var _quotaData$storage$cu = _quotaData$storage.currentUsage; |
| 21576 |
var currentUsage = _quotaData$storage$cu === void 0 ? 0 : _quotaData$storage$cu; |
| 21577 |
var _quotaData$storage$su = _quotaData$storage.subscriptionId; |
| 21578 |
return currentUsage > 0 && "" === (_quotaData$storage$su === void 0 ? "" : _quotaData$storage$su); |
| 21579 |
} |
| 21580 |
var init_utils$1 = __esmMin((() => {})); |
| 21581 |
|
| 21582 |
//#endregion |
| 21583 |
//#region app/modules/kit-library/assets/js/hooks/use-kits.js |
| 21584 |
function ownKeys$8(e, r) { |
| 21585 |
var t = Object.keys(e); |
| 21586 |
if (Object.getOwnPropertySymbols) { |
| 21587 |
var o = Object.getOwnPropertySymbols(e); |
| 21588 |
r && (o = o.filter(function(r) { |
| 21589 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 21590 |
})), t.push.apply(t, o); |
| 21591 |
} |
| 21592 |
return t; |
| 21593 |
} |
| 21594 |
function _objectSpread$7(e) { |
| 21595 |
for (var r = 1; r < arguments.length; r++) { |
| 21596 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 21597 |
r % 2 ? ownKeys$8(Object(t), !0).forEach(function(r) { |
| 21598 |
_defineProperty$1(e, r, t[r]); |
| 21599 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function(r) { |
| 21600 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 21601 |
}); |
| 21602 |
} |
| 21603 |
return e; |
| 21604 |
} |
| 21605 |
/** |
| 21606 |
* Fetch kits |
| 21607 |
* |
| 21608 |
* @param {boolean} force |
| 21609 |
* @return {*} kits |
| 21610 |
*/ |
| 21611 |
function fetchKits$1(force) { |
| 21612 |
return $e.data.get("kits/index", { force: force ? 1 : void 0 }, { refresh: true }).then(function(response) { |
| 21613 |
return response.data; |
| 21614 |
}).then(function(_ref2) { |
| 21615 |
return _ref2.data.map(function(item) { |
| 21616 |
return Kit.createFromResponse(item); |
| 21617 |
}); |
| 21618 |
}); |
| 21619 |
} |
| 21620 |
/** |
| 21621 |
* Main function. |
| 21622 |
* |
| 21623 |
* @param {*} initialQueryParams |
| 21624 |
* @return {Object} query |
| 21625 |
*/ |
| 21626 |
function useKits() { |
| 21627 |
var initialQueryParams = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; |
| 21628 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 21629 |
var force = _useState2[0]; |
| 21630 |
var setForce = _useState2[1]; |
| 21631 |
var _useState4 = _slicedToArray((0, react.useState)(function() { |
| 21632 |
return _objectSpread$7(_objectSpread$7({ ready: false }, defaultQueryParams$1), initialQueryParams); |
| 21633 |
}), 2); |
| 21634 |
var queryParams = _useState4[0]; |
| 21635 |
var setQueryParams = _useState4[1]; |
| 21636 |
var forceRefetch = (0, react.useCallback)(function() { |
| 21637 |
return setForce(true); |
| 21638 |
}, [setForce]); |
| 21639 |
var clearQueryParams = (0, react.useCallback)(function() { |
| 21640 |
return setQueryParams(_objectSpread$7(_objectSpread$7({ ready: true }, defaultQueryParams$1), initialQueryParams)); |
| 21641 |
}, [setQueryParams]); |
| 21642 |
var query = useQuery([KEY$5], function() { |
| 21643 |
return fetchKits$1(force); |
| 21644 |
}); |
| 21645 |
var data = (0, react.useMemo)(function() { |
| 21646 |
return !query.data ? [] : pipe.apply(void 0, _toConsumableArray(Object.values(kitsPipeFunctions$1)))(_toConsumableArray(query.data), queryParams); |
| 21647 |
}, [query.data, queryParams]); |
| 21648 |
var selectedTaxonomies = useSelectedTaxonomies(queryParams.taxonomies); |
| 21649 |
var isFilterActive = (0, react.useMemo)(function() { |
| 21650 |
return !!queryParams.search || !!selectedTaxonomies.length; |
| 21651 |
}, [queryParams]); |
| 21652 |
(0, react.useEffect)(function() { |
| 21653 |
if (!force) return; |
| 21654 |
query.refetch().then(function() { |
| 21655 |
return setForce(false); |
| 21656 |
}); |
| 21657 |
}, [force]); |
| 21658 |
return _objectSpread$7(_objectSpread$7({}, query), {}, { |
| 21659 |
data, |
| 21660 |
queryParams, |
| 21661 |
setQueryParams, |
| 21662 |
clearQueryParams, |
| 21663 |
forceRefetch, |
| 21664 |
isFilterActive |
| 21665 |
}); |
| 21666 |
} |
| 21667 |
var KEY$5, defaultQueryParams$1, kitsPipeFunctions$1; |
| 21668 |
var init_use_kits = __esmMin((() => { |
| 21669 |
init_slicedToArray(); |
| 21670 |
init_toConsumableArray(); |
| 21671 |
init_defineProperty$1(); |
| 21672 |
init_kit(); |
| 21673 |
init_use_selected_taxonomies(); |
| 21674 |
init_taxonomy(); |
| 21675 |
init_taxonomy_transformer(); |
| 21676 |
init_es(); |
| 21677 |
init_utils$1(); |
| 21678 |
__name(ownKeys$8, "ownKeys"); |
| 21679 |
__name(_objectSpread$7, "_objectSpread"); |
| 21680 |
KEY$5 = "kits"; |
| 21681 |
defaultQueryParams$1 = { |
| 21682 |
favorite: false, |
| 21683 |
search: "", |
| 21684 |
taxonomies: TaxonomyTypes.reduce(function(current, _ref) { |
| 21685 |
var key = _ref.key; |
| 21686 |
return _objectSpread$7(_objectSpread$7({}, current), {}, _defineProperty$1({}, key, [])); |
| 21687 |
}, {}), |
| 21688 |
order: { |
| 21689 |
direction: "asc", |
| 21690 |
by: "featuredIndex" |
| 21691 |
}, |
| 21692 |
referrer: null |
| 21693 |
}; |
| 21694 |
kitsPipeFunctions$1 = { |
| 21695 |
/** |
| 21696 |
* Filter by favorite |
| 21697 |
* |
| 21698 |
* @param {Array<*>} data |
| 21699 |
* @param {*} queryParams |
| 21700 |
* @return {Array} filtered data |
| 21701 |
*/ |
| 21702 |
favoriteFilter: function favoriteFilter(data, queryParams) { |
| 21703 |
if (!queryParams.favorite) return data; |
| 21704 |
return data.filter(function(item) { |
| 21705 |
return item.isFavorite; |
| 21706 |
}); |
| 21707 |
}, |
| 21708 |
/** |
| 21709 |
* Filter by search term. |
| 21710 |
* |
| 21711 |
* @param {Array<*>} data |
| 21712 |
* @param {*} queryParams |
| 21713 |
* @return {Array} filtered data |
| 21714 |
*/ |
| 21715 |
searchFilter: function searchFilter(data, queryParams) { |
| 21716 |
if (!queryParams.search) return data; |
| 21717 |
return data.filter(function(item) { |
| 21718 |
var keywords = [].concat(_toConsumableArray(item.keywords), _toConsumableArray(item.taxonomies), [item.title]); |
| 21719 |
var searchTerm = queryParams.search.toLowerCase(); |
| 21720 |
return keywords.some(function(keyword) { |
| 21721 |
return keyword.toLowerCase().includes(searchTerm); |
| 21722 |
}); |
| 21723 |
}); |
| 21724 |
}, |
| 21725 |
/** |
| 21726 |
* Filter by taxonomies. |
| 21727 |
* In each taxonomy type it use the OR operator and between types it uses the AND operator. |
| 21728 |
* |
| 21729 |
* @param {Array<*>} data |
| 21730 |
* @param {*} queryParams |
| 21731 |
* @return {Array} filtered data |
| 21732 |
*/ |
| 21733 |
taxonomiesFilter: function taxonomiesFilter(data, queryParams) { |
| 21734 |
var taxonomyTypes = Object.keys(queryParams.taxonomies).filter(function(taxonomyType) { |
| 21735 |
return queryParams.taxonomies[taxonomyType].length; |
| 21736 |
}); |
| 21737 |
return !taxonomyTypes.length ? data : data.filter(function(kit) { |
| 21738 |
return taxonomyTypes.some(function(taxonomyType) { |
| 21739 |
return isKitInTaxonomy(kit, taxonomyType, queryParams.taxonomies[taxonomyType]); |
| 21740 |
}); |
| 21741 |
}); |
| 21742 |
}, |
| 21743 |
/** |
| 21744 |
* Sort all the data by the "order" query param |
| 21745 |
* |
| 21746 |
* @param {Array<*>} data |
| 21747 |
* @param {*} queryParams |
| 21748 |
* @return {Array} sorted data |
| 21749 |
*/ |
| 21750 |
sort: function sort(data, queryParams) { |
| 21751 |
var order = queryParams.order; |
| 21752 |
return data.sort(function(item1, item2) { |
| 21753 |
if ("asc" === order.direction) return item1[order.by] - item2[order.by]; |
| 21754 |
return item2[order.by] - item1[order.by]; |
| 21755 |
}); |
| 21756 |
} |
| 21757 |
}; |
| 21758 |
__name(fetchKits$1, "fetchKits"); |
| 21759 |
})); |
| 21760 |
|
| 21761 |
//#endregion |
| 21762 |
//#region app/modules/kit-library/assets/js/hooks/use-kit.js |
| 21763 |
function useKit(id) { |
| 21764 |
var placeholderDataCallback = usePlaceholderDataCallback(id); |
| 21765 |
return useQuery(["kit", id], fetchKitItem, { placeholderData: placeholderDataCallback }); |
| 21766 |
} |
| 21767 |
/** |
| 21768 |
* Return placeholder function for kit query. |
| 21769 |
* |
| 21770 |
* @param {*} id |
| 21771 |
* @return {function(): (undefined|*)} placeholder |
| 21772 |
*/ |
| 21773 |
function usePlaceholderDataCallback(id) { |
| 21774 |
var queryClient = useQueryClient(); |
| 21775 |
return (0, react.useCallback)(function() { |
| 21776 |
var _queryClient$getQuery; |
| 21777 |
var placeholder = (_queryClient$getQuery = queryClient.getQueryData("kits")) === null || _queryClient$getQuery === void 0 ? void 0 : _queryClient$getQuery.find(function(kit) { |
| 21778 |
return kit.id === id; |
| 21779 |
}); |
| 21780 |
if (!placeholder) return; |
| 21781 |
return placeholder; |
| 21782 |
}, [queryClient, id]); |
| 21783 |
} |
| 21784 |
/** |
| 21785 |
* Fetch kit |
| 21786 |
* |
| 21787 |
* @param {Object} root0 |
| 21788 |
* @param {Object} root0.queryKey |
| 21789 |
* @param {*} root0.queryKey.0 |
| 21790 |
* @param {string} root0.queryKey.1 |
| 21791 |
* @return {Promise<Kit>} kit |
| 21792 |
*/ |
| 21793 |
function fetchKitItem(_ref) { |
| 21794 |
var _ref$queryKey = _slicedToArray(_ref.queryKey, 2); |
| 21795 |
_ref$queryKey[0]; |
| 21796 |
var id = _ref$queryKey[1]; |
| 21797 |
return $e.data.get("kits/index", { id }, { refresh: true }).then(function(response) { |
| 21798 |
return response.data; |
| 21799 |
}).then(function(_ref2) { |
| 21800 |
var data = _ref2.data; |
| 21801 |
return Kit.createFromResponse(data); |
| 21802 |
}); |
| 21803 |
} |
| 21804 |
var KEY$4; |
| 21805 |
var init_use_kit = __esmMin((() => { |
| 21806 |
init_slicedToArray(); |
| 21807 |
init_kit(); |
| 21808 |
init_use_kits(); |
| 21809 |
init_es(); |
| 21810 |
KEY$4 = "kit"; |
| 21811 |
})); |
| 21812 |
|
| 21813 |
//#endregion |
| 21814 |
//#region app/modules/kit-library/assets/js/hooks/use-kit-favorites-mutations.js |
| 21815 |
function useKitFavoritesMutations() { |
| 21816 |
var queryClient = useQueryClient(); |
| 21817 |
var onSuccess = (0, react.useCallback)(function(_ref) { |
| 21818 |
var data = _ref.data; |
| 21819 |
var id = data.data.id; |
| 21820 |
var isFavorite = data.data.is_favorite; |
| 21821 |
if (queryClient.getQueryData(["kits"])) queryClient.setQueryData([KEY$5], function(kits) { |
| 21822 |
if (!kits) return kits; |
| 21823 |
return kits.map(function(item) { |
| 21824 |
if (item.id === id) { |
| 21825 |
item.isFavorite = isFavorite; |
| 21826 |
return item.clone(); |
| 21827 |
} |
| 21828 |
return item; |
| 21829 |
}); |
| 21830 |
}); |
| 21831 |
if (queryClient.getQueryData(["kit", id])) queryClient.setQueryData(["kit", id], function(currentKit) { |
| 21832 |
currentKit.isFavorite = isFavorite; |
| 21833 |
return currentKit.clone(); |
| 21834 |
}); |
| 21835 |
}, [queryClient]); |
| 21836 |
var addToFavorites = useMutation(function(id) { |
| 21837 |
return $e.data.create("kits/favorites", {}, { id }); |
| 21838 |
}, { onSuccess }); |
| 21839 |
var removeFromFavorites = useMutation(function(id) { |
| 21840 |
return $e.data.delete("kits/favorites", { id }); |
| 21841 |
}, { onSuccess }); |
| 21842 |
return { |
| 21843 |
addToFavorites, |
| 21844 |
removeFromFavorites, |
| 21845 |
isLoading: addToFavorites.isLoading || removeFromFavorites.isLoading |
| 21846 |
}; |
| 21847 |
} |
| 21848 |
var init_use_kit_favorites_mutations = __esmMin((() => { |
| 21849 |
init_use_kits(); |
| 21850 |
init_use_kit(); |
| 21851 |
init_es(); |
| 21852 |
})); |
| 21853 |
|
| 21854 |
//#endregion |
| 21855 |
//#region app/modules/kit-library/assets/js/hooks/use-kit-library-tracking.js |
| 21856 |
function ownKeys$7(e, r) { |
| 21857 |
var t = Object.keys(e); |
| 21858 |
if (Object.getOwnPropertySymbols) { |
| 21859 |
var o = Object.getOwnPropertySymbols(e); |
| 21860 |
r && (o = o.filter(function(r) { |
| 21861 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 21862 |
})), t.push.apply(t, o); |
| 21863 |
} |
| 21864 |
return t; |
| 21865 |
} |
| 21866 |
function _objectSpread$6(e) { |
| 21867 |
for (var r = 1; r < arguments.length; r++) { |
| 21868 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 21869 |
r % 2 ? ownKeys$7(Object(t), !0).forEach(function(r) { |
| 21870 |
_defineProperty$1(e, r, t[r]); |
| 21871 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function(r) { |
| 21872 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 21873 |
}); |
| 21874 |
} |
| 21875 |
return e; |
| 21876 |
} |
| 21877 |
var SESSION_TIMEOUT, useKitLibraryTracking; |
| 21878 |
var init_use_kit_library_tracking = __esmMin((() => { |
| 21879 |
init_defineProperty$1(); |
| 21880 |
init_events_config(); |
| 21881 |
__name(ownKeys$7, "ownKeys"); |
| 21882 |
__name(_objectSpread$6, "_objectSpread"); |
| 21883 |
SESSION_TIMEOUT = 1800 * 1e3; |
| 21884 |
useKitLibraryTracking = function useKitLibraryTracking() { |
| 21885 |
var sessionStartTime = (0, react.useRef)(Date.now()); |
| 21886 |
var lastActivityTime = (0, react.useRef)(Date.now()); |
| 21887 |
var sessionEndedRef = (0, react.useRef)(false); |
| 21888 |
var actionsCount = (0, react.useRef)(0); |
| 21889 |
var filtersCount = (0, react.useRef)(0); |
| 21890 |
var demoViews = (0, react.useRef)(0); |
| 21891 |
var kitApplied = (0, react.useRef)(false); |
| 21892 |
var _ref$config = (elementorCommon || {}).config; |
| 21893 |
var _config$editor_events = (_ref$config === void 0 ? {} : _ref$config).editor_events; |
| 21894 |
var _editorEvents$can_sen = (_config$editor_events === void 0 ? {} : _config$editor_events).can_send_events; |
| 21895 |
var canSendEvents = _editorEvents$can_sen === void 0 ? false : _editorEvents$can_sen; |
| 21896 |
var isEventsManagerAvailable = (0, react.useCallback)(function() { |
| 21897 |
var _elementorCommon; |
| 21898 |
return ((_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager) && "function" === typeof elementorCommon.eventsManager.dispatchEvent; |
| 21899 |
}, []); |
| 21900 |
var trackMixpanelEvent = (0, react.useCallback)(function(eventName) { |
| 21901 |
var properties = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; |
| 21902 |
var callback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 21903 |
try { |
| 21904 |
if (canSendEvents && isEventsManagerAvailable()) elementorCommon.eventsManager.dispatchEvent(eventName, properties); |
| 21905 |
} finally { |
| 21906 |
if (callback) callback(); |
| 21907 |
} |
| 21908 |
}, [canSendEvents, isEventsManagerAvailable]); |
| 21909 |
var updateActivity = (0, react.useCallback)(function() { |
| 21910 |
lastActivityTime.current = Date.now(); |
| 21911 |
sessionEndedRef.current = false; |
| 21912 |
}, []); |
| 21913 |
var addTriggerToProperties = (0, react.useCallback)(function(properties, trigger) { |
| 21914 |
if (!trigger) return properties; |
| 21915 |
return _objectSpread$6(_objectSpread$6({}, properties), {}, { trigger: eventsConfig.triggers[trigger] || trigger }); |
| 21916 |
}, []); |
| 21917 |
var trackWithActivity = (0, react.useCallback)(function(eventName, properties) { |
| 21918 |
var callback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 21919 |
updateActivity(); |
| 21920 |
actionsCount.current += 1; |
| 21921 |
trackMixpanelEvent(eventName, properties, callback); |
| 21922 |
}, [updateActivity, trackMixpanelEvent]); |
| 21923 |
var trackKitlibOpened = (0, react.useCallback)(function(source) { |
| 21924 |
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 21925 |
var trigger = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 21926 |
trackWithActivity("kitlib_opened", addTriggerToProperties({ referrer_area: source }, trigger), callback); |
| 21927 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21928 |
var trackKitlibCategorySelected = (0, react.useCallback)(function(kitCategory) { |
| 21929 |
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 21930 |
var trigger = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click"; |
| 21931 |
filtersCount.current += 1; |
| 21932 |
trackWithActivity("kitlib_category_selected", addTriggerToProperties({ kit_category: kitCategory }, trigger), callback); |
| 21933 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21934 |
var trackKitlibTagSelected = (0, react.useCallback)(function(kitTag) { |
| 21935 |
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 21936 |
var trigger = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click"; |
| 21937 |
filtersCount.current += 1; |
| 21938 |
trackWithActivity("kitlib_tag_selected", addTriggerToProperties({ kit_tag: kitTag }, trigger), callback); |
| 21939 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21940 |
var trackKitlibPlanFilterSelected = (0, react.useCallback)(function(planType) { |
| 21941 |
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 21942 |
var trigger = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click"; |
| 21943 |
filtersCount.current += 1; |
| 21944 |
trackWithActivity("kitlib_plan_filter_selected", addTriggerToProperties({ kit_plan_filter: planType }, trigger), callback); |
| 21945 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21946 |
var trackKitlibSorterSelected = (0, react.useCallback)(function(sortType) { |
| 21947 |
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 21948 |
var trigger = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "dropdownClick"; |
| 21949 |
trackWithActivity("kitlib_sorter_selected", addTriggerToProperties({ kit_sorter: sortType }, trigger), callback); |
| 21950 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21951 |
var trackKitlibSearchSubmitted = (0, react.useCallback)(function(searchTerm) { |
| 21952 |
var resultsCount = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 21953 |
var callback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 21954 |
var trigger = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 21955 |
trackWithActivity("kitlib_search_submitted", addTriggerToProperties({ |
| 21956 |
kit_search_input: searchTerm, |
| 21957 |
kit_search_result_count: resultsCount |
| 21958 |
}, trigger), callback); |
| 21959 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21960 |
var trackKitlibFavoriteClicked = (0, react.useCallback)(function(kitId, title, favorited) { |
| 21961 |
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 21962 |
var trigger = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "click"; |
| 21963 |
trackWithActivity("kitlib_favorite_clicked", addTriggerToProperties({ |
| 21964 |
kit_id: kitId, |
| 21965 |
kit_title: title, |
| 21966 |
kit_fav_status: favorited |
| 21967 |
}, trigger), callback); |
| 21968 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21969 |
var trackKitlibFavoriteTab = (0, react.useCallback)(function() { |
| 21970 |
var callback = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; |
| 21971 |
var trigger = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "click"; |
| 21972 |
trackWithActivity("kitlib_favorite_tab", addTriggerToProperties({ page_url: window.location.href }, trigger), callback); |
| 21973 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21974 |
var trackKitdemoClicked = (0, react.useCallback)(function(kitId, title) { |
| 21975 |
var position = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 21976 |
var plan = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ""; |
| 21977 |
var callback = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null; |
| 21978 |
var trigger = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "click"; |
| 21979 |
trackWithActivity("kitdemo_clicked", addTriggerToProperties({ |
| 21980 |
kit_id: kitId, |
| 21981 |
kit_title: title, |
| 21982 |
kit_position: position, |
| 21983 |
requires_pro: plan |
| 21984 |
}, trigger), callback); |
| 21985 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21986 |
var trackKitdemoOpened = (0, react.useCallback)(function(kitId, title) { |
| 21987 |
var loadTime = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 21988 |
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 21989 |
var trigger = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "pageLoaded"; |
| 21990 |
demoViews.current += 1; |
| 21991 |
trackWithActivity("kitdemo_opened", addTriggerToProperties({ |
| 21992 |
kit_id: kitId, |
| 21993 |
kit_title: title, |
| 21994 |
kit_load_time: loadTime |
| 21995 |
}, trigger), callback); |
| 21996 |
}, [addTriggerToProperties, trackWithActivity]); |
| 21997 |
var trackKitdemoApplyClicked = (0, react.useCallback)(function(kitId, title) { |
| 21998 |
var plan = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ""; |
| 21999 |
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 22000 |
var trigger = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "click"; |
| 22001 |
kitApplied.current = true; |
| 22002 |
trackWithActivity("kitdemo_apply_clicked", addTriggerToProperties({ |
| 22003 |
kit_id: kitId, |
| 22004 |
kit_title: title, |
| 22005 |
requires_pro: plan |
| 22006 |
}, trigger), callback); |
| 22007 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22008 |
var trackKitdemoApplyRemoveExisting = (0, react.useCallback)(function(userChoice) { |
| 22009 |
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 22010 |
var trigger = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 22011 |
trackWithActivity("kitdemo_apply_remove_existing", addTriggerToProperties({ remove_existing_kit: userChoice }, trigger), callback); |
| 22012 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22013 |
var trackKitdemoApplyAllOrCustomize = (0, react.useCallback)(function(userChoice) { |
| 22014 |
var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 22015 |
var trigger = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "click"; |
| 22016 |
trackWithActivity("kitdemo_apply_all_or_customize", addTriggerToProperties({ apply_all: userChoice }, trigger), callback); |
| 22017 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22018 |
var trackKitdemoApplyCompleted = (0, react.useCallback)(function(kitId) { |
| 22019 |
var importTime = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 22020 |
var itemsImported = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 22021 |
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 22022 |
var trigger = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null; |
| 22023 |
trackWithActivity("kitdemo_apply_completed", addTriggerToProperties({ |
| 22024 |
kit_id: kitId, |
| 22025 |
import_time: importTime, |
| 22026 |
items_imported: itemsImported |
| 22027 |
}, trigger), callback); |
| 22028 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22029 |
var trackKitdemoApplyFailed = (0, react.useCallback)(function(kitId) { |
| 22030 |
var errorMessage = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 22031 |
var errorCode = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 22032 |
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 22033 |
var trigger = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : null; |
| 22034 |
trackWithActivity("kitdemo_apply_failed", addTriggerToProperties({ |
| 22035 |
kit_id: kitId, |
| 22036 |
error_message: errorMessage, |
| 22037 |
error_code: errorCode |
| 22038 |
}, trigger), callback); |
| 22039 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22040 |
var trackKitdemoDownloadClicked = (0, react.useCallback)(function(kitId, title) { |
| 22041 |
var callback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 22042 |
var trigger = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "click"; |
| 22043 |
trackWithActivity("kitdemo_download_clicked", addTriggerToProperties({ |
| 22044 |
kit_id: kitId, |
| 22045 |
kit_title: title |
| 22046 |
}, trigger), callback); |
| 22047 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22048 |
var trackKitdemoUpgradeClicked = (0, react.useCallback)(function(kitId, title) { |
| 22049 |
var plan = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ""; |
| 22050 |
var callback = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 22051 |
var trigger = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : "click"; |
| 22052 |
trackWithActivity("kitdemo_upgrade_clicked", addTriggerToProperties({ |
| 22053 |
kit_id: kitId, |
| 22054 |
kit_title: title, |
| 22055 |
kit_demo_upgrade_plan: plan |
| 22056 |
}, trigger), callback); |
| 22057 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22058 |
var trackKitdemoOverviewClicked = (0, react.useCallback)(function(kitId, title) { |
| 22059 |
var callback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 22060 |
var trigger = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "click"; |
| 22061 |
trackWithActivity("kitdemo_overview_clicked", addTriggerToProperties({ |
| 22062 |
kit_id: kitId, |
| 22063 |
kit_title: title |
| 22064 |
}, trigger), callback); |
| 22065 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22066 |
var trackKitdemoOverviewBack = (0, react.useCallback)(function(kitId, title) { |
| 22067 |
var callback = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 22068 |
var trigger = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "click"; |
| 22069 |
trackWithActivity("kitdemo_overview_back", addTriggerToProperties({ |
| 22070 |
kit_id: kitId, |
| 22071 |
kit_title: title |
| 22072 |
}, trigger), callback); |
| 22073 |
}, [addTriggerToProperties, trackWithActivity]); |
| 22074 |
var trackKitlibSessionEnded = (0, react.useCallback)(function() { |
| 22075 |
var reason = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "timeout"; |
| 22076 |
if (sessionEndedRef.current) return; |
| 22077 |
sessionEndedRef.current = true; |
| 22078 |
var durationMs = Date.now() - sessionStartTime.current; |
| 22079 |
trackMixpanelEvent("kitlib_session_ended", { |
| 22080 |
duration_s: Number((durationMs / 1e3).toFixed(2)), |
| 22081 |
actions_count: actionsCount.current, |
| 22082 |
filters_count: filtersCount.current, |
| 22083 |
demo_views: demoViews.current, |
| 22084 |
kit_applied: kitApplied.current, |
| 22085 |
reason |
| 22086 |
}); |
| 22087 |
}, [trackMixpanelEvent]); |
| 22088 |
(0, react.useEffect)(function() { |
| 22089 |
var interval = setInterval(function checkSessionTimeout() { |
| 22090 |
if (Date.now() - lastActivityTime.current > SESSION_TIMEOUT && !sessionEndedRef.current) trackKitlibSessionEnded("timeout"); |
| 22091 |
}, 6e4); |
| 22092 |
var handleBeforeUnload = function handleBeforeUnload() { |
| 22093 |
trackKitlibSessionEnded("page_unload"); |
| 22094 |
}; |
| 22095 |
window.addEventListener("beforeunload", handleBeforeUnload); |
| 22096 |
return function() { |
| 22097 |
clearInterval(interval); |
| 22098 |
window.removeEventListener("beforeunload", handleBeforeUnload); |
| 22099 |
}; |
| 22100 |
}, [trackKitlibSessionEnded]); |
| 22101 |
(0, react.useEffect)(function() { |
| 22102 |
var handleUserActivity = function handleUserActivity() { |
| 22103 |
updateActivity(); |
| 22104 |
}; |
| 22105 |
var events = [ |
| 22106 |
"mousedown", |
| 22107 |
"mousemove", |
| 22108 |
"keypress", |
| 22109 |
"scroll", |
| 22110 |
"touchstart", |
| 22111 |
"click" |
| 22112 |
]; |
| 22113 |
events.forEach(function(event) { |
| 22114 |
document.addEventListener(event, handleUserActivity, true); |
| 22115 |
}); |
| 22116 |
return function() { |
| 22117 |
events.forEach(function(event) { |
| 22118 |
document.removeEventListener(event, handleUserActivity, true); |
| 22119 |
}); |
| 22120 |
}; |
| 22121 |
}, [updateActivity]); |
| 22122 |
return { |
| 22123 |
trackKitlibOpened, |
| 22124 |
trackKitlibCategorySelected, |
| 22125 |
trackKitlibTagSelected, |
| 22126 |
trackKitlibPlanFilterSelected, |
| 22127 |
trackKitlibSorterSelected, |
| 22128 |
trackKitlibSearchSubmitted, |
| 22129 |
trackKitlibFavoriteClicked, |
| 22130 |
trackKitlibFavoriteTab, |
| 22131 |
trackKitdemoClicked, |
| 22132 |
trackKitdemoOpened, |
| 22133 |
trackKitdemoApplyClicked, |
| 22134 |
trackKitdemoApplyRemoveExisting, |
| 22135 |
trackKitdemoApplyAllOrCustomize, |
| 22136 |
trackKitdemoApplyCompleted, |
| 22137 |
trackKitdemoApplyFailed, |
| 22138 |
trackKitdemoDownloadClicked, |
| 22139 |
trackKitdemoUpgradeClicked, |
| 22140 |
trackKitdemoOverviewClicked, |
| 22141 |
trackKitdemoOverviewBack, |
| 22142 |
trackKitlibSessionEnded, |
| 22143 |
updateActivity |
| 22144 |
}; |
| 22145 |
}; |
| 22146 |
})); |
| 22147 |
|
| 22148 |
//#endregion |
| 22149 |
//#region app/modules/kit-library/assets/js/context/tracking-context.js |
| 22150 |
var import_prop_types$39, TrackingContext, TrackingProvider, useTracking; |
| 22151 |
var init_tracking_context = __esmMin((() => { |
| 22152 |
init_use_kit_library_tracking(); |
| 22153 |
import_prop_types$39 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22154 |
TrackingContext = (0, react.createContext)(); |
| 22155 |
TrackingProvider = function TrackingProvider(_ref) { |
| 22156 |
var children = _ref.children; |
| 22157 |
var tracking = useKitLibraryTracking(); |
| 22158 |
(0, react.useEffect)(function() { |
| 22159 |
var source = new URLSearchParams(window.location.search).get("source") || "direct"; |
| 22160 |
tracking.trackKitlibOpened(source); |
| 22161 |
}, []); |
| 22162 |
return /*#__PURE__*/ react.default.createElement(TrackingContext.Provider, { value: tracking }, children); |
| 22163 |
}; |
| 22164 |
useTracking = function useTracking() { |
| 22165 |
var context = (0, react.useContext)(TrackingContext); |
| 22166 |
if (!context) throw new Error("useTracking must be used within a TrackingProvider"); |
| 22167 |
return context; |
| 22168 |
}; |
| 22169 |
TrackingProvider.propTypes = { children: import_prop_types$39.default.node }; |
| 22170 |
})); |
| 22171 |
|
| 22172 |
//#endregion |
| 22173 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/favorites-actions.scss |
| 22174 |
var init_favorites_actions$1 = __esmMin((() => {})); |
| 22175 |
|
| 22176 |
//#endregion |
| 22177 |
//#region app/modules/kit-library/assets/js/components/favorites-actions.js |
| 22178 |
function FavoritesActions(props) { |
| 22179 |
var _useKitFavoritesMutat = useKitFavoritesMutations(); |
| 22180 |
var addToFavorites = _useKitFavoritesMutat.addToFavorites; |
| 22181 |
var removeFromFavorites = _useKitFavoritesMutat.removeFromFavorites; |
| 22182 |
var isLoading = _useKitFavoritesMutat.isLoading; |
| 22183 |
var tracking = useTracking(); |
| 22184 |
var loadingClasses = isLoading ? "e-kit-library__kit-favorite-actions--loading" : ""; |
| 22185 |
return props.isFavorite ? /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 22186 |
text: (0, _wordpress_i18n.__)("Remove from Favorites", "elementor"), |
| 22187 |
hideText: true, |
| 22188 |
icon: "eicon-heart", |
| 22189 |
className: "e-kit-library__kit-favorite-actions e-kit-library__kit-favorite-actions--active ".concat(loadingClasses), |
| 22190 |
onClick: function handleRemoveFromFavorites() { |
| 22191 |
if (isLoading) return; |
| 22192 |
tracking.trackKitlibFavoriteClicked(props.id, props === null || props === void 0 ? void 0 : props.name, false, function() { |
| 22193 |
return removeFromFavorites.mutate(props.id); |
| 22194 |
}); |
| 22195 |
} |
| 22196 |
}) : /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 22197 |
text: (0, _wordpress_i18n.__)("Add to Favorites", "elementor"), |
| 22198 |
hideText: true, |
| 22199 |
icon: "eicon-heart-o", |
| 22200 |
className: "e-kit-library__kit-favorite-actions ".concat(loadingClasses), |
| 22201 |
onClick: function handleAddToFavorites() { |
| 22202 |
if (isLoading) return; |
| 22203 |
tracking.trackKitlibFavoriteClicked(props.id, props === null || props === void 0 ? void 0 : props.name, true, function() { |
| 22204 |
return addToFavorites.mutate(props.id); |
| 22205 |
}); |
| 22206 |
} |
| 22207 |
}); |
| 22208 |
} |
| 22209 |
var import_prop_types$38; |
| 22210 |
var init_favorites_actions = __esmMin((() => { |
| 22211 |
import_prop_types$38 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22212 |
init_use_kit_favorites_mutations(); |
| 22213 |
init_tracking_context(); |
| 22214 |
init_favorites_actions$1(); |
| 22215 |
FavoritesActions.propTypes = { |
| 22216 |
isFavorite: import_prop_types$38.default.bool, |
| 22217 |
id: import_prop_types$38.default.string, |
| 22218 |
name: import_prop_types$38.default.string, |
| 22219 |
source: import_prop_types$38.default.string, |
| 22220 |
index: import_prop_types$38.default.number, |
| 22221 |
queryParams: import_prop_types$38.default.string |
| 22222 |
}; |
| 22223 |
})); |
| 22224 |
|
| 22225 |
//#endregion |
| 22226 |
//#region app/modules/kit-library/assets/js/context/settings-context.js |
| 22227 |
function ownKeys$6(e, r) { |
| 22228 |
var t = Object.keys(e); |
| 22229 |
if (Object.getOwnPropertySymbols) { |
| 22230 |
var o = Object.getOwnPropertySymbols(e); |
| 22231 |
r && (o = o.filter(function(r) { |
| 22232 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 22233 |
})), t.push.apply(t, o); |
| 22234 |
} |
| 22235 |
return t; |
| 22236 |
} |
| 22237 |
function _objectSpread$5(e) { |
| 22238 |
for (var r = 1; r < arguments.length; r++) { |
| 22239 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 22240 |
r % 2 ? ownKeys$6(Object(t), !0).forEach(function(r) { |
| 22241 |
_defineProperty$1(e, r, t[r]); |
| 22242 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function(r) { |
| 22243 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 22244 |
}); |
| 22245 |
} |
| 22246 |
return e; |
| 22247 |
} |
| 22248 |
/** |
| 22249 |
* Consume the context |
| 22250 |
* |
| 22251 |
* @return {{emptyTrashDays: number}} context value |
| 22252 |
*/ |
| 22253 |
function useSettingsContext() { |
| 22254 |
return (0, react.useContext)(SettingsContext); |
| 22255 |
} |
| 22256 |
/** |
| 22257 |
* Settings Provider |
| 22258 |
* |
| 22259 |
* @param {*} props |
| 22260 |
* @return {JSX.Element} element |
| 22261 |
* @function Object() { [native code] } |
| 22262 |
*/ |
| 22263 |
function SettingsProvider(props) { |
| 22264 |
var _useState2 = _slicedToArray((0, react.useState)({}), 2); |
| 22265 |
var settings = _useState2[0]; |
| 22266 |
var setSettings = _useState2[1]; |
| 22267 |
var updateSettings = (0, react.useCallback)(function(newSettings) { |
| 22268 |
setSettings(function(prev) { |
| 22269 |
return _objectSpread$5(_objectSpread$5({}, prev), newSettings); |
| 22270 |
}); |
| 22271 |
}, [setSettings]); |
| 22272 |
(0, react.useEffect)(function() { |
| 22273 |
setSettings(props.value); |
| 22274 |
}, [setSettings]); |
| 22275 |
return /*#__PURE__*/ react.default.createElement(SettingsContext.Provider, { value: { |
| 22276 |
settings, |
| 22277 |
setSettings, |
| 22278 |
updateSettings |
| 22279 |
} }, props.children); |
| 22280 |
} |
| 22281 |
var import_prop_types$37, SettingsContext; |
| 22282 |
var init_settings_context = __esmMin((() => { |
| 22283 |
import_prop_types$37 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22284 |
init_defineProperty$1(); |
| 22285 |
init_slicedToArray(); |
| 22286 |
__name(ownKeys$6, "ownKeys"); |
| 22287 |
__name(_objectSpread$5, "_objectSpread"); |
| 22288 |
SettingsContext = (0, react.createContext)({}); |
| 22289 |
SettingsProvider.propTypes = { |
| 22290 |
children: import_prop_types$37.default.any, |
| 22291 |
value: import_prop_types$37.default.object.isRequired |
| 22292 |
}; |
| 22293 |
})); |
| 22294 |
|
| 22295 |
//#endregion |
| 22296 |
//#region app/modules/kit-library/assets/js/hooks/use-kit-call-to-action.js |
| 22297 |
function useKitCallToAction(kitAccessTier) { |
| 22298 |
var settings = useSettingsContext().settings; |
| 22299 |
var userAccessTier = settings.access_tier; |
| 22300 |
var tierKey = TierToKeyMap[kitAccessTier]; |
| 22301 |
if (settings.is_pro && settings.is_library_connected && userAccessTier === TIERS.free) userAccessTier = TIERS["essential-oct2023"]; |
| 22302 |
var subscriptionPlan = (0, react.useMemo)(function() { |
| 22303 |
var _settings$subscriptio; |
| 22304 |
return (_settings$subscriptio = settings.subscription_plans) === null || _settings$subscriptio === void 0 ? void 0 : _settings$subscriptio[kitAccessTier]; |
| 22305 |
}, [settings, kitAccessTier]); |
| 22306 |
subscriptionPlan.label = PromotionChipText[tierKey]; |
| 22307 |
subscriptionPlan.isPromoted = TIERS.free !== kitAccessTier; |
| 22308 |
return { |
| 22309 |
type: (0, react.useMemo)(function() { |
| 22310 |
var isAuthorizeToApplyKit = isTierAtLeast(userAccessTier, kitAccessTier); |
| 22311 |
if (!settings.is_library_connected && (settings.is_pro || isAuthorizeToApplyKit)) return TYPE_CONNECT; |
| 22312 |
if (!isAuthorizeToApplyKit) return TYPE_PROMOTION; |
| 22313 |
return TYPE_APPLY; |
| 22314 |
}, [settings, kitAccessTier]), |
| 22315 |
subscriptionPlan |
| 22316 |
}; |
| 22317 |
} |
| 22318 |
var TYPE_CONNECT, TYPE_PROMOTION, TYPE_APPLY; |
| 22319 |
var init_use_kit_call_to_action = __esmMin((() => { |
| 22320 |
init_settings_context(); |
| 22321 |
init_tiers(); |
| 22322 |
init_taxonomy_transformer(); |
| 22323 |
TYPE_CONNECT = "connect"; |
| 22324 |
TYPE_PROMOTION = "promotion"; |
| 22325 |
TYPE_APPLY = "apply"; |
| 22326 |
})); |
| 22327 |
|
| 22328 |
//#endregion |
| 22329 |
//#region app/modules/kit-library/assets/js/hooks/use-add-kit-promotion-utm.js |
| 22330 |
function useAddKitPromotionUTM(promotionUrl, kitId, kitTitle) { |
| 22331 |
if (!promotionUrl) return ""; |
| 22332 |
var url; |
| 22333 |
try { |
| 22334 |
url = new URL(promotionUrl); |
| 22335 |
} catch (e) { |
| 22336 |
return ""; |
| 22337 |
} |
| 22338 |
if (kitTitle && "string" === typeof kitTitle) { |
| 22339 |
var cleanTitle = kitTitle.trim().replace(/\s+/g, "-").replace(/[^\w-]/g, "").toLowerCase(); |
| 22340 |
url.searchParams.set("utm_term", cleanTitle); |
| 22341 |
} |
| 22342 |
if (kitId && "string" === typeof kitId) url.searchParams.set("utm_content", kitId); |
| 22343 |
return url.toString(); |
| 22344 |
} |
| 22345 |
var init_use_add_kit_promotion_utm = __esmMin((() => {})); |
| 22346 |
|
| 22347 |
//#endregion |
| 22348 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/kit-list-item.scss |
| 22349 |
var init_kit_list_item$1 = __esmMin((() => {})); |
| 22350 |
|
| 22351 |
//#endregion |
| 22352 |
//#region app/modules/kit-library/assets/js/components/kit-list-item.js |
| 22353 |
var import_prop_types$36, KitListItem, kit_list_item_default; |
| 22354 |
var init_kit_list_item = __esmMin((() => { |
| 22355 |
import_prop_types$36 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22356 |
init_badge(); |
| 22357 |
init_favorites_actions(); |
| 22358 |
init_kit(); |
| 22359 |
init_use_kit_call_to_action(); |
| 22360 |
init_use_add_kit_promotion_utm(); |
| 22361 |
init_tracking_context(); |
| 22362 |
init_kit_list_item$1(); |
| 22363 |
KitListItem = function KitListItem(props) { |
| 22364 |
var _useKitCallToAction = useKitCallToAction(props.model.accessTier); |
| 22365 |
var type = _useKitCallToAction.type; |
| 22366 |
var subscriptionPlan = _useKitCallToAction.subscriptionPlan; |
| 22367 |
var promotionUrl = useAddKitPromotionUTM(subscriptionPlan.promotion_url, props.model.id, props.model.title); |
| 22368 |
var ctaText = (0, _wordpress_i18n.__)("Upgrade", "elementor"); |
| 22369 |
var showPromotion = TYPE_PROMOTION === type; |
| 22370 |
var tracking = useTracking(); |
| 22371 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Card, { className: "e-kit-library__kit-item" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardHeader, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 22372 |
tag: "h3", |
| 22373 |
title: props.model.title, |
| 22374 |
variant: "h5", |
| 22375 |
className: "eps-card__headline" |
| 22376 |
}, props.model.title), /*#__PURE__*/ react.default.createElement(FavoritesActions, { |
| 22377 |
id: props.model.id, |
| 22378 |
isFavorite: props.model.isFavorite, |
| 22379 |
index: props.index, |
| 22380 |
name: props.model.title, |
| 22381 |
queryParams: props.queryParams, |
| 22382 |
source: props.source |
| 22383 |
})), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardBody, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardImage, { |
| 22384 |
alt: props.model.title, |
| 22385 |
src: props.model.thumbnailUrl || "" |
| 22386 |
}, /*#__PURE__*/ react.default.createElement(Badge, { |
| 22387 |
variant: "sm", |
| 22388 |
className: "e-kit-library__kit-item-subscription-plan-badge ".concat(subscriptionPlan.isPromoted ? "promoted" : "") |
| 22389 |
}, subscriptionPlan.label), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardOverlay, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 22390 |
container: true, |
| 22391 |
direction: "column", |
| 22392 |
className: "e-kit-library__kit-item-overlay" |
| 22393 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 22394 |
className: "e-kit-library__kit-item-overlay-overview-button", |
| 22395 |
text: (0, _wordpress_i18n.__)("View Demo", "elementor"), |
| 22396 |
icon: "eicon-preview-medium", |
| 22397 |
url: "/kit-library/preview/".concat(props.model.id), |
| 22398 |
onClick: function onClick() { |
| 22399 |
tracking.trackKitdemoClicked(props.model.id, props.model.title, props.index, subscriptionPlan.label); |
| 22400 |
} |
| 22401 |
}), showPromotion && /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 22402 |
className: "e-kit-library__kit-item-overlay-promotion-button", |
| 22403 |
text: ctaText, |
| 22404 |
icon: "eicon-external-link-square", |
| 22405 |
url: promotionUrl, |
| 22406 |
target: "_blank", |
| 22407 |
onClick: function onClick() { |
| 22408 |
return tracking.trackKitdemoUpgradeClicked(props.model.id, props.model.title, subscriptionPlan.label); |
| 22409 |
} |
| 22410 |
})))))); |
| 22411 |
}; |
| 22412 |
KitListItem.propTypes = { |
| 22413 |
model: import_prop_types$36.default.instanceOf(Kit).isRequired, |
| 22414 |
index: import_prop_types$36.default.number, |
| 22415 |
queryParams: import_prop_types$36.default.string, |
| 22416 |
source: import_prop_types$36.default.string |
| 22417 |
}; |
| 22418 |
kit_list_item_default = react.default.memo(KitListItem); |
| 22419 |
})); |
| 22420 |
|
| 22421 |
//#endregion |
| 22422 |
//#region app/modules/kit-library/assets/js/components/new-page-kit-list-item.js |
| 22423 |
var NewPageKitListItem, new_page_kit_list_item_default; |
| 22424 |
var init_new_page_kit_list_item = __esmMin((() => { |
| 22425 |
init_settings_context(); |
| 22426 |
init_kit_list_item$1(); |
| 22427 |
NewPageKitListItem = function NewPageKitListItem() { |
| 22428 |
var _settings$urls; |
| 22429 |
var settings = useSettingsContext().settings; |
| 22430 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Card, { className: "e-kit-library__kit-item" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardHeader, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 22431 |
tag: "h3", |
| 22432 |
title: (0, _wordpress_i18n.__)("Blank Canvas", "elementor"), |
| 22433 |
variant: "h5", |
| 22434 |
className: "eps-card__headline" |
| 22435 |
}, (0, _wordpress_i18n.__)("Blank Canvas", "elementor"))), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardBody, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardImage, { |
| 22436 |
alt: (0, _wordpress_i18n.__)("Blank Canvas", "elementor"), |
| 22437 |
src: elementorCommon.config.urls.assets + "images/app/onboarding/Blank_Preview.jpg" || "" |
| 22438 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardOverlay, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 22439 |
container: true, |
| 22440 |
direction: "column", |
| 22441 |
className: "e-kit-library__kit-item-overlay" |
| 22442 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 22443 |
className: "e-kit-library__kit-item-overlay-overview-button", |
| 22444 |
text: (0, _wordpress_i18n.__)("Create New Elementor Page", "elementor"), |
| 22445 |
icon: "eicon-single-page", |
| 22446 |
url: (_settings$urls = settings.urls) === null || _settings$urls === void 0 ? void 0 : _settings$urls.createNewPage |
| 22447 |
})))))); |
| 22448 |
}; |
| 22449 |
new_page_kit_list_item_default = react.default.memo(NewPageKitListItem); |
| 22450 |
})); |
| 22451 |
|
| 22452 |
//#endregion |
| 22453 |
//#region app/modules/kit-library/assets/js/components/kit-list.js |
| 22454 |
function KitList(props) { |
| 22455 |
var referrer = new URLSearchParams(window.location.search).get("referrer"); |
| 22456 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CssGrid, { |
| 22457 |
spacing: 24, |
| 22458 |
colMinWidth: 290 |
| 22459 |
}, "onboarding" === referrer && /*#__PURE__*/ react.default.createElement(new_page_kit_list_item_default, null), props.data.map(function(model, index) { |
| 22460 |
var _props$queryParams; |
| 22461 |
return /*#__PURE__*/ react.default.createElement(kit_list_item_default, { |
| 22462 |
key: model.id, |
| 22463 |
model, |
| 22464 |
index: index + 1, |
| 22465 |
queryParams: (_props$queryParams = props.queryParams) === null || _props$queryParams === void 0 ? void 0 : _props$queryParams.search, |
| 22466 |
source: props.source |
| 22467 |
}); |
| 22468 |
})); |
| 22469 |
} |
| 22470 |
var import_prop_types$35; |
| 22471 |
var init_kit_list = __esmMin((() => { |
| 22472 |
import_prop_types$35 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22473 |
init_kit(); |
| 22474 |
init_kit_list_item(); |
| 22475 |
init_new_page_kit_list_item(); |
| 22476 |
KitList.propTypes = { |
| 22477 |
data: import_prop_types$35.default.arrayOf(import_prop_types$35.default.instanceOf(Kit)), |
| 22478 |
queryParams: import_prop_types$35.default.shape({ search: import_prop_types$35.default.string }), |
| 22479 |
source: import_prop_types$35.default.string |
| 22480 |
}; |
| 22481 |
})); |
| 22482 |
|
| 22483 |
//#endregion |
| 22484 |
//#region app/modules/kit-library/assets/js/components/layout/index.js |
| 22485 |
function Index$1(props) { |
| 22486 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-app__lightbox" }, /*#__PURE__*/ react.default.createElement("div", { className: "eps-app" }, props.header, /*#__PURE__*/ react.default.createElement("div", { className: "eps-app__main" }, props.sidebar && /*#__PURE__*/ react.default.createElement(Sidebar, null, props.sidebar), props.children))); |
| 22487 |
} |
| 22488 |
var import_prop_types$34; |
| 22489 |
var init_layout = __esmMin((() => { |
| 22490 |
import_prop_types$34 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22491 |
init_sidebar(); |
| 22492 |
__name(Index$1, "Index"); |
| 22493 |
Index$1.propTypes = { |
| 22494 |
header: import_prop_types$34.default.node, |
| 22495 |
sidebar: import_prop_types$34.default.node, |
| 22496 |
children: import_prop_types$34.default.node |
| 22497 |
}; |
| 22498 |
})); |
| 22499 |
|
| 22500 |
//#endregion |
| 22501 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/page-loader.scss |
| 22502 |
var init_page_loader$1 = __esmMin((() => {})); |
| 22503 |
|
| 22504 |
//#endregion |
| 22505 |
//#region app/modules/kit-library/assets/js/components/page-loader.js |
| 22506 |
function PageLoader(props) { |
| 22507 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__page-loader ".concat(props.className) }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Icon, { className: "eicon-loading eicon-animation-spin" })); |
| 22508 |
} |
| 22509 |
var import_prop_types$33; |
| 22510 |
var init_page_loader = __esmMin((() => { |
| 22511 |
import_prop_types$33 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22512 |
init_page_loader$1(); |
| 22513 |
PageLoader.propTypes = { className: import_prop_types$33.default.string }; |
| 22514 |
PageLoader.defaultProps = { className: "" }; |
| 22515 |
})); |
| 22516 |
|
| 22517 |
//#endregion |
| 22518 |
//#region app/modules/kit-library/assets/js/hooks/use-debounced-callback.js |
| 22519 |
function useDebouncedCallback(callback, wait) { |
| 22520 |
var timeout = (0, react.useRef)(); |
| 22521 |
return (0, react.useCallback)(function() { |
| 22522 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 22523 |
var later = function later() { |
| 22524 |
clearTimeout(timeout.current); |
| 22525 |
callback.apply(void 0, args); |
| 22526 |
}; |
| 22527 |
clearTimeout(timeout.current); |
| 22528 |
timeout.current = setTimeout(later, wait); |
| 22529 |
}, [callback, wait]); |
| 22530 |
} |
| 22531 |
var init_use_debounced_callback = __esmMin((() => {})); |
| 22532 |
|
| 22533 |
//#endregion |
| 22534 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/search-input.scss |
| 22535 |
var init_search_input$1 = __esmMin((() => {})); |
| 22536 |
|
| 22537 |
//#endregion |
| 22538 |
//#region app/modules/kit-library/assets/js/components/search-input.js |
| 22539 |
function SearchInput(props) { |
| 22540 |
var _useState2 = _slicedToArray((0, react.useState)(props.value || ""), 2); |
| 22541 |
var localValue = _useState2[0]; |
| 22542 |
var setLocalValue = _useState2[1]; |
| 22543 |
var debouncedOnChange = useDebouncedCallback(function(value) { |
| 22544 |
return props.onChange(value); |
| 22545 |
}, props.debounceTimeout); |
| 22546 |
(0, react.useEffect)(function() { |
| 22547 |
if (props.value !== localValue) setLocalValue(props.value); |
| 22548 |
}, [props.value]); |
| 22549 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-search-input__container ".concat(props.className) }, /*#__PURE__*/ react.default.createElement("input", { |
| 22550 |
className: "eps-search-input eps-search-input--".concat(props.size), |
| 22551 |
placeholder: props.placeholder, |
| 22552 |
value: localValue, |
| 22553 |
onChange: function onChange(e) { |
| 22554 |
setLocalValue(e.target.value); |
| 22555 |
debouncedOnChange(e.target.value); |
| 22556 |
} |
| 22557 |
}), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Icon, { className: "eicon-search-bold eps-search-input__icon eps-search-input__icon--".concat(props.size) }), props.value && /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 22558 |
text: (0, _wordpress_i18n.__)("Clear", "elementor"), |
| 22559 |
hideText: true, |
| 22560 |
className: "eicon-close-circle eps-search-input__clear-icon eps-search-input__clear-icon--".concat(props.size), |
| 22561 |
onClick: function onClick() { |
| 22562 |
return props.onChange(""); |
| 22563 |
} |
| 22564 |
})); |
| 22565 |
} |
| 22566 |
var import_prop_types$32; |
| 22567 |
var init_search_input = __esmMin((() => { |
| 22568 |
import_prop_types$32 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22569 |
init_slicedToArray(); |
| 22570 |
init_use_debounced_callback(); |
| 22571 |
init_search_input$1(); |
| 22572 |
SearchInput.propTypes = { |
| 22573 |
placeholder: import_prop_types$32.default.string, |
| 22574 |
value: import_prop_types$32.default.string.isRequired, |
| 22575 |
onChange: import_prop_types$32.default.func.isRequired, |
| 22576 |
className: import_prop_types$32.default.string, |
| 22577 |
size: import_prop_types$32.default.oneOf(["md", "sm"]), |
| 22578 |
debounceTimeout: import_prop_types$32.default.number |
| 22579 |
}; |
| 22580 |
SearchInput.defaultProps = { |
| 22581 |
className: "", |
| 22582 |
size: "md", |
| 22583 |
debounceTimeout: 300 |
| 22584 |
}; |
| 22585 |
})); |
| 22586 |
|
| 22587 |
//#endregion |
| 22588 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/sort-select.scss |
| 22589 |
var init_sort_select$1 = __esmMin((() => {})); |
| 22590 |
|
| 22591 |
//#endregion |
| 22592 |
//#region app/modules/kit-library/assets/js/components/sort-select.js |
| 22593 |
function SortSelect(props) { |
| 22594 |
var getSelectedOptionDetails = function getSelectedOptionDetails(value) { |
| 22595 |
return props.options.find(function(option) { |
| 22596 |
return option.value === value; |
| 22597 |
}); |
| 22598 |
}; |
| 22599 |
var _useState2 = _slicedToArray((0, react.useState)(getSelectedOptionDetails(props.value.by)), 2); |
| 22600 |
var selectedSortBy = _useState2[0]; |
| 22601 |
var setSelectedSortBy = _useState2[1]; |
| 22602 |
(0, react.useEffect)(function() { |
| 22603 |
var _selectedSortBy$defau; |
| 22604 |
props.onChange({ |
| 22605 |
by: selectedSortBy.value, |
| 22606 |
direction: (_selectedSortBy$defau = selectedSortBy.defaultOrder) !== null && _selectedSortBy$defau !== void 0 ? _selectedSortBy$defau : props.value.direction |
| 22607 |
}); |
| 22608 |
}, [selectedSortBy]); |
| 22609 |
return /*#__PURE__*/ react.default.createElement("div", { className: "eps-sort-select" }, /*#__PURE__*/ react.default.createElement("div", { className: "eps-sort-select__select-wrapper" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Select, { |
| 22610 |
options: props.options, |
| 22611 |
value: props.value.by, |
| 22612 |
onChange: function onChange(e) { |
| 22613 |
var _props$onChangeSortVa; |
| 22614 |
var value = e.target.value; |
| 22615 |
setSelectedSortBy(getSelectedOptionDetails(value)); |
| 22616 |
(_props$onChangeSortVa = props.onChangeSortValue) === null || _props$onChangeSortVa === void 0 || _props$onChangeSortVa.call(props, value); |
| 22617 |
}, |
| 22618 |
className: "eps-sort-select__select", |
| 22619 |
onClick: function onClick() { |
| 22620 |
var _props$onSortSelectOp; |
| 22621 |
props.onChange({ |
| 22622 |
by: props.value.by, |
| 22623 |
direction: props.value.direction |
| 22624 |
}); |
| 22625 |
(_props$onSortSelectOp = props.onSortSelectOpen) === null || _props$onSortSelectOp === void 0 || _props$onSortSelectOp.call(props); |
| 22626 |
} |
| 22627 |
})), !selectedSortBy.orderDisabled && /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 22628 |
text: "asc" === props.value.direction ? (0, _wordpress_i18n.__)("Sort Descending", "elementor") : (0, _wordpress_i18n.__)("Sort Ascending", "elementor"), |
| 22629 |
hideText: true, |
| 22630 |
icon: "asc" === props.value.direction ? "eicon-arrow-up" : "eicon-arrow-down", |
| 22631 |
className: "eps-sort-select__button", |
| 22632 |
onClick: function onClick() { |
| 22633 |
var direction = props.value.direction && "asc" === props.value.direction ? "desc" : "asc"; |
| 22634 |
if (props.onChangeSortDirection) props.onChangeSortDirection(direction); |
| 22635 |
props.onChange({ |
| 22636 |
by: props.value.by, |
| 22637 |
direction |
| 22638 |
}); |
| 22639 |
} |
| 22640 |
})); |
| 22641 |
} |
| 22642 |
var import_prop_types$31; |
| 22643 |
var init_sort_select = __esmMin((() => { |
| 22644 |
import_prop_types$31 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22645 |
init_slicedToArray(); |
| 22646 |
init_sort_select$1(); |
| 22647 |
SortSelect.propTypes = { |
| 22648 |
options: import_prop_types$31.default.arrayOf(import_prop_types$31.default.shape({ |
| 22649 |
label: import_prop_types$31.default.string.isRequired, |
| 22650 |
value: import_prop_types$31.default.oneOfType([import_prop_types$31.default.string, import_prop_types$31.default.number]).isRequired |
| 22651 |
})).isRequired, |
| 22652 |
value: import_prop_types$31.default.shape({ |
| 22653 |
direction: import_prop_types$31.default.oneOf(["asc", "desc"]).isRequired, |
| 22654 |
by: import_prop_types$31.default.string.isRequired |
| 22655 |
}).isRequired, |
| 22656 |
onChange: import_prop_types$31.default.func.isRequired, |
| 22657 |
onChangeSortValue: import_prop_types$31.default.func, |
| 22658 |
onSortSelectOpen: import_prop_types$31.default.func, |
| 22659 |
onChangeSortDirection: import_prop_types$31.default.func |
| 22660 |
}; |
| 22661 |
})); |
| 22662 |
|
| 22663 |
//#endregion |
| 22664 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/collapse.scss |
| 22665 |
var init_collapse$1 = __esmMin((() => {})); |
| 22666 |
|
| 22667 |
//#endregion |
| 22668 |
//#region app/modules/kit-library/assets/js/components/collapse.js |
| 22669 |
function Collapse(props) { |
| 22670 |
return /*#__PURE__*/ react.default.createElement("div", { |
| 22671 |
className: "eps-collapse ".concat(props.className), |
| 22672 |
"data-open": props.isOpen || void 0 |
| 22673 |
}, /*#__PURE__*/ react.default.createElement("button", { |
| 22674 |
className: "eps-collapse__title", |
| 22675 |
onClick: function onClick() { |
| 22676 |
var _props$onClick; |
| 22677 |
props.onChange(function(value) { |
| 22678 |
return !value; |
| 22679 |
}); |
| 22680 |
(_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, props.isOpen, props.title); |
| 22681 |
} |
| 22682 |
}, /*#__PURE__*/ react.default.createElement("span", null, props.title), /*#__PURE__*/ react.default.createElement("i", { className: "eicon-chevron-right eps-collapse__icon" })), /*#__PURE__*/ react.default.createElement("div", { className: "eps-collapse__content" }, props.children)); |
| 22683 |
} |
| 22684 |
var import_prop_types$30; |
| 22685 |
var init_collapse = __esmMin((() => { |
| 22686 |
import_prop_types$30 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22687 |
init_collapse$1(); |
| 22688 |
Collapse.propTypes = { |
| 22689 |
isOpen: import_prop_types$30.default.bool, |
| 22690 |
onChange: import_prop_types$30.default.func, |
| 22691 |
className: import_prop_types$30.default.string, |
| 22692 |
title: import_prop_types$30.default.node, |
| 22693 |
onClick: import_prop_types$30.default.func, |
| 22694 |
children: import_prop_types$30.default.oneOfType([import_prop_types$30.default.node, import_prop_types$30.default.arrayOf(import_prop_types$30.default.node)]) |
| 22695 |
}; |
| 22696 |
Collapse.defaultProps = { |
| 22697 |
className: "", |
| 22698 |
isOpen: false |
| 22699 |
}; |
| 22700 |
})); |
| 22701 |
|
| 22702 |
//#endregion |
| 22703 |
//#region app/modules/kit-library/assets/js/components/taxonomies-filter-list.js |
| 22704 |
var import_prop_types$29, MIN_TAGS_LENGTH_FOR_SEARCH_INPUT, TaxonomiesFilterList, taxonomies_filter_list_default; |
| 22705 |
var init_taxonomies_filter_list = __esmMin((() => { |
| 22706 |
import_prop_types$29 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22707 |
init_toConsumableArray(); |
| 22708 |
init_slicedToArray(); |
| 22709 |
init_taxonomy(); |
| 22710 |
init_collapse(); |
| 22711 |
init_search_input(); |
| 22712 |
init_tracking_context(); |
| 22713 |
MIN_TAGS_LENGTH_FOR_SEARCH_INPUT = 15; |
| 22714 |
TaxonomiesFilterList = function TaxonomiesFilterList(props) { |
| 22715 |
var _useState2 = _slicedToArray((0, react.useState)(props.taxonomiesByType.isOpenByDefault), 2); |
| 22716 |
var isOpen = _useState2[0]; |
| 22717 |
var setIsOpen = _useState2[1]; |
| 22718 |
var _useState4 = _slicedToArray((0, react.useState)(""), 2); |
| 22719 |
var search = _useState4[0]; |
| 22720 |
var setSearch = _useState4[1]; |
| 22721 |
var tracking = useTracking(); |
| 22722 |
var taxonomies = (0, react.useMemo)(function() { |
| 22723 |
if (!search) return props.taxonomiesByType.data; |
| 22724 |
var lowerCaseSearch = search.toLowerCase(); |
| 22725 |
return props.taxonomiesByType.data.filter(function(tag) { |
| 22726 |
return tag.text.toLowerCase().includes(lowerCaseSearch); |
| 22727 |
}); |
| 22728 |
}, [props.taxonomiesByType.data, search]); |
| 22729 |
return /*#__PURE__*/ react.default.createElement(Collapse, { |
| 22730 |
className: "e-kit-library__tags-filter-list", |
| 22731 |
title: props.taxonomiesByType.label, |
| 22732 |
isOpen, |
| 22733 |
onChange: setIsOpen |
| 22734 |
}, props.taxonomiesByType.data.length >= MIN_TAGS_LENGTH_FOR_SEARCH_INPUT && /*#__PURE__*/ react.default.createElement(SearchInput, { |
| 22735 |
size: "sm", |
| 22736 |
className: "e-kit-library__tags-filter-list-search", |
| 22737 |
placeholder: (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("Search %s...", "elementor"), props.taxonomiesByType.label), |
| 22738 |
value: search, |
| 22739 |
onChange: function onChange(searchTerm) { |
| 22740 |
setSearch(searchTerm); |
| 22741 |
} |
| 22742 |
}), /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__tags-filter-list-container" }, 0 === taxonomies.length && /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, null, (0, _wordpress_i18n.__)("No Results Found", "elementor")), taxonomies.map(function(taxonomy) { |
| 22743 |
var _props$selected$taxon; |
| 22744 |
return /*#__PURE__*/ react.default.createElement("label", { |
| 22745 |
key: taxonomy.text, |
| 22746 |
className: "e-kit-library__tags-filter-list-item" |
| 22747 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Checkbox, { |
| 22748 |
checked: !!((_props$selected$taxon = props.selected[taxonomy.type]) !== null && _props$selected$taxon !== void 0 && _props$selected$taxon.includes(taxonomy.id || taxonomy.text)), |
| 22749 |
onChange: function onChange(e) { |
| 22750 |
var checked = e.target.checked; |
| 22751 |
var callback = function callback() { |
| 22752 |
props.onSelect(taxonomy.type, function(prev) { |
| 22753 |
return checked ? [].concat(_toConsumableArray(prev), [taxonomy.id || taxonomy.text]) : prev.filter(function(tagId) { |
| 22754 |
return ![taxonomy.id, taxonomy.text].includes(tagId); |
| 22755 |
}); |
| 22756 |
}); |
| 22757 |
}; |
| 22758 |
if ("categories" === taxonomy.type && checked) tracking.trackKitlibCategorySelected(taxonomy.text, callback); |
| 22759 |
else if ("tags" === taxonomy.type && checked) tracking.trackKitlibTagSelected(taxonomy.text, callback); |
| 22760 |
else if ("subscription_plans" === taxonomy.type && checked) tracking.trackKitlibPlanFilterSelected(taxonomy.text, callback); |
| 22761 |
else callback(); |
| 22762 |
} |
| 22763 |
}), taxonomy.text); |
| 22764 |
}))); |
| 22765 |
}; |
| 22766 |
TaxonomiesFilterList.propTypes = { |
| 22767 |
taxonomiesByType: import_prop_types$29.default.shape({ |
| 22768 |
key: import_prop_types$29.default.string, |
| 22769 |
label: import_prop_types$29.default.string, |
| 22770 |
data: import_prop_types$29.default.arrayOf(import_prop_types$29.default.instanceOf(Taxonomy)), |
| 22771 |
isOpenByDefault: import_prop_types$29.default.bool |
| 22772 |
}), |
| 22773 |
selected: import_prop_types$29.default.objectOf(import_prop_types$29.default.arrayOf(import_prop_types$29.default.string)), |
| 22774 |
onSelect: import_prop_types$29.default.func, |
| 22775 |
onCollapseChange: import_prop_types$29.default.func, |
| 22776 |
category: import_prop_types$29.default.string, |
| 22777 |
onChange: import_prop_types$29.default.func |
| 22778 |
}; |
| 22779 |
taxonomies_filter_list_default = react.default.memo(TaxonomiesFilterList); |
| 22780 |
})); |
| 22781 |
|
| 22782 |
//#endregion |
| 22783 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/tags-filter.scss |
| 22784 |
var init_tags_filter = __esmMin((() => {})); |
| 22785 |
|
| 22786 |
//#endregion |
| 22787 |
//#region app/modules/kit-library/assets/js/components/taxonomies-filter.js |
| 22788 |
function TaxonomiesFilter(props) { |
| 22789 |
var taxonomiesByType = useMemo$7(function() { |
| 22790 |
return getTaxonomyFilterItems(props.taxonomies); |
| 22791 |
}, [props.taxonomies]); |
| 22792 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__tags-filter" }, taxonomiesByType.map(function(group) { |
| 22793 |
return /*#__PURE__*/ react.default.createElement(taxonomies_filter_list_default, { |
| 22794 |
key: group.key, |
| 22795 |
taxonomiesByType: group, |
| 22796 |
selected: props.selected, |
| 22797 |
onSelect: props.onSelect, |
| 22798 |
category: props.category |
| 22799 |
}); |
| 22800 |
})); |
| 22801 |
} |
| 22802 |
var import_prop_types$28, useMemo$7; |
| 22803 |
var init_taxonomies_filter = __esmMin((() => { |
| 22804 |
import_prop_types$28 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22805 |
init_taxonomies_filter_list(); |
| 22806 |
init_taxonomy(); |
| 22807 |
init_taxonomy_transformer(); |
| 22808 |
init_tags_filter(); |
| 22809 |
useMemo$7 = react.default.useMemo; |
| 22810 |
TaxonomiesFilter.propTypes = { |
| 22811 |
selected: import_prop_types$28.default.objectOf(import_prop_types$28.default.arrayOf(import_prop_types$28.default.string)), |
| 22812 |
onSelect: import_prop_types$28.default.func, |
| 22813 |
taxonomies: import_prop_types$28.default.arrayOf(import_prop_types$28.default.instanceOf(Taxonomy)), |
| 22814 |
category: import_prop_types$28.default.string |
| 22815 |
}; |
| 22816 |
})); |
| 22817 |
|
| 22818 |
//#endregion |
| 22819 |
//#region app/modules/kit-library/assets/js/context/connect-state-context.js |
| 22820 |
function ConnectStateProvider(_ref) { |
| 22821 |
var children = _ref.children; |
| 22822 |
var _useState2 = _slicedToArray((0, react.useState)(elementorCommon.config.library_connect.is_connected), 2); |
| 22823 |
var isConnected = _useState2[0]; |
| 22824 |
var setIsConnected = _useState2[1]; |
| 22825 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 22826 |
var isConnecting = _useState4[0]; |
| 22827 |
var setIsConnecting = _useState4[1]; |
| 22828 |
var handleConnectSuccess = (0, react.useCallback)(function(callback) { |
| 22829 |
setIsConnecting(true); |
| 22830 |
setIsConnected(true); |
| 22831 |
elementorCommon.config.library_connect.is_connected = true; |
| 22832 |
if (callback) callback(); |
| 22833 |
}, []); |
| 22834 |
var handleConnectError = (0, react.useCallback)(function(callback) { |
| 22835 |
setIsConnected(false); |
| 22836 |
setIsConnecting(false); |
| 22837 |
elementorCommon.config.library_connect.is_connected = false; |
| 22838 |
if (callback) callback(); |
| 22839 |
}, []); |
| 22840 |
var value = { |
| 22841 |
isConnected, |
| 22842 |
isConnecting, |
| 22843 |
setConnecting: (0, react.useCallback)(function(connecting) { |
| 22844 |
setIsConnecting(connecting); |
| 22845 |
}, []), |
| 22846 |
handleConnectSuccess, |
| 22847 |
handleConnectError |
| 22848 |
}; |
| 22849 |
return /*#__PURE__*/ react.default.createElement(ConnectStateContext.Provider, { value }, children); |
| 22850 |
} |
| 22851 |
var import_prop_types$27, ConnectStateContext; |
| 22852 |
var init_connect_state_context = __esmMin((() => { |
| 22853 |
init_slicedToArray(); |
| 22854 |
import_prop_types$27 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 22855 |
ConnectStateContext = (0, react.createContext)(); |
| 22856 |
ConnectStateProvider.propTypes = { children: import_prop_types$27.default.node.isRequired }; |
| 22857 |
})); |
| 22858 |
|
| 22859 |
//#endregion |
| 22860 |
//#region app/modules/kit-library/assets/js/hooks/use-connect-state.js |
| 22861 |
function useConnectState() { |
| 22862 |
var context = (0, react.useContext)(ConnectStateContext); |
| 22863 |
if (!context) throw new Error("useConnectState must be used within a ConnectStateProvider"); |
| 22864 |
return context; |
| 22865 |
} |
| 22866 |
var init_use_connect_state = __esmMin((() => { |
| 22867 |
init_connect_state_context(); |
| 22868 |
})); |
| 22869 |
|
| 22870 |
//#endregion |
| 22871 |
//#region app/modules/kit-library/assets/js/hooks/use-menu-items.js |
| 22872 |
/** |
| 22873 |
* Generate the menu items for the kit library pages. |
| 22874 |
* |
| 22875 |
* @param {string} path - The current page path |
| 22876 |
* @return {Array} menu items |
| 22877 |
*/ |
| 22878 |
function useMenuItems(path) { |
| 22879 |
var isConnected = useConnectState().isConnected; |
| 22880 |
var cloudKitsData = useCloudKitsEligibility({ enabled: isConnected }).data; |
| 22881 |
var isCloudKitsAvailable = cloudKitsData === null || cloudKitsData === void 0 ? void 0 : cloudKitsData.is_eligible; |
| 22882 |
return (0, react.useMemo)(function() { |
| 22883 |
var page = path.replace("/", ""); |
| 22884 |
var myWebsiteTemplatesLabel = (0, _wordpress_i18n.__)("My Website Templates", "elementor"); |
| 22885 |
if (!isConnected) myWebsiteTemplatesLabel = /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("My Website Templates", "elementor"), /*#__PURE__*/ react.default.createElement("span", { className: "connect-badge" }, (0, _wordpress_i18n.__)("Connect", "elementor"))); |
| 22886 |
else if (isConnected && false === isCloudKitsAvailable) myWebsiteTemplatesLabel = /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("My Website Templates", "elementor"), /*#__PURE__*/ react.default.createElement("span", { className: "upgrade-badge" }, (0, _wordpress_i18n.__)("Upgrade", "elementor"))); |
| 22887 |
return [ |
| 22888 |
{ |
| 22889 |
label: (0, _wordpress_i18n.__)("All Website Templates", "elementor"), |
| 22890 |
icon: "eicon-filter", |
| 22891 |
isActive: !page, |
| 22892 |
url: "/kit-library", |
| 22893 |
trackEventData: { |
| 22894 |
command: "kit-library/select-organizing-category", |
| 22895 |
category: "all" |
| 22896 |
} |
| 22897 |
}, |
| 22898 |
{ |
| 22899 |
label: myWebsiteTemplatesLabel, |
| 22900 |
icon: "eicon-library-cloud-empty", |
| 22901 |
isActive: "cloud" === page, |
| 22902 |
url: "/kit-library/cloud", |
| 22903 |
trackEventData: { |
| 22904 |
command: "kit-library/select-organizing-category", |
| 22905 |
category: "cloud" |
| 22906 |
} |
| 22907 |
}, |
| 22908 |
{ |
| 22909 |
label: (0, _wordpress_i18n.__)("Favorites", "elementor"), |
| 22910 |
icon: "eicon-heart-o", |
| 22911 |
isActive: "favorites" === page, |
| 22912 |
url: "/kit-library/favorites", |
| 22913 |
trackEventData: { |
| 22914 |
command: "kit-library/select-organizing-category", |
| 22915 |
category: "favorites" |
| 22916 |
} |
| 22917 |
} |
| 22918 |
]; |
| 22919 |
}, [ |
| 22920 |
path, |
| 22921 |
isConnected, |
| 22922 |
isCloudKitsAvailable |
| 22923 |
]); |
| 22924 |
} |
| 22925 |
var init_use_menu_items = __esmMin((() => { |
| 22926 |
init_use_cloud_kits_eligibility(); |
| 22927 |
init_use_connect_state(); |
| 22928 |
})); |
| 22929 |
|
| 22930 |
//#endregion |
| 22931 |
//#region app/modules/kit-library/assets/js/hooks/use-taxonomies.js |
| 22932 |
function ownKeys$5(e, r) { |
| 22933 |
var t = Object.keys(e); |
| 22934 |
if (Object.getOwnPropertySymbols) { |
| 22935 |
var o = Object.getOwnPropertySymbols(e); |
| 22936 |
r && (o = o.filter(function(r) { |
| 22937 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 22938 |
})), t.push.apply(t, o); |
| 22939 |
} |
| 22940 |
return t; |
| 22941 |
} |
| 22942 |
function _objectSpread$4(e) { |
| 22943 |
for (var r = 1; r < arguments.length; r++) { |
| 22944 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 22945 |
r % 2 ? ownKeys$5(Object(t), !0).forEach(function(r) { |
| 22946 |
_defineProperty$1(e, r, t[r]); |
| 22947 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function(r) { |
| 22948 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 22949 |
}); |
| 22950 |
} |
| 22951 |
return e; |
| 22952 |
} |
| 22953 |
function useTaxonomies() { |
| 22954 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 22955 |
var force = _useState2[0]; |
| 22956 |
var setForce = _useState2[1]; |
| 22957 |
var forceRefetch = (0, react.useCallback)(function() { |
| 22958 |
return setForce(true); |
| 22959 |
}, [setForce]); |
| 22960 |
var query = useQuery([KEY$3], function() { |
| 22961 |
return fetchTaxonomies(force); |
| 22962 |
}); |
| 22963 |
(0, react.useEffect)(function() { |
| 22964 |
if (!force) return; |
| 22965 |
query.refetch().then(function() { |
| 22966 |
return setForce(false); |
| 22967 |
}); |
| 22968 |
}, [force]); |
| 22969 |
return _objectSpread$4(_objectSpread$4({}, query), {}, { forceRefetch }); |
| 22970 |
} |
| 22971 |
function fetchTaxonomies(force) { |
| 22972 |
return $e.data.get("kit-taxonomies/index", { force: force ? 1 : void 0 }, { refresh: true }).then(function(response) { |
| 22973 |
return response.data; |
| 22974 |
}).then(function(_ref) { |
| 22975 |
return _ref.data.map(function(taxonomy) { |
| 22976 |
return Taxonomy.createFromResponse(taxonomy); |
| 22977 |
}); |
| 22978 |
}); |
| 22979 |
} |
| 22980 |
var KEY$3; |
| 22981 |
var init_use_taxonomies = __esmMin((() => { |
| 22982 |
init_defineProperty$1(); |
| 22983 |
init_slicedToArray(); |
| 22984 |
init_taxonomy(); |
| 22985 |
init_es(); |
| 22986 |
__name(ownKeys$5, "ownKeys"); |
| 22987 |
__name(_objectSpread$4, "_objectSpread"); |
| 22988 |
KEY$3 = "tags"; |
| 22989 |
})); |
| 22990 |
|
| 22991 |
//#endregion |
| 22992 |
//#region app/modules/kit-library/assets/js/context/last-filter-context.js |
| 22993 |
/** |
| 22994 |
* Consume the context |
| 22995 |
* |
| 22996 |
* @return {{}} context value |
| 22997 |
*/ |
| 22998 |
function useLastFilterContext() { |
| 22999 |
return (0, react.useContext)(LastFilterContext); |
| 23000 |
} |
| 23001 |
/** |
| 23002 |
* Settings Provider |
| 23003 |
* |
| 23004 |
* @param {*} props |
| 23005 |
* @return {JSX.Element} element |
| 23006 |
* @function Object() { [native code] } |
| 23007 |
*/ |
| 23008 |
function LastFilterProvider(props) { |
| 23009 |
var _useState2 = _slicedToArray((0, react.useState)({}), 2); |
| 23010 |
var lastFilter = _useState2[0]; |
| 23011 |
var setLastFilter = _useState2[1]; |
| 23012 |
return /*#__PURE__*/ react.default.createElement(LastFilterContext.Provider, { value: { |
| 23013 |
lastFilter, |
| 23014 |
setLastFilter |
| 23015 |
} }, props.children); |
| 23016 |
} |
| 23017 |
var import_prop_types$26, LastFilterContext; |
| 23018 |
var init_last_filter_context = __esmMin((() => { |
| 23019 |
import_prop_types$26 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23020 |
init_slicedToArray(); |
| 23021 |
LastFilterContext = (0, react.createContext)({}); |
| 23022 |
LastFilterProvider.propTypes = { children: import_prop_types$26.default.any }; |
| 23023 |
})); |
| 23024 |
|
| 23025 |
//#endregion |
| 23026 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/pages/index/index.scss |
| 23027 |
var init_index$1 = __esmMin((() => {})); |
| 23028 |
|
| 23029 |
//#endregion |
| 23030 |
//#region app/modules/kit-library/assets/js/pages/index/index.js |
| 23031 |
function ownKeys$4(e, r) { |
| 23032 |
var t = Object.keys(e); |
| 23033 |
if (Object.getOwnPropertySymbols) { |
| 23034 |
var o = Object.getOwnPropertySymbols(e); |
| 23035 |
r && (o = o.filter(function(r) { |
| 23036 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 23037 |
})), t.push.apply(t, o); |
| 23038 |
} |
| 23039 |
return t; |
| 23040 |
} |
| 23041 |
function _objectSpread$3(e) { |
| 23042 |
for (var r = 1; r < arguments.length; r++) { |
| 23043 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 23044 |
r % 2 ? ownKeys$4(Object(t), !0).forEach(function(r) { |
| 23045 |
_defineProperty$1(e, r, t[r]); |
| 23046 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function(r) { |
| 23047 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 23048 |
}); |
| 23049 |
} |
| 23050 |
return e; |
| 23051 |
} |
| 23052 |
/** |
| 23053 |
* Generate select and unselect taxonomy functions. |
| 23054 |
* |
| 23055 |
* @param {Function} setQueryParams |
| 23056 |
* @return {((function(*, *): *)|(function(*=): *))[]} taxonomy functions |
| 23057 |
*/ |
| 23058 |
function useTaxonomiesSelection(setQueryParams) { |
| 23059 |
return [(0, react.useCallback)(function(type, callback) { |
| 23060 |
return setQueryParams(function(prev) { |
| 23061 |
var taxonomies = _objectSpread$3({}, prev.taxonomies); |
| 23062 |
taxonomies[type] = callback(prev.taxonomies[type]); |
| 23063 |
return _objectSpread$3(_objectSpread$3({}, prev), {}, { taxonomies }); |
| 23064 |
}); |
| 23065 |
}, [setQueryParams]), (0, react.useCallback)(function(taxonomy) { |
| 23066 |
return setQueryParams(function(prev) { |
| 23067 |
var taxonomies = Object.entries(prev.taxonomies).reduce(function(current, _ref) { |
| 23068 |
var _ref2 = _slicedToArray(_ref, 2); |
| 23069 |
var key = _ref2[0]; |
| 23070 |
var groupedTaxonomies = _ref2[1]; |
| 23071 |
return _objectSpread$3(_objectSpread$3({}, current), {}, _defineProperty$1({}, key, groupedTaxonomies.filter(function(item) { |
| 23072 |
return item !== taxonomy; |
| 23073 |
}))); |
| 23074 |
}, {}); |
| 23075 |
return _objectSpread$3(_objectSpread$3({}, prev), {}, { taxonomies }); |
| 23076 |
}); |
| 23077 |
}, [setQueryParams])]; |
| 23078 |
} |
| 23079 |
/** |
| 23080 |
* Update and read the query param from the url |
| 23081 |
* |
| 23082 |
* @param {*} queryParams |
| 23083 |
* @param {*} setQueryParams |
| 23084 |
* @param {Array<string>} exclude |
| 23085 |
*/ |
| 23086 |
function useRouterQueryParams(queryParams, setQueryParams) { |
| 23087 |
var exclude = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; |
| 23088 |
var location = useLocation(); |
| 23089 |
var setLastFilter = useLastFilterContext().setLastFilter; |
| 23090 |
(0, react.useEffect)(function() { |
| 23091 |
var filteredQueryParams = Object.fromEntries(Object.entries(queryParams).filter(function(_ref3) { |
| 23092 |
var _ref4 = _slicedToArray(_ref3, 2); |
| 23093 |
var key = _ref4[0]; |
| 23094 |
var item = _ref4[1]; |
| 23095 |
return !exclude.includes(key) && item; |
| 23096 |
})); |
| 23097 |
setLastFilter(filteredQueryParams); |
| 23098 |
history.replaceState(null, "", decodeURI("#".concat(wp.url.addQueryArgs(location.pathname.split("?")[0] || "/", filteredQueryParams)))); |
| 23099 |
}, [queryParams]); |
| 23100 |
(0, react.useEffect)(function() { |
| 23101 |
var routerQueryParams = Object.keys(defaultQueryParams$1).reduce(function(current, key) { |
| 23102 |
var queryArg = wp.url.getQueryArg(location.pathname, key); |
| 23103 |
if (!queryArg) return current; |
| 23104 |
return _objectSpread$3(_objectSpread$3({}, current), {}, _defineProperty$1({}, key, queryArg)); |
| 23105 |
}, {}); |
| 23106 |
setQueryParams(function(prev) { |
| 23107 |
return _objectSpread$3(_objectSpread$3(_objectSpread$3({}, prev), routerQueryParams), {}, { |
| 23108 |
taxonomies: _objectSpread$3(_objectSpread$3({}, prev.taxonomies), routerQueryParams.taxonomies), |
| 23109 |
ready: true |
| 23110 |
}); |
| 23111 |
}); |
| 23112 |
}, []); |
| 23113 |
} |
| 23114 |
function Index(_ref5) { |
| 23115 |
var path = _ref5.path; |
| 23116 |
var _ref5$initialQueryPar = _ref5.initialQueryParams; |
| 23117 |
var initialQueryParams = _ref5$initialQueryPar === void 0 ? {} : _ref5$initialQueryPar; |
| 23118 |
var _ref5$renderNoResults = _ref5.renderNoResultsComponent; |
| 23119 |
var renderNoResultsComponent = _ref5$renderNoResults === void 0 ? function(_ref6) { |
| 23120 |
return _ref6.defaultComponent; |
| 23121 |
} : _ref5$renderNoResults; |
| 23122 |
usePageTitle({ title: (0, _wordpress_i18n.__)("Website Templates", "elementor") }); |
| 23123 |
var menuItems = useMenuItems(path); |
| 23124 |
var tracking = useTracking(); |
| 23125 |
var _useKits = useKits(initialQueryParams); |
| 23126 |
var data = _useKits.data; |
| 23127 |
var isSuccess = _useKits.isSuccess; |
| 23128 |
var isLoading = _useKits.isLoading; |
| 23129 |
var isFetching = _useKits.isFetching; |
| 23130 |
var isError = _useKits.isError; |
| 23131 |
var queryParams = _useKits.queryParams; |
| 23132 |
var setQueryParams = _useKits.setQueryParams; |
| 23133 |
var clearQueryParams = _useKits.clearQueryParams; |
| 23134 |
var forceRefetch = _useKits.forceRefetch; |
| 23135 |
var isFilterActive = _useKits.isFilterActive; |
| 23136 |
useRouterQueryParams(queryParams, setQueryParams, ["ready"].concat(_toConsumableArray(Object.keys(initialQueryParams)))); |
| 23137 |
(0, react.useEffect)(function() { |
| 23138 |
if (!queryParams.search) return; |
| 23139 |
tracking.trackKitlibSearchSubmitted(queryParams.search, data.length); |
| 23140 |
}, [ |
| 23141 |
queryParams.search, |
| 23142 |
data.length, |
| 23143 |
tracking |
| 23144 |
]); |
| 23145 |
var _useTaxonomies = useTaxonomies(); |
| 23146 |
var taxonomiesData = _useTaxonomies.data; |
| 23147 |
var forceRefetchTaxonomies = _useTaxonomies.forceRefetch; |
| 23148 |
var isFetchingTaxonomies = _useTaxonomies.isFetching; |
| 23149 |
var _useTaxonomiesSelecti2 = _slicedToArray(useTaxonomiesSelection(setQueryParams), 2); |
| 23150 |
var selectTaxonomy = _useTaxonomiesSelecti2[0]; |
| 23151 |
var unselectTaxonomy = _useTaxonomiesSelecti2[1]; |
| 23152 |
var options = [ |
| 23153 |
{ |
| 23154 |
label: (0, _wordpress_i18n.__)("Featured", "elementor"), |
| 23155 |
value: "featuredIndex", |
| 23156 |
defaultOrder: "asc", |
| 23157 |
orderDisabled: true |
| 23158 |
}, |
| 23159 |
{ |
| 23160 |
label: (0, _wordpress_i18n.__)("New", "elementor"), |
| 23161 |
value: "createdAt", |
| 23162 |
defaultOrder: "desc" |
| 23163 |
}, |
| 23164 |
{ |
| 23165 |
label: (0, _wordpress_i18n.__)("Popular", "elementor"), |
| 23166 |
value: "popularityIndex", |
| 23167 |
defaultOrder: "desc" |
| 23168 |
}, |
| 23169 |
{ |
| 23170 |
label: (0, _wordpress_i18n.__)("Trending", "elementor"), |
| 23171 |
value: "trendIndex", |
| 23172 |
defaultOrder: "desc" |
| 23173 |
} |
| 23174 |
]; |
| 23175 |
return /*#__PURE__*/ react.default.createElement(Index$1, { |
| 23176 |
sidebar: /*#__PURE__*/ react.default.createElement(IndexSidebar, { |
| 23177 |
tagsFilterSlot: /*#__PURE__*/ react.default.createElement(TaxonomiesFilter, { |
| 23178 |
selected: queryParams.taxonomies, |
| 23179 |
onSelect: selectTaxonomy, |
| 23180 |
taxonomies: taxonomiesData, |
| 23181 |
category: path |
| 23182 |
}), |
| 23183 |
menuItems |
| 23184 |
}), |
| 23185 |
header: /*#__PURE__*/ react.default.createElement(IndexHeader, { |
| 23186 |
refetch: function refetch() { |
| 23187 |
forceRefetch(); |
| 23188 |
forceRefetchTaxonomies(); |
| 23189 |
}, |
| 23190 |
isFetching: isFetching || isFetchingTaxonomies |
| 23191 |
}) |
| 23192 |
}, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__index-layout-container" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 23193 |
container: true, |
| 23194 |
className: "e-kit-library__index-layout-heading" |
| 23195 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 23196 |
item: true, |
| 23197 |
className: "e-kit-library__index-layout-heading-search" |
| 23198 |
}, /*#__PURE__*/ react.default.createElement(SearchInput, { |
| 23199 |
placeholder: (0, _wordpress_i18n.__)("Search all Website Templates...", "elementor"), |
| 23200 |
value: queryParams.search, |
| 23201 |
onChange: function onChange(value) { |
| 23202 |
setQueryParams(function(prev) { |
| 23203 |
return _objectSpread$3(_objectSpread$3({}, prev), {}, { search: value }); |
| 23204 |
}); |
| 23205 |
} |
| 23206 |
}), isFilterActive && /*#__PURE__*/ react.default.createElement(FilterIndicationText, { |
| 23207 |
queryParams, |
| 23208 |
resultCount: data.length || 0, |
| 23209 |
onClear: clearQueryParams, |
| 23210 |
onRemoveTag: unselectTaxonomy |
| 23211 |
})), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 23212 |
item: true, |
| 23213 |
className: "e-kit-library__index-layout-heading-sort" |
| 23214 |
}, /*#__PURE__*/ react.default.createElement(SortSelect, { |
| 23215 |
options, |
| 23216 |
value: queryParams.order, |
| 23217 |
onChange: function onChange(order) { |
| 23218 |
return setQueryParams(function(prev) { |
| 23219 |
return _objectSpread$3(_objectSpread$3({}, prev), {}, { order }); |
| 23220 |
}); |
| 23221 |
}, |
| 23222 |
onChangeSortValue: function onChangeSortValue(value) { |
| 23223 |
var label = options.find(function(option) { |
| 23224 |
return option.value === value; |
| 23225 |
}).label; |
| 23226 |
setQueryParams(function(prev) { |
| 23227 |
return _objectSpread$3(_objectSpread$3({}, prev), {}, { order: _objectSpread$3(_objectSpread$3({}, prev.order), {}, { by: value }) }); |
| 23228 |
}); |
| 23229 |
tracking.trackKitlibSorterSelected(label); |
| 23230 |
} |
| 23231 |
}))), /*#__PURE__*/ react.default.createElement(Content, { className: "e-kit-library__index-layout-main" }, /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, isLoading && /*#__PURE__*/ react.default.createElement(PageLoader, null), isError && /*#__PURE__*/ react.default.createElement(ErrorScreen, { |
| 23232 |
title: (0, _wordpress_i18n.__)("Something went wrong.", "elementor"), |
| 23233 |
description: (0, _wordpress_i18n.__)("Nothing to worry about, use 🔄 on the top corner to try again. If the problem continues, head over to the Help Center.", "elementor"), |
| 23234 |
button: { |
| 23235 |
text: (0, _wordpress_i18n.__)("Learn More", "elementor"), |
| 23236 |
url: "https://go.elementor.com/app-kit-library-error/", |
| 23237 |
target: "_blank" |
| 23238 |
} |
| 23239 |
}), isSuccess && 0 < data.length && queryParams.ready && /*#__PURE__*/ react.default.createElement(KitList, { |
| 23240 |
data, |
| 23241 |
queryParams, |
| 23242 |
source: path |
| 23243 |
}), isSuccess && 0 === data.length && queryParams.ready && renderNoResultsComponent({ |
| 23244 |
defaultComponent: /*#__PURE__*/ react.default.createElement(ErrorScreen, { |
| 23245 |
title: (0, _wordpress_i18n.__)("No results matched your search.", "elementor"), |
| 23246 |
description: (0, _wordpress_i18n.__)("Try different keywords or ", "elementor"), |
| 23247 |
button: { |
| 23248 |
text: (0, _wordpress_i18n.__)("Continue browsing.", "elementor"), |
| 23249 |
action: clearQueryParams, |
| 23250 |
category: path |
| 23251 |
} |
| 23252 |
}), |
| 23253 |
isFilterActive |
| 23254 |
}), /*#__PURE__*/ react.default.createElement(EnvatoPromotion, { category: path }))))); |
| 23255 |
} |
| 23256 |
var import_prop_types$25; |
| 23257 |
var init_index = __esmMin((() => { |
| 23258 |
import_prop_types$25 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23259 |
init_toConsumableArray(); |
| 23260 |
init_slicedToArray(); |
| 23261 |
init_defineProperty$1(); |
| 23262 |
init_content(); |
| 23263 |
init_envato_promotion(); |
| 23264 |
init_error_screen(); |
| 23265 |
init_filter_indication_text(); |
| 23266 |
init_index_header(); |
| 23267 |
init_index_sidebar(); |
| 23268 |
init_kit_list(); |
| 23269 |
init_layout(); |
| 23270 |
init_page_loader(); |
| 23271 |
init_search_input(); |
| 23272 |
init_sort_select(); |
| 23273 |
init_taxonomies_filter(); |
| 23274 |
init_use_kits(); |
| 23275 |
init_use_menu_items(); |
| 23276 |
init_use_page_title(); |
| 23277 |
init_use_taxonomies(); |
| 23278 |
init_last_filter_context(); |
| 23279 |
init_es$1(); |
| 23280 |
init_tracking_context(); |
| 23281 |
init_index$1(); |
| 23282 |
__name(ownKeys$4, "ownKeys"); |
| 23283 |
__name(_objectSpread$3, "_objectSpread"); |
| 23284 |
Index.propTypes = { |
| 23285 |
path: import_prop_types$25.default.string, |
| 23286 |
initialQueryParams: import_prop_types$25.default.object, |
| 23287 |
renderNoResultsComponent: import_prop_types$25.default.func |
| 23288 |
}; |
| 23289 |
})); |
| 23290 |
|
| 23291 |
//#endregion |
| 23292 |
//#region app/modules/kit-library/assets/js/pages/favorites/favorites.js |
| 23293 |
function Favorites(props) { |
| 23294 |
var navigate = useNavigate(); |
| 23295 |
var tracking = useTracking(); |
| 23296 |
(0, react.useEffect)(function() { |
| 23297 |
tracking.trackKitlibFavoriteTab(); |
| 23298 |
}, [tracking]); |
| 23299 |
var indexNotResultsFavorites = /*#__PURE__*/ react.default.createElement(ErrorScreen, { |
| 23300 |
title: (0, _wordpress_i18n.__)("No favorites here yet...", "elementor"), |
| 23301 |
description: (0, _wordpress_i18n.__)("Use the heart icon to save Website Templates that inspire you. You'll be able to find them here.", "elementor"), |
| 23302 |
button: { |
| 23303 |
text: (0, _wordpress_i18n.__)("Continue browsing.", "elementor"), |
| 23304 |
action: function action() { |
| 23305 |
return navigate("/kit-library"); |
| 23306 |
} |
| 23307 |
} |
| 23308 |
}); |
| 23309 |
return /*#__PURE__*/ react.default.createElement(Index, { |
| 23310 |
path: props.path, |
| 23311 |
initialQueryParams: { favorite: true }, |
| 23312 |
renderNoResultsComponent: function renderNoResultsComponent(_ref) { |
| 23313 |
var defaultComponent = _ref.defaultComponent; |
| 23314 |
if (!_ref.isFilterActive) return indexNotResultsFavorites; |
| 23315 |
return defaultComponent; |
| 23316 |
} |
| 23317 |
}); |
| 23318 |
} |
| 23319 |
var import_prop_types$24; |
| 23320 |
var init_favorites = __esmMin((() => { |
| 23321 |
init_index(); |
| 23322 |
init_error_screen(); |
| 23323 |
init_es$1(); |
| 23324 |
import_prop_types$24 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23325 |
init_tracking_context(); |
| 23326 |
Favorites.propTypes = { path: import_prop_types$24.default.string }; |
| 23327 |
})); |
| 23328 |
|
| 23329 |
//#endregion |
| 23330 |
//#region app/modules/kit-library/assets/js/components/kit-list-cloud-item.js |
| 23331 |
var import_prop_types$23, PLACEHOLDER_IMAGE_SRC, PopoverItem, KitActionsPopover, KitListCloudItem, kit_list_cloud_item_default; |
| 23332 |
var init_kit_list_cloud_item = __esmMin((() => { |
| 23333 |
init_slicedToArray(); |
| 23334 |
init_es$1(); |
| 23335 |
import_prop_types$23 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23336 |
init_kit(); |
| 23337 |
init_apps_event_tracking(); |
| 23338 |
init_use_kit$1(); |
| 23339 |
init_tooltip(); |
| 23340 |
init_kit_list_item$1(); |
| 23341 |
PLACEHOLDER_IMAGE_SRC = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQ1IiBoZWlnaHQ9IjMzMCIgdmlld0JveD0iMCAwIDM0NSAzMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIzNDUiIGhlaWdodD0iMzMwIiBmaWxsPSIjRjRGNUY4Ii8+CjxwYXRoIGQ9Ik0xNjQuMjY3IDE2Ny42QzE2Ni40NzIgMTYxLjc2MSAxNzAuMjEzIDE1Ni42MjUgMTc1LjA5NCAxNTIuNzM1QzE3OS45NzUgMTQ4Ljg0NiAxODUuODE2IDE0Ni4zNDYgMTkyIDE0NS41QzE5MS4xNTUgMTUxLjY4NCAxODguNjU0IDE1Ny41MjUgMTg0Ljc2NCAxNjIuNDA2QzE4MC44NzQgMTY3LjI4OCAxNzUuNzM5IDE3MS4wMjggMTY5LjkgMTczLjIzM00xNjkuNDY3IDE1OC41QzE3My42NzcgMTYwLjQ0MyAxNzcuMDU3IDE2My44MjMgMTc5IDE2OC4wMzNNMTUzIDE4NC41VjE3NS44MzNDMTUzIDE3NC4xMTkgMTUzLjUwOCAxNzIuNDQ0IDE1NC40NjEgMTcxLjAxOEMxNTUuNDEzIDE2OS41OTMgMTU2Ljc2NiAxNjguNDgyIDE1OC4zNSAxNjcuODI2QzE1OS45MzQgMTY3LjE3IDE2MS42NzYgMTY2Ljk5OSAxNjMuMzU3IDE2Ny4zMzNDMTY1LjAzOSAxNjcuNjY4IDE2Ni41ODMgMTY4LjQ5MyAxNjcuNzk1IDE2OS43MDVDMTY5LjAwNyAxNzAuOTE3IDE2OS44MzIgMTcyLjQ2MSAxNzAuMTY3IDE3NC4xNDNDMTcwLjUwMSAxNzUuODI0IDE3MC4zMyAxNzcuNTY2IDE2OS42NzQgMTc5LjE1QzE2OS4wMTggMTgwLjczNCAxNjcuOTA3IDE4Mi4wODcgMTY2LjQ4MiAxODMuMDM5QzE2NS4wNTYgMTgzLjk5MiAxNjMuMzgxIDE4NC41IDE2MS42NjcgMTg0LjVIMTUzWiIgc3Ryb2tlPSIjQUJBQkFCIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K"; |
| 23342 |
PopoverItem = function PopoverItem(_ref) { |
| 23343 |
var _ref$className = _ref.className; |
| 23344 |
var className = _ref$className === void 0 ? "" : _ref$className; |
| 23345 |
var icon = _ref.icon; |
| 23346 |
var title = _ref.title; |
| 23347 |
var onClick = _ref.onClick; |
| 23348 |
return /*#__PURE__*/ react.default.createElement("div", { |
| 23349 |
className: "e-kit-library__kit-item-actions-popover-item ".concat(className), |
| 23350 |
role: "button", |
| 23351 |
tabIndex: 0, |
| 23352 |
onClick: function handleClick() { |
| 23353 |
onClick(); |
| 23354 |
}, |
| 23355 |
onKeyDown: function handleKeyDown(event) { |
| 23356 |
if ("Enter" === event.key || " " === event.key) { |
| 23357 |
event.preventDefault(); |
| 23358 |
onClick(); |
| 23359 |
} |
| 23360 |
} |
| 23361 |
}, /*#__PURE__*/ react.default.createElement("i", { className: icon }), /*#__PURE__*/ react.default.createElement("span", null, title)); |
| 23362 |
}; |
| 23363 |
PopoverItem.propTypes = { |
| 23364 |
className: import_prop_types$23.default.string, |
| 23365 |
icon: import_prop_types$23.default.string.isRequired, |
| 23366 |
title: import_prop_types$23.default.string.isRequired, |
| 23367 |
onClick: import_prop_types$23.default.func.isRequired |
| 23368 |
}; |
| 23369 |
KitActionsPopover = function KitActionsPopover(_ref2) { |
| 23370 |
var isOpen = _ref2.isOpen; |
| 23371 |
var onClose = _ref2.onClose; |
| 23372 |
var onDelete = _ref2.onDelete; |
| 23373 |
var _ref2$className = _ref2.className; |
| 23374 |
var className = _ref2$className === void 0 ? "e-kit-library__kit-item-actions-popover" : _ref2$className; |
| 23375 |
if (!isOpen) return null; |
| 23376 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Popover, { |
| 23377 |
className, |
| 23378 |
closeFunction: onClose, |
| 23379 |
arrowPosition: "none" |
| 23380 |
}, /*#__PURE__*/ react.default.createElement(PopoverItem, { |
| 23381 |
className: "e-kit-library__kit-item-actions-popover-item--danger", |
| 23382 |
icon: "eicon-library-delete", |
| 23383 |
title: (0, _wordpress_i18n.__)("Delete", "elementor"), |
| 23384 |
onClick: onDelete |
| 23385 |
})); |
| 23386 |
}; |
| 23387 |
KitActionsPopover.propTypes = { |
| 23388 |
isOpen: import_prop_types$23.default.bool.isRequired, |
| 23389 |
onClose: import_prop_types$23.default.func.isRequired, |
| 23390 |
onDelete: import_prop_types$23.default.func.isRequired, |
| 23391 |
className: import_prop_types$23.default.string |
| 23392 |
}; |
| 23393 |
KitListCloudItem = function KitListCloudItem(props) { |
| 23394 |
var _props$model; |
| 23395 |
var navigate = useNavigate(); |
| 23396 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 23397 |
var isPopoverOpen = _useState2[0]; |
| 23398 |
var setIsPopoverOpen = _useState2[1]; |
| 23399 |
var _useState4 = _slicedToArray((0, react.useState)(false), 2); |
| 23400 |
var imageError = _useState4[0]; |
| 23401 |
var setImageError = _useState4[1]; |
| 23402 |
var isLocked = "locked" === ((_props$model = props.model) === null || _props$model === void 0 ? void 0 : _props$model.status); |
| 23403 |
var imageSrc = !props.model.thumbnailUrl || imageError ? PLACEHOLDER_IMAGE_SRC : props.model.thumbnailUrl; |
| 23404 |
(0, react.useEffect)(function() { |
| 23405 |
setImageError(false); |
| 23406 |
}, [props.model.thumbnailUrl]); |
| 23407 |
return /* @__PURE__ */ react.default.createElement(_elementor_app_ui.Card, { className: "e-kit-library__kit-item ".concat(isLocked ? "e-kit-library__kit-item--locked" : "") }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardHeader, { className: "e-kit-library__kit-item-header" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 23408 |
tag: "h3", |
| 23409 |
title: props.model.title, |
| 23410 |
variant: "h5", |
| 23411 |
className: "eps-card__headline" |
| 23412 |
}, isLocked && /*#__PURE__*/ react.default.createElement(Tooltip$2, { |
| 23413 |
tag: "span", |
| 23414 |
title: (0, _wordpress_i18n.__)("Your library is currently over the new quota. Upgrade your plan within 90 days to keep all website templates", "elementor") |
| 23415 |
}, /*#__PURE__*/ react.default.createElement("i", { |
| 23416 |
className: "eicon-lock e-kit-library__kit-item-lock-icon", |
| 23417 |
"aria-hidden": "true" |
| 23418 |
})), props.model.title), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 23419 |
text: (0, _wordpress_i18n.__)("Actions", "elementor"), |
| 23420 |
hideText: true, |
| 23421 |
icon: "eicon-ellipsis-v", |
| 23422 |
className: "e-kit-library__kit-item-actions-menu", |
| 23423 |
onClick: function onClick(event) { |
| 23424 |
event.stopPropagation(); |
| 23425 |
setIsPopoverOpen(true); |
| 23426 |
} |
| 23427 |
}), /*#__PURE__*/ react.default.createElement(KitActionsPopover, { |
| 23428 |
isOpen: isPopoverOpen, |
| 23429 |
onClose: function onClose() { |
| 23430 |
return setIsPopoverOpen(false); |
| 23431 |
}, |
| 23432 |
onDelete: function handleDelete() { |
| 23433 |
setIsPopoverOpen(false); |
| 23434 |
AppsEventTracking.sendKitCloudLibraryDelete(props.model.id); |
| 23435 |
props.onDelete(); |
| 23436 |
} |
| 23437 |
})), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardBody, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardImage, { |
| 23438 |
alt: props.model.title, |
| 23439 |
src: imageSrc, |
| 23440 |
onError: function handleImageError() { |
| 23441 |
if (props.model.thumbnailUrl && !imageError) setImageError(true); |
| 23442 |
} |
| 23443 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardOverlay, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 23444 |
container: true, |
| 23445 |
direction: "column", |
| 23446 |
className: "e-kit-library__kit-item-cloud-overlay" |
| 23447 |
}, isLocked ? /*#__PURE__*/ react.default.createElement(Tooltip$2, { |
| 23448 |
tag: "span", |
| 23449 |
title: (0, _wordpress_i18n.__)("Your library is currently over the new quota. Upgrade your plan within 90 days to keep all website templates", "elementor") |
| 23450 |
}, /*#__PURE__*/ react.default.createElement("i", { |
| 23451 |
className: "eicon-lock e-kit-library__kit-item-lock-icon", |
| 23452 |
"aria-hidden": "true" |
| 23453 |
})) : /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 23454 |
className: "eps-button e-kit-library__kit-item-cloud-overlay-import-button eps-button--primary eps-button--sm eps-button--contained", |
| 23455 |
text: (0, _wordpress_i18n.__)("Apply", "elementor"), |
| 23456 |
icon: "eicon-library-download", |
| 23457 |
onClick: function onClick() { |
| 23458 |
var _elementorCommon; |
| 23459 |
AppsEventTracking.sendKitCloudLibraryApply(props.model.id); |
| 23460 |
navigate((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.config) !== null && _elementorCommon !== void 0 && _elementorCommon.experimentalFeatures["import-export-customization"] ? "import-customization?referrer=".concat(KIT_SOURCE_MAP.CLOUD, "&id=").concat(props.model.id) : "import?referrer=kit-library&source=".concat(KIT_SOURCE_MAP.CLOUD, "&kit_id=").concat(props.model.id), { replace: true }); |
| 23461 |
} |
| 23462 |
})))))); |
| 23463 |
}; |
| 23464 |
KitListCloudItem.propTypes = { |
| 23465 |
model: import_prop_types$23.default.instanceOf(Kit).isRequired, |
| 23466 |
index: import_prop_types$23.default.number, |
| 23467 |
source: import_prop_types$23.default.string, |
| 23468 |
onDelete: import_prop_types$23.default.func.isRequired |
| 23469 |
}; |
| 23470 |
kit_list_cloud_item_default = react.default.memo(KitListCloudItem); |
| 23471 |
})); |
| 23472 |
|
| 23473 |
//#endregion |
| 23474 |
//#region app/modules/kit-library/assets/js/hooks/use-cloud-kits.js |
| 23475 |
function ownKeys$3(e, r) { |
| 23476 |
var t = Object.keys(e); |
| 23477 |
if (Object.getOwnPropertySymbols) { |
| 23478 |
var o = Object.getOwnPropertySymbols(e); |
| 23479 |
r && (o = o.filter(function(r) { |
| 23480 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 23481 |
})), t.push.apply(t, o); |
| 23482 |
} |
| 23483 |
return t; |
| 23484 |
} |
| 23485 |
function _objectSpread$2(e) { |
| 23486 |
for (var r = 1; r < arguments.length; r++) { |
| 23487 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 23488 |
r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) { |
| 23489 |
_defineProperty$1(e, r, t[r]); |
| 23490 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) { |
| 23491 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 23492 |
}); |
| 23493 |
} |
| 23494 |
return e; |
| 23495 |
} |
| 23496 |
/** |
| 23497 |
* Fetch kits |
| 23498 |
* |
| 23499 |
* @return {*} kits |
| 23500 |
*/ |
| 23501 |
function fetchKits() { |
| 23502 |
return $e.data.get("cloud-kits/index", {}, { refresh: true }).then(function(response) { |
| 23503 |
return response.data; |
| 23504 |
}).then(function(_ref) { |
| 23505 |
return _ref.data.map(function(item) { |
| 23506 |
return Kit.createFromResponse(item); |
| 23507 |
}); |
| 23508 |
}); |
| 23509 |
} |
| 23510 |
/** |
| 23511 |
* Main function. |
| 23512 |
* |
| 23513 |
* @param {*} initialQueryParams |
| 23514 |
* @return {Object} query |
| 23515 |
*/ |
| 23516 |
function useCloudKits() { |
| 23517 |
var initialQueryParams = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; |
| 23518 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 23519 |
var force = _useState2[0]; |
| 23520 |
var setForce = _useState2[1]; |
| 23521 |
var _useState4 = _slicedToArray((0, react.useState)(function() { |
| 23522 |
return _objectSpread$2(_objectSpread$2({ ready: false }, defaultQueryParams), initialQueryParams); |
| 23523 |
}), 2); |
| 23524 |
var queryParams = _useState4[0]; |
| 23525 |
var setQueryParams = _useState4[1]; |
| 23526 |
var forceRefetch = (0, react.useCallback)(function() { |
| 23527 |
return setForce(true); |
| 23528 |
}, [setForce]); |
| 23529 |
var clearQueryParams = (0, react.useCallback)(function() { |
| 23530 |
return setQueryParams(_objectSpread$2(_objectSpread$2({ ready: true }, defaultQueryParams), initialQueryParams)); |
| 23531 |
}, [setQueryParams]); |
| 23532 |
var query = useQuery([KEY$2], function() { |
| 23533 |
return fetchKits(force); |
| 23534 |
}); |
| 23535 |
var data = (0, react.useMemo)(function() { |
| 23536 |
return !query.data ? [] : pipe.apply(void 0, _toConsumableArray(Object.values(kitsPipeFunctions)))(_toConsumableArray(query.data), queryParams); |
| 23537 |
}, [query.data, queryParams]); |
| 23538 |
var isFilterActive = (0, react.useMemo)(function() { |
| 23539 |
return !!queryParams.search; |
| 23540 |
}, [queryParams]); |
| 23541 |
(0, react.useEffect)(function() { |
| 23542 |
if (!force) return; |
| 23543 |
query.refetch().then(function() { |
| 23544 |
return setForce(false); |
| 23545 |
}); |
| 23546 |
}, [force]); |
| 23547 |
return _objectSpread$2(_objectSpread$2({}, query), {}, { |
| 23548 |
data, |
| 23549 |
queryParams, |
| 23550 |
setQueryParams, |
| 23551 |
clearQueryParams, |
| 23552 |
forceRefetch, |
| 23553 |
isFilterActive |
| 23554 |
}); |
| 23555 |
} |
| 23556 |
var KEY$2, defaultQueryParams, kitsPipeFunctions; |
| 23557 |
var init_use_cloud_kits = __esmMin((() => { |
| 23558 |
init_toConsumableArray(); |
| 23559 |
init_defineProperty$1(); |
| 23560 |
init_slicedToArray(); |
| 23561 |
init_kit(); |
| 23562 |
init_es(); |
| 23563 |
init_utils$1(); |
| 23564 |
__name(ownKeys$3, "ownKeys"); |
| 23565 |
__name(_objectSpread$2, "_objectSpread"); |
| 23566 |
KEY$2 = "cloud-kits"; |
| 23567 |
defaultQueryParams = { |
| 23568 |
search: "", |
| 23569 |
referrer: null |
| 23570 |
}; |
| 23571 |
kitsPipeFunctions = { |
| 23572 |
/** |
| 23573 |
* Filter by search term. |
| 23574 |
* |
| 23575 |
* @param {Array<*>} data |
| 23576 |
* @param {*} queryParams |
| 23577 |
* @return {Array} filtered data |
| 23578 |
*/ |
| 23579 |
searchFilter: function searchFilter(data, queryParams) { |
| 23580 |
if (!queryParams.search) return data; |
| 23581 |
return data.filter(function(item) { |
| 23582 |
var keywords = [item.title]; |
| 23583 |
var searchTerm = queryParams.search.toLowerCase(); |
| 23584 |
return keywords.some(function(keyword) { |
| 23585 |
return keyword.toLowerCase().includes(searchTerm); |
| 23586 |
}); |
| 23587 |
}); |
| 23588 |
} }; |
| 23589 |
})); |
| 23590 |
|
| 23591 |
//#endregion |
| 23592 |
//#region app/assets/js/hooks/use-cloud-kits-quota.js |
| 23593 |
/** |
| 23594 |
* Hook to fetch cloud kits quota data |
| 23595 |
* |
| 23596 |
* @param {Object} options - React Query options |
| 23597 |
* @return {Object} Query result with quota data |
| 23598 |
*/ |
| 23599 |
function useCloudKitsQuota() { |
| 23600 |
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; |
| 23601 |
return useQuery([KEY$1], fetchCloudKitsQuota, options); |
| 23602 |
} |
| 23603 |
var KEY$1; |
| 23604 |
var init_use_cloud_kits_quota = __esmMin((() => { |
| 23605 |
init_es(); |
| 23606 |
init_cloud_kits(); |
| 23607 |
KEY$1 = "cloud-kits-quota"; |
| 23608 |
})); |
| 23609 |
|
| 23610 |
//#endregion |
| 23611 |
//#region app/modules/kit-library/assets/js/hooks/use-kit-cloud-mutation.js |
| 23612 |
function useKitCloudMutations() { |
| 23613 |
var queryClient = useQueryClient(); |
| 23614 |
var remove = useMutation(function(id) { |
| 23615 |
return $e.data.delete("cloud-kits/index", { id }); |
| 23616 |
}, { onSuccess: function onSuccess() { |
| 23617 |
queryClient.invalidateQueries(KEY$2); |
| 23618 |
queryClient.invalidateQueries(KEY$1); |
| 23619 |
} }); |
| 23620 |
return { |
| 23621 |
remove, |
| 23622 |
isLoading: remove.isLoading |
| 23623 |
}; |
| 23624 |
} |
| 23625 |
var init_use_kit_cloud_mutation = __esmMin((() => { |
| 23626 |
init_es(); |
| 23627 |
init_use_cloud_kits(); |
| 23628 |
init_use_cloud_kits_quota(); |
| 23629 |
})); |
| 23630 |
|
| 23631 |
//#endregion |
| 23632 |
//#region app/modules/kit-library/assets/js/components/kit-cloud-delete-dialog.js |
| 23633 |
function KitCloudDeleteDialog(_ref) { |
| 23634 |
var kit = _ref.kit; |
| 23635 |
var show = _ref.show; |
| 23636 |
var onCancelClick = _ref.onCancelClick; |
| 23637 |
var onDeleteClick = _ref.onDeleteClick; |
| 23638 |
var isLoading = _ref.isLoading; |
| 23639 |
if (!kit || !show) return null; |
| 23640 |
var handleDeleteClick = function handleDeleteClick() { |
| 23641 |
if (!isLoading) onDeleteClick(); |
| 23642 |
}; |
| 23643 |
var handleCancelClick = function handleCancelClick() { |
| 23644 |
if (!isLoading) onCancelClick(); |
| 23645 |
}; |
| 23646 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Dialog, { |
| 23647 |
title: (0, _wordpress_i18n.__)("Delete this Website Template?", "elementor"), |
| 23648 |
text: (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("Removing \"%s\" will permanently delete this website template from your library.", "elementor"), (kit === null || kit === void 0 ? void 0 : kit.title) || ""), |
| 23649 |
onClose: handleCancelClick, |
| 23650 |
dismissButtonText: (0, _wordpress_i18n.__)("Cancel", "elementor"), |
| 23651 |
dismissButtonOnClick: handleCancelClick, |
| 23652 |
approveButtonText: isLoading ? "" : (0, _wordpress_i18n.__)("Delete", "elementor"), |
| 23653 |
approveButtonOnClick: handleDeleteClick, |
| 23654 |
approveButtonColor: "danger" |
| 23655 |
}); |
| 23656 |
} |
| 23657 |
var import_prop_types$22; |
| 23658 |
var init_kit_cloud_delete_dialog = __esmMin((() => { |
| 23659 |
import_prop_types$22 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23660 |
KitCloudDeleteDialog.propTypes = { |
| 23661 |
onDeleteClick: import_prop_types$22.default.func.isRequired, |
| 23662 |
onCancelClick: import_prop_types$22.default.func.isRequired, |
| 23663 |
show: import_prop_types$22.default.bool.isRequired, |
| 23664 |
isLoading: import_prop_types$22.default.bool.isRequired, |
| 23665 |
kit: import_prop_types$22.default.shape({ |
| 23666 |
id: import_prop_types$22.default.string, |
| 23667 |
title: import_prop_types$22.default.string |
| 23668 |
}) |
| 23669 |
}; |
| 23670 |
})); |
| 23671 |
|
| 23672 |
//#endregion |
| 23673 |
//#region app/modules/kit-library/assets/js/components/kit-list-cloud.js |
| 23674 |
function KitListCloud(props) { |
| 23675 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 23676 |
var isDeleteModalOpen = _useState2[0]; |
| 23677 |
var setIsDeleteModalOpen = _useState2[1]; |
| 23678 |
var _useKitCloudMutations = useKitCloudMutations(); |
| 23679 |
var remove = _useKitCloudMutations.remove; |
| 23680 |
var isLoading = _useKitCloudMutations.isLoading; |
| 23681 |
var _useState4 = _slicedToArray((0, react.useState)(), 2); |
| 23682 |
var kit = _useState4[0]; |
| 23683 |
var setKit = _useState4[1]; |
| 23684 |
var resetKit = (0, react.useCallback)(function() { |
| 23685 |
setKit(null); |
| 23686 |
setIsDeleteModalOpen(false); |
| 23687 |
}, []); |
| 23688 |
var handleDelete = (0, react.useCallback)(/*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { |
| 23689 |
return import_regenerator.default.wrap(function(_context) { |
| 23690 |
while (1) switch (_context.prev = _context.next) { |
| 23691 |
case 0: |
| 23692 |
_context.prev = 0; |
| 23693 |
_context.next = 1; |
| 23694 |
return remove.mutate(kit.id); |
| 23695 |
case 1: |
| 23696 |
_context.prev = 1; |
| 23697 |
resetKit(); |
| 23698 |
return _context.finish(1); |
| 23699 |
case 2: |
| 23700 |
case "end": return _context.stop(); |
| 23701 |
} |
| 23702 |
}, _callee, null, [[ |
| 23703 |
0, |
| 23704 |
, |
| 23705 |
1, |
| 23706 |
2 |
| 23707 |
]]); |
| 23708 |
})), [ |
| 23709 |
kit, |
| 23710 |
remove, |
| 23711 |
resetKit |
| 23712 |
]); |
| 23713 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CssGrid, { |
| 23714 |
spacing: 24, |
| 23715 |
colMinWidth: 290 |
| 23716 |
}, /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, props.data.map(function(model, index) { |
| 23717 |
return /*#__PURE__*/ react.default.createElement(kit_list_cloud_item_default, { |
| 23718 |
key: model.id, |
| 23719 |
model, |
| 23720 |
index, |
| 23721 |
source: props.source, |
| 23722 |
onDelete: function onDelete() { |
| 23723 |
setKit(model); |
| 23724 |
setIsDeleteModalOpen(true); |
| 23725 |
} |
| 23726 |
}); |
| 23727 |
})), /*#__PURE__*/ react.default.createElement(KitCloudDeleteDialog, { |
| 23728 |
kit, |
| 23729 |
show: isDeleteModalOpen, |
| 23730 |
onDeleteClick: handleDelete, |
| 23731 |
onCancelClick: resetKit, |
| 23732 |
isLoading |
| 23733 |
})); |
| 23734 |
} |
| 23735 |
var import_prop_types$21, import_regenerator; |
| 23736 |
var init_kit_list_cloud = __esmMin((() => { |
| 23737 |
import_prop_types$21 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23738 |
init_asyncToGenerator(); |
| 23739 |
init_slicedToArray(); |
| 23740 |
import_regenerator = /* @__PURE__ */ __toESM(require_regenerator()); |
| 23741 |
init_kit(); |
| 23742 |
init_kit_list_cloud_item(); |
| 23743 |
init_use_kit_cloud_mutation(); |
| 23744 |
init_kit_cloud_delete_dialog(); |
| 23745 |
KitListCloud.propTypes = { |
| 23746 |
data: import_prop_types$21.default.arrayOf(import_prop_types$21.default.instanceOf(Kit)), |
| 23747 |
source: import_prop_types$21.default.string |
| 23748 |
}; |
| 23749 |
})); |
| 23750 |
|
| 23751 |
//#endregion |
| 23752 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/quota-bar.scss |
| 23753 |
var init_quota_bar$1 = __esmMin((() => {})); |
| 23754 |
|
| 23755 |
//#endregion |
| 23756 |
//#region app/modules/kit-library/assets/js/components/quota-bar.js |
| 23757 |
function QuotaBar(_ref) { |
| 23758 |
var _ref$used = _ref.used; |
| 23759 |
var used = _ref$used === void 0 ? 0 : _ref$used; |
| 23760 |
var _ref$total = _ref.total; |
| 23761 |
var total = _ref$total === void 0 ? 15 : _ref$total; |
| 23762 |
var _ref$unit = _ref.unit; |
| 23763 |
var unit = _ref$unit === void 0 ? "GB" : _ref$unit; |
| 23764 |
var _ref$label = _ref.label; |
| 23765 |
var label = _ref$label === void 0 ? "Storage" : _ref$label; |
| 23766 |
var displayValues = formatDisplayValues(used, total, unit); |
| 23767 |
var usagePercentage = total > 0 ? Math.min(used / total * 100, 100) : 0; |
| 23768 |
var getUsageState = function getUsageState() { |
| 23769 |
if (0 === usagePercentage) return "empty"; |
| 23770 |
if (usagePercentage >= 100) return "alert"; |
| 23771 |
if (usagePercentage >= 80) return "warning"; |
| 23772 |
return "normal"; |
| 23773 |
}; |
| 23774 |
return /*#__PURE__*/ react.default.createElement("div", { className: QUOTA_BAR_CLASSNAME }, /*#__PURE__*/ react.default.createElement("div", { className: "".concat(QUOTA_BAR_CLASSNAME, "__container") }, /*#__PURE__*/ react.default.createElement("div", { className: "".concat(QUOTA_BAR_CLASSNAME, "__header") }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 23775 |
className: "".concat(QUOTA_BAR_CLASSNAME, "__label"), |
| 23776 |
variant: "xs", |
| 23777 |
tag: "span" |
| 23778 |
}, function getUsageText() { |
| 23779 |
var state = getUsageState(); |
| 23780 |
if ("warning" === state || "alert" === state) return "".concat(label, ": ").concat(Math.round(usagePercentage), "%"); |
| 23781 |
return label; |
| 23782 |
}()), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 23783 |
className: "".concat(QUOTA_BAR_CLASSNAME, "__count"), |
| 23784 |
variant: "xs", |
| 23785 |
tag: "span" |
| 23786 |
}, displayValues.used, " ", displayValues.usedUnit, " ", (0, _wordpress_i18n.__)("of", "elementor"), " ", displayValues.total, " ", displayValues.totalUnit)), /*#__PURE__*/ react.default.createElement("div", { className: function getProgressContainerClass() { |
| 23787 |
var state = getUsageState(); |
| 23788 |
return "".concat(QUOTA_BAR_CLASSNAME, "__progress-container ").concat(QUOTA_BAR_CLASSNAME, "__progress-container--").concat(state); |
| 23789 |
}() }, /*#__PURE__*/ react.default.createElement("div", { |
| 23790 |
className: function getProgressBarClass() { |
| 23791 |
var state = getUsageState(); |
| 23792 |
return "".concat(QUOTA_BAR_CLASSNAME, "__progress-bar ").concat(QUOTA_BAR_CLASSNAME, "__progress-bar--").concat(state); |
| 23793 |
}(), |
| 23794 |
style: { width: "".concat(usagePercentage, "%") } |
| 23795 |
})), function shouldShowUpgradeMessage() { |
| 23796 |
var state = getUsageState(); |
| 23797 |
return "warning" === state || "alert" === state; |
| 23798 |
}() && /*#__PURE__*/ react.default.createElement("div", { className: "".concat(QUOTA_BAR_CLASSNAME, "__upgrade-message") }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 23799 |
variant: "xs", |
| 23800 |
tag: "span" |
| 23801 |
}, (0, _wordpress_i18n.__)("To get more space", "elementor")), /*#__PURE__*/ react.default.createElement("a", { |
| 23802 |
className: "".concat(QUOTA_BAR_CLASSNAME, "__upgrade-link"), |
| 23803 |
href: "https://go.elementor.com/go-pro-cloud-website-templates-library-advanced/", |
| 23804 |
target: "_blank", |
| 23805 |
rel: "noopener noreferrer" |
| 23806 |
}, (0, _wordpress_i18n.__)("Upgrade now", "elementor"))))); |
| 23807 |
} |
| 23808 |
var import_prop_types$20, QUOTA_BAR_CLASSNAME, BYTES_TO_GB, BYTES_TO_MB, convertBytesToGB, convertBytesToMB, formatDisplayValues; |
| 23809 |
var init_quota_bar = __esmMin((() => { |
| 23810 |
import_prop_types$20 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23811 |
init_quota_bar$1(); |
| 23812 |
QUOTA_BAR_CLASSNAME = "e-kit-library__quota-bar"; |
| 23813 |
BYTES_TO_GB = 1024 * 1024 * 1024; |
| 23814 |
BYTES_TO_MB = 1024 * 1024; |
| 23815 |
convertBytesToGB = function convertBytesToGB(bytes) { |
| 23816 |
return Math.round(bytes / BYTES_TO_GB * 100) / 100; |
| 23817 |
}; |
| 23818 |
convertBytesToMB = function convertBytesToMB(bytes) { |
| 23819 |
return Math.round(bytes / BYTES_TO_MB * 100) / 100; |
| 23820 |
}; |
| 23821 |
formatDisplayValues = function formatDisplayValues(used, total, unit) { |
| 23822 |
if ("B" === unit) { |
| 23823 |
var totalInGB = convertBytesToGB(total); |
| 23824 |
var usedInGB = convertBytesToGB(used); |
| 23825 |
var usedInMB = convertBytesToMB(used); |
| 23826 |
if (used === total) return { |
| 23827 |
used: usedInGB, |
| 23828 |
usedUnit: "GB", |
| 23829 |
total: totalInGB, |
| 23830 |
totalUnit: "GB" |
| 23831 |
}; |
| 23832 |
if (usedInGB < 1) return { |
| 23833 |
used: usedInMB, |
| 23834 |
usedUnit: "MB", |
| 23835 |
total: totalInGB, |
| 23836 |
totalUnit: "GB" |
| 23837 |
}; |
| 23838 |
return { |
| 23839 |
used: usedInGB, |
| 23840 |
usedUnit: "GB", |
| 23841 |
total: totalInGB, |
| 23842 |
totalUnit: "GB" |
| 23843 |
}; |
| 23844 |
} |
| 23845 |
return { |
| 23846 |
used, |
| 23847 |
usedUnit: unit, |
| 23848 |
total, |
| 23849 |
totalUnit: unit |
| 23850 |
}; |
| 23851 |
}; |
| 23852 |
QuotaBar.propTypes = { |
| 23853 |
used: import_prop_types$20.default.number, |
| 23854 |
total: import_prop_types$20.default.number, |
| 23855 |
unit: import_prop_types$20.default.string, |
| 23856 |
label: import_prop_types$20.default.string |
| 23857 |
}; |
| 23858 |
})); |
| 23859 |
|
| 23860 |
//#endregion |
| 23861 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/quota-notification.scss |
| 23862 |
var init_quota_notification$1 = __esmMin((() => {})); |
| 23863 |
|
| 23864 |
//#endregion |
| 23865 |
//#region app/modules/kit-library/assets/js/components/quota-notification.js |
| 23866 |
function QuotaNotification(_ref) { |
| 23867 |
var usagePercentage = _ref.usagePercentage; |
| 23868 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 23869 |
var isDismissed = _useState2[0]; |
| 23870 |
var setIsDismissed = _useState2[1]; |
| 23871 |
var handleDismiss = function handleDismiss() { |
| 23872 |
setIsDismissed(true); |
| 23873 |
}; |
| 23874 |
var getNotificationState = function getNotificationState() { |
| 23875 |
if (usagePercentage >= 100) return "alert"; |
| 23876 |
if (usagePercentage >= 80) return "warning"; |
| 23877 |
return null; |
| 23878 |
}; |
| 23879 |
var getNotificationContent = function getNotificationContent() { |
| 23880 |
var state = getNotificationState(); |
| 23881 |
if ("alert" === state) return { |
| 23882 |
icon: "eicon-alert", |
| 23883 |
message: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement("strong", null, (0, _wordpress_i18n.__)("Website template storage is full.", "elementor")), " ", (0, _wordpress_i18n.__)("Get more space ", "elementor")), |
| 23884 |
actions: [{ |
| 23885 |
text: (0, _wordpress_i18n.__)("Upgrade now", "elementor"), |
| 23886 |
href: "https://go.elementor.com/go-pro-cloud-website-templates-library-advanced/", |
| 23887 |
type: "link" |
| 23888 |
}] |
| 23889 |
}; |
| 23890 |
if ("warning" === state) return { |
| 23891 |
icon: "eicon-warning-full", |
| 23892 |
message: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement("strong", null, (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("Website template storage is %1$s%% full.", "elementor"), Math.round(usagePercentage))), " ", (0, _wordpress_i18n.__)("Get more space ", "elementor")), |
| 23893 |
actions: [{ |
| 23894 |
text: (0, _wordpress_i18n.__)("Upgrade now", "elementor"), |
| 23895 |
href: "https://go.elementor.com/go-pro-cloud-website-templates-library-advanced/", |
| 23896 |
type: "link" |
| 23897 |
}] |
| 23898 |
}; |
| 23899 |
return null; |
| 23900 |
}; |
| 23901 |
var state = getNotificationState(); |
| 23902 |
var content = getNotificationContent(); |
| 23903 |
if (!state || !content || isDismissed) return null; |
| 23904 |
return /*#__PURE__*/ react.default.createElement("div", { className: "".concat(QUOTA_NOTIFICATION_CLASSNAME, " ").concat(QUOTA_NOTIFICATION_CLASSNAME, "--").concat(state) }, /*#__PURE__*/ react.default.createElement("div", { className: "".concat(QUOTA_NOTIFICATION_CLASSNAME, "__content") }, /*#__PURE__*/ react.default.createElement("i", { className: "".concat(QUOTA_NOTIFICATION_CLASSNAME, "__icon ").concat(content.icon) }), /*#__PURE__*/ react.default.createElement("div", { className: "".concat(QUOTA_NOTIFICATION_CLASSNAME, "__message") }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { tag: "span" }, content.message), content.actions.map(function(action, index) { |
| 23905 |
return /*#__PURE__*/ react.default.createElement("span", { key: index }, index > 0 && /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { tag: "span" }, " ", (0, _wordpress_i18n.__)("or", "elementor"), " "), /*#__PURE__*/ react.default.createElement("a", { |
| 23906 |
className: "".concat(QUOTA_NOTIFICATION_CLASSNAME, "__action-link"), |
| 23907 |
href: action.href, |
| 23908 |
target: "_blank", |
| 23909 |
rel: "noopener noreferrer" |
| 23910 |
}, action.text)); |
| 23911 |
}))), /*#__PURE__*/ react.default.createElement("button", { |
| 23912 |
className: "".concat(QUOTA_NOTIFICATION_CLASSNAME, "__dismiss"), |
| 23913 |
onClick: handleDismiss, |
| 23914 |
"aria-label": (0, _wordpress_i18n.__)("Dismiss notification", "elementor") |
| 23915 |
}, /*#__PURE__*/ react.default.createElement("i", { className: "eicon-close" }))); |
| 23916 |
} |
| 23917 |
var import_prop_types$19, QUOTA_NOTIFICATION_CLASSNAME; |
| 23918 |
var init_quota_notification = __esmMin((() => { |
| 23919 |
init_slicedToArray(); |
| 23920 |
import_prop_types$19 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 23921 |
init_quota_notification$1(); |
| 23922 |
QUOTA_NOTIFICATION_CLASSNAME = "e-kit-library__quota-notification"; |
| 23923 |
QuotaNotification.propTypes = { usagePercentage: import_prop_types$19.default.number.isRequired }; |
| 23924 |
})); |
| 23925 |
|
| 23926 |
//#endregion |
| 23927 |
//#region app/modules/kit-library/assets/js/pages/cloud/connect-screen.js |
| 23928 |
function ConnectScreen(_ref) { |
| 23929 |
var _elementorAppConfig; |
| 23930 |
var _elementorAppConfig2; |
| 23931 |
var _elementorAppConfig3; |
| 23932 |
var _elementorAppConfig4; |
| 23933 |
var onConnectSuccess = _ref.onConnectSuccess; |
| 23934 |
var onConnectError = _ref.onConnectError; |
| 23935 |
var menuItems = _ref.menuItems; |
| 23936 |
var forceRefetch = _ref.forceRefetch; |
| 23937 |
var isFetching = _ref.isFetching; |
| 23938 |
var connectButtonRef = (0, react.useRef)(); |
| 23939 |
(0, react.useEffect)(function() { |
| 23940 |
if (!connectButtonRef.current) return; |
| 23941 |
jQuery(connectButtonRef.current).elementorConnect({ |
| 23942 |
popup: { |
| 23943 |
width: 600, |
| 23944 |
height: 700 |
| 23945 |
}, |
| 23946 |
success: function success(_event, data) { |
| 23947 |
var isTrackingOptedInConnect = data.tracking_opted_in && elementorCommon.config.editor_events; |
| 23948 |
elementorCommon.config.library_connect.is_connected = true; |
| 23949 |
elementorCommon.config.library_connect.current_access_level = data.kits_access_level || data.access_level || 0; |
| 23950 |
elementorCommon.config.library_connect.current_access_tier = data.access_tier; |
| 23951 |
elementorCommon.config.library_connect.plan_type = data.plan_type; |
| 23952 |
if (isTrackingOptedInConnect) elementorCommon.config.editor_events.can_send_events = true; |
| 23953 |
onConnectSuccess === null || onConnectSuccess === void 0 || onConnectSuccess(); |
| 23954 |
}, |
| 23955 |
error: function error() { |
| 23956 |
elementorCommon.config.library_connect.is_connected = false; |
| 23957 |
elementorCommon.config.library_connect.current_access_level = 0; |
| 23958 |
elementorCommon.config.library_connect.current_access_tier = ""; |
| 23959 |
elementorCommon.config.library_connect.plan_type = TIERS.free; |
| 23960 |
onConnectError === null || onConnectError === void 0 || onConnectError(); |
| 23961 |
} |
| 23962 |
}); |
| 23963 |
}, [onConnectSuccess, onConnectError]); |
| 23964 |
(0, react.useEffect)(function() { |
| 23965 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.cloudKitLibraryConnect); |
| 23966 |
}, []); |
| 23967 |
return /*#__PURE__*/ react.default.createElement(Index$1, { |
| 23968 |
sidebar: /*#__PURE__*/ react.default.createElement(IndexSidebar, { menuItems }), |
| 23969 |
header: /*#__PURE__*/ react.default.createElement(IndexHeader, { |
| 23970 |
refetch: function refetch() { |
| 23971 |
forceRefetch(); |
| 23972 |
}, |
| 23973 |
isFetching |
| 23974 |
}) |
| 23975 |
}, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__index-layout-container" }, /*#__PURE__*/ react.default.createElement(Content, { className: "e-kit-library__index-layout-main e-kit-library__connect-container" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 23976 |
container: true, |
| 23977 |
alignItems: "center", |
| 23978 |
justify: "center", |
| 23979 |
direction: "column", |
| 23980 |
className: "e-kit-library__error-screen" |
| 23981 |
}, /*#__PURE__*/ react.default.createElement("i", { |
| 23982 |
className: "eicon-library-cloud-connect", |
| 23983 |
"aria-hidden": "true" |
| 23984 |
}), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 23985 |
tag: "h3", |
| 23986 |
variant: "display-1", |
| 23987 |
className: "e-kit-library__error-screen-title" |
| 23988 |
}, (_elementorAppConfig = elementorAppConfig) === null || _elementorAppConfig === void 0 || (_elementorAppConfig = _elementorAppConfig["cloud-library"]) === null || _elementorAppConfig === void 0 ? void 0 : _elementorAppConfig.library_connect_title_copy), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 23989 |
variant: "xl", |
| 23990 |
className: "e-kit-library__error-screen-description" |
| 23991 |
}, (_elementorAppConfig2 = elementorAppConfig) === null || _elementorAppConfig2 === void 0 || (_elementorAppConfig2 = _elementorAppConfig2["cloud-library"]) === null || _elementorAppConfig2 === void 0 || (_elementorAppConfig2 = _elementorAppConfig2.library_connect_sub_title_copy) === null || _elementorAppConfig2 === void 0 ? void 0 : _elementorAppConfig2.replace(/<br\s*\/?>/gi, "\n")), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 23992 |
elRef: connectButtonRef, |
| 23993 |
text: (_elementorAppConfig3 = elementorAppConfig) === null || _elementorAppConfig3 === void 0 || (_elementorAppConfig3 = _elementorAppConfig3["cloud-library"]) === null || _elementorAppConfig3 === void 0 || (_elementorAppConfig3 = _elementorAppConfig3.library_connect_button_copy) === null || _elementorAppConfig3 === void 0 ? void 0 : _elementorAppConfig3.replace(/&/g, "&"), |
| 23994 |
url: (_elementorAppConfig4 = elementorAppConfig) === null || _elementorAppConfig4 === void 0 || (_elementorAppConfig4 = _elementorAppConfig4["cloud-library"]) === null || _elementorAppConfig4 === void 0 || (_elementorAppConfig4 = _elementorAppConfig4.library_connect_url) === null || _elementorAppConfig4 === void 0 ? void 0 : _elementorAppConfig4.replace(/&/g, "&"), |
| 23995 |
className: "e-kit-library__connect-button" |
| 23996 |
}))))); |
| 23997 |
} |
| 23998 |
var import_prop_types$18; |
| 23999 |
var init_connect_screen = __esmMin((() => { |
| 24000 |
import_prop_types$18 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24001 |
init_content(); |
| 24002 |
init_index_header(); |
| 24003 |
init_index_sidebar(); |
| 24004 |
init_layout(); |
| 24005 |
init_apps_event_tracking(); |
| 24006 |
init_tiers(); |
| 24007 |
ConnectScreen.propTypes = { |
| 24008 |
onConnectSuccess: import_prop_types$18.default.func, |
| 24009 |
onConnectError: import_prop_types$18.default.func, |
| 24010 |
menuItems: import_prop_types$18.default.array.isRequired, |
| 24011 |
forceRefetch: import_prop_types$18.default.func.isRequired, |
| 24012 |
isFetching: import_prop_types$18.default.bool.isRequired |
| 24013 |
}; |
| 24014 |
})); |
| 24015 |
|
| 24016 |
//#endregion |
| 24017 |
//#region app/modules/kit-library/assets/js/pages/cloud/upgrade-message.js |
| 24018 |
function UpgradeMessage(_ref) { |
| 24019 |
var hasSubscription = _ref.hasSubscription; |
| 24020 |
var showPlanUpgradeMessage = !_ref.isCloudKitsAvailable && hasSubscription; |
| 24021 |
var content = (0, react.useMemo)(function() { |
| 24022 |
return showPlanUpgradeMessage ? { |
| 24023 |
heading: (0, _wordpress_i18n.__)("Access Website Templates with a plan upgrade", "elementor"), |
| 24024 |
description: (0, _wordpress_i18n.__)("Your current plan doesn't include saving and importing Website Templates. Upgrade to the Advanced plan or higher to use this feature.", "elementor"), |
| 24025 |
buttonText: (0, _wordpress_i18n.__)("Compare plans", "elementor"), |
| 24026 |
url: UPGRADE_URLS.ADVANCED_PLAN |
| 24027 |
} : { |
| 24028 |
heading: (0, _wordpress_i18n.__)("It's time to level up", "elementor"), |
| 24029 |
description: (0, _wordpress_i18n.__)("Upgrade to Elementor Pro to import your own website template and save templates that you can reuse on any of your connected websites.", "elementor"), |
| 24030 |
buttonText: (0, _wordpress_i18n.__)("Upgrade now", "elementor"), |
| 24031 |
url: UPGRADE_URLS.GO_PRO |
| 24032 |
}; |
| 24033 |
}, [showPlanUpgradeMessage]); |
| 24034 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 24035 |
container: true, |
| 24036 |
alignItems: "center", |
| 24037 |
justify: "center", |
| 24038 |
direction: "column", |
| 24039 |
className: "e-kit-library__error-screen" |
| 24040 |
}, /*#__PURE__*/ react.default.createElement("i", { |
| 24041 |
className: "eicon-library-subscription-upgrade", |
| 24042 |
"aria-hidden": "true" |
| 24043 |
}), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 24044 |
tag: "h3", |
| 24045 |
variant: "display-1", |
| 24046 |
className: "e-kit-library__error-screen-title" |
| 24047 |
}, content.heading), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 24048 |
variant: "xl", |
| 24049 |
className: "e-kit-library__error-screen-description" |
| 24050 |
}, content.description), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 24051 |
text: content.buttonText, |
| 24052 |
url: content.url, |
| 24053 |
onClick: function onClick() { |
| 24054 |
AppsEventTracking.sendKitsCloudUpgradeClicked(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.cloudKitLibrary); |
| 24055 |
}, |
| 24056 |
target: "_blank", |
| 24057 |
className: "e-kit-library__upgrade-button" |
| 24058 |
})); |
| 24059 |
} |
| 24060 |
var import_prop_types$17, UPGRADE_URLS; |
| 24061 |
var init_upgrade_message = __esmMin((() => { |
| 24062 |
import_prop_types$17 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24063 |
init_apps_event_tracking(); |
| 24064 |
UPGRADE_URLS = { |
| 24065 |
ADVANCED_PLAN: "https://go.elementor.com/go-pro-cloud-website-templates-library-advanced/", |
| 24066 |
GO_PRO: "https://go.elementor.com/go-pro-cloud-website-templates-library/" |
| 24067 |
}; |
| 24068 |
UpgradeMessage.propTypes = { |
| 24069 |
hasSubscription: import_prop_types$17.default.bool.isRequired, |
| 24070 |
isCloudKitsAvailable: import_prop_types$17.default.bool.isRequired |
| 24071 |
}; |
| 24072 |
})); |
| 24073 |
|
| 24074 |
//#endregion |
| 24075 |
//#region app/modules/kit-library/assets/js/pages/cloud/upgrade-screen.js |
| 24076 |
function UpgradeScreen(_ref) { |
| 24077 |
var _cloudKitsData$is_eli; |
| 24078 |
var menuItems = _ref.menuItems; |
| 24079 |
var forceRefetch = _ref.forceRefetch; |
| 24080 |
var isFetching = _ref.isFetching; |
| 24081 |
var cloudKitsData = _ref.cloudKitsData; |
| 24082 |
var hasSubscription = "" !== (cloudKitsData === null || cloudKitsData === void 0 ? void 0 : cloudKitsData.subscription_id); |
| 24083 |
var isCloudKitsAvailable = (_cloudKitsData$is_eli = cloudKitsData === null || cloudKitsData === void 0 ? void 0 : cloudKitsData.is_eligible) !== null && _cloudKitsData$is_eli !== void 0 ? _cloudKitsData$is_eli : false; |
| 24084 |
(0, react.useEffect)(function() { |
| 24085 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.cloudKitLibraryUpgrade); |
| 24086 |
}, []); |
| 24087 |
return /*#__PURE__*/ react.default.createElement(Index$1, { |
| 24088 |
sidebar: /*#__PURE__*/ react.default.createElement(IndexSidebar, { menuItems }), |
| 24089 |
header: /*#__PURE__*/ react.default.createElement(IndexHeader, { |
| 24090 |
refetch: function refetch() { |
| 24091 |
forceRefetch(); |
| 24092 |
}, |
| 24093 |
isFetching |
| 24094 |
}) |
| 24095 |
}, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__index-layout-container" }, /*#__PURE__*/ react.default.createElement(Content, { className: "e-kit-library__index-layout-main e-kit-library__connect-container" }, /*#__PURE__*/ react.default.createElement(UpgradeMessage, { |
| 24096 |
hasSubscription, |
| 24097 |
isCloudKitsAvailable |
| 24098 |
})))); |
| 24099 |
} |
| 24100 |
var import_prop_types$16; |
| 24101 |
var init_upgrade_screen = __esmMin((() => { |
| 24102 |
import_prop_types$16 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24103 |
init_content(); |
| 24104 |
init_index_header(); |
| 24105 |
init_index_sidebar(); |
| 24106 |
init_layout(); |
| 24107 |
init_apps_event_tracking(); |
| 24108 |
init_upgrade_message(); |
| 24109 |
UpgradeScreen.propTypes = { |
| 24110 |
menuItems: import_prop_types$16.default.array.isRequired, |
| 24111 |
forceRefetch: import_prop_types$16.default.func.isRequired, |
| 24112 |
isFetching: import_prop_types$16.default.bool.isRequired, |
| 24113 |
cloudKitsData: import_prop_types$16.default.object.isRequired |
| 24114 |
}; |
| 24115 |
})); |
| 24116 |
|
| 24117 |
//#endregion |
| 24118 |
//#region app/modules/kit-library/assets/js/pages/cloud/deactivated-icon.js |
| 24119 |
var DeactivatedIcon; |
| 24120 |
var init_deactivated_icon = __esmMin((() => { |
| 24121 |
init_extends(); |
| 24122 |
DeactivatedIcon = function DeactivatedIcon(props) { |
| 24123 |
return /*#__PURE__*/ react.createElement("svg", _extends({ |
| 24124 |
width: 409, |
| 24125 |
height: 204, |
| 24126 |
viewBox: "0 0 409 204", |
| 24127 |
fill: "none", |
| 24128 |
xmlns: "http://www.w3.org/2000/svg", |
| 24129 |
xmlnsXlink: "http://www.w3.org/1999/xlink" |
| 24130 |
}, props), /*#__PURE__*/ react.createElement("g", { clipPath: "url(#clip0_9066_32193)" }, /*#__PURE__*/ react.createElement("path", { |
| 24131 |
d: "M324.425 167.25H81.7246L84.8596 19.5898H327.56L324.425 167.25Z", |
| 24132 |
fill: "white" |
| 24133 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24134 |
d: "M324.5 167.85H81.725C81.56 166.35 81.41 166.275 81.305 166.17C81.2473 166.114 81.2015 166.046 81.1706 165.971C81.1397 165.897 81.1242 165.816 81.125 165.735L84.26 19.5754C84.26 19.4973 84.2756 19.42 84.306 19.348C84.3363 19.2761 84.3807 19.2109 84.4366 19.1564C84.4926 19.1019 84.5588 19.0591 84.6316 19.0306C84.7043 19.0021 84.782 18.9884 84.86 18.9904H327.5C327.581 18.9896 327.661 19.005 327.736 19.036C327.811 19.0669 327.878 19.1126 327.935 19.1704C328.041 19.2845 328.1 19.4346 328.1 19.5904L324.965 165.765C325.025 166.08 324.755 166.35 324.5 167.85ZM82.415 166.65H323.915L327.02 20.1904H85.52L82.415 166.65Z", |
| 24135 |
fill: "black" |
| 24136 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24137 |
d: "M324.425 167.25H81.7246L84.8596 19.5898H327.56L324.425 167.25Z", |
| 24138 |
fill: "white" |
| 24139 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24140 |
d: "M327.5 18.6152V18.6162C327.63 18.6153 327.759 18.6398 327.879 18.6895C327.97 18.7271 328.055 18.778 328.131 18.8408L328.203 18.9082L328.21 18.915L328.209 18.916C328.38 19.0995 328.475 19.3402 328.475 19.5908V19.5986L325.34 165.752C325.355 165.875 325.343 165.988 325.319 166.095C325.294 166.207 325.251 166.339 325.209 166.476C325.121 166.759 324.994 167.184 324.87 167.913L324.816 168.226H81.3887L81.3525 167.892C81.2705 167.146 81.1944 166.784 81.1357 166.604C81.1081 166.519 81.0889 166.488 81.084 166.48C81.0775 166.471 81.0852 166.481 81.04 166.436L81.041 166.435C80.9484 166.343 80.874 166.235 80.8242 166.114C80.774 165.993 80.7486 165.863 80.75 165.731V165.728L83.8848 19.5674C83.8858 19.442 83.9112 19.3177 83.96 19.2021C84.0097 19.0841 84.0831 18.9772 84.1748 18.8877C84.2666 18.7983 84.3758 18.7284 84.4951 18.6816C84.6115 18.6361 84.7355 18.6142 84.8604 18.6162V18.6152H327.5ZM82.7979 166.275H323.548L326.638 20.5654H85.8867L82.7979 166.275Z", |
| 24141 |
fill: "black", |
| 24142 |
stroke: "black", |
| 24143 |
strokeWidth: .75 |
| 24144 |
}), /*#__PURE__*/ react.createElement("rect", { |
| 24145 |
x: 62.8398, |
| 24146 |
y: 70.7256, |
| 24147 |
width: 129.6, |
| 24148 |
height: 130.05, |
| 24149 |
fill: "url(#pattern0_9066_32193)" |
| 24150 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24151 |
d: "M327 20H86V27H327V20Z", |
| 24152 |
fill: "black" |
| 24153 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24154 |
d: "M379.517 66.4746C384.493 66.5767 389.147 67.4985 392.973 69.9111L393.34 70.1494C398.027 73.2721 400.399 77.8954 401.349 83.0469C402.264 88.0107 401.85 93.4321 400.92 98.3701H268.579C269.354 97.3672 270.032 96.4076 270.664 95.4883C271.555 94.1919 272.34 93.0016 273.194 91.8545C274.881 89.5905 276.807 87.5467 280.124 85.5752L280.128 85.5723C282.558 84.1054 292.59 78.7477 303.176 82.2373L303.177 82.2383C308.021 83.8273 312.135 87.1022 314.769 91.4678L315.227 92.2275L315.899 91.6484C320.102 88.0331 324.584 84.7564 329.304 81.8486L329.323 81.8369C339.795 74.9467 351.547 70.2358 363.879 67.9854C368.968 67.1385 374.379 66.3693 379.517 66.4746Z", |
| 24155 |
fill: "white", |
| 24156 |
stroke: "black", |
| 24157 |
strokeWidth: 1.5 |
| 24158 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24159 |
d: "M401.54 99.7197H267.02C266.906 99.7209 266.794 99.689 266.698 99.6277C266.602 99.5664 266.526 99.4785 266.48 99.3747C266.428 99.274 266.408 99.1604 266.421 99.0483C266.435 98.9361 266.481 98.8304 266.555 98.7447C267.865 97.1334 269.091 95.4562 270.23 93.7197C272.465 89.9075 275.608 86.7075 279.38 84.4047C282.26 82.6797 292.52 77.3247 303.53 80.9547C308.473 82.5478 312.713 85.8018 315.53 90.1647C319.651 86.6929 324.023 83.5293 328.61 80.6997C339.226 73.6882 351.158 68.9112 363.68 66.6597C374.075 64.9197 385.865 63.5247 394.115 69.0297C404.36 75.8547 404.135 89.2347 402.155 99.2397C402.126 99.3799 402.049 99.5053 401.936 99.5933C401.823 99.6813 401.683 99.7261 401.54 99.7197ZM268.265 98.5197H401C402.815 88.9347 402.905 76.3797 393.365 70.0197C385.49 64.7547 373.97 66.1347 363.8 67.8297C351.434 70.0599 339.65 74.7805 329.165 81.7047C324.416 84.6183 319.903 87.8983 315.665 91.5147C315.6 91.5721 315.523 91.6141 315.44 91.6374C315.357 91.6608 315.27 91.665 315.185 91.6497C315.098 91.6357 315.016 91.603 314.943 91.5538C314.871 91.5045 314.81 91.44 314.765 91.3647C312.101 86.9697 307.95 83.6754 303.065 82.0797C292.565 78.5997 282.68 83.7597 279.905 85.4247C276.284 87.6529 273.274 90.7455 271.145 94.4247C270.335 95.7147 269.405 97.0647 268.265 98.5197Z", |
| 24160 |
fill: "black" |
| 24161 |
}), /*#__PURE__*/ react.createElement("rect", { |
| 24162 |
x: 256.61, |
| 24163 |
y: 29.9395, |
| 24164 |
width: 67.83, |
| 24165 |
height: 102.69, |
| 24166 |
fill: "url(#pattern1_9066_32193)" |
| 24167 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24168 |
d: "M114.534 142.455C125.859 142.165 134.638 149.891 138.123 159.657C141.561 169.291 140.771 180.648 138.615 191.851H7.4873C14.0371 189.906 18.5275 187.327 22.167 184.635C24.4859 182.919 26.4597 181.156 28.3643 179.526C30.2782 177.888 32.132 176.375 34.2617 175.093L34.2871 175.077C37.9279 172.683 42.0044 171.029 46.2842 170.21C55.9983 168.873 63.2438 175.597 69.2598 182.215L70.0039 183.034L70.4893 182.039C74.9672 172.844 80.0844 163.559 87.4814 155.984C94.8869 148.401 104.941 142.645 114.529 142.455H114.534Z", |
| 24169 |
fill: "white", |
| 24170 |
stroke: "black", |
| 24171 |
strokeWidth: 1.5 |
| 24172 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24173 |
d: "M139.235 193.201H1.26466C1.10553 193.215 0.947384 193.165 0.825016 193.062C0.702649 192.96 0.626081 192.813 0.612157 192.654C0.598234 192.494 0.648094 192.336 0.75077 192.214C0.853446 192.092 1.00053 192.015 1.15966 192.001C10.6712 190.413 19.4897 186.014 26.4797 179.371C28.6625 177.384 31.011 175.588 33.4997 174.001C37.3028 171.511 41.5586 169.794 46.0247 168.946C56.1497 167.536 63.4997 174.136 69.5897 180.706C73.6847 172.321 78.8896 162.841 86.4496 155.101C94.8496 146.506 105.32 141.286 114.5 141.106C125.615 140.896 135.395 147.991 139.4 159.211C142.49 167.866 142.625 178.516 139.82 192.706C139.795 192.844 139.723 192.969 139.616 193.059C139.51 193.15 139.375 193.2 139.235 193.201ZM6.49966 192.001H138.74C141.395 178.261 141.245 168.001 138.26 159.601C134.51 149.101 125.405 142.306 115.01 142.306H114.5C105.62 142.486 95.4646 147.556 87.3346 155.806C79.6546 163.666 74.4196 173.401 70.3247 181.891C70.2806 181.98 70.215 182.057 70.1339 182.115C70.0527 182.172 69.9585 182.209 69.8597 182.221C69.7642 182.234 69.6669 182.225 69.5757 182.194C69.4845 182.162 69.4019 182.11 69.3346 182.041C63.3347 175.486 56.1047 168.541 46.2197 170.041C41.9437 170.889 37.8701 172.549 34.2197 174.931C31.7589 176.501 29.44 178.283 27.2897 180.256C21.4457 185.841 14.2995 189.878 6.49966 192.001Z", |
| 24174 |
fill: "black" |
| 24175 |
}), /*#__PURE__*/ react.createElement("rect", { |
| 24176 |
x: 1.16016, |
| 24177 |
y: 159.721, |
| 24178 |
width: 74.7, |
| 24179 |
height: 39.15, |
| 24180 |
fill: "url(#pattern2_9066_32193)" |
| 24181 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24182 |
d: "M351.575 47.475H350.66C350.975 41.37 350.885 38.58 349.49 37.11C348.095 35.64 345.335 35.43 339.62 35.43V34.5C350.78 34.5 351.35 33.945 351.935 22.5H352.865C352.55 28.605 352.64 31.38 354.035 32.85C355.43 34.32 358.19 34.5 363.905 34.5V35.415C352.745 35.385 352.175 36 351.575 47.475Z", |
| 24183 |
fill: "black" |
| 24184 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24185 |
d: "M365.928 48.5617C365.965 48.5274 365.966 48.4704 365.932 48.4344C365.897 48.3984 365.841 48.3969 365.804 48.4312C365.768 48.4654 365.767 48.5224 365.801 48.5584C365.835 48.5944 365.892 48.5959 365.928 48.5617Z", |
| 24186 |
fill: "black" |
| 24187 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24188 |
d: "M365.945 56.1301H365.03C365.21 52.5601 365.15 50.8201 364.355 49.9801C363.56 49.1401 361.91 49.0051 358.49 49.0051V48.0001C365.18 48.0001 365.45 47.7301 365.795 40.8301H366.71C366.53 44.4151 366.59 46.1551 367.385 46.9951C368.18 47.8351 369.83 47.9551 373.25 47.9551V48.8701C366.5 48.9601 366.29 49.2301 365.945 56.1301Z", |
| 24189 |
fill: "black" |
| 24190 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24191 |
d: "M35.7348 121.501C35.5847 121.501 35.4402 121.443 35.3314 121.34C35.2225 121.237 35.1575 121.095 35.1498 120.946C35.1436 120.867 35.1531 120.787 35.1777 120.712C35.2023 120.637 35.2416 120.568 35.2931 120.508C35.3447 120.448 35.4076 120.399 35.4783 120.363C35.5489 120.328 35.6259 120.306 35.7048 120.301C45.1943 119.723 54.4415 117.07 62.7948 112.531C61.4473 111.922 60.2425 111.037 59.2581 109.934C58.2738 108.831 57.5317 107.533 57.0798 106.126C56.8661 105.317 56.8614 104.468 57.0661 103.657C57.2707 102.846 57.678 102.101 58.2498 101.491C59.9194 99.935 62.1177 99.0718 64.3998 99.0756C68.2698 98.9706 71.8998 101.356 72.0348 104.116C72.1698 106.876 69.5898 109.246 67.5348 110.776C66.8148 111.331 66.0348 111.856 65.2848 112.381C69.5723 113.922 74.1785 114.36 78.6798 113.656L86.8248 111.781C86.9796 111.749 87.1408 111.778 87.2749 111.861C87.4089 111.945 87.5056 112.077 87.5448 112.231C87.5625 112.307 87.565 112.387 87.552 112.465C87.539 112.543 87.5108 112.617 87.469 112.684C87.4272 112.751 87.3727 112.809 87.3084 112.854C87.2442 112.9 87.1716 112.933 87.0948 112.951L78.9048 114.826C74.1613 115.576 69.305 115.111 64.7898 113.476L64.0398 113.161C55.3894 118.084 45.7171 120.938 35.7798 121.501H35.7348ZM64.5798 100.321H64.4148C62.4581 100.297 60.5675 101.028 59.1348 102.361C58.7017 102.829 58.3936 103.399 58.2389 104.017C58.0842 104.636 58.0879 105.284 58.2498 105.901C58.7748 108.181 60.8898 110.401 64.0098 111.901C65.0148 111.271 65.9748 110.611 66.8598 109.936C69.6498 107.791 70.9398 105.946 70.8498 104.296C70.7598 102.646 67.9998 100.321 64.5798 100.321Z", |
| 24192 |
fill: "black" |
| 24193 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24194 |
d: "M227.918 83.4521L219.466 83.9988L219.216 79.8446L218.535 72.8255C217.891 63.9799 210.155 57.3905 201.31 58.1067C192.464 58.8229 185.839 66.63 186.483 75.4397L187.021 82.4589L189.599 121.852L181.219 123.643L178.533 83.1393L177.996 76.1202C176.993 62.5832 187.164 50.6936 200.665 49.5834C214.166 48.4733 225.984 58.5723 226.987 72.0734L227.667 79.0926L227.918 83.2826V83.4521Z", |
| 24195 |
fill: "white", |
| 24196 |
stroke: "#0C0D0E", |
| 24197 |
strokeWidth: 2.25, |
| 24198 |
strokeMiterlimit: 10 |
| 24199 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24200 |
d: "M176.061 141.262L234.507 136.428C236.584 136.249 238.159 134.386 238.016 132.309L235.76 102.263C235.617 100.293 233.934 98.8608 231.964 99.004L173.519 103.839C171.442 104.018 169.866 105.88 170.009 107.957L172.265 138.003C172.408 139.973 174.092 141.406 176.061 141.262Z", |
| 24201 |
fill: "#0C0D0E", |
| 24202 |
stroke: "#0C0D0E", |
| 24203 |
strokeWidth: 3.375, |
| 24204 |
strokeMiterlimit: 10 |
| 24205 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24206 |
d: "M185.693 140.473L236.045 136.319C238.015 136.14 239.554 134.385 239.411 132.379L237.155 102.011C237.012 100.113 235.4 98.7519 233.502 98.8951L183.15 103.049C181.181 103.228 179.641 104.983 179.784 106.989L182.04 137.357C182.184 139.255 183.795 140.616 185.693 140.473Z", |
| 24207 |
fill: "white", |
| 24208 |
stroke: "#0C0D0E", |
| 24209 |
strokeWidth: 2.25, |
| 24210 |
strokeMiterlimit: 10 |
| 24211 |
}), /*#__PURE__*/ react.createElement("g", { style: { mixBlendMode: "multiply" } }, /*#__PURE__*/ react.createElement("path", { |
| 24212 |
d: "M199.911 139.544L235.508 136.607C236.904 136.5 237.979 134.888 237.836 133.098L235.723 105.522C235.579 103.803 234.433 102.514 233.073 102.621L197.475 105.558C196.079 105.666 195.004 107.277 195.148 109.068L197.261 136.643C197.404 138.362 198.55 139.651 199.911 139.544Z", |
| 24213 |
fill: "#FBF2FB" |
| 24214 |
}))), /*#__PURE__*/ react.createElement("path", { |
| 24215 |
d: "M83.4999 104.999L84 66L143.5 25.5005L196 25.4994L83.4999 104.999Z", |
| 24216 |
fill: "white", |
| 24217 |
stroke: "black", |
| 24218 |
strokeWidth: 2.25 |
| 24219 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24220 |
d: "M126.356 67.4886C125.206 68.2993 124.008 68.767 122.761 68.8917C121.518 68.9943 120.335 68.7839 119.212 68.2606C118.092 67.7153 117.138 66.8695 116.349 65.7234C115.548 64.5865 115.007 63.3812 114.729 62.1078C114.463 60.8252 114.438 59.5561 114.655 58.3004C114.876 57.0227 115.332 55.831 116.023 54.7252C116.704 53.6065 117.607 52.6509 118.731 51.8584C119.894 51.0386 121.097 50.5774 122.339 50.4747C123.573 50.3592 124.75 50.5741 125.87 51.1195C126.993 51.6428 127.949 52.4775 128.738 53.6236C129.53 54.7476 130.064 55.9574 130.339 57.2529C130.618 58.5263 130.647 59.8019 130.426 61.0796C130.208 62.3353 129.759 63.5225 129.078 64.6412C128.4 65.7378 127.493 66.687 126.356 67.4886ZM125.013 64.9249C125.723 64.4239 126.282 63.8172 126.689 63.1048C127.109 62.3833 127.374 61.6067 127.483 60.7749C127.597 59.921 127.546 59.067 127.331 58.213C127.12 57.3369 126.741 56.5113 126.194 55.7361C125.669 54.9647 125.076 54.3968 124.413 54.0325C123.75 53.6682 123.05 53.5133 122.315 53.5675C121.579 53.6218 120.837 53.9131 120.088 54.4415C119.377 54.9425 118.812 55.5537 118.392 56.2752C117.976 56.9747 117.711 57.7514 117.598 58.6052C117.488 59.437 117.534 60.2845 117.736 61.1477C117.952 62.0017 118.337 62.8228 118.893 63.611C119.421 64.3603 120.021 64.9236 120.694 65.3008C121.369 65.656 122.08 65.8129 122.824 65.7715C123.573 65.7082 124.302 65.4259 125.013 64.9249Z", |
| 24221 |
fill: "#0C0D0E" |
| 24222 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24223 |
d: "M107.473 80.4541L100.292 65.207L105.292 61.6817C106.261 60.9985 107.174 60.6063 108.031 60.5049C108.892 60.3816 109.666 60.493 110.355 60.839C111.048 61.163 111.616 61.6526 112.058 62.3077C112.723 63.2509 113.063 64.2399 113.076 65.2746C113.09 66.3094 112.807 67.3212 112.228 68.31C111.652 69.2768 110.809 70.1519 109.698 70.9353L107.275 72.6433L110.089 78.6094L107.473 80.4541ZM114.643 75.3984L108.691 70.6589L111.404 68.746L117.492 73.3898L114.643 75.3984ZM106.285 70.498L108.572 68.8857C109.399 68.3027 109.903 67.6185 110.084 66.833C110.278 66.0385 110.102 65.2536 109.556 64.4784C109.209 63.9874 108.765 63.7007 108.224 63.6184C107.686 63.514 107.062 63.7123 106.351 64.2133L104.064 65.8257L106.285 70.498Z", |
| 24224 |
fill: "#0C0D0E" |
| 24225 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24226 |
d: "M95.5492 88.8603L88.3682 73.6133L93.4653 70.0196C94.4343 69.3365 95.3473 68.9442 96.2043 68.8429C97.0613 68.7416 97.8343 68.8639 98.5231 69.21C99.2029 69.5431 99.7751 70.0392 100.24 70.6981C100.923 71.6671 101.274 72.6865 101.293 73.7562C101.316 74.8038 101.038 75.8221 100.458 76.8109C99.8828 77.7777 99.0394 78.6528 97.9282 79.4362L95.4281 81.1989L98.1655 87.0157L95.5492 88.8603ZM94.307 78.8268L96.6326 77.1871C97.4983 76.5768 98.0199 75.8899 98.1973 75.1265C98.3877 74.354 98.216 73.5755 97.6824 72.7912C97.3089 72.2615 96.8559 71.9619 96.3234 71.8924C95.7818 71.8101 95.1556 72.0194 94.445 72.5204L92.1194 74.1601L94.307 78.8268Z", |
| 24227 |
fill: "#0C0D0E" |
| 24228 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24229 |
d: "M118.585 51.6485C119.78 50.8061 121.026 50.3252 122.321 50.2183L122.32 50.2189C123.599 50.0994 124.821 50.322 125.981 50.8862L126.198 50.9931C127.273 51.5414 128.191 52.3714 128.952 53.4758L129.243 53.9121C129.896 54.9393 130.347 56.0354 130.594 57.1999C130.88 58.5051 130.909 59.8138 130.683 61.124C130.46 62.4125 129.998 63.6309 129.301 64.7764L129.3 64.777C128.603 65.9055 127.671 66.8805 126.507 67.7006C125.326 68.5336 124.086 69.0195 122.789 69.1491L122.785 69.1497C121.498 69.256 120.27 69.0375 119.106 68.4952L119.102 68.493C117.938 67.926 116.951 67.0486 116.14 65.8702C115.321 64.7078 114.766 63.4723 114.479 62.164L114.478 62.1609C114.206 60.8476 114.182 59.5458 114.405 58.2574C114.631 56.9475 115.098 55.7249 115.805 54.5916L116.079 54.1685C116.741 53.199 117.578 52.3589 118.585 51.6485ZM118.882 52.0699C117.786 52.843 116.908 53.7731 116.246 54.86L116.244 54.8626C115.571 55.9402 115.128 57.1006 114.912 58.3453C114.701 59.5672 114.723 60.8029 114.982 62.0537L114.983 62.0539C115.254 63.2914 115.78 64.465 116.563 65.5757L116.565 65.5781C117.33 66.6904 118.25 67.504 119.323 68.0278C120.406 68.532 121.544 68.7341 122.743 68.6352C123.938 68.5148 125.094 68.0665 126.21 67.2792C127.321 66.4961 128.203 65.5708 128.861 64.506C129.526 63.4147 129.963 62.2584 130.175 61.0361C130.39 59.7916 130.361 58.55 130.09 57.3091L130.089 57.3069C129.822 56.0471 129.303 54.8694 128.53 53.7729L128.529 53.7704C127.763 52.6575 126.841 51.8552 125.764 51.3536L125.759 51.3521C124.682 50.8274 123.553 50.6209 122.367 50.7319L122.363 50.7328C121.173 50.8312 120.013 51.2728 118.882 52.0699ZM119.942 54.2314C120.72 53.6826 121.507 53.3696 122.299 53.3112C123.085 53.2532 123.834 53.4196 124.54 53.8072C125.245 54.1945 125.866 54.7928 126.408 55.5884L126.611 55.8909C127.067 56.6033 127.392 57.3582 127.585 58.1539C127.807 59.0379 127.86 59.9237 127.742 60.8097C127.628 61.6746 127.351 62.4829 126.915 63.2336C126.488 63.9805 125.904 64.6153 125.164 65.1366C124.422 65.6597 123.65 65.9616 122.849 66.0295L122.841 66.0303C122.049 66.0742 121.293 65.9063 120.577 65.5301L120.57 65.5261C119.859 65.1269 119.231 64.5354 118.685 63.7607C118.113 62.9492 117.712 62.0989 117.489 61.2114L117.488 61.2069C117.279 60.3153 117.231 59.436 117.345 58.5717C117.463 57.6855 117.739 56.8754 118.174 56.1444C118.613 55.3905 119.203 54.7523 119.942 54.2314ZM119.106 63.4637C119.615 64.185 120.186 64.7179 120.816 65.073L121.056 65.1897C121.619 65.4409 122.203 65.5484 122.813 65.5145L122.812 65.5151C123.506 65.455 124.19 65.1926 124.867 64.7153C125.549 64.2347 126.081 63.6556 126.468 62.9779L126.469 62.9759C126.872 62.2841 127.125 61.5396 127.231 60.7414C127.34 59.9208 127.291 59.0997 127.083 58.2767L127.083 58.2745C126.88 57.4317 126.515 56.6355 125.986 55.8854L125.984 55.8821C125.477 55.1367 124.912 54.5999 124.292 54.2592C123.671 53.9183 123.021 53.7751 122.336 53.8256C121.658 53.8758 120.959 54.1449 120.239 54.6527C119.557 55.1332 119.018 55.7174 118.618 56.4054L118.617 56.4074C118.22 57.0752 117.966 57.8186 117.856 58.6399C117.751 59.439 117.795 60.2549 117.99 61.0893C118.197 61.9085 118.568 62.7001 119.106 63.4637Z", |
| 24230 |
fill: "#0C0D0E" |
| 24231 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24232 |
d: "M105.146 61.4721C106.135 60.775 107.086 60.3605 107.996 60.2513C108.899 60.122 109.726 60.2366 110.466 60.6064C111.201 60.9502 111.804 61.4698 112.271 62.16L112.515 62.5301C113.047 63.4009 113.324 64.3158 113.337 65.2719C113.351 66.3585 113.054 67.4164 112.453 68.4412L112.452 68.4432C112.347 68.6193 112.231 68.79 112.109 68.9597L117.931 73.3988L114.637 75.7211L114.486 75.6011L109.341 71.5053L107.603 72.7306L110.417 78.6962L107.372 80.8428L99.9687 65.1225L105.146 61.4721ZM111.795 69.3685C111.27 70.0078 110.622 70.6022 109.849 71.1473L109.78 71.1955L114.655 75.0776L117.058 73.383L111.795 69.3685ZM107.577 80.0676L109.766 78.5244L106.952 72.5587L108.921 71.171L108.263 70.6476L111.412 68.4273L111.699 68.6467C111.728 68.6053 111.76 68.5659 111.789 68.5242L112.009 68.1794C112.567 67.2271 112.834 66.2618 112.821 65.2795C112.808 64.3027 112.489 63.3628 111.85 62.457L111.847 62.4529C111.43 61.8351 110.897 61.3766 110.248 61.073L110.242 61.0704C109.606 60.7511 108.885 60.6443 108.07 60.7612L108.063 60.7622C107.262 60.8571 106.389 61.2266 105.443 61.8935L100.62 65.2944L107.577 80.0676ZM109.36 70.8612L109.552 70.726C110.267 70.2218 110.863 69.6802 111.346 69.1051L109.123 70.6721L109.36 70.8612ZM109.347 64.628C109.037 64.1883 108.652 63.9446 108.187 63.8739L108.177 63.8722C107.74 63.7873 107.188 63.9413 106.502 64.4249L104.393 65.9124L106.388 70.113L108.426 68.6765C109.215 68.1204 109.672 67.485 109.835 66.776L109.836 66.7732C110.01 66.0628 109.858 65.3531 109.347 64.628ZM109.769 64.331C110.35 65.1563 110.552 66.0165 110.337 66.8953C110.138 67.7557 109.587 68.4887 108.723 69.0978L106.186 70.8865L106.055 70.6094L103.834 65.9379L103.741 65.7411L106.205 64.0035C106.937 63.488 107.63 63.245 108.265 63.3643L108.491 63.4106C109.007 63.5442 109.434 63.8565 109.769 64.331Z", |
| 24233 |
fill: "#0C0D0E" |
| 24234 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24235 |
d: "M100.03 70.8484C99.589 70.2226 99.0496 69.7562 98.4113 69.4433L98.4094 69.4423C97.7709 69.1215 97.0489 69.0048 96.2358 69.101C95.4344 69.1958 94.5616 69.5656 93.6153 70.2328L88.6953 73.7016L95.6529 88.4748L97.8418 86.9316L95.1047 81.1151L97.7815 79.2278C98.8691 78.461 99.6849 77.6111 100.239 76.6812C100.796 75.73 101.059 74.7588 101.037 73.7638C101.019 72.7512 100.687 71.78 100.03 70.8484ZM94.2975 72.3117C95.0298 71.7955 95.7228 71.5441 96.3582 71.6386L96.5856 71.6816C97.1034 71.8105 97.5394 72.1416 97.8943 72.645L97.8967 72.6483C98.4628 73.4804 98.6609 74.3331 98.4496 75.1904L98.4482 75.1901C98.2513 76.0326 97.6798 76.7667 96.7821 77.3996L94.2056 79.2161L91.8877 74.2719L91.7959 74.0754L94.2975 72.3117ZM94.4105 78.4409L96.485 76.9783C97.3173 76.3916 97.7885 75.7531 97.9473 75.0702L97.9486 75.0668C98.1178 74.3801 97.9721 73.6772 97.473 72.942L97.3429 72.7714C97.0327 72.3985 96.6821 72.2011 96.2914 72.1502L96.2858 72.1492C95.8395 72.0815 95.2812 72.2489 94.5945 72.7331L92.446 74.2479L94.4105 78.4409ZM100.452 70.5513C101.161 71.5574 101.531 72.626 101.552 73.7524C101.576 74.8522 101.284 75.9176 100.682 76.9436C100.085 77.9473 99.2132 78.8491 98.0785 79.6491L95.7556 81.2869L98.4001 86.9075L98.4927 87.1034L95.448 89.25L88.0444 73.5298L93.3182 69.8115C94.3098 69.1124 95.263 68.697 96.1755 68.5891C97.0755 68.4827 97.8995 68.61 98.6381 68.9804L98.9035 69.121C99.5088 69.4678 100.025 69.9461 100.452 70.5513Z", |
| 24236 |
fill: "#0C0D0E" |
| 24237 |
}), /*#__PURE__*/ react.createElement("path", { |
| 24238 |
fillRule: "evenodd", |
| 24239 |
clipRule: "evenodd", |
| 24240 |
d: "M139.254 33.713C139.666 33.4358 140.202 33.372 140.646 33.5779L149.068 36.9906L151.39 29.4591C151.571 28.8508 152.127 28.453 152.748 28.4112C153.369 28.3695 153.949 28.7464 154.182 29.3269L160.068 43.2661C160.348 43.9266 160.107 44.6776 159.552 45.0754L142.342 56.7546C141.76 57.1681 140.965 57.0967 140.46 56.6038L129.667 45.9751C129.236 45.5465 129.094 44.8768 129.36 44.2905C129.625 43.7043 130.212 43.3598 130.827 43.4294L138.688 44.0517L138.617 34.9481C138.611 34.4494 138.843 33.9902 139.254 33.713Z", |
| 24241 |
fill: "#0C0D0E" |
| 24242 |
}), /*#__PURE__*/ react.createElement("defs", null, /*#__PURE__*/ react.createElement("pattern", { |
| 24243 |
id: "pattern0_9066_32193", |
| 24244 |
patternContentUnits: "objectBoundingBox", |
| 24245 |
width: 1, |
| 24246 |
height: 1 |
| 24247 |
}, /*#__PURE__*/ react.createElement("use", { |
| 24248 |
xlinkHref: "#image0_9066_32193", |
| 24249 |
transform: "scale(0.00173611 0.0017301)" |
| 24250 |
})), /*#__PURE__*/ react.createElement("pattern", { |
| 24251 |
id: "pattern1_9066_32193", |
| 24252 |
patternContentUnits: "objectBoundingBox", |
| 24253 |
width: 1, |
| 24254 |
height: 1 |
| 24255 |
}, /*#__PURE__*/ react.createElement("use", { |
| 24256 |
xlinkHref: "#image1_9066_32193", |
| 24257 |
transform: "scale(0.00309598 0.00204499)" |
| 24258 |
})), /*#__PURE__*/ react.createElement("pattern", { |
| 24259 |
id: "pattern2_9066_32193", |
| 24260 |
patternContentUnits: "objectBoundingBox", |
| 24261 |
width: 1, |
| 24262 |
height: 1 |
| 24263 |
}, /*#__PURE__*/ react.createElement("use", { |
| 24264 |
xlinkHref: "#image2_9066_32193", |
| 24265 |
transform: "scale(0.00301205 0.00574713)" |
| 24266 |
})), /*#__PURE__*/ react.createElement("clipPath", { id: "clip0_9066_32193" }, /*#__PURE__*/ react.createElement("rect", { |
| 24267 |
width: 408, |
| 24268 |
height: 204, |
| 24269 |
fill: "white", |
| 24270 |
transform: "translate(0.5)" |
| 24271 |
})), /*#__PURE__*/ react.createElement("image", { |
| 24272 |
id: "image0_9066_32193", |
| 24273 |
width: 576, |
| 24274 |
height: 578, |
| 24275 |
preserveAspectRatio: "none", |
| 24276 |
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkAAAAJCCAYAAAAoUng9AAAACXBIWXMAAEtbAABLWwHvoCmtAAAgAElEQVR4Xu3d63Lruo4wWua8/zvn+9GHtbEwAZJK7MwLx6hK2RJB8CJHQjtz7f74/PwcAAA3+f92AQAA/xoFEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBRAAcB0FEABwHQUQAHAdBdAP+vj4+NzFAADv9/H56ZkMANzFN0C/wcfHx6dvgwDg9/ENEABwHd8A/eF8UwQAr+cbIADgOr4B+gf51ggA1hRAP2AWJE8Lk9P4HPf5+fnRxUan+QHgX6MA+kGnhcl0Gv/5+flRFTO7Auc0PwD8axRAP+A7hcbpt0dzjBi3Gtd/ig/Azfwj6N/o4+Pj8zvFEQDwNb4B+o12xU/+9uf0W5sYcxIPALfxDdAPyt/4PPkGqIt9kqPy3f4A8DfyDdAP6gqN7h8wn/57nie++l+MAcC/xDdAl/ud3wD9zrEBuJtvgH5A/tal+jc6p/9WZxe3GqvyOwuQ3zk2AHdTAP2A/J+oVw/+7t/3PI3L7U+LjF3B9FXvygsAX+FPYL9BLoSqwuhP+PPQag5P5vckFgB+ggLoB63+S675/vP//191XhUMu/aV7/QFgH+FP4H9gNWfvub5+bOKm/9lWP6mqIqNbdWfyHZ/ksr/TmkXP+N2MQDwJ1AA/YAn37jkwiO37/5MFoue1bi7OcX2WJxVc4qFmSIIgL+BAujNckGwKnBy0ZKLlN1xda4rSLpCpoqNujF3314BwJ/EvwH6A3Tf5MxvVKrXLteJkxw5ZhZHu34nXpkLAL5CAfSDVn+yOi0GToqXdzoZv4t5utZXOZkzAHdRAP2A+OCPD+PqW5ZXFEhj9P97Qad5XqVb+2z76fkAwBgKoD9GVxx85U9fq9gnebI4lzHOizIA+NP4R9A/YBYMHx+//ufkuZiYMfM4v1Z987nuW6RK1zbnEecc5/K7ip8439W6Vr7aD4B/h2+AfrPdNzyr9iff5jyJ/a5YML1q3FflAYAxfAP0dl/5tqH71iXHdQVB9U3TPF/FP9HljuI3RK8qWmYxtYvL8zvp88Sr8wHwe/gG6M1yIdO155hXfOPxihy/S5z7T61jN86uHYC/h2+A3qx6YOaiZ/7M8/NB233bsPp2pyuouphTJ31OYiq7dZ4Uj6+wK2527QD8PRRAPyB+k5G/RagKlln8dAVMdb7rUzmJyXKB1sXE4xi3Kla69ezm2e1jVM05nzudJwD/DgXQD8iFT3zwVg/xKnaM/xZSI+mKnzl27P9VVaFSFRNxvJOxc44u9kkRtWqf7+P8KnEtq5hVOwB/Jv8G6AfNIqV60K/aKjE+vp702cWM0f97pFWO3HYy3ndUa1+dq/pWeTtxb77SP/pufwC+RwH0B8gP6zH++21P9fCe708f7NUY0+mDuCtwqjnH4ypH95rjc7+u/dVePd6r8wHwPf4E9gM+Pn79U1EnPyS7h2YuRGJbHC/Hxwfx52f972yqua6KtGrO+VxXFHU5sl17ttvnnafjrayK0ioegPdTAL3ZfPitHvSxsOgeirEoWT1MV8XH7niOX83187P/093ss5p/V/hkueiq8uWY3D7GukDszr+rIOnW+soiC4BnFEA/YFUYRLsiKeeY577yIF0VN7Egmq/dOLm4+8pcolgM5nxVAVaN1+1TXldWrb1yci2fqsZ9xzgA/B8F0JvNh/hXC4P4EMw5Vm2rbx1WhUyVczVu95DO5588zLv8sTjaxWa5UFvFncacrqmKq4q0+Jrfn44FwJmPT/8I+u26h11sm8XHrlBaxcRcp/Gr2JP5vMOqsMtx1b51x/F8tVc/YTdXAH6Gb4B+QH7AzYfvfPjtHvInBUGXaz74cxGWi4HYnouy3K96fZW4jtW+1b3/T7UHq/Nj/Dfn6TgrXd9uzFd6xfwB/nUKoDeLxUT1IM7FUH5oxX4xNj/kumKhapvnZp44r3ic5dj42sXP16qQqh7Qea3xfZxfNZdsVQDkve72/teerxOv7Svt9gUABdBb5Yd4fGjP96fFx4zJ7+O5qujJBVIsSqqxun75/aq4mPIcq7G7PHncPJ+TucR+OWZXHHVt8zrmczmuytHNZZ6rcgPwHh+f/g3QW+2KmpWqYJrvxzj7v/C72FwsdWPt5Ad2LlZOcu1iVnNbHe9i8/ldexW7m/vv9ORzAnAbBdAbdUXLrtioHlyruBlbjXEyh64t5p9to/GqQmD10P5u8VGteXUdTn2l76rPV/JF3+0/xr4oBPjbKYDe6PThkR/6r3rQVw/4VRGwypXPjXH2zcLpeCfzmO/zmnJMt2e7/azWdTr/74pzG+Nsb0+8a75jvLeIA3g3/wboN5sPiu6hXsXH16o9PuRjXHWuilm1z3MjyTFPHuRVkZFj5h7FuJx7tnd7OM91czrZ92o/drq9ieLcTvb31G7/v5p3jH1ugD+ZAugHVA+ZWWjMh0guGHIRMs+dPKRnn5P4k+KmUhUf8/0cNxdWM26OWxVJ3QP5yYP6Sb44j7xf8Tie7/aoWu+MXx2fOFnTV5xe76dy3lfOGeAVFEC/SSxqYsEQj6uHU2yP52bO/KDePXhjn64g6R6+1UMtFxM5pltbtYacayTdXPKa4/m8xjhetQ/V/Ecjxuf5Vtcitnd5q/PVXnRW8/2KXb6u/cmcAX7Cx6d/A/Q2sQjoHo45psox31f9qjwz9vR99zDOc9/NO69vt7ZoN6dOXvcY5w/bPPeu35P5jLGPP92XXfurnM4H4F/iG6A3ig/m+XCpHtZVEfHxUf8/IM1FRpenionn89zia9dnvu/mlfPmtcbY+VqtJ+7Fak4xNr6u+uTr0e3nd+zmkOfc7X81pxyz258T1WdnjNfkBvhTKYDeLD/s5vtd0TGLiXguxs7iYFUkxIdaVVTEMfIDML6Pfaq4eC6/78aecVURUq2n2q98rtrrLO/9Kjb2ice7a/cVu1zdXsb1dH12uceo11jtzUkugL/Bx6c/gf2Y6oG1Os7FxS7X7FPF5vbqgVrF5Pddv6rPztPYMb4+/5hnda5bZ47v2p44uXY7T/bwJ1R7uesTPenzJBYgUwD9gHyjjg/Z7mGcH45j9N9EVG2drmD56oMr5usKgzzPLn/Olfds13/GVXt9ErvyJG+OeRJbHa8+J/ncGOvPwm4uuxy7ea08jQd4JwXQD1oVAl958OR8MfbkXMyV31ftMc9KXNuqf9W+i8nr6MaJub5yvhpnxlTr6/LFnCfnq/3a7c/4Aav1vcNPjwfcx78BeqOPj1//RwXja4z7/Pzfv4fJ/eL7aPapHtLxOOfqHqA5T9U/yuuocuU1dYVAzhPX1a0vts32vNY5fjyX+52cn23dQ3nXb3U+7nO11tP9X8WeyPsXdZ+N/P7ESXy3zwCv8vHpG6C3iw/i+JrbZnz3wIxtVc7ZXj3M45hRPt89hPO56oGf53aSv3s/46u9qNYx27/SNtvHePbgPdnn3bivkj8P8VwXe3r+nX7HmABj+AboR80H1Bj/fXiuCo18PueK52OuKk8ce/5Ux7lfzpXXUa0p962OV+/nT96HMf67jtxWxY3Rz7nT7UU055jP5ePdWNnpPKv1nRQTXUx1/mTuu3nGuHxuN9+TvF/1ztzAn08B9Gb5oRTf5wfYfIjFB2D3gMhFwIyrCp+qXywy8oM8j5vnOV+rXCPoiojqgZnXPV/z3sV9ymvtjmP/2JbnkdtnrtNr0LV3uv75WuY+eQ25X3W8m0snj9HFdHuU46rzq/wneb/qnbmBP58C6I2qG/t8oOaH9XywVUXE6oEYH1D5gV7liOdin/hQffIgrQqJGZeLiBwXx47jnjyYqpicO7ePURdJ1f7E+LxHuS33ibnja26f77u15Lact+pTnR/jrJCpruHTPl9xcr0BXu3j078Bepv44I8PoPy+6jff5wdXVVSsHpLdA6qbQ8y3yx1jurZRqPYkt8/31V7kPdud6/YqW619nhujLmiq/KvxurY4xmpdJ2sZo59r3WtfZP2E3Ryzp/HZd/sDfyffAL3Z7kH68bH+tzez/8yRY6vzebx5nPPkvvm1ml9s78T+8Weey69Ve5UjtseYKM43P8y7PZzv877lmDmPPG68Tt1eVvm6czHfKmYsdH13/Vaqz8Jp++4zE3WfuzHqa1ddkyd2nyng3/Tx6RugHxEfkNUNt3voVbob/6rvqk910+/mGouI1fvVWqqYah0nObrjeH6MXx9yq/XF19w3ejJmjl+trbKbS7bLv9qXrs/Kd/pWvpvv5Bp0TmKAv58C6Id0D/h4rnsAx/axscrdxZ08lPMDJcfuxovn42ts7x7K+Vw8P52up7oOsa1af9enul55/+NedOs+sdqH1Xq72HhujPPCaoz9OJ2n/br5PsmRPe3/NB74eyiA3ig/OKsHZRc7z8W46mG1e0h0eUehm2M375OxV/PY6cbrcuX2bh7dnHf7fbL+rm8+P9t2OVb723k6z11bt5YcV7V1vpszX7PuGlZ9qradk/xV/C4O+H0+PhVAb1XdoMf49eGX22dMzBPPdcednDuey3OI7/N8uvlH1fndumPMVK11tc5qLp08x+8ez3Nj7Auvbp05T27v5pBfxxc86bu7lk9yjdHv00l8de5pvugk/iTmFX5qHLjVx6cC6O2qB8bJQyS299n/z+6B0MXHcXZ9d31OY3K+VY68Pytd/9gW22NMN9bqOqzOreb9ZD05z2nfne/kqfZolWsXv+ufPY3vvCoP8HfyX4H9sHzDnQ/Qj4///e++rG7M8fx8nx8mMX71EK4eRHk+Y/xf/vgAznlmzEhinyounq/6dOdiW5UjjtWtY4p7GPejyhvj43G+DtV1mao9zzE5bs6tipux1bluDVVs9X53vLr2UV5vdw2yeL1P1jGdxu7mPcZ5LuDvowB6s+7hlB+c+XjG5IdMfgDtHo5de86XH7h5Lqt1zPY8VnxfzT+O0z0Y89h5HjHHPI6xcW+rdcT1x9ecN88vzjv3XYl7tNqzai+q8zlHnn+Oz33iuqr5d/PIqr2tYvL7VZ+45u4aT7uxs5P5jnFWJO3MsU7GG+P5WoCv+fj0J7C3iQ+a+JDpHjgxNj/YVn3i+TxOlSfHnuSNfVcPwWq9Vd/dPuS88XyOz32q9c3z3R53a9qp1pfzrfZ7tS9RlfNkzt1exPbV2HFNqzw7p/ONTvrs5r/rszpX+e5n56vXEXg93wC9WXez7eKn2Gf1APr4+PUbknmcX1fvx/jvtwY57xy3aou54oOhyl/1ie1xrfl87JP3ZzSqvchj5OOTfVvtzQjy8TwX15Tjur07mVd+X+1djMmfrd18u/Wt5jb75/Yufuo+R1XsKk/WfcbicZcjXuuq37Sbw9R9Br7rlbngX6UA+gHVw2GM+iEeHxT5AZXl/lW+VVt8wHQ38hwX+49RFwM5Lq9hjpfn1M1lnq/aYu44bhV3epzX17XH+VRjV+vMuap886daV9W/y1O15+tYrSG+VvPvrnclz6WLn3G5rRs/7kWcZ7f2Km88v1rDV5xco67tFV6ZC/5VCqA3izfw1YNkHs+f1Q2suonuHkL5QVfNJf6MUT+YZ3x8WOX15TXHh1v3oIvyXGa+OP7qQVc91FbxOXaK66/2ereOvH9Vjpgrx+Q9zPFxTXGOeZ/GRu6XX7PqOlRjVmua57s93O1pXHPVp5pH1Sf2zf2ykz38KXkuf9Lc4G/z8enfAL3NyY29e3DM4+5hVj0A87ncJ/etjmO+2LbKmR8eXftqfXH+ud+U1/ikzy7P7FvtY7WH05Pxqva8J9mqvRtrxlfrqmJnTG6r1t/lWvXr1v7UV/qf9jmNq+z67tr/Bv/CGiDzDdAb5Qfd5+ev3wZ9fKz/L/fZnh/C8Xjmjn1ibB433sxivzh+vtnlnLmtG3sVn8eu5lH1zXtYxcz31T5XTm7ucR/n8Xy/mntcW4yN8as9rHJW+eLexH75fOyT11T1zXFxPdVc4/Vd7dfqM1O1n1yjbu9W1z6bY+8+M9NuXrv2J7q96tpWnsS/cg3wp/j49A3Q28QHT7zZnNyUqwfQ7ua+GyvmyPnmcTe3qu+THPkGGuO62Gpdq7FzzDiwyp3nPONmvzy/ym6deb55Prlftze5T/V+1Z5zrXTxX8nZzekr7Sd28bv2zu46173+Z/V5O+l/6iv5vtIH/gYfnwqgt4k3wejz8/wBPUb/oNzlqPrN82OsH1hd/ChU+XO+qYqLr1VcF1vFzL5d+8k6s2rd3Xy6tVdz6saL8bu2bj3VcbXHq+N4Ph7v+qzmvmqv9i23r/KeWs25e50xY5wVNNGTeT+Jzb7Td+edueF38SewHxBvHK+6ieQb0mqMGRtv5PNmnh9uUc4zj+Nrt548Vn54xNc4lzifHBNjc0x3bs4x5pjvq7Wv9ibmivGxfbWfcfwuR9Vnvs6fPE61BzE25om6tngc51z12a05xk7duHlfpm7dJ7rrnMX1xX2L84nzO8k5VWvqPM2/+/w9ybOKfbIG+Ft8fPoG6G1Obz7Z0xt9jI830Pz+yUMrx6z6VLFj/PqQ3J2fVv2qHN1x7H/SnnPlOXTnV31GkuPy+Xyum29u72J24nzG6Pez67daw5P5VGsZ49mDtxt/3eu/8rX+ylpi/Olx5zSu8pU9fLXvzB/e7eNTAfQ2+eHyHfGmnM/l19k2Rl00xPYp9utyxr5dWxc3z1U35SpHt5bcd57PY+X1jKRbZ9d/N2YVU+n266Rv5WSes30en8x3t9d1r72TOVbnumszktW1qmLHeLb3p/lX+7Saz5PzO1/t9wq/c2w45U9gbzRvAN2NILd/fvb/o3nxhtKdiw/Xj4/6TyD5OOeZ5+ODcsbN+cVzsS2/xly5T847X6v5zeO8N3FNq4dHPI4xsd/uht3lqa7JfI0/uW81j3xNuj2r2mKeGBPHiWvNfbucs606X9nlqcavrvnco3kuxuT9q3JV5+LerOJzTJTjqz2u4qLuGjxZ0xj9HE/msPLkeu+scr1yHPgKBdAbVTfcXXuOjTfYVXyMy6/xhtjlr+aYHxQfH/t/T5EfCHkuOTbmzDfuat1xHnneOV/MEWPi8cwR81bziGNV+xDnNA5V+5RV+72KjevZxWe5T9Wv2s+8ZzEmt8e5xbZ8rad8jXdribF57Cle19znRDef6vrHdY/C07Gjai9Wczi12+Ooy533eBUzxvM5wit8fPoT2Nuc/lLHm/zu5hPjqhtxvgGublBPHjzduXi+Wkc13269MUeVM48Z+8Sx8hi5z3Qy13hcXZsqx8nccp6v6OY02/K5bk9P1lVZ7e9qbpXdeKt97a7rGOtrF+O/097F7a7Pag2dJ7FTvOa7vicxr/TT40GkAHqj1UOoio9t8ebYxeX4fKM7HT+fq/Lm+DHquWVV7GoO+Wb4ZIwpjzXPxbiTfY7tM2Y3zyo+ts+YavxV7twWz8XYKseuf/U6CquxqjFz7Dx/Mk5cWxfXyeuMbdX5am9ibM556snevkp1jbu4MZ7v7fQTa4F38yewN6tuEic3jo+Psz83VefjzXb+VDHdDb97aOQHQpUr94u5u/Hiufi6W0PVt9qTnHuMs7Wu5pfPzfg5h+oBEXPm/NUex9zxNbbl/vl9nuN4oNrLeD12Oas15bl1Y8zX+b5bd1TFnO53bsvjVuvsPmvV2PH1VLU/3dpnW7fXWd6PldW+nuiuM/xuCqAfUt3In9yEqht4/IkPuup9FZfHyHOLbbNvfI39qpt+dfM+WXPMtbpxVuvP7XGu1ZpyTLW2qm+3B91YM6Z6XcXkfDFv3uu4hpw3t3V7k/ehurZVe7W3I4lr+wzXLsfEn5ivuxYxZr7mdcyY1Xri64lq7t2a4mvVVuny57jVvnT58/6uxLzd3q9UexKdzgNeTQH0RvGmHX/Jq1/4GFvJD5rqAVG978SHRXU+zvvpjXvKuboHQ6Xaj+4BV/WtHm7zfbV3c2+rOVd7kM93e7661tUaqs9MNf+4F/M4zyWvKcp9qraYa57PY1T7POPyGvOcc5/ZVs25yj0O5Dwx924901fHGqPey5iv29/cN8dG1XpO+lTz6a5LtGr7im6Op141D+6jAPoh3S/5vMk9+SWefaob2Oo43lDzgyTnqh5Ac57VTTnOp7tpVzfo3DfGVv2qvarmXI2V517p5jdf89rmT+y3GyOK1yaPXa21WmN1Ll/rkVTXMop5Yp9qTpW4V3OcfB2r10qc5+neVte+W1MVF9t3MfPcKOzWtZrP6VqnvOfxdaUac7XfT67Fyfg7uxwn84CKAuhNqptkFRNfxzi/8eSbZ3yw7G66832MO7mhx7FWN9ruYRPb8zrnuXh+9+Dp9jfuxTxX7Unei5M9yG27HFme/+o6V8ezT1xjXu/ugVCtM/7Mva8+b/M49luNm8eK8632MPbLefP1XPWPc8w5dvPMfeP7nK+z+hzMuee5rHJWc1mJY8xzq367nPH6n5rjP+1XeUUOyD4+/Vdgb7G68Vc32C62k/OtxjuNqc5/Jc9J3nhujPObZbyx59cZU7XnvjMunp/vY1t3rlPtxRi/Fjune1jNfxyK443x6750bV3/nd11yOfG+O8Yu/ju3Mncq7mNpJpLbF/NJedaqfJ0MafnVzEnfV7hu+Oc7EsVv4uDzsenAugtqptyJcbEX/7VDTq3VfGrsXNbl7eK7dq6ua/W8pW8p3s6xq9FzOl4sW81l9gvxsZzUdc+15OPV/OccfM4z3vKOWLfKs+qLc+ruiZVvsrp+DE+xmRVn3y+i4mx+dwuvprnk/FybPU6xnoeX7Gb24mvzO0V48Kr+RPYG8Ubxckv/4zPN+R4s6z6ZXGs3cMhy3Ndxa5u5DFmjD5vNddq/fFct5+rfer2dLbNnB8f/Z/ZYlyeU9Sdz/lXObq96d7PvHmfRiHHrcTrGdfd7X/e1y5XNX4339U64p5W48X+8zi/zpg8Tr72OV8VV7Vn1W6Nvb8AABNtSURBVPXrXqt9quZfebLHWbeXY5zl6Pak29OuX6fbg9P+MMbwDdC7rH4RVze3HHcaE2NPHjL5hhb7znyruJ3T+ez6jFE/yLqc1VpGoXqIrXLGuFGo5hbt5tStt5pXNfcqV7c3J9cxx+Y+1Zx28+uuX7VfWRW365vbu2uQ596t46d1+9+taZdndf4r+5ud5vhO3qd9O6/Kw99NAfQm8Qb7Kt2Nujr+rl2+eGMeo17var45boyzB3mV57R/nPPJ3Of7rn88F/t185i5Vn262DjX3bx3c8zx830er1pHFVONledYHXd9VlZ98lhf8WQeVVw1p5N8Ud7bqq06PpnTV+e3mtN3vDofPOFPYL/J5+evX7nnc/N9vHnNtvh+Hu9uJLv2KObP88g3wjyXKkeeX86ZzTHyQy3mqW7k+VzVN75285ptOW+eb3UdYq68jl2fOO48njlyzGof5nGe75xTXGcVu1p3HmM1Zjf+SPJ88ut8n3PnvY2xXVuOi/HV3GJsFzfz5H3p3ud5Vdehuka5T7Ufq5is2vdqvJm7y/XV67Ca299o93njz6IA+gHVA6G7YVY3zSr2RHeT3sWd3FTj68rqgRBzz+O4P1Xf3Gck3VyjfDOv3se5zPPVXGdMdW1Wc9ldy27fVlZzyHtbncvn47mpyzOSnC+ej7l2sfE4XvsoXs94Pbr1Vap1rcTPwhh1sZLnPtu7Pcw5T/LM99Wcu72q+uR9y/1m22qc3B7XmnOe7HGW+7wix6t1e8ef6ePTn8DeovtF624inRz/tH+06jvb8mvVr8pTxa/i4o04tu3OreYV46cne5Vzj9GPG9u6XDOmmtNqv3P/Lu887vbztM+0y9n1mzHVWqp1VvFVru44nh+jXl+XZ77v+kQn+xFjuzXmvLltN4eZt4uJcV85VzldR2V1bVfxu7in3pWXf4dvgN5kdaOqznfyTTsfz3HieE/GzjfhfMOtVG27m82ca+yb+3Rjxpt/NU7OEdeSY7o5Vu15rjE+zqPKmecc5xXb4/HuWsZcoxDHjD+zzzyOeePc8jWqxsnXMJ/v9jeq1p73KL6Pc8254nzi+nJbFZP35DvivnbXZ4xfPxfzfTeHmDfG5DGq/ifnqrnOfYmfixzTifHVWPl6VHGvssq7uka/y584p3+dAuhN3vFhzjej7oby5ObS3QB3MVN1U46v8WFTzTE+BFbHMV+15qy6EeeHU7WXXXvOkV9zzAiqa1CtrzLHiOPlmGrc6hrktti/mnNeW36f92uq+kR5X6vxpzhOlS+eX81pjHp/sti/m1c8362v25fYL76f8XkNq/3N51Z9u/zVZyN+nk73bL4/+azFMaqYr8pry+fjue7zNp3OaXet4vld3Op3oDrP9318+hPYW6w+5E8/0LHP6sab++S4k7FPYqY8r9N+0XdzxBvqqm+3b1X/HPtkjKo99z8ZK+eo2mK+Kn41Ro6LMfn9bk25bdqtqdqHrn88V81/vt/lnPHdeKt5TLs1n1zTuH/d3uRzp3bXZRVTzWmXa4x+3fE4nuuczP2pnHM1xpPxd5+zlSfj8D6+AXqT+eHOH/LqZlfJv7Dx/ckNJcfNc6s+3c24k+e1ip0+P//7Z5gnOU5u2FXMbI8xq+syY/MNPM+vGyu/j/2rz8U8X+1/HmP3uaquexTn1O1ZXn83h8ruGk4xd74+Y/z6QI1z7cbY7X3O3/Wv9nDOczV+nHPsE+c+f3Lf2JbnnsU1VXG7/jEmqq75ar1ZjKuuRfe5ieuIMbvr1a0/68aNdjmmvMaT3GN87RrxfgqgNzn5YFc3ifn+pP8Yv940spNf0NNfxurmWLWvxIdLfDDM15McndOb7pxD1ZbnUK057lc+7vpNc+zuZl99DnbXZ7ef1Z7P9nic1zPPVeNW+cb4X86Ta5v3olvnav2xbzXXk/HjcYzNa6jy57VWc4xtsT1e32oe3XFcU3ydcd18urnldU45f47PsVV8l7uS+8Xj7vrGflXbKr46V7Xla5bbs92YT/PxPgqg36i7OXU3qs4qfndTWN20s3yzzjepLk93w879qhtcvLHuzuc9zDfQkeTx8l7E9rj2eS7H572ZP3Gu8bVab5U75ojziP26/cjz6+YRz80x4rnqfTzO84nn817M83m+U7WO/D7nW/Wt9qqKzfuar1G1xzFPXl91LXdrjuub/fI+x5hVrtPzT62u+25+VfxJv6n7PFbH1efjK6oc+XOVPzc5Purau73hfRRAb1Z9iHe/ID9pdROtbjbxpnK6jnxj292YVjfYeD7niQ+aGBNj47rice4727vcM38+Xu1b1Xe11pgr33DnuVV7Fve/uiar1+p6xfF31zPv8Xyf96tbQ7Wnecx8HPPnNVdjzvP5eHeNdnu0yhP7z+M456p99o/v8/Xq8kd53rFv1ac6V12DOPdqT6r42G+eX/WburWNcZZjtzedvLaTsaJ8nSpPc/KcAug3qG5oJ94VW8m/mPF4d6M8sbrRVTfm+T6/Vv1W8oOhuhHFc9UNfiQnN/u4lnxuvo85qr2tcmRxXau5z7g4bu4T23PO1ecjjhHbqjnlazDb55gxrjqfc82Y+Fq9r+Zf7decX86d42KevI5dn9x/vlbrqOKrsbr1Vnt3cu262Lg3UbWmfH627dq7tngu59nNe6pydudXe7hS9euuU47LOXgtBdBv9uSD/crY7sYc7XLs7G78Y6zHiDf3HD/b5o2vekh0D5B4s8wPj27O+SaWY6sHQZxfdfPLN+y8ltk/xlfjdtcxrzHGd/ue11eta7bnPqt9zfOs5lbliO1Vzpgrvo/7GXNWsXkOcd1zrGoeldXcpm7vsxwXc66u+Sr/7LfKMc2Y7nrEHKdrquz2c77vxojXqeuXx9hdl6o9fv5y20rV7+Qa7c5Fp/t/GncLBdAP6T7AT8+f2vXf3SiznG+Xf4xnv2yrm9d8jTfiea67Acf4/FrFxZ/cPka93nzj/fz8b8HQ3USrnDlHjIviuTl2nEfcky5fzFGtOcZU68s5oura5b4zZ5U3983ryXlzv7z2PFaOXeXOqnGr/evWHde/Gmeac5tjVPsVz/WZ6t/fLkcVOwo5vtuH1dzmPPKezfcn12MV3/XvPg/dNdrl7WKfjF/ZfU5O9vhJ3G0+Pv3vAL3F7oP7Ck9upKtfxFWO77ZXuhvmbPv4+PX/8syxq/Yn663Gy3H5/Rj/ezCfzmG3hnhuvp9jzPexz6rvbk5V3Izp1hzHrPLG/rt1xbj5fhRO1tP1r9barXN1Lp7Pqv3oxqvO7fZwFbeaaz5X6caebVWOfB3yHue4HDvb4n7NmNjWjRXzd2OvVP26MVc5djE7q3k/XdMT78z9t/r4VAC9RfwFf7V8A3naHj2J7axynOb/Tly+gb3aydx2MU/nGG/U1euMmfFV3tVeTTlXPI594/gjyee7fl3/3Gf2y21VjipnHj/Gxfjdelb7vdKNP4+r/NUauvnu9qAav3Iy/u5cZ7e3XZ8x+jk/Gb9y0n+137v+Vd8uduek/0nMK/zUOL+DP4H9YU4+aPEGF8Vfvqo9m7/Uu7hKnOcqxy7/0zl3cbub52pfZ1uOOZnb5+ezP6+cXN8x/jdm9RrnNX/meNUaqjFnvxkTx4jxsX91zePDIR7H+Gof4vvcZ7dHeU/m+ypXXGeOrdYT++X5xzHy2CPJufMe59huTTlHFTeP47ry+HHO87W7nrFtNc5qD7pruFrDnHe1R1MeM8+jiq3WW8XNmBg/9zO3VXaf2yjOrcq5G2vGrNqnXZ6d03H+Rh+fvgF6i+6X6hWqX9In8WPUN5+Tc6ee9H0Su3OyjrwHq/G/M7c4TjWH3TyzVb4YU41TfQambh9i3Gp/YvvpZ606H9u69hyTzbU+OdftTzxfrTMfd+OMQrXOp+vq2nbr7XylX7f+7n3s1507Wc+Jk36nczv1pO+TWN7DN0A/oLsJTvGXoHsfxXwnv0Q5Ph7Hm1Q8zv1epZprHufzc/8twMnedOfyHnTrnDfjqi3GdMdxnGoOM351DeLxyZzj5yG+dp+BGd997mJszJdj4hyrz9DJOmNbnlfuH39i327seJzN/en2vRJz5f2Oqpyrc9Uc59zi3uS2+T7GVvuTz+V++fzqGk15/XlO8zWOfTrWjO2uXcyZ11rF5L6r3J1uD8dYf2aiao/+dn/jOj4+fQP0Fu/+MDz5xT2NPY17lZPx4g1lFzvGOudX22b7GL8++Krj/LqLH0k8fzKvPFae626e1blq36s92OWPcVW/kXTziX1i7tw2z52sI8fG/F3O3G8kq/PzfbUv3Z5VcdVxtScn8/2qk72t4rpzT9qz3bXo9m33eajmPd8/md+p3TzHeM24T/f3X+YboN9g9eGLbbubRNf2VSc5n/7idOvJv9hdn4+P9f/lmFU3i/kaf/FP55Lbu/FjTH6ddsdj7NdX3ZTjDXu+j2utbqyrfPM17ns8V/WdY8e55Fwjybljzm6cmDv26frFOeRzOefMEV/jXsY9ieNV+xTf5/zVvuScI6lyVm1j/G8/dnnicfVajbEbO5/P12qeq+K7Ne7GrPLN83lfq755brFPjo3XcYz+WnX7spLHjHNbfTZOvTLX9NUcX+33ah+fvgF6i5++wN0N76nuhrDqc+qruVb9TnLGX/iT+NwnnjvtexJXqfp2+b6zL/nmOvdmjP2NcrU3OdeMO1nXap3xuBonn6tedznn+Tz/SjfPau257cmcYlw1p5w/t8e2bq+qXPHcaf/Kbo2Vap/y2Pn9LtcqJsed9DmJOfG7xuX/+AboH9Hd/J7qborRV38BvzLHeQPs2k/m9/Hx3/8rPsdXZp8x+kIgtlV7drJPsX+c3+4aVGaOMfo+Vft8v+qT57Pbi5M57/YpzjXmm/mr/aquRz6e/bprnMfNsTlvzh37VnnjcXXNur2rrlk1fv7J/eL+jSTG5z3OMXk9+X1c49jIfWJb1/8kbzX/Lq56n1W58rnVeNVe5verfCdrHuP8ntH5bv+/hQLoTb7zS/s7nd4wOq9e33fmMsZ/5/Mk1+zX7Ue+WeWb1Hf2MfY9uTHHueQHSFzHjOlydfln3hwbf2LsbI/9ur3I+xRz5rl285jvu/FWa466fazmtDL75v6n8xijLlTinq6uVXW8GjNfszjejKmuU3U9Yr/cf4z69yWey3FR3JPcluPi8cl+V6q57q5Fd22eXIf8Pvfp9j062aeV3Z59J3fnHTl3Pj79CewtfvJinn7YVzeX0xw/7WReu5iuPd7wu5tmvhH9xN6dXKc45sn4JzHTKja3VfPoHgjVXlc39ypP1z/q4uf7GVPt36/Zfp1LHrfbi928u/Gq2JUqTzV+F5Njq/Xl80/2L6r67PY1zy3OZzdmXmO35hy/el8d5xzz/W5+0y5ft2dV/OwzY1cxJ7myp9fgu35iDN8A/YGeXvR8A+lUN5qubefpHDurPPGXf2X+ouxuTLsbTT6Xxz65eb7CHDvmrOZXvc+6HPN9tW+r/crzWt2cqxtmnOs8rvZ5vq6uQZ57jK/2pBo/n4s54prmaxy7y5Nf83yrNeU5xPg8ZtzTnKebxyo278l87fYqvo6kWkcU15PPV69ZHrfbuymvJ+fN1yjvS47v9j63x5hq/6v4TtyzXXy3vzkmvu6uWe6X37/LaozVPJ/4+PQNEABwGd8AAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDXUQABANdRAAEA11EAAQDX+X/Z+IWTCJcbtQAAAABJRU5ErkJggg==" |
| 24277 |
}), /*#__PURE__*/ react.createElement("image", { |
| 24278 |
id: "image1_9066_32193", |
| 24279 |
width: 323, |
| 24280 |
height: 489, |
| 24281 |
preserveAspectRatio: "none", |
| 24282 |
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUMAAAHpCAYAAAAYtF6PAAAACXBIWXMAAFGCAABRggFYdP86AAAMQklEQVR4Xu3c0W7bOAJA0ev9/3/OvowADktKspNM2/gcYBBbIinZjS7kupjHx8dHAO/uf1cDAN6BGAIkhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJIUAlhgCVGAJUYghQiSFAJYYAlRgCVGIIUIkhQCWGAJUYAlRiCFCJ4ac8Ho+P8efVOODP9fj4cJ1+lcfj8fHx8fE4fl6NB/4cYvhJwgc/g4/Jn3QWwvnj8fh89RHbx2n4fdwZvujuHeHdj85X+4Hv5c7wRVdhuzNuNI+7c5d49wsc4Jo7w0/6rju68Y6y7kcVeI07Q4DE8NPuflyet119uTKu+8pHaOA5Yviirw7SLn6r2PrIDF9PDF90J0i/I2RfHWl4F2J4051/D3jn293xC5FnwnVn7br+SH31HN6Vb5MvjH9/98w3x981dnQ275U1X5kDP4U7w5vmf+pyNfbs+bj9Kmhn287CdfdcR0LIOxPDhdVH0jEuu9iNH4GvvgTZbX82gGfBezVud2MOP4kYLhzhezZqx88xjs+GZIzuvO7V+MPVMXdR33kmqs+uDX8KMTyxu0PcfQSdI3Y8nqM4rzevdRWf3fjx+PO5r8737DivxuxOwA+vHgO+gy9QJscd4fF43r/7aLv6+DreYY4/d2utYjqu1cIqrFeRuxOqlfm9ubvOM2PhdxHDyeqCv3Mx3xk773tm7NmYO+vuttW/43t37plnx8OfwMfkf4x3WPP2qwv76m5v3D8fZ7fvWGd3XuOY1fZ53mq9j49//53oOO5q25nVsc5eB/wJxBAgMax+/bh53M2Nd07zXc7xfBy3ugsc913dhe3u3pqMx57P+Wze2fZ5/rFt/Ll7vLvrOzvW+BP+BP7OcDBfnHOcxot7te3YvovfuH+1vfZfqhyOtedtx9g7x9yNe8bqda7W3W2r5z9+w3d66zvDXVR2j+c7ryMGx3/HvvnxuH8Vs3m9ce6xfRWcefu85mFc9+rn/PjKLr7Hz9X+8bzH8fA7vf2d4XHBjhfuuO0Y9+zdzbzuHMPdttVaq/XmfXVvndHVazjGrPY/c5zZs2veOc/RZ86N9/W2MdzFaY7UOPYwXmjjhTc/nseutu/mr9ZfuTP/eDy/tvl1N3nlfGbPjr/rK84NRm8Zw7O47caMxqjMz6/CNO4f57cwxupq7DhnHHfnPMb9u2NdrfOVztb9rmOCGP7jiM4cn3nfMX8ctwrcOHe1b15z507cdtvvrH817iqcrx7zO/zOY/P3e6svUB6PX//JzOriWV3g8/xdCOe152OOa49zx2PMxzqbM0d23LZaf2UO3G7fWWjmY87bz85zN+bKOH73+Gzb2Xbez1vdGZ5d6Ed45rGrMePPca35+dm8MVSrx8fzca3V/vG4qxDt5q72X63xHVbvydm4u9v/C7/z2Hy9t7kzHH9x5wCMF+Tx3zx3Dt283hiTq7XOHs/H6cR83Gf2j695N39c4+q858crq/3zn8nV+Hn7OO/s+K/uO3P158Pf5S3uDOdf9tUFNAdyDt7OOGY1ft62Gn92Dk3GOVcxm491jFud07xvt+7Z9q94H67mrbw6D0Y/PobHxVvrj7K757vHx/Nx7fn5aHeRj84CtDruuH0XgV2c5v27deb1rrY9a3WeuzGrfbNnxsLK23xMBjjzo2M43vXMd0HzXcm8/9i3m7c6zmg+xjHm8fj3t6jz/nHNs23zucxjj33jaxyPNb7ucf7uuOO++XxXr/9s3+o8zsYcz1fjVnZjr7bvXveZO2P4O/zoj8nHL+oqNnPkrn6pV+PPts0X+dm4cfxu3fE8ztadjzGOe3bMMa4T49jD+FrG56t5Z2PP5p9Zvf/P7Oc9/fgYri7u1fZx368rnc+9mrcyX4xzpMbHq+PeicZqnXHf6vnZe7OaO6+z88qc2o89W2N+Lasxd7x6zvydfuTH5PFC3kVqtX38hf/4+PX/An3MWYVkN+fM47H+fxCOF+C8b348bhvXG8/pGDMfb15/fj6/njvrN5mPeczZncdu/dUa45yz93GePx9jfnzYveersVeenfPseD7vx90ZXl14O8e4cfx4Ia5icexbrTM/nu3WG50dd94//tytsRuzGlvX793uvVqNm7ddmdc9ts1/Jqt5Z8e72v+q71qX/86PiuHZhVv7i3t1IZ9d3Ctnobmzxjx/frwbv9o+zp/Dtps3r3F1ca/Obzf+KmJn53pnnWfO9a6z9V9Z7xln63/3sd/Zj4/h/Es87z/GzBfiPH+39upCuTtudayz7cfjcf7xuME8f7Xv7HUd4+b9uyDsXtvu+ehs/dX20dlxVu/XvNbuPR23r+a94uw94M/wo2II8Kof+QUKwLPEECAxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgEoMASoxBKjEEKASQ4BKDAEqMQSoxBCgEkOASgwBKjEEqMQQoBJDgKr+D2phk8xYkYdKAAAAAElFTkSuQmCC" |
| 24283 |
}), /*#__PURE__*/ react.createElement("image", { |
| 24284 |
id: "image2_9066_32193", |
| 24285 |
width: 332, |
| 24286 |
height: 174, |
| 24287 |
preserveAspectRatio: "none", |
| 24288 |
xlinkHref: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUwAAACuCAYAAABdlTRiAAAACXBIWXMAAEtbAABLWwHvoCmtAAAISElEQVR4Xu3aWZLbMBIFQHLuf2fOhwMz5eoCUJTZe2aEQyJ2osVnqO3zuq4DgL3/7BoA8IfABGgSmABNAhOgSWACNAlMgCaBCdAkMAGaBCZAk8AEaBKYAE0CE6BJYAI0CUyAJoEJ0CQwAZoEJkCTwARoEpgATQIToElgAjQJTIAmgQnQJDABmgQmQJPABGgSmABNAhOgSWACNAlMgCaBCdAkMAGaBCZAk8AEaBKYAE0CE6BJYAI0CUyAJoEJ0CQwAZoEJkCTwARoEpgATQIToElgAjQJTIAmgQnQJDABmgQmQJPABGgSmABNAhOgSWACNAlMgCaBCdAkMAGaBCZAk8AEaBKYAE0CE6BJYAI0CUyAJoEJ0CQwAZoEJkCTwARoEpgATQIToElgAjQJTIAmgQnQJDABmgQmQJPABGgSmABNAhOgSWACNAlMgCaBCdAkMAGaBCZAk8AEaBKYAE0CE6BJYAI0CUyAJoEJ0CQwAZoEJkCTwARoEpgATQIToElgAjQJTIAmgQnQJDABmgQmQJPABGgSmABNAhOgSWACNAlMgCaBCdAkMAGaBCZAk8AEaBKYAE0CE6BJYAI0CUyAJoEJ0CQwAZoEJkCTwARoEpgATQLzCzjP89q1AT6fwPxk53le13Wd4/2uPfB5zuvyjAJ0OGE+JJ8OZ6fFWO5ECd+LwHzI+Fo9u87l46v4K6EpdOFz+Er+TkaQxeCMv698bx85F/wWTpgPySe967rOKrCqE+F7nBKFJTxPYD5kF47ViXPIp9Dc9189ORb8Zr6S3zD7mhvD8M5X4V3bXT3wsZwwJ87zvPJpbxVeOSyfONW9EpZPn1DjPsBvJzALI/hGYFVfmaOqXTQLnNm4nfdZ9TvUbtuVsQ93+sBPJTCT1dfg2eltV54DZxY+1Uk2nljzuuI4u9COOm2yV/rAT+N3mMe93xV2AjWfHLtjR7OAXM1d1cXyV9cC/PErA7M6+Y33+TQYy2djPRGQO+81LtD3K7+SX1f9+8mqvmpznvN/CImBO2uT7dp1wjKPsRvzrn8dr9O/0wY+068IzCrgVqfI6gQa5UB9ShW01Qk296kC9en1rU7Y8TWXD9VfOkfy9JrhaT/+K3kOxlieAzK3m4Vovh7tcvtdAHTa3Gk35LVW9XfGm1mN89Qc8JX8uMD8l5PLLgCOo/ffdWbBPOuTw3ZWfxz7k173XrMn+q/Wv2oD38WP+UpenRLHn9gmtxvXVdDG9vGhz+2Gar7V+1gWQzEa442xZ2Pmuas23bWv2s3s5p61ueuVtcFTvv0JcxYy1clsd8K5W79qPwvaV0Nj1X+37m6bSuz36hgf6Tuske/r254wc4CME1InLM/zz8lxdfqK9VW7PN6RxLVU16Pf7Ho2Zi6blef+uU11v0eSw2c3xkfYzSkseU/fJjBjkOzCIJbHQB39Y30MtKr/rGwVHjn08pyxLF7vAjher4J1Zuzdbq5hFz53AnRWV/084av68l/JY7DkE88s/HL72etunvg66kbbqv9s7FfkOTvtOn0665u16fSN7Vb7NOt7p81x7PcHnvTlTpjn5MQRH8LcZjw0q9eq/Rg3lo3rHJaxLsr94zhV+6ouzjleq6CZjfdUWI45Zm2qfavWNNv3WLey2/exxs5Yd8z2F4YvEZg5KGYBtwugVX1+v3o44oM41lM9oGO91QNdXa/uqRqrWseRxHCK5asgm917nqMbilWbcb0LtWrssRdV++PYj9mxuieYOa9P+kq++8DGAJm9jj7xAcvv89izsBht8rhVm7c9385bBU+U153lPrv2M3nfZvVV353Oz6Dq06nbrauqf2rsu54ej6/rQwNzF1azuvjQz9rEhyGWdQIjt411d6+rsfL68/tqrKhTt5rvOPZBv5ojtptdz+T7vKu6r12fqHt/0PGuX8njAxs/sPF1/Mlt4588Vjb65zazwKjKZ33jOmZtc9ns4Yxl+b7j++pehrwnVRjksrju2Tqr/encZ67Pbcd9rtqt5PuKdbv5o9ka7owB7xKYs/CJ1zHk8vWRjIcuP3yzUKoe0lUIjH6xPo6R66pxcvtZ2FR1cQ9G/6pPXFtuH/cyjpH3K19Xe16Nm/ez2uPj+Huf477N9r1j9zOr2uR9qOqq+4r1lc59dNrwPZ3XP34l7344qg/3LFhy+9Fn1j6WV2ETr3ObStVv9XAOMSCq8iHW57VXD/Fq/rwnswBY7We1htl41VhV/Wrc2X3G/rPxcvtV34+ymjfWfdb6eM6twJw9BPkhyzoP0Gr8/H4lz/XKeldtd9e575FU88Z2s/vNY96Zc7Sf1XXc6Z/3P9cdx/wvudzmeMFq7+P+vTr+U77CGrhnGZizYJg94LlP7ldd78pX8pz5YeiMl+9rtrbjeLsf4/2svKrbPSS7h30316osv89jrOZYtT+CXLaaf7ZXs70ddas5ctluv2d2P4dVG36u//0OM34w84c0lsUPSyyrPuyV/CGL4817/d91/f07yryG6gHrvN89XHncPFdeT1WX+1dl1f7m+tVcsV9+Xd3bGHvWNs4by7pzxLo812qv4s971K3WcRx/7+NqPSuzfnnvn/Ze4/KM87quNz+k/AGs5DZ3Pkid8buqdcQHsno9jrcPbX4/2qzmWpXn+YZZWdV3vD8Ks3vK7ar+1Rp25cfx9p52a5zZ7Uv1s6nGqczWetcrfV/pU3lqHJ53Xjd+hwnwm73LfysC+IkEJkCTwARoEpgATQIToElgAjQJTIAmgQnQJDABmgQmQJPABGgSmABNAhOgSWACNAlMgCaBCdAkMAGaBCZAk8AEaBKYAE0CE6BJYAI0CUyApv8CbNNILtJ4154AAAAASUVORK5CYII=" |
| 24289 |
}))); |
| 24290 |
}; |
| 24291 |
})); |
| 24292 |
|
| 24293 |
//#endregion |
| 24294 |
//#region app/modules/kit-library/assets/js/pages/cloud/deactivated-screen.js |
| 24295 |
function DeactivatedScreen(_ref) { |
| 24296 |
var menuItems = _ref.menuItems; |
| 24297 |
var forceRefetch = _ref.forceRefetch; |
| 24298 |
var isFetching = _ref.isFetching; |
| 24299 |
return /*#__PURE__*/ react.default.createElement(Index$1, { |
| 24300 |
sidebar: /*#__PURE__*/ react.default.createElement(IndexSidebar, { menuItems }), |
| 24301 |
header: /*#__PURE__*/ react.default.createElement(IndexHeader, { |
| 24302 |
refetch: function refetch() { |
| 24303 |
forceRefetch(); |
| 24304 |
}, |
| 24305 |
isFetching |
| 24306 |
}) |
| 24307 |
}, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__index-layout-container" }, /*#__PURE__*/ react.default.createElement(Content, { className: "e-kit-library__index-layout-main e-kit-library__connect-container" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 24308 |
container: true, |
| 24309 |
alignItems: "center", |
| 24310 |
justify: "center", |
| 24311 |
direction: "column", |
| 24312 |
className: "e-kit-library__error-screen" |
| 24313 |
}, /*#__PURE__*/ react.default.createElement(DeactivatedIcon, null), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 24314 |
tag: "h3", |
| 24315 |
variant: "display-1", |
| 24316 |
className: "e-kit-library__error-screen-title" |
| 24317 |
}, (0, _wordpress_i18n.__)("Your library has been deactivated", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 24318 |
variant: "xl", |
| 24319 |
className: "e-kit-library__error-screen-description" |
| 24320 |
}, (0, _wordpress_i18n.__)("Your subscription is currently deactivated, but you still have a 90 day window to keep all your templates safe. Upgrade within this time to continue enjoying them without interruption.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 24321 |
text: (0, _wordpress_i18n.__)("Upgrade now", "elementor"), |
| 24322 |
url: "https://go.elementor.com/go-pro-cloud-website-templates-library-advanced/", |
| 24323 |
target: "_blank", |
| 24324 |
className: "e-kit-library__upgrade-button" |
| 24325 |
}))))); |
| 24326 |
} |
| 24327 |
var import_prop_types$15; |
| 24328 |
var init_deactivated_screen = __esmMin((() => { |
| 24329 |
import_prop_types$15 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24330 |
init_content(); |
| 24331 |
init_index_header(); |
| 24332 |
init_index_sidebar(); |
| 24333 |
init_layout(); |
| 24334 |
init_deactivated_icon(); |
| 24335 |
DeactivatedScreen.propTypes = { |
| 24336 |
menuItems: import_prop_types$15.default.array.isRequired, |
| 24337 |
forceRefetch: import_prop_types$15.default.func.isRequired, |
| 24338 |
isFetching: import_prop_types$15.default.bool.isRequired |
| 24339 |
}; |
| 24340 |
})); |
| 24341 |
|
| 24342 |
//#endregion |
| 24343 |
//#region app/modules/kit-library/assets/js/pages/cloud/full-page-loader.js |
| 24344 |
function FullPageLoader(_ref) { |
| 24345 |
var menuItems = _ref.menuItems; |
| 24346 |
var forceRefetch = _ref.forceRefetch; |
| 24347 |
var isFetching = _ref.isFetching; |
| 24348 |
return /*#__PURE__*/ react.default.createElement(Index$1, { |
| 24349 |
sidebar: /*#__PURE__*/ react.default.createElement(IndexSidebar, { menuItems }), |
| 24350 |
header: /*#__PURE__*/ react.default.createElement(IndexHeader, { |
| 24351 |
refetch: function refetch() { |
| 24352 |
forceRefetch(); |
| 24353 |
}, |
| 24354 |
isFetching |
| 24355 |
}) |
| 24356 |
}, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__index-layout-container" }, /*#__PURE__*/ react.default.createElement(Content, { className: "e-kit-library__index-layout-main" }, /*#__PURE__*/ react.default.createElement(PageLoader, null)))); |
| 24357 |
} |
| 24358 |
var import_prop_types$14; |
| 24359 |
var init_full_page_loader = __esmMin((() => { |
| 24360 |
import_prop_types$14 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24361 |
init_content(); |
| 24362 |
init_index_header(); |
| 24363 |
init_index_sidebar(); |
| 24364 |
init_layout(); |
| 24365 |
init_page_loader(); |
| 24366 |
FullPageLoader.propTypes = { |
| 24367 |
menuItems: import_prop_types$14.default.array.isRequired, |
| 24368 |
forceRefetch: import_prop_types$14.default.func.isRequired, |
| 24369 |
isFetching: import_prop_types$14.default.bool.isRequired |
| 24370 |
}; |
| 24371 |
})); |
| 24372 |
|
| 24373 |
//#endregion |
| 24374 |
//#region app/modules/kit-library/assets/js/pages/cloud/cloud.js |
| 24375 |
function ownKeys$2(e, r) { |
| 24376 |
var t = Object.keys(e); |
| 24377 |
if (Object.getOwnPropertySymbols) { |
| 24378 |
var o = Object.getOwnPropertySymbols(e); |
| 24379 |
r && (o = o.filter(function(r) { |
| 24380 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 24381 |
})), t.push.apply(t, o); |
| 24382 |
} |
| 24383 |
return t; |
| 24384 |
} |
| 24385 |
function _objectSpread$1(e) { |
| 24386 |
for (var r = 1; r < arguments.length; r++) { |
| 24387 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 24388 |
r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) { |
| 24389 |
_defineProperty$1(e, r, t[r]); |
| 24390 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) { |
| 24391 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 24392 |
}); |
| 24393 |
} |
| 24394 |
return e; |
| 24395 |
} |
| 24396 |
function Cloud(_ref) { |
| 24397 |
var _elementorCommon; |
| 24398 |
var _ref$path = _ref.path; |
| 24399 |
var path = _ref$path === void 0 ? "" : _ref$path; |
| 24400 |
var _ref$renderNoResultsC = _ref.renderNoResultsComponent; |
| 24401 |
var renderNoResultsComponent = _ref$renderNoResultsC === void 0 ? function(_ref2) { |
| 24402 |
return _ref2.defaultComponent; |
| 24403 |
} : _ref$renderNoResultsC; |
| 24404 |
usePageTitle({ title: (0, _wordpress_i18n.__)("Website Templates", "elementor") }); |
| 24405 |
var _useConnectState = useConnectState(); |
| 24406 |
var isConnected = _useConnectState.isConnected; |
| 24407 |
var isConnecting = _useConnectState.isConnecting; |
| 24408 |
var setConnecting = _useConnectState.setConnecting; |
| 24409 |
var handleConnectSuccess = _useConnectState.handleConnectSuccess; |
| 24410 |
var handleConnectError = _useConnectState.handleConnectError; |
| 24411 |
var _useCloudKits = useCloudKits(); |
| 24412 |
var data = _useCloudKits.data; |
| 24413 |
var isSuccess = _useCloudKits.isSuccess; |
| 24414 |
var isLoading = _useCloudKits.isLoading; |
| 24415 |
var isFetching = _useCloudKits.isFetching; |
| 24416 |
var isError = _useCloudKits.isError; |
| 24417 |
var queryParams = _useCloudKits.queryParams; |
| 24418 |
var setQueryParams = _useCloudKits.setQueryParams; |
| 24419 |
var clearQueryParams = _useCloudKits.clearQueryParams; |
| 24420 |
var forceRefetch = _useCloudKits.forceRefetch; |
| 24421 |
var isFilterActive = _useCloudKits.isFilterActive; |
| 24422 |
var _useCloudKitsEligibil = useCloudKitsEligibility({ enabled: isConnected }); |
| 24423 |
var cloudKitsData = _useCloudKitsEligibil.data; |
| 24424 |
var isCheckingEligibility = _useCloudKitsEligibil.isLoading; |
| 24425 |
var refetchEligibility = _useCloudKitsEligibil.refetch; |
| 24426 |
var _useCloudKitsQuota = useCloudKitsQuota({ enabled: isConnected }); |
| 24427 |
var quotaData = _useCloudKitsQuota.data; |
| 24428 |
var isLoadingQuota = _useCloudKitsQuota.isLoading; |
| 24429 |
var isCloudKitsAvailable = (cloudKitsData === null || cloudKitsData === void 0 ? void 0 : cloudKitsData.is_eligible) || false; |
| 24430 |
var isDeactivated = quotaData && isCloudKitsDeactivated(quotaData); |
| 24431 |
var exportUrl = (_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.config) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.experimentalFeatures) !== null && _elementorCommon !== void 0 && _elementorCommon["import-export-customization"] ? elementorAppConfig.base_url + "#/export-customization" : elementorAppConfig.base_url + "#/export"; |
| 24432 |
var menuItems = useMenuItems(path); |
| 24433 |
var onConnectSuccess = function onConnectSuccess() { |
| 24434 |
refetchEligibility(); |
| 24435 |
forceRefetch(); |
| 24436 |
handleConnectSuccess(); |
| 24437 |
}; |
| 24438 |
var onConnectError = function onConnectError() { |
| 24439 |
handleConnectError(); |
| 24440 |
}; |
| 24441 |
var shouldShowLoading = isConnecting || isCheckingEligibility || isConnected && isLoading; |
| 24442 |
(0, react.useEffect)(function() { |
| 24443 |
if (isConnecting && !isCheckingEligibility && !isLoading) setConnecting(false); |
| 24444 |
}, [ |
| 24445 |
isConnecting, |
| 24446 |
isCheckingEligibility, |
| 24447 |
isLoading, |
| 24448 |
setConnecting |
| 24449 |
]); |
| 24450 |
(0, react.useEffect)(function() { |
| 24451 |
AppsEventTracking.sendPageViewsWebsiteTemplates(elementorCommon.eventsManager.config.secondaryLocations.kitLibrary.cloudKitLibrary); |
| 24452 |
}, []); |
| 24453 |
if (!isConnected) return /*#__PURE__*/ react.default.createElement(ConnectScreen, { |
| 24454 |
onConnectSuccess, |
| 24455 |
onConnectError, |
| 24456 |
menuItems, |
| 24457 |
forceRefetch, |
| 24458 |
isFetching |
| 24459 |
}); |
| 24460 |
if (shouldShowLoading) return /*#__PURE__*/ react.default.createElement(FullPageLoader, { |
| 24461 |
menuItems, |
| 24462 |
forceRefetch, |
| 24463 |
isFetching |
| 24464 |
}); |
| 24465 |
if (isDeactivated && !shouldShowLoading) return /*#__PURE__*/ react.default.createElement(DeactivatedScreen, { |
| 24466 |
menuItems, |
| 24467 |
forceRefetch, |
| 24468 |
isFetching |
| 24469 |
}); |
| 24470 |
if (!isCloudKitsAvailable && !shouldShowLoading) return /*#__PURE__*/ react.default.createElement(UpgradeScreen, { |
| 24471 |
menuItems, |
| 24472 |
forceRefetch, |
| 24473 |
isFetching, |
| 24474 |
cloudKitsData |
| 24475 |
}); |
| 24476 |
return /*#__PURE__*/ react.default.createElement(Index$1, { |
| 24477 |
sidebar: /*#__PURE__*/ react.default.createElement(IndexSidebar, { menuItems }), |
| 24478 |
header: /*#__PURE__*/ react.default.createElement(IndexHeader, { |
| 24479 |
refetch: function refetch() { |
| 24480 |
forceRefetch(); |
| 24481 |
}, |
| 24482 |
isFetching |
| 24483 |
}) |
| 24484 |
}, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__index-layout-container" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 24485 |
container: true, |
| 24486 |
className: "e-kit-library__index-layout-heading" |
| 24487 |
}, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 24488 |
item: true, |
| 24489 |
className: "e-kit-library__index-layout-heading-search" |
| 24490 |
}, /*#__PURE__*/ react.default.createElement(SearchInput, { |
| 24491 |
placeholder: (0, _wordpress_i18n.__)("Search my Website Templates...", "elementor"), |
| 24492 |
value: queryParams.search, |
| 24493 |
onChange: function onChange(value) { |
| 24494 |
setQueryParams(function(prev) { |
| 24495 |
return _objectSpread$1(_objectSpread$1({}, prev), {}, { search: value }); |
| 24496 |
}); |
| 24497 |
} |
| 24498 |
})), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 24499 |
item: true, |
| 24500 |
className: "e-kit-library__index-layout-heading-quota" |
| 24501 |
}, !isLoadingQuota && (quotaData === null || quotaData === void 0 ? void 0 : quotaData.storage) && /*#__PURE__*/ react.default.createElement(QuotaBar, { |
| 24502 |
used: quotaData.storage.currentUsage, |
| 24503 |
total: quotaData.storage.threshold, |
| 24504 |
unit: quotaData.storage.unit |
| 24505 |
}))), !isLoadingQuota && (quotaData === null || quotaData === void 0 ? void 0 : quotaData.storage) && /*#__PURE__*/ react.default.createElement(QuotaNotification, { usagePercentage: Math.min(quotaData.storage.currentUsage / quotaData.storage.threshold * 100, 100) }), /*#__PURE__*/ react.default.createElement(Content, { className: "e-kit-library__index-layout-main" }, /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, isError && /*#__PURE__*/ react.default.createElement(ErrorScreen, { |
| 24506 |
title: (0, _wordpress_i18n.__)("Something went wrong.", "elementor"), |
| 24507 |
description: (0, _wordpress_i18n.__)("Nothing to worry about, use 🔄 on the top corner to try again. If the problem continues, head over to the Help Center.", "elementor"), |
| 24508 |
button: { |
| 24509 |
text: (0, _wordpress_i18n.__)("Learn More", "elementor"), |
| 24510 |
url: "https://go.elementor.com/app-kit-library-error/", |
| 24511 |
target: "_blank" |
| 24512 |
} |
| 24513 |
}), isSuccess && 0 < data.length && /*#__PURE__*/ react.default.createElement(KitListCloud, { |
| 24514 |
data, |
| 24515 |
source: path |
| 24516 |
}), isSuccess && 0 === data.length && (queryParams.search ? /*#__PURE__*/ react.default.createElement(ErrorScreen, { |
| 24517 |
title: (0, _wordpress_i18n.__)("No Website Templates found for your search", "elementor"), |
| 24518 |
description: (0, _wordpress_i18n.__)("Try different keywords or ", "elementor"), |
| 24519 |
button: { |
| 24520 |
text: (0, _wordpress_i18n.__)("Continue browsing.", "elementor"), |
| 24521 |
action: clearQueryParams |
| 24522 |
} |
| 24523 |
}) : renderNoResultsComponent({ |
| 24524 |
defaultComponent: /*#__PURE__*/ react.default.createElement(ErrorScreen, { |
| 24525 |
title: (0, _wordpress_i18n.__)("No Website Templates to show here yet", "elementor"), |
| 24526 |
description: (0, _wordpress_i18n.__)("Once you export a Website to the cloud, you'll find it here and be able to use it on all your sites.", "elementor"), |
| 24527 |
newLineButton: true, |
| 24528 |
button: { |
| 24529 |
text: (0, _wordpress_i18n.__)("Export this site", "elementor"), |
| 24530 |
url: exportUrl, |
| 24531 |
target: "_blank", |
| 24532 |
variant: "contained", |
| 24533 |
color: "primary" |
| 24534 |
} |
| 24535 |
}), |
| 24536 |
isFilterActive |
| 24537 |
})))))); |
| 24538 |
} |
| 24539 |
var import_prop_types$13; |
| 24540 |
var init_cloud = __esmMin((() => { |
| 24541 |
init_defineProperty$1(); |
| 24542 |
init_content(); |
| 24543 |
init_error_screen(); |
| 24544 |
init_index_header(); |
| 24545 |
init_index_sidebar(); |
| 24546 |
init_kit_list_cloud(); |
| 24547 |
init_layout(); |
| 24548 |
init_quota_bar(); |
| 24549 |
init_quota_notification(); |
| 24550 |
init_search_input(); |
| 24551 |
init_use_cloud_kits(); |
| 24552 |
init_use_cloud_kits_eligibility(); |
| 24553 |
init_use_cloud_kits_quota(); |
| 24554 |
init_use_menu_items(); |
| 24555 |
init_use_connect_state(); |
| 24556 |
init_use_page_title(); |
| 24557 |
init_apps_event_tracking(); |
| 24558 |
init_utils$1(); |
| 24559 |
import_prop_types$13 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24560 |
init_connect_screen(); |
| 24561 |
init_upgrade_screen(); |
| 24562 |
init_deactivated_screen(); |
| 24563 |
init_full_page_loader(); |
| 24564 |
init_index$1(); |
| 24565 |
__name(ownKeys$2, "ownKeys"); |
| 24566 |
__name(_objectSpread$1, "_objectSpread"); |
| 24567 |
Cloud.propTypes = { |
| 24568 |
path: import_prop_types$13.default.string, |
| 24569 |
renderNoResultsComponent: import_prop_types$13.default.func |
| 24570 |
}; |
| 24571 |
})); |
| 24572 |
|
| 24573 |
//#endregion |
| 24574 |
//#region app/modules/kit-library/assets/js/components/kit-already-applied-dialog.js |
| 24575 |
function KitAlreadyAppliedDialog(props) { |
| 24576 |
var tracking = useTracking(); |
| 24577 |
var _useQueryParams$getAl = useQueryParams().getAll(); |
| 24578 |
var returnToParam = _useQueryParams$getAl.return_to; |
| 24579 |
var noAutomaticRedirectParam = _useQueryParams$getAl.no_automatic_redirect; |
| 24580 |
var getRemoveKitUrl = function getRemoveKitUrl() { |
| 24581 |
var elementorToolsUrl = elementorAppConfig["import-export"].tools_url; |
| 24582 |
var url = new URL(elementorToolsUrl); |
| 24583 |
url.searchParams.append("referrer_kit", props.id); |
| 24584 |
url.searchParams.append("scroll_to_revert", "1"); |
| 24585 |
if (returnToParam) url.searchParams.append("return_to", returnToParam); |
| 24586 |
if (noAutomaticRedirectParam) url.searchParams.append("no_automatic_redirect", noAutomaticRedirectParam); |
| 24587 |
url.hash = "tab-import-export-kit"; |
| 24588 |
return url.toString(); |
| 24589 |
}; |
| 24590 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Dialog, { |
| 24591 |
title: (0, _wordpress_i18n.__)("You've already applied a Website Templates.", "elementor"), |
| 24592 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Applying two Website Templates on the same website will mix global styles and colors and hurt your site's performance.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement("br", null), (0, _wordpress_i18n.__)("Remove the existing Website Template before applying a new one.", "elementor")), |
| 24593 |
approveButtonText: (0, _wordpress_i18n.__)("Remove existing", "elementor"), |
| 24594 |
approveButtonColor: "primary", |
| 24595 |
approveButtonOnClick: function approveButtonOnClick() { |
| 24596 |
return tracking.trackKitdemoApplyRemoveExisting(true, function() { |
| 24597 |
location.href = getRemoveKitUrl(); |
| 24598 |
}); |
| 24599 |
}, |
| 24600 |
dismissButtonText: (0, _wordpress_i18n.__)("Apply anyway", "elementor"), |
| 24601 |
dismissButtonOnClick: function dismissButtonOnClick() { |
| 24602 |
return tracking.trackKitdemoApplyRemoveExisting(false, props.dismissButtonOnClick); |
| 24603 |
}, |
| 24604 |
onClose: props.onClose |
| 24605 |
}); |
| 24606 |
} |
| 24607 |
var import_prop_types$12; |
| 24608 |
var init_kit_already_applied_dialog = __esmMin((() => { |
| 24609 |
import_prop_types$12 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24610 |
init_tracking_context(); |
| 24611 |
init_use_query_params(); |
| 24612 |
KitAlreadyAppliedDialog.propTypes = { |
| 24613 |
id: import_prop_types$12.default.string.isRequired, |
| 24614 |
dismissButtonOnClick: import_prop_types$12.default.func.isRequired, |
| 24615 |
onClose: import_prop_types$12.default.func.isRequired |
| 24616 |
}; |
| 24617 |
})); |
| 24618 |
|
| 24619 |
//#endregion |
| 24620 |
//#region app/modules/kit-library/assets/js/components/apply-kit-dialog.js |
| 24621 |
function ApplyKitDialog(props) { |
| 24622 |
var navigate = useNavigate(); |
| 24623 |
var tracking = useTracking(); |
| 24624 |
var returnTo = useReturnTo(); |
| 24625 |
var startImportProcess = (0, react.useCallback)(function() { |
| 24626 |
var _elementorCommon; |
| 24627 |
var applyAll = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; |
| 24628 |
var url = ""; |
| 24629 |
if ((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.config) !== null && _elementorCommon !== void 0 && _elementorCommon.experimentalFeatures["import-export-customization"]) { |
| 24630 |
url = "import-customization?referrer=kit-library&id=".concat(props.id, "&file_url=").concat(encodeURIComponent(props.downloadLink)); |
| 24631 |
if (applyAll) url += "&action_type=apply-all"; |
| 24632 |
if (returnTo) url += "&return_to=".concat(encodeURIComponent(returnTo), "&no_automatic_redirect=true"); |
| 24633 |
} else { |
| 24634 |
url = "/import/process" + "?id=".concat(props.id) + "&file_url=".concat(encodeURIComponent(props.downloadLink)) + "&nonce=".concat(props.nonce, "&referrer=kit-library"); |
| 24635 |
if (applyAll) url += "&action_type=apply-all"; |
| 24636 |
if (returnTo) url += "&return_to=".concat(encodeURIComponent(returnTo), "&no_automatic_redirect=true"); |
| 24637 |
} |
| 24638 |
tracking.trackKitdemoApplyAllOrCustomize(applyAll, function() { |
| 24639 |
return navigate(url); |
| 24640 |
}); |
| 24641 |
}, [ |
| 24642 |
props.downloadLink, |
| 24643 |
props.nonce, |
| 24644 |
props.id, |
| 24645 |
tracking, |
| 24646 |
navigate, |
| 24647 |
returnTo |
| 24648 |
]); |
| 24649 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Dialog, { |
| 24650 |
title: (0, _wordpress_i18n.__)("Apply %s?", "elementor").replace("%s", props.title), |
| 24651 |
text: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("You can use everything in this kit, or Customize to only include some items.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), /*#__PURE__*/ react.default.createElement("br", null), (0, _wordpress_i18n.__)("By applying the entire kit, you'll override any styles, settings or content already on your site.", "elementor")), |
| 24652 |
approveButtonText: (0, _wordpress_i18n.__)("Apply All", "elementor"), |
| 24653 |
approveButtonColor: "primary", |
| 24654 |
approveButtonOnClick: function approveButtonOnClick() { |
| 24655 |
return startImportProcess(true); |
| 24656 |
}, |
| 24657 |
dismissButtonText: (0, _wordpress_i18n.__)("Customize", "elementor"), |
| 24658 |
dismissButtonOnClick: function dismissButtonOnClick() { |
| 24659 |
return startImportProcess(false); |
| 24660 |
}, |
| 24661 |
onClose: props.onClose |
| 24662 |
}); |
| 24663 |
} |
| 24664 |
var import_prop_types$11; |
| 24665 |
var init_apply_kit_dialog = __esmMin((() => { |
| 24666 |
import_prop_types$11 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24667 |
init_es$1(); |
| 24668 |
init_tracking_context(); |
| 24669 |
init_return_to_context(); |
| 24670 |
ApplyKitDialog.propTypes = { |
| 24671 |
id: import_prop_types$11.default.string.isRequired, |
| 24672 |
downloadLink: import_prop_types$11.default.string.isRequired, |
| 24673 |
nonce: import_prop_types$11.default.string.isRequired, |
| 24674 |
onClose: import_prop_types$11.default.func.isRequired, |
| 24675 |
title: import_prop_types$11.default.string |
| 24676 |
}; |
| 24677 |
ApplyKitDialog.defaultProps = { title: "Kit" }; |
| 24678 |
})); |
| 24679 |
|
| 24680 |
//#endregion |
| 24681 |
//#region app/modules/kit-library/assets/js/components/kit-dialog.js |
| 24682 |
function KitDialog(props) { |
| 24683 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 24684 |
var applyAnyway = _useState2[0]; |
| 24685 |
var setApplyAnyway = _useState2[1]; |
| 24686 |
if (!!elementorAppConfig["import-export"].lastImportedSession.session_id && !applyAnyway) return /*#__PURE__*/ react.default.createElement(KitAlreadyAppliedDialog, { |
| 24687 |
id: props.id, |
| 24688 |
dismissButtonOnClick: function dismissButtonOnClick() { |
| 24689 |
return setApplyAnyway(true); |
| 24690 |
}, |
| 24691 |
onClose: props.onClose |
| 24692 |
}); |
| 24693 |
return /*#__PURE__*/ react.default.createElement(ApplyKitDialog, { |
| 24694 |
id: props.id, |
| 24695 |
downloadLink: props.downloadLinkData.data.download_link, |
| 24696 |
nonce: props.downloadLinkData.meta.nonce, |
| 24697 |
onClose: props.onClose |
| 24698 |
}); |
| 24699 |
} |
| 24700 |
var import_prop_types$10; |
| 24701 |
var init_kit_dialog = __esmMin((() => { |
| 24702 |
import_prop_types$10 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24703 |
init_slicedToArray(); |
| 24704 |
init_kit_already_applied_dialog(); |
| 24705 |
init_apply_kit_dialog(); |
| 24706 |
KitDialog.propTypes = { |
| 24707 |
id: import_prop_types$10.default.string.isRequired, |
| 24708 |
downloadLinkData: import_prop_types$10.default.object.isRequired, |
| 24709 |
onClose: import_prop_types$10.default.func.isRequired |
| 24710 |
}; |
| 24711 |
})); |
| 24712 |
|
| 24713 |
//#endregion |
| 24714 |
//#region app/modules/kit-library/assets/js/components/connect-dialog.js |
| 24715 |
function ConnectDialog(props) { |
| 24716 |
var settings = useSettingsContext().settings; |
| 24717 |
var approveButtonRef = useRef$2(); |
| 24718 |
useEffect$2(function() { |
| 24719 |
jQuery(approveButtonRef.current).elementorConnect({ |
| 24720 |
success: function success(e, data) { |
| 24721 |
return props.onSuccess(data); |
| 24722 |
}, |
| 24723 |
error: function error() { |
| 24724 |
return props.onError((0, _wordpress_i18n.__)("Unable to connect", "elementor")); |
| 24725 |
}, |
| 24726 |
parseUrl: function parseUrl(url) { |
| 24727 |
return url.replace("%%page%%", props.pageId); |
| 24728 |
} |
| 24729 |
}); |
| 24730 |
}, []); |
| 24731 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Dialog, { |
| 24732 |
title: (0, _wordpress_i18n.__)("Connect to Template Library", "elementor"), |
| 24733 |
text: (0, _wordpress_i18n.__)("Access this template and our entire library by creating a free personal account", "elementor"), |
| 24734 |
approveButtonText: (0, _wordpress_i18n.__)("Get Started", "elementor"), |
| 24735 |
approveButtonUrl: settings.library_connect_url, |
| 24736 |
approveButtonOnClick: function approveButtonOnClick() { |
| 24737 |
return props.onClose(); |
| 24738 |
}, |
| 24739 |
approveButtonColor: "primary", |
| 24740 |
approveButtonRef, |
| 24741 |
dismissButtonText: (0, _wordpress_i18n.__)("Cancel", "elementor"), |
| 24742 |
dismissButtonOnClick: function dismissButtonOnClick() { |
| 24743 |
return props.onClose(); |
| 24744 |
}, |
| 24745 |
onClose: function onClose() { |
| 24746 |
return props.onClose(); |
| 24747 |
} |
| 24748 |
}); |
| 24749 |
} |
| 24750 |
var import_prop_types$9, _React, useEffect$2, useRef$2; |
| 24751 |
var init_connect_dialog = __esmMin((() => { |
| 24752 |
import_prop_types$9 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24753 |
init_settings_context(); |
| 24754 |
_React = react.default; |
| 24755 |
useEffect$2 = _React.useEffect; |
| 24756 |
useRef$2 = _React.useRef; |
| 24757 |
ConnectDialog.propTypes = { |
| 24758 |
onClose: import_prop_types$9.default.func.isRequired, |
| 24759 |
onError: import_prop_types$9.default.func.isRequired, |
| 24760 |
onSuccess: import_prop_types$9.default.func.isRequired, |
| 24761 |
pageId: import_prop_types$9.default.string |
| 24762 |
}; |
| 24763 |
})); |
| 24764 |
|
| 24765 |
//#endregion |
| 24766 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/layout/header-back-button.scss |
| 24767 |
var init_header_back_button$1 = __esmMin((() => {})); |
| 24768 |
|
| 24769 |
//#endregion |
| 24770 |
//#region app/modules/kit-library/assets/js/components/layout/header-back-button.js |
| 24771 |
function HeaderBackButton(props) { |
| 24772 |
var navigate = useNavigate(); |
| 24773 |
var lastFilter = useLastFilterContext().lastFilter; |
| 24774 |
var tracking = useTracking(); |
| 24775 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__header-back-container" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 24776 |
className: "e-kit-library__header-back", |
| 24777 |
icon: "eicon-chevron-left", |
| 24778 |
text: (0, _wordpress_i18n.__)("Back to Library", "elementor"), |
| 24779 |
onClick: function onClick() { |
| 24780 |
tracking.trackKitdemoOverviewBack(props.kitId, props.kitName, function() { |
| 24781 |
return navigate(wp.url.addQueryArgs("/kit-library", lastFilter)); |
| 24782 |
}); |
| 24783 |
} |
| 24784 |
})); |
| 24785 |
} |
| 24786 |
var import_prop_types$8; |
| 24787 |
var init_header_back_button = __esmMin((() => { |
| 24788 |
import_prop_types$8 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 24789 |
init_last_filter_context(); |
| 24790 |
init_es$1(); |
| 24791 |
init_tracking_context(); |
| 24792 |
init_header_back_button$1(); |
| 24793 |
HeaderBackButton.propTypes = { |
| 24794 |
pageId: import_prop_types$8.default.string.isRequired, |
| 24795 |
kitName: import_prop_types$8.default.string.isRequired, |
| 24796 |
kitId: import_prop_types$8.default.string.isRequired |
| 24797 |
}; |
| 24798 |
})); |
| 24799 |
|
| 24800 |
//#endregion |
| 24801 |
//#region app/modules/kit-library/assets/js/hooks/use-download-link-mutation.js |
| 24802 |
function useDownloadLinkMutation(model, _ref) { |
| 24803 |
var onError = _ref.onError; |
| 24804 |
var onSuccess = _ref.onSuccess; |
| 24805 |
return useMutation((0, react.useCallback)(function() { |
| 24806 |
return $e.data.get("kits/download-link", { id: model.id }, { refresh: true }); |
| 24807 |
}, [model]), { |
| 24808 |
onSuccess, |
| 24809 |
onError |
| 24810 |
}); |
| 24811 |
} |
| 24812 |
var init_use_download_link_mutation = __esmMin((() => { |
| 24813 |
init_es(); |
| 24814 |
})); |
| 24815 |
|
| 24816 |
//#endregion |
| 24817 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/components/item-header.scss |
| 24818 |
var init_item_header$1 = __esmMin((() => {})); |
| 24819 |
|
| 24820 |
//#endregion |
| 24821 |
//#region app/modules/kit-library/assets/js/components/item-header.js |
| 24822 |
/** |
| 24823 |
* Returns the right call to action button. |
| 24824 |
* |
| 24825 |
* @param {Kit} model |
| 24826 |
* @param {Object} root0 |
| 24827 |
* @param {Function} root0.apply |
| 24828 |
* @param {Function} root0.onConnect |
| 24829 |
* @param {Function} root0.onClick |
| 24830 |
* @param {boolean} root0.isApplyLoading |
| 24831 |
* @param {Function} root0.onUpgrade |
| 24832 |
* @return {Object} result |
| 24833 |
*/ |
| 24834 |
function useKitCallToActionButton(model, _ref) { |
| 24835 |
var apply = _ref.apply; |
| 24836 |
var isApplyLoading = _ref.isApplyLoading; |
| 24837 |
var onConnect = _ref.onConnect; |
| 24838 |
var _onClick = _ref.onClick; |
| 24839 |
var _ref$onUpgrade = _ref.onUpgrade; |
| 24840 |
var onUpgrade = _ref$onUpgrade === void 0 ? function() {} : _ref$onUpgrade; |
| 24841 |
var _useKitCallToAction = useKitCallToAction(model.accessTier); |
| 24842 |
var type = _useKitCallToAction.type; |
| 24843 |
var subscriptionPlan = _useKitCallToAction.subscriptionPlan; |
| 24844 |
var promotionUrl = useAddKitPromotionUTM(subscriptionPlan.promotion_url, model.id, model.title); |
| 24845 |
var settings = useSettingsContext().settings; |
| 24846 |
return (0, react.useMemo)(function() { |
| 24847 |
if (type === "connect") return { |
| 24848 |
id: "connect", |
| 24849 |
text: (0, _wordpress_i18n.__)("Apply", "elementor"), |
| 24850 |
hideText: false, |
| 24851 |
variant: "contained", |
| 24852 |
color: "primary", |
| 24853 |
size: "sm", |
| 24854 |
onClick: function onClick(e) { |
| 24855 |
onConnect(e); |
| 24856 |
_onClick === null || _onClick === void 0 || _onClick(e); |
| 24857 |
}, |
| 24858 |
includeHeaderBtnClass: false |
| 24859 |
}; |
| 24860 |
if (type === "promotion" && subscriptionPlan) return { |
| 24861 |
id: "promotion", |
| 24862 |
text: settings.is_pro ? "Upgrade" : "Go ".concat(subscriptionPlan.label), |
| 24863 |
hideText: false, |
| 24864 |
variant: "contained", |
| 24865 |
color: "cta", |
| 24866 |
size: "sm", |
| 24867 |
url: promotionUrl, |
| 24868 |
target: "_blank", |
| 24869 |
onClick: function onClick(e) { |
| 24870 |
onUpgrade === null || onUpgrade === void 0 || onUpgrade(e); |
| 24871 |
}, |
| 24872 |
includeHeaderBtnClass: false |
| 24873 |
}; |
| 24874 |
return { |
| 24875 |
id: "apply", |
| 24876 |
text: (0, _wordpress_i18n.__)("Apply", "elementor"), |
| 24877 |
className: "e-kit-library__apply-button", |
| 24878 |
icon: isApplyLoading ? "eicon-loading eicon-animation-spin" : "", |
| 24879 |
hideText: false, |
| 24880 |
variant: "contained", |
| 24881 |
color: isApplyLoading ? "disabled" : "primary", |
| 24882 |
size: "sm", |
| 24883 |
onClick: function onClick(e) { |
| 24884 |
if (!isApplyLoading) apply(e); |
| 24885 |
_onClick === null || _onClick === void 0 || _onClick(e); |
| 24886 |
}, |
| 24887 |
includeHeaderBtnClass: false |
| 24888 |
}; |
| 24889 |
}, [ |
| 24890 |
type, |
| 24891 |
subscriptionPlan, |
| 24892 |
isApplyLoading, |
| 24893 |
apply |
| 24894 |
]); |
| 24895 |
} |
| 24896 |
function ItemHeader(props) { |
| 24897 |
var updateSettings = useSettingsContext().updateSettings; |
| 24898 |
var tracking = useTracking(); |
| 24899 |
var resetConnect = function resetConnect() { |
| 24900 |
var _elementorCommon; |
| 24901 |
var lc = (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 || (_elementorCommon = _elementorCommon.config) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.library_connect; |
| 24902 |
if (!lc) return; |
| 24903 |
lc.is_connected = false; |
| 24904 |
lc.current_access_level = 0; |
| 24905 |
lc.current_access_tier = TIERS.free; |
| 24906 |
lc.plan_type = TIERS.free; |
| 24907 |
updateSettings({ |
| 24908 |
is_library_connected: false, |
| 24909 |
access_level: 0, |
| 24910 |
access_tier: TIERS.free |
| 24911 |
}); |
| 24912 |
}; |
| 24913 |
var _useState2 = _slicedToArray((0, react.useState)(false), 2); |
| 24914 |
var isConnectDialogOpen = _useState2[0]; |
| 24915 |
var setIsConnectDialogOpen = _useState2[1]; |
| 24916 |
var _useState4 = _slicedToArray((0, react.useState)(null), 2); |
| 24917 |
var downloadLinkData = _useState4[0]; |
| 24918 |
var setDownloadLinkData = _useState4[1]; |
| 24919 |
var _useState6 = _slicedToArray((0, react.useState)(false), 2); |
| 24920 |
var error = _useState6[0]; |
| 24921 |
var setError = _useState6[1]; |
| 24922 |
var handleKitError = function handleKitError(_ref2) { |
| 24923 |
var code = _ref2.code; |
| 24924 |
if (401 === code) { |
| 24925 |
resetConnect(); |
| 24926 |
setIsConnectDialogOpen(true); |
| 24927 |
return; |
| 24928 |
} |
| 24929 |
setError({ |
| 24930 |
code, |
| 24931 |
message: (0, _wordpress_i18n.__)("Something went wrong.", "elementor") |
| 24932 |
}); |
| 24933 |
}; |
| 24934 |
var kitData = { |
| 24935 |
kitName: props.model.title, |
| 24936 |
pageId: props.pageId |
| 24937 |
}; |
| 24938 |
var _useDownloadLinkMutat = useDownloadLinkMutation(props.model, { |
| 24939 |
onSuccess: function onSuccess(_ref3) { |
| 24940 |
var data = _ref3.data; |
| 24941 |
return setDownloadLinkData(data); |
| 24942 |
}, |
| 24943 |
onError: handleKitError |
| 24944 |
}); |
| 24945 |
var apply = _useDownloadLinkMutat.mutate; |
| 24946 |
var isApplyLoading = _useDownloadLinkMutat.isLoading; |
| 24947 |
var _useDownloadLinkMutat2 = useDownloadLinkMutation(props.model, { |
| 24948 |
onSuccess: function onSuccess(response) { |
| 24949 |
try { |
| 24950 |
var _response$data; |
| 24951 |
var linkUrl = response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.data) === null || _response$data === void 0 ? void 0 : _response$data.download_link; |
| 24952 |
if (linkUrl) window.open(linkUrl, "_blank"); |
| 24953 |
} catch (e) { |
| 24954 |
setError({ message: (0, _wordpress_i18n.__)("Something went wrong.", "elementor") }); |
| 24955 |
} |
| 24956 |
}, |
| 24957 |
onError: handleKitError |
| 24958 |
}); |
| 24959 |
var fetchDownloadLink = _useDownloadLinkMutat2.mutate; |
| 24960 |
var isDownloadLoading = _useDownloadLinkMutat2.isLoading; |
| 24961 |
var subscriptionPlan = useKitCallToAction(props.model.accessTier).subscriptionPlan; |
| 24962 |
var applyButton = useKitCallToActionButton(props.model, { |
| 24963 |
onConnect: function onConnect() { |
| 24964 |
return setIsConnectDialogOpen(true); |
| 24965 |
}, |
| 24966 |
apply, |
| 24967 |
isApplyLoading, |
| 24968 |
onClick: function onClick() { |
| 24969 |
tracking.trackKitdemoApplyClicked(props.model.id, props.model.title, props.model.accessTier); |
| 24970 |
}, |
| 24971 |
onUpgrade: function onUpgrade() { |
| 24972 |
tracking.trackKitdemoUpgradeClicked(props.model.id, props.model.title, subscriptionPlan.label); |
| 24973 |
} |
| 24974 |
}); |
| 24975 |
var downloadButton = (0, react.useMemo)(function() { |
| 24976 |
return { |
| 24977 |
id: "download", |
| 24978 |
text: (0, _wordpress_i18n.__)("Download Website", "elementor"), |
| 24979 |
hideText: true, |
| 24980 |
icon: "eicon-file-download", |
| 24981 |
tooltip: (0, _wordpress_i18n.__)("Download Website ZIP", "elementor"), |
| 24982 |
color: isDownloadLoading ? "disabled" : "secondary", |
| 24983 |
includeHeaderBtnClass: false, |
| 24984 |
onClick: function onClick(e) { |
| 24985 |
if (isDownloadLoading) return; |
| 24986 |
tracking.trackKitdemoDownloadClicked(props.model.id, props.model.title, function() { |
| 24987 |
return fetchDownloadLink(e); |
| 24988 |
}); |
| 24989 |
} |
| 24990 |
}; |
| 24991 |
}, [ |
| 24992 |
isDownloadLoading, |
| 24993 |
fetchDownloadLink, |
| 24994 |
tracking, |
| 24995 |
props.model.id, |
| 24996 |
props.model.title |
| 24997 |
]); |
| 24998 |
var buttons = (0, react.useMemo)(function() { |
| 24999 |
return [downloadButton, applyButton].concat(_toConsumableArray(props.buttons)); |
| 25000 |
}, [ |
| 25001 |
props.buttons, |
| 25002 |
applyButton, |
| 25003 |
downloadButton |
| 25004 |
]); |
| 25005 |
return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, error && /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Dialog, { |
| 25006 |
title: error.message, |
| 25007 |
text: (0, _wordpress_i18n.__)("Go to the pages screen to make sure your kit pages have been imported successfully. If not, try again.", "elementor"), |
| 25008 |
approveButtonText: (0, _wordpress_i18n.__)("Go to pages", "elementor"), |
| 25009 |
approveButtonColor: "primary", |
| 25010 |
approveButtonUrl: elementorAppConfig.admin_url + "edit.php?post_type=page", |
| 25011 |
approveButtonOnClick: function approveButtonOnClick() { |
| 25012 |
return setError(false); |
| 25013 |
}, |
| 25014 |
dismissButtonText: (0, _wordpress_i18n.__)("Got it", "elementor"), |
| 25015 |
dismissButtonOnClick: function dismissButtonOnClick() { |
| 25016 |
return setError(false); |
| 25017 |
}, |
| 25018 |
onClose: function onClose() { |
| 25019 |
return setError(false); |
| 25020 |
} |
| 25021 |
}), downloadLinkData && /*#__PURE__*/ react.default.createElement(KitDialog, { |
| 25022 |
id: props.model.id, |
| 25023 |
downloadLinkData, |
| 25024 |
onClose: function onClose() { |
| 25025 |
return setDownloadLinkData(null); |
| 25026 |
} |
| 25027 |
}), isConnectDialogOpen && /*#__PURE__*/ react.default.createElement(ConnectDialog, { |
| 25028 |
pageId: props.pageId, |
| 25029 |
onClose: function onClose() { |
| 25030 |
return setIsConnectDialogOpen(false); |
| 25031 |
}, |
| 25032 |
onSuccess: function onSuccess(data) { |
| 25033 |
var accessLevel = data.kits_access_level || data.access_level || 0; |
| 25034 |
var accessTier = data.access_tier; |
| 25035 |
elementorCommon.config.library_connect.is_connected = true; |
| 25036 |
elementorCommon.config.library_connect.current_access_level = accessLevel; |
| 25037 |
elementorCommon.config.library_connect.current_access_tier = accessTier; |
| 25038 |
elementorCommon.config.library_connect.plan_type = data.plan_type; |
| 25039 |
updateSettings({ |
| 25040 |
is_library_connected: true, |
| 25041 |
access_level: accessLevel, |
| 25042 |
access_tier: accessTier |
| 25043 |
}); |
| 25044 |
if (data.access_level < props.model.accessLevel) return; |
| 25045 |
if (!isTierAtLeast(accessTier, props.model.accessTier)) return; |
| 25046 |
apply(); |
| 25047 |
}, |
| 25048 |
onError: function onError(message) { |
| 25049 |
return setError({ message }); |
| 25050 |
} |
| 25051 |
}), /*#__PURE__*/ react.default.createElement(Header, _extends({ |
| 25052 |
startColumn: /*#__PURE__*/ react.default.createElement(HeaderBackButton, _extends({}, kitData, { kitId: props.model.id })), |
| 25053 |
centerColumn: props.centerColumn, |
| 25054 |
buttons |
| 25055 |
}, kitData))); |
| 25056 |
} |
| 25057 |
var import_prop_types$7; |
| 25058 |
var init_item_header = __esmMin((() => { |
| 25059 |
import_prop_types$7 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25060 |
init_extends(); |
| 25061 |
init_toConsumableArray(); |
| 25062 |
init_slicedToArray(); |
| 25063 |
init_kit_dialog(); |
| 25064 |
init_connect_dialog(); |
| 25065 |
init_header(); |
| 25066 |
init_header_back_button(); |
| 25067 |
init_kit(); |
| 25068 |
init_use_download_link_mutation(); |
| 25069 |
init_use_kit_call_to_action(); |
| 25070 |
init_use_add_kit_promotion_utm(); |
| 25071 |
init_settings_context(); |
| 25072 |
init_tiers(); |
| 25073 |
init_tracking_context(); |
| 25074 |
init_item_header$1(); |
| 25075 |
ItemHeader.propTypes = { |
| 25076 |
model: import_prop_types$7.default.instanceOf(Kit).isRequired, |
| 25077 |
centerColumn: import_prop_types$7.default.node, |
| 25078 |
buttons: import_prop_types$7.default.arrayOf(import_prop_types$7.default.object), |
| 25079 |
pageId: import_prop_types$7.default.string |
| 25080 |
}; |
| 25081 |
})); |
| 25082 |
|
| 25083 |
//#endregion |
| 25084 |
//#region app/modules/kit-library/assets/js/models/content-type.js |
| 25085 |
function _callSuper(t, o, e) { |
| 25086 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 25087 |
} |
| 25088 |
function _isNativeReflectConstruct() { |
| 25089 |
try { |
| 25090 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 25091 |
} catch (t) {} |
| 25092 |
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { |
| 25093 |
return !!t; |
| 25094 |
})(); |
| 25095 |
} |
| 25096 |
var ContentType; |
| 25097 |
var init_content_type = __esmMin((() => { |
| 25098 |
init_classCallCheck(); |
| 25099 |
init_createClass(); |
| 25100 |
init_possibleConstructorReturn(); |
| 25101 |
init_getPrototypeOf(); |
| 25102 |
init_inherits(); |
| 25103 |
init_defineProperty$1(); |
| 25104 |
init_base_model(); |
| 25105 |
ContentType = /*#__PURE__*/ function(_BaseModel) { |
| 25106 |
function ContentType() { |
| 25107 |
var _this; |
| 25108 |
_classCallCheck(this, ContentType); |
| 25109 |
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; |
| 25110 |
_this = _callSuper(this, ContentType, [].concat(args)); |
| 25111 |
_defineProperty$1(_this, "id", ""); |
| 25112 |
_defineProperty$1(_this, "label", ""); |
| 25113 |
_defineProperty$1(_this, "documentTypes", []); |
| 25114 |
_defineProperty$1(_this, "documents", []); |
| 25115 |
_defineProperty$1(_this, "order", 0); |
| 25116 |
return _this; |
| 25117 |
} |
| 25118 |
_inherits(ContentType, _BaseModel); |
| 25119 |
return _createClass(ContentType, null, [{ |
| 25120 |
key: "createFromResponse", |
| 25121 |
value: function createFromResponse(documentType) { |
| 25122 |
return new ContentType().init({ |
| 25123 |
id: documentType.id, |
| 25124 |
label: documentType.label, |
| 25125 |
documentTypes: documentType.doc_types, |
| 25126 |
order: documentType.order, |
| 25127 |
documents: [] |
| 25128 |
}); |
| 25129 |
} |
| 25130 |
}]); |
| 25131 |
}(BaseModel); |
| 25132 |
})); |
| 25133 |
|
| 25134 |
//#endregion |
| 25135 |
//#region app/modules/kit-library/assets/js/pages/overview/overview-content-group-item.js |
| 25136 |
function OverviewContentGroupItem(props) { |
| 25137 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Card, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardHeader, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 25138 |
tag: "h3", |
| 25139 |
title: props.document.title, |
| 25140 |
variant: "h5", |
| 25141 |
className: "eps-card__headline" |
| 25142 |
}, props.document.title)), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardBody, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardImage, { |
| 25143 |
alt: props.document.title, |
| 25144 |
src: props.document.thumbnailUrl || "" |
| 25145 |
}, props.document.previewUrl && /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardOverlay, null, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 25146 |
className: "e-kit-library__kit-item-overlay-overview-button", |
| 25147 |
text: (0, _wordpress_i18n.__)("View Demo", "elementor"), |
| 25148 |
icon: "eicon-preview-medium", |
| 25149 |
url: "/kit-library/preview/".concat(props.kitId, "?document_id=").concat(props.document.id) |
| 25150 |
}))))); |
| 25151 |
} |
| 25152 |
var import_prop_types$6; |
| 25153 |
var init_overview_content_group_item = __esmMin((() => { |
| 25154 |
import_prop_types$6 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25155 |
init_document(); |
| 25156 |
OverviewContentGroupItem.propTypes = { |
| 25157 |
document: import_prop_types$6.default.instanceOf(Document).isRequired, |
| 25158 |
kitId: import_prop_types$6.default.string.isRequired, |
| 25159 |
kitTitle: import_prop_types$6.default.string.isRequired, |
| 25160 |
groupData: import_prop_types$6.default.shape({ |
| 25161 |
label: import_prop_types$6.default.string, |
| 25162 |
id: import_prop_types$6.default.string |
| 25163 |
}).isRequired |
| 25164 |
}; |
| 25165 |
})); |
| 25166 |
|
| 25167 |
//#endregion |
| 25168 |
//#region app/modules/kit-library/assets/js/pages/overview/overview-content-group.js |
| 25169 |
function OverviewContentGroup(props) { |
| 25170 |
var _props$contentType; |
| 25171 |
if (((_props$contentType = props.contentType) === null || _props$contentType === void 0 || (_props$contentType = _props$contentType.documents) === null || _props$contentType === void 0 ? void 0 : _props$contentType.length) <= 0) return ""; |
| 25172 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__content-overview-group-item" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 25173 |
tag: "h3", |
| 25174 |
variant: "h3", |
| 25175 |
className: "e-kit-library__content-overview-group-title" |
| 25176 |
}, props.contentType.label), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CssGrid, { |
| 25177 |
spacing: 24, |
| 25178 |
colMinWidth: 250 |
| 25179 |
}, props.contentType.documents.map(function(document) { |
| 25180 |
return /*#__PURE__*/ react.default.createElement(OverviewContentGroupItem, { |
| 25181 |
key: document.id, |
| 25182 |
document, |
| 25183 |
kitId: props.kitId, |
| 25184 |
kitTitle: props.kitTitle, |
| 25185 |
groupData: props.contentType |
| 25186 |
}); |
| 25187 |
}))); |
| 25188 |
} |
| 25189 |
var import_prop_types$5; |
| 25190 |
var init_overview_content_group = __esmMin((() => { |
| 25191 |
import_prop_types$5 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25192 |
init_content_type(); |
| 25193 |
init_overview_content_group_item(); |
| 25194 |
OverviewContentGroup.propTypes = { |
| 25195 |
contentType: import_prop_types$5.default.instanceOf(ContentType), |
| 25196 |
kitId: import_prop_types$5.default.string.isRequired, |
| 25197 |
kitTitle: import_prop_types$5.default.string.isRequired |
| 25198 |
}; |
| 25199 |
})); |
| 25200 |
|
| 25201 |
//#endregion |
| 25202 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/pages/overview/overview-sidebar.scss |
| 25203 |
var init_overview_sidebar$1 = __esmMin((() => {})); |
| 25204 |
|
| 25205 |
//#endregion |
| 25206 |
//#region app/modules/kit-library/assets/js/pages/overview/overview-sidebar.js |
| 25207 |
function OverviewSidebar(props) { |
| 25208 |
var _props$groupedKitCont; |
| 25209 |
var _useState2 = _slicedToArray((0, react.useState)(true), 2); |
| 25210 |
var isInformationCollapseOpen = _useState2[0]; |
| 25211 |
var setIsInformationCollapseOpen = _useState2[1]; |
| 25212 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__item-sidebar" }, /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library__item-sidebar-header" }, /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Heading, { |
| 25213 |
tag: "h1", |
| 25214 |
variant: "h5", |
| 25215 |
className: "e-kit-library__item-sidebar-header-title" |
| 25216 |
}, props.model.title), /*#__PURE__*/ react.default.createElement(FavoritesActions, { |
| 25217 |
isFavorite: props.model.isFavorite, |
| 25218 |
id: props.model.id |
| 25219 |
})), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.CardImage, { |
| 25220 |
className: "e-kit-library__item-sidebar-thumbnail", |
| 25221 |
alt: props.model.title, |
| 25222 |
src: props.model.thumbnailUrl || "" |
| 25223 |
}), /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { className: "e-kit-library__item-sidebar-description" }, props.model.description || ""), ((_props$groupedKitCont = props.groupedKitContent) === null || _props$groupedKitCont === void 0 ? void 0 : _props$groupedKitCont.length) > 0 && props.model.documents.length > 0 && /*#__PURE__*/ react.default.createElement(Collapse, { |
| 25224 |
isOpen: isInformationCollapseOpen, |
| 25225 |
onChange: setIsInformationCollapseOpen, |
| 25226 |
title: (0, _wordpress_i18n.__)("WHAT'S INSIDE", "elementor"), |
| 25227 |
className: "e-kit-library__item-sidebar-collapse-info" |
| 25228 |
}, props.groupedKitContent.map(function(contentType) { |
| 25229 |
if (contentType.documents <= 0) return ""; |
| 25230 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Text, { |
| 25231 |
className: "e-kit-library__item-information-text", |
| 25232 |
key: contentType.id |
| 25233 |
}, contentType.documents.length, " ", contentType.label); |
| 25234 |
}))); |
| 25235 |
} |
| 25236 |
var import_prop_types$4; |
| 25237 |
var init_overview_sidebar = __esmMin((() => { |
| 25238 |
import_prop_types$4 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25239 |
init_slicedToArray(); |
| 25240 |
init_collapse(); |
| 25241 |
init_content_type(); |
| 25242 |
init_favorites_actions(); |
| 25243 |
init_kit(); |
| 25244 |
init_overview_sidebar$1(); |
| 25245 |
OverviewSidebar.propTypes = { |
| 25246 |
model: import_prop_types$4.default.instanceOf(Kit).isRequired, |
| 25247 |
index: import_prop_types$4.default.number, |
| 25248 |
groupedKitContent: import_prop_types$4.default.arrayOf(import_prop_types$4.default.instanceOf(ContentType)) |
| 25249 |
}; |
| 25250 |
})); |
| 25251 |
|
| 25252 |
//#endregion |
| 25253 |
//#region app/modules/kit-library/assets/js/hooks/use-content-types.js |
| 25254 |
/** |
| 25255 |
* The data should come from the server, this is a temp solution that helps to demonstrate that data comes from the server |
| 25256 |
* but for now this is a local data. |
| 25257 |
* |
| 25258 |
* @return {import('react-query').UseQueryResult<Promise.constructor, unknown>} result |
| 25259 |
*/ |
| 25260 |
function useContentTypes() { |
| 25261 |
var settings = useSettingsContext().settings; |
| 25262 |
return useQuery([KEY, settings], function() { |
| 25263 |
return fetchContentTypes(settings); |
| 25264 |
}); |
| 25265 |
} |
| 25266 |
/** |
| 25267 |
* @param {Object} settings - Current settings |
| 25268 |
* |
| 25269 |
* @return {Promise.constructor} content types |
| 25270 |
*/ |
| 25271 |
function fetchContentTypes(settings) { |
| 25272 |
var contentTypes = [{ |
| 25273 |
id: "page", |
| 25274 |
label: (0, _wordpress_i18n.__)("Pages", "elementor"), |
| 25275 |
doc_types: ["wp-page"], |
| 25276 |
order: 0 |
| 25277 |
}, { |
| 25278 |
id: "site-parts", |
| 25279 |
label: (0, _wordpress_i18n.__)("Site Parts", "elementor"), |
| 25280 |
doc_types: [ |
| 25281 |
"archive", |
| 25282 |
"error-404", |
| 25283 |
"footer", |
| 25284 |
"header", |
| 25285 |
"search-results", |
| 25286 |
"single-page", |
| 25287 |
"single-post", |
| 25288 |
"product", |
| 25289 |
"product-archive", |
| 25290 |
"404", |
| 25291 |
"single" |
| 25292 |
], |
| 25293 |
order: 1 |
| 25294 |
}]; |
| 25295 |
var userAccessTier = settings.access_tier; |
| 25296 |
if (settings.is_pro && settings.is_library_connected && userAccessTier === TIERS.free) userAccessTier = TIERS["essential-oct2023"]; |
| 25297 |
var tierThatSupportsPopups = TIERS["essential-oct2023"]; |
| 25298 |
if (isTierAtLeast(userAccessTier, tierThatSupportsPopups)) contentTypes.push({ |
| 25299 |
id: "popup", |
| 25300 |
label: (0, _wordpress_i18n.__)("Popups", "elementor"), |
| 25301 |
doc_types: ["popup"], |
| 25302 |
order: 2 |
| 25303 |
}); |
| 25304 |
return Promise.resolve(contentTypes).then(function(data) { |
| 25305 |
return data.map(function(contentType) { |
| 25306 |
return ContentType.createFromResponse(contentType); |
| 25307 |
}); |
| 25308 |
}); |
| 25309 |
} |
| 25310 |
var KEY; |
| 25311 |
var init_use_content_types = __esmMin((() => { |
| 25312 |
init_content_type(); |
| 25313 |
init_es(); |
| 25314 |
init_settings_context(); |
| 25315 |
init_tiers(); |
| 25316 |
KEY = "content-types"; |
| 25317 |
})); |
| 25318 |
|
| 25319 |
//#endregion |
| 25320 |
//#region app/modules/kit-library/assets/js/hooks/use-kit-document-by-type.js |
| 25321 |
function ownKeys$1(e, r) { |
| 25322 |
var t = Object.keys(e); |
| 25323 |
if (Object.getOwnPropertySymbols) { |
| 25324 |
var o = Object.getOwnPropertySymbols(e); |
| 25325 |
r && (o = o.filter(function(r) { |
| 25326 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 25327 |
})), t.push.apply(t, o); |
| 25328 |
} |
| 25329 |
return t; |
| 25330 |
} |
| 25331 |
function _objectSpread(e) { |
| 25332 |
for (var r = 1; r < arguments.length; r++) { |
| 25333 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 25334 |
r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) { |
| 25335 |
_defineProperty$1(e, r, t[r]); |
| 25336 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) { |
| 25337 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 25338 |
}); |
| 25339 |
} |
| 25340 |
return e; |
| 25341 |
} |
| 25342 |
function useKitDocumentByType(kit) { |
| 25343 |
var contentTypesQuery = useContentTypes(); |
| 25344 |
var data = (0, react.useMemo)(function() { |
| 25345 |
if (!kit || !contentTypesQuery.data) return []; |
| 25346 |
return kit.getDocumentsByTypes(contentTypesQuery.data).sort(function(a, b) { |
| 25347 |
return a.order - b.order; |
| 25348 |
}); |
| 25349 |
}, [kit, contentTypesQuery.data]); |
| 25350 |
return _objectSpread(_objectSpread({}, contentTypesQuery), {}, { data }); |
| 25351 |
} |
| 25352 |
var init_use_kit_document_by_type = __esmMin((() => { |
| 25353 |
init_defineProperty$1(); |
| 25354 |
init_use_content_types(); |
| 25355 |
__name(ownKeys$1, "ownKeys"); |
| 25356 |
})); |
| 25357 |
|
| 25358 |
//#endregion |
| 25359 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/pages/overview/overview.scss |
| 25360 |
var init_overview$1 = __esmMin((() => {})); |
| 25361 |
|
| 25362 |
//#endregion |
| 25363 |
//#region app/modules/kit-library/assets/js/pages/overview/overview.js |
| 25364 |
function useHeaderButtons$1(id, kitName) { |
| 25365 |
var navigate = useNavigate(); |
| 25366 |
return (0, react.useMemo)(function() { |
| 25367 |
return [{ |
| 25368 |
id: "view-demo", |
| 25369 |
text: (0, _wordpress_i18n.__)("View Demo", "elementor"), |
| 25370 |
hideText: false, |
| 25371 |
variant: "outlined", |
| 25372 |
color: "secondary", |
| 25373 |
size: "sm", |
| 25374 |
onClick: function onClick() { |
| 25375 |
navigate("/kit-library/preview/".concat(id)); |
| 25376 |
}, |
| 25377 |
includeHeaderBtnClass: false |
| 25378 |
}]; |
| 25379 |
}, [ |
| 25380 |
id, |
| 25381 |
kitName, |
| 25382 |
navigate |
| 25383 |
]); |
| 25384 |
} |
| 25385 |
function Overview(props) { |
| 25386 |
var _useKit = useKit(props.id); |
| 25387 |
var kit = _useKit.data; |
| 25388 |
var isError = _useKit.isError; |
| 25389 |
var isLoading = _useKit.isLoading; |
| 25390 |
var documentsByType = useKitDocumentByType(kit).data; |
| 25391 |
var headerButtons = useHeaderButtons$1(props.id, kit && kit.title); |
| 25392 |
usePageTitle({ title: kit ? "".concat((0, _wordpress_i18n.__)("Kit Library", "elementor"), " | ").concat(kit.title) : (0, _wordpress_i18n.__)("Loading...", "elementor") }); |
| 25393 |
if (isError) throw new Error(); |
| 25394 |
if (isLoading) return /*#__PURE__*/ react.default.createElement(ElementorLoading, null); |
| 25395 |
return /*#__PURE__*/ react.default.createElement(Index$1, { |
| 25396 |
header: /*#__PURE__*/ react.default.createElement(ItemHeader, { |
| 25397 |
model: kit, |
| 25398 |
buttons: headerButtons, |
| 25399 |
pageId: "overview" |
| 25400 |
}), |
| 25401 |
sidebar: /*#__PURE__*/ react.default.createElement(OverviewSidebar, { |
| 25402 |
model: kit, |
| 25403 |
groupedKitContent: documentsByType |
| 25404 |
}) |
| 25405 |
}, documentsByType.length > 0 && /*#__PURE__*/ react.default.createElement(Content, null, documentsByType.map(function(contentType) { |
| 25406 |
return /*#__PURE__*/ react.default.createElement(OverviewContentGroup, { |
| 25407 |
key: contentType.id, |
| 25408 |
contentType, |
| 25409 |
kitId: props.id, |
| 25410 |
kitTitle: kit.title |
| 25411 |
}); |
| 25412 |
}))); |
| 25413 |
} |
| 25414 |
var import_prop_types$3; |
| 25415 |
var init_overview = __esmMin((() => { |
| 25416 |
import_prop_types$3 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25417 |
init_content(); |
| 25418 |
init_elementor_loading(); |
| 25419 |
init_item_header(); |
| 25420 |
init_layout(); |
| 25421 |
init_overview_content_group(); |
| 25422 |
init_overview_sidebar(); |
| 25423 |
init_use_kit(); |
| 25424 |
init_use_kit_document_by_type(); |
| 25425 |
init_use_page_title(); |
| 25426 |
init_es$1(); |
| 25427 |
init_overview$1(); |
| 25428 |
__name(useHeaderButtons$1, "useHeaderButtons"); |
| 25429 |
Overview.propTypes = { id: import_prop_types$3.default.string }; |
| 25430 |
})); |
| 25431 |
|
| 25432 |
//#endregion |
| 25433 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/pages/preview/preview-responsive-controls.scss |
| 25434 |
var init_preview_responsive_controls$1 = __esmMin((() => {})); |
| 25435 |
|
| 25436 |
//#endregion |
| 25437 |
//#region app/modules/kit-library/assets/js/pages/preview/preview-responsive-controls.js |
| 25438 |
function PreviewResponsiveControls(props) { |
| 25439 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 25440 |
container: true, |
| 25441 |
alignItems: "center", |
| 25442 |
justify: "center", |
| 25443 |
className: "e-kit-library__preview-responsive-controls" |
| 25444 |
}, breakpoints.map(function(_ref) { |
| 25445 |
var label = _ref.label; |
| 25446 |
var value = _ref.value; |
| 25447 |
var className = "e-kit-library__preview-responsive-controls-item"; |
| 25448 |
if (props.active === value) className += " e-kit-library__preview-responsive-controls-item--active"; |
| 25449 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Button, { |
| 25450 |
key: value, |
| 25451 |
text: label, |
| 25452 |
hideText: true, |
| 25453 |
className, |
| 25454 |
icon: "eicon-device-".concat(value), |
| 25455 |
onClick: function onClick() { |
| 25456 |
return props.onChange(value); |
| 25457 |
} |
| 25458 |
}); |
| 25459 |
})); |
| 25460 |
} |
| 25461 |
var import_prop_types$2; |
| 25462 |
var init_preview_responsive_controls = __esmMin((() => { |
| 25463 |
import_prop_types$2 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25464 |
init_preview(); |
| 25465 |
init_preview_responsive_controls$1(); |
| 25466 |
PreviewResponsiveControls.propTypes = { |
| 25467 |
active: import_prop_types$2.default.string, |
| 25468 |
onChange: import_prop_types$2.default.func.isRequired |
| 25469 |
}; |
| 25470 |
PreviewResponsiveControls.defaultProps = { active: "desktop" }; |
| 25471 |
})); |
| 25472 |
|
| 25473 |
//#endregion |
| 25474 |
//#region app/modules/kit-library/assets/js/pages/preview/preview-iframe.js |
| 25475 |
function PreviewIframe(props) { |
| 25476 |
var ref = (0, react.useRef)(); |
| 25477 |
(0, react.useEffect)(function() { |
| 25478 |
if (!ref.current) return; |
| 25479 |
var listener = function listener() { |
| 25480 |
return props.onLoaded(); |
| 25481 |
}; |
| 25482 |
ref.current.addEventListener("load", listener); |
| 25483 |
return function() { |
| 25484 |
return ref.current && ref.current.removeEventListener("load", listener); |
| 25485 |
}; |
| 25486 |
}, [ref.current, props.previewUrl]); |
| 25487 |
return /*#__PURE__*/ react.default.createElement(_elementor_app_ui.Grid, { |
| 25488 |
container: true, |
| 25489 |
justify: "center", |
| 25490 |
className: "e-kit-library__preview-iframe-container" |
| 25491 |
}, /*#__PURE__*/ react.default.createElement("iframe", { |
| 25492 |
className: "e-kit-library__preview-iframe", |
| 25493 |
src: props.previewUrl, |
| 25494 |
style: props.style, |
| 25495 |
ref |
| 25496 |
})); |
| 25497 |
} |
| 25498 |
var import_prop_types$1; |
| 25499 |
var init_preview_iframe = __esmMin((() => { |
| 25500 |
import_prop_types$1 = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25501 |
PreviewIframe.propTypes = { |
| 25502 |
previewUrl: import_prop_types$1.default.string.isRequired, |
| 25503 |
style: import_prop_types$1.default.object, |
| 25504 |
onLoaded: import_prop_types$1.default.func |
| 25505 |
}; |
| 25506 |
PreviewIframe.defaultProps = { |
| 25507 |
style: { |
| 25508 |
width: "100%", |
| 25509 |
height: "100%" |
| 25510 |
}, |
| 25511 |
onLoaded: function onLoaded() {} |
| 25512 |
}; |
| 25513 |
})); |
| 25514 |
|
| 25515 |
//#endregion |
| 25516 |
//#region \0app-scss:/home/runner/work/elementor/elementor/app/modules/kit-library/assets/js/pages/preview/preview.scss |
| 25517 |
var init_preview$1 = __esmMin((() => {})); |
| 25518 |
|
| 25519 |
//#endregion |
| 25520 |
//#region app/modules/kit-library/assets/js/pages/preview/preview.js |
| 25521 |
function useHeaderButtons(id, kitName) { |
| 25522 |
var navigate = useNavigate(); |
| 25523 |
var tracking = useTracking(); |
| 25524 |
return (0, react.useMemo)(function() { |
| 25525 |
return [{ |
| 25526 |
id: "overview", |
| 25527 |
text: (0, _wordpress_i18n.__)("Overview", "elementor"), |
| 25528 |
hideText: false, |
| 25529 |
variant: "outlined", |
| 25530 |
color: "secondary", |
| 25531 |
size: "sm", |
| 25532 |
onClick: function onClick() { |
| 25533 |
tracking.trackKitdemoOverviewClicked(id, kitName, function() { |
| 25534 |
return navigate("/kit-library/overview/".concat(id)); |
| 25535 |
}); |
| 25536 |
}, |
| 25537 |
includeHeaderBtnClass: false |
| 25538 |
}]; |
| 25539 |
}, [ |
| 25540 |
id, |
| 25541 |
kitName, |
| 25542 |
tracking, |
| 25543 |
navigate |
| 25544 |
]); |
| 25545 |
} |
| 25546 |
/** |
| 25547 |
* Get preview url. |
| 25548 |
* |
| 25549 |
* @param {*} data |
| 25550 |
* @return {null|string} Preview URL |
| 25551 |
*/ |
| 25552 |
function usePreviewUrl(data) { |
| 25553 |
var location = useLocation(); |
| 25554 |
return (0, react.useMemo)(function() { |
| 25555 |
var _location$pathname$sp; |
| 25556 |
var _data$documents$find; |
| 25557 |
if (!data) return null; |
| 25558 |
var documentId = new URLSearchParams((_location$pathname$sp = location.pathname.split("?")) === null || _location$pathname$sp === void 0 ? void 0 : _location$pathname$sp[1]).get("document_id"); |
| 25559 |
var utm = "?utm_source=kit-library&utm_medium=wp-dash&utm_campaign=preview"; |
| 25560 |
var previewUrl = data.previewUrl ? data.previewUrl + utm : data.previewUrl; |
| 25561 |
if (!documentId) return previewUrl; |
| 25562 |
var documentPreviewUrl = ((_data$documents$find = data.documents.find(function(item) { |
| 25563 |
return item.id === parseInt(documentId); |
| 25564 |
})) === null || _data$documents$find === void 0 ? void 0 : _data$documents$find.previewUrl) || previewUrl; |
| 25565 |
return documentPreviewUrl ? documentPreviewUrl + utm : documentPreviewUrl; |
| 25566 |
}, [location, data]); |
| 25567 |
} |
| 25568 |
function Preview(props) { |
| 25569 |
var _useKit = useKit(props.id); |
| 25570 |
var data = _useKit.data; |
| 25571 |
var isError = _useKit.isError; |
| 25572 |
var isLoading = _useKit.isLoading; |
| 25573 |
var _useState2 = _slicedToArray((0, react.useState)(true), 2); |
| 25574 |
var isIframeLoading = _useState2[0]; |
| 25575 |
var setIsIframeLoading = _useState2[1]; |
| 25576 |
var headersButtons = useHeaderButtons(props.id, data && data.title); |
| 25577 |
var previewUrl = usePreviewUrl(data); |
| 25578 |
var _useState4 = _slicedToArray((0, react.useState)("desktop"), 2); |
| 25579 |
var activeDevice = _useState4[0]; |
| 25580 |
var setActiveDevice = _useState4[1]; |
| 25581 |
var tracking = useTracking(); |
| 25582 |
var loadStartTime = (0, react.useRef)(Date.now()); |
| 25583 |
var hasTrackedOpen = (0, react.useRef)(false); |
| 25584 |
var iframeStyle = (0, react.useMemo)(function() { |
| 25585 |
return breakpoints.find(function(_ref) { |
| 25586 |
return _ref.value === activeDevice; |
| 25587 |
}).style; |
| 25588 |
}, [activeDevice]); |
| 25589 |
(0, react.useEffect)(function() { |
| 25590 |
if (!isIframeLoading && data && !hasTrackedOpen.current) { |
| 25591 |
var loadTime = Date.now() - loadStartTime.current; |
| 25592 |
tracking.trackKitdemoOpened(props.id, data.title, loadTime); |
| 25593 |
hasTrackedOpen.current = true; |
| 25594 |
} |
| 25595 |
}, [ |
| 25596 |
isIframeLoading, |
| 25597 |
data, |
| 25598 |
props.id, |
| 25599 |
tracking |
| 25600 |
]); |
| 25601 |
var _onChange = function onChange(device) { |
| 25602 |
setActiveDevice(device); |
| 25603 |
}; |
| 25604 |
usePageTitle({ title: data ? "".concat((0, _wordpress_i18n.__)("Kit Library", "elementor"), " | ").concat(data.title) : (0, _wordpress_i18n.__)("Loading...", "elementor") }); |
| 25605 |
if (isError) throw new Error(); |
| 25606 |
if (isLoading) return /*#__PURE__*/ react.default.createElement(ElementorLoading, null); |
| 25607 |
return /*#__PURE__*/ react.default.createElement(Index$1, { header: /*#__PURE__*/ react.default.createElement(ItemHeader, { |
| 25608 |
model: data, |
| 25609 |
buttons: headersButtons, |
| 25610 |
centerColumn: /*#__PURE__*/ react.default.createElement(PreviewResponsiveControls, { |
| 25611 |
active: activeDevice, |
| 25612 |
onChange: function onChange(device) { |
| 25613 |
return _onChange(device); |
| 25614 |
}, |
| 25615 |
kitName: data.title |
| 25616 |
}), |
| 25617 |
pageId: "demo" |
| 25618 |
}) }, isIframeLoading && /*#__PURE__*/ react.default.createElement(PageLoader, { className: "e-kit-library__preview-loader" }), previewUrl && /*#__PURE__*/ react.default.createElement(PreviewIframe, { |
| 25619 |
previewUrl, |
| 25620 |
style: iframeStyle, |
| 25621 |
onLoaded: function onLoaded() { |
| 25622 |
return setIsIframeLoading(false); |
| 25623 |
} |
| 25624 |
})); |
| 25625 |
} |
| 25626 |
var import_prop_types, breakpoints; |
| 25627 |
var init_preview = __esmMin((() => { |
| 25628 |
import_prop_types = /* @__PURE__ */ __toESM(require_prop_types()); |
| 25629 |
init_slicedToArray(); |
| 25630 |
init_elementor_loading(); |
| 25631 |
init_item_header(); |
| 25632 |
init_layout(); |
| 25633 |
init_page_loader(); |
| 25634 |
init_preview_responsive_controls(); |
| 25635 |
init_use_kit(); |
| 25636 |
init_use_page_title(); |
| 25637 |
init_preview_iframe(); |
| 25638 |
init_es$1(); |
| 25639 |
init_tracking_context(); |
| 25640 |
init_preview$1(); |
| 25641 |
breakpoints = [ |
| 25642 |
{ |
| 25643 |
value: "desktop", |
| 25644 |
label: (0, _wordpress_i18n.__)("Desktop", "elementor"), |
| 25645 |
style: { |
| 25646 |
width: "100%", |
| 25647 |
height: "100%" |
| 25648 |
} |
| 25649 |
}, |
| 25650 |
{ |
| 25651 |
value: "tablet", |
| 25652 |
label: (0, _wordpress_i18n.__)("Tablet", "elementor"), |
| 25653 |
style: { |
| 25654 |
marginBlockStart: "30px", |
| 25655 |
marginBlockEnd: "30px", |
| 25656 |
width: "768px", |
| 25657 |
height: "1024px" |
| 25658 |
} |
| 25659 |
}, |
| 25660 |
{ |
| 25661 |
value: "mobile", |
| 25662 |
label: (0, _wordpress_i18n.__)("Mobile", "elementor"), |
| 25663 |
style: { |
| 25664 |
marginBlockStart: "30px", |
| 25665 |
marginBlockEnd: "30px", |
| 25666 |
width: "375px", |
| 25667 |
height: "667px" |
| 25668 |
} |
| 25669 |
} |
| 25670 |
]; |
| 25671 |
Preview.propTypes = { id: import_prop_types.default.string }; |
| 25672 |
})); |
| 25673 |
|
| 25674 |
//#endregion |
| 25675 |
//#region node_modules/match-sorter/node_modules/remove-accents/index.js |
| 25676 |
var require_remove_accents = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 25677 |
var characterMap = { |
| 25678 |
"À": "A", |
| 25679 |
"Á": "A", |
| 25680 |
"Â": "A", |
| 25681 |
"Ã": "A", |
| 25682 |
"Ä": "A", |
| 25683 |
"Å": "A", |
| 25684 |
"Ấ": "A", |
| 25685 |
"Ắ": "A", |
| 25686 |
"Ẳ": "A", |
| 25687 |
"Ẵ": "A", |
| 25688 |
"Ặ": "A", |
| 25689 |
"Æ": "AE", |
| 25690 |
"Ầ": "A", |
| 25691 |
"Ằ": "A", |
| 25692 |
"Ȃ": "A", |
| 25693 |
"Ả": "A", |
| 25694 |
"Ạ": "A", |
| 25695 |
"Ẩ": "A", |
| 25696 |
"Ẫ": "A", |
| 25697 |
"Ậ": "A", |
| 25698 |
"Ç": "C", |
| 25699 |
"Ḉ": "C", |
| 25700 |
"È": "E", |
| 25701 |
"É": "E", |
| 25702 |
"Ê": "E", |
| 25703 |
"Ë": "E", |
| 25704 |
"Ế": "E", |
| 25705 |
"Ḗ": "E", |
| 25706 |
"Ề": "E", |
| 25707 |
"Ḕ": "E", |
| 25708 |
"Ḝ": "E", |
| 25709 |
"Ȇ": "E", |
| 25710 |
"Ẻ": "E", |
| 25711 |
"Ẽ": "E", |
| 25712 |
"Ẹ": "E", |
| 25713 |
"Ể": "E", |
| 25714 |
"Ễ": "E", |
| 25715 |
"Ệ": "E", |
| 25716 |
"Ì": "I", |
| 25717 |
"Í": "I", |
| 25718 |
"Î": "I", |
| 25719 |
"Ï": "I", |
| 25720 |
"Ḯ": "I", |
| 25721 |
"Ȋ": "I", |
| 25722 |
"Ỉ": "I", |
| 25723 |
"Ị": "I", |
| 25724 |
"Ð": "D", |
| 25725 |
"Ñ": "N", |
| 25726 |
"Ò": "O", |
| 25727 |
"Ó": "O", |
| 25728 |
"Ô": "O", |
| 25729 |
"Õ": "O", |
| 25730 |
"Ö": "O", |
| 25731 |
"Ø": "O", |
| 25732 |
"Ố": "O", |
| 25733 |
"Ṍ": "O", |
| 25734 |
"Ṓ": "O", |
| 25735 |
"Ȏ": "O", |
| 25736 |
"Ỏ": "O", |
| 25737 |
"Ọ": "O", |
| 25738 |
"Ổ": "O", |
| 25739 |
"Ỗ": "O", |
| 25740 |
"Ộ": "O", |
| 25741 |
"Ờ": "O", |
| 25742 |
"Ở": "O", |
| 25743 |
"Ỡ": "O", |
| 25744 |
"Ớ": "O", |
| 25745 |
"Ợ": "O", |
| 25746 |
"Ù": "U", |
| 25747 |
"Ú": "U", |
| 25748 |
"Û": "U", |
| 25749 |
"Ü": "U", |
| 25750 |
"Ủ": "U", |
| 25751 |
"Ụ": "U", |
| 25752 |
"Ử": "U", |
| 25753 |
"Ữ": "U", |
| 25754 |
"Ự": "U", |
| 25755 |
"Ý": "Y", |
| 25756 |
"à": "a", |
| 25757 |
"á": "a", |
| 25758 |
"â": "a", |
| 25759 |
"ã": "a", |
| 25760 |
"ä": "a", |
| 25761 |
"å": "a", |
| 25762 |
"ấ": "a", |
| 25763 |
"ắ": "a", |
| 25764 |
"ẳ": "a", |
| 25765 |
"ẵ": "a", |
| 25766 |
"ặ": "a", |
| 25767 |
"æ": "ae", |
| 25768 |
"ầ": "a", |
| 25769 |
"ằ": "a", |
| 25770 |
"ȃ": "a", |
| 25771 |
"ả": "a", |
| 25772 |
"ạ": "a", |
| 25773 |
"ẩ": "a", |
| 25774 |
"ẫ": "a", |
| 25775 |
"ậ": "a", |
| 25776 |
"ç": "c", |
| 25777 |
"ḉ": "c", |
| 25778 |
"è": "e", |
| 25779 |
"é": "e", |
| 25780 |
"ê": "e", |
| 25781 |
"ë": "e", |
| 25782 |
"ế": "e", |
| 25783 |
"ḗ": "e", |
| 25784 |
"ề": "e", |
| 25785 |
"ḕ": "e", |
| 25786 |
"ḝ": "e", |
| 25787 |
"ȇ": "e", |
| 25788 |
"ẻ": "e", |
| 25789 |
"ẽ": "e", |
| 25790 |
"ẹ": "e", |
| 25791 |
"ể": "e", |
| 25792 |
"ễ": "e", |
| 25793 |
"ệ": "e", |
| 25794 |
"ì": "i", |
| 25795 |
"í": "i", |
| 25796 |
"î": "i", |
| 25797 |
"ï": "i", |
| 25798 |
"ḯ": "i", |
| 25799 |
"ȋ": "i", |
| 25800 |
"ỉ": "i", |
| 25801 |
"ị": "i", |
| 25802 |
"ð": "d", |
| 25803 |
"ñ": "n", |
| 25804 |
"ò": "o", |
| 25805 |
"ó": "o", |
| 25806 |
"ô": "o", |
| 25807 |
"õ": "o", |
| 25808 |
"ö": "o", |
| 25809 |
"ø": "o", |
| 25810 |
"ố": "o", |
| 25811 |
"ṍ": "o", |
| 25812 |
"ṓ": "o", |
| 25813 |
"ȏ": "o", |
| 25814 |
"ỏ": "o", |
| 25815 |
"ọ": "o", |
| 25816 |
"ổ": "o", |
| 25817 |
"ỗ": "o", |
| 25818 |
"ộ": "o", |
| 25819 |
"ờ": "o", |
| 25820 |
"ở": "o", |
| 25821 |
"ỡ": "o", |
| 25822 |
"ớ": "o", |
| 25823 |
"ợ": "o", |
| 25824 |
"ù": "u", |
| 25825 |
"ú": "u", |
| 25826 |
"û": "u", |
| 25827 |
"ü": "u", |
| 25828 |
"ủ": "u", |
| 25829 |
"ụ": "u", |
| 25830 |
"ử": "u", |
| 25831 |
"ữ": "u", |
| 25832 |
"ự": "u", |
| 25833 |
"ý": "y", |
| 25834 |
"ÿ": "y", |
| 25835 |
"Ā": "A", |
| 25836 |
"ā": "a", |
| 25837 |
"Ă": "A", |
| 25838 |
"ă": "a", |
| 25839 |
"Ą": "A", |
| 25840 |
"ą": "a", |
| 25841 |
"Ć": "C", |
| 25842 |
"ć": "c", |
| 25843 |
"Ĉ": "C", |
| 25844 |
"ĉ": "c", |
| 25845 |
"Ċ": "C", |
| 25846 |
"ċ": "c", |
| 25847 |
"Č": "C", |
| 25848 |
"č": "c", |
| 25849 |
"C̆": "C", |
| 25850 |
"c̆": "c", |
| 25851 |
"Ď": "D", |
| 25852 |
"ď": "d", |
| 25853 |
"Đ": "D", |
| 25854 |
"đ": "d", |
| 25855 |
"Ē": "E", |
| 25856 |
"ē": "e", |
| 25857 |
"Ĕ": "E", |
| 25858 |
"ĕ": "e", |
| 25859 |
"Ė": "E", |
| 25860 |
"ė": "e", |
| 25861 |
"Ę": "E", |
| 25862 |
"ę": "e", |
| 25863 |
"Ě": "E", |
| 25864 |
"ě": "e", |
| 25865 |
"Ĝ": "G", |
| 25866 |
"Ǵ": "G", |
| 25867 |
"ĝ": "g", |
| 25868 |
"ǵ": "g", |
| 25869 |
"Ğ": "G", |
| 25870 |
"ğ": "g", |
| 25871 |
"Ġ": "G", |
| 25872 |
"ġ": "g", |
| 25873 |
"Ģ": "G", |
| 25874 |
"ģ": "g", |
| 25875 |
"Ĥ": "H", |
| 25876 |
"ĥ": "h", |
| 25877 |
"Ħ": "H", |
| 25878 |
"ħ": "h", |
| 25879 |
"Ḫ": "H", |
| 25880 |
"ḫ": "h", |
| 25881 |
"Ĩ": "I", |
| 25882 |
"ĩ": "i", |
| 25883 |
"Ī": "I", |
| 25884 |
"ī": "i", |
| 25885 |
"Ĭ": "I", |
| 25886 |
"ĭ": "i", |
| 25887 |
"Į": "I", |
| 25888 |
"į": "i", |
| 25889 |
"İ": "I", |
| 25890 |
"ı": "i", |
| 25891 |
"IJ": "IJ", |
| 25892 |
"ij": "ij", |
| 25893 |
"Ĵ": "J", |
| 25894 |
"ĵ": "j", |
| 25895 |
"Ķ": "K", |
| 25896 |
"ķ": "k", |
| 25897 |
"Ḱ": "K", |
| 25898 |
"ḱ": "k", |
| 25899 |
"K̆": "K", |
| 25900 |
"k̆": "k", |
| 25901 |
"Ĺ": "L", |
| 25902 |
"ĺ": "l", |
| 25903 |
"Ļ": "L", |
| 25904 |
"ļ": "l", |
| 25905 |
"Ľ": "L", |
| 25906 |
"ľ": "l", |
| 25907 |
"Ŀ": "L", |
| 25908 |
"ŀ": "l", |
| 25909 |
"Ł": "l", |
| 25910 |
"ł": "l", |
| 25911 |
"Ḿ": "M", |
| 25912 |
"ḿ": "m", |
| 25913 |
"M̆": "M", |
| 25914 |
"m̆": "m", |
| 25915 |
"Ń": "N", |
| 25916 |
"ń": "n", |
| 25917 |
"Ņ": "N", |
| 25918 |
"ņ": "n", |
| 25919 |
"Ň": "N", |
| 25920 |
"ň": "n", |
| 25921 |
"ʼn": "n", |
| 25922 |
"N̆": "N", |
| 25923 |
"n̆": "n", |
| 25924 |
"Ō": "O", |
| 25925 |
"ō": "o", |
| 25926 |
"Ŏ": "O", |
| 25927 |
"ŏ": "o", |
| 25928 |
"Ő": "O", |
| 25929 |
"ő": "o", |
| 25930 |
"Œ": "OE", |
| 25931 |
"œ": "oe", |
| 25932 |
"P̆": "P", |
| 25933 |
"p̆": "p", |
| 25934 |
"Ŕ": "R", |
| 25935 |
"ŕ": "r", |
| 25936 |
"Ŗ": "R", |
| 25937 |
"ŗ": "r", |
| 25938 |
"Ř": "R", |
| 25939 |
"ř": "r", |
| 25940 |
"R̆": "R", |
| 25941 |
"r̆": "r", |
| 25942 |
"Ȓ": "R", |
| 25943 |
"ȓ": "r", |
| 25944 |
"Ś": "S", |
| 25945 |
"ś": "s", |
| 25946 |
"Ŝ": "S", |
| 25947 |
"ŝ": "s", |
| 25948 |
"Ş": "S", |
| 25949 |
"Ș": "S", |
| 25950 |
"ș": "s", |
| 25951 |
"ş": "s", |
| 25952 |
"Š": "S", |
| 25953 |
"š": "s", |
| 25954 |
"Ţ": "T", |
| 25955 |
"ţ": "t", |
| 25956 |
"ț": "t", |
| 25957 |
"Ț": "T", |
| 25958 |
"Ť": "T", |
| 25959 |
"ť": "t", |
| 25960 |
"Ŧ": "T", |
| 25961 |
"ŧ": "t", |
| 25962 |
"T̆": "T", |
| 25963 |
"t̆": "t", |
| 25964 |
"Ũ": "U", |
| 25965 |
"ũ": "u", |
| 25966 |
"Ū": "U", |
| 25967 |
"ū": "u", |
| 25968 |
"Ŭ": "U", |
| 25969 |
"ŭ": "u", |
| 25970 |
"Ů": "U", |
| 25971 |
"ů": "u", |
| 25972 |
"Ű": "U", |
| 25973 |
"ű": "u", |
| 25974 |
"Ų": "U", |
| 25975 |
"ų": "u", |
| 25976 |
"Ȗ": "U", |
| 25977 |
"ȗ": "u", |
| 25978 |
"V̆": "V", |
| 25979 |
"v̆": "v", |
| 25980 |
"Ŵ": "W", |
| 25981 |
"ŵ": "w", |
| 25982 |
"Ẃ": "W", |
| 25983 |
"ẃ": "w", |
| 25984 |
"X̆": "X", |
| 25985 |
"x̆": "x", |
| 25986 |
"Ŷ": "Y", |
| 25987 |
"ŷ": "y", |
| 25988 |
"Ÿ": "Y", |
| 25989 |
"Y̆": "Y", |
| 25990 |
"y̆": "y", |
| 25991 |
"Ź": "Z", |
| 25992 |
"ź": "z", |
| 25993 |
"Ż": "Z", |
| 25994 |
"ż": "z", |
| 25995 |
"Ž": "Z", |
| 25996 |
"ž": "z", |
| 25997 |
"ſ": "s", |
| 25998 |
"ƒ": "f", |
| 25999 |
"Ơ": "O", |
| 26000 |
"ơ": "o", |
| 26001 |
"Ư": "U", |
| 26002 |
"ư": "u", |
| 26003 |
"Ǎ": "A", |
| 26004 |
"ǎ": "a", |
| 26005 |
"Ǐ": "I", |
| 26006 |
"ǐ": "i", |
| 26007 |
"Ǒ": "O", |
| 26008 |
"ǒ": "o", |
| 26009 |
"Ǔ": "U", |
| 26010 |
"ǔ": "u", |
| 26011 |
"Ǖ": "U", |
| 26012 |
"ǖ": "u", |
| 26013 |
"Ǘ": "U", |
| 26014 |
"ǘ": "u", |
| 26015 |
"Ǚ": "U", |
| 26016 |
"ǚ": "u", |
| 26017 |
"Ǜ": "U", |
| 26018 |
"ǜ": "u", |
| 26019 |
"Ứ": "U", |
| 26020 |
"ứ": "u", |
| 26021 |
"Ṹ": "U", |
| 26022 |
"ṹ": "u", |
| 26023 |
"Ǻ": "A", |
| 26024 |
"ǻ": "a", |
| 26025 |
"Ǽ": "AE", |
| 26026 |
"ǽ": "ae", |
| 26027 |
"Ǿ": "O", |
| 26028 |
"ǿ": "o", |
| 26029 |
"Þ": "TH", |
| 26030 |
"þ": "th", |
| 26031 |
"Ṕ": "P", |
| 26032 |
"ṕ": "p", |
| 26033 |
"Ṥ": "S", |
| 26034 |
"ṥ": "s", |
| 26035 |
"X́": "X", |
| 26036 |
"x́": "x", |
| 26037 |
"Ѓ": "Г", |
| 26038 |
"ѓ": "г", |
| 26039 |
"Ќ": "К", |
| 26040 |
"ќ": "к", |
| 26041 |
"A̋": "A", |
| 26042 |
"a̋": "a", |
| 26043 |
"E̋": "E", |
| 26044 |
"e̋": "e", |
| 26045 |
"I̋": "I", |
| 26046 |
"i̋": "i", |
| 26047 |
"Ǹ": "N", |
| 26048 |
"ǹ": "n", |
| 26049 |
"Ồ": "O", |
| 26050 |
"ồ": "o", |
| 26051 |
"Ṑ": "O", |
| 26052 |
"ṑ": "o", |
| 26053 |
"Ừ": "U", |
| 26054 |
"ừ": "u", |
| 26055 |
"Ẁ": "W", |
| 26056 |
"ẁ": "w", |
| 26057 |
"Ỳ": "Y", |
| 26058 |
"ỳ": "y", |
| 26059 |
"Ȁ": "A", |
| 26060 |
"ȁ": "a", |
| 26061 |
"Ȅ": "E", |
| 26062 |
"ȅ": "e", |
| 26063 |
"Ȉ": "I", |
| 26064 |
"ȉ": "i", |
| 26065 |
"Ȍ": "O", |
| 26066 |
"ȍ": "o", |
| 26067 |
"Ȑ": "R", |
| 26068 |
"ȑ": "r", |
| 26069 |
"Ȕ": "U", |
| 26070 |
"ȕ": "u", |
| 26071 |
"B̌": "B", |
| 26072 |
"b̌": "b", |
| 26073 |
"Č̣": "C", |
| 26074 |
"č̣": "c", |
| 26075 |
"Ê̌": "E", |
| 26076 |
"ê̌": "e", |
| 26077 |
"F̌": "F", |
| 26078 |
"f̌": "f", |
| 26079 |
"Ǧ": "G", |
| 26080 |
"ǧ": "g", |
| 26081 |
"Ȟ": "H", |
| 26082 |
"ȟ": "h", |
| 26083 |
"J̌": "J", |
| 26084 |
"ǰ": "j", |
| 26085 |
"Ǩ": "K", |
| 26086 |
"ǩ": "k", |
| 26087 |
"M̌": "M", |
| 26088 |
"m̌": "m", |
| 26089 |
"P̌": "P", |
| 26090 |
"p̌": "p", |
| 26091 |
"Q̌": "Q", |
| 26092 |
"q̌": "q", |
| 26093 |
"Ř̩": "R", |
| 26094 |
"ř̩": "r", |
| 26095 |
"Ṧ": "S", |
| 26096 |
"ṧ": "s", |
| 26097 |
"V̌": "V", |
| 26098 |
"v̌": "v", |
| 26099 |
"W̌": "W", |
| 26100 |
"w̌": "w", |
| 26101 |
"X̌": "X", |
| 26102 |
"x̌": "x", |
| 26103 |
"Y̌": "Y", |
| 26104 |
"y̌": "y", |
| 26105 |
"A̧": "A", |
| 26106 |
"a̧": "a", |
| 26107 |
"B̧": "B", |
| 26108 |
"b̧": "b", |
| 26109 |
"Ḑ": "D", |
| 26110 |
"ḑ": "d", |
| 26111 |
"Ȩ": "E", |
| 26112 |
"ȩ": "e", |
| 26113 |
"Ɛ̧": "E", |
| 26114 |
"ɛ̧": "e", |
| 26115 |
"Ḩ": "H", |
| 26116 |
"ḩ": "h", |
| 26117 |
"I̧": "I", |
| 26118 |
"i̧": "i", |
| 26119 |
"Ɨ̧": "I", |
| 26120 |
"ɨ̧": "i", |
| 26121 |
"M̧": "M", |
| 26122 |
"m̧": "m", |
| 26123 |
"O̧": "O", |
| 26124 |
"o̧": "o", |
| 26125 |
"Q̧": "Q", |
| 26126 |
"q̧": "q", |
| 26127 |
"U̧": "U", |
| 26128 |
"u̧": "u", |
| 26129 |
"X̧": "X", |
| 26130 |
"x̧": "x", |
| 26131 |
"Z̧": "Z", |
| 26132 |
"z̧": "z", |
| 26133 |
"й": "и", |
| 26134 |
"Й": "И", |
| 26135 |
"ё": "е", |
| 26136 |
"Ё": "Е" |
| 26137 |
}; |
| 26138 |
var chars = Object.keys(characterMap).join("|"); |
| 26139 |
var allAccents = new RegExp(chars, "g"); |
| 26140 |
var firstAccent = new RegExp(chars, ""); |
| 26141 |
function matcher(match) { |
| 26142 |
return characterMap[match]; |
| 26143 |
} |
| 26144 |
var removeAccents = function(string) { |
| 26145 |
return string.replace(allAccents, matcher); |
| 26146 |
}; |
| 26147 |
var hasAccents = function(string) { |
| 26148 |
return !!string.match(firstAccent); |
| 26149 |
}; |
| 26150 |
module.exports = removeAccents; |
| 26151 |
module.exports.has = hasAccents; |
| 26152 |
module.exports.remove = removeAccents; |
| 26153 |
})); |
| 26154 |
|
| 26155 |
//#endregion |
| 26156 |
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js |
| 26157 |
function _typeof(o) { |
| 26158 |
"@babel/helpers - typeof"; |
| 26159 |
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 26160 |
return typeof o; |
| 26161 |
} : function(o) { |
| 26162 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 26163 |
}, _typeof(o); |
| 26164 |
} |
| 26165 |
var init_typeof = __esmMin((() => {})); |
| 26166 |
|
| 26167 |
//#endregion |
| 26168 |
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js |
| 26169 |
function toPrimitive(t, r) { |
| 26170 |
if ("object" != _typeof(t) || !t) return t; |
| 26171 |
var e = t[Symbol.toPrimitive]; |
| 26172 |
if (void 0 !== e) { |
| 26173 |
var i = e.call(t, r || "default"); |
| 26174 |
if ("object" != _typeof(i)) return i; |
| 26175 |
throw new TypeError("@@toPrimitive must return a primitive value."); |
| 26176 |
} |
| 26177 |
return ("string" === r ? String : Number)(t); |
| 26178 |
} |
| 26179 |
var init_toPrimitive = __esmMin((() => { |
| 26180 |
init_typeof(); |
| 26181 |
})); |
| 26182 |
|
| 26183 |
//#endregion |
| 26184 |
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js |
| 26185 |
function toPropertyKey(t) { |
| 26186 |
var i = toPrimitive(t, "string"); |
| 26187 |
return "symbol" == _typeof(i) ? i : i + ""; |
| 26188 |
} |
| 26189 |
var init_toPropertyKey = __esmMin((() => { |
| 26190 |
init_typeof(); |
| 26191 |
init_toPrimitive(); |
| 26192 |
})); |
| 26193 |
|
| 26194 |
//#endregion |
| 26195 |
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js |
| 26196 |
function _defineProperty(e, r, t) { |
| 26197 |
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { |
| 26198 |
value: t, |
| 26199 |
enumerable: !0, |
| 26200 |
configurable: !0, |
| 26201 |
writable: !0 |
| 26202 |
}) : e[r] = t, e; |
| 26203 |
} |
| 26204 |
var init_defineProperty = __esmMin((() => { |
| 26205 |
init_toPropertyKey(); |
| 26206 |
})); |
| 26207 |
|
| 26208 |
//#endregion |
| 26209 |
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/objectSpread2.js |
| 26210 |
function ownKeys(e, r) { |
| 26211 |
var t = Object.keys(e); |
| 26212 |
if (Object.getOwnPropertySymbols) { |
| 26213 |
var o = Object.getOwnPropertySymbols(e); |
| 26214 |
r && (o = o.filter(function(r) { |
| 26215 |
return Object.getOwnPropertyDescriptor(e, r).enumerable; |
| 26216 |
})), t.push.apply(t, o); |
| 26217 |
} |
| 26218 |
return t; |
| 26219 |
} |
| 26220 |
function _objectSpread2(e) { |
| 26221 |
for (var r = 1; r < arguments.length; r++) { |
| 26222 |
var t = null != arguments[r] ? arguments[r] : {}; |
| 26223 |
r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { |
| 26224 |
_defineProperty(e, r, t[r]); |
| 26225 |
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { |
| 26226 |
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); |
| 26227 |
}); |
| 26228 |
} |
| 26229 |
return e; |
| 26230 |
} |
| 26231 |
var init_objectSpread2 = __esmMin((() => { |
| 26232 |
init_defineProperty(); |
| 26233 |
})); |
| 26234 |
|
| 26235 |
//#endregion |
| 26236 |
//#region node_modules/match-sorter/dist/match-sorter.esm.js |
| 26237 |
/** |
| 26238 |
* @name match-sorter |
| 26239 |
* @license MIT license. |
| 26240 |
* @copyright (c) 2020 Kent C. Dodds |
| 26241 |
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com) |
| 26242 |
*/ |
| 26243 |
/** |
| 26244 |
* Takes an array of items and a value and returns a new array with the items that match the given value |
| 26245 |
* @param {Array} items - the items to sort |
| 26246 |
* @param {String} value - the value to use for ranking |
| 26247 |
* @param {Object} options - Some options to configure the sorter |
| 26248 |
* @return {Array} - the new sorted array |
| 26249 |
*/ |
| 26250 |
function matchSorter(items, value, options) { |
| 26251 |
if (options === void 0) options = {}; |
| 26252 |
const { keys, threshold = rankings.MATCHES, baseSort = defaultBaseSortFn, sorter = (matchedItems) => matchedItems.sort((a, b) => sortRankedValues(a, b, baseSort)) } = options; |
| 26253 |
return sorter(items.reduce(reduceItemsToRanked, [])).map((_ref) => { |
| 26254 |
let { item } = _ref; |
| 26255 |
return item; |
| 26256 |
}); |
| 26257 |
function reduceItemsToRanked(matches, item, index) { |
| 26258 |
const rankingInfo = getHighestRanking(item, keys, value, options); |
| 26259 |
const { rank, keyThreshold = threshold } = rankingInfo; |
| 26260 |
if (rank >= keyThreshold) matches.push(_objectSpread2(_objectSpread2({}, rankingInfo), {}, { |
| 26261 |
item, |
| 26262 |
index |
| 26263 |
})); |
| 26264 |
return matches; |
| 26265 |
} |
| 26266 |
} |
| 26267 |
/** |
| 26268 |
* Gets the highest ranking for value for the given item based on its values for the given keys |
| 26269 |
* @param {*} item - the item to rank |
| 26270 |
* @param {Array} keys - the keys to get values from the item for the ranking |
| 26271 |
* @param {String} value - the value to rank against |
| 26272 |
* @param {Object} options - options to control the ranking |
| 26273 |
* @return {{rank: Number, keyIndex: Number, keyThreshold: Number}} - the highest ranking |
| 26274 |
*/ |
| 26275 |
function getHighestRanking(item, keys, value, options) { |
| 26276 |
if (!keys) { |
| 26277 |
const stringItem = item; |
| 26278 |
return { |
| 26279 |
rankedValue: stringItem, |
| 26280 |
rank: getMatchRanking(stringItem, value, options), |
| 26281 |
keyIndex: -1, |
| 26282 |
keyThreshold: options.threshold |
| 26283 |
}; |
| 26284 |
} |
| 26285 |
return getAllValuesToRank(item, keys).reduce((_ref2, _ref3, i) => { |
| 26286 |
let { rank, rankedValue, keyIndex, keyThreshold } = _ref2; |
| 26287 |
let { itemValue, attributes } = _ref3; |
| 26288 |
let newRank = getMatchRanking(itemValue, value, options); |
| 26289 |
let newRankedValue = rankedValue; |
| 26290 |
const { minRanking, maxRanking, threshold } = attributes; |
| 26291 |
if (newRank < minRanking && newRank >= rankings.MATCHES) newRank = minRanking; |
| 26292 |
else if (newRank > maxRanking) newRank = maxRanking; |
| 26293 |
if (newRank > rank) { |
| 26294 |
rank = newRank; |
| 26295 |
keyIndex = i; |
| 26296 |
keyThreshold = threshold; |
| 26297 |
newRankedValue = itemValue; |
| 26298 |
} |
| 26299 |
return { |
| 26300 |
rankedValue: newRankedValue, |
| 26301 |
rank, |
| 26302 |
keyIndex, |
| 26303 |
keyThreshold |
| 26304 |
}; |
| 26305 |
}, { |
| 26306 |
rankedValue: item, |
| 26307 |
rank: rankings.NO_MATCH, |
| 26308 |
keyIndex: -1, |
| 26309 |
keyThreshold: options.threshold |
| 26310 |
}); |
| 26311 |
} |
| 26312 |
/** |
| 26313 |
* Gives a rankings score based on how well the two strings match. |
| 26314 |
* @param {String} testString - the string to test against |
| 26315 |
* @param {String} stringToRank - the string to rank |
| 26316 |
* @param {Object} options - options for the match (like keepDiacritics for comparison) |
| 26317 |
* @returns {Number} the ranking for how well stringToRank matches testString |
| 26318 |
*/ |
| 26319 |
function getMatchRanking(testString, stringToRank, options) { |
| 26320 |
testString = prepareValueForComparison(testString, options); |
| 26321 |
stringToRank = prepareValueForComparison(stringToRank, options); |
| 26322 |
if (stringToRank.length > testString.length) return rankings.NO_MATCH; |
| 26323 |
if (testString === stringToRank) return rankings.CASE_SENSITIVE_EQUAL; |
| 26324 |
testString = testString.toLowerCase(); |
| 26325 |
stringToRank = stringToRank.toLowerCase(); |
| 26326 |
if (testString === stringToRank) return rankings.EQUAL; |
| 26327 |
if (testString.startsWith(stringToRank)) return rankings.STARTS_WITH; |
| 26328 |
if (testString.includes(` ${stringToRank}`)) return rankings.WORD_STARTS_WITH; |
| 26329 |
if (testString.includes(stringToRank)) return rankings.CONTAINS; |
| 26330 |
else if (stringToRank.length === 1) return rankings.NO_MATCH; |
| 26331 |
if (getAcronym(testString).includes(stringToRank)) return rankings.ACRONYM; |
| 26332 |
return getClosenessRanking(testString, stringToRank); |
| 26333 |
} |
| 26334 |
/** |
| 26335 |
* Generates an acronym for a string. |
| 26336 |
* |
| 26337 |
* @param {String} string the string for which to produce the acronym |
| 26338 |
* @returns {String} the acronym |
| 26339 |
*/ |
| 26340 |
function getAcronym(string) { |
| 26341 |
let acronym = ""; |
| 26342 |
string.split(" ").forEach((wordInString) => { |
| 26343 |
wordInString.split("-").forEach((splitByHyphenWord) => { |
| 26344 |
acronym += splitByHyphenWord.substr(0, 1); |
| 26345 |
}); |
| 26346 |
}); |
| 26347 |
return acronym; |
| 26348 |
} |
| 26349 |
/** |
| 26350 |
* Returns a score based on how spread apart the |
| 26351 |
* characters from the stringToRank are within the testString. |
| 26352 |
* A number close to rankings.MATCHES represents a loose match. A number close |
| 26353 |
* to rankings.MATCHES + 1 represents a tighter match. |
| 26354 |
* @param {String} testString - the string to test against |
| 26355 |
* @param {String} stringToRank - the string to rank |
| 26356 |
* @returns {Number} the number between rankings.MATCHES and |
| 26357 |
* rankings.MATCHES + 1 for how well stringToRank matches testString |
| 26358 |
*/ |
| 26359 |
function getClosenessRanking(testString, stringToRank) { |
| 26360 |
let matchingInOrderCharCount = 0; |
| 26361 |
let charNumber = 0; |
| 26362 |
function findMatchingCharacter(matchChar, string, index) { |
| 26363 |
for (let j = index, J = string.length; j < J; j++) if (string[j] === matchChar) { |
| 26364 |
matchingInOrderCharCount += 1; |
| 26365 |
return j + 1; |
| 26366 |
} |
| 26367 |
return -1; |
| 26368 |
} |
| 26369 |
function getRanking(spread) { |
| 26370 |
const spreadPercentage = 1 / spread; |
| 26371 |
const inOrderPercentage = matchingInOrderCharCount / stringToRank.length; |
| 26372 |
return rankings.MATCHES + inOrderPercentage * spreadPercentage; |
| 26373 |
} |
| 26374 |
const firstIndex = findMatchingCharacter(stringToRank[0], testString, 0); |
| 26375 |
if (firstIndex < 0) return rankings.NO_MATCH; |
| 26376 |
charNumber = firstIndex; |
| 26377 |
for (let i = 1, I = stringToRank.length; i < I; i++) { |
| 26378 |
const matchChar = stringToRank[i]; |
| 26379 |
charNumber = findMatchingCharacter(matchChar, testString, charNumber); |
| 26380 |
if (!(charNumber > -1)) return rankings.NO_MATCH; |
| 26381 |
} |
| 26382 |
return getRanking(charNumber - firstIndex); |
| 26383 |
} |
| 26384 |
/** |
| 26385 |
* Sorts items that have a rank, index, and keyIndex |
| 26386 |
* @param {Object} a - the first item to sort |
| 26387 |
* @param {Object} b - the second item to sort |
| 26388 |
* @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal |
| 26389 |
*/ |
| 26390 |
function sortRankedValues(a, b, baseSort) { |
| 26391 |
const aFirst = -1; |
| 26392 |
const bFirst = 1; |
| 26393 |
const { rank: aRank, keyIndex: aKeyIndex } = a; |
| 26394 |
const { rank: bRank, keyIndex: bKeyIndex } = b; |
| 26395 |
if (aRank === bRank) if (aKeyIndex === bKeyIndex) return baseSort(a, b); |
| 26396 |
else return aKeyIndex < bKeyIndex ? aFirst : bFirst; |
| 26397 |
else return aRank > bRank ? aFirst : bFirst; |
| 26398 |
} |
| 26399 |
/** |
| 26400 |
* Prepares value for comparison by stringifying it, removing diacritics (if specified) |
| 26401 |
* @param {String} value - the value to clean |
| 26402 |
* @param {Object} options - {keepDiacritics: whether to remove diacritics} |
| 26403 |
* @return {String} the prepared value |
| 26404 |
*/ |
| 26405 |
function prepareValueForComparison(value, _ref4) { |
| 26406 |
let { keepDiacritics } = _ref4; |
| 26407 |
value = `${value}`; |
| 26408 |
if (!keepDiacritics) value = (0, import_remove_accents.default)(value); |
| 26409 |
return value; |
| 26410 |
} |
| 26411 |
/** |
| 26412 |
* Gets value for key in item at arbitrarily nested keypath |
| 26413 |
* @param {Object} item - the item |
| 26414 |
* @param {Object|Function} key - the potentially nested keypath or property callback |
| 26415 |
* @return {Array} - an array containing the value(s) at the nested keypath |
| 26416 |
*/ |
| 26417 |
function getItemValues(item, key) { |
| 26418 |
if (typeof key === "object") key = key.key; |
| 26419 |
let value; |
| 26420 |
if (typeof key === "function") value = key(item); |
| 26421 |
else if (item == null) value = null; |
| 26422 |
else if (Object.hasOwnProperty.call(item, key)) value = item[key]; |
| 26423 |
else if (key.includes(".")) return getNestedValues(key, item); |
| 26424 |
else value = null; |
| 26425 |
if (value == null) return []; |
| 26426 |
if (Array.isArray(value)) return value; |
| 26427 |
return [String(value)]; |
| 26428 |
} |
| 26429 |
/** |
| 26430 |
* Given path: "foo.bar.baz" |
| 26431 |
* And item: {foo: {bar: {baz: 'buzz'}}} |
| 26432 |
* -> 'buzz' |
| 26433 |
* @param path a dot-separated set of keys |
| 26434 |
* @param item the item to get the value from |
| 26435 |
*/ |
| 26436 |
function getNestedValues(path, item) { |
| 26437 |
const keys = path.split("."); |
| 26438 |
let values = [item]; |
| 26439 |
for (let i = 0, I = keys.length; i < I; i++) { |
| 26440 |
const nestedKey = keys[i]; |
| 26441 |
let nestedValues = []; |
| 26442 |
for (let j = 0, J = values.length; j < J; j++) { |
| 26443 |
const nestedItem = values[j]; |
| 26444 |
if (nestedItem == null) continue; |
| 26445 |
if (Object.hasOwnProperty.call(nestedItem, nestedKey)) { |
| 26446 |
const nestedValue = nestedItem[nestedKey]; |
| 26447 |
if (nestedValue != null) nestedValues.push(nestedValue); |
| 26448 |
} else if (nestedKey === "*") nestedValues = nestedValues.concat(nestedItem); |
| 26449 |
} |
| 26450 |
values = nestedValues; |
| 26451 |
} |
| 26452 |
if (Array.isArray(values[0])) return [].concat(...values); |
| 26453 |
return values; |
| 26454 |
} |
| 26455 |
/** |
| 26456 |
* Gets all the values for the given keys in the given item and returns an array of those values |
| 26457 |
* @param item - the item from which the values will be retrieved |
| 26458 |
* @param keys - the keys to use to retrieve the values |
| 26459 |
* @return objects with {itemValue, attributes} |
| 26460 |
*/ |
| 26461 |
function getAllValuesToRank(item, keys) { |
| 26462 |
const allValues = []; |
| 26463 |
for (let j = 0, J = keys.length; j < J; j++) { |
| 26464 |
const key = keys[j]; |
| 26465 |
const attributes = getKeyAttributes(key); |
| 26466 |
const itemValues = getItemValues(item, key); |
| 26467 |
for (let i = 0, I = itemValues.length; i < I; i++) allValues.push({ |
| 26468 |
itemValue: itemValues[i], |
| 26469 |
attributes |
| 26470 |
}); |
| 26471 |
} |
| 26472 |
return allValues; |
| 26473 |
} |
| 26474 |
/** |
| 26475 |
* Gets all the attributes for the given key |
| 26476 |
* @param key - the key from which the attributes will be retrieved |
| 26477 |
* @return object containing the key's attributes |
| 26478 |
*/ |
| 26479 |
function getKeyAttributes(key) { |
| 26480 |
if (typeof key === "string") return defaultKeyAttributes; |
| 26481 |
return _objectSpread2(_objectSpread2({}, defaultKeyAttributes), key); |
| 26482 |
} |
| 26483 |
var import_remove_accents, rankings, defaultBaseSortFn, defaultKeyAttributes; |
| 26484 |
var init_match_sorter_esm = __esmMin((() => { |
| 26485 |
import_remove_accents = /* @__PURE__ */ __toESM(require_remove_accents()); |
| 26486 |
init_objectSpread2(); |
| 26487 |
rankings = { |
| 26488 |
CASE_SENSITIVE_EQUAL: 7, |
| 26489 |
EQUAL: 6, |
| 26490 |
STARTS_WITH: 5, |
| 26491 |
WORD_STARTS_WITH: 4, |
| 26492 |
CONTAINS: 3, |
| 26493 |
ACRONYM: 2, |
| 26494 |
MATCHES: 1, |
| 26495 |
NO_MATCH: 0 |
| 26496 |
}; |
| 26497 |
defaultBaseSortFn = (a, b) => String(a.rankedValue).localeCompare(String(b.rankedValue)); |
| 26498 |
matchSorter.rankings = rankings; |
| 26499 |
defaultKeyAttributes = { |
| 26500 |
maxRanking: Infinity, |
| 26501 |
minRanking: -Infinity |
| 26502 |
}; |
| 26503 |
})); |
| 26504 |
|
| 26505 |
//#endregion |
| 26506 |
//#region node_modules/react-query/es/devtools/useLocalStorage.js |
| 26507 |
function useLocalStorage(key, defaultValue) { |
| 26508 |
var _React$useState = react.default.useState(); |
| 26509 |
var value = _React$useState[0]; |
| 26510 |
var setValue = _React$useState[1]; |
| 26511 |
react.default.useEffect(function() { |
| 26512 |
var initialValue = getItem(key); |
| 26513 |
if (typeof initialValue === "undefined" || initialValue === null) setValue(typeof defaultValue === "function" ? defaultValue() : defaultValue); |
| 26514 |
else setValue(initialValue); |
| 26515 |
}, [defaultValue, key]); |
| 26516 |
return [value, react.default.useCallback(function(updater) { |
| 26517 |
setValue(function(old) { |
| 26518 |
var newVal = updater; |
| 26519 |
if (typeof updater == "function") newVal = updater(old); |
| 26520 |
try { |
| 26521 |
localStorage.setItem(key, JSON.stringify(newVal)); |
| 26522 |
} catch (_unused2) {} |
| 26523 |
return newVal; |
| 26524 |
}); |
| 26525 |
}, [key])]; |
| 26526 |
} |
| 26527 |
var getItem; |
| 26528 |
var init_useLocalStorage = __esmMin((() => { |
| 26529 |
getItem = function getItem(key) { |
| 26530 |
try { |
| 26531 |
var itemValue = localStorage.getItem(key); |
| 26532 |
if (typeof itemValue === "string") return JSON.parse(itemValue); |
| 26533 |
return; |
| 26534 |
} catch (_unused) { |
| 26535 |
return; |
| 26536 |
} |
| 26537 |
}; |
| 26538 |
})); |
| 26539 |
|
| 26540 |
//#endregion |
| 26541 |
//#region node_modules/react-query/es/devtools/theme.js |
| 26542 |
function ThemeProvider(_ref) { |
| 26543 |
var theme = _ref.theme; |
| 26544 |
var rest = _objectWithoutPropertiesLoose(_ref, ["theme"]); |
| 26545 |
return /*#__PURE__*/ react.default.createElement(ThemeContext.Provider, _extends({ value: theme }, rest)); |
| 26546 |
} |
| 26547 |
function useTheme() { |
| 26548 |
return react.default.useContext(ThemeContext); |
| 26549 |
} |
| 26550 |
var defaultTheme, ThemeContext; |
| 26551 |
var init_theme = __esmMin((() => { |
| 26552 |
init_extends(); |
| 26553 |
init_objectWithoutPropertiesLoose(); |
| 26554 |
defaultTheme = { |
| 26555 |
background: "#0b1521", |
| 26556 |
backgroundAlt: "#132337", |
| 26557 |
foreground: "white", |
| 26558 |
gray: "#3f4e60", |
| 26559 |
grayAlt: "#222e3e", |
| 26560 |
inputBackgroundColor: "#fff", |
| 26561 |
inputTextColor: "#000", |
| 26562 |
success: "#00ab52", |
| 26563 |
danger: "#ff0085", |
| 26564 |
active: "#006bff", |
| 26565 |
warning: "#ffb200" |
| 26566 |
}; |
| 26567 |
ThemeContext = /*#__PURE__*/ react.default.createContext(defaultTheme); |
| 26568 |
})); |
| 26569 |
|
| 26570 |
//#endregion |
| 26571 |
//#region node_modules/react-query/es/devtools/useMediaQuery.js |
| 26572 |
function useMediaQuery(query) { |
| 26573 |
var _React$useState = react.default.useState(function() { |
| 26574 |
if (typeof window !== "undefined") return window.matchMedia && window.matchMedia(query).matches; |
| 26575 |
}); |
| 26576 |
var isMatch = _React$useState[0]; |
| 26577 |
var setIsMatch = _React$useState[1]; |
| 26578 |
react.default.useEffect(function() { |
| 26579 |
if (typeof window !== "undefined") { |
| 26580 |
if (!window.matchMedia) return; |
| 26581 |
var matcher = window.matchMedia(query); |
| 26582 |
var onChange = function onChange(_ref) { |
| 26583 |
var matches = _ref.matches; |
| 26584 |
return setIsMatch(matches); |
| 26585 |
}; |
| 26586 |
matcher.addListener(onChange); |
| 26587 |
return function() { |
| 26588 |
matcher.removeListener(onChange); |
| 26589 |
}; |
| 26590 |
} |
| 26591 |
}, [ |
| 26592 |
isMatch, |
| 26593 |
query, |
| 26594 |
setIsMatch |
| 26595 |
]); |
| 26596 |
return isMatch; |
| 26597 |
} |
| 26598 |
var init_useMediaQuery = __esmMin((() => {})); |
| 26599 |
|
| 26600 |
//#endregion |
| 26601 |
//#region node_modules/react-query/es/devtools/utils.js |
| 26602 |
function getQueryStatusColor(query, theme) { |
| 26603 |
return query.state.isFetching ? theme.active : !query.getObserversCount() ? theme.gray : query.isStale() ? theme.warning : theme.success; |
| 26604 |
} |
| 26605 |
function getQueryStatusLabel(query) { |
| 26606 |
return query.state.isFetching ? "fetching" : !query.getObserversCount() ? "inactive" : query.isStale() ? "stale" : "fresh"; |
| 26607 |
} |
| 26608 |
function styled(type, newStyles, queries) { |
| 26609 |
if (queries === void 0) queries = {}; |
| 26610 |
return /*#__PURE__*/ react.default.forwardRef(function(_ref, ref) { |
| 26611 |
var style = _ref.style; |
| 26612 |
var rest = _objectWithoutPropertiesLoose(_ref, ["style"]); |
| 26613 |
var theme = useTheme(); |
| 26614 |
var mediaStyles = Object.entries(queries).reduce(function(current, _ref2) { |
| 26615 |
var key = _ref2[0]; |
| 26616 |
var value = _ref2[1]; |
| 26617 |
return useMediaQuery(key) ? _extends({}, current, typeof value === "function" ? value(rest, theme) : value) : current; |
| 26618 |
}, {}); |
| 26619 |
return /*#__PURE__*/ react.default.createElement(type, _extends({}, rest, { |
| 26620 |
style: _extends({}, typeof newStyles === "function" ? newStyles(rest, theme) : newStyles, style, mediaStyles), |
| 26621 |
ref |
| 26622 |
})); |
| 26623 |
}); |
| 26624 |
} |
| 26625 |
function useIsMounted() { |
| 26626 |
var mountedRef = react.default.useRef(false); |
| 26627 |
var isMounted = react.default.useCallback(function() { |
| 26628 |
return mountedRef.current; |
| 26629 |
}, []); |
| 26630 |
react.default[isServer$1 ? "useEffect" : "useLayoutEffect"](function() { |
| 26631 |
mountedRef.current = true; |
| 26632 |
return function() { |
| 26633 |
mountedRef.current = false; |
| 26634 |
}; |
| 26635 |
}, []); |
| 26636 |
return isMounted; |
| 26637 |
} |
| 26638 |
/** |
| 26639 |
* This hook is a safe useState version which schedules state updates in microtasks |
| 26640 |
* to prevent updating a component state while React is rendering different components |
| 26641 |
* or when the component is not mounted anymore. |
| 26642 |
*/ |
| 26643 |
function useSafeState(initialState) { |
| 26644 |
var isMounted = useIsMounted(); |
| 26645 |
var _React$useState = react.default.useState(initialState); |
| 26646 |
var state = _React$useState[0]; |
| 26647 |
var setState = _React$useState[1]; |
| 26648 |
return [state, react.default.useCallback(function(value) { |
| 26649 |
scheduleMicrotask(function() { |
| 26650 |
if (isMounted()) setState(value); |
| 26651 |
}); |
| 26652 |
}, [isMounted])]; |
| 26653 |
} |
| 26654 |
/** |
| 26655 |
* Schedules a microtask. |
| 26656 |
* This can be useful to schedule state updates after rendering. |
| 26657 |
*/ |
| 26658 |
function scheduleMicrotask(callback) { |
| 26659 |
Promise.resolve().then(callback).catch(function(error) { |
| 26660 |
return setTimeout(function() { |
| 26661 |
throw error; |
| 26662 |
}); |
| 26663 |
}); |
| 26664 |
} |
| 26665 |
var isServer$1, displayValue; |
| 26666 |
var init_utils = __esmMin((() => { |
| 26667 |
init_extends(); |
| 26668 |
init_objectWithoutPropertiesLoose(); |
| 26669 |
init_theme(); |
| 26670 |
init_useMediaQuery(); |
| 26671 |
isServer$1 = typeof window === "undefined"; |
| 26672 |
displayValue = function displayValue(value) { |
| 26673 |
var name = Object.getOwnPropertyNames(Object(value)); |
| 26674 |
var newValue = typeof value === "bigint" ? value.toString() + "n" : value; |
| 26675 |
return JSON.stringify(newValue, name); |
| 26676 |
}; |
| 26677 |
})); |
| 26678 |
|
| 26679 |
//#endregion |
| 26680 |
//#region node_modules/react-query/es/devtools/styledComponents.js |
| 26681 |
var Panel, ActiveQueryPanel, Button, QueryKeys, QueryKey, Code, Input, Select; |
| 26682 |
var init_styledComponents = __esmMin((() => { |
| 26683 |
init_utils(); |
| 26684 |
Panel = styled("div", function(_props, theme) { |
| 26685 |
return { |
| 26686 |
fontSize: "clamp(12px, 1.5vw, 14px)", |
| 26687 |
fontFamily: "sans-serif", |
| 26688 |
display: "flex", |
| 26689 |
backgroundColor: theme.background, |
| 26690 |
color: theme.foreground |
| 26691 |
}; |
| 26692 |
}, { |
| 26693 |
"(max-width: 700px)": { flexDirection: "column" }, |
| 26694 |
"(max-width: 600px)": { fontSize: ".9em" } |
| 26695 |
}); |
| 26696 |
ActiveQueryPanel = styled("div", function() { |
| 26697 |
return { |
| 26698 |
flex: "1 1 500px", |
| 26699 |
display: "flex", |
| 26700 |
flexDirection: "column", |
| 26701 |
overflow: "auto", |
| 26702 |
height: "100%" |
| 26703 |
}; |
| 26704 |
}, { "(max-width: 700px)": function maxWidth700px(_props, theme) { |
| 26705 |
return { borderTop: "2px solid " + theme.gray }; |
| 26706 |
} }); |
| 26707 |
Button = styled("button", function(props, theme) { |
| 26708 |
return { |
| 26709 |
appearance: "none", |
| 26710 |
fontSize: ".9em", |
| 26711 |
fontWeight: "bold", |
| 26712 |
background: theme.gray, |
| 26713 |
border: "0", |
| 26714 |
borderRadius: ".3em", |
| 26715 |
color: "white", |
| 26716 |
padding: ".5em", |
| 26717 |
opacity: props.disabled ? ".5" : void 0, |
| 26718 |
cursor: "pointer" |
| 26719 |
}; |
| 26720 |
}); |
| 26721 |
QueryKeys = styled("span", { |
| 26722 |
display: "inline-block", |
| 26723 |
fontSize: "0.9em" |
| 26724 |
}); |
| 26725 |
QueryKey = styled("span", { |
| 26726 |
display: "inline-flex", |
| 26727 |
alignItems: "center", |
| 26728 |
padding: ".2em .4em", |
| 26729 |
fontWeight: "bold", |
| 26730 |
textShadow: "0 0 10px black", |
| 26731 |
borderRadius: ".2em" |
| 26732 |
}); |
| 26733 |
Code = styled("code", { |
| 26734 |
fontSize: ".9em", |
| 26735 |
color: "inherit", |
| 26736 |
background: "inherit" |
| 26737 |
}); |
| 26738 |
Input = styled("input", function(_props, theme) { |
| 26739 |
return { |
| 26740 |
backgroundColor: theme.inputBackgroundColor, |
| 26741 |
border: 0, |
| 26742 |
borderRadius: ".2em", |
| 26743 |
color: theme.inputTextColor, |
| 26744 |
fontSize: ".9em", |
| 26745 |
lineHeight: "1.3", |
| 26746 |
padding: ".3em .4em" |
| 26747 |
}; |
| 26748 |
}); |
| 26749 |
Select = styled("select", function(_props, theme) { |
| 26750 |
return { |
| 26751 |
display: "inline-block", |
| 26752 |
fontSize: ".9em", |
| 26753 |
fontFamily: "sans-serif", |
| 26754 |
fontWeight: "normal", |
| 26755 |
lineHeight: "1.3", |
| 26756 |
padding: ".3em 1.5em .3em .5em", |
| 26757 |
height: "auto", |
| 26758 |
border: 0, |
| 26759 |
borderRadius: ".2em", |
| 26760 |
appearance: "none", |
| 26761 |
WebkitAppearance: "none", |
| 26762 |
backgroundColor: theme.inputBackgroundColor, |
| 26763 |
backgroundImage: "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")", |
| 26764 |
backgroundRepeat: "no-repeat", |
| 26765 |
backgroundPosition: "right .55em center", |
| 26766 |
backgroundSize: ".65em auto, 100%", |
| 26767 |
color: theme.inputTextColor |
| 26768 |
}; |
| 26769 |
}, { "(max-width: 500px)": { display: "none" } }); |
| 26770 |
})); |
| 26771 |
|
| 26772 |
//#endregion |
| 26773 |
//#region node_modules/react-query/es/devtools/Explorer.js |
| 26774 |
/** |
| 26775 |
* Chunk elements in the array by size |
| 26776 |
* |
| 26777 |
* when the array cannot be chunked evenly by size, the last chunk will be |
| 26778 |
* filled with the remaining elements |
| 26779 |
* |
| 26780 |
* @example |
| 26781 |
* chunkArray(['a','b', 'c', 'd', 'e'], 2) // returns [['a','b'], ['c', 'd'], ['e']] |
| 26782 |
*/ |
| 26783 |
function chunkArray(array, size) { |
| 26784 |
if (size < 1) return []; |
| 26785 |
var i = 0; |
| 26786 |
var result = []; |
| 26787 |
while (i < array.length) { |
| 26788 |
result.push(array.slice(i, i + size)); |
| 26789 |
i = i + size; |
| 26790 |
} |
| 26791 |
return result; |
| 26792 |
} |
| 26793 |
function isIterable(x) { |
| 26794 |
return Symbol.iterator in x; |
| 26795 |
} |
| 26796 |
function Explorer(_ref3) { |
| 26797 |
var value = _ref3.value; |
| 26798 |
var defaultExpanded = _ref3.defaultExpanded; |
| 26799 |
var _ref3$renderer = _ref3.renderer; |
| 26800 |
var renderer = _ref3$renderer === void 0 ? DefaultRenderer : _ref3$renderer; |
| 26801 |
var _ref3$pageSize = _ref3.pageSize; |
| 26802 |
var pageSize = _ref3$pageSize === void 0 ? 100 : _ref3$pageSize; |
| 26803 |
var rest = _objectWithoutPropertiesLoose(_ref3, [ |
| 26804 |
"value", |
| 26805 |
"defaultExpanded", |
| 26806 |
"renderer", |
| 26807 |
"pageSize" |
| 26808 |
]); |
| 26809 |
var _React$useState2 = react.default.useState(Boolean(defaultExpanded)); |
| 26810 |
var expanded = _React$useState2[0]; |
| 26811 |
var setExpanded = _React$useState2[1]; |
| 26812 |
var toggleExpanded = react.default.useCallback(function() { |
| 26813 |
return setExpanded(function(old) { |
| 26814 |
return !old; |
| 26815 |
}); |
| 26816 |
}, []); |
| 26817 |
var type = typeof value; |
| 26818 |
var subEntries = []; |
| 26819 |
var makeProperty = function makeProperty(sub) { |
| 26820 |
var _ref4; |
| 26821 |
return _extends({}, sub, { defaultExpanded: defaultExpanded === true ? (_ref4 = {}, _ref4[sub.label] = true, _ref4) : defaultExpanded == null ? void 0 : defaultExpanded[sub.label] }); |
| 26822 |
}; |
| 26823 |
if (Array.isArray(value)) { |
| 26824 |
type = "array"; |
| 26825 |
subEntries = value.map(function(d, i) { |
| 26826 |
return makeProperty({ |
| 26827 |
label: i.toString(), |
| 26828 |
value: d |
| 26829 |
}); |
| 26830 |
}); |
| 26831 |
} else if (value !== null && typeof value === "object" && isIterable(value) && typeof value[Symbol.iterator] === "function") { |
| 26832 |
type = "Iterable"; |
| 26833 |
subEntries = Array.from(value, function(val, i) { |
| 26834 |
return makeProperty({ |
| 26835 |
label: i.toString(), |
| 26836 |
value: val |
| 26837 |
}); |
| 26838 |
}); |
| 26839 |
} else if (typeof value === "object" && value !== null) { |
| 26840 |
type = "object"; |
| 26841 |
subEntries = Object.entries(value).map(function(_ref5) { |
| 26842 |
var key = _ref5[0]; |
| 26843 |
var val = _ref5[1]; |
| 26844 |
return makeProperty({ |
| 26845 |
label: key, |
| 26846 |
value: val |
| 26847 |
}); |
| 26848 |
}); |
| 26849 |
} |
| 26850 |
var subEntryPages = chunkArray(subEntries, pageSize); |
| 26851 |
return renderer(_extends({ |
| 26852 |
HandleEntry: function HandleEntry(_ref6) { |
| 26853 |
var entry = _ref6.entry; |
| 26854 |
return /*#__PURE__*/ react.default.createElement(Explorer, _extends({ |
| 26855 |
value, |
| 26856 |
renderer |
| 26857 |
}, rest, entry)); |
| 26858 |
}, |
| 26859 |
type, |
| 26860 |
subEntries, |
| 26861 |
subEntryPages, |
| 26862 |
value, |
| 26863 |
expanded, |
| 26864 |
toggleExpanded, |
| 26865 |
pageSize |
| 26866 |
}, rest)); |
| 26867 |
} |
| 26868 |
var Entry, Label, LabelButton, ExpandButton, Value, SubEntries, Info, Expander, DefaultRenderer; |
| 26869 |
var init_Explorer = __esmMin((() => { |
| 26870 |
init_objectWithoutPropertiesLoose(); |
| 26871 |
init_extends(); |
| 26872 |
init_utils(); |
| 26873 |
Entry = styled("div", { |
| 26874 |
fontFamily: "Menlo, monospace", |
| 26875 |
fontSize: "1em", |
| 26876 |
lineHeight: "1.7", |
| 26877 |
outline: "none", |
| 26878 |
wordBreak: "break-word" |
| 26879 |
}); |
| 26880 |
Label = styled("span", { color: "white" }); |
| 26881 |
LabelButton = styled("button", { |
| 26882 |
cursor: "pointer", |
| 26883 |
color: "white" |
| 26884 |
}); |
| 26885 |
ExpandButton = styled("button", { |
| 26886 |
cursor: "pointer", |
| 26887 |
color: "inherit", |
| 26888 |
font: "inherit", |
| 26889 |
outline: "inherit", |
| 26890 |
background: "transparent", |
| 26891 |
border: "none", |
| 26892 |
padding: 0 |
| 26893 |
}); |
| 26894 |
Value = styled("span", function(_props, theme) { |
| 26895 |
return { color: theme.danger }; |
| 26896 |
}); |
| 26897 |
SubEntries = styled("div", { |
| 26898 |
marginLeft: ".1em", |
| 26899 |
paddingLeft: "1em", |
| 26900 |
borderLeft: "2px solid rgba(0,0,0,.15)" |
| 26901 |
}); |
| 26902 |
Info = styled("span", { |
| 26903 |
color: "grey", |
| 26904 |
fontSize: ".7em" |
| 26905 |
}); |
| 26906 |
Expander = function Expander(_ref) { |
| 26907 |
var expanded = _ref.expanded; |
| 26908 |
var _ref$style = _ref.style; |
| 26909 |
var style = _ref$style === void 0 ? {} : _ref$style; |
| 26910 |
return /*#__PURE__*/ react.default.createElement("span", { style: _extends({ |
| 26911 |
display: "inline-block", |
| 26912 |
transition: "all .1s ease", |
| 26913 |
transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || "") |
| 26914 |
}, style) }, "▶"); |
| 26915 |
}; |
| 26916 |
DefaultRenderer = function DefaultRenderer(_ref2) { |
| 26917 |
var HandleEntry = _ref2.HandleEntry; |
| 26918 |
var label = _ref2.label; |
| 26919 |
var value = _ref2.value; |
| 26920 |
var _ref2$subEntries = _ref2.subEntries; |
| 26921 |
var subEntries = _ref2$subEntries === void 0 ? [] : _ref2$subEntries; |
| 26922 |
var _ref2$subEntryPages = _ref2.subEntryPages; |
| 26923 |
var subEntryPages = _ref2$subEntryPages === void 0 ? [] : _ref2$subEntryPages; |
| 26924 |
var type = _ref2.type; |
| 26925 |
var _ref2$expanded = _ref2.expanded; |
| 26926 |
var expanded = _ref2$expanded === void 0 ? false : _ref2$expanded; |
| 26927 |
var toggleExpanded = _ref2.toggleExpanded; |
| 26928 |
var pageSize = _ref2.pageSize; |
| 26929 |
var _React$useState = react.default.useState([]); |
| 26930 |
var expandedPages = _React$useState[0]; |
| 26931 |
var setExpandedPages = _React$useState[1]; |
| 26932 |
return /*#__PURE__*/ react.default.createElement(Entry, { key: label }, (subEntryPages == null ? void 0 : subEntryPages.length) ? /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(ExpandButton, { onClick: function onClick() { |
| 26933 |
return toggleExpanded(); |
| 26934 |
} }, /*#__PURE__*/ react.default.createElement(Expander, { expanded }), " ", label, " ", /*#__PURE__*/ react.default.createElement(Info, null, String(type).toLowerCase() === "iterable" ? "(Iterable) " : "", subEntries.length, " ", subEntries.length > 1 ? "items" : "item")), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/ react.default.createElement(SubEntries, null, subEntries.map(function(entry) { |
| 26935 |
return /*#__PURE__*/ react.default.createElement(HandleEntry, { |
| 26936 |
key: entry.label, |
| 26937 |
entry |
| 26938 |
}); |
| 26939 |
})) : /*#__PURE__*/ react.default.createElement(SubEntries, null, subEntryPages.map(function(entries, index) { |
| 26940 |
return /*#__PURE__*/ react.default.createElement("div", { key: index }, /*#__PURE__*/ react.default.createElement(Entry, null, /*#__PURE__*/ react.default.createElement(LabelButton, { onClick: function onClick() { |
| 26941 |
return setExpandedPages(function(old) { |
| 26942 |
return old.includes(index) ? old.filter(function(d) { |
| 26943 |
return d !== index; |
| 26944 |
}) : [].concat(old, [index]); |
| 26945 |
}); |
| 26946 |
} }, /*#__PURE__*/ react.default.createElement(Expander, { expanded }), " [", index * pageSize, " ...", " ", index * pageSize + pageSize - 1, "]"), expandedPages.includes(index) ? /*#__PURE__*/ react.default.createElement(SubEntries, null, entries.map(function(entry) { |
| 26947 |
return /*#__PURE__*/ react.default.createElement(HandleEntry, { |
| 26948 |
key: entry.label, |
| 26949 |
entry |
| 26950 |
}); |
| 26951 |
})) : null)); |
| 26952 |
})) : null) : /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(Label, null, label, ":"), " ", /*#__PURE__*/ react.default.createElement(Value, null, displayValue(value)))); |
| 26953 |
}; |
| 26954 |
})); |
| 26955 |
|
| 26956 |
//#endregion |
| 26957 |
//#region node_modules/react-query/es/devtools/Logo.js |
| 26958 |
function Logo(props) { |
| 26959 |
return /*#__PURE__*/ react.createElement("svg", _extends({ |
| 26960 |
width: "40px", |
| 26961 |
height: "40px", |
| 26962 |
viewBox: "0 0 190 190", |
| 26963 |
version: "1.1" |
| 26964 |
}, props), /*#__PURE__*/ react.createElement("g", { |
| 26965 |
stroke: "none", |
| 26966 |
strokeWidth: "1", |
| 26967 |
fill: "none", |
| 26968 |
fillRule: "evenodd" |
| 26969 |
}, /*#__PURE__*/ react.createElement("g", { transform: "translate(-33.000000, 0.000000)" }, /*#__PURE__*/ react.createElement("path", { |
| 26970 |
d: "M72.7239712,61.3436237 C69.631224,46.362877 68.9675112,34.8727722 70.9666331,26.5293551 C72.1555965,21.5671678 74.3293088,17.5190846 77.6346064,14.5984631 C81.1241394,11.5150478 85.5360327,10.0020122 90.493257,10.0020122 C98.6712013,10.0020122 107.26826,13.7273214 116.455725,20.8044264 C120.20312,23.6910458 124.092437,27.170411 128.131651,31.2444746 C128.45314,30.8310265 128.816542,30.4410453 129.22143,30.0806152 C140.64098,19.9149716 150.255245,13.5989272 158.478408,11.1636507 C163.367899,9.715636 167.958526,9.57768202 172.138936,10.983031 C176.551631,12.4664684 180.06766,15.5329489 182.548314,19.8281091 C186.642288,26.9166735 187.721918,36.2310983 186.195595,47.7320243 C185.573451,52.4199112 184.50985,57.5263831 183.007094,63.0593153 C183.574045,63.1277086 184.142416,63.2532808 184.705041,63.4395297 C199.193932,68.2358678 209.453582,73.3937462 215.665021,79.2882839 C219.360669,82.7953831 221.773972,86.6998434 222.646365,91.0218204 C223.567176,95.5836746 222.669313,100.159332 220.191548,104.451297 C216.105211,111.529614 208.591643,117.11221 197.887587,121.534031 C193.589552,123.309539 188.726579,124.917559 183.293259,126.363748 C183.541176,126.92292 183.733521,127.516759 183.862138,128.139758 C186.954886,143.120505 187.618598,154.61061 185.619477,162.954027 C184.430513,167.916214 182.256801,171.964297 178.951503,174.884919 C175.46197,177.968334 171.050077,179.48137 166.092853,179.48137 C157.914908,179.48137 149.31785,175.756061 140.130385,168.678956 C136.343104,165.761613 132.410866,162.238839 128.325434,158.108619 C127.905075,158.765474 127.388968,159.376011 126.77857,159.919385 C115.35902,170.085028 105.744755,176.401073 97.5215915,178.836349 C92.6321009,180.284364 88.0414736,180.422318 83.8610636,179.016969 C79.4483686,177.533532 75.9323404,174.467051 73.4516862,170.171891 C69.3577116,163.083327 68.2780823,153.768902 69.8044053,142.267976 C70.449038,137.410634 71.56762,132.103898 73.1575891,126.339009 C72.5361041,126.276104 71.9120754,126.144816 71.2949591,125.940529 C56.8060684,121.144191 46.5464184,115.986312 40.3349789,110.091775 C36.6393312,106.584675 34.2260275,102.680215 33.3536352,98.3582381 C32.4328237,93.7963839 33.3306866,89.2207269 35.8084524,84.9287618 C39.8947886,77.8504443 47.4083565,72.2678481 58.1124133,67.8460273 C62.5385143,66.0176154 67.5637208,64.366822 73.1939394,62.8874674 C72.9933393,62.3969171 72.8349374,61.8811235 72.7239712,61.3436237 Z", |
| 26971 |
fill: "#002C4B", |
| 26972 |
fillRule: "nonzero", |
| 26973 |
transform: "translate(128.000000, 95.000000) scale(-1, 1) translate(-128.000000, -95.000000) " |
| 26974 |
}), /*#__PURE__*/ react.createElement("path", { |
| 26975 |
d: "M113.396882,64 L142.608177,64 C144.399254,64 146.053521,64.958025 146.944933,66.5115174 L161.577138,92.0115174 C162.461464,93.5526583 162.461464,95.4473417 161.577138,96.9884826 L146.944933,122.488483 C146.053521,124.041975 144.399254,125 142.608177,125 L113.396882,125 C111.605806,125 109.951539,124.041975 109.060126,122.488483 L94.4279211,96.9884826 C93.543596,95.4473417 93.543596,93.5526583 94.4279211,92.0115174 L109.060126,66.5115174 C109.951539,64.958025 111.605806,64 113.396882,64 Z M138.987827,70.2765273 C140.779849,70.2765273 142.434839,71.2355558 143.325899,72.7903404 L154.343038,92.0138131 C155.225607,93.5537825 155.225607,95.4462175 154.343038,96.9861869 L143.325899,116.20966 C142.434839,117.764444 140.779849,118.723473 138.987827,118.723473 L117.017233,118.723473 C115.225211,118.723473 113.570221,117.764444 112.67916,116.20966 L101.662022,96.9861869 C100.779452,95.4462175 100.779452,93.5537825 101.662022,92.0138131 L112.67916,72.7903404 C113.570221,71.2355558 115.225211,70.2765273 117.017233,70.2765273 L138.987827,70.2765273 Z M135.080648,77.1414791 L120.924411,77.1414791 C119.134228,77.1414791 117.480644,78.0985567 116.5889,79.6508285 L116.5889,79.6508285 L109.489217,92.0093494 C108.603232,93.5515958 108.603232,95.4484042 109.489217,96.9906506 L109.489217,96.9906506 L116.5889,109.349172 C117.480644,110.901443 119.134228,111.858521 120.924411,111.858521 L120.924411,111.858521 L135.080648,111.858521 C136.870831,111.858521 138.524416,110.901443 139.41616,109.349172 L139.41616,109.349172 L146.515843,96.9906506 C147.401828,95.4484042 147.401828,93.5515958 146.515843,92.0093494 L146.515843,92.0093494 L139.41616,79.6508285 C138.524416,78.0985567 136.870831,77.1414791 135.080648,77.1414791 L135.080648,77.1414791 Z M131.319186,83.7122186 C133.108028,83.7122186 134.760587,84.6678753 135.652827,86.2183156 L138.983552,92.0060969 C139.87203,93.5500005 139.87203,95.4499995 138.983552,96.9939031 L135.652827,102.781684 C134.760587,104.332125 133.108028,105.287781 131.319186,105.287781 L124.685874,105.287781 C122.897032,105.287781 121.244473,104.332125 120.352233,102.781684 L117.021508,96.9939031 C116.13303,95.4499995 116.13303,93.5500005 117.021508,92.0060969 L120.352233,86.2183156 C121.244473,84.6678753 122.897032,83.7122186 124.685874,83.7122186 L131.319186,83.7122186 Z M128.003794,90.1848875 C126.459294,90.1848875 125.034382,91.0072828 124.263005,92.3424437 C123.491732,93.6774232 123.491732,95.3225768 124.263005,96.6575563 C125.034382,97.9927172 126.459294,98.8151125 128.001266,98.8151125 L128.001266,98.8151125 C129.545766,98.8151125 130.970678,97.9927172 131.742055,96.6575563 C132.513327,95.3225768 132.513327,93.6774232 131.742055,92.3424437 C130.970678,91.0072828 129.545766,90.1848875 128.003794,90.1848875 L128.003794,90.1848875 Z M93,94.5009646 L100.767764,94.5009646", |
| 26976 |
fill: "#FFD94C" |
| 26977 |
}), /*#__PURE__*/ react.createElement("path", { |
| 26978 |
d: "M87.8601729,108.357758 C89.1715224,107.608286 90.8360246,108.074601 91.5779424,109.399303 L91.5779424,109.399303 L92.0525843,110.24352 C95.8563392,116.982993 99.8190116,123.380176 103.940602,129.435068 C108.807881,136.585427 114.28184,143.82411 120.362479,151.151115 C121.316878,152.30114 121.184944,154.011176 120.065686,154.997937 L120.065686,154.997937 L119.454208,155.534625 C99.3465389,173.103314 86.2778188,176.612552 80.2480482,166.062341 C74.3500652,155.742717 76.4844915,136.982888 86.6513274,109.782853 C86.876818,109.179582 87.3045861,108.675291 87.8601729,108.357758 Z M173.534177,129.041504 C174.986131,128.785177 176.375496,129.742138 176.65963,131.194242 L176.65963,131.194242 L176.812815,131.986376 C181.782365,157.995459 178.283348,171 166.315764,171 C154.609745,171 139.708724,159.909007 121.612702,137.727022 C121.211349,137.235047 120.994572,136.617371 121,135.981509 C121.013158,134.480686 122.235785,133.274651 123.730918,133.287756 L123.730918,133.287756 L124.684654,133.294531 C132.305698,133.335994 139.714387,133.071591 146.910723,132.501323 C155.409039,131.82788 164.283523,130.674607 173.534177,129.041504 Z M180.408726,73.8119663 C180.932139,72.4026903 182.508386,71.6634537 183.954581,72.149012 L183.954581,72.149012 L184.742552,72.4154854 C210.583763,81.217922 220.402356,90.8916805 214.198332,101.436761 C208.129904,111.751366 190.484347,119.260339 161.26166,123.963678 C160.613529,124.067994 159.948643,123.945969 159.382735,123.618843 C158.047025,122.846729 157.602046,121.158214 158.388848,119.847438 L158.388848,119.847438 L158.889328,119.0105 C162.877183,112.31633 166.481358,105.654262 169.701854,99.0242957 C173.50501,91.1948179 177.073967,82.7907081 180.408726,73.8119663 Z M94.7383398,66.0363218 C95.3864708,65.9320063 96.0513565,66.0540315 96.6172646,66.3811573 C97.9529754,67.153271 98.3979538,68.8417862 97.6111517,70.1525615 L97.6111517,70.1525615 L97.1106718,70.9895001 C93.1228168,77.6836699 89.5186416,84.3457379 86.2981462,90.9757043 C82.49499,98.8051821 78.9260328,107.209292 75.5912744,116.188034 C75.0678608,117.59731 73.4916142,118.336546 72.045419,117.850988 L72.045419,117.850988 L71.2574475,117.584515 C45.4162372,108.782078 35.597644,99.1083195 41.8016679,88.5632391 C47.8700957,78.2486335 65.515653,70.7396611 94.7383398,66.0363218 Z M136.545792,34.4653746 C156.653461,16.8966864 169.722181,13.3874478 175.751952,23.9376587 C181.649935,34.2572826 179.515508,53.0171122 169.348673,80.2171474 C169.123182,80.8204179 168.695414,81.324709 168.139827,81.6422422 C166.828478,82.3917144 165.163975,81.9253986 164.422058,80.6006966 L164.422058,80.6006966 L163.947416,79.7564798 C160.143661,73.0170065 156.180988,66.6198239 152.059398,60.564932 C147.192119,53.4145727 141.71816,46.1758903 135.637521,38.8488847 C134.683122,37.6988602 134.815056,35.9888243 135.934314,35.0020629 L135.934314,35.0020629 Z M90.6842361,18 C102.390255,18 117.291276,29.0909926 135.387298,51.2729777 C135.788651,51.7649527 136.005428,52.3826288 136,53.0184911 C135.986842,54.5193144 134.764215,55.7253489 133.269082,55.7122445 L133.269082,55.7122445 L132.315346,55.7054689 C124.694302,55.6640063 117.285613,55.9284091 110.089277,56.4986773 C101.590961,57.17212 92.7164767,58.325393 83.4658235,59.9584962 C82.0138691,60.2148231 80.6245044,59.2578618 80.3403697,57.805758 L80.3403697,57.805758 L80.1871846,57.0136235 C75.2176347,31.0045412 78.7166519,18 90.6842361,18 Z", |
| 26979 |
fill: "#FF4154" |
| 26980 |
})))); |
| 26981 |
} |
| 26982 |
var init_Logo = __esmMin((() => { |
| 26983 |
init_extends(); |
| 26984 |
})); |
| 26985 |
|
| 26986 |
//#endregion |
| 26987 |
//#region node_modules/react-query/es/devtools/devtools.js |
| 26988 |
function ReactQueryDevtools$1(_ref) { |
| 26989 |
var initialIsOpen = _ref.initialIsOpen; |
| 26990 |
var _ref$panelProps = _ref.panelProps; |
| 26991 |
var panelProps = _ref$panelProps === void 0 ? {} : _ref$panelProps; |
| 26992 |
var _ref$closeButtonProps = _ref.closeButtonProps; |
| 26993 |
var closeButtonProps = _ref$closeButtonProps === void 0 ? {} : _ref$closeButtonProps; |
| 26994 |
var _ref$toggleButtonProp = _ref.toggleButtonProps; |
| 26995 |
var toggleButtonProps = _ref$toggleButtonProp === void 0 ? {} : _ref$toggleButtonProp; |
| 26996 |
var _ref$position = _ref.position; |
| 26997 |
var position = _ref$position === void 0 ? "bottom-left" : _ref$position; |
| 26998 |
var _ref$containerElement = _ref.containerElement; |
| 26999 |
var Container = _ref$containerElement === void 0 ? "aside" : _ref$containerElement; |
| 27000 |
var styleNonce = _ref.styleNonce; |
| 27001 |
var rootRef = react.default.useRef(null); |
| 27002 |
var panelRef = react.default.useRef(null); |
| 27003 |
var _useLocalStorage = useLocalStorage("reactQueryDevtoolsOpen", initialIsOpen); |
| 27004 |
var isOpen = _useLocalStorage[0]; |
| 27005 |
var setIsOpen = _useLocalStorage[1]; |
| 27006 |
var _useLocalStorage2 = useLocalStorage("reactQueryDevtoolsHeight", null); |
| 27007 |
var devtoolsHeight = _useLocalStorage2[0]; |
| 27008 |
var setDevtoolsHeight = _useLocalStorage2[1]; |
| 27009 |
var _useSafeState = useSafeState(false); |
| 27010 |
var isResolvedOpen = _useSafeState[0]; |
| 27011 |
var setIsResolvedOpen = _useSafeState[1]; |
| 27012 |
var _useSafeState2 = useSafeState(false); |
| 27013 |
var isResizing = _useSafeState2[0]; |
| 27014 |
var setIsResizing = _useSafeState2[1]; |
| 27015 |
var isMounted = useIsMounted(); |
| 27016 |
var _handleDragStart = function handleDragStart(panelElement, startEvent) { |
| 27017 |
var _panelElement$getBoun; |
| 27018 |
if (startEvent.button !== 0) return; |
| 27019 |
setIsResizing(true); |
| 27020 |
var dragInfo = { |
| 27021 |
originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0, |
| 27022 |
pageY: startEvent.pageY |
| 27023 |
}; |
| 27024 |
var run = function run(moveEvent) { |
| 27025 |
var delta = dragInfo.pageY - moveEvent.pageY; |
| 27026 |
var newHeight = (dragInfo == null ? void 0 : dragInfo.originalHeight) + delta; |
| 27027 |
setDevtoolsHeight(newHeight); |
| 27028 |
if (newHeight < 70) setIsOpen(false); |
| 27029 |
else setIsOpen(true); |
| 27030 |
}; |
| 27031 |
var unsub = function unsub() { |
| 27032 |
setIsResizing(false); |
| 27033 |
document.removeEventListener("mousemove", run); |
| 27034 |
document.removeEventListener("mouseUp", unsub); |
| 27035 |
}; |
| 27036 |
document.addEventListener("mousemove", run); |
| 27037 |
document.addEventListener("mouseup", unsub); |
| 27038 |
}; |
| 27039 |
react.default.useEffect(function() { |
| 27040 |
setIsResolvedOpen(isOpen != null ? isOpen : false); |
| 27041 |
}, [ |
| 27042 |
isOpen, |
| 27043 |
isResolvedOpen, |
| 27044 |
setIsResolvedOpen |
| 27045 |
]); |
| 27046 |
react.default.useEffect(function() { |
| 27047 |
var ref = panelRef.current; |
| 27048 |
if (ref) { |
| 27049 |
var handlePanelTransitionStart = function handlePanelTransitionStart() { |
| 27050 |
if (ref && isResolvedOpen) ref.style.visibility = "visible"; |
| 27051 |
}; |
| 27052 |
var handlePanelTransitionEnd = function handlePanelTransitionEnd() { |
| 27053 |
if (ref && !isResolvedOpen) ref.style.visibility = "hidden"; |
| 27054 |
}; |
| 27055 |
ref.addEventListener("transitionstart", handlePanelTransitionStart); |
| 27056 |
ref.addEventListener("transitionend", handlePanelTransitionEnd); |
| 27057 |
return function() { |
| 27058 |
ref.removeEventListener("transitionstart", handlePanelTransitionStart); |
| 27059 |
ref.removeEventListener("transitionend", handlePanelTransitionEnd); |
| 27060 |
}; |
| 27061 |
} |
| 27062 |
}, [isResolvedOpen]); |
| 27063 |
react.default[isServer ? "useEffect" : "useLayoutEffect"](function() { |
| 27064 |
if (isResolvedOpen) { |
| 27065 |
var _rootRef$current; |
| 27066 |
var _rootRef$current$pare; |
| 27067 |
var previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom; |
| 27068 |
var run = function run() { |
| 27069 |
var _panelRef$current; |
| 27070 |
var _rootRef$current2; |
| 27071 |
var containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height; |
| 27072 |
if ((_rootRef$current2 = rootRef.current) == null ? void 0 : _rootRef$current2.parentElement) rootRef.current.parentElement.style.paddingBottom = containerHeight + "px"; |
| 27073 |
}; |
| 27074 |
run(); |
| 27075 |
if (typeof window !== "undefined") { |
| 27076 |
window.addEventListener("resize", run); |
| 27077 |
return function() { |
| 27078 |
var _rootRef$current3; |
| 27079 |
window.removeEventListener("resize", run); |
| 27080 |
if (((_rootRef$current3 = rootRef.current) == null ? void 0 : _rootRef$current3.parentElement) && typeof previousValue === "string") rootRef.current.parentElement.style.paddingBottom = previousValue; |
| 27081 |
}; |
| 27082 |
} |
| 27083 |
} |
| 27084 |
}, [isResolvedOpen]); |
| 27085 |
var _panelProps$style = panelProps.style; |
| 27086 |
var panelStyle = _panelProps$style === void 0 ? {} : _panelProps$style; |
| 27087 |
var otherPanelProps = _objectWithoutPropertiesLoose(panelProps, ["style"]); |
| 27088 |
var _closeButtonProps$sty = closeButtonProps.style; |
| 27089 |
var closeButtonStyle = _closeButtonProps$sty === void 0 ? {} : _closeButtonProps$sty; |
| 27090 |
var onCloseClick = closeButtonProps.onClick; |
| 27091 |
var otherCloseButtonProps = _objectWithoutPropertiesLoose(closeButtonProps, ["style", "onClick"]); |
| 27092 |
var _toggleButtonProps$st = toggleButtonProps.style; |
| 27093 |
var toggleButtonStyle = _toggleButtonProps$st === void 0 ? {} : _toggleButtonProps$st; |
| 27094 |
var onToggleClick = toggleButtonProps.onClick; |
| 27095 |
var otherToggleButtonProps = _objectWithoutPropertiesLoose(toggleButtonProps, ["style", "onClick"]); |
| 27096 |
if (!isMounted()) return null; |
| 27097 |
return /*#__PURE__*/ react.default.createElement(Container, { |
| 27098 |
ref: rootRef, |
| 27099 |
className: "ReactQueryDevtools", |
| 27100 |
"aria-label": "React Query Devtools" |
| 27101 |
}, /*#__PURE__*/ react.default.createElement(ThemeProvider, { theme: defaultTheme }, /*#__PURE__*/ react.default.createElement(ReactQueryDevtoolsPanel, _extends({ |
| 27102 |
ref: panelRef, |
| 27103 |
styleNonce |
| 27104 |
}, otherPanelProps, { |
| 27105 |
style: _extends({ |
| 27106 |
position: "fixed", |
| 27107 |
bottom: "0", |
| 27108 |
right: "0", |
| 27109 |
zIndex: 99999, |
| 27110 |
width: "100%", |
| 27111 |
height: devtoolsHeight != null ? devtoolsHeight : 500, |
| 27112 |
maxHeight: "90%", |
| 27113 |
boxShadow: "0 0 20px rgba(0,0,0,.3)", |
| 27114 |
borderTop: "1px solid " + defaultTheme.gray, |
| 27115 |
transformOrigin: "top", |
| 27116 |
visibility: isOpen ? "visible" : "hidden" |
| 27117 |
}, panelStyle, isResizing ? { transition: "none" } : { transition: "all .2s ease" }, isResolvedOpen ? { |
| 27118 |
opacity: 1, |
| 27119 |
pointerEvents: "all", |
| 27120 |
transform: "translateY(0) scale(1)" |
| 27121 |
} : { |
| 27122 |
opacity: 0, |
| 27123 |
pointerEvents: "none", |
| 27124 |
transform: "translateY(15px) scale(1.02)" |
| 27125 |
}), |
| 27126 |
isOpen: isResolvedOpen, |
| 27127 |
setIsOpen, |
| 27128 |
handleDragStart: function handleDragStart(e) { |
| 27129 |
return _handleDragStart(panelRef.current, e); |
| 27130 |
} |
| 27131 |
})), isResolvedOpen ? /*#__PURE__*/ react.default.createElement(Button, _extends({ |
| 27132 |
type: "button", |
| 27133 |
"aria-controls": "ReactQueryDevtoolsPanel", |
| 27134 |
"aria-haspopup": "true", |
| 27135 |
"aria-expanded": "true" |
| 27136 |
}, otherCloseButtonProps, { |
| 27137 |
onClick: function onClick(e) { |
| 27138 |
setIsOpen(false); |
| 27139 |
onCloseClick && onCloseClick(e); |
| 27140 |
}, |
| 27141 |
style: _extends({ |
| 27142 |
position: "fixed", |
| 27143 |
zIndex: 99999, |
| 27144 |
margin: ".5em", |
| 27145 |
bottom: 0 |
| 27146 |
}, position === "top-right" ? { right: "0" } : position === "top-left" ? { left: "0" } : position === "bottom-right" ? { right: "0" } : { left: "0" }, closeButtonStyle) |
| 27147 |
}), "Close") : null), !isResolvedOpen ? /*#__PURE__*/ react.default.createElement("button", _extends({ type: "button" }, otherToggleButtonProps, { |
| 27148 |
"aria-label": "Open React Query Devtools", |
| 27149 |
"aria-controls": "ReactQueryDevtoolsPanel", |
| 27150 |
"aria-haspopup": "true", |
| 27151 |
"aria-expanded": "false", |
| 27152 |
onClick: function onClick(e) { |
| 27153 |
setIsOpen(true); |
| 27154 |
onToggleClick && onToggleClick(e); |
| 27155 |
}, |
| 27156 |
style: _extends({ |
| 27157 |
background: "none", |
| 27158 |
border: 0, |
| 27159 |
padding: 0, |
| 27160 |
position: "fixed", |
| 27161 |
zIndex: 99999, |
| 27162 |
display: "inline-flex", |
| 27163 |
fontSize: "1.5em", |
| 27164 |
margin: ".5em", |
| 27165 |
cursor: "pointer", |
| 27166 |
width: "fit-content" |
| 27167 |
}, position === "top-right" ? { |
| 27168 |
top: "0", |
| 27169 |
right: "0" |
| 27170 |
} : position === "top-left" ? { |
| 27171 |
top: "0", |
| 27172 |
left: "0" |
| 27173 |
} : position === "bottom-right" ? { |
| 27174 |
bottom: "0", |
| 27175 |
right: "0" |
| 27176 |
} : { |
| 27177 |
bottom: "0", |
| 27178 |
left: "0" |
| 27179 |
}, toggleButtonStyle) |
| 27180 |
}), /*#__PURE__*/ react.default.createElement(Logo, { "aria-hidden": true })) : null); |
| 27181 |
} |
| 27182 |
var isServer, getStatusRank, sortFns, ReactQueryDevtoolsPanel; |
| 27183 |
var init_devtools$1 = __esmMin((() => { |
| 27184 |
init_extends(); |
| 27185 |
init_objectWithoutPropertiesLoose(); |
| 27186 |
init_es(); |
| 27187 |
init_match_sorter_esm(); |
| 27188 |
init_useLocalStorage(); |
| 27189 |
init_utils(); |
| 27190 |
init_styledComponents(); |
| 27191 |
init_theme(); |
| 27192 |
init_Explorer(); |
| 27193 |
init_Logo(); |
| 27194 |
init_utils$3(); |
| 27195 |
isServer = typeof window === "undefined"; |
| 27196 |
__name(ReactQueryDevtools$1, "ReactQueryDevtools"); |
| 27197 |
getStatusRank = function getStatusRank(q) { |
| 27198 |
return q.state.isFetching ? 0 : !q.getObserversCount() ? 3 : q.isStale() ? 2 : 1; |
| 27199 |
}; |
| 27200 |
sortFns = { |
| 27201 |
"Status > Last Updated": function StatusLastUpdated(a, b) { |
| 27202 |
var _sortFns$LastUpdated; |
| 27203 |
return getStatusRank(a) === getStatusRank(b) ? (_sortFns$LastUpdated = sortFns["Last Updated"]) == null ? void 0 : _sortFns$LastUpdated.call(sortFns, a, b) : getStatusRank(a) > getStatusRank(b) ? 1 : -1; |
| 27204 |
}, |
| 27205 |
"Query Hash": function QueryHash(a, b) { |
| 27206 |
return a.queryHash > b.queryHash ? 1 : -1; |
| 27207 |
}, |
| 27208 |
"Last Updated": function LastUpdated(a, b) { |
| 27209 |
return a.state.dataUpdatedAt < b.state.dataUpdatedAt ? 1 : -1; |
| 27210 |
} |
| 27211 |
}; |
| 27212 |
ReactQueryDevtoolsPanel = /*#__PURE__*/ react.default.forwardRef(function ReactQueryDevtoolsPanel(props, ref) { |
| 27213 |
var _activeQuery$state; |
| 27214 |
var _props$isOpen = props.isOpen; |
| 27215 |
var isOpen = _props$isOpen === void 0 ? true : _props$isOpen; |
| 27216 |
var styleNonce = props.styleNonce; |
| 27217 |
var setIsOpen = props.setIsOpen; |
| 27218 |
var handleDragStart = props.handleDragStart; |
| 27219 |
var panelProps = _objectWithoutPropertiesLoose(props, [ |
| 27220 |
"isOpen", |
| 27221 |
"styleNonce", |
| 27222 |
"setIsOpen", |
| 27223 |
"handleDragStart" |
| 27224 |
]); |
| 27225 |
var queryClient = useQueryClient(); |
| 27226 |
var queryCache = queryClient.getQueryCache(); |
| 27227 |
var _useLocalStorage3 = useLocalStorage("reactQueryDevtoolsSortFn", Object.keys(sortFns)[0]); |
| 27228 |
var sort = _useLocalStorage3[0]; |
| 27229 |
var setSort = _useLocalStorage3[1]; |
| 27230 |
var _useLocalStorage4 = useLocalStorage("reactQueryDevtoolsFilter", ""); |
| 27231 |
var filter = _useLocalStorage4[0]; |
| 27232 |
var setFilter = _useLocalStorage4[1]; |
| 27233 |
var _useLocalStorage5 = useLocalStorage("reactQueryDevtoolsSortDesc", false); |
| 27234 |
var sortDesc = _useLocalStorage5[0]; |
| 27235 |
var setSortDesc = _useLocalStorage5[1]; |
| 27236 |
var sortFn = react.default.useMemo(function() { |
| 27237 |
return sortFns[sort]; |
| 27238 |
}, [sort]); |
| 27239 |
react.default[isServer ? "useEffect" : "useLayoutEffect"](function() { |
| 27240 |
if (!sortFn) setSort(Object.keys(sortFns)[0]); |
| 27241 |
}, [setSort, sortFn]); |
| 27242 |
var _useSafeState3 = useSafeState(Object.values(queryCache.findAll())); |
| 27243 |
var unsortedQueries = _useSafeState3[0]; |
| 27244 |
var setUnsortedQueries = _useSafeState3[1]; |
| 27245 |
var _useLocalStorage6 = useLocalStorage("reactQueryDevtoolsActiveQueryHash", ""); |
| 27246 |
var activeQueryHash = _useLocalStorage6[0]; |
| 27247 |
var setActiveQueryHash = _useLocalStorage6[1]; |
| 27248 |
var queries = react.default.useMemo(function() { |
| 27249 |
var sorted = [].concat(unsortedQueries).sort(sortFn); |
| 27250 |
if (sortDesc) sorted.reverse(); |
| 27251 |
if (!filter) return sorted; |
| 27252 |
return matchSorter(sorted, filter, { keys: ["queryHash"] }).filter(function(d) { |
| 27253 |
return d.queryHash; |
| 27254 |
}); |
| 27255 |
}, [ |
| 27256 |
sortDesc, |
| 27257 |
sortFn, |
| 27258 |
unsortedQueries, |
| 27259 |
filter |
| 27260 |
]); |
| 27261 |
var activeQuery = react.default.useMemo(function() { |
| 27262 |
return queries.find(function(query) { |
| 27263 |
return query.queryHash === activeQueryHash; |
| 27264 |
}); |
| 27265 |
}, [activeQueryHash, queries]); |
| 27266 |
var hasFresh = queries.filter(function(q) { |
| 27267 |
return getQueryStatusLabel(q) === "fresh"; |
| 27268 |
}).length; |
| 27269 |
var hasFetching = queries.filter(function(q) { |
| 27270 |
return getQueryStatusLabel(q) === "fetching"; |
| 27271 |
}).length; |
| 27272 |
var hasStale = queries.filter(function(q) { |
| 27273 |
return getQueryStatusLabel(q) === "stale"; |
| 27274 |
}).length; |
| 27275 |
var hasInactive = queries.filter(function(q) { |
| 27276 |
return getQueryStatusLabel(q) === "inactive"; |
| 27277 |
}).length; |
| 27278 |
react.default.useEffect(function() { |
| 27279 |
if (isOpen) { |
| 27280 |
var unsubscribe = queryCache.subscribe(function() { |
| 27281 |
setUnsortedQueries(Object.values(queryCache.getAll())); |
| 27282 |
}); |
| 27283 |
setUnsortedQueries(Object.values(queryCache.getAll())); |
| 27284 |
return unsubscribe; |
| 27285 |
} |
| 27286 |
}, [ |
| 27287 |
isOpen, |
| 27288 |
sort, |
| 27289 |
sortFn, |
| 27290 |
sortDesc, |
| 27291 |
setUnsortedQueries, |
| 27292 |
queryCache |
| 27293 |
]); |
| 27294 |
return /*#__PURE__*/ react.default.createElement(ThemeProvider, { theme: defaultTheme }, /*#__PURE__*/ react.default.createElement(Panel, _extends({ |
| 27295 |
ref, |
| 27296 |
className: "ReactQueryDevtoolsPanel", |
| 27297 |
"aria-label": "React Query Devtools Panel", |
| 27298 |
id: "ReactQueryDevtoolsPanel" |
| 27299 |
}, panelProps), /*#__PURE__*/ react.default.createElement("style", { |
| 27300 |
nonce: styleNonce, |
| 27301 |
dangerouslySetInnerHTML: { __html: "\n .ReactQueryDevtoolsPanel * {\n scrollbar-color: " + defaultTheme.backgroundAlt + " " + defaultTheme.gray + ";\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar, .ReactQueryDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar-track, .ReactQueryDevtoolsPanel scrollbar-track {\n background: " + defaultTheme.backgroundAlt + ";\n }\n\n .ReactQueryDevtoolsPanel *::-webkit-scrollbar-thumb, .ReactQueryDevtoolsPanel scrollbar-thumb {\n background: " + defaultTheme.gray + ";\n border-radius: .5em;\n border: 3px solid " + defaultTheme.backgroundAlt + ";\n }\n " } |
| 27302 |
}), /*#__PURE__*/ react.default.createElement("div", { |
| 27303 |
style: { |
| 27304 |
position: "absolute", |
| 27305 |
left: 0, |
| 27306 |
top: 0, |
| 27307 |
width: "100%", |
| 27308 |
height: "4px", |
| 27309 |
marginBottom: "-4px", |
| 27310 |
cursor: "row-resize", |
| 27311 |
zIndex: 1e5 |
| 27312 |
}, |
| 27313 |
onMouseDown: handleDragStart |
| 27314 |
}), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27315 |
flex: "1 1 500px", |
| 27316 |
minHeight: "40%", |
| 27317 |
maxHeight: "100%", |
| 27318 |
overflow: "auto", |
| 27319 |
borderRight: "1px solid " + defaultTheme.grayAlt, |
| 27320 |
display: isOpen ? "flex" : "none", |
| 27321 |
flexDirection: "column" |
| 27322 |
} }, /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27323 |
padding: ".5em", |
| 27324 |
background: defaultTheme.backgroundAlt, |
| 27325 |
display: "flex", |
| 27326 |
justifyContent: "space-between", |
| 27327 |
alignItems: "center" |
| 27328 |
} }, /*#__PURE__*/ react.default.createElement("button", { |
| 27329 |
type: "button", |
| 27330 |
"aria-label": "Close React Query Devtools", |
| 27331 |
"aria-controls": "ReactQueryDevtoolsPanel", |
| 27332 |
"aria-haspopup": "true", |
| 27333 |
"aria-expanded": "true", |
| 27334 |
onClick: function onClick() { |
| 27335 |
return setIsOpen(false); |
| 27336 |
}, |
| 27337 |
style: { |
| 27338 |
display: "inline-flex", |
| 27339 |
background: "none", |
| 27340 |
border: 0, |
| 27341 |
padding: 0, |
| 27342 |
marginRight: ".5em", |
| 27343 |
cursor: "pointer" |
| 27344 |
} |
| 27345 |
}, /*#__PURE__*/ react.default.createElement(Logo, { "aria-hidden": true })), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27346 |
display: "flex", |
| 27347 |
flexDirection: "column" |
| 27348 |
} }, /*#__PURE__*/ react.default.createElement(QueryKeys, { style: { marginBottom: ".5em" } }, /*#__PURE__*/ react.default.createElement(QueryKey, { style: { |
| 27349 |
background: defaultTheme.success, |
| 27350 |
opacity: hasFresh ? 1 : .3 |
| 27351 |
} }, "fresh ", /*#__PURE__*/ react.default.createElement(Code, null, "(", hasFresh, ")")), " ", /*#__PURE__*/ react.default.createElement(QueryKey, { style: { |
| 27352 |
background: defaultTheme.active, |
| 27353 |
opacity: hasFetching ? 1 : .3 |
| 27354 |
} }, "fetching ", /*#__PURE__*/ react.default.createElement(Code, null, "(", hasFetching, ")")), " ", /*#__PURE__*/ react.default.createElement(QueryKey, { style: { |
| 27355 |
background: defaultTheme.warning, |
| 27356 |
color: "black", |
| 27357 |
textShadow: "0", |
| 27358 |
opacity: hasStale ? 1 : .3 |
| 27359 |
} }, "stale ", /*#__PURE__*/ react.default.createElement(Code, null, "(", hasStale, ")")), " ", /*#__PURE__*/ react.default.createElement(QueryKey, { style: { |
| 27360 |
background: defaultTheme.gray, |
| 27361 |
opacity: hasInactive ? 1 : .3 |
| 27362 |
} }, "inactive ", /*#__PURE__*/ react.default.createElement(Code, null, "(", hasInactive, ")"))), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27363 |
display: "flex", |
| 27364 |
alignItems: "center" |
| 27365 |
} }, /*#__PURE__*/ react.default.createElement(Input, { |
| 27366 |
placeholder: "Filter", |
| 27367 |
"aria-label": "Filter by queryhash", |
| 27368 |
value: filter != null ? filter : "", |
| 27369 |
onChange: function onChange(e) { |
| 27370 |
return setFilter(e.target.value); |
| 27371 |
}, |
| 27372 |
onKeyDown: function onKeyDown(e) { |
| 27373 |
if (e.key === "Escape") setFilter(""); |
| 27374 |
}, |
| 27375 |
style: { |
| 27376 |
flex: "1", |
| 27377 |
marginRight: ".5em", |
| 27378 |
width: "100%" |
| 27379 |
} |
| 27380 |
}), !filter ? /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(Select, { |
| 27381 |
"aria-label": "Sort queries", |
| 27382 |
value: sort, |
| 27383 |
onChange: function onChange(e) { |
| 27384 |
return setSort(e.target.value); |
| 27385 |
}, |
| 27386 |
style: { |
| 27387 |
flex: "1", |
| 27388 |
minWidth: 75, |
| 27389 |
marginRight: ".5em" |
| 27390 |
} |
| 27391 |
}, Object.keys(sortFns).map(function(key) { |
| 27392 |
return /*#__PURE__*/ react.default.createElement("option", { |
| 27393 |
key, |
| 27394 |
value: key |
| 27395 |
}, "Sort by ", key); |
| 27396 |
})), /*#__PURE__*/ react.default.createElement(Button, { |
| 27397 |
type: "button", |
| 27398 |
onClick: function onClick() { |
| 27399 |
return setSortDesc(function(old) { |
| 27400 |
return !old; |
| 27401 |
}); |
| 27402 |
}, |
| 27403 |
style: { padding: ".3em .4em" } |
| 27404 |
}, sortDesc ? "⬇ Desc" : "⬆ Asc")) : null))), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27405 |
overflowY: "auto", |
| 27406 |
flex: "1" |
| 27407 |
} }, queries.map(function(query, i) { |
| 27408 |
var isDisabled = query.getObserversCount() > 0 && !query.isActive(); |
| 27409 |
return /*#__PURE__*/ react.default.createElement("div", { |
| 27410 |
key: query.queryHash || i, |
| 27411 |
role: "button", |
| 27412 |
"aria-label": "Open query details for " + query.queryHash, |
| 27413 |
onClick: function onClick() { |
| 27414 |
return setActiveQueryHash(activeQueryHash === query.queryHash ? "" : query.queryHash); |
| 27415 |
}, |
| 27416 |
style: { |
| 27417 |
display: "flex", |
| 27418 |
borderBottom: "solid 1px " + defaultTheme.grayAlt, |
| 27419 |
cursor: "pointer", |
| 27420 |
background: query === activeQuery ? "rgba(255,255,255,.1)" : void 0 |
| 27421 |
} |
| 27422 |
}, /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27423 |
flex: "0 0 auto", |
| 27424 |
width: "2em", |
| 27425 |
height: "2em", |
| 27426 |
background: getQueryStatusColor(query, defaultTheme), |
| 27427 |
display: "flex", |
| 27428 |
alignItems: "center", |
| 27429 |
justifyContent: "center", |
| 27430 |
fontWeight: "bold", |
| 27431 |
textShadow: getQueryStatusLabel(query) === "stale" ? "0" : "0 0 10px black", |
| 27432 |
color: getQueryStatusLabel(query) === "stale" ? "black" : "white" |
| 27433 |
} }, query.getObserversCount()), isDisabled ? /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27434 |
flex: "0 0 auto", |
| 27435 |
height: "2em", |
| 27436 |
background: defaultTheme.gray, |
| 27437 |
display: "flex", |
| 27438 |
alignItems: "center", |
| 27439 |
fontWeight: "bold", |
| 27440 |
padding: "0 0.5em" |
| 27441 |
} }, "disabled") : null, /*#__PURE__*/ react.default.createElement(Code, { style: { padding: ".5em" } }, "" + query.queryHash)); |
| 27442 |
}))), activeQuery ? /*#__PURE__*/ react.default.createElement(ActiveQueryPanel, null, /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27443 |
padding: ".5em", |
| 27444 |
background: defaultTheme.backgroundAlt, |
| 27445 |
position: "sticky", |
| 27446 |
top: 0, |
| 27447 |
zIndex: 1 |
| 27448 |
} }, "Query Details"), /*#__PURE__*/ react.default.createElement("div", { style: { padding: ".5em" } }, /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27449 |
marginBottom: ".5em", |
| 27450 |
display: "flex", |
| 27451 |
alignItems: "start", |
| 27452 |
justifyContent: "space-between" |
| 27453 |
} }, /*#__PURE__*/ react.default.createElement(Code, { style: { lineHeight: "1.8em" } }, /*#__PURE__*/ react.default.createElement("pre", { style: { |
| 27454 |
margin: 0, |
| 27455 |
padding: 0, |
| 27456 |
overflow: "auto" |
| 27457 |
} }, JSON.stringify(activeQuery.queryKey, null, 2))), /*#__PURE__*/ react.default.createElement("span", { style: { |
| 27458 |
padding: "0.3em .6em", |
| 27459 |
borderRadius: "0.4em", |
| 27460 |
fontWeight: "bold", |
| 27461 |
textShadow: "0 2px 10px black", |
| 27462 |
background: getQueryStatusColor(activeQuery, defaultTheme), |
| 27463 |
flexShrink: 0 |
| 27464 |
} }, getQueryStatusLabel(activeQuery))), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27465 |
marginBottom: ".5em", |
| 27466 |
display: "flex", |
| 27467 |
alignItems: "center", |
| 27468 |
justifyContent: "space-between" |
| 27469 |
} }, "Observers: ", /*#__PURE__*/ react.default.createElement(Code, null, activeQuery.getObserversCount())), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27470 |
display: "flex", |
| 27471 |
alignItems: "center", |
| 27472 |
justifyContent: "space-between" |
| 27473 |
} }, "Last Updated:", " ", /*#__PURE__*/ react.default.createElement(Code, null, new Date(activeQuery.state.dataUpdatedAt).toLocaleTimeString()))), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27474 |
background: defaultTheme.backgroundAlt, |
| 27475 |
padding: ".5em", |
| 27476 |
position: "sticky", |
| 27477 |
top: 0, |
| 27478 |
zIndex: 1 |
| 27479 |
} }, "Actions"), /*#__PURE__*/ react.default.createElement("div", { style: { padding: "0.5em" } }, /*#__PURE__*/ react.default.createElement(Button, { |
| 27480 |
type: "button", |
| 27481 |
onClick: function handleRefetch() { |
| 27482 |
var promise = activeQuery == null ? void 0 : activeQuery.fetch(); |
| 27483 |
promise == null || promise.catch(noop); |
| 27484 |
}, |
| 27485 |
disabled: activeQuery.state.isFetching, |
| 27486 |
style: { background: defaultTheme.active } |
| 27487 |
}, "Refetch"), " ", /*#__PURE__*/ react.default.createElement(Button, { |
| 27488 |
type: "button", |
| 27489 |
onClick: function onClick() { |
| 27490 |
return queryClient.invalidateQueries(activeQuery); |
| 27491 |
}, |
| 27492 |
style: { |
| 27493 |
background: defaultTheme.warning, |
| 27494 |
color: defaultTheme.inputTextColor |
| 27495 |
} |
| 27496 |
}, "Invalidate"), " ", /*#__PURE__*/ react.default.createElement(Button, { |
| 27497 |
type: "button", |
| 27498 |
onClick: function onClick() { |
| 27499 |
return queryClient.resetQueries(activeQuery); |
| 27500 |
}, |
| 27501 |
style: { background: defaultTheme.gray } |
| 27502 |
}, "Reset"), " ", /*#__PURE__*/ react.default.createElement(Button, { |
| 27503 |
type: "button", |
| 27504 |
onClick: function onClick() { |
| 27505 |
return queryClient.removeQueries(activeQuery); |
| 27506 |
}, |
| 27507 |
style: { background: defaultTheme.danger } |
| 27508 |
}, "Remove")), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27509 |
background: defaultTheme.backgroundAlt, |
| 27510 |
padding: ".5em", |
| 27511 |
position: "sticky", |
| 27512 |
top: 0, |
| 27513 |
zIndex: 1 |
| 27514 |
} }, "Data Explorer"), /*#__PURE__*/ react.default.createElement("div", { style: { padding: ".5em" } }, /*#__PURE__*/ react.default.createElement(Explorer, { |
| 27515 |
label: "Data", |
| 27516 |
value: activeQuery == null ? void 0 : (_activeQuery$state = activeQuery.state) == null ? void 0 : _activeQuery$state.data, |
| 27517 |
defaultExpanded: {} |
| 27518 |
})), /*#__PURE__*/ react.default.createElement("div", { style: { |
| 27519 |
background: defaultTheme.backgroundAlt, |
| 27520 |
padding: ".5em", |
| 27521 |
position: "sticky", |
| 27522 |
top: 0, |
| 27523 |
zIndex: 1 |
| 27524 |
} }, "Query Explorer"), /*#__PURE__*/ react.default.createElement("div", { style: { padding: ".5em" } }, /*#__PURE__*/ react.default.createElement(Explorer, { |
| 27525 |
label: "Query", |
| 27526 |
value: activeQuery, |
| 27527 |
defaultExpanded: { queryKey: true } |
| 27528 |
}))) : null)); |
| 27529 |
}); |
| 27530 |
})); |
| 27531 |
|
| 27532 |
//#endregion |
| 27533 |
//#region node_modules/react-query/es/devtools/index.js |
| 27534 |
var devtools_exports = /* @__PURE__ */ __exportAll({ |
| 27535 |
ReactQueryDevtools: () => ReactQueryDevtools$1, |
| 27536 |
ReactQueryDevtoolsPanel: () => ReactQueryDevtoolsPanel |
| 27537 |
}); |
| 27538 |
var init_devtools = __esmMin((() => { |
| 27539 |
init_devtools$1(); |
| 27540 |
})); |
| 27541 |
|
| 27542 |
//#endregion |
| 27543 |
//#region node_modules/react-query/devtools/index.js |
| 27544 |
var require_devtools = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 27545 |
module.exports = (init_devtools(), __toCommonJS(devtools_exports)); |
| 27546 |
})); |
| 27547 |
|
| 27548 |
//#endregion |
| 27549 |
//#region app/modules/kit-library/assets/js/app.js |
| 27550 |
var app_exports = /* @__PURE__ */ __exportAll({ default: () => App }); |
| 27551 |
function AppContent() { |
| 27552 |
var returnTo = useQueryParams().getAll().return_to; |
| 27553 |
return /*#__PURE__*/ react.default.createElement(SettingsProvider, { value: elementorAppConfig["kit-library"] }, /*#__PURE__*/ react.default.createElement(ReturnToProvider, { value: returnTo }, /*#__PURE__*/ react.default.createElement(ConnectStateProvider, null, /*#__PURE__*/ react.default.createElement(TrackingProvider, null, /*#__PURE__*/ react.default.createElement(LastFilterProvider, null, /*#__PURE__*/ react.default.createElement(Router, null, /*#__PURE__*/ react.default.createElement(Index, { path: "/" }), /*#__PURE__*/ react.default.createElement(Favorites, { path: "/favorites" }), /*#__PURE__*/ react.default.createElement(Preview, { path: "/preview/:id" }), /*#__PURE__*/ react.default.createElement(Overview, { path: "/overview/:id" }), /*#__PURE__*/ react.default.createElement(Cloud, { path: "/cloud" }))))))); |
| 27554 |
} |
| 27555 |
function App() { |
| 27556 |
return /*#__PURE__*/ react.default.createElement("div", { className: "e-kit-library" }, /*#__PURE__*/ react.default.createElement(QueryClientProvider, { client: queryClient }, /*#__PURE__*/ react.default.createElement(AppContent, null), elementorCommon.config.isElementorDebug && /*#__PURE__*/ react.default.createElement(import_devtools.ReactQueryDevtools, { initialIsOpen: false }))); |
| 27557 |
} |
| 27558 |
var import_devtools, queryClient; |
| 27559 |
var init_app = __esmMin((() => { |
| 27560 |
init_favorites(); |
| 27561 |
init_index(); |
| 27562 |
init_cloud(); |
| 27563 |
init_overview(); |
| 27564 |
init_preview(); |
| 27565 |
init_last_filter_context(); |
| 27566 |
init_es(); |
| 27567 |
import_devtools = require_devtools(); |
| 27568 |
init_es$1(); |
| 27569 |
init_settings_context(); |
| 27570 |
init_connect_state_context(); |
| 27571 |
init_tracking_context(); |
| 27572 |
init_return_to_context(); |
| 27573 |
init_use_query_params(); |
| 27574 |
queryClient = new QueryClient({ defaultOptions: { queries: { |
| 27575 |
refetchOnWindowFocus: false, |
| 27576 |
retry: false, |
| 27577 |
staleTime: 1e3 * 60 * 30 |
| 27578 |
} } }); |
| 27579 |
})); |
| 27580 |
|
| 27581 |
//#endregion |
| 27582 |
//#region app/modules/kit-library/assets/js/module.js |
| 27583 |
init_classCallCheck(); |
| 27584 |
init_createClass(); |
| 27585 |
init_preload_helper(); |
| 27586 |
var KitLibrary = /*#__PURE__*/ function() { |
| 27587 |
function KitLibrary() { |
| 27588 |
_classCallCheck(this, KitLibrary); |
| 27589 |
if (!this.hasAccessToModule()) return; |
| 27590 |
$e.components.register(new Component$2()); |
| 27591 |
$e.components.register(new Component$1()); |
| 27592 |
$e.components.register(new EComponent()); |
| 27593 |
$e.components.register(new Component()); |
| 27594 |
_elementor_router.default.addRoute({ |
| 27595 |
path: "/kit-library/*", |
| 27596 |
component: react.default.lazy(function() { |
| 27597 |
return __vitePreload(() => Promise.resolve().then(() => (init_app(), app_exports)), void 0); |
| 27598 |
}) |
| 27599 |
}); |
| 27600 |
} |
| 27601 |
return _createClass(KitLibrary, [{ |
| 27602 |
key: "hasAccessToModule", |
| 27603 |
value: function hasAccessToModule() { |
| 27604 |
var _elementorAppConfig$k; |
| 27605 |
return (_elementorAppConfig$k = elementorAppConfig["kit-library"]) === null || _elementorAppConfig$k === void 0 ? void 0 : _elementorAppConfig$k.has_access_to_module; |
| 27606 |
} |
| 27607 |
}]); |
| 27608 |
}(); |
| 27609 |
|
| 27610 |
//#endregion |
| 27611 |
//#region app/modules/onboarding/assets/js/module.js |
| 27612 |
init_createClass(); |
| 27613 |
init_classCallCheck(); |
| 27614 |
var LazyApp = react.default.lazy(function() { |
| 27615 |
return Promise.resolve(elementorV2.onboarding).then(function(module) { |
| 27616 |
return { default: module.App }; |
| 27617 |
}); |
| 27618 |
}); |
| 27619 |
var Onboarding = /*#__PURE__*/ _createClass(function Onboarding() { |
| 27620 |
_classCallCheck(this, Onboarding); |
| 27621 |
_elementor_router.default.addRoute({ |
| 27622 |
path: "/onboarding/*", |
| 27623 |
component: LazyApp |
| 27624 |
}); |
| 27625 |
}); |
| 27626 |
|
| 27627 |
//#endregion |
| 27628 |
//#region app/assets/js/index.js |
| 27629 |
var _elementorCommon; |
| 27630 |
new ImportExport(); |
| 27631 |
new KitLibrary(); |
| 27632 |
new _elementor_site_editor.Module(); |
| 27633 |
new Onboarding(); |
| 27634 |
if ((_elementorCommon = elementorCommon) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.config) !== null && _elementorCommon !== void 0 && (_elementorCommon = _elementorCommon.experimentalFeatures) !== null && _elementorCommon !== void 0 && _elementorCommon["import-export-customization"]) new ImportExportCustomization(); |
| 27635 |
var AppWrapper = react.default.Fragment; |
| 27636 |
react_default.render(/*#__PURE__*/ react.default.createElement(AppWrapper, null, /*#__PURE__*/ react.default.createElement(AppProvider, null, /*#__PURE__*/ react.default.createElement(App$1, null))), document.getElementById("e-app")); |
| 27637 |
|
| 27638 |
//#endregion |
| 27639 |
})(React, ReactDOM, elementorAppPackages.router, wp.i18n, elementorAppPackages.hooks, elementorV2.ui, elementorV2.icons, elementorAppPackages.appUi, elementorAppPackages.siteEditor); |
| 27640 |
//# sourceMappingURL=app.js.map |