@emailmaker/emailmaker 1.1.6 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{emailmaker-core.0e62ec4f.js → emailmaker-core.0f53b24b.js} +1 -1
- package/emailmaker-esm.js +2 -2
- package/emailmaker.d.ts +70 -7
- package/emailmaker.js +2 -2
- package/iframe/js/amp.BtGt-xkd.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.CNqvmp_P.js +1 -1
- package/iframe/js/sanitize-html.BzjMWt1k.js +1 -1
- package/package.json +1 -1
- package/static/core/{e544e2af.js → 37323be2.js} +5 -5
- package/static/core/425f6198.js +3 -0
- package/static/core/{8c582ee0.js → 542c10a0.js} +1 -1
- package/static/core/{5f2e1ad8.js → 54c69205.js} +1 -1
- package/static/core/{c229993d.js → 5f66a133.js} +1 -1
- package/static/core/{f75a0a8d.js → 6f1c8ca5.js} +1 -1
- package/static/core/{77e5c7c2.js → 99f965a4.js} +1 -1
- package/static/core/{c900a8e5.js → b330862b.js} +1 -1
- package/static/core/{aa02cba4.js → c19a7448.js} +1 -1
- package/static/core/{cea7a3d0.js → c7f99585.js} +1 -1
- package/static/core/de149603.js +1 -0
- package/static/core/{2395566a.js → e1ac64f3.js} +1 -1
- package/static/core/{b2851f05.js → e5c35767.js} +1 -1
- package/static/core/{32c094cc.js → eb4e7505.js} +1 -1
- package/static/core/{33abfdde.js → f67b8fa2.js} +1 -1
- package/ui-kit/index.js +1589 -1589
- package/static/core/5929a1fb.js +0 -3
- package/static/core/9856c4cd.js +0 -1
- /package/iframe/{iframe-eblock.0e62ec4f.html → iframe-eblock.0f53b24b.html} +0 -0
- /package/iframe/{iframe.0e62ec4f.html → iframe.0f53b24b.html} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.setAttribute(`data-emailmaker`,`true`),e.appendChild(document.createTextNode(`@import "https://fonts.googleapis.com/css2?family=Geologica:wght@300;600&display=swap";.blocks-app .ant-modal.premium-features-modal .ant-modal-content{border-radius:calc(var(--borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .limit-upgrade-modal.ant-modal{max-width:calc(100vw - 24px)}.blocks-app .limit-upgrade-modal .ant-modal-content{border-radius:16px;padding:0;overflow:hidden;box-shadow:0 12px 24px -4px #191d3a14}.blocks-app .limit-upgrade-modal .ant-modal-header{display:none}.blocks-app .limit-upgrade-modal .ant-modal-content .ant-modal-body{padding:0}.blocks-app .limit-upgrade-modal__wrap{background:var(--colorBgContainer);flex-direction:column;align-items:center;width:400px;max-width:100%;display:flex}.blocks-app .limit-upgrade-modal__header{box-sizing:border-box;flex-direction:row;justify-content:flex-end;align-items:center;width:100%;min-height:34px;padding:8px 8px 0;display:flex}.blocks-app .limit-upgrade-modal__close{background:var(--colorBgContainer);width:34px;height:34px;color:var(--colorTextSecondary);cursor:pointer;border:none;border-radius:6px;justify-content:center;align-items:center;margin:0;padding:0;transition:background .15s,color .15s;display:flex}.blocks-app .limit-upgrade-modal__close:hover{background:var(--colorFillTertiary);color:var(--colorText)}.blocks-app .limit-upgrade-modal__close .anticon{font-size:16px}.blocks-app .limit-upgrade-modal__body{box-sizing:border-box;flex-direction:column;align-items:center;gap:16px;width:100%;padding:0 40px 24px;display:flex}.blocks-app .limit-upgrade-modal__title{text-align:center;max-width:320px;color:var(--colorText);margin:0;font-size:18px;font-weight:400;line-height:130%}.blocks-app .limit-upgrade-modal__subtitle{text-align:center;max-width:320px;color:var(--colorTextSecondary);margin:0;font-size:14px;font-weight:100;line-height:120%}.blocks-app .limit-upgrade-modal__limits-row{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;width:100%;max-width:320px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle{box-sizing:border-box;border:1px solid var(--colorText);width:34px;height:34px;color:var(--colorText);border-radius:32px;flex:none;justify-content:center;align-items:center;padding:8px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle .anticon{font-size:18px}.blocks-app .limit-upgrade-modal__icon-circle svg{flex-shrink:0;width:18px;height:18px;display:block}.blocks-app .limit-upgrade-modal__limit-old{color:#f85243;flex-shrink:0;font-size:40px;font-weight:100;line-height:100%}.blocks-app .limit-upgrade-modal__arrow-btn{color:#fff;background:#8946fb;border-radius:38px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.blocks-app .limit-upgrade-modal__arrow-icon{font-size:16px;transform:rotate(45deg)}.blocks-app .limit-upgrade-modal__limit-new{color:#7ed846;flex-shrink:0;font-size:40px;font-weight:400;line-height:100%}.blocks-app .limit-upgrade-modal__limit-new--infinity{font-size:36px;line-height:40px}.blocks-app .limit-upgrade-modal__divider{border:none;border-top:1px solid var(--colorBorderSecondary);width:100%;height:0;margin:0}.blocks-app .limit-upgrade-modal__footer{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:16px 0;display:flex}.blocks-app .limit-upgrade-modal__footer--dual{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;padding:16px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary{min-width:147px;height:32px;box-shadow:none;background:#2884ff;border-color:#2884ff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary:hover{background:#1a75f0;border-color:#1a75f0}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default{border-color:var(--colorBorder);min-width:147px;height:32px;color:var(--colorText);box-shadow:none;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default:hover{color:#2884ff;border-color:#2884ff}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();__emailmaker__.define(`static/core/8c582ee0.js`,[`require`,`exports`,`module`,`static/core/354bf8a9.js`,`static/core/92ad1565.js`,`static/core/c229993d.js`,`static/core/5929a1fb.js`,`static/core/c900a8e5.js`,`react`,`react-dom`,`react-router-dom`,`react/jsx-runtime`,`antd`,`react-dom/client`,`@ant-design/icons`],function(e,t,n){let r=e("./354bf8a9.js"),i=e("./c229993d.js"),a=e("./c900a8e5.js");e("./92ad1565.js");let o=e("./5929a1fb.js"),s=e("react");s=r.l(s),e("react-dom");let c=e("react-router-dom"),l=e("react/jsx-runtime"),u=e("antd");e("react-dom/client");let d=e("@ant-design/icons");var f=({open:e,sideOnOk:t,onCancel:n,initialSlide:r=0})=>{let{__:a}=o.h(),u=(0,c.useNavigate)(),[d,f]=(0,s.useState)(r),p=(0,s.useRef)(null),m=i.wt(),h=()=>{t&&t(),u(`/billing`),n(!1)};(0,s.useEffect)(()=>{e&&p.current&&(p.current.goTo(r,!0),f(r))},[e,r]);let g=(0,s.useMemo)(()=>[{image:a(`https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png`),backgroundColor:`var(--blue-2)`,title:a(`More editing features`),description:a(`Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png`),backgroundColor:`var(--purple-2)`,title:a(`Work with the HTML code`),description:a(`Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png`),backgroundColor:`var(--cyan-2)`,title:a(`AI image generation`),description:a(`Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png`),backgroundColor:`var(--green-2)`,title:a(`Stock photos and GIFs`),description:a(`Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_NDYloAO.png`),backgroundColor:`var(--magenta-2)`,title:a(`Version history`),description:a(`Check who and when made changes to the email template and, if necessary, restore one of the previous versions.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png`),backgroundColor:`var(--red-2)`,title:a(`Image editor`),description:a(`Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png`),backgroundColor:`var(--orange-2)`,title:a(`Email optimization`),description:a(`Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png`),backgroundColor:`var(--volcano-2)`,title:a(`Team collaboration`),description:a(`Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png`),backgroundColor:`var(--geekblue-2)`,title:a(`Email testing`),description:a(`Check how your email appears across various devices and email clients.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png`),backgroundColor:`var(--geekblue-2)`,title:a(`AI assistant`),description:a(`Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!`)}],[a]);return(0,s.useEffect)(()=>{if(e&&p.current){p.current.goTo(r,!0),f(r);let e=g[r];m({event:`open_modal`,action:`open_premium-features_modal`,modal_id:`premium-features`,offer_id:e.title})}},[e,g,r,m]),(0,l.jsxs)(o.J,{open:e,footer:null,onCancel:n,closable:!1,className:`premium-features-modal`,classNames:{mask:`premium-features-modal-mask`},styles:{mask:{background:`rgba(0, 0, 0, 0.65)`}},width:1100,style:{maxWidth:`80%`},children:[(0,l.jsx)(o.V,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:`carousel-slider`,draggable:!0,autoplaySpeed:5e3,initialSlide:d,ref:p,children:g.map((e,t)=>(0,l.jsx)(`div`,{children:(0,l.jsxs)(`div`,{className:`carousel-slide`,style:{background:`${e.backgroundColor}`},children:[(0,l.jsx)(`div`,{className:`slide-item-image`,children:(0,l.jsx)(`img`,{src:e.image,alt:`slide-${t}`})}),(0,l.jsxs)(`div`,{className:`slide-item-content`,children:[(0,l.jsx)(`h3`,{className:`slide-title`,children:e.title}),(0,l.jsx)(`p`,{className:`slide-description`,children:e.description})]})]})},t))}),(0,l.jsx)(`div`,{className:`modal-subtitle`,children:a(`This and other features are available for you on any paid plan.`)}),(0,l.jsxs)(`div`,{className:`modal-buttons`,children:[(0,l.jsx)(o.It,{size:`large`,onClick:()=>n(!1),children:a(`Cancel`)}),(0,l.jsx)(o.It,{type:`primary`,size:`large`,onClick:h,style:{padding:`0 30px`},children:a(`Select plan`)})]})]})};function p(e){return e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,``),e=e.replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,``),e=e.replace(/ on\w+="[^"]*"/g,``),e=e.replace(/ on\w+='[^']*'/g,``),e}var m=({icon:e,...t})=>{let n=i.vn();return(0,l.jsx)(o.Ft,{icon:e,configIcons:(0,s.useMemo)(()=>{if(!n?.icons)return;let e={};for(let[t,r]of Object.entries(n.icons))typeof r==`string`&&(e[t]=p(r));return Object.keys(e).length>0?e:void 0},[n?.icons]),...t})},h={ai:`AIRequests`,email_generate:`EmailEnvelope`,image_generate:`Image`,optimization:`Optimization`,preview:`SendOutlined`,link_check:`Web`,image_check:`Image`,spam_check:`Block`,projects:`FolderOpen`,emails:`EmailEnvelope`,blocks:`Block`,users:`SliderGroup`};function g(e,t){if(e==null)return null;if(typeof e==`number`||typeof e==`string`){let n=e===`∞`||e===`∞`||e===`infinity`||typeof e==`string`&&e.toLowerCase()===`infinity`;return(0,l.jsx)(`span`,{className:t===`old`?`limit-upgrade-modal__limit-old`:`limit-upgrade-modal__limit-new${n?` limit-upgrade-modal__limit-new--infinity`:``}`,children:n?`∞`:e})}return e}var _=({open:e,onClose:t,title:n,subtitle:r,usageResource:i,icon:a,previousDisplay:s,nextDisplay:c,onChangePlan:f,secondaryAction:p,changePlanLabel:_})=>{let{__:v}=o.h(),y=_??v(`Change plan`),b=!!p,x=i==null?a??null:(0,l.jsx)(m,{icon:h[i]});return(0,l.jsx)(u.Modal,{open:e,onCancel:t,footer:null,closable:!1,width:400,centered:!0,className:`limit-upgrade-modal`,destroyOnClose:!0,maskClosable:!0,children:(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__wrap`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__header`,children:(0,l.jsx)(`button`,{type:`button`,className:`limit-upgrade-modal__close`,onClick:t,"aria-label":v(`Close`),children:(0,l.jsx)(d.CloseOutlined,{})})}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__body`,children:[(0,l.jsx)(`h1`,{className:`limit-upgrade-modal__title`,children:n}),(0,l.jsx)(`p`,{className:`limit-upgrade-modal__subtitle`,children:r}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__limits-row`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__icon-circle`,"aria-hidden":!0,children:x}),g(s,`old`),(0,l.jsx)(`div`,{className:`limit-upgrade-modal__arrow-btn`,"aria-hidden":!0,children:(0,l.jsx)(d.ArrowUpOutlined,{className:`limit-upgrade-modal__arrow-icon`})}),g(c,`new`)]})]}),(0,l.jsx)(`hr`,{className:`limit-upgrade-modal__divider`}),(0,l.jsx)(`div`,{className:b?`limit-upgrade-modal__footer limit-upgrade-modal__footer--dual`:`limit-upgrade-modal__footer`,children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Button,{className:`limit-upgrade-modal__cta-secondary`,onClick:p.onClick,children:p.label}),(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})]}):(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})})]})})},v={email_10_30:{id:`email_10_30`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:10,next:30,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 10→30`},email_30_300:{id:`email_30_300`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:30,next:300,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 30→300`},email_300_inf:{id:`email_300_inf`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:300,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 300→∞`},ai_10_50:{id:`ai_10_50`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:10,next:50,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 10→50`},ai_30_150:{id:`ai_30_150`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:30,next:150,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 30→150`},ai_150_inf:{id:`ai_150_inf`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:150,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 150→∞`},optimization_exceeded:{id:`optimization_exceeded`,titleKey:`You have used up your optimisation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`optimization`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: optimization exhausted`},image_generate_exceeded:{id:`image_generate_exceeded`,titleKey:`You have used up your image generation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_generate`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_generate exhausted`},preview_exceeded:{id:`preview_exceeded`,titleKey:`You have used up your preview (test send) limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`preview`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: preview exhausted`},link_check_exceeded:{id:`link_check_exceeded`,titleKey:`You have used up your link check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`link_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: link_check exhausted`},image_check_exceeded:{id:`image_check_exceeded`,titleKey:`You have used up your image check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_check exhausted`},spam_check_exceeded:{id:`spam_check_exceeded`,titleKey:`You have used up your spam check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`spam_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: spam_check exhausted`}};function y(e){return v[e]}function b(e){return e===`infinity`?`∞`:e}var x={ai:`ai_150_inf`,email_generate:`email_300_inf`,image_generate:`image_generate_exceeded`,preview:`preview_exceeded`,link_check:`link_check_exceeded`,image_check:`image_check_exceeded`,spam_check:`spam_check_exceeded`};function S(e){return!e||e.is_unlimited||e.total_limit<=0?!1:e.remaining<=0||e.used>=e.total_limit}function C(e,t){return S(t)?{presetId:x[e],previousLimit:t?.total_limit??0,nextLimit:`infinity`}:null}function w(e,t){return C(e,t)}function T(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(typeof n==`string`&&n)return n}}function E(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof Blob)return n}}function D(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(typeof r==`string`&&r&&r!==t)return r}}var O=(0,s.createContext)(null),k=e=>e.includes(`UPLOAD_IMAGE_`)||e.includes(`UPLOAD_BACKGROUND_`),A=({children:e})=>{let t=i.Ir(),n=i.Fr(a.s),[r,o]=(0,s.useState)(null),c=(0,s.useRef)(null),u=(0,s.useCallback)(e=>{c.current?.(e),c.current=null},[]),d=(0,s.useCallback)(e=>(u(null),o(e),t(a.r(e.entryModal)),new Promise(e=>{c.current=e})),[t,u]);(0,s.useEffect)(()=>{k(n)||(o(null),c.current&&u(null))},[n,u]);let f=(0,s.useMemo)(()=>({request:r,openImagePicker:d,resolveImagePicker:u}),[r,d,u]);return(0,l.jsx)(O.Provider,{value:f,children:e})},j=()=>{let e=(0,s.useContext)(O);if(!e)throw Error(`useImagePicker must be used within ImagePickerProvider`);return e};function M(e){if(!e)return!1;try{return i.Ar.getInstance(e,i.wa)!==void 0}catch{return!1}}function N(){let e=i.Lr();return(0,s.useMemo)(()=>M(e),[e])}Object.defineProperty(t,"a",{enumerable:!0,get:function(){return D}}),Object.defineProperty(t,"c",{enumerable:!0,get:function(){return C}}),Object.defineProperty(t,"d",{enumerable:!0,get:function(){return b}}),Object.defineProperty(t,"f",{enumerable:!0,get:function(){return _}}),Object.defineProperty(t,"g",{enumerable:!0,get:function(){return f}}),Object.defineProperty(t,"h",{enumerable:!0,get:function(){return p}}),Object.defineProperty(t,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(t,"l",{enumerable:!0,get:function(){return w}}),Object.defineProperty(t,"m",{enumerable:!0,get:function(){return m}}),Object.defineProperty(t,"n",{enumerable:!0,get:function(){return A}}),Object.defineProperty(t,"o",{enumerable:!0,get:function(){return T}}),Object.defineProperty(t,"p",{enumerable:!0,get:function(){return h}}),Object.defineProperty(t,"r",{enumerable:!0,get:function(){return j}}),Object.defineProperty(t,"s",{enumerable:!0,get:function(){return S}}),Object.defineProperty(t,"t",{enumerable:!0,get:function(){return N}}),Object.defineProperty(t,"u",{enumerable:!0,get:function(){return y}})});
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.setAttribute(`data-emailmaker`,`true`),e.appendChild(document.createTextNode(`@import "https://fonts.googleapis.com/css2?family=Geologica:wght@300;600&display=swap";.blocks-app .ant-modal.premium-features-modal .ant-modal-content{border-radius:calc(var(--borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .limit-upgrade-modal.ant-modal{max-width:calc(100vw - 24px)}.blocks-app .limit-upgrade-modal .ant-modal-content{border-radius:16px;padding:0;overflow:hidden;box-shadow:0 12px 24px -4px #191d3a14}.blocks-app .limit-upgrade-modal .ant-modal-header{display:none}.blocks-app .limit-upgrade-modal .ant-modal-content .ant-modal-body{padding:0}.blocks-app .limit-upgrade-modal__wrap{background:var(--colorBgContainer);flex-direction:column;align-items:center;width:400px;max-width:100%;display:flex}.blocks-app .limit-upgrade-modal__header{box-sizing:border-box;flex-direction:row;justify-content:flex-end;align-items:center;width:100%;min-height:34px;padding:8px 8px 0;display:flex}.blocks-app .limit-upgrade-modal__close{background:var(--colorBgContainer);width:34px;height:34px;color:var(--colorTextSecondary);cursor:pointer;border:none;border-radius:6px;justify-content:center;align-items:center;margin:0;padding:0;transition:background .15s,color .15s;display:flex}.blocks-app .limit-upgrade-modal__close:hover{background:var(--colorFillTertiary);color:var(--colorText)}.blocks-app .limit-upgrade-modal__close .anticon{font-size:16px}.blocks-app .limit-upgrade-modal__body{box-sizing:border-box;flex-direction:column;align-items:center;gap:16px;width:100%;padding:0 40px 24px;display:flex}.blocks-app .limit-upgrade-modal__title{text-align:center;max-width:320px;color:var(--colorText);margin:0;font-size:18px;font-weight:400;line-height:130%}.blocks-app .limit-upgrade-modal__subtitle{text-align:center;max-width:320px;color:var(--colorTextSecondary);margin:0;font-size:14px;font-weight:100;line-height:120%}.blocks-app .limit-upgrade-modal__limits-row{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;width:100%;max-width:320px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle{box-sizing:border-box;border:1px solid var(--colorText);width:34px;height:34px;color:var(--colorText);border-radius:32px;flex:none;justify-content:center;align-items:center;padding:8px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle .anticon{font-size:18px}.blocks-app .limit-upgrade-modal__icon-circle svg{flex-shrink:0;width:18px;height:18px;display:block}.blocks-app .limit-upgrade-modal__limit-old{color:#f85243;flex-shrink:0;font-size:40px;font-weight:100;line-height:100%}.blocks-app .limit-upgrade-modal__arrow-btn{color:#fff;background:#8946fb;border-radius:38px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.blocks-app .limit-upgrade-modal__arrow-icon{font-size:16px;transform:rotate(45deg)}.blocks-app .limit-upgrade-modal__limit-new{color:#7ed846;flex-shrink:0;font-size:40px;font-weight:400;line-height:100%}.blocks-app .limit-upgrade-modal__limit-new--infinity{font-size:36px;line-height:40px}.blocks-app .limit-upgrade-modal__divider{border:none;border-top:1px solid var(--colorBorderSecondary);width:100%;height:0;margin:0}.blocks-app .limit-upgrade-modal__footer{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:16px 0;display:flex}.blocks-app .limit-upgrade-modal__footer--dual{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;padding:16px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary{min-width:147px;height:32px;box-shadow:none;background:#2884ff;border-color:#2884ff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary:hover{background:#1a75f0;border-color:#1a75f0}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default{border-color:var(--colorBorder);min-width:147px;height:32px;color:var(--colorText);box-shadow:none;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default:hover{color:#2884ff;border-color:#2884ff}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();__emailmaker__.define(`static/core/542c10a0.js`,[`require`,`exports`,`module`,`static/core/354bf8a9.js`,`static/core/92ad1565.js`,`static/core/5f66a133.js`,`static/core/425f6198.js`,`static/core/b330862b.js`,`react`,`react-dom`,`react-router-dom`,`react/jsx-runtime`,`antd`,`react-dom/client`,`@ant-design/icons`],function(e,t,n){let r=e("./354bf8a9.js"),i=e("./5f66a133.js"),a=e("./b330862b.js");e("./92ad1565.js");let o=e("./425f6198.js"),s=e("react");s=r.l(s),e("react-dom");let c=e("react-router-dom"),l=e("react/jsx-runtime"),u=e("antd");e("react-dom/client");let d=e("@ant-design/icons");var f=({open:e,sideOnOk:t,onCancel:n,initialSlide:r=0})=>{let{__:a}=o.h(),u=(0,c.useNavigate)(),[d,f]=(0,s.useState)(r),p=(0,s.useRef)(null),m=i.wt(),h=()=>{t&&t(),u(`/billing`),n(!1)};(0,s.useEffect)(()=>{e&&p.current&&(p.current.goTo(r,!0),f(r))},[e,r]);let g=(0,s.useMemo)(()=>[{image:a(`https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png`),backgroundColor:`var(--blue-2)`,title:a(`More editing features`),description:a(`Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png`),backgroundColor:`var(--purple-2)`,title:a(`Work with the HTML code`),description:a(`Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png`),backgroundColor:`var(--cyan-2)`,title:a(`AI image generation`),description:a(`Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png`),backgroundColor:`var(--green-2)`,title:a(`Stock photos and GIFs`),description:a(`Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_NDYloAO.png`),backgroundColor:`var(--magenta-2)`,title:a(`Version history`),description:a(`Check who and when made changes to the email template and, if necessary, restore one of the previous versions.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png`),backgroundColor:`var(--red-2)`,title:a(`Image editor`),description:a(`Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png`),backgroundColor:`var(--orange-2)`,title:a(`Email optimization`),description:a(`Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png`),backgroundColor:`var(--volcano-2)`,title:a(`Team collaboration`),description:a(`Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png`),backgroundColor:`var(--geekblue-2)`,title:a(`Email testing`),description:a(`Check how your email appears across various devices and email clients.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png`),backgroundColor:`var(--geekblue-2)`,title:a(`AI assistant`),description:a(`Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!`)}],[a]);return(0,s.useEffect)(()=>{if(e&&p.current){p.current.goTo(r,!0),f(r);let e=g[r];m({event:`open_modal`,action:`open_premium-features_modal`,modal_id:`premium-features`,offer_id:e.title})}},[e,g,r,m]),(0,l.jsxs)(o.J,{open:e,footer:null,onCancel:n,closable:!1,className:`premium-features-modal`,classNames:{mask:`premium-features-modal-mask`},styles:{mask:{background:`rgba(0, 0, 0, 0.65)`}},width:1100,style:{maxWidth:`80%`},children:[(0,l.jsx)(o.V,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:`carousel-slider`,draggable:!0,autoplaySpeed:5e3,initialSlide:d,ref:p,children:g.map((e,t)=>(0,l.jsx)(`div`,{children:(0,l.jsxs)(`div`,{className:`carousel-slide`,style:{background:`${e.backgroundColor}`},children:[(0,l.jsx)(`div`,{className:`slide-item-image`,children:(0,l.jsx)(`img`,{src:e.image,alt:`slide-${t}`})}),(0,l.jsxs)(`div`,{className:`slide-item-content`,children:[(0,l.jsx)(`h3`,{className:`slide-title`,children:e.title}),(0,l.jsx)(`p`,{className:`slide-description`,children:e.description})]})]})},t))}),(0,l.jsx)(`div`,{className:`modal-subtitle`,children:a(`This and other features are available for you on any paid plan.`)}),(0,l.jsxs)(`div`,{className:`modal-buttons`,children:[(0,l.jsx)(o.It,{size:`large`,onClick:()=>n(!1),children:a(`Cancel`)}),(0,l.jsx)(o.It,{type:`primary`,size:`large`,onClick:h,style:{padding:`0 30px`},children:a(`Select plan`)})]})]})};function p(e){return e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,``),e=e.replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,``),e=e.replace(/ on\w+="[^"]*"/g,``),e=e.replace(/ on\w+='[^']*'/g,``),e}var m=({icon:e,...t})=>{let n=i.vn();return(0,l.jsx)(o.Ft,{icon:e,configIcons:(0,s.useMemo)(()=>{if(!n?.icons)return;let e={};for(let[t,r]of Object.entries(n.icons))typeof r==`string`&&(e[t]=p(r));return Object.keys(e).length>0?e:void 0},[n?.icons]),...t})},h={ai:`AIRequests`,email_generate:`EmailEnvelope`,image_generate:`Image`,optimization:`Optimization`,preview:`SendOutlined`,link_check:`Web`,image_check:`Image`,spam_check:`Block`,projects:`FolderOpen`,emails:`EmailEnvelope`,blocks:`Block`,users:`SliderGroup`};function g(e,t){if(e==null)return null;if(typeof e==`number`||typeof e==`string`){let n=e===`∞`||e===`∞`||e===`infinity`||typeof e==`string`&&e.toLowerCase()===`infinity`;return(0,l.jsx)(`span`,{className:t===`old`?`limit-upgrade-modal__limit-old`:`limit-upgrade-modal__limit-new${n?` limit-upgrade-modal__limit-new--infinity`:``}`,children:n?`∞`:e})}return e}var _=({open:e,onClose:t,title:n,subtitle:r,usageResource:i,icon:a,previousDisplay:s,nextDisplay:c,onChangePlan:f,secondaryAction:p,changePlanLabel:_})=>{let{__:v}=o.h(),y=_??v(`Change plan`),b=!!p,x=i==null?a??null:(0,l.jsx)(m,{icon:h[i]});return(0,l.jsx)(u.Modal,{open:e,onCancel:t,footer:null,closable:!1,width:400,centered:!0,className:`limit-upgrade-modal`,destroyOnClose:!0,maskClosable:!0,children:(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__wrap`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__header`,children:(0,l.jsx)(`button`,{type:`button`,className:`limit-upgrade-modal__close`,onClick:t,"aria-label":v(`Close`),children:(0,l.jsx)(d.CloseOutlined,{})})}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__body`,children:[(0,l.jsx)(`h1`,{className:`limit-upgrade-modal__title`,children:n}),(0,l.jsx)(`p`,{className:`limit-upgrade-modal__subtitle`,children:r}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__limits-row`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__icon-circle`,"aria-hidden":!0,children:x}),g(s,`old`),(0,l.jsx)(`div`,{className:`limit-upgrade-modal__arrow-btn`,"aria-hidden":!0,children:(0,l.jsx)(d.ArrowUpOutlined,{className:`limit-upgrade-modal__arrow-icon`})}),g(c,`new`)]})]}),(0,l.jsx)(`hr`,{className:`limit-upgrade-modal__divider`}),(0,l.jsx)(`div`,{className:b?`limit-upgrade-modal__footer limit-upgrade-modal__footer--dual`:`limit-upgrade-modal__footer`,children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Button,{className:`limit-upgrade-modal__cta-secondary`,onClick:p.onClick,children:p.label}),(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})]}):(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})})]})})},v={email_10_30:{id:`email_10_30`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:10,next:30,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 10→30`},email_30_300:{id:`email_30_300`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:30,next:300,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 30→300`},email_300_inf:{id:`email_300_inf`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:300,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 300→∞`},ai_10_50:{id:`ai_10_50`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:10,next:50,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 10→50`},ai_30_150:{id:`ai_30_150`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:30,next:150,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 30→150`},ai_150_inf:{id:`ai_150_inf`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:150,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 150→∞`},optimization_exceeded:{id:`optimization_exceeded`,titleKey:`You have used up your optimisation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`optimization`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: optimization exhausted`},image_generate_exceeded:{id:`image_generate_exceeded`,titleKey:`You have used up your image generation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_generate`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_generate exhausted`},preview_exceeded:{id:`preview_exceeded`,titleKey:`You have used up your preview (test send) limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`preview`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: preview exhausted`},link_check_exceeded:{id:`link_check_exceeded`,titleKey:`You have used up your link check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`link_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: link_check exhausted`},image_check_exceeded:{id:`image_check_exceeded`,titleKey:`You have used up your image check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_check exhausted`},spam_check_exceeded:{id:`spam_check_exceeded`,titleKey:`You have used up your spam check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`spam_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: spam_check exhausted`}};function y(e){return v[e]}function b(e){return e===`infinity`?`∞`:e}var x={ai:`ai_150_inf`,email_generate:`email_300_inf`,image_generate:`image_generate_exceeded`,preview:`preview_exceeded`,link_check:`link_check_exceeded`,image_check:`image_check_exceeded`,spam_check:`spam_check_exceeded`};function S(e){return!e||e.is_unlimited||e.total_limit<=0?!1:e.remaining<=0||e.used>=e.total_limit}function C(e,t){return S(t)?{presetId:x[e],previousLimit:t?.total_limit??0,nextLimit:`infinity`}:null}function w(e,t){return C(e,t)}function T(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(typeof n==`string`&&n)return n}}function E(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof Blob)return n}}function D(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(typeof r==`string`&&r&&r!==t)return r}}var O=(0,s.createContext)(null),k=e=>e.includes(`UPLOAD_IMAGE_`)||e.includes(`UPLOAD_BACKGROUND_`),A=({children:e})=>{let t=i.Ir(),n=i.Fr(a.s),[r,o]=(0,s.useState)(null),c=(0,s.useRef)(null),u=(0,s.useCallback)(e=>{c.current?.(e),c.current=null},[]),d=(0,s.useCallback)(e=>(u(null),o(e),t(a.r(e.entryModal)),new Promise(e=>{c.current=e})),[t,u]);(0,s.useEffect)(()=>{k(n)||(o(null),c.current&&u(null))},[n,u]);let f=(0,s.useMemo)(()=>({request:r,openImagePicker:d,resolveImagePicker:u}),[r,d,u]);return(0,l.jsx)(O.Provider,{value:f,children:e})},j=()=>{let e=(0,s.useContext)(O);if(!e)throw Error(`useImagePicker must be used within ImagePickerProvider`);return e};function M(e){if(!e)return!1;try{return i.Ar.getInstance(e,i.wa)!==void 0}catch{return!1}}function N(){let e=i.Lr();return(0,s.useMemo)(()=>M(e),[e])}Object.defineProperty(t,"a",{enumerable:!0,get:function(){return D}}),Object.defineProperty(t,"c",{enumerable:!0,get:function(){return C}}),Object.defineProperty(t,"d",{enumerable:!0,get:function(){return b}}),Object.defineProperty(t,"f",{enumerable:!0,get:function(){return _}}),Object.defineProperty(t,"g",{enumerable:!0,get:function(){return f}}),Object.defineProperty(t,"h",{enumerable:!0,get:function(){return p}}),Object.defineProperty(t,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(t,"l",{enumerable:!0,get:function(){return w}}),Object.defineProperty(t,"m",{enumerable:!0,get:function(){return m}}),Object.defineProperty(t,"n",{enumerable:!0,get:function(){return A}}),Object.defineProperty(t,"o",{enumerable:!0,get:function(){return T}}),Object.defineProperty(t,"p",{enumerable:!0,get:function(){return h}}),Object.defineProperty(t,"r",{enumerable:!0,get:function(){return j}}),Object.defineProperty(t,"s",{enumerable:!0,get:function(){return S}}),Object.defineProperty(t,"t",{enumerable:!0,get:function(){return N}}),Object.defineProperty(t,"u",{enumerable:!0,get:function(){return y}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define(`static/core/
|
|
1
|
+
__emailmaker__.define(`static/core/54c69205.js`,[`require`,`exports`,`module`,`static/core/92ad1565.js`,`static/core/542c10a0.js`,`static/core/5f66a133.js`,`react`,`react-router-dom`],function(e,t,n){let r=e("./5f66a133.js"),i=e("./92ad1565.js"),a=e("./542c10a0.js"),o=e("react"),s=e("react-router-dom");var c=()=>r.Ar.useInstance(r.pa);function l(e,t){if(e){if(t===`preview`){let t=e;return t.preview??t.test_sends}return e[t]}}function u(e,t){if(e?.flags){if(t===`preview`){let t=e.flags;return t.preview??t.test_sends}return e.flags[t]}}var d=[10,30,300],f=[10,50,150];function p(e,t){for(let n of t)if(n>e)return n;return`infinity`}function m(e){return e<=10?`email_10_30`:e<=30?`email_30_300`:`email_300_inf`}function h(e){return e<=10?`ai_10_50`:e<=50?`ai_30_150`:`ai_150_inf`}function g(e,t){return t?.limit_exceeded?!0:e.is_unlimited||e.total_limit<=0?!1:e.remaining<=0||e.used>=e.total_limit}var _=[`optimization`,`image_generate`,`preview`,`link_check`,`image_check`,`spam_check`];function v(e){return _.includes(e)}var y={optimization:`optimization_exceeded`,image_generate:`image_generate_exceeded`,preview:`preview_exceeded`,link_check:`link_check_exceeded`,image_check:`image_check_exceeded`,spam_check:`spam_check_exceeded`};function b(e,t,n){if(v(e))return null;let r=l(t,e),i=u(n,e);if(!r||!g(r,i))return null;let a=r.total_limit;return{kind:e,presetId:y[e],previousLimit:a,nextLimit:`infinity`}}function x(e,t){if(!e)return null;let n=l(e,`ai`),r=u(t,`ai`);if(n&&g(n,r)){let e=n.total_limit;return{kind:`ai`,presetId:h(e),previousLimit:e,nextLimit:p(e,f)}}let i=l(e,`email_generate`),a=u(t,`email_generate`);if(i&&g(i,a)){let e=i.total_limit;return{kind:`email_generate`,presetId:m(e),previousLimit:e,nextLimit:p(e,d)}}return b(`image_generate`,e,t)||b(`optimization`,e,t)||b(`preview`,e,t)||b(`link_check`,e,t)||b(`image_check`,e,t)||b(`spam_check`,e,t)}function S(e){return{presetId:h(e),previousLimit:e,nextLimit:p(e,f)}}function C(e){let t=String(e??``).split(`;`)[0].trim();if(!t)return``;let n=t.toLowerCase(),r=n.indexOf(`/`);if(r===-1)return n;let i=n.slice(r+1);return i===`svg+xml`?`svg`:i}async function w(e){if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);try{return{width:t.width,height:t.height}}finally{t.close?.()}}catch{}return new Promise((t,n)=>{let r=URL.createObjectURL(e),i=new Image;i.onload=()=>{URL.revokeObjectURL(r);let e=i.naturalWidth||i.width,a=i.naturalHeight||i.height;e>0&&a>0?t({width:e,height:a}):n(Error(`Could not read image dimensions`))},i.onerror=()=>{URL.revokeObjectURL(r),n(Error(`Could not decode image`))},i.src=r})}function T(e){return e.trim()}function E(){let e=new Map,t=new Map;function n(e,t){return t?new Promise((n,r)=>{if(t.aborted){r(new DOMException(`Aborted`,`AbortError`));return}let i=()=>{r(new DOMException(`Aborted`,`AbortError`))};t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{t.removeEventListener(`abort`,i),n(e)},e=>{t.removeEventListener(`abort`,i),r(e)})}):e}async function r(r,i,a){let o=T(r);if(!o)throw Error(`Empty image URL`);let s=e.get(o);if(s){if(i?.aborted)throw new DOMException(`Aborted`,`AbortError`);return s}let c=t.get(o);if(c)return n(c.promise,i);let l=new AbortController,u=a(o,l.signal).then(n=>(t.delete(o),e.set(o,n),n)).catch(e=>{throw t.delete(o),e});return t.set(o,{promise:u,controller:l}),n(u,i)}function i(n){let r=T(n);if(!r)return;let i=t.get(r);i&&(i.controller.abort(),t.delete(r)),e.delete(r)}function a(){for(let[,e]of t)e.controller.abort();t.clear(),e.clear()}return{resolve:r,abandonKey:i,invalidateAll:a}}async function D(e,t){if(!e||typeof e.findFileByUrl!=`function`)return null;let n=await e.findFileByUrl(t);if(!n)return null;let r=typeof e.getFileById==`function`&&n.id&&await e.getFileById(n.id)||n,i=r.url||t,a=r.thumbnailUrl||r.thumbnail||i||(typeof e.getThumbnailUrl==`function`?await e.getThumbnailUrl(r):``)||``;return a?{file:r,previewUrl:a}:null}function O(e){if(!(e instanceof Blob)||e.size===0)throw new i.T(`Failed to download file from the URL.`,`UploadUrlDownloadFailed`);let t=e.type?.split(`;`)[0]?.trim()||`image/png`;if(!t.startsWith(`image/`))throw new i.T(`Content type at the URL is not allowed.`,`UploadUrlContentTypeNotAllowed`);return{blob:e,mimeType:t}}async function k(e,t){let n=await fetch(e,t);if(!n.ok)throw Error(`Server returned ${n.status}`);return n.blob()}async function A(e,t,n){let o=n?{signal:n}:void 0,{blob:s}=await i.v(e,{handleFileProxy:async e=>a.i(await t.fireFileProxy(e))??null,handleProxyUrl:async e=>a.a(await t.fireProxyUrl(e),e),fetchWithProxy:(e,n,i)=>r.sa(e,{config:t.appConfig,standalone:t.isStandalone,intent:i?.intent||`downloadBlob`,validateBlob:async e=>!e.type||e.type.startsWith(`image/`),init:n})},e=>k(e,o),O,{fetchInit:o});return s}function j(){let e=r.vn(),t=a.t(),n=r.Fr(r.ct),{projectId:i}=(0,s.useParams)(),c=n?.id===void 0?i||``:String(n.id),l=r.q(r.Oa.FILE_PROXY_EVENT_ID),u=r.q(r.Oa.PROXY_URL_EVENT_ID);return(0,o.useCallback)(async(n,r)=>A(n,{appConfig:e,isStandalone:t,fireFileProxy:e=>l.fire({url:e,project:c}),fireProxyUrl:e=>u.fire({url:e,project:c})},r),[e,c,t,l,u])}Object.defineProperty(t,"a",{enumerable:!0,get:function(){return w}}),Object.defineProperty(t,"c",{enumerable:!0,get:function(){return x}}),Object.defineProperty(t,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(t,"l",{enumerable:!0,get:function(){return c}}),Object.defineProperty(t,"n",{enumerable:!0,get:function(){return D}}),Object.defineProperty(t,"o",{enumerable:!0,get:function(){return C}}),Object.defineProperty(t,"r",{enumerable:!0,get:function(){return T}}),Object.defineProperty(t,"s",{enumerable:!0,get:function(){return S}}),Object.defineProperty(t,"t",{enumerable:!0,get:function(){return j}})});
|