File manager - Edit - /home/vblioqus/dlskitsurl.com/wp-content/plugins/gp-premium/dist/site-library.js
Back
(()=>{var e={703:(e,t,r)=>{"use strict";var n=r(414);function a(){}function s(){}s.resetWarningCache=a,e.exports=function(){function e(e,t,r,a,s,i){if(i!==n){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:a};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},216:(e,t,r)=>{"use strict";t.be=void 0;var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(196),s=u(a),i=u(r(697)),l=r(81),o=u(r(315)),p=u(r(282)),c=u(r(821));function u(e){return e&&e.__esModule?e:{default:e}}var m="data-lazyload-listened",d=[],g=[],f=!1;try{var h=Object.defineProperty({},"passive",{get:function(){f=!0}});window.addEventListener("test",null,h)}catch(e){}var b=!!f&&{capture:!1,passive:!0},v=function(e){var t=e.ref;if(t instanceof HTMLElement){var r=(0,o.default)(t),n=e.props.overflow&&r!==t.ownerDocument&&r!==document&&r!==document.documentElement?function(e,t){var r=e.ref,n=void 0,a=void 0,s=void 0,i=void 0;try{var l=t.getBoundingClientRect();n=l.top,a=l.left,s=l.height,i=l.width}catch(e){n=0,a=0,s=0,i=0}var o=window.innerHeight||document.documentElement.clientHeight,p=window.innerWidth||document.documentElement.clientWidth,c=Math.max(n,0),u=Math.max(a,0),m=Math.min(o,n+s)-c,d=Math.min(p,a+i)-u,g=void 0,f=void 0,h=void 0,b=void 0;try{var v=r.getBoundingClientRect();g=v.top,f=v.left,h=v.height,b=v.width}catch(e){g=0,f=0,h=0,b=0}var y=g-c,_=f-u,E=Array.isArray(e.props.offset)?e.props.offset:[e.props.offset,e.props.offset];return y-E[0]<=m&&y+h+E[1]>=0&&_-E[0]<=d&&_+b+E[1]>=0}(e,r):function(e){var t=e.ref;if(!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))return!1;var r=void 0,n=void 0;try{var a=t.getBoundingClientRect();r=a.top,n=a.height}catch(e){r=0,n=0}var s=window.innerHeight||document.documentElement.clientHeight,i=Array.isArray(e.props.offset)?e.props.offset:[e.props.offset,e.props.offset];return r-i[0]<=s&&r+n+i[1]>=0}(e);n?e.visible||(e.props.once&&g.push(e),e.visible=!0,e.forceUpdate()):e.props.once&&e.visible||(e.visible=!1,e.props.unmountIfInvisible&&e.forceUpdate())}},y=function(){for(var e=0;e<d.length;++e){var t=d[e];v(t)}g.forEach((function(e){var t=d.indexOf(e);-1!==t&&d.splice(t,1)})),g=[]},_=void 0,E=null,w=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.visible=!1,r.setRef=r.setRef.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidMount",value:function(){var e=window,t=this.props.scrollContainer;t&&"string"==typeof t&&(e=e.document.querySelector(t));var r=void 0!==this.props.debounce&&"throttle"===_||"debounce"===_&&void 0===this.props.debounce;if(r&&((0,l.off)(e,"scroll",E,b),(0,l.off)(window,"resize",E,b),E=null),E||(void 0!==this.props.debounce?(E=(0,p.default)(y,"number"==typeof this.props.debounce?this.props.debounce:300),_="debounce"):void 0!==this.props.throttle?(E=(0,c.default)(y,"number"==typeof this.props.throttle?this.props.throttle:300),_="throttle"):E=y),this.props.overflow){var n=(0,o.default)(this.ref);if(n&&"function"==typeof n.getAttribute){var a=+n.getAttribute(m)+1;1===a&&n.addEventListener("scroll",E,b),n.setAttribute(m,a)}}else if(0===d.length||r){var s=this.props,i=s.scroll,u=s.resize;i&&(0,l.on)(e,"scroll",E,b),u&&(0,l.on)(window,"resize",E,b)}d.push(this),v(this)}},{key:"shouldComponentUpdate",value:function(){return this.visible}},{key:"componentWillUnmount",value:function(){if(this.props.overflow){var e=(0,o.default)(this.ref);if(e&&"function"==typeof e.getAttribute){var t=+e.getAttribute(m)-1;0===t?(e.removeEventListener("scroll",E,b),e.removeAttribute(m)):e.setAttribute(m,t)}}var r=d.indexOf(this);-1!==r&&d.splice(r,1),0===d.length&&"undefined"!=typeof window&&((0,l.off)(window,"resize",E,b),(0,l.off)(window,"scroll",E,b))}},{key:"setRef",value:function(e){e&&(this.ref=e)}},{key:"render",value:function(){var e=this.props,t=e.height,r=e.children,n=e.placeholder,a=e.className,i=e.classNamePrefix,l=e.style;return s.default.createElement("div",{className:i+"-wrapper "+a,ref:this.setRef,style:l},this.visible?r:n||s.default.createElement("div",{style:{height:t},className:i+"-placeholder"}))}}]),t}(a.Component);w.propTypes={className:i.default.string,classNamePrefix:i.default.string,once:i.default.bool,height:i.default.oneOfType([i.default.number,i.default.string]),offset:i.default.oneOfType([i.default.number,i.default.arrayOf(i.default.number)]),overflow:i.default.bool,resize:i.default.bool,scroll:i.default.bool,children:i.default.node,throttle:i.default.oneOfType([i.default.number,i.default.bool]),debounce:i.default.oneOfType([i.default.number,i.default.bool]),placeholder:i.default.node,scrollContainer:i.default.oneOfType([i.default.string,i.default.object]),unmountIfInvisible:i.default.bool,style:i.default.object},w.defaultProps={className:"",classNamePrefix:"lazyload",once:!1,offset:0,overflow:!1,resize:!1,scroll:!0,unmountIfInvisible:!1},t.ZP=w,t.be=y},282:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n=void 0,a=void 0,s=void 0,i=void 0,l=void 0,o=function o(){var p=+new Date-i;p<t&&p>=0?n=setTimeout(o,t-p):(n=null,r||(l=e.apply(s,a),n||(s=null,a=null)))};return function(){s=this,a=arguments,i=+new Date;var p=r&&!n;return n||(n=setTimeout(o,t)),p&&(l=e.apply(s,a),s=null,a=null),l}}},81:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.on=function(e,t,r,n){n=n||!1,e.addEventListener?e.addEventListener(t,r,n):e.attachEvent&&e.attachEvent("on"+t,(function(t){r.call(e,t||window.event)}))},t.off=function(e,t,r,n){n=n||!1,e.removeEventListener?e.removeEventListener(t,r,n):e.detachEvent&&e.detachEvent("on"+t,r)}},315:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!(e instanceof HTMLElement))return document.documentElement;for(var t="absolute"===e.style.position,r=/(scroll|auto)/,n=e;n;){if(!n.parentNode)return e.ownerDocument||document.documentElement;var a=window.getComputedStyle(n),s=a.position,i=a.overflow,l=a["overflow-x"],o=a["overflow-y"];if("static"===s&&t)n=n.parentNode;else{if(r.test(i)&&r.test(l)&&r.test(o))return n;n=n.parentNode}}return e.ownerDocument||e.documentElement||document.documentElement}},821:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n,a;return t||(t=250),function(){var s=r||this,i=+new Date,l=arguments;n&&i<n+t?(clearTimeout(a),a=setTimeout((function(){n=i,e.apply(s,l)}),t)):(n=i,e.apply(s,l))}}},196:e=>{"use strict";e.exports=window.React}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(196);const t=window.wp.element,n=window.wp.i18n,a=window.wp.components,s=window.wp.htmlEntities,i=window.wp.apiFetch;var l=r.n(i),o=r(216);function p(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=p(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const c=function(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=p(e))&&(n&&(n+=" "),n+=t);return n};function u(e,t,r){const n=r&&r.lexicographical,a=r&&r.zeroExtend;let s=e.split("."),i=t.split(".");function l(e){return(n?/^\d+[A-Za-z]*$/:/^\d+$/).test(e)}if(!s.every(l)||!i.every(l))return NaN;if(a){for(;s.length<i.length;)s.push("0");for(;i.length<s.length;)i.push("0")}n||(s=s.map(Number),i=i.map(Number));for(let e=0;e<s.length;++e){if(i.length===e)return 1;if(s[e]!==i[e])return s[e]>i[e]?1:-1}return s.length!==i.length?-1:0}function m({allSites:t,value:r,onChange:s}){if(!t)return null;const i=[""];return Object.keys(t).forEach((e=>{t[e].category.forEach((e=>{i.includes(e)||i.push(e)}))})),i.length<2?null:(0,e.createElement)("div",{className:"generatepress-site-library-filter--categories"},i.map((t=>(0,e.createElement)(a.Button,{key:t,variant:t===r?"primary":"",onClick:()=>s(t)},""===t?(0,n.__)("All","gp-premium"):t))))}function d({onChange:t,value:r}){return(0,e.createElement)("div",null,(0,e.createElement)("input",{type:"search",onChange:e=>t(e?.target?.value),value:r,placeholder:(0,n.__)("Search site name or author","gp-premium")}))}function g({value:t,onChange:r}){return(0,e.createElement)("div",{className:"gpp-premium-filter"},(0,e.createElement)(a.Button,{variant:"gp-one"===t?"primary":"",onClick:()=>r("gp-one")},(0,n.__)("GP One","gp-premium")),(0,e.createElement)(a.Button,{variant:"gp-premium"===t?"primary":"",onClick:()=>r("gp-premium")},(0,n.__)("GP Premium","gp-premium")))}function f({children:t,shouldRender:r=!0}){return r?(0,e.createElement)("div",{className:"generatepress-site-library-content"},t):null}function h({url:r,previewWidth:n}){const a=(0,t.useRef)(null);return(0,t.useEffect)((()=>{const e=a.current.attachShadow({mode:"open"}),t=document.createElement("iframe");return t.src=r,t.style.width="100%",t.style.height="100%",t.style.border="none",e.appendChild(t),()=>{e.removeChild(t)}}),[r]),(0,e.createElement)("div",{style:{width:n},ref:a})}function b({device:t,setDevice:r}){return(0,e.createElement)("div",{className:"generatepress-site-library-footer"},(0,e.createElement)(a.Tooltip,{text:(0,n.__)("Preview desktop","gp-premium")},(0,e.createElement)(a.Button,{variant:"desktop"===t?"primary":"",onClick:()=>{r("desktop")}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M21 14H3V4h18m0-2H3c-1.11 0-2 .89-2 2v12a2 2 0 002 2h7l-2 3v1h8v-1l-2-3h7a2 2 0 002-2V4a2 2 0 00-2-2z",fill:"currentColor"})))),(0,e.createElement)(a.Tooltip,{text:(0,n.__)("Preview tablet","gp-premium")},(0,e.createElement)(a.Button,{variant:"tablet"===t?"primary":"",onClick:()=>{r("tablet")}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M19 19H4V3h15m-7.5 20a1.5 1.5 0 01-1.5-1.5 1.5 1.5 0 011.5-1.5 1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m7-23h-14A2.5 2.5 0 002 2.5v19A2.5 2.5 0 004.5 24h14a2.5 2.5 0 002.5-2.5v-19A2.5 2.5 0 0018.5 0z",fill:"currentColor"})))),(0,e.createElement)(a.Tooltip,{text:(0,n.__)("Preview mobile","gp-premium")},(0,e.createElement)(a.Button,{variant:"mobile"===t?"primary":"",onClick:()=>{r("mobile")}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",width:"1em",height:"1em",viewBox:"0 0 24 24"},(0,e.createElement)("path",{d:"M17 19H7V5h10m0-4H7c-1.11 0-2 .89-2 2v18a2 2 0 002 2h10a2 2 0 002-2V3a2 2 0 00-2-2z",fill:"currentColor"})))))}var v,y;v=(0,e.createElement)((function({readOnly:r=!1,gpPremiumBuyNowUrl:i="",gpOneBuyNowUrl:p=""}){var v;const[y,_]=(0,t.useState)(!1),[E,w]=(0,t.useState)({}),[k,C]=(0,t.useState)(!1),[O,S]=(0,t.useState)(!1),[x,N]=(0,t.useState)({}),[T,L]=(0,t.useState)({}),[P,B]=(0,t.useState)({}),[R,j]=(0,t.useState)(!1),[I,D]=(0,t.useState)(!0),[A,G]=(0,t.useState)(!0),[M,U]=(0,t.useState)(!1),[z,W]=(0,t.useState)(!1),[F,H]=(0,t.useState)([]),[q,V]=(0,t.useState)([]),[Z,J]=(0,t.useState)([]),[Y,$]=(0,t.useState)(!1),[K,Q]=(0,t.useState)(gppSiteLibrary.hasBackup),[X,ee]=(0,t.useState)(""),[te,re]=(0,t.useState)(""),[ne,ae]=(0,t.useState)("desktop"),se=null!==(v=gppSiteLibrary?.isGenerateBlocksProInstalled)&&void 0!==v&&v,[ie,le]=(0,t.useState)(se?"gp-one":"gp-premium"),oe=(0,t.useRef)(null),pe=(0,t.useRef)(null),ce=(0,t.useCallback)((e=>{if("Tab"!==e.key)return;const t=oe.current;if(!t)return;const r=Array.from(t.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter((e=>{const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&null!==e.offsetParent}));if(0===r.length)return;const n=r[0],a=r[r.length-1],s=document.activeElement;if(!t.contains(s))return n.focus(),void e.preventDefault();e.shiftKey?s===n&&(a.focus(),e.preventDefault()):s===a&&(n.focus(),e.preventDefault())}),[]),ue=(0,t.useCallback)((e=>{"Escape"===e.key&&O&&(S(!1),N({}),L({}),B({}),j(!1),D(!0),G(!0),U(!1),W(!1),H([]),V([]),J([]))}),[O]);function me(e){e.classList.add("gpp-library-action-message--show"),e.textContent=(0,n.__)("Activating plugins","gp-premium"),l()({path:"/generatepress-site-library/v1/activate_plugins",method:"POST",data:{siteData:x,siteSlug:x.name.replace(/\s+/g,"_").toLowerCase(),importOptions:I,importContent:A}}).then((t=>{e.textContent=t.response,t.success&&t.response||e.classList.add("gblocks-action-message--error"),setTimeout((()=>{de(e)}),2e3)}))}function de(e){e.classList.add("gpp-library-action-message--show"),e.textContent=(0,n.__)("Importing content","gp-premium"),l()({path:"/generatepress-site-library/v1/import_content",method:"POST",data:{siteData:x,siteSlug:x.name.replace(/\s+/g,"_").toLowerCase(),importOptions:I,importContent:A}}).then((t=>{e.textContent=t.response,t.success&&t.response||e.classList.add("gblocks-action-message--error"),setTimeout((()=>{!function(e){e.classList.add("gpp-library-action-message--show"),e.textContent=(0,n.__)("Importing site options","gp-premium"),l()({path:"/generatepress-site-library/v1/import_site_options",method:"POST",data:{siteData:x,siteSlug:x.name.replace(/\s+/g,"_").toLowerCase(),importOptions:I,importContent:A}}).then((t=>{e.textContent=t.response,t.success&&t.response||e.classList.add("gblocks-action-message--error"),setTimeout((()=>{R?function(e){e.classList.add("gpp-library-action-message--show"),e.textContent=(0,n.__)("Importing widgets","gp-premium"),l()({path:"/generatepress-site-library/v1/import_widgets",method:"POST",data:{siteData:x,siteSlug:x.name.replace(/\s+/g,"_").toLowerCase(),importOptions:I,importContent:A}}).then((t=>{e.textContent=t.response,t.success&&t.response||e.classList.add("gblocks-action-message--error"),setTimeout((()=>{e.textContent=(0,n.__)("Import Complete","gp-premium"),C(!1),W(!0),Q(!0)}),2e3)}))}(e):(e.textContent=(0,n.__)("Import Complete","gp-premium"),C(!1),W(!0),Q(!0))}),2e3)}))}(e)}),2e3)}))}if((0,t.useEffect)((()=>{if(O)return document.body.classList.add("gpp-site-library-opened"),pe.current=document.activeElement,setTimeout((()=>{if(oe.current){oe.current.setAttribute("tabindex","-1");const e=oe.current.querySelector('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');e?e.focus():oe.current.focus()}}),100),document.addEventListener("keydown",ce),document.addEventListener("keydown",ue),()=>{document.removeEventListener("keydown",ce),document.removeEventListener("keydown",ue),document.body.classList.remove("gpp-site-library-opened"),pe.current&&pe.current.focus&&pe.current.focus()}}),[O,ce,ue]),(0,t.useEffect)((()=>{l()({path:"/generatepress-site-library/v1/get_sites"}).then((e=>{_(!0),w(e.response)}))}),[]),!y)return(0,e.createElement)(a.Placeholder,{className:"gpp-library-placeholder"},(0,e.createElement)(a.Spinner,null));if(!E||"no results"===E)return(0,e.createElement)("div",{className:"generatepress-site-library-no-results"},(0,e.createElement)("p",null,(0,n.__)("No sites were found.","gp-premium")," ",!r&&(0,e.createElement)("a",{href:"https://docs.generatepress.com/article/site-library-unavailable/",target:"_blank",rel:"noreferrer noopener"},(0,n.__)("Why?","gp-premium"))),!r&&(0,e.createElement)(a.Button,{variant:"primary",onClick:()=>{$(!0),l()({path:"/generatepress-site-library/v1/get_sites?forceRefresh=true"}).then((e=>{_(!0),w(e.response),$(!1)}))}},Y&&(0,e.createElement)(a.Spinner,null),!Y&&(0,n.__)("Try again","gp-premium")));let ge="100%";"tablet"===ne&&(ge="768px"),"mobile"===ne&&(ge="480px");const fe=x.author_name&&x.author_url&&"GeneratePress"!==x.author_name&&!r;return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"generatepress-site-library"},!!K&&(0,e.createElement)("div",{className:"generatepress-site-library-restore"},(0,e.createElement)("h2",null,(0,n.__)("Existing Site Import Detected","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("It is highly recommended that you remove the last site you imported before importing a new one.","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("This process restores your previous options, widgets and active plugins. It will also remove your imported content and CSS.","gp-premium")),(0,e.createElement)("div",{className:"gpp-library-action-button"},(0,e.createElement)(a.Button,{variant:"primary",onClick:e=>{window.confirm((0,n.__)("This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.","gp-premium"))&&(C(!0),function(e){const t=e.target.nextElementSibling;t.classList.add("gpp-library-action-message--show"),t.textContent=(0,n.__)("Restoring theme options","gp-premium"),l()({path:"/generatepress-site-library/v1/restore_theme_options",method:"POST"}).then((e=>{t.textContent=e.response,e.success&&e.response||t.classList.add("gblocks-action-message--error"),setTimeout((()=>{t.textContent=(0,n.__)("Restoring content","gp-premium"),l()({path:"/generatepress-site-library/v1/restore_content",method:"POST"}).then((e=>{t.textContent=e.response,e.success&&e.response||t.classList.add("gblocks-action-message--error"),C(!1),Q(!1)}))}),2e3)}))}(e))}},k&&(0,e.createElement)(a.Spinner,null),!k&&(0,n.__)("Remove imported site","gp-premium")),(0,e.createElement)("span",{className:"gpp-library-action-message"}),!k&&(0,e.createElement)(a.Button,{onClick:()=>{Q(!1)}},(0,n.__)("No thanks","gp-premium")))),!K&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"generatepress-site-library-filter"},(0,e.createElement)(m,{allSites:E,value:X,onChange:e=>{ee(e),setTimeout((()=>{(0,o.be)()}),100)}}),(0,e.createElement)("div",{className:"generatepress-site-library-filter-right"},(0,e.createElement)(g,{value:ie,onChange:e=>{le(e),setTimeout((()=>{(0,o.be)()}),100)}}),(0,e.createElement)(d,{value:te,onChange:e=>{re(e),ee(""),setTimeout((()=>{(0,o.be)()}),100)}}))),!r&&!se&&"gp-one"===ie&&(0,e.createElement)(a.Notice,{isDismissible:!1,status:"info",className:"gp-one-notice"},(0,e.createElement)("p",null,(0,t.createInterpolateElement)((0,n.__)("<strong>Note:</strong> Some of these sites require GenerateBlocks Pro. You can <a>upgrade to GeneratePress One</a> and install GenerateBlocks Pro to install these sites.","gp-premium"),{strong:(0,e.createElement)("strong",null),a:(0,e.createElement)("a",{href:"https://generatepress.com/account",target:"_blank",rel:"noopener noreferrer"},(0,n.__)("upgrade to GeneratePress One","gp-premium"))}))),(0,e.createElement)("ul",{className:"generatepress-site-library-list"},Object.keys(E).map((t=>{if(""!==X&&!E[t].category.includes(X))return null;const r=E[t].name,a=(0,s.decodeEntities)(r);if(""!==te&&!a.toLowerCase().includes(te.toLowerCase())&&!E[t].author_name.toLowerCase().includes(te.toLowerCase()))return null;const i=JSON.parse(E[t].plugins||"{}"),l=Object.keys(i).some((e=>e.toLowerCase().includes("generateblocks pro")));if("gp-premium"===ie&&l)return null;const p=E[t].directory+"/screenshot.png",c=gppSiteLibrary.gppVersion.split("-")[0],m=E[t].min_version.split("-")[0],d=gppSiteLibrary.gpVersion.split("-")[0],g=gppSiteLibrary.generateblocksVersion.split("-")[0],f=E[t].min_theme_version?E[t].min_theme_version.split("-")[0]:d,h=E[t].min_generateblocks_version?E[t].min_generateblocks_version.split("-")[0]:g,b=E[t].image_width,v=E[t].image_height,y=u(m,c)>0||u(f,d)>0||g&&u(h,g)>0;return(0,e.createElement)("li",{className:"generatepress-site-library-list-item",key:r+":"+t},(0,e.createElement)("button",{disabled:y,onClick:()=>{S(!0),N(E[t]),L(JSON.parse(E[t].plugins))}},(0,e.createElement)("div",{className:"generatepress-site-library-list-item-image"},(0,e.createElement)(o.ZP,{offset:100,once:!0},(0,e.createElement)("img",{src:p,alt:r,width:b,height:v}))),(0,e.createElement)("div",{className:"generatepress-site-library-list-item-title"},(0,e.createElement)("span",{className:"generatepress-site-library-list-item-title-text"},a,!!l&&(0,e.createElement)("span",{className:"gp-one-badge",title:"GeneratePress One"},(0,e.createElement)("span",{className:"gb-icon"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"27.6 27.6 200.02 200.02"},(0,e.createElement)("path",{fill:"currentColor",d:"m189.34 170.19-33.03-15.4 5.28-11.32c1.85-3.97 2.94-8.1 3.34-12.23a37.56 37.56 0 0 0-11.05-30.36c-2.96-2.9-6.45-5.37-10.42-7.22-3.97-1.85-8.1-2.94-12.23-3.34-11.24-1.09-22.46 2.99-30.37 11.05a37.297 37.297 0 0 0-7.22 10.42l-5.28 11.32-10.16 21.74c-.23.5-.02 1.1.48 1.33l21.75 10.14 11.33 5.28 11.33 5.28 22.65 10.56 24.89 11.6c-21.65 15.13-50.71 18.39-76.24 5.8-36.73-18.12-52.1-62.79-34.36-99.7 17.76-36.95 62-52.82 99.27-35.45 29.37 13.69 45.69 43.97 43.02 74.47-.04.42.19.81.57.99l21.85 10.19c.6.28 1.3-.08 1.41-.73 7.54-43.55-14.68-88.47-56.85-107.82-50.11-23-109.01-1.35-132.31 48.6-23.33 50.03-1.68 109.5 48.36 132.82 38.03 17.73 81.5 9.48 110.43-17.45a99.24 99.24 0 0 0 15.84-18.94c.33-.51.13-1.19-.42-1.45l-21.86-10.18zm-78.35-36.52 5.28-11.32c2.92-6.25 10.35-8.96 16.61-6.04 6.26 2.92 8.96 10.35 6.04 16.6l-5.28 11.32-11.33-5.28-11.32-5.28z"}))),(0,e.createElement)("span",{className:"gb-button-text"},"One"))),!!y&&u(m,c)>0&&(0,e.createElement)("span",{className:"generatepress-site-library-required-version"},(0,n.sprintf)(/* translators: Version number */ (0,n.__)("Requires GP Premium %s.","gp-premium"),m)),!!y&&u(f,d)>0&&(0,e.createElement)("span",{className:"generatepress-site-library-required-version"},(0,n.sprintf)(/* translators: Version number */ (0,n.__)("Requires GeneratePress %s.","gp-premium"),f)),!!y&&g&&u(h,g)>0&&(0,e.createElement)("span",{className:"generatepress-site-library-required-version"},(0,n.sprintf)(/* translators: Version number */ (0,n.__)("Requires GenerateBlocks %s.","gp-premium"),h)))))}))),!r&&(0,e.createElement)("div",{className:"generatepress-site-library-refresh"},(0,e.createElement)(a.Button,{variant:"primary",onClick:()=>{$(!0),l()({path:"/generatepress-site-library/v1/get_sites?forceRefresh=true"}).then((e=>{_(!0),w(e.response),$(!1)}))}},Y&&(0,e.createElement)(a.Spinner,null),!Y&&(0,n.__)("Refresh sites","gp-premium")))),O&&(0,e.createElement)("div",{className:c("generatepress-site-library-opened",r&&"generatepress-site-library-opened--read-only"),ref:oe},(0,e.createElement)("div",{className:"generatepress-site-library-iframe"},(0,e.createElement)(h,{url:x.preview_url,previewWidth:ge})),(0,e.createElement)("div",{className:"generatepress-site-library-info"},(0,e.createElement)("div",{className:"generatepress-site-library-header"},(0,e.createElement)("div",{className:"generatepress-site-library-header__title"},(0,e.createElement)("h2",{className:fe?"has-author":""},(0,s.decodeEntities)(x.name)),fe&&(0,e.createElement)("span",{className:"site-library-author"},/* translators: Site library site built by "author name" */ (0,n.__)("Built by","gp-premium")+" ",(0,e.createElement)("a",{href:x.author_url,target:"_blank",rel:"noreferrer noopener"},x.author_name)),!!r&&(0,e.createElement)("div",{className:"gpp-library-action-button"},(()=>{const t=Object.keys(T).some((e=>e.toLowerCase().includes("generateblocks pro"))),r=t?p:i;return r?(0,e.createElement)("a",{href:r,className:"components-button is-primary",target:"_blank",rel:"noopener noreferrer"},t?(0,n.__)("Buy GP One","gp-premium"):(0,n.__)("Buy GP Premium","gp-premium")):null})())),!!r&&(0,e.createElement)(b,{device:ne,setDevice:ae}),(0,e.createElement)(a.Button,{onClick:()=>{C(!1),S(!1),N({}),L({}),B({}),j(!1),D(!0),G(!0),U(!1),W(!1),H([]),V([]),J([])}},(0,e.createElement)("svg",{width:"35",height:"35",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z"})))),(0,e.createElement)(f,{shouldRender:!r},!!x.description&&(0,e.createElement)("p",null,(0,s.decodeEntities)(x.description)),!z&&(0,e.createElement)(t.Fragment,null,0===Object.keys(P).length&&(0,e.createElement)(t.Fragment,null,gppSiteLibrary.isDebugEnabled&&(0,e.createElement)(a.PanelBody,{className:"gpp-debug-panel",title:(0,n.__)("Debug Mode Enabled","gp-premium"),initialOpen:!1},(0,e.createElement)("p",null,(0,n.__)("WordPress debug mode is currently enabled. With this, any errors from third-party plugins might affect the import process.","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("To disable it, find WP_DEBUG in your wp-config.php file and set it to false like the below.","gp-premium")),(0,e.createElement)("code",null,"define( 'WP_DEBUG', false );"),(0,e.createElement)("p",null,(0,e.createElement)("a",{href:"https://docs.generatepress.com/article/debug-mode-enabled/",target:"_blank",rel:"noreferrer noopener"},(0,n.__)("Learn more here","gp-premium")))),Object.keys(T).length>0&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("h3",null,(0,n.__)("Plugins","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("This site uses the following plugins.","gp-premium")),(0,e.createElement)("ul",{className:"generatepress-site-library-plugins"},Object.entries(T).map((([t])=>(0,e.createElement)("li",{key:t},t))))),(0,e.createElement)("div",{className:"gpp-library-action-button"},(0,e.createElement)(a.Button,{variant:"primary",disabled:k,onClick:e=>{C(!0);const t=e.target.nextElementSibling;t.textContent=(0,n.__)("Gathering information","gp-premium"),l()({path:"/generatepress-site-library/v1/get_site_data",method:"POST",data:{siteData:x}}).then((e=>{const r=[],n=[],a=[];Object.entries(e.response.plugin_data).forEach((([t])=>{const s=e.response.plugin_data[t];s.repo&&!s.installed?r.push(s.name):s.installed||s.active?n.push(s.name):a.push(s.name)})),C(!1),B(e.response),L(e.response.plugins),j(e.response.widgets),H(r),V(n),J(a),t.classList.add("gpp-library-action-message--show"),t.textContent=e.response,e.success&&e.response?setTimeout((function(){t.classList.remove("gpp-library-action-message--show")}),3e3):t.classList.add("gpp-library-action-message--error")}))}},k&&(0,e.createElement)(a.Spinner,null),!k&&(0,n.__)("Get Started","gp-premium")),(0,e.createElement)("span",{className:"gpp-library-action-message"}))),Object.keys(P).length>0&&Object.keys(T).length>0&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("h3",null,(0,n.__)("Plugins","gp-premium")),F.length>0&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("p",null,(0,n.__)("These plugins can be installed automatically.","gp-premium")),(0,e.createElement)("ul",{className:"generatepress-site-library-plugins"},F.map((t=>(0,e.createElement)("li",{key:t},t))))),q.length>0&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("p",null,(0,n.__)("These plugins are already installed.","gp-premium")),(0,e.createElement)("ul",{className:"generatepress-site-library-plugins"},q.map((t=>(0,e.createElement)("li",{key:t},t))))),Z.length>0&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("p",{style:{fontWeight:"bold"}},(0,n.__)("These plugins need to be installed manually.","gp-premium")),(0,e.createElement)("ul",{className:"generatepress-site-library-plugins"},Z.map((t=>"GenerateBlocks Pro"===t?(0,e.createElement)("li",{key:t},(0,e.createElement)(a.ExternalLink,{href:"https://generatepress.com/blocks/#pricing"},t)):(0,e.createElement)("li",{key:t},t)))))),Object.keys(P).length>0&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("h3",null,(0,n.__)("Import","gp-premium")),!k&&0===Z.length&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("p",null,(0,n.__)("This process makes changes to your website. If it contains important data, we suggest backing it up before proceeding.","gp-premium")),(0,e.createElement)(a.ToggleControl,{checked:!!M,label:(0,n.__)("I understand","gp-premium"),onChange:e=>{U(e)}})),(0,e.createElement)("div",{className:"gpp-library-action-button"},(0,e.createElement)(a.Button,{variant:"primary",disabled:!M||z||k||Z.length>0,onClick:e=>{C(!0),function(e){const t=e.target.nextElementSibling;t.classList.add("gpp-library-action-message--show"),t.textContent=(0,n.__)("Importing theme options","gp-premium"),l()({path:"/generatepress-site-library/v1/import_theme_options",method:"POST",data:{siteData:x,siteSlug:x.name.replace(/\s+/g,"_").toLowerCase(),importOptions:I,importContent:A}}).then((e=>{t.textContent=e.response,e.success&&e.response||t.classList.add("gblocks-action-message--error"),setTimeout((()=>{A?Object.keys(P.plugin_data).length>0?function(e){void 0!==e.target&&(e=e.target.nextElementSibling),e.classList.add("gpp-library-action-message--show"),e.textContent=(0,n.__)("Installing plugins","gp-premium"),Object.entries(P.plugin_data).forEach((([t,r])=>{let a=r.slug.split("/")[0],s=r.name;r.installed?(delete P.plugin_data[t],0===Object.keys(P.plugin_data).length&&me(e)):("bb-plugin"===a&&(a="beaver-builder-lite-version",s="Beaver Builder Lite"),e.textContent=(0,n.sprintf)(/* translators: Installing "Plugin Name" */ (0,n.__)("Installing %s","gp-premium"),s),wp.updates.installPlugin({slug:a,success:r=>{console.log(r),delete P.plugin_data[t],0===Object.keys(P.plugin_data).length&&me(e)},error:r=>{console.log(r),delete P.plugin_data[t],0===Object.keys(P.plugin_data).length&&me(e)}}))}))}(t):de(t):(t.textContent=(0,n.__)("Import Complete","gp-premium"),C(!1),W(!0),Q(!0))}),2e3)}))}(e)}},k&&(0,e.createElement)(a.Spinner,null),!k&&(0,n.__)("Begin Import","gp-premium")),(0,e.createElement)("span",{className:"gpp-library-action-message"})))),!!z&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("h3",null,(0,n.__)("Import Complete","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("Check out your new site and start making it yours!","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("Note: We do our best to ensure all imported images are licensed for open use. However, image licenses can change, so we strongly advise that you replace all imported images with your own.","gp-premium")),(0,e.createElement)("a",{className:"components-button is-primary",href:gppSiteLibrary.homeUrl},(0,n.__)("View Site","gp-premium")),x.uploads_url&&Object.values(T).includes("elementor/elementor.php")&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("h3",null,(0,n.__)("Additional Cleanup","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("This site is using Elementor which means you will want to replace the imported image URLs.","gp-premium")),(0,e.createElement)("p",null,(0,n.__)("Take note of the old and new URLs below, then head over to the Elementor Tools area to replace them.","gp-premium")),(0,e.createElement)(a.TextControl,{label:(0,n.__)("Old URL","gp-premium"),readOnly:!0,value:x.uploads_url}),(0,e.createElement)(a.TextControl,{label:(0,n.__)("New URL","gp-premium"),readOnly:!0,value:gppSiteLibrary.uploadsUrl}),(0,e.createElement)("a",{href:gppSiteLibrary.elementorReplaceUrls,className:"components-button is-primary",target:"_blank",rel:"noopener noreferrer"},(0,n.__)("Elementor Tools","gp-premium")))),(0,e.createElement)(b,{device:ne,setDevice:ae}))))))}),null),y=document.getElementById("gpp-site-library"),void 0!==t.createRoot?(0,t.createRoot)(y).render(v):(0,t.render)(v,y)})()})();
| ver. 1.4 |
Github
|
.
| PHP 8.2.30 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings