",{css:{background:"gray",width:s.width(),height:s.height()}});s.before(n),s.remove()}))}removeUnnecessaryElements(){let e=0;this.elements.$sections.filter(((t,s)=>{let n=!1;return e>=this.getSettings("crop.height")&&(n=!0),e+=jQuery(s).outerHeight(),n})).each(((e,t)=>{t.remove()})),this.elements.$notElementorElements.remove()}handleLinks(){elementorCommon.elements.$body.find("a").attr("href","/")}removeFirstSectionMargin(){this.elements.$firstSection.css({marginTop:0})}createImage(){const e=new Promise((e=>{window.addEventListener("load",(()=>{e()}))})),t=new Promise((e=>{setTimeout((()=>{e()}),this.getSettings("render_timeout"))}));return Promise.race([e,t]).then((()=>{if(this.log("Start creating screenshot."),this.getSettings("isDebugSvg"))return domtoimage.toSvg(document.body,{imagePlaceholder:this.getSettings("image_placeholder")}).then((e=>this.download(e))),Promise.reject("Debug SVG.");return/^((?!chrome|android).)*safari/i.test(window.userAgent)?(this.log('Creating screenshot with "html2canvas"'),html2canvas(document.body).then((e=>e.toDataURL("image/png")))):(this.log('Creating screenshot with "dom-to-image"'),domtoimage.toPng(document.body,{imagePlaceholder:this.getSettings("image_placeholder")}))}))}download(e){const t=jQuery("
",{href:e,download:"debugSvg.svg",html:"Download SVG"});elementorCommon.elements.$body.append(t),t.trigger("click")}createImageElement(e){const t=new Image;return t.src=e,new Promise((e=>{t.onload=()=>e(t)}))}cropCanvas(e){const t=this.getSettings("crop.width"),s=this.getSettings("crop.height"),n=document.createElement("canvas"),i=n.getContext("2d"),o=t/e.width;return n.width=t,n.height=s>e.height?e.height:s,i.drawImage(e,0,0,e.width,e.height,0,0,e.width*o,e.height*o),Promise.resolve(n)}save(e){return new Promise(((t,s)=>{elementorCommon.ajax.addRequest("screenshot_save",{data:{post_id:this.getSettings("post_id"),screenshot:e.toDataURL("image/png")},success:e=>{this.log(`Screenshot created: ${encodeURI(e)}`),t(e)},error:()=>{this.log("Failed to create screenshot."),s()}})}))}markAsFailed(){return new Promise(((e,t)=>{elementorCommon.ajax.addRequest("screenshot_failed",{data:{post_id:this.getSettings("post_id")},success:()=>{this.log("Marked as failed."),e()},error:()=>{this.log("Failed to mark this screenshot as failed."),t()}})}))}getScreenshotProxyUrl(e){return`${this.getSettings("home_url")}?screenshot_proxy&nonce=${this.getSettings("nonce")}&href=${e}`}screenshotSucceed(e){this.screenshotDone(!0,e)}screenshotFailed(e){this.log(e,null),this.markAsFailed().then((()=>this.screenshotDone(!1)))}screenshotDone(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;clearTimeout(this.timeoutTimer),this.timeoutTimer=null,window.parent.postMessage({name:"capture-screenshot-done",success:e,id:this.getSettings("post_id"),imageUrl:t},"*"),this.log(`Screenshot ${e?"Succeed":"Failed"}.`,"timeEnd")}log(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"timeLog";this.getSettings("isDebug")&&(console.log("string"==typeof e?`${this.getSettings("post_id")} - ${e}`:e),t&&console[t](this.getSettings("timer_label")))}}jQuery((()=>{new Screenshot}))})();import { __ } from '@wordpress/i18n';
export const DARK_PALETTES = [
{
slug: 'style-1',
title: __( 'Style 1', 'astra-sites' ),
colors: [
'#8E43F0',
'#7215EA',
'#FFFFFF',
'#EEEBF4',
'#150E1F',
'#494153',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-2',
title: __( 'Style 2', 'astra-sites' ),
colors: [
'#EF4D48',
'#D90700',
'#FFFFFF',
'#EEEAEC',
'#2B161B',
'#3C2F32',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-3',
title: __( 'Style 3', 'astra-sites' ),
colors: [
'#FF42B3',
'#FF0099',
'#FFFFFF',
'#EEEAEC',
'#2B161B',
'#3C2F32',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-4',
title: __( 'Style 4', 'astra-sites' ),
colors: [
'#FF6A97',
'#FA036B',
'#FFFFFF',
'#EEEAEC',
'#2B161B',
'#3C2F32',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-5',
title: __( 'Style 5', 'astra-sites' ),
colors: [
'#FF7A3D',
'#FF5100',
'#FFFFFF',
'#F1EDEB',
'#1E1810',
'#443D3A',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-6',
title: __( 'Style 6', 'astra-sites' ),
colors: [
'#F9C349',
'#FFB100',
'#FFFFFF',
'#F0EFEC',
'#1E1810',
'#4D4A46',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-7',
title: __( 'Style 7', 'astra-sites' ),
colors: [
'#30C7B5',
'#00AC97',
'#FFFFFF',
'#F0EFEC',
'#1E1810',
'#4D4A46',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-8',
title: __( 'Style 8', 'astra-sites' ),
colors: [
'#1BAE70',
'#06752E',
'#FFFFFF',
'#EBECEB',
'#14261C',
'#3D4641',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-9',
title: __( 'Style 9', 'astra-sites' ),
colors: [
'#2FE6FF',
'#00D0EC',
'#FFFFFF',
'#E8EBEC',
'#101218',
'#3B4244',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-10',
title: __( 'Style 10', 'astra-sites' ),
colors: [
'#4175FC',
'#084AF3',
'#FFFFFF',
'#E8EBEC',
'#101218',
'#3B4244',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
];
export const LIGHT_PALETTES = [
{
slug: 'style-1',
title: __( 'Style 1', 'astra-sites' ),
colors: [
'#8E43F0',
'#6300E2',
'#150E1F',
'#584D66',
'#F3F1F6',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-2',
title: __( 'Style 2', 'astra-sites' ),
colors: [
'#EF4D48',
'#D90700',
'#2B161B',
'#453E3E',
'#F7F3F5',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-3',
title: __( 'Style 3', 'astra-sites' ),
colors: [
'#FF42B3',
'#FF0099',
'#2B161B',
'#554B4E',
'#F6F3F5',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-4',
title: __( 'Style 4', 'astra-sites' ),
colors: [
'#FF6A97',
'#FA036B',
'#2B161B',
'#645659',
'#F8F3F5',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-5',
title: __( 'Style 5', 'astra-sites' ),
colors: [
'#FF7A3D',
'#FF5100',
'#1E1810',
'#575250',
'#F8F5F4',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-6',
title: __( 'Style 6', 'astra-sites' ),
colors: [
'#F9C349',
'#FFB100',
'#1E1810',
'#62615C',
'#F8F7F3',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-7',
title: __( 'Style 7', 'astra-sites' ),
colors: [
'#30C7B5',
'#00AC97',
'#14261C',
'#4F5655',
'#F3F6F3',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-8',
title: __( 'Style 8', 'astra-sites' ),
colors: [
'#1BAE70',
'#06752E',
'#14261C',
'#4E5652',
'#F4F6F4',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-9',
title: __( 'Style 9', 'astra-sites' ),
colors: [
'#2FC1FF',
'#08ACF2',
'#101218',
'#4C5253',
'#F3F6F6',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
{
slug: 'style-10',
title: __( 'Style 10', 'astra-sites' ),
colors: [
'#4175FC',
'#084AF3',
'#101218',
'#494B51',
'#F3F5F5',
'#FFFFFF',
'#000000',
'#4B4F58',
'#F6F7F8',
],
},
];