Template Kit – Import - Version 1.0.10

Version Description

  • 2020-11-09 =
  • Fix: Bug where UI not updated if template kit is already imported allowing duplicate imports
  • Disable: WP big image size threshold to allow larger images
Download this release

Release Info

Developer Brad Davis
Plugin Icon 128x128 Template Kit – Import
Version 1.0.10
Comparing to
See all releases

Code changes from version 1.0.9 to 1.0.10

assets/main.js CHANGED
@@ -52,4 +52,4 @@ var r=/input|select|textarea|button|object/;function a(e){var t=e.offsetWidth<=0
52
  *
53
  * This source code is licensed under the MIT license found in the
54
  * LICENSE file in the root directory of this source tree.
55
- */var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case f:case d:case i:case u:case l:case m:return e;default:switch(e=e&&e.$$typeof){case s:case p:case v:case y:case c:return e;default:return t}}case o:return t}}}function x(e){return k(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=s,t.ContextProvider=c,t.Element=a,t.ForwardRef=p,t.Fragment=i,t.Lazy=v,t.Memo=y,t.Portal=o,t.Profiler=u,t.StrictMode=l,t.Suspense=m,t.isAsyncMode=function(e){return x(e)||k(e)===f},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===s},t.isContextProvider=function(e){return k(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===i},t.isLazy=function(e){return k(e)===v},t.isMemo=function(e){return k(e)===y},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===u},t.isStrictMode=function(e){return k(e)===l},t.isSuspense=function(e){return k(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===u||e===l||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===c||e.$$typeof===s||e.$$typeof===p||e.$$typeof===b||e.$$typeof===w||e.$$typeof===E||e.$$typeof===g)},t.typeOf=k},,,function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o=n(13),i=n.n(o),l=n(3),u=n(1),c=n.n(u);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return"/"===e.charAt(0)}function d(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var p=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],o=e&&f(e),i=t&&f(t),l=o||i;if(e&&f(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var u=a[a.length-1];n="."===u||".."===u||""===u}else n=!1;for(var c=0,s=a.length;s>=0;s--){var p=a[s];"."===p?d(a,s):".."===p?(d(a,s),c++):c&&(d(a,s),c--)}if(!l)for(;c--;c)a.unshift("..");!l||""===a[0]||a[0]&&f(a[0])||a.unshift("");var m=a.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function m(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var h=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=m(t),a=m(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var y=function(e,t){if(!e)throw new Error("Invariant failed")};function v(e){return"/"===e.charAt(0)?e:"/"+e}function g(e){return"/"===e.charAt(0)?e.substr(1):e}function b(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function w(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function E(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function k(e,t,n,r){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=s({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(a.key=n),r?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=p(a.pathname,r.pathname)):a.pathname=r.pathname:a.pathname||(a.pathname="/"),a}function x(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var S=!("undefined"==typeof window||!window.document||!window.document.createElement);function C(e,t){t(window.confirm(e))}function T(){try{return window.history.state||{}}catch(e){return{}}}function O(e){void 0===e&&(e={}),S||y(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,l=void 0!==i&&i,u=o.getUserConfirmation,c=void 0===u?C:u,f=o.keyLength,d=void 0===f?6:f,p=e.basename?w(v(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return p&&(o=b(o,p)),k(o,r,n)}function h(){return Math.random().toString(36).substr(2,d)}var g=x();function O(e){s(z,e),z.length=n.length,g.notifyListeners(z.location,z.action)}function _(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||j(m(e.state))}function P(){j(m(T()))}var N=!1;function j(e){if(N)N=!1,O();else{g.confirmTransitionTo(e,"POP",c,(function(t){t?O({action:"POP",location:e}):function(e){var t=z.location,n=A.indexOf(t.key);-1===n&&(n=0);var r=A.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(N=!0,R(a))}(e)}))}}var I=m(T()),A=[I.key];function M(e){return p+E(e)}function R(e){n.go(e)}var F=0;function D(e){1===(F+=e)&&1===e?(window.addEventListener("popstate",_),a&&window.addEventListener("hashchange",P)):0===F&&(window.removeEventListener("popstate",_),a&&window.removeEventListener("hashchange",P))}var L=!1;var z={length:n.length,action:"POP",location:I,createHref:M,push:function(e,t){var a=k(e,t,h(),z.location);g.confirmTransitionTo(a,"PUSH",c,(function(e){if(e){var t=M(a),o=a.key,i=a.state;if(r)if(n.pushState({key:o,state:i},null,t),l)window.location.href=t;else{var u=A.indexOf(z.location.key),c=A.slice(0,u+1);c.push(a.key),A=c,O({action:"PUSH",location:a})}else window.location.href=t}}))},replace:function(e,t){var a=k(e,t,h(),z.location);g.confirmTransitionTo(a,"REPLACE",c,(function(e){if(e){var t=M(a),o=a.key,i=a.state;if(r)if(n.replaceState({key:o,state:i},null,t),l)window.location.replace(t);else{var u=A.indexOf(z.location.key);-1!==u&&(A[u]=a.key),O({action:"REPLACE",location:a})}else window.location.replace(t)}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&(e=!1);var t=g.setPrompt(e);return L||(D(1),L=!0),function(){return L&&(L=!1,D(-1)),t()}},listen:function(e){var t=g.appendListener(e);return D(1),function(){D(-1),t()}}};return z}var _={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+g(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:g,decodePath:v},slash:{encodePath:v,decodePath:v}};function P(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function N(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function j(e){window.location.replace(P(window.location.href)+"#"+e)}function I(e){void 0===e&&(e={}),S||y(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,a=void 0===r?C:r,o=n.hashType,i=void 0===o?"slash":o,l=e.basename?w(v(e.basename)):"",u=_[i],c=u.encodePath,f=u.decodePath;function d(){var e=f(N());return l&&(e=b(e,l)),k(e)}var p=x();function m(e){s(z,e),z.length=t.length,p.notifyListeners(z.location,z.action)}var h=!1,g=null;function T(){var e,t,n=N(),r=c(n);if(n!==r)j(r);else{var o=d(),i=z.location;if(!h&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(g===E(o))return;g=null,function(e){if(h)h=!1,m();else{p.confirmTransitionTo(e,"POP",a,(function(t){t?m({action:"POP",location:e}):function(e){var t=z.location,n=M.lastIndexOf(E(t));-1===n&&(n=0);var r=M.lastIndexOf(E(e));-1===r&&(r=0);var a=n-r;a&&(h=!0,R(a))}(e)}))}}(o)}}var O=N(),I=c(O);O!==I&&j(I);var A=d(),M=[E(A)];function R(e){t.go(e)}var F=0;function D(e){1===(F+=e)&&1===e?window.addEventListener("hashchange",T):0===F&&window.removeEventListener("hashchange",T)}var L=!1;var z={length:t.length,action:"POP",location:A,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=P(window.location.href)),n+"#"+c(l+E(e))},push:function(e,t){var n=k(e,void 0,void 0,z.location);p.confirmTransitionTo(n,"PUSH",a,(function(e){if(e){var t=E(n),r=c(l+t);if(N()!==r){g=t,function(e){window.location.hash=e}(r);var a=M.lastIndexOf(E(z.location)),o=M.slice(0,a+1);o.push(t),M=o,m({action:"PUSH",location:n})}else m()}}))},replace:function(e,t){var n=k(e,void 0,void 0,z.location);p.confirmTransitionTo(n,"REPLACE",a,(function(e){if(e){var t=E(n),r=c(l+t);N()!==r&&(g=t,j(r));var a=M.indexOf(E(z.location));-1!==a&&(M[a]=t),m({action:"REPLACE",location:n})}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return L||(D(1),L=!0),function(){return L&&(L=!1,D(-1)),t()}},listen:function(e){var t=p.appendListener(e);return D(1),function(){D(-1),t()}}};return z}function A(e,t,n){return Math.min(Math.max(e,t),n)}function M(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,r=t.initialEntries,a=void 0===r?["/"]:r,o=t.initialIndex,i=void 0===o?0:o,l=t.keyLength,u=void 0===l?6:l,c=x();function f(e){s(v,e),v.length=v.entries.length,c.notifyListeners(v.location,v.action)}function d(){return Math.random().toString(36).substr(2,u)}var p=A(i,0,a.length-1),m=a.map((function(e){return k(e,void 0,"string"==typeof e?d():e.key||d())})),h=E;function y(e){var t=A(v.index+e,0,v.entries.length-1),r=v.entries[t];c.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var v={length:m.length,action:"POP",location:m[p],index:p,entries:m,createHref:h,push:function(e,t){var r=k(e,t,d(),v.location);c.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=v.index+1,n=v.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=k(e,t,d(),v.location);c.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(v.entries[v.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=v.index+e;return t>=0&&t<v.entries.length},block:function(e){return void 0===e&&(e=!1),c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return v}var R=n(24),F=n(25),D=n.n(F);n(35);function L(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var z=n(36),U=n.n(z),W=function(e){var t=Object(R.a)();return t.displayName=e,t}("Router-History"),B=function(e){var t=Object(R.a)();return t.displayName=e,t}("Router"),K=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(l.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return a.a.createElement(B.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.a.createElement(W.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.a.Component);var H=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=M(t.props),t}return Object(l.a)(t,e),t.prototype.render=function(){return a.a.createElement(K,{history:this.history,children:this.props.children})},t}(a.a.Component);var q=function(e){function t(){return e.apply(this,arguments)||this}Object(l.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(a.a.Component);var V={},$=0;function Q(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(V[e])return V[e];var t=D.a.compile(e);return $<1e4&&(V[e]=t,$++),t}(e)(t,{pretty:!0})}function Y(e){var t=e.computedMatch,n=e.to,r=e.push,o=void 0!==r&&r;return a.a.createElement(B.Consumer,null,(function(e){e||y(!1);var r=e.history,i=e.staticContext,l=o?r.push:r.replace,u=k(t?"string"==typeof n?Q(n,t.params):s({},n,{pathname:Q(n.pathname,t.params)}):n);return i?(l(u),null):a.a.createElement(q,{onMount:function(){l(u)},onUpdate:function(e,t){var n,r,a=k(t.to);n=a,r=s({},u,{key:a.key}),n.pathname===r.pathname&&n.search===r.search&&n.hash===r.hash&&n.key===r.key&&h(n.state,r.state)||l(u)},to:n})}))}var X={},Z=0;function G(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=X[n]||(X[n]={});if(r[e])return r[e];var a=[],o={regexp:D()(e,a,t),keys:a};return Z<1e4&&(r[e]=o,Z++),o}(n,{end:o,strict:l,sensitive:c}),a=r.regexp,i=r.keys,u=a.exec(e);if(!u)return null;var s=u[0],f=u.slice(1),d=e===s;return o&&!d?null:{path:n,url:"/"===n&&""===s?"/":s,isExact:d,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var J=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this;return a.a.createElement(B.Consumer,null,(function(t){t||y(!1);var n=e.props.location||t.location,r=s({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?G(n.pathname,e.props):t.match}),o=e.props,i=o.children,l=o.component,u=o.render;return Array.isArray(i)&&0===i.length&&(i=null),a.a.createElement(B.Provider,{value:r},r.match?i?"function"==typeof i?i(r):i:l?a.a.createElement(l,r):u?u(r):null:"function"==typeof i?i(r):null)}))},t}(a.a.Component);function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e,t){if(!e)return t;var n=ee(e);return 0!==t.pathname.indexOf(n)?t:s({},t,{pathname:t.pathname.substr(n.length)})}function ne(e){return"string"==typeof e?e:E(e)}function re(e){return function(){y(!1)}}function ae(){}a.a.Component;var oe=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this;return a.a.createElement(B.Consumer,null,(function(t){t||y(!1);var n,r,o=e.props.location||t.location;return a.a.Children.forEach(e.props.children,(function(e){if(null==r&&a.a.isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?G(o.pathname,s({},e.props,{path:i})):t.match}})),r?a.a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(a.a.Component);function ie(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=L(t,["wrappedComponentRef"]);return a.a.createElement(B.Consumer,null,(function(t){return t||y(!1),a.a.createElement(e,s({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,U()(n,e)}var le=a.a.useContext;function ue(){var e=le(B).match;return e?e.params:{}}function ce(e){var t=le(B).location,n=le(B).match;return e?G(t.pathname,e):n}a.a.Component;var se=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=I(t.props),t}return Object(l.a)(t,e),t.prototype.render=function(){return a.a.createElement(K,{history:this.history,children:this.props.children})},t}(a.a.Component);var fe=function(e,t){return"function"==typeof e?e(t):e},de=function(e,t){return"string"==typeof e?k(e,null,null,t):e},pe=function(e){return e},me=a.a.forwardRef;void 0===me&&(me=pe);var he=me((function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=L(e,["innerRef","navigate","onClick"]),l=i.target,u=s({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||l&&"_self"!==l||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=pe!==me&&t||n,a.a.createElement("a",u)}));var ye=me((function(e,t){var n=e.component,r=void 0===n?he:n,o=e.replace,i=e.to,l=e.innerRef,u=L(e,["component","replace","to","innerRef"]);return a.a.createElement(B.Consumer,null,(function(e){e||y(!1);var n=e.history,c=de(fe(i,e.location),e.location),f=c?n.createHref(c):"",d=s({},u,{href:f,navigate:function(){var t=fe(i,e.location);(o?n.replace:n.push)(t)}});return pe!==me?d.ref=t||l:d.innerRef=l,a.a.createElement(r,d)}))})),ve=function(e){return e},ge=a.a.forwardRef;void 0===ge&&(ge=ve);ge((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,i=void 0===o?"active":o,l=e.activeStyle,u=e.className,c=e.exact,f=e.isActive,d=e.location,p=e.sensitive,m=e.strict,h=e.style,v=e.to,g=e.innerRef,b=L(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a.a.createElement(B.Consumer,null,(function(e){e||y(!1);var n=d||e.location,o=de(fe(v,n),n),w=o.pathname,E=w&&w.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),k=E?G(n.pathname,{path:E,exact:c,sensitive:p,strict:m}):null,x=!!(f?f(k,n):k),S=x?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(u,i):u,C=x?s({},h,{},l):h,T=s({"aria-current":x&&r||null,className:S,style:C,to:o},b);return ve!==ge?T.ref=t||g:T.innerRef=g,a.a.createElement(ye,T)}))}));function be(e){return function(e){if(Array.isArray(e))return ke(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Ee(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){if(e){if("string"==typeof e)return ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xe=a.a.createContext({errors:[],addError:function(){},removeError:function(){}});function Se(e){var t=e.children,n=we(Object(r.useState)([]),2),o=n[0],i=n[1],l={errors:o,addError:Object(r.useCallback)((function(e,t,n){return function(e,t,n){i((function(r){return[].concat(be(r),[{code:e,message:t,debug:n}])}))}(e,t,n)}),[]),removeError:Object(r.useCallback)((function(e){return t=e,void i((function(e){return e.filter((function(e){return e!==t}))}));var t}),[])};return a.a.createElement(xe.Provider,{value:l},t)}function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=a.a.createContext({globalConfig:{},setConfigValue:function(){}});function je(e){var t=e.children,n=e.config,o=void 0===n?{}:n,i=_e(Object(r.useState)(Object.keys(o).length>0?o:window.template_kit_import),2),l=i[0],u=i[1],c={globalConfig:l,setConfigValue:Object(r.useCallback)((function(e,t){return function(e,t){u((function(n){return Te(Te({},n),{},Oe({},e,t))}))}(e,t)}),[])};return a.a.createElement(Ne.Provider,{value:c},t)}var Ie=function(){var e=Object(r.useContext)(xe);return{errors:e.errors,addError:e.addError,removeError:e.removeError}},Ae=n(5),Me=n.n(Ae),Re=n(17),Fe=n.n(Re);function De(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Le(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ze={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999},content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",padding:"40px",borderRadius:"10px"}},Ue=function(e){var t=e.isOpen,n=e.onCloseCallback,o=void 0===n?null:n,i=e.children,l=De(a.a.useState(!1),2),u=l[0],c=l[1],s=function(){c(!1),o&&o()};return Object(r.useEffect)((function(){t&&c(!0)}),[t]),Object(r.useEffect)((function(){"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Me.a.setAppElement(window.templateKitImport.modalAppHolder)})),a.a.createElement(Me.a,{isOpen:u,onRequestClose:s,style:ze,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:Fe.a.modalInner},a.a.createElement("button",{onClick:s,"data-testid":"modal-close-button",className:Fe.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat(Fe.a.dismissIcon)})),"function"==typeof i?i({closeModal:s}):i))},We=n(18),Be=n.n(We),Ke=function(e){var t=e.title,n=e.subtitle;return a.a.createElement("div",{className:Be.a.wrapper},a.a.createElement("h1",{className:Be.a.title},t),n?a.a.createElement("p",{className:Be.a.subtitle},n):null)},He=n(10),qe=n.n(He),Ve=n(19),$e=n.n(Ve),Qe=function(e){var t=e.label,n=e.icon,r=["dashicons",Ye[n],$e.a.icon];return t&&r.push($e.a.iconWithLabel),a.a.createElement(a.a.Fragment,null,n?a.a.createElement("span",{className:r.join(" ")}):null,t)},Ye={arrow:"dashicons-arrow-right-alt2",tick:"dashicons-yes",info:"dashicons-info",eye:"dashicons-visibility",cross:"dashicons-dismiss",update:"dashicons-update",updateSpinning:"dashicons-update ".concat($e.a.iconSpinning),link:"dashicons-external",plus:"dashicons-plus-alt",trash:"dashicons-trash",download:"dashicons-download",expand:"dashicons-editor-expand"};Qe.propTypes={label:c.a.string,icon:c.a.oneOf(Object.keys(Ye))},Qe.defaultProps={label:null,icon:null};var Xe=Qe,Ze=n(14),Ge=n.n(Ze);function Je(){return(Je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function et(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var tt=function(e){var t=e.type,n=e.dataTestId,r=e.element,o=e.children,i=et(e,["type","dataTestId","element","children"]);return"button"===r?a.a.createElement("button",Je({className:Ge.a[t],"data-testid":n},i),o):"Link"===r?a.a.createElement(ye,Je({className:Ge.a[t],"data-testid":n},i),o):"a"===r?a.a.createElement("a",Je({className:Ge.a[t],"data-testid":n},i),o):"label"===r?a.a.createElement("label",Je({className:Ge.a[t],"data-testid":n},i),o):void 0};tt.propTypes={type:c.a.oneOf(["ghost","primary","secondary","warning","attention"]),dataTestId:c.a.string,element:c.a.oneOf(["button","a","Link","label"]).isRequired,children:c.a.node},tt.defaultProps={type:"ghost",dataTestId:null,children:null};var nt=tt,rt=function(e){var t=e.type,n=e.label,r=e.icon,o=e.onClick,i=e.disabled,l=e.dataTestId;return a.a.createElement(nt,{element:"button",type:t,onClick:o,disabled:i,dataTestId:l},a.a.createElement(Xe,{label:n,icon:r}))};rt.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,onClick:c.a.func,disabled:c.a.bool,dataTestId:c.a.string},rt.defaultProps={type:"ghost",label:null,icon:null,onClick:null,disabled:!1,dataTestId:null};var at=rt,ot=n(37),it=n.n(ot),lt=function(e){var t=e.children;return a.a.createElement("div",{className:it.a.wrapper},t)};function ut(e){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return st(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ft=function(e){var t=e.error,n=ct(Object(r.useState)(!1),2),o=n[0],i=n[1];return a.a.createElement("div",{className:qe.a.debugWrapper},t.debug&&o?a.a.createElement("div",{className:qe.a.debugInformation},a.a.createElement("textarea",{className:qe.a.debugText,onClick:function(e){e.target.focus(),e.target.select()},defaultValue:"object"===ut(t.debug)?JSON.stringify(t.debug,null,"\t"):t.debug})):null,a.a.createElement("div",{className:qe.a.debugActions},a.a.createElement(lt,null,a.a.createElement(at,{icon:"update",label:"Refresh Page",onClick:function(e){return e.preventDefault(),window.location.reload(),!1}}),t.debug?a.a.createElement(at,{icon:"eye",label:o?"Hide Debug Details":"Show Debug Details",className:qe.a.buttonDebug,onClick:function(){i(!o)}}):null),"If this error continues please contact ",a.a.createElement("a",{href:"mailto:extensions@envato.com"},"extensions@envato.com"),"."))},dt=function(){var e=Ie(),t=e.errors,n=e.removeError;return t.length>0?a.a.createElement(a.a.Fragment,null,t.map((function(e){return"zip_failure"===e.code?a.a.createElement(Ue,{key:e.code,isOpen:!0,onCloseCallback:function(){n(e)}},a.a.createElement(Ke,{title:"Template Kit Install Error"}),a.a.createElement("p",{className:qe.a.copy},"There was an issue installing this template kit. Please try again."),e.message,a.a.createElement(ft,{error:e})):"generic_api_error"===e.code?a.a.createElement(Ue,{key:e.code,isOpen:!0,onCloseCallback:function(){n(e)}},a.a.createElement(Ke,{title:"Unexpected Error"}),a.a.createElement("p",{className:qe.a.copy},"Sorry there was an unexpected error from API call:"),e.message,a.a.createElement(ft,{error:e})):void 0}))):null},pt=n(4),mt=n.n(pt),ht=n(38),yt=n.n(ht);function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){bt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wt=function(){var e=Object(r.useContext)(Ne),t=e.globalConfig,n=e.setConfigValue,a=function(e,r){var a=t[e]||[];n(e,gt(gt({},a),r))};return{getDownloadedItemId:function(e){return t.downloaded_items?t.downloaded_items[e]:null},addDownloadedItem:function(e){var t=e.humaneId,n=e.importedId;a("downloaded_items",bt({},t,n))},removeDownloadedItem:function(e){var n=e.importedId;Object.keys(t.downloaded_items).map((function(e){t.downloaded_items[e]===n&&delete t.downloaded_items[e]}))},subscriptionStatus:t.subscription_status,setSubscriptionStatus:function(e){n("subscription_status",e)},bannerHasBeenDismissed:function(e){a("dismissed_banners",bt({},e,!0))},isBannerDismissed:function(e){return t.dismissed_banners?t.dismissed_banners[e]:null},getConfigProjectName:function(){return t.project_name},setConfigProjectName:function(e){n("project_name",e)},getMagicButtonMode:function(){return t.magicButtonMode},setMagicButtonMode:function(e){n("magicButtonMode",e)},getElementsTokenUrl:function(){return t.elements_token_url},getApiUrl:function(){return t.api_url},getApiNonce:function(){return t.api_nonce},getReviewMode:function(){return t.review_mode}}};function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(n),!0).forEach((function(t){xt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function St(e,t,n,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,a)}function Ct(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){St(o,r,a,i,l,"next",e)}function l(e){St(o,r,a,i,l,"throw",e)}i(void 0)}))}}function Tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ot(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _t=function(e){var t=e.endpoint,n=e.args,a=void 0===n?{}:n,o=e.allowLongRunning,i=void 0!==o&&o,l=wt(),u=l.getApiUrl,c=l.getApiNonce,s=Tt(Object(r.useState)({loading:!0,data:null,error:null}),2),f=s[0],d=s[1],p=Ie().addError,m=t+JSON.stringify(a);return Object(r.useEffect)((function(){var e=new AbortController,n=e.signal;function r(){return(r=Ct(regeneratorRuntime.mark((function e(){var r,o,i,l,s,f,m,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(l in d((function(e){return{loading:!0,error:null,data:e.data}})),r=u()+t,o=kt(kt({},a),{},{_wpnonce:c()}),i=new FormData,o)i.append(l,o[l]);return s=null,e.prev=6,e.next=9,fetch(r,{method:"post",body:i,signal:n});case 9:return f=e.sent,e.next=12,f.clone().text();case 12:return s=e.sent,e.next=15,f.json();case 15:if(m=e.sent,f.ok){e.next=20;break}return m&&m.error&&m.error.code&&p(m.error.code,m.error.message,m),d({loading:!1,error:!0,data:m}),e.abrupt("return");case 20:d({loading:!1,error:null,data:m}),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(6),"AbortError"!==e.t0.name&&(h="".concat(e.t0,". ").concat(s?s.slice(0,200):""),p("generic_api_error",h,s),d({loading:!1,error:!0,data:e.t0.message}));case 26:case"end":return e.stop()}}),e,null,[[6,23]])})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){i||e.abort()}}),[m]),f},Pt=function(e){var t=e.importedTemplateId;return"post.php?post=".concat(t,"&action=elementor")};function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var It=function(e){var t=e.chosenFile,n=e.onComplete,r=_t({endpoint:"uploadTemplateKitZipFile",args:{file:t}}),a=r.loading,o=r.data,i=r.error;return!a&&!i&&o&&o.templateKitId&&setTimeout((function(){var e,t;n((e={importedTemplateKitId:o.templateKitId},t=e.importedTemplateKitId,"/template-kits/installed-kits/kit/".concat(t)))}),200),null},At=ie((function(e){var t=e.history,n=Nt(Object(r.useState)(null),2),o=n[0],i=n[1];return a.a.createElement(a.a.Fragment,null,a.a.createElement(nt,{element:"label",htmlFor:"upload-template-kit-zip-file"},a.a.createElement(Xe,{label:o?"Processing...":"Upload Template Kit (Zip File)",icon:"link"}),a.a.createElement("input",{type:"file",name:"upload-template-kit-zip-file",id:"upload-template-kit-zip-file",className:yt.a.formInput,onChange:function(e){i(e.target.files[0])}})),o?a.a.createElement(It,{chosenFile:o,onComplete:function(e){i(!1),t.push(e)}}):null)})),Mt=function(){return a.a.createElement("div",{className:mt.a.wrapper},a.a.createElement("div",{className:mt.a.logo},a.a.createElement(ye,{to:"/",className:mt.a.logoLink},"Envato")),a.a.createElement("nav",{className:mt.a.menu},a.a.createElement("ul",{className:mt.a.menuInner},a.a.createElement("li",{className:mt.a.menuItem},a.a.createElement(ye,{to:"/template-kits/installed-kits",className:"".concat(mt.a.menuLink," ").concat(ce({path:"/template-kits"})?mt.a.menuLinkActive:"")},"Template Kits"))),a.a.createElement("ul",{className:"".concat(mt.a.menuInner," ").concat(mt.a.menuRight)},a.a.createElement("li",{className:mt.a.menuItem},a.a.createElement(At,null)))))},Rt=function(e){var t=e.href,n=e.text,r=void 0===n?"Link":n;return a.a.createElement("a",{href:t,target:"_blank",rel:"noopener noreferrer"},r)},Ft=n(39),Dt=n.n(Ft),Lt=function(){return a.a.createElement("div",{className:Dt.a.footerBar},a.a.createElement("p",null,a.a.createElement("strong",null,"Feedback & Support: ")," If you have any questions or feedback for the team please send an email to"," ",a.a.createElement(Rt,{href:"mailto:extensions@envato.com",text:"extensions@envato.com"})," | ",a.a.createElement(Rt,{href:"https://envato.com/privacy?utm_source=extensions&utm_medium=referral&utm_campaign=template_kit_import_footer",text:"Privacy Policy"})," | ",a.a.createElement(Rt,{href:"https://help.market.envato.com/hc/en-us/sections/360007560992-Template-Kits?utm_source=extensions&utm_medium=referral&utm_campaign=template_kit_import_footer",text:"Help"})))},zt=function(e){return _t({endpoint:"fetchIndividualTemplates",args:e})},Ut=n(2),Wt=n.n(Ut);function Bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(n),!0).forEach((function(t){Ht(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $t=function(e){var t=e.requirement,n=e.completeCallback;if(!t)return Object(r.useEffect)((function(){n()}),[]),"Skipped";var o=function(e){var t={requirement:JSON.stringify(e)};return _t({endpoint:"installRequirement",args:t})}(t),i=o.loading,l=o.data,u=o.error;return Object(r.useEffect)((function(){i||n(u)}),[i]),a.a.createElement(a.a.Fragment,null,i?a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"dashicons dashicons-update ".concat(Wt.a.installingIcon)}),"Installing..."):null,u?a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"dashicons dashicons-no"}),l&&l.error?a.a.createElement(a.a.Fragment,null,l.error.data&&l.error.data.url?a.a.createElement("a",{href:l.error.data.url,target:"_blank",rel:"noopener noreferrer"},l.error.message):l.error.message):"Error"):null,i||u?null:a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"dashicons dashicons-yes-alt"}),"Success!"))},Qt=function(e){var t=e.previewCss,n=qt(Object(r.useState)(!1),2),o=n[0],i=n[1];return a.a.createElement(a.a.Fragment,null,o?a.a.createElement(Ue,{isOpen:!0,onCloseCallback:function(){return i(!1)}},a.a.createElement("code",{className:Wt.a.cssPreview},a.a.createElement("pre",null,t))):null," ",a.a.createElement("a",{href:"#",onClick:function(e){return e.preventDefault(),i(!0),!1}},"Preview CSS"))},Yt=function(e){var t=e.plugins,n=e.theme,o=e.settings,i=e.requiredCss,l=e.templateKitId,u=e.completeCallback,c=qt(Object(r.useState)(!1),2),s=c[0],f=c[1],d=qt(Object(r.useState)(null),2),p=d[0],m=d[1],h=qt(Object(r.useState)({}),2),y=h[0],v=h[1],g=function(){m((function(e){return e+1}))},b=[];t.forEach((function(e){"activated"!==e.status&&b.push({plugin:e})})),o.forEach((function(e){b.push({setting:e})})),i.forEach((function(e){b.push({requiredCss:Kt(Kt({},e),{},{templateKitId:l})})}));var w=b.length;if(0===w)return null;var E=function(e){return void 0===y[e]||y[e]};return a.a.createElement(a.a.Fragment,null,s?a.a.createElement(Ue,{isOpen:!0,onCloseCallback:u},a.a.createElement("div",null,a.a.createElement(Ke,{title:"Missing Requirements"}),a.a.createElement("p",{className:Wt.a.notice},"Please install and activate these missing requirements for this Template Kit to work correctly. We recommend checking with your web developer before applying these changes."),a.a.createElement("ul",{className:Wt.a.requirements},b.map((function(e,t){return a.a.createElement("li",{key:"requirement".concat(t),className:Wt.a.requirement},a.a.createElement("div",{className:Wt.a.checkbox},a.a.createElement("input",{type:"checkbox",id:"requirement".concat(t),name:"installRequirement[]",value:"1",disabled:null!==p,checked:E(t),onChange:function(e){var n=!!e.target.checked;v((function(e){return Kt(Kt({},e),{},Ht({},t,n))}))}})),a.a.createElement("div",{className:Wt.a.text},a.a.createElement("label",{htmlFor:"requirement".concat(t)},e.theme?"Theme: ".concat(e.theme.name):null,e.plugin?"Plugin: ".concat(e.plugin.name):null,e.setting?"Setting: ".concat(e.setting.name):null,e.requiredCss?a.a.createElement(a.a.Fragment,null,e.requiredCss.name,": ",e.requiredCss.description,a.a.createElement(Qt,{previewCss:e.requiredCss.css_preview})):null)),a.a.createElement("div",{className:Wt.a.status},p===t||p>t?a.a.createElement($t,{key:"installRequirement".concat(t),requirement:E(t)?e:null,completeCallback:g}):null))})),n?a.a.createElement("li",{className:Wt.a.requirement},a.a.createElement("div",{className:Wt.a.checkbox},a.a.createElement("span",{className:"dashicons dashicons-warning"})),a.a.createElement("div",{className:Wt.a.text},'FYI: This Template Kit has only been tested with the "',n.name,'" WordPress theme. ',a.a.createElement("br",null),"If the imported templates don’t look correct please read ",a.a.createElement(Rt,{href:"https://help.market.envato.com/hc/en-us/sections/360007560992-Template-Kits",text:"this article"}),".")):null),a.a.createElement("div",{className:Wt.a.footer},null===p?a.a.createElement(at,{type:"primary",icon:"plus",label:"Install Above Selected Requirements",onClick:function(){m(0)}}):a.a.createElement(a.a.Fragment,null,p>=w?a.a.createElement(a.a.Fragment,null,a.a.createElement("p",{className:Wt.a.notice},"Once the above is completed you can close this window."),a.a.createElement(at,{type:"primary",icon:"plus",label:"Close",onClick:u})):a.a.createElement("p",{className:Wt.a.notice},"Installing..."))))):null,a.a.createElement("div",{className:Wt.a.wrapper},a.a.createElement("div",{className:Wt.a.textWrapper},a.a.createElement("strong",null,"Attention!")," There are ",w," requirements that need installing for this Template Kit to work correctly."),a.a.createElement("div",{className:Wt.a.buttonWrapper},a.a.createElement(at,{type:"attention",label:"Install Requirements",icon:"info",onClick:function(){f(!0)}}))))};Yt.propTypes={plugins:c.a.arrayOf(c.a.shape({author:c.a.string,file:c.a.string,name:c.a.string,slug:c.a.string,status:c.a.string,url:c.a.string,version:c.a.string})),settings:c.a.arrayOf(c.a.shape({name:c.a.string,setting_name:c.a.string})),templateKitId:c.a.number.isRequired,completeCallback:c.a.func.isRequired},Yt.defaultProps={plugins:[],settings:[]};var Xt=Yt,Zt=n(26),Gt=n.n(Zt),Jt=function(){return a.a.createElement("div",{className:Gt.a.wrap},a.a.createElement("span",{className:Gt.a.inner,"aria-label":"Loading"}))},en=function(e){return _t({endpoint:"fetchInstalledTemplateKits",args:e})},tn=n(6),nn=n.n(tn),rn=function(e){var t=e.currentKitId,n=e.handleChangeKitId,r=en();return a.a.createElement(a.a.Fragment,null,!r.loading&&r.data&&r.data.length>1?a.a.createElement("div",{className:nn.a.currentKit},a.a.createElement("div",{className:nn.a.optionKitWrapper},a.a.createElement("div",{className:nn.a.optionKit},a.a.createElement("button",{className:"".concat(nn.a.optionKitLink," ").concat("all"===t?nn.a.optionKitLinkCurrent:""),onClick:function(){n("all")}},"All Kits")),r.data.map((function(e){return a.a.createElement("div",{className:nn.a.optionKit,key:e.id},a.a.createElement("button",{className:"".concat(nn.a.optionKitLink," ").concat(t===e.id?nn.a.optionKitLinkCurrent:""),onClick:function(){n(e.id)}},e.title))})))):null)};function an(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return on(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return on(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function on(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ln=function(e){var t=e.actionHook,n=e.LoadingButton,r=e.SuccessButton,a=e.ErrorButton,o=e.errorCallback,i=e.completeCallback,l=t(),u=l.loading,c=l.data,s=l.error;return u||s?s?(setTimeout((function(){o(c)}),100),a):n:(setTimeout((function(){i(c)}),500),r)},un=function(e){var t=e.DefaultButton,n=e.CompletedButton,o=e.LoadingButton,i=e.ErrorButton,l=e.SuccessButton,u=e.actionHook,c=e.isAlreadyCompleted,s=void 0!==c&&c,f=e.completedCallback,d=void 0===f?null:f,p=e.errorCallback,m=void 0===p?null:p,h=e.actionConfirmationMessage,y=void 0===h?null:h,v=an(Object(r.useState)(!1),2),g=v[0],b=v[1],w=an(Object(r.useState)(s),2),E=w[0],k=w[1],x=an(Object(r.useState)(null),2),S=x[0],C=x[1];return Object(r.useEffect)((function(){E&&d&&!s&&d(E)}),[E]),Object(r.useEffect)((function(){S&&m&&m(S)}),[S]),Object(r.useEffect)((function(){k(s)}),[s]),E?n:g?a.a.createElement(ln,{actionHook:u,LoadingButton:o,ErrorButton:i,SuccessButton:l,errorCallback:function(e){setTimeout((function(){b(!1)}),500),C(e)},completeCallback:function(e){b(!1),k(e)}}):a.a.cloneElement(t,{onClick:function(e){if(y&&!confirm(y))return e.preventDefault(),!1;b(!0)}})},cn=function(e){var t=e.templateKitId,n=e.customActionHook,r=void 0===n?null:n,o=e.completeCallback,i=void 0===o?null:o,l=e.errorCallback,u=void 0===l?null:l;return a.a.createElement(un,{DefaultButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash"}),actionConfirmationMessage:"Really delete this Template Kit?",LoadingButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash",disabled:!0}),ErrorButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash",disabled:!0}),SuccessButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash",disabled:!0}),CompletedButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash"}),actionHook:function(){return r?r():_t({endpoint:"deleteTemplateKit",args:{templateKitId:t},allowLongRunning:!0})},isAlreadyCompleted:!1,completedCallback:function(){i&&i()},errorCallback:u})},sn=n(27),fn=n.n(sn),dn=function(e){var t=e.message;return a.a.createElement("div",{className:fn.a.message},a.a.createElement("p",{className:fn.a.copy},t))};dn.propTypes={message:c.a.string},dn.defaultProps={message:"Sorry there was an error loading this data. Please try again."};var pn=dn,mn=n(20),hn=n.n(mn),yn=function(e){var t=e.children,n=e.includeLastItemSpacer,r=void 0!==n&&n;return a.a.createElement("div",{className:hn.a.wrapper},a.a.createElement("div",{className:hn.a.inner},t,r?a.a.createElement("div",{className:hn.a.cardSpacing}):null))},vn=n(7),gn=n.n(vn);function bn(){return(bn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var En=function(e){var t=e.colWidthPercentage,n=void 0===t?20:t,r=e.children,o=e.className,i=wn(e,["colWidthPercentage","children","className"]),l=[gn.a.item];return 20===n&&l.push(gn.a.widthTwenty),25===n&&l.push(gn.a.widthTwentyFive),33===n&&l.push(gn.a.widthThirtyThree),40===n&&l.push(gn.a.widthFourty),50===n&&l.push(gn.a.widthFifty),60===n&&l.push(gn.a.widthSixty),100===n&&l.push(gn.a.widthFull),o&&l.push(o),a.a.createElement("div",bn({className:l.join(" ")},i),r)},kn=n(11),xn=n.n(kn),Sn=function(e){var t=e.Images,n=e.Buttons,r=e.title,o=e.description;return a.a.createElement("div",{className:xn.a.wrapper},a.a.createElement("div",{className:xn.a.inner},a.a.createElement("div",{className:xn.a.images},t),a.a.createElement("div",{className:xn.a.meta},a.a.createElement("h4",{className:xn.a.cardTitle},r),a.a.createElement("p",{className:xn.a.cardDescription},o),n)))};function Cn(){return(Cn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var On=function(e){var t=e.type,n=e.label,r=e.icon,o=e.href,i=e.openNewWindow,l=Tn(e,["type","label","icon","href","openNewWindow"]),u=i?{target:"_blank",rel:"noopener noreferrer"}:null;return a.a.createElement(nt,Cn({href:o,type:t,element:"a"},u,l),a.a.createElement(Xe,{label:n,icon:r}))};On.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,href:c.a.string.isRequired},On.defaultProps={type:"ghost",label:null,icon:null};var _n=On;function Pn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jn(e){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function In(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(Object(n),!0).forEach((function(t){Mn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):In(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rn=function(e){var t,n=e.image,a=e.templateKitName,o=e.completeCallback,i=(t=An(An({},n),{},{templateKitName:a}),_t({endpoint:"importElementorTemplateImage",args:t,allowLongRunning:!0})),l=i.loading,u=i.error,c=i.data;return Object(r.useEffect)((function(){!l&&!u&&c&&c.id&&o()}),[l]),null},Fn=function(e){var t=e.templateData,n=e.progressCallback,o=e.completeCallback,i=Pn(Object(r.useState)(0),2),l=i[0],u=i[1],c=Pn(Object(r.useState)(null),2),s=c[0],f=c[1];Object(r.useEffect)((function(){f(function(e){var t=[];return function e(n){n&&Object.keys(n).forEach((function(r){n[r]&&n[r].url&&n[r].id&&t.push(n[r]),("object"===jn(n[r])||Array.isArray(n[r]))&&e(n[r])}))}(e.content),t}(t))}),[]);var d=function(){u((function(e){return e+1}))};return Object(r.useEffect)((function(){l&&l>0&&s&&s.length>0&&(n(Math.round(l/(s.length+2)*100)/100),l===s.length&&(u(null),o()))}),[l]),Object(r.useEffect)((function(){null!==s&&0===s.length&&(n(.5),o())}),[s]),null===s?null:a.a.createElement(a.a.Fragment,null,s.map((function(e,n){return a.a.createElement(a.a.Fragment,{key:"importImage".concat(n)},l===n||l>n?a.a.createElement(Rn,{key:"importImageBackground".concat(n),image:e,templateKitName:t.template_kit_name,completeCallback:d}):null)})))};Fn.propTypes={templateData:c.a.shape({author:c.a.string,file:c.a.string}).isRequired,completeCallback:c.a.func.isRequired};var Dn=Fn;function Ln(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Un=function(e){var t=e.templateKitId,n=e.templateId,a=e.importAgain,o=e.insertToPage,i=e.completeCallback,l=_t({endpoint:"importSingleTemplate",args:{templateKitId:t,templateId:n,importAgain:a,insertToPage:o},allowLongRunning:!0}),u=l.loading,c=l.error,s=l.data;return Object(r.useEffect)((function(){!u&&!c&&s&&s.imported_template_id&&i(s)}),[u]),null},Wn=function(e){var t=e.templateKitId,n=e.templateId,a=e.completeCallback,o=_t({endpoint:"getSingleTemplateImportData",args:{templateKitId:t,templateId:n},allowLongRunning:!0}),i=o.loading,l=o.error,u=o.data;return Object(r.useEffect)((function(){!i&&!l&&u&&u.template_data&&a(u.template_data)}),[i]),null},Bn=function(e){var t=e.templateKitId,n=e.templateId,o=e.existingImports,i=void 0===o?[]:o,l=(0,wt().getMagicButtonMode)(),u=l&&"elementorMagicButton"===l.mode,c=Ln(Object(r.useState)(u?null:i.length?i[0].imported_template_id:null),2),s=c[0],f=c[1],d=Ln(Object(r.useState)(null),2),p=d[0],m=d[1],h=Ln(Object(r.useState)(0),2),y=h[0],v=h[1],g=Ln(Object(r.useState)("idle"),2),b=g[0],w=g[1],E=Ln(Object(r.useState)(!1),2),k=E[0],x=E[1],S=s?a.a.createElement(at,{type:"ghost",label:"Import Again",icon:"plus",onClick:function(){v(0),x(!0),w("importingFetchJsonData")}}):a.a.createElement(at,{type:"primary",label:u?"Insert Template":"Import Template",icon:"plus",onClick:function(){v(0),w("importingFetchJsonData")}}),C=a.a.createElement(at,{type:"primary",label:"Importing ".concat(Math.round(100*y),"%"),icon:"updateSpinning",disabled:!0}),T=a.a.createElement(_n,{href:Pt({importedTemplateId:s}),type:"primary",label:"View Template",icon:"eye",openNewWindow:!0});return a.a.createElement(a.a.Fragment,null,s?T:null,"idle"===b?S:null,"importingFetchJsonData"===b||"importingImages"===b||"importingTemplate"===b?C:null,"importingFetchJsonData"===b?a.a.createElement(Wn,{templateKitId:t,templateId:n,completeCallback:function(e){m(e),w("importingImages")}}):null,"importingImages"===b?a.a.createElement(Dn,{templateData:p,progressCallback:function(e){v(e)},completeCallback:function(){w("importingTemplate")}}):null,"importingTemplate"===b?a.a.createElement(Un,{templateKitId:t,templateId:n,importAgain:k,insertToPage:u,completeCallback:function(e){e&&e.imported_template_id&&(v(1),setTimeout((function(){f(e.imported_template_id),w("idle")}),300),u&&l.insertCallback&&"function"==typeof l.insertCallback&&l.insertCallback(e))}}):null)},Kn=n(28),Hn=n.n(Kn),qn=function(){return a.a.createElement("div",{className:Hn.a.svgWrapper},a.a.createElement("svg",{className:Hn.a.svgEnvatoLogo,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 27 31"},a.a.createElement("path",{fill:"#fff",d:"M23.64 1.318C19.45-3.592 5.89 5.918 6 18.178a.58.58 0 01-.57.57.58.58 0 01-.49-.28 13.13 13.13 0 01-.52-9.65.53.53 0 00-.9-.52A13 13 0 000 17.188a13 13 0 0013.15 13.15c18.5-.42 14.23-24.64 10.49-29.02z"})))},Vn=n(8),$n=n.n(Vn);function Qn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xn={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999},content:{background:"#f1f1f1",border:"0",top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",padding:"0",transform:"translate(-50%, -50%)",borderRadius:"4px"}},Zn=function(e){var t=e.isOpen,n=e.onCloseCallback,o=void 0===n?null:n,i=e.children,l=e.templatePreviewTitle,u=e.templateId,c=e.templateKitId,s=e.existingImports,f=Qn(a.a.useState(!1),2),d=f[0],p=f[1],m=function(){p(!1),o&&o()};return Object(r.useEffect)((function(){t&&p(!0)}),[t]),"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Me.a.setAppElement(window.templateKitImport.modalAppHolder),a.a.createElement(Me.a,{isOpen:d,onRequestClose:m,style:Xn,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:$n.a.modalInner},a.a.createElement("div",{className:$n.a.modalHeader},a.a.createElement("div",{className:$n.a.modalLogo},a.a.createElement(qn,null)),a.a.createElement("div",{className:$n.a.headerTitle},l),a.a.createElement("div",{className:$n.a.headerActions},a.a.createElement(Bn,{templateKitId:c,templateId:u,existingImports:s}),a.a.createElement("button",{onClick:m,"data-testid":"modal-close-button",className:$n.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat($n.a.dismissIcon)})))),a.a.createElement("div",{className:$n.a.kitInner},"function"==typeof i?i({closeModal:m}):i)))},Gn=n(29),Jn=n.n(Gn);function er(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nr=function(e){var t=e.onCloseCallback,n=e.templateId,o=e.templateKitId,i=e.existingImports,l=e.templateScreenShotUrl,u=e.templatePreviewTitle,c=e.installRequirements,s=ue().id,f=er(Object(r.useState)(null),2),d=f[0],p=f[1],m=zt({id:s,refresh:d});return a.a.createElement(Zn,{templateId:n,templateKitId:o,existingImports:i,templatePreviewTitle:u,isOpen:!0,onCloseCallback:t},c&&!m.loading&&!m.error&&m.data?a.a.createElement("div",{className:Jn.a.missingRequirementsWrapper},a.a.createElement(Xt,{settings:m.data.requirements.settings,theme:m.data.requirements.theme,plugins:m.data.requirements.plugins,requiredCss:m.data.requirements.css,templateKitId:s,completeCallback:function(){p((new Date).getTime())}})):null,a.a.createElement("img",{className:Jn.a.previewTemplate,src:l,alt:u}))},rr=n(15),ar=n.n(rr);function or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ir(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lr=function(e){var t=e.template,n=or(Object(r.useState)(!1),2),o=n[0],i=n[1],l=Object(r.useRef)(null),u=t.id,c=t.template_kit_id,s=t.name,f=t.screenshot_url,d=t.imports,p=or(Object(r.useState)(t.unmet_requirements&&t.unmet_requirements.length>0),2),m=p[0],h=p[1],y=t.metadata.additional_template_information?t.metadata.additional_template_information.join(" "):"";return a.a.createElement(En,{colWidthPercentage:33,key:u},a.a.createElement(Sn,{Images:a.a.createElement("div",{className:ar.a.imageWrapper},a.a.createElement("img",{src:f,alt:s,className:ar.a.image}),a.a.createElement("div",{className:ar.a.expandButton,ref:l,onClick:function(e){e.target===l.current&&i(!0)}},o?a.a.createElement(nr,{templateScreenShotUrl:f,templatePreviewTitle:s,templateKitId:c,templateId:u,existingImports:d,onCloseCallback:function(){i(!1)}}):null,a.a.createElement(at,{type:"ghost",icon:"expand",onClick:function(){i(!0)}}))),Buttons:a.a.createElement(a.a.Fragment,null,m?a.a.createElement(a.a.Fragment,null,a.a.createElement("p",{className:ar.a.unmetRequirementsMessage},t.unmet_requirements.join(" ")),a.a.createElement(at,{type:"warning",label:"Ignore Requirements",icon:"cross",onClick:function(){return h(!1)}})):a.a.createElement(lt,null,a.a.createElement(Bn,{templateKitId:c,templateId:u,existingImports:d}))),title:s,description:y}))},ur=function(e){var t=e.templates;return a.a.createElement(yn,{includeLastItemSpacer:!0},t.map((function(e){return a.a.createElement(lr,{key:e.id,template:e})})))},cr=n(21),sr=n.n(cr);function fr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pr=ie((function(e){var t=e.history,n=ue().id,o=ce().path,i=fr(Object(r.useState)(null),2),l=i[0],u=i[1],c=zt({id:n,refresh:l}),s=fr(Object(r.useState)(!1),2),f=s[0],d=s[1];return a.a.createElement(a.a.Fragment,null,c.loading?a.a.createElement(Jt,null):null,c.error?a.a.createElement(pn,null):null,f?a.a.createElement(Y,{to:"/template-kits/installed-kits"}):null,c.loading||c.error||!c.data?null:a.a.createElement("div",null,c.data.requirements?a.a.createElement("div",{className:sr.a.missingRequirementsWrapper},a.a.createElement(Xt,{settings:c.data.requirements.settings,theme:c.data.requirements.theme,plugins:c.data.requirements.plugins,requiredCss:c.data.requirements.css,templateKitId:n,completeCallback:function(){u((new Date).getTime())}})):null,a.a.createElement("div",{className:sr.a.headerWrapper},a.a.createElement(Ke,{title:c.data.title}),a.a.createElement(rn,{currentKitId:c.data.id,handleChangeKitId:function(e){t.push(o.replace(":id",e))}}),a.a.createElement("div",{className:sr.a.deleteKitWrapper},a.a.createElement(cn,{templateKitId:c.data.id,completeCallback:function(){d(!0)}}))),a.a.createElement(ur,{templates:c.data.templates})))})),mr=function(e){var t=e.type,n=e.label,r=e.icon,o=e.href;return a.a.createElement(nt,{element:"Link",to:o,type:t},a.a.createElement(Xe,{label:n,icon:r}))};mr.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,href:c.a.string.isRequired},mr.defaultProps={type:"ghost",label:null,icon:null};var hr=mr,yr=n(16),vr=n.n(yr);function gr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return br(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var wr=function(e){var t=e.item,n=ce().url,o=gr(Object(r.useState)(!1),2),i=o[0],l=o[1],u=wt().getReviewMode;return i?null:a.a.createElement(En,{colWidthPercentage:33,className:vr.a.itemCard},a.a.createElement(Sn,{Images:a.a.createElement(ye,{to:"".concat(n,"/kit/").concat(t.id),className:vr.a.itemImageLink},a.a.createElement("img",{src:t.screenshot_url,alt:t.title,className:vr.a.itemImage})),Buttons:a.a.createElement(lt,null,a.a.createElement(hr,{type:"primary",label:"View Installed Kit",icon:"plus",href:"".concat(n,"/kit/").concat(t.id)}),u()?a.a.createElement(_n,{href:"admin.php?page=template-kit-review&template_kit_id=".concat(t.id),type:"primary",openNewWindow:!0,label:"Review",icon:"eye"}):null,a.a.createElement("div",{className:vr.a.itemDelete},a.a.createElement(cn,{templateKitId:t.id,completeCallback:function(){l(!0)}}))),title:t.title,description:"Contains ".concat(t.template_count," templates")}))},Er=n(12),kr=n.n(Er);function xr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cr=function(e){e.item;var t=xr(Object(r.useState)(null),2),n=t[0],o=t[1];return a.a.createElement(En,{colWidthPercentage:33},a.a.createElement("div",{className:kr.a.uploadCard},a.a.createElement("label",{htmlFor:"upload-template-kit-zip-file",className:kr.a.uploadCardButton},n?a.a.createElement(Jt,null):a.a.createElement("span",{className:kr.a.icon}),a.a.createElement("div",{className:kr.a.message},"Upload Template Kit ZIP File"),a.a.createElement("input",{type:"file",name:"upload-template-kit-zip-file",id:"upload-template-kit-zip-file",className:kr.a.formInput,onChange:function(e){o(e.target.files[0])}})),n?a.a.createElement(It,{chosenFile:n}):null))},Tr=function(){var e=en(),t=e.loading,n=e.data,r=e.error;return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",null,a.a.createElement(Ke,{title:"Installed Template Kits",subtitle:"These are the Template Kits installed on this WordPress website."})),t?a.a.createElement(Jt,null):null,r?a.a.createElement(pn,null):null,t||r||0!==n.length?null:a.a.createElement(pn,{message:a.a.createElement(a.a.Fragment,null,"No installed Template Kits found. Please"," ",a.a.createElement(Rt,{href:"https://themeforest.net/category/template-kits?utm_source=extensions&utm_medium=referral&utm_campaign=template_kit_import_plugin",text:"click here to view available premium Template Kits"})," "," or upload a new Template Kit ZIP file below.")}),t||r?null:a.a.createElement(yn,{includeLastItemSpacer:!0},n.map((function(e){return a.a.createElement(wr,{key:e.id,item:e})})),a.a.createElement(Cr,null)))},Or=function(){var e=ce().url;return a.a.createElement(oe,null,a.a.createElement(J,{path:"".concat(e,"/kit/:id"),children:a.a.createElement(pr,null)}),a.a.createElement(J,{children:a.a.createElement(Tr,null)}))},_r=function(){var e=ce().url;return a.a.createElement(a.a.Fragment,null,a.a.createElement(oe,null,a.a.createElement(J,{path:"".concat(e,"/installed-kits"),children:a.a.createElement(Or,null)}),a.a.createElement(J,null,a.a.createElement(Y,{to:"/template-kits/installed-kits"}))))},Pr=n(30),Nr=n.n(Pr),jr=function(){return a.a.createElement("div",{className:Nr.a.wrapper},a.a.createElement(je,null,a.a.createElement(Se,null,a.a.createElement(se,null,a.a.createElement(dt,null),a.a.createElement(Mt,null),a.a.createElement("div",{className:Nr.a.container},a.a.createElement(oe,null,a.a.createElement(J,{exact:!0,path:"/"},a.a.createElement(Y,{to:"/template-kits/installed-kits"})),a.a.createElement(J,{path:"/template-kits",children:a.a.createElement(_r,null)}))),a.a.createElement(Lt,null)))))},Ir=n(9),Ar=n.n(Ir);function Mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Fr={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999,display:"flex",justifyContent:"center",alignItems:"center"},content:{background:"#f1f1f1",border:"0",padding:"0",right:"auto",bottom:"auto",top:"auto",left:"auto",borderRadius:"4px"}},Dr=function(e){e.photoId,e.photoTitle;var t=e.onCloseCallback,n=void 0===t?null:t,r=e.children,o=Mr(a.a.useState(!0),2),i=o[0],l=o[1],u=function(){l(!1),n&&n()};return"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Me.a.setAppElement(window.templateKitImport.modalAppHolder),a.a.createElement(Me.a,{isOpen:i,onRequestClose:u,style:Fr,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:Ar.a.modalInner},a.a.createElement("div",{className:Ar.a.modalHeader},a.a.createElement("div",{className:Ar.a.modalLogo},a.a.createElement(qn,null)),a.a.createElement("div",{className:Ar.a.headerNav}),a.a.createElement("div",{className:Ar.a.headerActions},a.a.createElement("button",{onClick:u,"data-testid":"modal-close-button",className:Ar.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat(Ar.a.dismissIcon)})))),a.a.createElement("div",{className:Ar.a.magicModalInner},"function"==typeof r?r({closeModal:u}):r)))};function Lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lr(Object(n),!0).forEach((function(t){Ur(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wr=function(e){var t=e.onClose,n=e.magicButtonMode;return a.a.createElement(je,{config:zr(zr({},window.template_kit_import),{},{magicButtonMode:n})},a.a.createElement(Se,null,a.a.createElement(H,null,a.a.createElement(dt,null),a.a.createElement(Dr,{onCloseCallback:t},a.a.createElement(oe,null,a.a.createElement(J,{exact:!0,path:"/"},a.a.createElement(Y,{to:"/template-kits/installed-kits"})),a.a.createElement(J,{path:"/template-kits",children:a.a.createElement(_r,null)}))))))};window.templateKitImport={modalAppHolder:null},window.templateKitImport.initBackend=function(e){window.templateKitImport.modalAppHolder=e,i.a.render(a.a.createElement(jr,null),e)},window.templateKitImport.initMagicButton=function(e,t){window.templateKitImport.modalAppHolder=e,i.a.render(a.a.createElement(Wr,{magicButtonMode:t,onClose:function(){window.templateKitImport.closeMagicButton(e)}}),e)},window.templateKitImport.closeMagicButton=function(e){i.a.unmountComponentAtNode(e)}}]);
52
  *
53
  * This source code is licensed under the MIT license found in the
54
  * LICENSE file in the root directory of this source tree.
55
+ */var r="function"==typeof Symbol&&Symbol.for,a=r?Symbol.for("react.element"):60103,o=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,s=r?Symbol.for("react.context"):60110,f=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,m=r?Symbol.for("react.suspense"):60113,h=r?Symbol.for("react.suspense_list"):60120,y=r?Symbol.for("react.memo"):60115,v=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function k(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case a:switch(e=e.type){case f:case d:case i:case u:case l:case m:return e;default:switch(e=e&&e.$$typeof){case s:case p:case v:case y:case c:return e;default:return t}}case o:return t}}}function x(e){return k(e)===d}t.AsyncMode=f,t.ConcurrentMode=d,t.ContextConsumer=s,t.ContextProvider=c,t.Element=a,t.ForwardRef=p,t.Fragment=i,t.Lazy=v,t.Memo=y,t.Portal=o,t.Profiler=u,t.StrictMode=l,t.Suspense=m,t.isAsyncMode=function(e){return x(e)||k(e)===f},t.isConcurrentMode=x,t.isContextConsumer=function(e){return k(e)===s},t.isContextProvider=function(e){return k(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===a},t.isForwardRef=function(e){return k(e)===p},t.isFragment=function(e){return k(e)===i},t.isLazy=function(e){return k(e)===v},t.isMemo=function(e){return k(e)===y},t.isPortal=function(e){return k(e)===o},t.isProfiler=function(e){return k(e)===u},t.isStrictMode=function(e){return k(e)===l},t.isSuspense=function(e){return k(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===u||e===l||e===m||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===c||e.$$typeof===s||e.$$typeof===p||e.$$typeof===b||e.$$typeof===w||e.$$typeof===E||e.$$typeof===g)},t.typeOf=k},,,function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o=n(13),i=n.n(o),l=n(3),u=n(1),c=n.n(u);function s(){return(s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function f(e){return"/"===e.charAt(0)}function d(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}var p=function(e,t){void 0===t&&(t="");var n,r=e&&e.split("/")||[],a=t&&t.split("/")||[],o=e&&f(e),i=t&&f(t),l=o||i;if(e&&f(e)?a=r:r.length&&(a.pop(),a=a.concat(r)),!a.length)return"/";if(a.length){var u=a[a.length-1];n="."===u||".."===u||""===u}else n=!1;for(var c=0,s=a.length;s>=0;s--){var p=a[s];"."===p?d(a,s):".."===p?(d(a,s),c++):c&&(d(a,s),c--)}if(!l)for(;c--;c)a.unshift("..");!l||""===a[0]||a[0]&&f(a[0])||a.unshift("");var m=a.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function m(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var h=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=m(t),a=m(n);return r!==t||a!==n?e(r,a):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var y=function(e,t){if(!e)throw new Error("Invariant failed")};function v(e){return"/"===e.charAt(0)?e:"/"+e}function g(e){return"/"===e.charAt(0)?e.substr(1):e}function b(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function w(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function E(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function k(e,t,n,r){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=s({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(a.key=n),r?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=p(a.pathname,r.pathname)):a.pathname=r.pathname:a.pathname||(a.pathname="/"),a}function x(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach((function(e){return e.apply(void 0,n)}))}}}var S=!("undefined"==typeof window||!window.document||!window.document.createElement);function C(e,t){t(window.confirm(e))}function T(){try{return window.history.state||{}}catch(e){return{}}}function O(e){void 0===e&&(e={}),S||y(!1);var t,n=window.history,r=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,a=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e,i=o.forceRefresh,l=void 0!==i&&i,u=o.getUserConfirmation,c=void 0===u?C:u,f=o.keyLength,d=void 0===f?6:f,p=e.basename?w(v(e.basename)):"";function m(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return p&&(o=b(o,p)),k(o,r,n)}function h(){return Math.random().toString(36).substr(2,d)}var g=x();function O(e){s(z,e),z.length=n.length,g.notifyListeners(z.location,z.action)}function _(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||j(m(e.state))}function P(){j(m(T()))}var N=!1;function j(e){if(N)N=!1,O();else{g.confirmTransitionTo(e,"POP",c,(function(t){t?O({action:"POP",location:e}):function(e){var t=z.location,n=A.indexOf(t.key);-1===n&&(n=0);var r=A.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(N=!0,R(a))}(e)}))}}var I=m(T()),A=[I.key];function M(e){return p+E(e)}function R(e){n.go(e)}var F=0;function D(e){1===(F+=e)&&1===e?(window.addEventListener("popstate",_),a&&window.addEventListener("hashchange",P)):0===F&&(window.removeEventListener("popstate",_),a&&window.removeEventListener("hashchange",P))}var L=!1;var z={length:n.length,action:"POP",location:I,createHref:M,push:function(e,t){var a=k(e,t,h(),z.location);g.confirmTransitionTo(a,"PUSH",c,(function(e){if(e){var t=M(a),o=a.key,i=a.state;if(r)if(n.pushState({key:o,state:i},null,t),l)window.location.href=t;else{var u=A.indexOf(z.location.key),c=A.slice(0,u+1);c.push(a.key),A=c,O({action:"PUSH",location:a})}else window.location.href=t}}))},replace:function(e,t){var a=k(e,t,h(),z.location);g.confirmTransitionTo(a,"REPLACE",c,(function(e){if(e){var t=M(a),o=a.key,i=a.state;if(r)if(n.replaceState({key:o,state:i},null,t),l)window.location.replace(t);else{var u=A.indexOf(z.location.key);-1!==u&&(A[u]=a.key),O({action:"REPLACE",location:a})}else window.location.replace(t)}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&(e=!1);var t=g.setPrompt(e);return L||(D(1),L=!0),function(){return L&&(L=!1,D(-1)),t()}},listen:function(e){var t=g.appendListener(e);return D(1),function(){D(-1),t()}}};return z}var _={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+g(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:g,decodePath:v},slash:{encodePath:v,decodePath:v}};function P(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function N(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function j(e){window.location.replace(P(window.location.href)+"#"+e)}function I(e){void 0===e&&(e={}),S||y(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,a=void 0===r?C:r,o=n.hashType,i=void 0===o?"slash":o,l=e.basename?w(v(e.basename)):"",u=_[i],c=u.encodePath,f=u.decodePath;function d(){var e=f(N());return l&&(e=b(e,l)),k(e)}var p=x();function m(e){s(z,e),z.length=t.length,p.notifyListeners(z.location,z.action)}var h=!1,g=null;function T(){var e,t,n=N(),r=c(n);if(n!==r)j(r);else{var o=d(),i=z.location;if(!h&&(t=o,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(g===E(o))return;g=null,function(e){if(h)h=!1,m();else{p.confirmTransitionTo(e,"POP",a,(function(t){t?m({action:"POP",location:e}):function(e){var t=z.location,n=M.lastIndexOf(E(t));-1===n&&(n=0);var r=M.lastIndexOf(E(e));-1===r&&(r=0);var a=n-r;a&&(h=!0,R(a))}(e)}))}}(o)}}var O=N(),I=c(O);O!==I&&j(I);var A=d(),M=[E(A)];function R(e){t.go(e)}var F=0;function D(e){1===(F+=e)&&1===e?window.addEventListener("hashchange",T):0===F&&window.removeEventListener("hashchange",T)}var L=!1;var z={length:t.length,action:"POP",location:A,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=P(window.location.href)),n+"#"+c(l+E(e))},push:function(e,t){var n=k(e,void 0,void 0,z.location);p.confirmTransitionTo(n,"PUSH",a,(function(e){if(e){var t=E(n),r=c(l+t);if(N()!==r){g=t,function(e){window.location.hash=e}(r);var a=M.lastIndexOf(E(z.location)),o=M.slice(0,a+1);o.push(t),M=o,m({action:"PUSH",location:n})}else m()}}))},replace:function(e,t){var n=k(e,void 0,void 0,z.location);p.confirmTransitionTo(n,"REPLACE",a,(function(e){if(e){var t=E(n),r=c(l+t);N()!==r&&(g=t,j(r));var a=M.indexOf(E(z.location));-1!==a&&(M[a]=t),m({action:"REPLACE",location:n})}}))},go:R,goBack:function(){R(-1)},goForward:function(){R(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return L||(D(1),L=!0),function(){return L&&(L=!1,D(-1)),t()}},listen:function(e){var t=p.appendListener(e);return D(1),function(){D(-1),t()}}};return z}function A(e,t,n){return Math.min(Math.max(e,t),n)}function M(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,r=t.initialEntries,a=void 0===r?["/"]:r,o=t.initialIndex,i=void 0===o?0:o,l=t.keyLength,u=void 0===l?6:l,c=x();function f(e){s(v,e),v.length=v.entries.length,c.notifyListeners(v.location,v.action)}function d(){return Math.random().toString(36).substr(2,u)}var p=A(i,0,a.length-1),m=a.map((function(e){return k(e,void 0,"string"==typeof e?d():e.key||d())})),h=E;function y(e){var t=A(v.index+e,0,v.entries.length-1),r=v.entries[t];c.confirmTransitionTo(r,"POP",n,(function(e){e?f({action:"POP",location:r,index:t}):f()}))}var v={length:m.length,action:"POP",location:m[p],index:p,entries:m,createHref:h,push:function(e,t){var r=k(e,t,d(),v.location);c.confirmTransitionTo(r,"PUSH",n,(function(e){if(e){var t=v.index+1,n=v.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),f({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=k(e,t,d(),v.location);c.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(v.entries[v.index]=r,f({action:"REPLACE",location:r}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=v.index+e;return t>=0&&t<v.entries.length},block:function(e){return void 0===e&&(e=!1),c.setPrompt(e)},listen:function(e){return c.appendListener(e)}};return v}var R=n(24),F=n(25),D=n.n(F);n(35);function L(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}var z=n(36),U=n.n(z),W=function(e){var t=Object(R.a)();return t.displayName=e,t}("Router-History"),B=function(e){var t=Object(R.a)();return t.displayName=e,t}("Router"),K=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(l.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return a.a.createElement(B.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.a.createElement(W.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.a.Component);var H=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=M(t.props),t}return Object(l.a)(t,e),t.prototype.render=function(){return a.a.createElement(K,{history:this.history,children:this.props.children})},t}(a.a.Component);var q=function(e){function t(){return e.apply(this,arguments)||this}Object(l.a)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(a.a.Component);var V={},$=0;function Q(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(V[e])return V[e];var t=D.a.compile(e);return $<1e4&&(V[e]=t,$++),t}(e)(t,{pretty:!0})}function Y(e){var t=e.computedMatch,n=e.to,r=e.push,o=void 0!==r&&r;return a.a.createElement(B.Consumer,null,(function(e){e||y(!1);var r=e.history,i=e.staticContext,l=o?r.push:r.replace,u=k(t?"string"==typeof n?Q(n,t.params):s({},n,{pathname:Q(n.pathname,t.params)}):n);return i?(l(u),null):a.a.createElement(q,{onMount:function(){l(u)},onUpdate:function(e,t){var n,r,a=k(t.to);n=a,r=s({},u,{key:a.key}),n.pathname===r.pathname&&n.search===r.search&&n.hash===r.hash&&n.key===r.key&&h(n.state,r.state)||l(u)},to:n})}))}var X={},Z=0;function G(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,l=void 0!==i&&i,u=n.sensitive,c=void 0!==u&&u;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=X[n]||(X[n]={});if(r[e])return r[e];var a=[],o={regexp:D()(e,a,t),keys:a};return Z<1e4&&(r[e]=o,Z++),o}(n,{end:o,strict:l,sensitive:c}),a=r.regexp,i=r.keys,u=a.exec(e);if(!u)return null;var s=u[0],f=u.slice(1),d=e===s;return o&&!d?null:{path:n,url:"/"===n&&""===s?"/":s,isExact:d,params:i.reduce((function(e,t,n){return e[t.name]=f[n],e}),{})}}),null)}var J=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this;return a.a.createElement(B.Consumer,null,(function(t){t||y(!1);var n=e.props.location||t.location,r=s({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?G(n.pathname,e.props):t.match}),o=e.props,i=o.children,l=o.component,u=o.render;return Array.isArray(i)&&0===i.length&&(i=null),a.a.createElement(B.Provider,{value:r},r.match?i?"function"==typeof i?i(r):i:l?a.a.createElement(l,r):u?u(r):null:"function"==typeof i?i(r):null)}))},t}(a.a.Component);function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e,t){if(!e)return t;var n=ee(e);return 0!==t.pathname.indexOf(n)?t:s({},t,{pathname:t.pathname.substr(n.length)})}function ne(e){return"string"==typeof e?e:E(e)}function re(e){return function(){y(!1)}}function ae(){}a.a.Component;var oe=function(e){function t(){return e.apply(this,arguments)||this}return Object(l.a)(t,e),t.prototype.render=function(){var e=this;return a.a.createElement(B.Consumer,null,(function(t){t||y(!1);var n,r,o=e.props.location||t.location;return a.a.Children.forEach(e.props.children,(function(e){if(null==r&&a.a.isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?G(o.pathname,s({},e.props,{path:i})):t.match}})),r?a.a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(a.a.Component);function ie(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=L(t,["wrappedComponentRef"]);return a.a.createElement(B.Consumer,null,(function(t){return t||y(!1),a.a.createElement(e,s({},r,t,{ref:n}))}))};return n.displayName=t,n.WrappedComponent=e,U()(n,e)}var le=a.a.useContext;function ue(){var e=le(B).match;return e?e.params:{}}function ce(e){var t=le(B).location,n=le(B).match;return e?G(t.pathname,e):n}a.a.Component;var se=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=I(t.props),t}return Object(l.a)(t,e),t.prototype.render=function(){return a.a.createElement(K,{history:this.history,children:this.props.children})},t}(a.a.Component);var fe=function(e,t){return"function"==typeof e?e(t):e},de=function(e,t){return"string"==typeof e?k(e,null,null,t):e},pe=function(e){return e},me=a.a.forwardRef;void 0===me&&(me=pe);var he=me((function(e,t){var n=e.innerRef,r=e.navigate,o=e.onClick,i=L(e,["innerRef","navigate","onClick"]),l=i.target,u=s({},i,{onClick:function(e){try{o&&o(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||l&&"_self"!==l||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return u.ref=pe!==me&&t||n,a.a.createElement("a",u)}));var ye=me((function(e,t){var n=e.component,r=void 0===n?he:n,o=e.replace,i=e.to,l=e.innerRef,u=L(e,["component","replace","to","innerRef"]);return a.a.createElement(B.Consumer,null,(function(e){e||y(!1);var n=e.history,c=de(fe(i,e.location),e.location),f=c?n.createHref(c):"",d=s({},u,{href:f,navigate:function(){var t=fe(i,e.location);(o?n.replace:n.push)(t)}});return pe!==me?d.ref=t||l:d.innerRef=l,a.a.createElement(r,d)}))})),ve=function(e){return e},ge=a.a.forwardRef;void 0===ge&&(ge=ve);ge((function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,o=e.activeClassName,i=void 0===o?"active":o,l=e.activeStyle,u=e.className,c=e.exact,f=e.isActive,d=e.location,p=e.sensitive,m=e.strict,h=e.style,v=e.to,g=e.innerRef,b=L(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return a.a.createElement(B.Consumer,null,(function(e){e||y(!1);var n=d||e.location,o=de(fe(v,n),n),w=o.pathname,E=w&&w.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),k=E?G(n.pathname,{path:E,exact:c,sensitive:p,strict:m}):null,x=!!(f?f(k,n):k),S=x?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return e})).join(" ")}(u,i):u,C=x?s({},h,{},l):h,T=s({"aria-current":x&&r||null,className:S,style:C,to:o},b);return ve!==ge?T.ref=t||g:T.innerRef=g,a.a.createElement(ye,T)}))}));function be(e){return function(e){if(Array.isArray(e))return ke(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||Ee(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(e,t){if(e){if("string"==typeof e)return ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xe=a.a.createContext({errors:[],addError:function(){},removeError:function(){}});function Se(e){var t=e.children,n=we(Object(r.useState)([]),2),o=n[0],i=n[1],l={errors:o,addError:Object(r.useCallback)((function(e,t,n){return function(e,t,n){i((function(r){return[].concat(be(r),[{code:e,message:t,debug:n}])}))}(e,t,n)}),[]),removeError:Object(r.useCallback)((function(e){return t=e,void i((function(e){return e.filter((function(e){return e!==t}))}));var t}),[])};return a.a.createElement(xe.Provider,{value:l},t)}function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){Oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pe(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ne=a.a.createContext({globalConfig:{},setConfigValue:function(){}});function je(e){var t=e.children,n=e.config,o=void 0===n?{}:n,i=_e(Object(r.useState)(Object.keys(o).length>0?o:window.template_kit_import),2),l=i[0],u=i[1],c={globalConfig:l,setConfigValue:Object(r.useCallback)((function(e,t){return function(e,t){u((function(n){return Te(Te({},n),{},Oe({},e,t))})),window.envato_elements&&(window.envato_elements[e]=t)}(e,t)}),[])};return a.a.createElement(Ne.Provider,{value:c},t)}var Ie=function(){var e=Object(r.useContext)(xe);return{errors:e.errors,addError:e.addError,removeError:e.removeError}},Ae=n(5),Me=n.n(Ae),Re=n(17),Fe=n.n(Re);function De(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Le(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ze={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999},content:{top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",transform:"translate(-50%, -50%)",padding:"40px",borderRadius:"10px"}},Ue=function(e){var t=e.isOpen,n=e.onCloseCallback,o=void 0===n?null:n,i=e.children,l=De(a.a.useState(!1),2),u=l[0],c=l[1],s=function(){c(!1),o&&o()};return Object(r.useEffect)((function(){t&&c(!0)}),[t]),Object(r.useEffect)((function(){"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Me.a.setAppElement(window.templateKitImport.modalAppHolder)})),a.a.createElement(Me.a,{isOpen:u,onRequestClose:s,style:ze,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:Fe.a.modalInner},a.a.createElement("button",{onClick:s,"data-testid":"modal-close-button",className:Fe.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat(Fe.a.dismissIcon)})),"function"==typeof i?i({closeModal:s}):i))},We=n(18),Be=n.n(We),Ke=function(e){var t=e.title,n=e.subtitle;return a.a.createElement("div",{className:Be.a.wrapper},a.a.createElement("h1",{className:Be.a.title},t),n?a.a.createElement("p",{className:Be.a.subtitle},n):null)},He=n(10),qe=n.n(He),Ve=n(19),$e=n.n(Ve),Qe=function(e){var t=e.label,n=e.icon,r=["dashicons",Ye[n],$e.a.icon];return t&&r.push($e.a.iconWithLabel),a.a.createElement(a.a.Fragment,null,n?a.a.createElement("span",{className:r.join(" ")}):null,t)},Ye={arrow:"dashicons-arrow-right-alt2",tick:"dashicons-yes",info:"dashicons-info",eye:"dashicons-visibility",cross:"dashicons-dismiss",update:"dashicons-update",updateSpinning:"dashicons-update ".concat($e.a.iconSpinning),link:"dashicons-external",plus:"dashicons-plus-alt",trash:"dashicons-trash",download:"dashicons-download",expand:"dashicons-editor-expand"};Qe.propTypes={label:c.a.string,icon:c.a.oneOf(Object.keys(Ye))},Qe.defaultProps={label:null,icon:null};var Xe=Qe,Ze=n(14),Ge=n.n(Ze);function Je(){return(Je=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function et(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var tt=function(e){var t=e.type,n=e.dataTestId,r=e.element,o=e.children,i=et(e,["type","dataTestId","element","children"]);return"button"===r?a.a.createElement("button",Je({className:Ge.a[t],"data-testid":n},i),o):"Link"===r?a.a.createElement(ye,Je({className:Ge.a[t],"data-testid":n},i),o):"a"===r?a.a.createElement("a",Je({className:Ge.a[t],"data-testid":n},i),o):"label"===r?a.a.createElement("label",Je({className:Ge.a[t],"data-testid":n},i),o):void 0};tt.propTypes={type:c.a.oneOf(["ghost","primary","secondary","warning","attention"]),dataTestId:c.a.string,element:c.a.oneOf(["button","a","Link","label"]).isRequired,children:c.a.node},tt.defaultProps={type:"ghost",dataTestId:null,children:null};var nt=tt,rt=function(e){var t=e.type,n=e.label,r=e.icon,o=e.onClick,i=e.disabled,l=e.dataTestId;return a.a.createElement(nt,{element:"button",type:t,onClick:o,disabled:i,dataTestId:l},a.a.createElement(Xe,{label:n,icon:r}))};rt.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,onClick:c.a.func,disabled:c.a.bool,dataTestId:c.a.string},rt.defaultProps={type:"ghost",label:null,icon:null,onClick:null,disabled:!1,dataTestId:null};var at=rt,ot=n(37),it=n.n(ot),lt=function(e){var t=e.children;return a.a.createElement("div",{className:it.a.wrapper},t)};function ut(e){return(ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return st(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ft=function(e){var t=e.error,n=ct(Object(r.useState)(!1),2),o=n[0],i=n[1];return a.a.createElement("div",{className:qe.a.debugWrapper},t.debug&&o?a.a.createElement("div",{className:qe.a.debugInformation},a.a.createElement("textarea",{className:qe.a.debugText,onClick:function(e){e.target.focus(),e.target.select()},defaultValue:"object"===ut(t.debug)?JSON.stringify(t.debug,null,"\t"):t.debug})):null,a.a.createElement("div",{className:qe.a.debugActions},a.a.createElement(lt,null,a.a.createElement(at,{icon:"update",label:"Refresh Page",onClick:function(e){return e.preventDefault(),window.location.reload(),!1}}),t.debug?a.a.createElement(at,{icon:"eye",label:o?"Hide Debug Details":"Show Debug Details",className:qe.a.buttonDebug,onClick:function(){i(!o)}}):null),"If this error continues please contact ",a.a.createElement("a",{href:"mailto:extensions@envato.com"},"extensions@envato.com"),"."))},dt=function(){var e=Ie(),t=e.errors,n=e.removeError;return t.length>0?a.a.createElement(a.a.Fragment,null,t.map((function(e){return"zip_failure"===e.code?a.a.createElement(Ue,{key:e.code,isOpen:!0,onCloseCallback:function(){n(e)}},a.a.createElement(Ke,{title:"Template Kit Install Error"}),a.a.createElement("p",{className:qe.a.copy},"There was an issue installing this template kit. Please try again."),e.message,a.a.createElement(ft,{error:e})):"generic_api_error"===e.code?a.a.createElement(Ue,{key:e.code,isOpen:!0,onCloseCallback:function(){n(e)}},a.a.createElement(Ke,{title:"Unexpected Error"}),a.a.createElement("p",{className:qe.a.copy},"Sorry there was an unexpected error from API call:"),e.message,a.a.createElement(ft,{error:e})):void 0}))):null},pt=n(4),mt=n.n(pt),ht=n(38),yt=n.n(ht);function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach((function(t){bt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wt=function(){var e=Object(r.useContext)(Ne),t=e.globalConfig,n=e.setConfigValue,a=function(e,r){var a=t[e]||[];n(e,gt(gt({},a),r))};return{getDownloadedItemId:function(e){return t.downloaded_items?t.downloaded_items[e]:null},addDownloadedItem:function(e){var t=e.humaneId,n=e.importedId;a("downloaded_items",bt({},t,n))},removeDownloadedItem:function(e){var n=e.importedId;Object.keys(t.downloaded_items).map((function(e){t.downloaded_items[e]===n&&delete t.downloaded_items[e]}))},subscriptionStatus:t.subscription_status,setSubscriptionStatus:function(e){n("subscription_status",e)},bannerHasBeenDismissed:function(e){a("dismissed_banners",bt({},e,!0))},isBannerDismissed:function(e){return t.dismissed_banners?t.dismissed_banners[e]:null},getConfigProjectName:function(){return t.project_name},setConfigProjectName:function(e){n("project_name",e)},getMagicButtonMode:function(){return t.magicButtonMode},setMagicButtonMode:function(e){n("magicButtonMode",e)},getElementsTokenUrl:function(){return t.elements_token_url},getApiUrl:function(){return t.api_url},getApiNonce:function(){return t.api_nonce},getReviewMode:function(){return t.review_mode}}};function Et(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Et(Object(n),!0).forEach((function(t){xt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Et(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function St(e,t,n,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,a)}function Ct(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){St(o,r,a,i,l,"next",e)}function l(e){St(o,r,a,i,l,"throw",e)}i(void 0)}))}}function Tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ot(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _t=function(e){var t=e.endpoint,n=e.args,a=void 0===n?{}:n,o=e.allowLongRunning,i=void 0!==o&&o,l=wt(),u=l.getApiUrl,c=l.getApiNonce,s=Tt(Object(r.useState)({loading:!0,data:null,error:null}),2),f=s[0],d=s[1],p=Ie().addError,m=t+JSON.stringify(a);return Object(r.useEffect)((function(){var e=new AbortController,n=e.signal;function r(){return(r=Ct(regeneratorRuntime.mark((function e(){var r,o,i,l,s,f,m,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(l in d((function(e){return{loading:!0,error:null,data:e.data}})),r=u()+t,o=kt(kt({},a),{},{_wpnonce:c()}),i=new FormData,o)i.append(l,o[l]);return s=null,e.prev=6,e.next=9,fetch(r,{method:"post",body:i,signal:n});case 9:return f=e.sent,e.next=12,f.clone().text();case 12:return s=e.sent,e.next=15,f.json();case 15:if(m=e.sent,f.ok){e.next=20;break}return m&&m.error&&m.error.code&&p(m.error.code,m.error.message,m),d({loading:!1,error:!0,data:m}),e.abrupt("return");case 20:d({loading:!1,error:null,data:m}),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(6),"AbortError"!==e.t0.name&&(h="".concat(e.t0,". ").concat(s?s.slice(0,200):""),p("generic_api_error",h,s),d({loading:!1,error:!0,data:e.t0.message}));case 26:case"end":return e.stop()}}),e,null,[[6,23]])})))).apply(this,arguments)}return function(){r.apply(this,arguments)}(),function(){i||e.abort()}}),[m]),f},Pt=function(e){var t=e.importedTemplateId;return"post.php?post=".concat(t,"&action=elementor")};function Nt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return jt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var It=function(e){var t=e.chosenFile,n=e.onComplete,r=_t({endpoint:"uploadTemplateKitZipFile",args:{file:t}}),a=r.loading,o=r.data,i=r.error;return!a&&!i&&o&&o.templateKitId&&setTimeout((function(){var e,t;n((e={importedTemplateKitId:o.templateKitId},t=e.importedTemplateKitId,"/template-kits/installed-kits/kit/".concat(t)))}),200),null},At=ie((function(e){var t=e.history,n=Nt(Object(r.useState)(null),2),o=n[0],i=n[1];return a.a.createElement(a.a.Fragment,null,a.a.createElement(nt,{element:"label",htmlFor:"upload-template-kit-zip-file"},a.a.createElement(Xe,{label:o?"Processing...":"Upload Template Kit (Zip File)",icon:"link"}),a.a.createElement("input",{type:"file",name:"upload-template-kit-zip-file",id:"upload-template-kit-zip-file",className:yt.a.formInput,onChange:function(e){i(e.target.files[0])}})),o?a.a.createElement(It,{chosenFile:o,onComplete:function(e){i(!1),t.push(e)}}):null)})),Mt=function(){return a.a.createElement("div",{className:mt.a.wrapper},a.a.createElement("div",{className:mt.a.logo},a.a.createElement(ye,{to:"/",className:mt.a.logoLink},"Envato")),a.a.createElement("nav",{className:mt.a.menu},a.a.createElement("ul",{className:mt.a.menuInner},a.a.createElement("li",{className:mt.a.menuItem},a.a.createElement(ye,{to:"/template-kits/installed-kits",className:"".concat(mt.a.menuLink," ").concat(ce({path:"/template-kits"})?mt.a.menuLinkActive:"")},"Template Kits"))),a.a.createElement("ul",{className:"".concat(mt.a.menuInner," ").concat(mt.a.menuRight)},a.a.createElement("li",{className:mt.a.menuItem},a.a.createElement(At,null)))))},Rt=function(e){var t=e.href,n=e.text,r=void 0===n?"Link":n;return a.a.createElement("a",{href:t,target:"_blank",rel:"noopener noreferrer"},r)},Ft=n(39),Dt=n.n(Ft),Lt=function(){return a.a.createElement("div",{className:Dt.a.footerBar},a.a.createElement("p",null,a.a.createElement("strong",null,"Feedback & Support: ")," If you have any questions or feedback for the team please send an email to"," ",a.a.createElement(Rt,{href:"mailto:extensions@envato.com",text:"extensions@envato.com"})," | ",a.a.createElement(Rt,{href:"https://envato.com/privacy?utm_source=extensions&utm_medium=referral&utm_campaign=template_kit_import_footer",text:"Privacy Policy"})," | ",a.a.createElement(Rt,{href:"https://help.market.envato.com/hc/en-us/sections/360007560992-Template-Kits?utm_source=extensions&utm_medium=referral&utm_campaign=template_kit_import_footer",text:"Help"})))},zt=function(e){return _t({endpoint:"fetchIndividualTemplates",args:e})},Ut=n(2),Wt=n.n(Ut);function Bt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Kt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bt(Object(n),!0).forEach((function(t){Ht(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Vt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $t=function(e){var t=e.requirement,n=e.completeCallback;if(!t)return Object(r.useEffect)((function(){n()}),[]),"Skipped";var o=function(e){var t={requirement:JSON.stringify(e)};return _t({endpoint:"installRequirement",args:t})}(t),i=o.loading,l=o.data,u=o.error;return Object(r.useEffect)((function(){i||n(u)}),[i]),a.a.createElement(a.a.Fragment,null,i?a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"dashicons dashicons-update ".concat(Wt.a.installingIcon)}),"Installing..."):null,u?a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"dashicons dashicons-no"}),l&&l.error?a.a.createElement(a.a.Fragment,null,l.error.data&&l.error.data.url?a.a.createElement("a",{href:l.error.data.url,target:"_blank",rel:"noopener noreferrer"},l.error.message):l.error.message):"Error"):null,i||u?null:a.a.createElement(a.a.Fragment,null,a.a.createElement("span",{className:"dashicons dashicons-yes-alt"}),"Success!"))},Qt=function(e){var t=e.previewCss,n=qt(Object(r.useState)(!1),2),o=n[0],i=n[1];return a.a.createElement(a.a.Fragment,null,o?a.a.createElement(Ue,{isOpen:!0,onCloseCallback:function(){return i(!1)}},a.a.createElement("code",{className:Wt.a.cssPreview},a.a.createElement("pre",null,t))):null," ",a.a.createElement("a",{href:"#",onClick:function(e){return e.preventDefault(),i(!0),!1}},"Preview CSS"))},Yt=function(e){var t=e.plugins,n=e.theme,o=e.settings,i=e.requiredCss,l=e.templateKitId,u=e.completeCallback,c=qt(Object(r.useState)(!1),2),s=c[0],f=c[1],d=qt(Object(r.useState)(null),2),p=d[0],m=d[1],h=qt(Object(r.useState)({}),2),y=h[0],v=h[1],g=function(){m((function(e){return e+1}))},b=[];t.forEach((function(e){"activated"!==e.status&&b.push({plugin:e})})),o.forEach((function(e){b.push({setting:e})})),i.forEach((function(e){b.push({requiredCss:Kt(Kt({},e),{},{templateKitId:l})})}));var w=b.length;if(0===w)return null;var E=function(e){return void 0===y[e]||y[e]};return a.a.createElement(a.a.Fragment,null,s?a.a.createElement(Ue,{isOpen:!0,onCloseCallback:u},a.a.createElement("div",null,a.a.createElement(Ke,{title:"Missing Requirements"}),a.a.createElement("p",{className:Wt.a.notice},"Please install and activate these missing requirements for this Template Kit to work correctly. We recommend checking with your web developer before applying these changes."),a.a.createElement("ul",{className:Wt.a.requirements},b.map((function(e,t){return a.a.createElement("li",{key:"requirement".concat(t),className:Wt.a.requirement},a.a.createElement("div",{className:Wt.a.checkbox},a.a.createElement("input",{type:"checkbox",id:"requirement".concat(t),name:"installRequirement[]",value:"1",disabled:null!==p,checked:E(t),onChange:function(e){var n=!!e.target.checked;v((function(e){return Kt(Kt({},e),{},Ht({},t,n))}))}})),a.a.createElement("div",{className:Wt.a.text},a.a.createElement("label",{htmlFor:"requirement".concat(t)},e.theme?"Theme: ".concat(e.theme.name):null,e.plugin?"Plugin: ".concat(e.plugin.name):null,e.setting?"Setting: ".concat(e.setting.name):null,e.requiredCss?a.a.createElement(a.a.Fragment,null,e.requiredCss.name,": ",e.requiredCss.description,a.a.createElement(Qt,{previewCss:e.requiredCss.css_preview})):null)),a.a.createElement("div",{className:Wt.a.status},p===t||p>t?a.a.createElement($t,{key:"installRequirement".concat(t),requirement:E(t)?e:null,completeCallback:g}):null))})),n?a.a.createElement("li",{className:Wt.a.requirement},a.a.createElement("div",{className:Wt.a.checkbox},a.a.createElement("span",{className:"dashicons dashicons-warning"})),a.a.createElement("div",{className:Wt.a.text},'FYI: This Template Kit has only been tested with the "',n.name,'" WordPress theme. ',a.a.createElement("br",null),"If the imported templates don’t look correct please read ",a.a.createElement(Rt,{href:"https://help.market.envato.com/hc/en-us/sections/360007560992-Template-Kits",text:"this article"}),".")):null),a.a.createElement("div",{className:Wt.a.footer},null===p?a.a.createElement(at,{type:"primary",icon:"plus",label:"Install Above Selected Requirements",onClick:function(){m(0)}}):a.a.createElement(a.a.Fragment,null,p>=w?a.a.createElement(a.a.Fragment,null,a.a.createElement("p",{className:Wt.a.notice},"Once the above is completed you can close this window."),a.a.createElement(at,{type:"primary",icon:"plus",label:"Close",onClick:u})):a.a.createElement("p",{className:Wt.a.notice},"Installing..."))))):null,a.a.createElement("div",{className:Wt.a.wrapper},a.a.createElement("div",{className:Wt.a.textWrapper},a.a.createElement("strong",null,"Attention!")," There are ",w," requirements that need installing for this Template Kit to work correctly."),a.a.createElement("div",{className:Wt.a.buttonWrapper},a.a.createElement(at,{type:"attention",label:"Install Requirements",icon:"info",onClick:function(){f(!0)}}))))};Yt.propTypes={plugins:c.a.arrayOf(c.a.shape({author:c.a.string,file:c.a.string,name:c.a.string,slug:c.a.string,status:c.a.string,url:c.a.string,version:c.a.string})),settings:c.a.arrayOf(c.a.shape({name:c.a.string,setting_name:c.a.string})),templateKitId:c.a.number.isRequired,completeCallback:c.a.func.isRequired},Yt.defaultProps={plugins:[],settings:[]};var Xt=Yt,Zt=n(26),Gt=n.n(Zt),Jt=function(){return a.a.createElement("div",{className:Gt.a.wrap},a.a.createElement("span",{className:Gt.a.inner,"aria-label":"Loading"}))},en=function(e){return _t({endpoint:"fetchInstalledTemplateKits",args:e})},tn=n(6),nn=n.n(tn),rn=function(e){var t=e.currentKitId,n=e.handleChangeKitId,r=en();return a.a.createElement(a.a.Fragment,null,!r.loading&&r.data&&r.data.length>1?a.a.createElement("div",{className:nn.a.currentKit},a.a.createElement("div",{className:nn.a.optionKitWrapper},a.a.createElement("div",{className:nn.a.optionKit},a.a.createElement("button",{className:"".concat(nn.a.optionKitLink," ").concat("all"===t?nn.a.optionKitLinkCurrent:""),onClick:function(){n("all")}},"All Kits")),r.data.map((function(e){return a.a.createElement("div",{className:nn.a.optionKit,key:e.id},a.a.createElement("button",{className:"".concat(nn.a.optionKitLink," ").concat(t===e.id?nn.a.optionKitLinkCurrent:""),onClick:function(){n(e.id)}},e.title))})))):null)};function an(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return on(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return on(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function on(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ln=function(e){var t=e.actionHook,n=e.LoadingButton,r=e.SuccessButton,a=e.ErrorButton,o=e.errorCallback,i=e.completeCallback,l=t(),u=l.loading,c=l.data,s=l.error;return u||s?s?(setTimeout((function(){o(c)}),100),a):n:(setTimeout((function(){i(c)}),500),r)},un=function(e){var t=e.DefaultButton,n=e.CompletedButton,o=e.LoadingButton,i=e.ErrorButton,l=e.SuccessButton,u=e.actionHook,c=e.isAlreadyCompleted,s=void 0!==c&&c,f=e.completedCallback,d=void 0===f?null:f,p=e.errorCallback,m=void 0===p?null:p,h=e.actionConfirmationMessage,y=void 0===h?null:h,v=an(Object(r.useState)(!1),2),g=v[0],b=v[1],w=an(Object(r.useState)(s),2),E=w[0],k=w[1],x=an(Object(r.useState)(null),2),S=x[0],C=x[1];return Object(r.useEffect)((function(){E&&d&&!s&&d(E)}),[E]),Object(r.useEffect)((function(){S&&m&&m(S)}),[S]),Object(r.useEffect)((function(){k(s)}),[s]),E?n:g?a.a.createElement(ln,{actionHook:u,LoadingButton:o,ErrorButton:i,SuccessButton:l,errorCallback:function(e){setTimeout((function(){b(!1)}),500),C(e)},completeCallback:function(e){b(!1),k(e)}}):a.a.cloneElement(t,{onClick:function(e){if(y&&!confirm(y))return e.preventDefault(),!1;b(!0)}})},cn=function(e){var t=e.templateKitId,n=e.customActionHook,r=void 0===n?null:n,o=e.completeCallback,i=void 0===o?null:o,l=e.errorCallback,u=void 0===l?null:l;return a.a.createElement(un,{DefaultButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash"}),actionConfirmationMessage:"Really delete this Template Kit?",LoadingButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash",disabled:!0}),ErrorButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash",disabled:!0}),SuccessButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash",disabled:!0}),CompletedButton:a.a.createElement(at,{type:"warning",label:"",icon:"trash"}),actionHook:function(){return r?r():_t({endpoint:"deleteTemplateKit",args:{templateKitId:t},allowLongRunning:!0})},isAlreadyCompleted:!1,completedCallback:function(){i&&i()},errorCallback:u})},sn=n(27),fn=n.n(sn),dn=function(e){var t=e.message;return a.a.createElement("div",{className:fn.a.message},a.a.createElement("p",{className:fn.a.copy},t))};dn.propTypes={message:c.a.string},dn.defaultProps={message:"Sorry there was an error loading this data. Please try again."};var pn=dn,mn=n(20),hn=n.n(mn),yn=function(e){var t=e.children,n=e.includeLastItemSpacer,r=void 0!==n&&n;return a.a.createElement("div",{className:hn.a.wrapper},a.a.createElement("div",{className:hn.a.inner},t,r?a.a.createElement("div",{className:hn.a.cardSpacing}):null))},vn=n(7),gn=n.n(vn);function bn(){return(bn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var En=function(e){var t=e.colWidthPercentage,n=void 0===t?20:t,r=e.children,o=e.className,i=wn(e,["colWidthPercentage","children","className"]),l=[gn.a.item];return 20===n&&l.push(gn.a.widthTwenty),25===n&&l.push(gn.a.widthTwentyFive),33===n&&l.push(gn.a.widthThirtyThree),40===n&&l.push(gn.a.widthFourty),50===n&&l.push(gn.a.widthFifty),60===n&&l.push(gn.a.widthSixty),100===n&&l.push(gn.a.widthFull),o&&l.push(o),a.a.createElement("div",bn({className:l.join(" ")},i),r)},kn=n(11),xn=n.n(kn),Sn=function(e){var t=e.Images,n=e.Buttons,r=e.title,o=e.description;return a.a.createElement("div",{className:xn.a.wrapper},a.a.createElement("div",{className:xn.a.inner},a.a.createElement("div",{className:xn.a.images},t),a.a.createElement("div",{className:xn.a.meta},a.a.createElement("h4",{className:xn.a.cardTitle},r),a.a.createElement("p",{className:xn.a.cardDescription},o),n)))};function Cn(){return(Cn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var On=function(e){var t=e.type,n=e.label,r=e.icon,o=e.href,i=e.openNewWindow,l=Tn(e,["type","label","icon","href","openNewWindow"]),u=i?{target:"_blank",rel:"noopener noreferrer"}:null;return a.a.createElement(nt,Cn({href:o,type:t,element:"a"},u,l),a.a.createElement(Xe,{label:n,icon:r}))};On.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,href:c.a.string.isRequired},On.defaultProps={type:"ghost",label:null,icon:null};var _n=On;function Pn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jn(e){return(jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function In(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?In(Object(n),!0).forEach((function(t){Mn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):In(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Mn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Rn=function(e){var t,n=e.image,a=e.templateKitName,o=e.completeCallback,i=(t=An(An({},n),{},{templateKitName:a}),_t({endpoint:"importElementorTemplateImage",args:t,allowLongRunning:!0})),l=i.loading,u=i.error,c=i.data;return Object(r.useEffect)((function(){!l&&!u&&c&&c.id&&o()}),[l]),null},Fn=function(e){var t=e.templateData,n=e.progressCallback,o=e.completeCallback,i=Pn(Object(r.useState)(0),2),l=i[0],u=i[1],c=Pn(Object(r.useState)(null),2),s=c[0],f=c[1];Object(r.useEffect)((function(){f(function(e){var t=[];return function e(n){n&&Object.keys(n).forEach((function(r){n[r]&&n[r].url&&n[r].id&&t.push(n[r]),("object"===jn(n[r])||Array.isArray(n[r]))&&e(n[r])}))}(e.content),t}(t))}),[]);var d=function(){u((function(e){return e+1}))};return Object(r.useEffect)((function(){l&&l>0&&s&&s.length>0&&(n(Math.round(l/(s.length+2)*100)/100),l===s.length&&(u(null),o()))}),[l]),Object(r.useEffect)((function(){null!==s&&0===s.length&&(n(.5),o())}),[s]),null===s?null:a.a.createElement(a.a.Fragment,null,s.map((function(e,n){return a.a.createElement(a.a.Fragment,{key:"importImage".concat(n)},l===n||l>n?a.a.createElement(Rn,{key:"importImageBackground".concat(n),image:e,templateKitName:t.template_kit_name,completeCallback:d}):null)})))};Fn.propTypes={templateData:c.a.shape({author:c.a.string,file:c.a.string}).isRequired,completeCallback:c.a.func.isRequired};var Dn=Fn;function Ln(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Un=function(e){var t=e.templateKitId,n=e.templateId,a=e.importAgain,o=e.insertToPage,i=e.completeCallback,l=_t({endpoint:"importSingleTemplate",args:{templateKitId:t,templateId:n,importAgain:a,insertToPage:o},allowLongRunning:!0}),u=l.loading,c=l.error,s=l.data;return Object(r.useEffect)((function(){!u&&!c&&s&&s.imported_template_id&&i(s)}),[u]),null},Wn=function(e){var t=e.templateKitId,n=e.templateId,a=e.completeCallback,o=_t({endpoint:"getSingleTemplateImportData",args:{templateKitId:t,templateId:n},allowLongRunning:!0}),i=o.loading,l=o.error,u=o.data;return Object(r.useEffect)((function(){!i&&!l&&u&&u.template_data&&a(u.template_data)}),[i]),null},Bn=function(e){var t=e.templateKitId,n=e.templateId,o=e.existingImports,i=void 0===o?[]:o,l=(0,wt().getMagicButtonMode)(),u=l&&"elementorMagicButton"===l.mode,c=Ln(Object(r.useState)(u?null:i.length?i[0].imported_template_id:null),2),s=c[0],f=c[1],d=Ln(Object(r.useState)(null),2),p=d[0],m=d[1],h=Ln(Object(r.useState)(0),2),y=h[0],v=h[1],g=Ln(Object(r.useState)("idle"),2),b=g[0],w=g[1],E=Ln(Object(r.useState)(!1),2),k=E[0],x=E[1],S=s?a.a.createElement(at,{type:"ghost",label:"Import Again",icon:"plus",onClick:function(){v(0),x(!0),w("importingFetchJsonData")}}):a.a.createElement(at,{type:"primary",label:u?"Insert Template":"Import Template",icon:"plus",onClick:function(){v(0),w("importingFetchJsonData")}}),C=a.a.createElement(at,{type:"primary",label:"Importing ".concat(Math.round(100*y),"%"),icon:"updateSpinning",disabled:!0}),T=a.a.createElement(_n,{href:Pt({importedTemplateId:s}),type:"primary",label:"View Template",icon:"eye",openNewWindow:!0});return a.a.createElement(a.a.Fragment,null,s?T:null,"idle"===b?S:null,"importingFetchJsonData"===b||"importingImages"===b||"importingTemplate"===b?C:null,"importingFetchJsonData"===b?a.a.createElement(Wn,{templateKitId:t,templateId:n,completeCallback:function(e){m(e),w("importingImages")}}):null,"importingImages"===b?a.a.createElement(Dn,{templateData:p,progressCallback:function(e){v(e)},completeCallback:function(){w("importingTemplate")}}):null,"importingTemplate"===b?a.a.createElement(Un,{templateKitId:t,templateId:n,importAgain:k,insertToPage:u,completeCallback:function(e){e&&e.imported_template_id&&(v(1),setTimeout((function(){f(e.imported_template_id),w("idle")}),300),u&&l.insertCallback&&"function"==typeof l.insertCallback&&l.insertCallback(e))}}):null)},Kn=n(28),Hn=n.n(Kn),qn=function(){return a.a.createElement("div",{className:Hn.a.svgWrapper},a.a.createElement("svg",{className:Hn.a.svgEnvatoLogo,xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",fill:"none",viewBox:"0 0 27 31"},a.a.createElement("path",{fill:"#fff",d:"M23.64 1.318C19.45-3.592 5.89 5.918 6 18.178a.58.58 0 01-.57.57.58.58 0 01-.49-.28 13.13 13.13 0 01-.52-9.65.53.53 0 00-.9-.52A13 13 0 000 17.188a13 13 0 0013.15 13.15c18.5-.42 14.23-24.64 10.49-29.02z"})))},Vn=n(8),$n=n.n(Vn);function Qn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Yn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yn(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Xn={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999},content:{background:"#f1f1f1",border:"0",top:"50%",left:"50%",right:"auto",bottom:"auto",marginRight:"-50%",padding:"0",transform:"translate(-50%, -50%)",borderRadius:"4px"}},Zn=function(e){var t=e.isOpen,n=e.onCloseCallback,o=void 0===n?null:n,i=e.children,l=e.templatePreviewTitle,u=e.templateId,c=e.templateKitId,s=e.existingImports,f=Qn(a.a.useState(!1),2),d=f[0],p=f[1],m=function(){p(!1),o&&o()};return Object(r.useEffect)((function(){t&&p(!0)}),[t]),"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Me.a.setAppElement(window.templateKitImport.modalAppHolder),a.a.createElement(Me.a,{isOpen:d,onRequestClose:m,style:Xn,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:$n.a.modalInner},a.a.createElement("div",{className:$n.a.modalHeader},a.a.createElement("div",{className:$n.a.modalLogo},a.a.createElement(qn,null)),a.a.createElement("div",{className:$n.a.headerTitle},l),a.a.createElement("div",{className:$n.a.headerActions},a.a.createElement(Bn,{templateKitId:c,templateId:u,existingImports:s}),a.a.createElement("button",{onClick:m,"data-testid":"modal-close-button",className:$n.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat($n.a.dismissIcon)})))),a.a.createElement("div",{className:$n.a.kitInner},"function"==typeof i?i({closeModal:m}):i)))},Gn=n(29),Jn=n.n(Gn);function er(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return tr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return tr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var nr=function(e){var t=e.onCloseCallback,n=e.templateId,o=e.templateKitId,i=e.existingImports,l=e.templateScreenShotUrl,u=e.templatePreviewTitle,c=e.installRequirements,s=ue().id,f=er(Object(r.useState)(null),2),d=f[0],p=f[1],m=zt({id:s,refresh:d});return a.a.createElement(Zn,{templateId:n,templateKitId:o,existingImports:i,templatePreviewTitle:u,isOpen:!0,onCloseCallback:t},c&&!m.loading&&!m.error&&m.data?a.a.createElement("div",{className:Jn.a.missingRequirementsWrapper},a.a.createElement(Xt,{settings:m.data.requirements.settings,theme:m.data.requirements.theme,plugins:m.data.requirements.plugins,requiredCss:m.data.requirements.css,templateKitId:s,completeCallback:function(){p((new Date).getTime())}})):null,a.a.createElement("img",{className:Jn.a.previewTemplate,src:l,alt:u}))},rr=n(15),ar=n.n(rr);function or(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return ir(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ir(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var lr=function(e){var t=e.template,n=or(Object(r.useState)(!1),2),o=n[0],i=n[1],l=Object(r.useRef)(null),u=t.id,c=t.template_kit_id,s=t.name,f=t.screenshot_url,d=t.imports,p=or(Object(r.useState)(t.unmet_requirements&&t.unmet_requirements.length>0),2),m=p[0],h=p[1],y=t.metadata.additional_template_information?t.metadata.additional_template_information.join(" "):"";return a.a.createElement(En,{colWidthPercentage:33,key:u},a.a.createElement(Sn,{Images:a.a.createElement("div",{className:ar.a.imageWrapper},a.a.createElement("img",{src:f,alt:s,className:ar.a.image}),a.a.createElement("div",{className:ar.a.expandButton,ref:l,onClick:function(e){e.target===l.current&&i(!0)}},o?a.a.createElement(nr,{templateScreenShotUrl:f,templatePreviewTitle:s,templateKitId:c,templateId:u,existingImports:d,onCloseCallback:function(){i(!1)}}):null,a.a.createElement(at,{type:"ghost",icon:"expand",onClick:function(){i(!0)}}))),Buttons:a.a.createElement(a.a.Fragment,null,m?a.a.createElement(a.a.Fragment,null,a.a.createElement("p",{className:ar.a.unmetRequirementsMessage},t.unmet_requirements.join(" ")),a.a.createElement(at,{type:"warning",label:"Ignore Requirements",icon:"cross",onClick:function(){return h(!1)}})):a.a.createElement(lt,null,a.a.createElement(Bn,{templateKitId:c,templateId:u,existingImports:d}))),title:s,description:y}))},ur=function(e){var t=e.templates;return a.a.createElement(yn,{includeLastItemSpacer:!0},t.map((function(e){return a.a.createElement(lr,{key:e.id,template:e})})))},cr=n(21),sr=n.n(cr);function fr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return dr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pr=ie((function(e){var t=e.history,n=ue().id,o=ce().path,i=fr(Object(r.useState)(null),2),l=i[0],u=i[1],c=zt({id:n,refresh:l}),s=fr(Object(r.useState)(!1),2),f=s[0],d=s[1];return a.a.createElement(a.a.Fragment,null,c.loading?a.a.createElement(Jt,null):null,c.error?a.a.createElement(pn,null):null,f?a.a.createElement(Y,{to:"/template-kits/installed-kits"}):null,c.loading||c.error||!c.data?null:a.a.createElement("div",null,c.data.requirements?a.a.createElement("div",{className:sr.a.missingRequirementsWrapper},a.a.createElement(Xt,{settings:c.data.requirements.settings,theme:c.data.requirements.theme,plugins:c.data.requirements.plugins,requiredCss:c.data.requirements.css,templateKitId:n,completeCallback:function(){u((new Date).getTime())}})):null,a.a.createElement("div",{className:sr.a.headerWrapper},a.a.createElement(Ke,{title:c.data.title}),a.a.createElement(rn,{currentKitId:c.data.id,handleChangeKitId:function(e){t.push(o.replace(":id",e))}}),a.a.createElement("div",{className:sr.a.deleteKitWrapper},a.a.createElement(cn,{templateKitId:c.data.id,completeCallback:function(){d(!0)}}))),a.a.createElement(ur,{templates:c.data.templates})))})),mr=function(e){var t=e.type,n=e.label,r=e.icon,o=e.href;return a.a.createElement(nt,{element:"Link",to:o,type:t},a.a.createElement(Xe,{label:n,icon:r}))};mr.propTypes={type:c.a.string,label:c.a.string,icon:c.a.string,href:c.a.string.isRequired},mr.defaultProps={type:"ghost",label:null,icon:null};var hr=mr,yr=n(16),vr=n.n(yr);function gr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return br(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var wr=function(e){var t=e.item,n=ce().url,o=gr(Object(r.useState)(!1),2),i=o[0],l=o[1],u=wt().getReviewMode;return i?null:a.a.createElement(En,{colWidthPercentage:33,className:vr.a.itemCard},a.a.createElement(Sn,{Images:a.a.createElement(ye,{to:"".concat(n,"/kit/").concat(t.id),className:vr.a.itemImageLink},a.a.createElement("img",{src:t.screenshot_url,alt:t.title,className:vr.a.itemImage})),Buttons:a.a.createElement(lt,null,a.a.createElement(hr,{type:"primary",label:"View Installed Kit",icon:"plus",href:"".concat(n,"/kit/").concat(t.id)}),u()?a.a.createElement(_n,{href:"admin.php?page=template-kit-review&template_kit_id=".concat(t.id),type:"primary",openNewWindow:!0,label:"Review",icon:"eye"}):null,a.a.createElement("div",{className:vr.a.itemDelete},a.a.createElement(cn,{templateKitId:t.id,completeCallback:function(){l(!0)}}))),title:t.title,description:"Contains ".concat(t.template_count," templates")}))},Er=n(12),kr=n.n(Er);function xr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Sr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Sr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Cr=function(e){e.item;var t=xr(Object(r.useState)(null),2),n=t[0],o=t[1];return a.a.createElement(En,{colWidthPercentage:33},a.a.createElement("div",{className:kr.a.uploadCard},a.a.createElement("label",{htmlFor:"upload-template-kit-zip-file",className:kr.a.uploadCardButton},n?a.a.createElement(Jt,null):a.a.createElement("span",{className:kr.a.icon}),a.a.createElement("div",{className:kr.a.message},"Upload Template Kit ZIP File"),a.a.createElement("input",{type:"file",name:"upload-template-kit-zip-file",id:"upload-template-kit-zip-file",className:kr.a.formInput,onChange:function(e){o(e.target.files[0])}})),n?a.a.createElement(It,{chosenFile:n}):null))},Tr=function(){var e=en(),t=e.loading,n=e.data,r=e.error;return a.a.createElement(a.a.Fragment,null,a.a.createElement("div",null,a.a.createElement(Ke,{title:"Installed Template Kits",subtitle:"These are the Template Kits installed on this WordPress website."})),t?a.a.createElement(Jt,null):null,r?a.a.createElement(pn,null):null,t||r||0!==n.length?null:a.a.createElement(pn,{message:a.a.createElement(a.a.Fragment,null,"No installed Template Kits found. Please"," ",a.a.createElement(Rt,{href:"https://themeforest.net/category/template-kits?utm_source=extensions&utm_medium=referral&utm_campaign=template_kit_import_plugin",text:"click here to view available premium Template Kits"})," "," or upload a new Template Kit ZIP file below.")}),t||r?null:a.a.createElement(yn,{includeLastItemSpacer:!0},n.map((function(e){return a.a.createElement(wr,{key:e.id,item:e})})),a.a.createElement(Cr,null)))},Or=function(){var e=ce().url;return a.a.createElement(oe,null,a.a.createElement(J,{path:"".concat(e,"/kit/:id"),children:a.a.createElement(pr,null)}),a.a.createElement(J,{children:a.a.createElement(Tr,null)}))},_r=function(){var e=ce().url;return a.a.createElement(a.a.Fragment,null,a.a.createElement(oe,null,a.a.createElement(J,{path:"".concat(e,"/installed-kits"),children:a.a.createElement(Or,null)}),a.a.createElement(J,null,a.a.createElement(Y,{to:"/template-kits/installed-kits"}))))},Pr=n(30),Nr=n.n(Pr),jr=function(){return a.a.createElement("div",{className:Nr.a.wrapper},a.a.createElement(je,null,a.a.createElement(Se,null,a.a.createElement(se,null,a.a.createElement(dt,null),a.a.createElement(Mt,null),a.a.createElement("div",{className:Nr.a.container},a.a.createElement(oe,null,a.a.createElement(J,{exact:!0,path:"/"},a.a.createElement(Y,{to:"/template-kits/installed-kits"})),a.a.createElement(J,{path:"/template-kits",children:a.a.createElement(_r,null)}))),a.a.createElement(Lt,null)))))},Ir=n(9),Ar=n.n(Ir);function Mr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,a=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(a)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Rr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rr(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Fr={overlay:{backgroundColor:"rgba(32, 32, 32, 0.81)",zIndex:199999,display:"flex",justifyContent:"center",alignItems:"center"},content:{background:"#f1f1f1",border:"0",padding:"0",right:"auto",bottom:"auto",top:"auto",left:"auto",borderRadius:"4px"}},Dr=function(e){e.photoId,e.photoTitle;var t=e.onCloseCallback,n=void 0===t?null:t,r=e.children,o=Mr(a.a.useState(!0),2),i=o[0],l=o[1],u=function(){l(!1),n&&n()};return"undefined"!=typeof window&&window.templateKitImport&&window.templateKitImport.modalAppHolder&&Me.a.setAppElement(window.templateKitImport.modalAppHolder),a.a.createElement(Me.a,{isOpen:i,onRequestClose:u,style:Fr,contentLabel:"Envato Elements","data-testid":"modal-wrapper"},a.a.createElement("div",{className:Ar.a.modalInner},a.a.createElement("div",{className:Ar.a.modalHeader},a.a.createElement("div",{className:Ar.a.modalLogo},a.a.createElement(qn,null)),a.a.createElement("div",{className:Ar.a.headerNav}),a.a.createElement("div",{className:Ar.a.headerActions},a.a.createElement("button",{onClick:u,"data-testid":"modal-close-button",className:Ar.a.closeButton},a.a.createElement("span",{className:"dashicons dashicons-no-alt ".concat(Ar.a.dismissIcon)})))),a.a.createElement("div",{className:Ar.a.magicModalInner},"function"==typeof r?r({closeModal:u}):r)))};function Lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lr(Object(n),!0).forEach((function(t){Ur(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ur(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wr=function(e){var t=e.onClose,n=e.magicButtonMode;return a.a.createElement(je,{config:zr(zr({},window.template_kit_import),{},{magicButtonMode:n})},a.a.createElement(Se,null,a.a.createElement(H,null,a.a.createElement(dt,null),a.a.createElement(Dr,{onCloseCallback:t},a.a.createElement(oe,null,a.a.createElement(J,{exact:!0,path:"/"},a.a.createElement(Y,{to:"/template-kits/installed-kits"})),a.a.createElement(J,{path:"/template-kits",children:a.a.createElement(_r,null)}))))))};window.templateKitImport={modalAppHolder:null},window.templateKitImport.initBackend=function(e){window.templateKitImport.modalAppHolder=e,i.a.render(a.a.createElement(jr,null),e)},window.templateKitImport.initMagicButton=function(e,t){window.templateKitImport.modalAppHolder=e,i.a.render(a.a.createElement(Wr,{magicButtonMode:t,onClose:function(){window.templateKitImport.closeMagicButton(e)}}),e)},window.templateKitImport.closeMagicButton=function(e){i.a.unmountComponentAtNode(e)}}]);
inc/api/class-template-kit-import.php CHANGED
@@ -244,6 +244,8 @@ class Template_Kit_Import extends API {
244
  */
245
  public function import_elementor_template_image( $request ) {
246
 
 
 
247
  $image_id = (int) $request->get_param( 'id' );
248
  $provided_url = $request->get_param( 'url' );
249
  $kit_name = $request->get_param( 'templateKitName' );
244
  */
245
  public function import_elementor_template_image( $request ) {
246
 
247
+ Limits::get_instance()->raise_limits();
248
+
249
  $image_id = (int) $request->get_param( 'id' );
250
  $provided_url = $request->get_param( 'url' );
251
  $kit_name = $request->get_param( 'templateKitName' );
inc/utils/class-limits.php CHANGED
@@ -23,11 +23,15 @@ if ( ! defined( 'ABSPATH' ) ) {
23
  class Limits extends Base {
24
 
25
  /**
26
- * We raise our memory and timeout limits during import because
27
  * some operations take a lot of processing (i.e. large images in Template Kits).
28
  */
29
  public function raise_limits() {
30
 
 
 
 
 
31
  // WordPress has a built in way to raise the memory limit thankfully:
32
  wp_raise_memory_limit( 'admin' );
33
 
23
  class Limits extends Base {
24
 
25
  /**
26
+ * We raise our memory, timeout limits and image threshold during import because
27
  * some operations take a lot of processing (i.e. large images in Template Kits).
28
  */
29
  public function raise_limits() {
30
 
31
+ // WordPress added a size threshold when uploading images in 5.3.0. Adding This filter
32
+ // will remove that threshold. Reference - https://developer.wordpress.org/reference/hooks/big_image_size_threshold/.
33
+ add_filter( 'big_image_size_threshold', '__return_false' );
34
+
35
  // WordPress has a built in way to raise the memory limit thankfully:
36
  wp_raise_memory_limit( 'admin' );
37
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: elementor, template, templates
4
  Requires at least: 5.3
5
  Tested up to: 5.5
6
  Requires PHP: 5.6
7
- Stable tag: 1.0.9
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -36,6 +36,10 @@ Create your own "Template Kit" for others with the "[Template Kit Export](https:
36
 
37
  == Changelog ==
38
 
 
 
 
 
39
  = 1.0.9 - 2020-08-28 =
40
  * Fix: Better support for RTL text direction
41
  * Fix: Better handling of Global Kit Site Styles
4
  Requires at least: 5.3
5
  Tested up to: 5.5
6
  Requires PHP: 5.6
7
+ Stable tag: 1.0.10
8
  License: GPLv3
9
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
 
36
 
37
  == Changelog ==
38
 
39
+ = 1.0.10 - 2020-11-09 =
40
+ * Fix: Bug where UI not updated if template kit is already imported allowing duplicate imports
41
+ * Disable: WP big image size threshold to allow larger images
42
+
43
  = 1.0.9 - 2020-08-28 =
44
  * Fix: Better support for RTL text direction
45
  * Fix: Better handling of Global Kit Site Styles
src/js/react/components/Contexts/GlobalConfigProvider.jsx CHANGED
@@ -15,6 +15,11 @@ export default function GlobalConfigProvider ({ children, config = {} }) {
15
  ...globalConfig,
16
  [key]: value
17
  }))
 
 
 
 
 
18
  }
19
 
20
  const contextValue = {
15
  ...globalConfig,
16
  [key]: value
17
  }))
18
+ // We also update the global window settings object so our magic button works successfully between reloads.
19
+ // Without this when in the Elementor magic button it doesn't remember which templates we have installed between modal loads.
20
+ if (window.envato_elements) {
21
+ window.envato_elements[key] = value
22
+ }
23
  }
24
 
25
  const contextValue = {
template-kit-import.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Import Template Kits to WordPress
5
  * Author: Envato
6
  * Author URI: https://envato.com
7
- * Version: 1.0.9
8
  * License: GPLv3 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  *
@@ -28,7 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
28
  }
29
 
30
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_SLUG', 'template-kit-import' );
31
- define( 'ENVATO_TEMPLATE_KIT_IMPORT_VER', '1.0.9' );
32
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_FILE', __FILE__ );
33
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_DIR', plugin_dir_path( ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
34
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_URI', plugins_url( '/', ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
4
  * Description: Import Template Kits to WordPress
5
  * Author: Envato
6
  * Author URI: https://envato.com
7
+ * Version: 1.0.10
8
  * License: GPLv3 or later
9
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
10
  *
28
  }
29
 
30
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_SLUG', 'template-kit-import' );
31
+ define( 'ENVATO_TEMPLATE_KIT_IMPORT_VER', '1.0.10' );
32
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_FILE', __FILE__ );
33
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_DIR', plugin_dir_path( ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );
34
  define( 'ENVATO_TEMPLATE_KIT_IMPORT_URI', plugins_url( '/', ENVATO_TEMPLATE_KIT_IMPORT_FILE ) );