@emailmaker/emailmaker 1.1.103 → 1.1.108
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/CHANGELOG.md +34 -0
- package/README.md +1 -0
- package/emailmaker-core.d5e4bde1.js +859 -0
- package/emailmaker-esm.js +11 -11
- package/{emailmaker-po.3529b1de.js → emailmaker-po.d5e4bde1.js} +1 -1
- package/emailmaker.d.ts +144 -13
- package/emailmaker.js +12 -12
- package/iframe/.vite/manifest.json +13 -25
- package/iframe/css/sandbox.css +11 -9
- package/iframe/{iframe-eblock.3529b1de.html → iframe-eblock.d5e4bde1.html} +2 -2
- package/iframe/{iframe.3529b1de.html → iframe.d5e4bde1.html} +2 -2
- package/iframe/js/elMarkupHelper.C66zL1zp.js +279 -0
- package/iframe/js/iframe-eblock.body.d5e4bde1.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.d5e4bde1.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/iframe/js/{typograf.all.B0pVhMV_.js → typograf.all.Mun9CrLC.js} +12 -12
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{6efc4a78.js → 13b2a363.js} +3 -3
- package/static/core/{a4d1fdc5.js → 22140fa1.js} +1 -1
- package/static/core/{71d7c710.js → 2455e45e.js} +11 -11
- package/static/core/{7fd8d843.js → 2734fa96.js} +1 -1
- package/static/core/3a6dbf2b.js +7 -0
- package/static/core/{0cb54b92.js → 4797d4f7.js} +6 -6
- package/static/core/{5eaa42ac.js → 566e8ce8.js} +1 -1
- package/static/core/{b99c36c9.js → 6ba8aedc.js} +1 -1
- package/static/core/{9909de51.js → 6c52be40.js} +1 -1
- package/static/core/{73291b7c.js → 6e8d008d.js} +1 -1
- package/static/core/{c1460335.js → 6f6a92e3.js} +1 -1
- package/static/core/{2a6bfcb1.js → 756e184f.js} +1 -1
- package/static/core/7985de17.js +28 -0
- package/static/core/{b3d5871e.js → 7e51da74.js} +1 -1
- package/static/core/{3b315cf0.js → 7e69b03c.js} +1 -1
- package/static/core/{82f5152d.js → 8889dbc6.js} +1 -1
- package/static/core/8a621181.js +2 -0
- package/static/core/a22823f9.js +1 -0
- package/static/core/{1922419a.js → abcacabc.js} +1 -1
- package/static/core/{48387a41.js → b43852b9.js} +1 -1
- package/static/core/{9f7f5230.js → b712bb05.js} +1 -1
- package/static/core/{e420456c.js → b916e437.js} +1 -1
- package/static/core/{8fe408ef.js → d5cd2a7b.js} +1 -1
- package/static/core/{91e9b542.js → d74c1e57.js} +1 -1
- package/static/core/{66be8204.js → d8800deb.js} +1 -1
- package/static/core/{fbd1b42a.js → dbc12df7.js} +2 -2
- package/static/core/{5de7475e.js → e1f8b6ea.js} +1 -1
- package/static/core/e88db487.js +1 -0
- package/static/core/{9ca4cda3.js → ecaf7c36.js} +1 -1
- package/static/core/edf49656.js +4 -0
- package/static/core/{6dd152e5.js → f20ffa90.js} +3 -3
- package/static/core/{682a8e2c.js → f37da79c.js} +1 -1
- package/static/esm/73c89921.js +1 -0
- package/static/esm/delivery-libs.js +1 -1
- package/static/umd-runtime/delivery-libs.eFZaeVgo.js +1 -0
- package/static/umd-runtime/{runtime.D9PiY8Jx.js → runtime.BZcjM8iG.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.3529b1de.js +0 -859
- package/iframe/js/discussHandlers.BrvInbT7.js +0 -88
- package/iframe/js/iframe-eblock.body.3529b1de.js +0 -233
- package/iframe/js/iframe.body.3529b1de.js +0 -319
- package/iframe/js/rolldown-runtime.qcwTIabA.js +0 -1
- package/static/core/90715222.js +0 -28
- package/static/core/c9a013a6.js +0 -4
- package/static/core/d4619860.js +0 -7
- package/static/core/e6f6edff.js +0 -1
- package/static/esm/d4338c39.js +0 -1
- package/static/umd-runtime/delivery-libs.Cmqsjupj.js +0 -1
package/static/core/d4619860.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/61378c9e.js",["require","exports","module"],function(d,a,u){function l(c,s="application/octet-stream"){let t=c.trim(),o=s?.trim()||"application/octet-stream";const r=t.indexOf(",");if(t.startsWith("data:")&&r>=0){const e=t.slice(5,r).split(";")[0]?.trim();e&&(o=e),t=t.slice(r+1)}const m=t.replace(/\s/g,""),i=atob(m),n=new Uint8Array(i.length);for(let e=0;e<i.length;e++)n[e]=i.charCodeAt(e);return new Blob([n],{type:o})}Object.defineProperty(a,"base64ToBlob",{enumerable:!0,get:function(){return l}})});
|
|
2
|
-
|
|
3
|
-
(function(){try{if(typeof document<"u"){var t=".blocks-app .image-preview{text-align:center;min-height:100px;position:relative}.blocks-app .image-preview .image-editor-modal{border:1px solid red}.blocks-app .image-preview__edit-button{position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-preview img{border:1px solid var(--em-colorBorder);border-radius:6px;max-width:100%;max-height:500px}.blocks-app .serach-results .ant-row{align-items:center}.blocks-app .serach-results .blocks-search__divider-wrapper{margin-top:12px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{border-top:1px solid var(--em-colorBorderSecondary);background:0 0;width:100%;height:1px;min-height:0;margin:0;position:static}.blocks-app .slideshow-container{width:524px;height:350px;margin:auto;position:relative;overflow:hidden}.blocks-app .slideshow-image{opacity:0;width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .image-ai .slideshow-image{width:auto;height:auto}.blocks-app .image-ai__image-item{text-align:center;border-radius:6px;justify-content:center;align-items:center;min-height:100px;display:flex;position:relative}.blocks-app .image-ai__image-item .buttons{justify-content:space-between;display:flex;position:absolute;bottom:10px;left:50%;transform:translate(-50%)}.blocks-app .image-ai .text-area-input-hybrid{border:none;outline:none;min-height:0;padding:0 0 0 1px}.blocks-app .image-ai .text-area-input-hybrid textarea{height:32px;min-height:32px;padding:3px 11px;line-height:26px}.blocks-app .image-ai__loading{justify-content:center;align-items:center;min-height:150px;display:flex}.blocks-app .image-ai__loading .spin{flex-direction:column;justify-content:center;align-items:center;height:150px;display:flex}.blocks-app .image-ai__loading .status{margin:3px 0 0}.blocks-app .image-ai__preview{border-radius:6px;margin-top:24px;overflow:hidden}.blocks-app .image-ai__preview .image-ai__image-item img{border-radius:calc(var(--em-borderRadius) * 1px);object-fit:contain;max-height:100%;transition:height 1s;top:50%;left:50%;overflow:hidden;transform:translate(-50%,-50%)}.blocks-app .image-ai .small{width:302px;height:202px}.blocks-app .image-ai .large{width:524px;height:350px}.blocks-app .image-ai .image-ai__row{padding:0 2px}.blocks-app .image-ai .image-ai__input-affix-wrapper{border-style:solid;border-width:calc(var(--em-borderWidth) * 1px);border-color:var(--em-colorFillSecondaryDarken);border-radius:calc(var(--em-borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--em-borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--em-colorPrimaryBorder)}.blocks-app .image-ai .image-ai__textarea{font-size:16px}.blocks-app .image-ai .image-ai__input-icon{font-size:16px;top:0;right:0}.dark .blocks-app .image-ai .image-ai__preview .image-ai__image-item img{background:#2b2b2b;border:1px solid #434343}.dark .blocks-app .image-ai .ant-btn{background:#1f1f1f}.dark .blocks-app .image-ai .ant-btn:hover{color:var(--em-colorPrimary)}.blocks-app .stock-tab img{border-radius:0;max-width:none;max-height:none}.blocks-app .stock-tab .stock-search-input{padding:0 2px}.blocks-app .stock-tab .my-masonry-grid{text-align:center;width:auto;display:flex}.blocks-app .stock-tab .my-masonry-grid_column{background-clip:padding-box}.blocks-app .stock-tab .list-item{cursor:pointer;background:#f0f2f5;border:1px solid #f0f2f5;border-radius:6px;min-height:100px;max-height:100px;margin-bottom:20px;transition:all .3s;display:inline-block;position:relative;overflow:hidden}.blocks-app .stock-tab .list-item .overlay-image{opacity:0;background-size:cover;width:110px;height:40px;transition:opacity .5s;position:absolute;bottom:10px;right:10px}.blocks-app .stock-tab .list-item .ant-spin{color:#f0f2f5;font-size:20px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.blocks-app .stock-tab .list-item img{object-fit:cover;opacity:0;border-radius:6px;height:auto;transition:opacity .5s ease-in-out;display:block}.blocks-app .stock-tab .list-item.loaded{border:1px solid #d9d9d9;max-height:1000px}.blocks-app .stock-tab .list-item.loaded img{opacity:1;height:100%}.blocks-app .stock-tab .list-item.loaded .loaded-image{opacity:.5}.blocks-app .stock-tab .list-item:hover{box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.blocks-app .stock-tab .list-item:hover p.creator-info,.blocks-app .stock-tab .list-item:hover .overlay-image{opacity:1}.blocks-app .stock-tab .list-item p.creator-info{color:#fff;opacity:0;background-color:#00000080;border-radius:0 0 6px;margin:0;padding:5px;font-size:10px;line-height:1.2;position:absolute;bottom:0;right:0}.blocks-app .stock-tab .list-item p.creator-info:hover a{color:#fff;text-decoration:underline}.blocks-app .stock-tab .list-item p.creator-info a{color:#fff;text-decoration:none}.blocks-app .stock-color-filter{display:flex}.blocks-app .stock-color-filter label{border-width:1px;width:24px;height:24px;margin:4px;padding:0;font-size:0;border-radius:6px!important}.blocks-app .stock-color-filter label.all-colors{background-image:linear-gradient(135deg,red,#ff7f00,#ff0,#0f0,#00f,#8b00ff)}.blocks-app .stock-color-filter label.black-color{background:#222}.blocks-app .stock-color-filter label.bw-color{background-image:linear-gradient(135deg,#222 50%,#fff 50%)}.blocks-app .stock-color-filter label.white-color{background:#fff}.blocks-app .stock-color-filter label.orange-color{background:#fa8c16}.blocks-app .stock-color-filter label.red-color{background:#f5222d}.blocks-app .stock-color-filter label.purple-color{background:#722ed1}.blocks-app .stock-color-filter label.magenta-color{background:#eb2f96}.blocks-app .stock-color-filter label.green-color{background:#52c41a}.blocks-app .stock-color-filter label.teal-color{background:#43c3c3}.blocks-app .stock-color-filter label.blue-color{background:#1677ff}.blocks-app .stock-color-filter .ant-radio-button-wrapper:not(:first-child):before{display:none}.blocks-app .serach-results{padding-top:6px}.blocks-app .serach-results .stock-search-input{width:322px;padding:0 2px}.blocks-app .serach-results .blocks-search__divider-wrapper{width:calc(100% + 48px);margin-top:12px;margin-left:-24px;margin-right:-24px;position:relative}.blocks-app .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{pointer-events:none;border-top:1px solid var(--em-colorBorderSecondary);background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-bottom:none;width:100%;height:20px;min-height:20px;margin:0;position:relative;bottom:auto;left:auto;right:auto}.dark .blocks-app .image-center .stock-tab .serach-results .blocks-search__divider-wrapper .ant-divider-horizontal{background:linear-gradient(180deg, var(--em-colorBgBase), transparent 40%)}.dark .blocks-app .stock-tab .list-item{background:#2b2b2b;border:1px solid #2b2b2b}.dark .blocks-app .stock-tab .list-item.loaded{border:1px solid #434343}.blocks-app .image-center .image-center-image-preview{justify-content:center;align-items:center;display:flex}.blocks-app .image-center .ant-divider-horizontal{pointer-events:none;z-index:1;background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);width:calc(100% + 48px);height:20px;margin:24px -24px 0;position:absolute;bottom:-19px}.dark .blocks-app .image-center .ant-divider-horizontal{background:linear-gradient(180deg, var(--em-colorBgBase), transparent 40%)}.blocks-app .image-center .ant-divider-horizontal.ant-divider-with-text{background:0 0;width:calc(100% + 38px);margin:0 -24px 20px;position:relative;top:0}.blocks-app .image-center img{border-radius:4px;max-width:524px;max-height:352px}.blocks-app .image-center .image-size{justify-content:center;margin-top:6px;font-size:14px;line-height:22px;display:flex}.blocks-app .image-center .ant-upload.ant-upload-drag{border-radius:6px}.blocks-app .image-center .ant-modal-body .stock-search-input{margin-bottom:0}.blocks-app .image-center .ant-modal-body .serach-results .stock-search-input{margin-bottom:10px}.blocks-app .image-center .ant-modal-body .ant-form:not(.serach-results) .ant-form-item:last-child{margin-bottom:0}.blocks-app .image-center .ant-modal-body .ant-tabs{transition:all .7s cubic-bezier(.075,.82,.165,1)}.blocks-app .image-center .ant-modal-body .ant-tabs .ant-tabs-content-holder{overflow-y:clip}.blocks-app .ant-modal{transition:width .7s ease-in-out}",e=window.__emailmaker_styles__||(window.__emailmaker_styles__={sheets:{},order:[]}),r=t;if(!e.sheets[r]){var o=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(o=new CSSStyleSheet,o.replaceSync(t))}catch{o=null}if(o){if(!e.host||!e.host.isConnected||!e.host.sheet){var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),document.head.appendChild(a),e.host=a}for(var l=e.host.sheet,p=0;p<o.cssRules.length;p++)try{l.insertRule(o.cssRules[p].cssText,l.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(t),(e.listeners||[]).forEach(function(i){try{i(t)}catch{}})}else{var a=document.createElement("style");a.setAttribute("data-emailmaker","true"),a.appendChild(document.createTextNode(t)),document.head.appendChild(a)}e.sheets[r]=!0,e.order.push(r)}}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
4
|
-
__emailmaker__.define("static/core/d4619860.js",["require","exports","module","static/core/5dc34752.js","static/core/a68428d8.js","static/core/3acdfe13.js","static/core/90715222.js","static/core/61378c9e.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper"],function(ce,yt,un){const Ye=ce("./5dc34752.js"),Ae=ce("./a68428d8.js"),s=ce("./3acdfe13.js"),ee=ce("./90715222.js"),At=ce("./61378c9e.js");let e=ce("react");e=Ye.__toESM(e);let t=ce("react/jsx-runtime"),m=ce("__delivery__/libs"),bt=ce("vite/preload-helper");var wt=Ye.__toESM(s.require_prop_types()),It=[10,50,150];function kt(r,o){for(const l of o)if(l>r)return l;return"infinity"}function _t(r){return r<=10?"ai_10_50":r<=50?"ai_30_150":"ai_150_inf"}function xt(r){return{presetId:_t(r),previousLimit:r,nextLimit:kt(r,It)}}var Et=s.lazyRoute(()=>(0,bt.__vitePreload)(()=>Promise.resolve().then(()=>ce("./9ca4cda3.js")),void 0,{}.url));function St(r){return s.useSelector(s.selectSecondModal)?(0,t.jsx)(e.Suspense,{fallback:null,children:(0,t.jsx)(Et,{...r})}):null}var jt=({currentImageLink:r,newLink:o,previewDisplayUrl:l,resolvedPreviewObjectUrl:c,resolvedPreviewBlob:u,resolveImageBlob:a,onSave:y,uploadImageResultIsLoading:h})=>{const p=l||c;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"image-preview",children:[h&&(0,t.jsx)("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:s.emCssVar("colorBgLayout"),zIndex:10,opacity:.7},children:(0,t.jsx)(m.ui_kit$Spin,{size:"large"})}),p&&(0,t.jsx)("img",{alt:"uploadedImage",src:p})]})}),(0,t.jsx)(St,{currentImageLink:r,prefetchedBlob:u,resolveImageBlob:a,newLink:o,onSave:y,uploadImageResultIsLoading:h})]})},_e={Pixel:"Pixel",Percent:"Percent"},Ze={unit:_e.Percent,value:80};function Rt(r){return typeof r=="number"?{unit:_e.Percent,value:r*100}:typeof r=="string"?/^(\d*(\.\d+)?)px$/.exec(r)?{unit:_e.Pixel,value:parseFloat(r)}:/^(\d*(\.\d+)?)%$/.exec(r)?{unit:_e.Percent,value:parseFloat(r)}:Ze:Ze}function Ot(r,o){const l=Rt(r);let c;return l.unit===_e.Pixel?c=`${l.value}px`:c=`${100-l.value}%`,o?`${c} 0px 0px 0px`:`0px 0px ${c} 0px`}function Je({next:r,hasMore:o,children:l,loader:c,scrollThreshold:u=.8,endMessage:a,style:y,height:h,scrollableTarget:p,hasChildren:k,inverse:I=!1,pullDownToRefresh:f=!1,pullDownToRefreshContent:A,releaseToRefreshContent:E,pullDownToRefreshThreshold:b=100,refreshFunction:O,onScroll:g,dataLength:R,initialScrollY:S,className:$="",role:V,tabIndex:D,id:M,...F}){const[te,T]=(0,e.useState)(!1),[H,K]=(0,e.useState)(!1),[Z,ne]=(0,e.useState)(0),_=(0,e.useRef)(null),z=(0,e.useRef)(null),Q=(0,e.useRef)(null),N=(0,e.useRef)(r);N.current=r;const q=(0,e.useRef)(O);q.current=O;const L=(0,e.useRef)(b);L.current=b;const n=(0,e.useRef)(!1),C=(0,e.useRef)(!1),x=(0,e.useRef)(0),Y=(0,e.useRef)(0),W=(0,e.useRef)(0),U=(0,e.useCallback)(()=>p instanceof HTMLElement?p:typeof p=="string"?document.getElementById(p):null,[p]);(0,e.useEffect)(()=>{if(typeof R>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(f&&typeof O!="function")throw new Error(`Mandatory prop "refreshFunction" missing.
|
|
5
|
-
Pull Down To Refresh functionality will not work
|
|
6
|
-
as expected. Check README.md for usage'`);if(typeof S=="number"){const B=h?_.current:U();B&&B.scrollHeight>S&&B.scrollTo(0,S)}},[]),(0,e.useEffect)(()=>{n.current=!1,T(!1)},[R]),(0,e.useEffect)(()=>{if(!o||typeof IntersectionObserver>"u")return;const B=z.current;if(!B)return;const re=h?_.current:U(),j=new IntersectionObserver(([se])=>{!se.isIntersecting||n.current||(n.current=!0,T(!0),N.current())},{root:re,rootMargin:Ot(u,I),threshold:0});return j.observe(B),()=>j.disconnect()},[o,u,I,h,U]),(0,e.useEffect)(()=>{var B;if(!g)return;const re=(B=h?_.current:U())!==null&&B!==void 0?B:typeof window<"u"?window:null;if(!re)return;const j=se=>{setTimeout(()=>g(se),0)};return re.addEventListener("scroll",j),()=>re.removeEventListener("scroll",j)},[g,h,U]),(0,e.useEffect)(()=>{var B,re;if(!f)return;const j=(B=h?_.current:U())!==null&&B!==void 0?B:typeof window<"u"?window:null;if(!j)return;if(!((re=Q.current)===null||re===void 0)&&re.firstChild){const P=Q.current.firstChild.getBoundingClientRect().height;W.current=P,ne(P)}const se=P=>{(j instanceof HTMLElement?j.scrollTop:document.documentElement.scrollTop)>0||(C.current=!0,P instanceof MouseEvent?x.current=P.pageY:P instanceof TouchEvent&&(x.current=P.touches[0].pageY),Y.current=x.current,_.current&&(_.current.style.willChange="transform",_.current.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},v=P=>{if(!C.current||(P instanceof MouseEvent?Y.current=P.pageY:P instanceof TouchEvent&&(Y.current=P.touches[0].pageY),Y.current<x.current))return;const ue=Y.current-x.current;ue>=L.current&&K(!0),!(ue>W.current*1.5)&&_.current&&(_.current.style.overflow="visible",_.current.style.transform=`translate3d(0px, ${ue}px, 0px)`)},J=()=>{x.current=0,Y.current=0,C.current=!1,K(P=>{var ue;return P&&((ue=q.current)===null||ue===void 0||ue.call(q)),!1}),requestAnimationFrame(()=>{_.current&&(_.current.style.overflow="auto",_.current.style.transform="none",_.current.style.willChange="unset")})};return j.addEventListener("touchstart",se),j.addEventListener("touchmove",v),j.addEventListener("touchend",J),j.addEventListener("mousedown",se),j.addEventListener("mousemove",v),j.addEventListener("mouseup",J),()=>{j.removeEventListener("touchstart",se),j.removeEventListener("touchmove",v),j.removeEventListener("touchend",J),j.removeEventListener("mousedown",se),j.removeEventListener("mousemove",v),j.removeEventListener("mouseup",J)}},[f,h,U]);const oe={height:h??"auto",overflow:"auto",WebkitOverflowScrolling:"touch",...y},he=k||!!(l&&l instanceof Array&&l.length),ge=f&&h?{overflow:"auto"}:{},ie=o?(0,t.jsx)("div",{ref:z,style:{height:1}}):null;return(0,t.jsx)("div",{style:ge,className:"infinite-scroll-component__outerdiv",children:(0,t.jsxs)("div",{...F,role:V,tabIndex:D,id:M,className:["infinite-scroll-component",$].filter(Boolean).join(" "),ref:_,style:oe,children:[f&&(0,t.jsx)("div",{style:{position:"relative"},ref:Q,children:(0,t.jsx)("div",{style:{position:"absolute",left:0,right:0,top:-1*Z},children:H?E:A})}),l,!te&&!he&&o&&c,te&&o&&c,ie,!o&&a]})})}function Lt(r,o){if(r==null)return{};var l=Pt(r,o),c,u;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(u=0;u<a.length;u++)c=a[u],!(o.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(r,c)&&(l[c]=r[c])}return l}function Pt(r,o){if(r==null)return{};for(var l={},c=Object.keys(r),u,a=0;a<c.length;a++)u=c[a],!(o.indexOf(u)>=0)&&(l[u]=r[u]);return l}function Le(){return Le=Object.assign||function(r){for(var o=1;o<arguments.length;o++){var l=arguments[o];for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(r[c]=l[c])}return r},Le.apply(this,arguments)}function Xe(r,o){var l=Object.keys(r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);o&&(c=c.filter(function(u){return Object.getOwnPropertyDescriptor(r,u).enumerable})),l.push.apply(l,c)}return l}function xe(r){for(var o=1;o<arguments.length;o++){var l=arguments[o]!=null?arguments[o]:{};o%2?Xe(Object(l),!0).forEach(function(c){Dt(r,c,l[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(l)):Xe(Object(l)).forEach(function(c){Object.defineProperty(r,c,Object.getOwnPropertyDescriptor(l,c))})}return r}function Dt(r,o,l){return o in r?Object.defineProperty(r,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[o]=l,r}var Ut={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0},Me=2,Ge=class extends e.default.Component{constructor(r){super(r),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this);let o;this.props.breakpointCols&&this.props.breakpointCols.default?o=this.props.breakpointCols.default:o=parseInt(this.props.breakpointCols)||Me,this.state={columnCount:o}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){if(!window||!window.requestAnimationFrame){this.reCalculateColumnCount();return}window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})}reCalculateColumnCount(){const r=window&&window.innerWidth||1/0;let o=this.props.breakpointCols;typeof o!="object"&&(o={default:parseInt(o)||Me});let l=1/0,c=o.default||Me;for(let u in o){const a=parseInt(u);a>0&&r<=a&&a<l&&(l=a,c=o[u])}c=Math.max(1,parseInt(c)||1),this.state.columnCount!==c&&this.setState({columnCount:c})}itemsInColumns(){const r=this.state.columnCount,o=new Array(r),l=e.default.Children.toArray(this.props.children);for(let c=0;c<l.length;c++){const u=c%r;o[u]||(o[u]=[]),o[u].push(l[c])}return o}renderColumns(){const{column:r,columnAttrs:o={},columnClassName:l}=this.props,c=this.itemsInColumns(),u=`${100/c.length}%`;let a=l;a&&typeof a!="string"&&(this.logDeprecated('The property "columnClassName" requires a string'),typeof a>"u"&&(a="my-masonry-grid_column"));const y=xe(xe(xe({},r),o),{},{style:xe(xe({},o.style),{},{width:u}),className:a});return c.map((h,p)=>e.default.createElement("div",Le({},y,{key:p}),h))}logDeprecated(r){}render(){const r=this.props,{children:o,breakpointCols:l,columnClassName:c,columnAttrs:u,column:a,className:y}=r,h=Lt(r,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let p=y;return typeof y!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof y>"u"&&(p="my-masonry-grid")),e.default.createElement("div",Le({},h,{className:p}),this.renderColumns())}};Ge.defaultProps=Ut;function Te(r,o){return r?r.exhausted?{...r,src:null}:{...r,src:r.src||o||null}:null}function et({items:r,getItemId:o,getRequestUrl:l,createController:c}){const[u,a]=(0,e.useState)({}),y=(0,e.useRef)(new Map),h=(0,e.useCallback)(p=>{const k=o(p),I=l(p),f=`${k}:${I}`;if(y.current.has(f))return{itemId:k,requestUrl:I,cacheKey:f,controller:y.current.get(f)};const A=c(I);return y.current.set(f,A),{itemId:k,requestUrl:I,cacheKey:f,controller:A}},[c,o,l]);return(0,e.useEffect)(()=>{const p=new Set,k={},I=r.map(f=>{const{itemId:A,cacheKey:E,controller:b}=h(f);p.add(E),k[A]=b.src;const O=Te(b.handleChangeSrc?.(),b.src);return O?.changed&&O.src&&(k[A]=O.src),b.subscribeToSrcChange?.(g=>{const R=Te(g,b.src);!R?.changed||!R.src||a(S=>S[A]===R.src?S:{...S,[A]:R.src})})}).filter(Boolean);return y.current.forEach((f,A)=>{p.has(A)||y.current.delete(A)}),a(k),()=>{I.forEach(f=>f?.())}},[h,r]),{getDisplaySrc:(0,e.useCallback)(p=>{const{itemId:k,requestUrl:I,controller:f}=h(p);return u[k]||f.src||I},[u,h]),handleLoad:(0,e.useCallback)(p=>{h(p).controller.handleSuccess()},[h]),handleError:(0,e.useCallback)(p=>{const{itemId:k,controller:I}=h(p),f=Te(I.handleError(),I.src);f?.changed&&f.src&&a(A=>({...A,[k]:f.src}))},[h])}}var tt="blocks",Mt=({setCurrentImageLink:r,setModalHeight:o,setModalWidth:l,setImageStockList:c,imageStockList:u,currentReq:a,setCurrentReq:y,inputRef:h,setStockLink:p,customRequest:k})=>{const I=s.useAppConfig(),f=s.useIsStandalone(),[A,E]=(0,e.useState)(!1),[b,O]=(0,e.useState)(2),{__:g}=s.useI18n(),R=s.useNotification(),[S]=s.useLazyGetUnsplashImageQuery(),[$]=s.useLazyGetSearchImageQuery(),V=(0,e.useCallback)(n=>n instanceof Error||typeof n?.message=="string"&&n.message?n.message:typeof n?.error?.message=="string"&&n.error.message?n.error.message:g("Failed to load stock images through the configured proxy chain."),[g]),D=(0,e.useCallback)(n=>{R.error({id:"STOCK_IMAGES_SEARCH_FAILED",title:g("Failed to load stock images"),description:V(n)})},[g,V,R]),M=async()=>{A||(E(!0),$({query:a,page:b}).then(n=>{if(n?.error){D(n.error),E(!1);return}const C=n?.data?.results||[];c(x=>[...x,...C]),E(!1),O(x=>x+1)}).catch(()=>{E(!1)}))};(0,e.useEffect)(()=>{a.keywords!==""&&F()},[a.color,a.orientation]);const F=async()=>{const n=await $({query:a,page:1});if(n?.error){D(n.error),c([]);return}const C=n?.data?.results||[];C.length>0?(c(C),setTimeout(()=>{l(1060),o("84vh")},0)):c([])},[te,T]=(0,e.useState)(null),H=(0,e.useCallback)((n,C,x)=>`${n}${n.includes("?")?"&":"?"}w=${C}&q=${x}`,[]),K=(0,e.useCallback)(n=>Ae.getProxiedUrl(n,{config:I,standalone:f,resourceType:"stockImages",intent:"display"}),[I,f]),Z=(0,e.useCallback)(n=>n.id,[]),ne=(0,e.useCallback)(n=>H(n.urls.raw,644,96),[H]),{getDisplaySrc:_,handleLoad:z,handleError:Q}=et({items:u,getItemId:Z,getRequestUrl:ne,createController:K}),N=n=>C=>{z(n),C.target.parentNode.classList.add("loaded")},q=n=>()=>{Q(n)},L=(n,C,x)=>{S(C.download_location),T(x),setTimeout(()=>T(null),2e3),p(`${n.raw}&w=1200&q=96`),r(`${n.raw}&w=1200&q=96`),k(`${n.raw}&w=1200&q=96`)};return(0,t.jsxs)("div",{className:"stock-tab",children:[(0,t.jsxs)(m.ui_kit$Form,{onValuesChange:F,className:u.length>0?"serach-results":"",children:[(0,t.jsxs)(m.ui_kit$Row,{gutter:24,children:[(0,t.jsx)(m.ui_kit$Col,{span:u.length>0?"":24,children:(0,t.jsx)(m.ui_kit$Form.Item,{className:"stock-search-input",children:(0,t.jsx)(m.ui_kit$SearchInput,{onSearch:F,allowClear:!0,size:u.length>0?"medium":"large",placeholder:g("Search image"),value:a.keywords,onChange:n=>y(C=>({...C,keywords:n.target.value})),ref:h,spellCheck:"false",enterButton:!1})})}),u.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.ui_kit$Col,{children:(0,t.jsxs)(m.ui_kit$Radio.Group,{defaultValue:"",onChange:n=>y(C=>({...C,orientation:n.target.value})),children:[(0,t.jsx)(m.ui_kit$Tooltip,{title:g("All"),placement:"top",children:(0,t.jsx)(m.ui_kit$Radio.Button,{value:"",children:(0,t.jsx)(s.EmIcons,{icon:"MixedView",component:m.icons$MixedView})})}),(0,t.jsx)(m.ui_kit$Tooltip,{title:g("Landscape"),placement:"top",children:(0,t.jsx)(m.ui_kit$Radio.Button,{value:"landscape",children:(0,t.jsx)(s.EmIcons,{icon:"LandscapeView",component:m.icons$LandscapeView})})}),(0,t.jsx)(m.ui_kit$Tooltip,{title:g("Portrait"),placement:"top",children:(0,t.jsx)(m.ui_kit$Radio.Button,{value:"portrait",children:(0,t.jsx)(s.EmIcons,{icon:"PortraitView",component:m.icons$PortraitView})})}),(0,t.jsx)(m.ui_kit$Tooltip,{title:g("Squarish"),placement:"top",children:(0,t.jsx)(m.ui_kit$Radio.Button,{value:"squarish",children:(0,t.jsx)(s.EmIcons,{icon:"SquareView",component:m.icons$SquareView})})})]})}),(0,t.jsx)(m.ui_kit$Col,{children:(0,t.jsx)(m.ui_kit$RadioColorFilter,{defaultValue:"",onChange:n=>y(C=>({...C,color:n.target.value})),options:[{value:"",colorClass:"all-colors",label:g("All")},{value:"black",colorClass:"black-color",label:g("Black")},{value:"black_and_white",colorClass:"bw-color",label:g("Black and White")},{value:"white",colorClass:"white-color",label:g("White")},{value:"orange",colorClass:"orange-color",label:g("Orange")},{value:"red",colorClass:"red-color",label:g("Red")},{value:"purple",colorClass:"purple-color",label:g("Purple")},{value:"magenta",colorClass:"magenta-color",label:g("Magenta")},{value:"green",colorClass:"green-color",label:g("Green")},{value:"teal",colorClass:"teal-color",label:g("Teal")},{value:"blue",colorClass:"blue-color",label:g("Blue")}],tooltipPlacement:"top"})})]})]}),u.length>0&&(0,t.jsx)("div",{className:"blocks-search__divider-wrapper",children:(0,t.jsx)("div",{className:"ant-divider ant-divider-horizontal",role:"separator"})})]}),(0,t.jsx)("div",{className:"serach-output-wrapper",style:{marginRight:-10},children:u.length>0&&(0,t.jsx)("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"},children:(0,t.jsx)(Je,{dataLength:u&&u.length,next:M,hasMore:u,endMessage:(0,t.jsxs)(m.ui_kit$Divider,{plain:!0,children:[g("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:null,children:(0,t.jsx)(Ge,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column",children:u.map(n=>(0,t.jsxs)("div",{className:"list-item",onClick:()=>L(n.urls,n.links,n.id),children:[(0,t.jsx)("img",{className:te===n.id?"loaded-image":"",width:"322px",src:_(n),alt:n.description,onLoad:N(n),onError:q(n)}),(0,t.jsxs)("p",{className:"creator-info",onClick:C=>C.stopPropagation(),children:["Photo by"," ",(0,t.jsx)("a",{target:"_blank",href:`${n.user.links.html}?utm_source=${tt}&utm_medium=referral`,rel:"noreferrer",children:n.user.name})," ","on"," ",(0,t.jsx)("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${tt}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),te===n.id&&(0,t.jsx)(m.ui_kit$Spin,{className:"ant-spin",size:"small"})]},n.id))})})})})]})};function nt(r){return/^(https?:)?\/\//i.test(r.trim())}function Gt(r){const o=r.trim();return nt(o)||/^data:/i.test(o)?o:`data:image/jpeg;base64, ${r}`}var Tt=({images:r,transitionDuration:o=1e3})=>{const[l,c]=(0,e.useState)([]);return(0,e.useEffect)(()=>{if(r.length>0){const u=r[r.length-1];c(a=>[...a,{src:u,opacity:0}]),setTimeout(()=>{c(a=>a.map((y,h)=>h===a.length-1?{...y,opacity:1}:y))},1e3)}},[r]),(0,t.jsx)("div",{className:"slideshow-container",children:l.map((u,a)=>(0,t.jsx)("img",{src:Gt(u.src),alt:`Slide ${a+1}`,className:"slideshow-image",style:{opacity:u.opacity,transition:`opacity ${o}ms linear`}},a))})};function Nt({setModalHeight:r,customRequest:o,aiTabRef:l,isImageUploaded:c,setIsImageUploaded:u,aiImageRequest:a,imageAiList:y,setImageAiList:h,isLoadingAi:p,setIsLoadingAi:k,onPluginAiImageLimitExceeded:I,onImageGenerateLimitExceeded:f}){const{__:A}=s.useI18n(),E=s.useAppConfig(),b=s.useNotification(),O=s.usePushToDataLayer(),{blockId:g}=s.useRouteParams(),R=s.useEditorProjectId(),S=s.useRouteEmailId(),[$]=s.useLazySendAiImageRequestQuery(),[V,{data:D=[]}]=s.useLazyGetAiImageSSEQuery(),M=s.useProjectPlanLimitPreflight(),F=E?.sendAIImageRequest||$,te=E?.trigger||V,T=E?.handleLimitUsageEmitter||s.useEventEmitter(Ae.events.ON_LIMIT_ID),[H,K]=(0,e.useState)(0),[Z,ne]=(0,e.useState)(null),[_,z]=(0,e.useState)(!1),[Q,N]=(0,e.useState)(A("Evaluating the task")),[q,L]=(0,e.useState)(!1),n=S||g,{limits:C}=E?.limits?E:{limits:{ai_img_limit:0}},{ai_img_limit:x}=C,Y=!!(E.limits&&E.counters)&&!0,W=s.useEventEmitter(Ae.events.AI_IMAGE_REQUEST_ID).hasListeners(),U=ee.shouldCountAiUsage({limitsInPlugin:Y,hostedAiActive:W}),oe=!W&&x>0&&H>=x,he=(0,e.useCallback)(()=>{T.fire({name:"AiImgCount",count:H+1})},[T,H]),ge=(0,e.useMemo)(()=>!oe&&(!U||x===0||H<x),[oe,U,H,x]),ie=(0,e.useCallback)(async()=>{N(A("Evaluating the task")),a!==""&&!p&&(k(!0),L(!0),h([]),O({event:"submit_form",action:"ai_image_generation",entity_id:S,project_id:R}),F({body:{project_id:R,request:"create-image",connection:"midjourney",message:a}}).then(({data:v,error:J})=>{if(J)throw J;if(v.data.status===401)throw new Error(s.ERROR);if(v?.data?._eventResult){h(v.data.task.images),k(!1),L(!1),N(A("Evaluating the task"));return}v?.data.status===200?(v?.data.task.id&&(N(v.data.task.message),ne(v.data.task.id)),v.message&&b.success({id:"AI_IMAGE_SEND_SUCCESS",title:v.message,placement:"bottomRight",data:a}),te({task_id:v?.data.task.id,entity_id:n})):(k(!1),L(!1),b.error({id:"AI_IMAGE_SEND_ERROR",title:v?.message||A("Something went wrong, please try again"),placement:"bottomRight",data:a,innerException:v}))}).catch(v=>{k(!1),L(!1),(v?.error||v?.data)&&b.fromError("AI_IMAGE_SEND_ERROR",a,v.error||v)}))},[a,p,k,L,h,O,S,R,F,b,te,n,A]),B=(0,e.useCallback)(async()=>{ge?(U&&(K(v=>v+1),he()),ie()):Y&&(I?I():b.error({title:A("The usage limit has been exceeded"),description:A(`The maximum number of requests for the current subscription period has been reached.
|
|
7
|
-
Select the appropriate plan to fulfil more requests`),placement:"bottomRight"}))},[ge,Y,W,U,M,f,K,he,ie,b,A,I]);(0,e.useEffect)(()=>{Y&&K(E?.counters?.ai_img_counter||0)},[E,Y]);const re=s.useEventEmitter(Ae.events.AI_IMAGE_PROGRESS_ID);(0,e.useEffect)(()=>{const v=re.event(({progress:J,status:P})=>{N(P||`${Math.round(J)}%`)});return()=>v.dispose()},[re]);const j=(0,e.useCallback)(async v=>{if(!c){u(!0);try{const J=nt(v)?await(await fetch(v)).blob():At.base64ToBlob(v);o({file:new File([J],"image.jpeg",{type:J.type||"image/jpeg"})})}catch{u(!1)}}},[c,u,o]),se=(0,e.useCallback)(v=>{v.status!=="error"&&v.status!=="Canceled"?v.images?(N(v.status),v.progress===100&&(h(v.images),N(A("Evaluating the task")),ne(null),L(!1))):(h([v.data]),k(!1)):(k(!1),L(!1),b.error({id:"AI_IMAGE_GET_ERROR",title:A("Something went wrong, please try again"),placement:"bottomRight",data:Z}))},[h,N,A,k,r,Z,b,L]);return(0,e.useEffect)(()=>{D.length>1&&se(D[D.length-1])},[D,se]),(0,e.useEffect)(()=>{(p||y.length>0)&&setTimeout(()=>{let v=550;l.current&&(v=l.current.offsetHeight+68),r(v)},0)},[l,D,y.length,p,r]),{aiImageCounter:H,setAiImageCounter:K,currentAiImgLimits:x,isFieldsDisabled:oe,canGenerateImage:ge,aiImageRequest:a,imageAiList:y,setImageAiList:h,isLoadingAi:p,setIsLoadingAi:k,loadingDuringGeneration:q,setLoadingDuringGeneration:L,requestStatus:Q,setRequestStatus:N,handleGenerate:B,handleLimitAiImgCount:he,convertBase64ToFile:j,isShiftPressed:_,setIsShiftPressed:z,currentReqId:Z,setCurrentReqId:ne,limitsInPlugin:Y}}var Bt=({setModalHeight:r,customRequest:o,aiTabRef:l,inputAiRef:c,isImageUploaded:u,setIsImageUploaded:a,aiImageRequest:y,setAiImageRequest:h,imageAiList:p,setImageAiList:k,isLoadingAi:I,setIsLoadingAi:f})=>{const A=s.useAppNavigate();s.useDispatch();const E=s.useOpenPlanCatalog(),{__:b,_n:O}=s.useI18n(),g=s.useAppConfig(),[R,S]=(0,e.useState)(!1),[$,V]=(0,e.useState)(null),{aiImageCounter:D,currentAiImgLimits:M,loadingDuringGeneration:F,requestStatus:te,handleGenerate:T,convertBase64ToFile:H,isShiftPressed:K,setIsShiftPressed:Z,limitsInPlugin:ne}=Nt({setModalHeight:r,customRequest:o,aiTabRef:l,isImageUploaded:u,setIsImageUploaded:a,aiImageRequest:y,imageAiList:p,setImageAiList:k,isLoadingAi:I,setIsLoadingAi:f,onPluginAiImageLimitExceeded:()=>S(!0),onImageGenerateLimitExceeded:V}),_=R&&M>0?xt(M):null,z=_?s.getLimitUpgradePresetDefinition(_.presetId):null,Q=$?s.getLimitUpgradePresetDefinition($.presetId):null,[N,q]=(0,e.useState)(!1),L=(0,e.useCallback)(()=>q(!0),[]),n=(0,e.useCallback)(()=>q(!1),[]),C=(0,e.useCallback)(U=>h(U.target.value),[h]),x=(0,e.useCallback)(U=>{U.key==="Shift"?Z(!0):U.key==="Enter"&&!K&&(U.preventDefault(),T())},[K,T,Z]),Y=(0,e.useCallback)(U=>{U.key==="Shift"&&Z(!1)},[Z]),W=p[p.length-1];return(0,t.jsxs)("div",{className:"image-ai",children:[z&&_?(0,t.jsx)(ee.LimitUpgradeModal$1,{open:!0,onClose:()=>S(!1),title:b(z.titleKey),subtitle:b(z.subtitleKey),usageResource:z.usageResource,previousDisplay:s.presetLimitDisplay(_.previousLimit),nextDisplay:s.presetLimitDisplay(_.nextLimit),onChangePlan:()=>{S(!1),E()}}):null,Q&&$?(0,t.jsx)(ee.LimitUpgradeModal$1,{open:!0,onClose:()=>V(null),title:b(Q.titleKey),subtitle:b(Q.subtitleKey),usageResource:Q.usageResource,previousDisplay:s.presetLimitDisplay($.previousLimit),nextDisplay:s.presetLimitDisplay($.nextLimit),onChangePlan:()=>{V(null),E()}}):null,ne&&(0,t.jsx)(m.ui_kit$LimitsCounter,{text:`${D} ${b("of")} ${M>0?M:"∞"} images ${O("was used","were used",D)}`,exceeded:M>0&&D>=M,style:{marginTop:-25},extra:(0,t.jsx)("span",{style:{textDecoration:"underline",cursor:"pointer"},onClick:()=>A(g.billingPageUrl||s.APP_ROUTES.billing),children:b("Need more?")})}),(0,t.jsx)(m.ui_kit$Row,{gutter:24,className:"image-ai__row",children:(0,t.jsx)(m.ui_kit$Col,{span:24,children:(0,t.jsx)(m.ui_kit$Form.Item,{style:{margin:0},children:(0,t.jsxs)("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper${N?" ant-input-affix-wrapper-focused":""}`,children:[(0,t.jsx)(m.ui_kit$TextArea,{ref:c,onKeyDown:x,onKeyUp:Y,onFocus:L,onBlur:n,autoSize:!0,allowClear:!0,className:"text-area-input-hybrid image-ai__textarea",placeholder:b("Generate image"),value:y,onChange:C,spellCheck:"false"}),(0,t.jsx)("span",{className:"ant-input-suffix image-ai__input-suffix",children:I||F?(0,t.jsx)(s.EmIcons,{icon:"LoadingOutlined",component:m.icons$LoadingOutlined,className:"input-icon image-ai__input-icon",spin:!0}):(0,t.jsx)(s.EmIcons,{icon:"AI",component:m.icons$AI,className:"input-icon image-ai__input-icon",onClick:T})})]})})})}),(I||p.length>0)&&(0,t.jsxs)("div",{className:"image-ai__preview",children:[I&&p.length===0&&(0,t.jsx)("div",{className:"image-ai__loading",children:(0,t.jsxs)("div",{className:"spin",children:[(0,t.jsx)(s.EmIcons,{icon:"LoadingOutlined",component:m.icons$LoadingOutlined,style:{fontSize:48},spin:!0}),(0,t.jsx)("p",{className:"status",children:te})]})}),p.length>0&&(0,t.jsxs)("div",{className:"image-ai__image-item",children:[(0,t.jsx)(Tt,{images:p}),(0,t.jsx)("div",{className:"buttons",children:(0,t.jsx)(m.ui_kit$Button,{onClick:()=>H(W),icon:(0,t.jsx)(s.EmIcons,{icon:"CheckOutlined",component:m.icons$CheckOutlined}),children:b("Use this one")})})]})]})]})},dn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=",Ft=({setNewLink:r,setCurrentImageLink:o,setModalHeight:l,setModalWidth:c,setImageGifList:u,imageGifList:a,currentReqGif:y,setCurrentReqGif:h,inputRef:p,setStockLink:k,customRequest:I})=>{const{__:f}=s.useI18n(),A=s.useAppConfig(),E=s.useIsStandalone(),b=s.useNotification(),[O,g]=(0,e.useState)(null),[R,S]=(0,e.useState)(!1),[$,V]=(0,e.useState)(25),[D]=s.useLazyGetSearchGifQuery(),M=(0,e.useCallback)(n=>n instanceof Error||typeof n?.message=="string"&&n.message?n.message:typeof n?.error?.message=="string"&&n.error.message?n.error.message:f("Failed to load GIFs through the configured proxy chain."),[f]),F=(0,e.useCallback)(n=>{b.error({id:"STOCK_GIFS_SEARCH_FAILED",title:f("Failed to load GIFs"),description:M(n)})},[f,M,b]),te=async()=>{R||(S(!0),D({query:y,page:$}).then(n=>{if(n?.error){F(n.error),S(!1);return}u(C=>[...C,...n.data.data]),S(!1),V(C=>C+25)}).catch(()=>{S(!1)}))},T=async()=>{const n=await D({query:y,page:0});if(n?.error){F(n.error),u([]);return}n?.data?.data?.length>0&&(u(n.data.data),setTimeout(()=>{l("84vh"),c(1060)},0))},H=(n,C)=>{g(C),setTimeout(()=>{g(null)},2e3),k(`${n}`),o(`${n}`),I(`${n}`)},K={default:3},Z=(0,e.useCallback)(n=>Ae.getProxiedUrl(n,{config:A,standalone:E,resourceType:"generic",intent:"display"}),[A,E]),ne=(0,e.useCallback)(n=>n.id,[]),_=(0,e.useCallback)(n=>n.images.downsized.url,[]),{getDisplaySrc:z,handleLoad:Q,handleError:N}=et({items:a,getItemId:ne,getRequestUrl:_,createController:Z}),q=n=>C=>{Q(n),C.target.parentNode.classList.add("loaded")},L=n=>()=>{N(n)};return(0,t.jsxs)("div",{className:"stock-tab",children:[(0,t.jsxs)(m.ui_kit$Form,{onValuesChange:T,className:a.length>0?"serach-results":"",children:[(0,t.jsx)(m.ui_kit$Row,{gutter:24,children:(0,t.jsx)(m.ui_kit$Col,{span:a.length>0?"":24,children:(0,t.jsx)(m.ui_kit$Form.Item,{className:"stock-search-input",children:(0,t.jsx)(m.ui_kit$SearchInput,{onSearch:T,allowClear:!0,size:a.length>0?"medium":"large",placeholder:f("Search GIFs"),value:y.keywords,onChange:n=>h(C=>({...C,keywords:n.target.value})),ref:p,spellCheck:"false",enterButton:!1})})})}),a.length>0&&(0,t.jsx)("div",{className:"blocks-search__divider-wrapper",children:(0,t.jsx)("div",{className:"ant-divider ant-divider-horizontal",role:"separator"})})]}),(0,t.jsx)("div",{className:"serach-output-wrapper",style:{marginRight:-10},children:a.length>0&&(0,t.jsx)("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"},children:(0,t.jsx)(Je,{dataLength:a&&a.length,next:te,hasMore:a,endMessage:(0,t.jsxs)(m.ui_kit$Divider,{plain:!0,children:[f("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:(0,t.jsx)(m.ui_kit$Spin,{size:"small"}),children:(0,t.jsx)(Ge,{breakpointCols:K,className:"my-masonry-grid",columnClassName:"my-masonry-grid_column",children:a.map((n,C)=>(0,t.jsxs)("div",{className:"list-item",onClick:()=>H(n.images.downsized.url,n.id),children:[(0,t.jsx)("img",{className:O===n.id?"loaded-image":"",width:"322px",src:z(n),alt:n.title,onLoad:q(n),onError:L(n)}),(0,t.jsx)("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:x=>x.stopPropagation(),children:(0,t.jsx)("div",{className:"overlay-image",style:{backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=)"}})}),O===n.id&&(0,t.jsx)(m.ui_kit$Spin,{className:"ant-spin",size:"small"})]},n.id+C))})})})})]})},rt="IMG",st="BACKGROUND",zt="GALLERY",be="EDITOR",fe="UPLOAD",Ne="STOCK",Be="GIF",Fe="AI",$t={mode:"select"},Kt={mode:"save"},{Dragger:Wt}=m.ui_kit$Upload,Vt=(r,o="image")=>s.decodeFileNameFromUrl(r)??o,Ee=ee.normalizeImageFormatForDisplay,Ht=(r,o)=>{const l=Ee(o);return!l||r.includes(".")?r:`${r}.${l}`},Qt=(r,o)=>new File([r],Ht(Vt(o),r.type),{type:r.type||"application/octet-stream"}),at=({dataProvider:r,usesBuiltInStorage:o})=>{const l=s.useAppConfig(),c=s.useIntegratorConfigValue("compressMaxSize"),u=s.useIsStandalone(),{__:a}=s.useI18n(),y=s.useDispatch(),h=s.useEditorProjectId(),[p]=s.useLazyGetImageInfoQuery(),{modal:k}=m.ui_kit$App.useApp(),I=s.useNotification(),f=s.useSelector(s.selectActiveModal$1),{request:A,resolveImagePicker:E}=s.useImagePicker(),[b,O]=(0,e.useState)(""),[g,R]=(0,e.useState)(""),[S,$]=(0,e.useState)(""),[V,D]=(0,e.useState)(""),[M,F]=(0,e.useState)(fe),[te,T]=(0,e.useState)({width:"",height:"",size:"",format:""}),[H,K]=(0,e.useState)("success"),[Z,ne]=(0,e.useState)(!1),_=e.default.useRef(null),z=e.default.useRef(null),Q=e.default.useRef(null),N=e.default.useRef(null),q=e.default.useRef(null),L=e.default.useRef(null),n=e.default.useRef(null),C=e.default.useRef(null),x=e.default.useRef(null),[Y,W]=(0,e.useState)("auto"),[U,oe]=(0,e.useState)(572),[he,ge]=(0,e.useState)(!1),[ie,B]=(0,e.useState)({keywords:"",color:"",orientation:""}),[re,j]=(0,e.useState)({keywords:""}),[se,v]=(0,e.useState)([]),[J,P]=(0,e.useState)([]),[ue,qt]=(0,e.useState)([]),[ot,it]=(0,e.useState)(!1),[lt,ze]=(0,e.useState)(""),[Yt,Se]=(0,e.useState)(!1),[Zt,Pe]=(0,e.useState)(0),ct=s.useProjectData(),ut=ct?.id!==void 0?String(ct.id):h||"",dt=s.useEventEmitter(Ae.events.UPLOAD_EVENT_ID),me=ee.useImageBlobResolver(),je=e.default.useRef(""),Ce=e.default.useRef(0),we=e.default.useRef(""),[Jt,ft]=(0,e.useState)(""),[Xt,mt]=(0,e.useState)(null),[en,$e]=(0,e.useState)(""),De=(0,e.useCallback)(i=>{if(!(i instanceof Blob))return;we.current&&URL.revokeObjectURL(we.current);const d=URL.createObjectURL(i);we.current=d,ft(d),mt(i)},[]),pe=(0,e.useCallback)(()=>{we.current&&(URL.revokeObjectURL(we.current),we.current=""),ft(""),mt(null)},[]),le=(0,e.useCallback)(()=>{$e("")},[]),Ke=s.usePlanFeatureGate("element_ai_image"),We=s.usePlanFeatureGate("stock_photo"),Ve=s.usePlanFeatureGate("stock_gif"),pt=s.usePlanFeatureGate("image_editor"),tn=i=>{R(i.target.value)},Re=(0,e.useCallback)((i,d,w=a("The image could not be uploaded."))=>{const G=d instanceof Error?d.message:w;I.error({id:"IMAGE_UPLOAD_ERROR",data:i,title:a("Upload failed"),description:G})},[a,I]),nn=(0,e.useCallback)(i=>s.fireUploadImageEvent(dt,{file:i,project:ut}),[ut,dt]),ye=ee.useImageBlobFetch(),rn=(0,e.useCallback)(i=>me.resolve(ee.canonicalImageUrlKey(i),void 0,ye),[ye,me]),Ue=async i=>{if(i)try{const d=await sn(i);d&&Qe(d)?await Ie({file:d}):d||Re({url:i},null,a("Failed to download image from URL."))}catch(d){Re({url:i},d,a("Failed to process image URL."))}},ht=e.default.useRef(Ue);ht.current=Ue,e.default.useEffect(()=>{if(M!==fe||!V)return;const i=g.trim();if(!i||!i.toLowerCase().startsWith("http"))return;const d=setTimeout(()=>{ht.current(i)},1e3);return()=>{clearTimeout(d)}},[g,M,V]);const sn=async i=>{try{const d=ee.canonicalImageUrlKey(i),w=await me.resolve(d,void 0,ye);return Qt(w,d)}catch{}};document.onpaste=function(i){const d=i.clipboardData?.items?.[0];if(M===fe&&V){if(d?.type?.indexOf("image")===0&&l.imageCenterLocalUploadEnabled!==!1){const G=d.getAsFile();Qe(G);const ae={file:G};R(""),Ie(ae);return}const w=i.clipboardData?.getData("text/plain");if(w&&w.trim().toLowerCase().startsWith("http")){i.preventDefault(),i.stopPropagation(),R(w.trim());return}d?.type?.indexOf("text")===0&&d.getAsString(G=>{if(G.trim().toLowerCase().startsWith("http"))R(G.trim());else if(G.toString().slice(1,5)==="meta"){const ae=G.toString().split('"')[1];ae&&R(ae)}})}},(0,e.useEffect)(()=>{const i=d=>{let w=null;A?.kind==="background"?(w=st,D(st)):A?.kind==="img"&&(D(rt),w=rt),A?.currentUrl&&w&&(O(A.currentUrl),F(d))};f===s.MODALS.UPLOAD_IMAGE_MODAL||f===s.MODALS.UPLOAD_BACKGROUND_MODAL?i(be):f===s.MODALS.UPLOAD_IMAGE_MODAL_AI||f===s.MODALS.UPLOAD_BACKGROUND_MODAL_AI?(Ke.isLocked?(Se(!0),Pe(s.FEATURE_UPSELL_SLIDE.element_ai_image)):i(Fe),setTimeout(()=>x.current?.focus({cursor:"start"}),100)):f===s.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD||f===s.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD?(i(fe),setTimeout(()=>L.current?.focus({cursor:"start"}),100)):f===s.MODALS.UPLOAD_IMAGE_MODAL_STOCK||f===s.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK?(We.isLocked?(Se(!0),Pe(s.FEATURE_UPSELL_SLIDE.stock_photo)):i(Ne),setTimeout(()=>C.current?.focus({cursor:"start"}),100)):f===s.MODALS.UPLOAD_IMAGE_MODAL_GIF||f===s.MODALS.UPLOAD_BACKGROUND_MODAL_GIF?(Ve.isLocked?(Se(!0),Pe(s.FEATURE_UPSELL_SLIDE.stock_gif)):i(Be),setTimeout(()=>n.current?.focus({cursor:"start"}),100)):f===s.MODALS.UPLOAD_IMAGE_MODAL_EDIT||f===s.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT?(pt.isLocked?(Se(!0),Pe(s.FEATURE_UPSELL_SLIDE.image_editor)):i(be),y(s.openSecondModal(s.MODALS.IMAGE_EDITOR_MODAL))):D("")},[f,y,Ke.isLocked,We.isLocked,Ve.isLocked,pt.isLocked,A]);const He=(0,e.useCallback)(({url:i=b||"",meta:d=$t})=>{O(i),E({url:i,meta:d}),setTimeout(()=>{le(),pe(),B({keywords:"",color:"",orientation:""}),j({keywords:""}),P([]),v([]),D(""),ze(""),it(!1),$(""),R(""),F(fe)},200),y(s.closeModal$1()),y(s.closeSecondModal())},[b,le,y,E,pe]),gt=(0,e.useCallback)((i,d)=>(W("auto"),ne(!1),He({url:i,meta:Kt}),I.success({id:"IMAGE_UPLOAD_SUCCESS",data:d,title:a("The image was successfully uploaded.")}),i),[a,He,I]);(0,e.useEffect)(()=>{const i=g||S,d=ee.canonicalImageUrlKey(i);if(!i||!d){K(""),je.current&&me.abandonKey(je.current),je.current="",le(),pe();return}const w=je.current;w&&w!==d&&(me.abandonKey(w),le(),pe()),je.current=d;const G=new AbortController,ae=g?800:0,X=++Ce.current,qe=setTimeout(async()=>{try{const ke=async()=>{const de=await me.resolve(d,G.signal,ye);if(X!==Ce.current)return;const{width:ve,height:cn}=await ee.getImageDimensionsFromBlob(de);X===Ce.current&&(T({width:ve,height:cn,size:(de.size/1024).toFixed(2),format:Ee(de.type)}),le(),De(de))};if(u)await ke();else{const de=await ee.resolveDataProviderPreview(r,d);if(de?.previewUrl&&X===Ce.current){$e(de.previewUrl),pe();try{const{data:ve}=await p(d);if(X!==Ce.current)return;ve?T({width:ve?.width,height:ve?.height,size:ve?.fileSize!=null?(ve.fileSize/1024).toFixed(2):"",format:Ee(ve?.format)}):await ke()}catch{await ke()}}else await ke()}if(X!==Ce.current)return;K("success"),O(i),oe(572),setTimeout(()=>{let de=0;z.current&&(de=z.current.offsetHeight+62),W(de)},0)}catch(ke){if(ke?.name==="AbortError"||G.signal.aborted||X!==Ce.current)return;le(),pe(),K("error")}},ae);return()=>{clearTimeout(qe),G.abort()}},[g,S,u,le,ye,p,me,pe,r,De]),(0,e.useEffect)(()=>{if(!b||g||S||!f)return;const i=ee.canonicalImageUrlKey(b),d=new AbortController;let w=!1;const G=async()=>{const ae=await me.resolve(i,d.signal,ye);if(w)return;const{width:X,height:qe}=await ee.getImageDimensionsFromBlob(ae);w||(le(),De(ae),T({width:X,height:qe,size:(ae.size/1024).toFixed(2),format:Ee(ae.type)}))};return(async()=>{try{if(!u){const ae=await ee.resolveDataProviderPreview(r,i);if(ae?.previewUrl&&!w){$e(ae.previewUrl),pe();try{const{data:X}=await p(i);if(w)return;X?T({width:X?.width,height:X?.height,size:X?.fileSize!=null?(X.fileSize/1024).toFixed(2):"",format:Ee(X?.format)}):await G();return}catch{await G()}}}await G()}catch{w||le()}})(),()=>{w=!0,d.abort()}},[u,f,le,b,ye,p,me,r,g,S,De]);const an=()=>{y(s.closeModal$1()),setTimeout(()=>{le(),pe(),O(""),R(""),P([]),P([]),B({keywords:"",color:"",orientation:""}),j({keywords:""}),W("auto"),!ot&&ze(""),oe(572),F(fe)},200)},on=i=>{i===zt?k.success({mask:{closable:!0},centered:!0,title:a("Coming soon"),content:a("The feature is under development."),okText:a("Ok. I'll be waiting"),onOk:()=>{}}):i===be&&b===""?k.warning({mask:{closable:!0},centered:!0,title:a(""),content:a("To preview and edit the uploaded image"),okText:a("Upload Image"),onOk:()=>{F(fe)}}):(setTimeout(()=>{let d=0,w=0;i===fe&&_.current?(ie.keywords===""&&L.current?.focus({cursor:"start"}),d=300,w=572):i===be&&z.current?(d=z.current.offsetHeight+62,w=572):i===Ne&&Q.current?(ie.keywords===""&&C.current?.focus({cursor:"start"}),d=130,w=572,J.length>0&&(w=1060,d="84vh")):i===Be&&N.current?(ie.keywords===""&&n.current?.focus({cursor:"start"}),d=130,w=572,se.length>0&&(w=1060,d="84vh")):i===Fe&&q.current&&(lt===""&&ue.length===0?(x.current?.focus({cursor:"start"}),d=130):d=q.current.offsetHeight+82,w=572),W(d),oe(w)},0),F(i))};(0,e.useEffect)(()=>{ie.keywords===""&&(L?.current?.focus({cursor:"start"}),P([]),setTimeout(()=>{W("auto"),oe(572)},0))},[ie,P,W,oe]);const Qe=i=>{const d=i.type==="image/jpeg"||i.type==="image/png"||i.type==="image/jpg"||i.type==="image/webp"||i.type==="image/gif"||i.type==="image/svg+xml";return d||I.error({id:"IMAGE_UPLOAD_WRONG_FORMAT",data:i,title:"Upload",description:"You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"}),d},vt=(0,e.useRef)(null),Ie=async({file:i})=>{try{ge(!0);const d=i===vt.current?await s.prepareImageForEditorResult(i,l,void 0,{compressBySize:c!==void 0}):await s.prepareImageForEditorUpload(i,l),w=await nn(d);if(w.url)return gt(w.url,d),w.url;if(!s.shouldFallbackToBuiltInUpload(w,{isStandalone:u,targetIsOurBackend:!!o})){Re(d,s.toUploadImageError(w));return}const G=await s.uploadFileViaDataProvider(d,r);if(G?.url)return gt(G.url,d),G.url;Re(d,null);return}catch(d){Re(i,d);return}finally{ge(!1)}},Ct=(0,e.useRef)(Ie);Ct.current=Ie;const ln=(0,e.useCallback)(i=>(vt.current=i,Ct.current({file:i})),[]);let Oe=[{label:a("Upload"),key:fe,children:(0,t.jsxs)("div",{ref:_,style:{paddingBottom:24},children:[l.imageCenterLocalUploadEnabled!==!1&&(0,t.jsxs)(Wt,{showUploadList:!1,name:"Image",beforeUpload:Qe,customRequest:Ie,style:{marginBottom:10},multiple:!1,accept:"image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml",children:[(0,t.jsx)("p",{className:"ant-upload-drag-icon",children:(0,t.jsx)(s.EmIcons,{icon:"InboxOutlined",component:m.icons$InboxOutlined})}),(0,t.jsx)("p",{className:"ant-upload-text",children:a("Click to select, paste from the clipboard, or drag and drop")}),(0,t.jsx)("p",{className:"ant-upload-hint",children:a("Accepted formats: PNG, JPG, WEBP, SVG or GIF.")})]}),(0,t.jsx)(m.ui_kit$Form,{style:{padding:"0 2px 0 2px"},children:(0,t.jsx)(m.ui_kit$Form.Item,{validateStatus:H,children:(0,t.jsx)(m.ui_kit$Input,{ref:L,allowClear:!0,size:"large",placeholder:a("Paste image URL here"),value:g,onChange:tn,spellCheck:"false"})})})]})}];return l.imageCenterStockEnabled&&!We.isLocked&&Oe.push({label:a("Stock"),key:Ne,children:(0,t.jsx)("div",{ref:Q,style:{paddingBottom:24},children:(0,t.jsx)(Mt,{currentReq:ie,setCurrentReq:B,imageStockList:J,setImageStockList:P,setModalWidth:oe,setModalHeight:W,setStockLink:$,setCurrentImageLink:O,inputRef:C,customRequest:Ue})})}),l.imageCenterGifEnabled&&!Ve.isLocked&&Oe.push({label:a("GIF"),key:Be,children:(0,t.jsx)("div",{ref:N,style:{paddingBottom:24},children:(0,t.jsx)(Ft,{currentReqGif:re,setCurrentReqGif:j,imageGifList:se,setImageGifList:v,setModalWidth:oe,setModalHeight:W,setStockLink:$,setCurrentImageLink:O,inputRef:n,customRequest:Ue})})}),l.elementAIimageEnabled&&!Ke.isLocked&&Oe.push({label:a("AI"),key:Fe,children:(0,t.jsx)("div",{ref:q,style:{paddingBottom:24},children:(0,t.jsx)(Bt,{setModalHeight:W,customRequest:Ie,aiImageRequest:lt,setAiImageRequest:ze,imageAiList:ue,setImageAiList:qt,isLoadingAi:ot,setIsLoadingAi:it,aiTabRef:q,inputAiRef:x,isImageUploaded:Z,setIsImageUploaded:ne})})}),l.imageCenterEditorEnabled&&Oe.push({label:"",key:be,children:(0,t.jsx)("div",{ref:z,children:(0,t.jsx)(jt,{currentImageLink:b,newLink:g,previewDisplayUrl:en,resolvedPreviewObjectUrl:Jt,resolvedPreviewBlob:Xt,resolveImageBlob:rn,imageSize:te,onSave:ln,uploadImageResultIsLoading:he||!1})})}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.ui_kit$Modal,{width:U,className:"image-center",title:a("Image Center"),style:{minHeight:390},open:!!V,onOk:He,onCancel:an,footer:M===be?(0,t.jsx)(t.Fragment,{}):null,children:(0,t.jsx)(m.ui_kit$Spin,{spinning:he,children:(0,t.jsx)(m.ui_kit$Tabs,{activeKey:M,onChange:on,items:Oe,className:"modal-tabs",style:{height:Y,minHeight:130}})})}),(0,t.jsx)(s.PlanUpgradePrompt,{open:Yt,onCancel:()=>Se(!1),initialSlide:Zt})]})};at.propTypes={dataProvider:wt.default.object},yt.default=at});
|
package/static/core/e6f6edff.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__emailmaker__.define("static/core/e6f6edff.js",["require","exports","module"],function(P,o,d){var b=Object.create,l=Object.defineProperty,p=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,O=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,v=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(u){throw t=[u],u}},y=(e,r)=>()=>(r||(e((r={exports:{}}).exports,r),e=null),r.exports),j=(e,r,t,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(var f=i(r),n=0,s=f.length,a;n<s;n++)a=f[n],!c.call(e,a)&&a!==t&&l(e,a,{get:(g=>r[g]).bind(null,a),enumerable:!(u=p(r,a))||u.enumerable});return e},m=(e,r,t)=>(t=e==null?{}:b(O(e)),j(r||!e||!e.__esModule||!c.call(e,"default")?l(t,"default",{value:e,enumerable:!0}):t,e));Object.defineProperty(o,"l",{enumerable:!0,get:function(){return m}}),Object.defineProperty(o,"o",{enumerable:!0,get:function(){return v}}),Object.defineProperty(o,"s",{enumerable:!0,get:function(){return y}})});
|
package/static/esm/d4338c39.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var O=class Ae{_inner;_isDisposed=!1;constructor(t=[]){this._inner=t}addDisposable(t){return this._inner.push(t),t instanceof Ae&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(t){this.addDisposable({dispose:t})}removeDisposable(t){const r=this._inner.indexOf(t);r>=0&&this._inner.splice(r,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(const t of[...this._inner])t.dispose()}}};function k(e){return`service_container_${e}`}var N=new Set,W;function Ke(){if(!W)return;const e=new Error("getInstanceAsync"),t=Error;return typeof t.captureStackTrace=="function"&&t.captureStackTrace(e,Ie.prototype.getInstanceAsync),e.stack}function U(e){N.delete(e)&&W?.end(e)}var Ie=class H extends O{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(t){[...this._injectCallbacks].forEach(r=>r(t))}constructor(t=null){super(),this._parent=t,t&&this.addDisposable(t.onInject(r=>this._runCallbacks(r)))}onInject=t=>(this._injectCallbacks.push(t),{dispose:()=>{const r=this._injectCallbacks.indexOf(t);r>=0&&this._injectCallbacks.splice(r,1)}});inject(t,r){this._injections[t]=()=>r,this._runCallbacks(t)}injectFactory(t,r,n){const s=this._injections[t];let o=typeof s=="function"?s():s;const i=this._injections[t]=()=>(o=r(this,o),o);n&&i(),this._runCallbacks(t)}_find(t,r=!0){return this._injections[t]||r&&this._parent?._find(t)}_onInject(t,r,n=new O){return n.addDisposable(this.onInject(s=>{t===s&&!n.isDisposed()&&(n.dispose(),r(this.getInstance(s)))})),this._parent&&n.addDisposable(this._parent._onInject(t,r,n)),this.addDisposable(n),n}getInstance(t,r=!0){const n=this._find(t,r);if(typeof n=="function")return n()}getOrCreateInstance(t,r){const n=this._find(t);if(typeof n=="function")return n();const s=r(this);return this.inject(t,s),s}getInstanceAsync(t){const r=this._find(t);if(typeof r=="function")return Promise.resolve(r());const n=Ke();return new Promise((s,o)=>{const i={id:String(t),startedAt:Date.now(),origin:n,container:this,reject:o};N.add(i),W?.start(i),this._onInject(t,()=>{U(i),s(this.getInstance(t))})})}failPendingWaits(t){for(const r of Array.from(N))r.container===this&&(U(r),r.reject(t))}pendingWaits(){return[...N].filter(t=>t.container===this)}addService(t,r){const n=k(t);this.injectFactory(n,(o,i=[])=>i.indexOf(r)<0?[...i,r]:i);const s=new O;return s.addDispose(()=>{this.injectFactory(n,(o,i=[])=>i.filter(a=>a!==r))}),s}addServiceFactory(t,r,n){const s=k(t);let o;this.injectFactory(s,(a,c=[])=>(o=r(a,o),o===void 0?c:c.indexOf(o)<0?[...c,o]:c),n);const i=new O;return i.addDispose(()=>{this.injectFactory(s,(a,c=[])=>o===void 0?c:c.filter(_=>_!==o))}),i}getServices(t){const r=k(t);return[...this.getInstance(r,!1)||[],...this._parent?.getServices(t)||[]]}createChild(){return new H(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{const r=this._parent?.getOrCreateIsolatedContainer(t);return new H(r)})}remove(t){const r=this._injections;delete r[String(t)]}injectListenerCount(){return this._injectCallbacks.length}dispose(){for(const t of Array.from(N))t.container===this&&U(t);this._injections=Object.create(null),this._injectCallbacks=[],super.dispose()}};function G(e){return e.startsWith("__")?e:`__${e}__`}function ze(e){if(typeof globalThis>"u")throw new Error("[di] globalThis is required for namespace container access.");const t=G(e),r=globalThis;return r[t]??={}}function Je(e){return e!=null&&typeof e=="object"&&typeof e.inject=="function"&&typeof e.getInstance=="function"}function Ye(e){if(e)return G(e);const t="emailmaker".trim();if(!t)throw new Error("[di] REACT_APP_NAME is required for resolveContainer().");return G(t)}function me(e){const t=Ye(e),r=ze(t);if(Je(r.container))return r.container;const n=new Ie(null);return r.container=n,n}function Or(e){return me(e)}function Qe(){let e=new Date().getTime(),t=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let n=Math.random()*16;return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),(r==="x"?n:n&3|8).toString(16)})}function Ze(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Qe()}function d(e=Ze()){return e}function ge(){return"esm".trim()||"unknown"}function et(e){if(typeof globalThis>"u")return;const t=ge(),r=globalThis[e]??{};globalThis[e]=r;const n=r.__diagnostics??={},s=n.diModuleEval??={evalCount:0,records:[]};s.records.push({buildSource:t,timestamp:Date.now(),stack:new Error().stack}),s.evalCount+=1}function tt(){const e="emailmaker".trim();if(!e)throw new Error("[di] REACT_APP_NAME is required for DependencyResolver diagnostics.");return`__${e}__`}function rt(e,t){if(et(t),typeof globalThis>"u")return e;const r=ge(),n=globalThis,s=n[t]=n[t]||{},o=s.__diagnostics=s.__diagnostics||{},i=o.dependencyResolver=o.dependencyResolver||{entries:[]},a={container:e,source:"packages/runtime-core/di/index.ts",buildSource:r,timestamp:Date.now(),stack:new Error().stack};return i.entries.push(a),e}var w;function nt(){if(w)return w;const e=tt();return w=rt(me(e),e),w}var te=new Proxy({},{get(e,t,r){const n=nt(),s=Reflect.get(n,t,r);return typeof s=="function"?s.bind(n):s}});function Tr(e,t="BackendError"){switch(e){case 400:return"ValidationError";case 401:return"AuthenticationFailed";case 403:return"AuthorizationFailed";case 404:return"FileNotFound";case 413:return"PayloadTooLarge";case 415:return"UnsupportedMediaType";case 429:return"RateLimitExceeded";case 500:return"BackendError";case 503:return"ServiceUnavailable";case 504:return"Timeout";default:return t}}function C(e){if(e instanceof DOMException&&e.name==="AbortError")return e;const t=e===void 0?"The operation was aborted.":typeof e=="string"?e:e instanceof Error?e.message:String(e);return new DOMException(t,"AbortError")}function Sr(e){return e instanceof DOMException&&e.name==="AbortError"}function Oe(e){if(e?.aborted)throw C(e.reason)}function Dr(e,t){return t?(t.aborted&&e.catch(()=>{}),Oe(t),new Promise((r,n)=>{const s=()=>{o(),n(C(t.reason))},o=()=>{t.removeEventListener("abort",s)};t.addEventListener("abort",s),e.then(i=>{o(),r(i)},i=>{o(),n(i)})})):e}var Te=class extends O{_options;_listeners=[];constructor(e={}){super(),this._options=e}getListeners(e){return this._listeners.flatMap(([t])=>typeof t=="function"?t:t.getListeners(e))}hasListeners(){for(const[e]of this._listeners){if(typeof e=="function")return!0;const t=e;if(typeof t.hasListeners=="function"){if(t.hasListeners())return!0;continue}return!0}return!1}_addListener(e,t=0,r){if(this.isDisposed())return{dispose:()=>{}};const n=this._listeners,s=this._options;r&&typeof e=="function"&&(e=e.bind(r));const o=n.findIndex(([,a])=>a<t),i=[e,t];return n.splice(o>=0?o:n.length,0,i),n.length===1&&s.onFirstListenerAdd&&s.onFirstListenerAdd(),{dispose:()=>{const a=n.indexOf(i);a>=0&&(n.splice(a,1),!n.length&&s.onLastListenerRemove&&s.onLastListenerRemove())}}}on=this._addListener.bind(this);event=this._addListener.bind(this);once=(e,t=0,r)=>{const n=this._addListener((...s)=>(n?.dispose(),r?e.call(r,...s):e(...s)),t);return n};un=e=>{const t=this._listeners.findIndex(([r])=>r===e);t>=0&&(this._listeners.splice(t,1),this._listeners.length===0&&this._options.onLastListenerRemove&&this._options.onLastListenerRemove())};dispose(){this._listeners.splice(0,this._listeners.length),this._options.onLastListenerRemove&&this._options.onLastListenerRemove(),super.dispose()}},b=class extends Te{execute(e,t){for(const r of t)try{r(...e)}catch{}}fire(...e){if(!this.isDisposed()){const t=this.execute(e,this.getListeners(e));return t===void 0?void 0:t}}},Nr=class extends b{execute([e],t){for(const r of t)try{r(e)}catch{}}},yr=class extends b{_suspendCounter=0;_wasFired=!1;execute([e],t){if(this._suspendCounter)this._wasFired=!0;else for(const r of t)try{r(e)}catch{}}suspend(){this._suspendCounter++}resume(){--this._suspendCounter===0&&this._wasFired&&(this.fire(),this._wasFired=!1)}},q=class extends b{async execute([e],t){const r=[];for(const n of t)try{r.push(await n(e))}catch{}return r}async fireSettled(e){const t={results:[],errors:[]};if(this.isDisposed())return t;for(const r of this.getListeners([e]))try{t.results.push(await r(e))}catch(n){t.errors.push(n)}return t}};function vr(e,t=0){const r=new Te,n=e(r,t);return n&&r.addDisposable(n),r.event}function Cr(e,t,r=0){const n=new b,s=e((...o)=>{if(t(...o))return n.fire(...o)},r);return s&&n.addDisposable(s),n.event}function br(e,t=0,r=0){const n=new b;let s,o;const i=e((...a)=>{o=a,s||(s=setTimeout(()=>{o&&n.fire(...o),s=void 0},t))},r);return i&&n.addDisposable(i),n.event}function Pr(e,t){return e.getOrCreateInstance(t,()=>new q)}function l(e){return d(e)}var re;(function(e){e.BEFORE_SAVE_EMAIL=l("events.BEFORE_SAVE_EMAIL"),e.ON_SAVEBUTTON_CLICK_ID=l("events.ON_SAVEBUTTON_CLICK_ID"),e.ON_NEXTBUTTON_CLICK_ID=l("events.ON_NEXTBUTTON_CLICK_ID"),e.ON_PREVIOUSBUTTON_CLICK_ID=l("events.ON_PREVIOUSBUTTON_CLICK_ID"),e.ON_DOCUMENT_SESSION_CHANGE=l("events.ON_DOCUMENT_SESSION_CHANGE"),e.WILL_EMAIL_INIT_ID=l("events.WILL_EMAIL_INIT_ID"),e.ON_EMAIL_INIT_ID=l("events.ON_EMAIL_INIT_ID"),e.ON_BLOCK_INIT_ID=l("events.ON_BLOCK_INIT_ID"),e.ON_CONTENT_CHANGED_ID=l("events.ON_CONTENT_CHANGED_ID"),e.ON_PREHEADER_CHANGED_ID=l("events.ON_PREHEADER_CHANGED_ID"),e.ON_SUBJECT_CHANGED_ID=l("events.ON_SUBJECT_CHANGED_ID"),e.ON_EMAIL_CHANGED_ID=l("events.ON_EMAIL_CHANGED_ID"),e.ON_HEADER_APPLIED_ID=l("events.ON_HEADER_APPLIED_ID"),e.ON_BLOCK_CHANGED_ID=l("events.ON_BLOCK_CHANGED_ID"),e.ON_CHUNKS_LOADED=l("events.ON_CHUNKS_LOADED"),e.ON_SEND_TESTEMAIL_ID=l("events.ON_SEND_TESTEMAIL_ID"),e.ON_SEND_LIVEPREVIEW_ID=l("events.ON_SEND_LIVEPREVIEW_ID"),e.ON_SHARE_ID=l("events.ON_SHARE_ID"),e.ON_SHOW_PREVIEW_ID=l("events.ON_SHOW_PREVIEW_ID"),e.ON_EMAIL_CLONE_ID=l("events.ON_EMAIL_CLONE_ID"),e.ON_SEND_EMAIL_MODAL_ID=l("events.ON_SEND_EMAIL_MODAL_ID"),e.ON_NOTIFICATION=l("events.ON_NOTIFICATION"),e.READ_LOCALE=l("events.READ_LOCALE"),e.ON_TRANSLATE_ID=l("events.ON_TRANSLATE_ID"),e.ON_CODE_VALIDATE_ID=l("events.ON_CODE_VALIDATE_ID"),e.UPLOAD_EVENT_ID=l("events.UPLOAD_EVENT_ID"),e.PROXY_URL_EVENT_ID=l("events.PROXY_URL_EVENT_ID"),e.FILE_PROXY_EVENT_ID=l("events.FILE_PROXY_EVENT_ID"),e.ON_LIMIT_ID=l("events.ON_LIMIT_ID"),e.ON_BROWSER_EXTENSION_DETECTED_ID=l("events.ON_BROWSER_EXTENSION_DETECTED_ID"),e.ON_LAYOUT_CONVERT_REQUEST_ID=l("events.ON_LAYOUT_CONVERT_REQUEST_ID"),e.ON_BROWSER_TRANSLATE_DETECTED_ID=l("events.ON_BROWSER_TRANSLATE_DETECTED_ID"),e.AI_TEXT_REQUEST_ID=l("events.AI_TEXT_REQUEST_ID"),e.AI_IMAGE_REQUEST_ID=l("events.AI_IMAGE_REQUEST_ID"),e.AI_TEXT_PROGRESS_ID=l("events.AI_TEXT_PROGRESS_ID"),e.AI_IMAGE_PROGRESS_ID=l("events.AI_IMAGE_PROGRESS_ID"),e.AI_TEXT_STREAM_ID=l("events.AI_TEXT_STREAM_ID")})(re||(re={}));function Lr(e,t){return e.getOrCreateInstance(t,()=>new q).event}function Rr(e,t){return e.getOrCreateInstance(t,()=>new q)}var xr=d("plugin.app"),wr=d("plugin.disposable"),Mr=d("InitPipelineContext"),Br=d("plugin.instance"),Fr=d("plugin.lateSurfaceListeners"),st=d("plugin.optionsSource"),kr=d("plugin.store"),ot=d("ConfigSource"),Ur=d("plugin.standalone.project"),it=d("plugin.standalone.bootstrapToken"),jr=d("plugin.element"),at=d("plugin.securityModule"),Hr=d("plugin.standalone.activated"),Gr=d("plugin.standalone.fileProxyRegistered"),X=d("plugin.jwt.token"),y=d("plugin.jwt.error"),Xr=d("PluginCollection"),Vr=l("APP_LOAD_EVENT"),$r=l("CONFIG_CHANGED_EVENT");function ct(e,t=window){return{peer:e,send(r){e.postMessage(r,"*")},subscribe(r){const n=s=>{r({data:s.data,source:s.source,ports:s.ports})};return t.addEventListener("message",n),{dispose:()=>t.removeEventListener("message",n)}},close(){}}}function _t(e){let t=!1;return{peer:e,send(r){e.postMessage(r)},subscribe(r){const n=s=>{r({data:s.data,source:e})};return e.addEventListener("message",n),t||(t=!0,e.start()),{dispose:()=>e.removeEventListener("message",n)}},close(){e.close()}}}function Wr(e){return e}function ut(e){return e&&typeof e=="object"}function ne(e,t){return e&&typeof e=="object"&&e.operationId===t}var g="INIT_MESSAGE",lt="em:port-ready",dt="em:window-drained",j="";function se(){return Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)}var ft=class extends O{_listeners=Object.create(null);addListenerAsync=(e,t,r=0,n)=>{const s=this._listeners[e]||(this._listeners[e]=[]);n&&typeof t=="function"&&(t=t.bind(n));const o=s.findIndex(([a,c])=>r<=c),i=[t,r];return this.isDisposed()||s.splice(o>=0?o:s.length,0,i),{dispose(){const a=s.indexOf(i);a>=0&&s.splice(a,1)}}};fireAsync=(e,t)=>{if(!this.isDisposed()){const r=this._listeners[e]||(this._listeners[e]=[]);let n;for(let s=0;s<r.length;s++){const o=r[s][0],i=n;n=a=>o(a,i)}if(n)return n(t)}};addListener=(e,t,r=0)=>this.addListenerAsync(e,(n,s)=>{try{t(n)}catch{}return s&&s(n)},r)},qr=class extends O{_singleton;_target;_transport;_transportSubscription;_ports=new Map;_drained=new WeakSet;_portSendHeld=new WeakSet;_inited=!1;_emitter=this.addDisposable(new ft);_handshaken=new WeakSet;_greeted=new WeakSet;_outgoingFilter;_outgoingObservers=new Set;_offTargetListeners=new Map;constructor(e,t){super(),this._singleton=t,this._transport=ct({postMessage:()=>{}},window),this._transportSubscription=this.addDisposable(this._transport.subscribe(this._onTransportMessage)),this.addListener(g,()=>{this._inited||(this._inited=!0,this._target&&this._handshaken.add(this._target),this.send(g))}),e&&this.setTarget(e)}_onTransportMessage=e=>{const t=e,r=t.data,n=t.source,s=r?.port===!0?t.ports?.[0]:void 0,o=!this._isPortSource(t.source);if(o&&n&&r?.operationId==="em:window-drained"){this._ports.has(n)&&this._drained.add(n);return}if(o&&n&&this._drained.has(n))return;if(n&&n!==this._target&&this._greeted.has(n)&&ne(r,g)){this._greeted.delete(n),this._handshaken.add(n),this._postMessage(n,{operationId:g,data:{}}),s&&this.usePort(s,!0,n);return}const i=t.source===this.target||this._isCurrentPort(t.source);if(i||this._notifyOffTarget(r?.operationId,t.source),ut(r)&&i||this._singleton&&ne(r,g)){if(s&&i){const u=this._target;Promise.resolve().then(()=>this.usePort(s,!0,u))}const a=this._emitter.fireAsync(r.operationId||j,r.operationId===void 0?t:r.data),c=r.result,_=r.error;c&&_&&Promise.resolve(a).then(u=>this._sendMessage(c,u),u=>this._sendMessage(_,u))}};setTarget(e){if(this._target!==e){if(this._target=e,!e){this._inited=!1;return}if(this._handshaken.has(e)){this._inited=!0,this._emitter.fireAsync(g,void 0);return}this._inited=!1,this._postMessage(e,{operationId:g,data:{}})}}sendPort(e,t){this._postMessage(e,{operationId:g,data:{},port:!0},[t])}observeOutgoing(e){return this._outgoingObservers.add(e),{dispose:()=>{this._outgoingObservers.delete(e)}}}_notifyOutgoing(e,t){for(const r of Array.from(this._outgoingObservers))try{r(e,t)}catch{}}addOffTargetListener(e,t){let r=this._offTargetListeners.get(e);return r||(r=new Set,this._offTargetListeners.set(e,r)),r.add(t),{dispose:()=>{r.delete(t)}}}_notifyOffTarget(e,t){const r=typeof e=="string"?this._offTargetListeners.get(e):void 0,n=r?.size?this._knownPeer(t):void 0;if(!(!r||!n))for(const s of Array.from(r))try{s(n)}catch{}}_knownPeer(e){for(const[r,n]of this._ports)if(n.transport.peer===e)return r;const t=e;return typeof e=="object"&&e!==null&&(this._handshaken.has(t)||this._greeted.has(t))?t:void 0}setOutgoingFilter(e){return this._outgoingFilter=e,()=>{this._outgoingFilter===e&&(this._outgoingFilter=void 0)}}sendNow(e){const t=this._target;return!this._inited||!t?!1:(this._postMessage(t,e),!0)}greet(e){this._handshaken.has(e)||this._greeted.has(e)||this._target===e||(this._greeted.add(e),this._postMessage(e,{operationId:g,data:{}}))}forget(e){this._handshaken.delete(e),this._greeted.delete(e),this._closePort(e),this._drained.delete(e),this._target===e&&(this._inited=!1)}usePort(e,t=!1,r=this._target){if(!r||this._ports.has(r))return;const n=_t(e),s=n.subscribe(this._onTransportMessage);this._ports.set(r,{transport:n,subscription:s}),t&&(n.send({operationId:lt,data:{}}),this.drainWindow(r))}holdPort(e=this._target){!e||!this._ports.has(e)||(this._portSendHeld.add(e),this._drained.delete(e))}resumePort(e=this._target){e&&this._portSendHeld.delete(e)}useWindow(e=this._target){e&&(this._closePort(e),this._drained.delete(e))}get usesPort(){return this._target!==void 0&&this._ports.has(this._target)&&!this._portSendHeld.has(this._target)}hasPort(e,t){const r=this._ports.get(e);return r!==void 0&&(t===void 0||r.transport.peer===t)}_closePort(e){const t=this._ports.get(e);t&&(t.subscription.dispose(),t.transport.close(),this._ports.delete(e),this._portSendHeld.delete(e))}drainWindow(e){this._ports.has(e)&&e.postMessage({operationId:dt,data:{}},"*")}isWindowDrained(e){return this._drained.has(e)}_isPortSource(e){for(const t of this._ports.values())if(t.transport.peer===e)return!0;return!1}_isCurrentPort(e){return this._target!==void 0&&this._ports.get(this._target)?.transport.peer===e}getTarget(){return this._target}get target(){return this._target}_postMessage(e,t,r){let n=t;this._outgoingFilter&&!r?.length&&(n="data"in t?{...t,data:this._outgoingFilter(t.data)}:this._outgoingFilter(t));try{const s=this._ports.get(e);if(s&&!this._portSendHeld.has(e)){s.transport.send(n);return}if(r?.length){e.postMessage(n,"*",r);return}e.postMessage(n,"*")}catch(s){if(s?.name==="DataCloneError"){const o=typeof n?.data=="object"&&n?.data!==null?n.data:void 0}throw s}}_sendMessage(e,t,r=!0){if(!r&&!this.isInited())return;e&&this._notifyOutgoing(e,t);const n=this.addDisposable(this.onInit(s=>{const o=e?{operationId:e,data:t}:t;try{this._postMessage(s,{...o})}finally{n.dispose()}}))}send(e,t,r){return typeof e=="string"?this._sendMessage(e,t,r):this._sendMessage(j,e,t)}sendAsync(e,t,r=!0){if(!r&&!this.isInited())return Promise.resolve();this._notifyOutgoing(e,t);const n=se(),s=se();return new Promise((o,i)=>{const a=this.addDisposable(new O);a.addDisposable(this.onInit(c=>{try{this._postMessage(c,{operationId:e,data:t,result:n,error:s})}catch(_){a.dispose(),i(_);return}a.addDisposable(this._onMessage(n,_=>{o(_),a.dispose()})),a.addDisposable(this._onMessage(s,_=>{i(_),a.dispose()}))}))})}_onMessage(e,t,r=0){return this._emitter.addListener(e,t,r)}addListener(e,t,r){return t?this._onMessage(e,t,r):this._onMessage(j,e)}addListenerAsyncPipe(e,t,r=0){return this._emitter.addListenerAsync(e,t,r)}addListenerAsync(e,t,r=0){return this._emitter.addListenerAsync(e,async(n,s)=>{const o=await t(n);return s?s(n):o},r)}isInited(){return this._inited}get inited(){return this._inited}onInit(e,t=!0,r=0){const n=this.addDisposable(new O);return this._inited&&this._target?t&&Promise.resolve().then(()=>{!this._inited||!this._target?n.addDisposable(this.onInit(e,t,r)):e(this._target)}):n.addDisposable(this._onMessage(g,()=>{e(this._target)},r)),n}dispose(){for(const e of Array.from(this._ports.keys()))this._closePort(e);this._transport.close(),super.dispose()}};function P(e){return d(e)}var Kr=d("extensions.atomsHandlers"),zr=P("HANDLE_ATOM_INSERT"),Jr=d("HeadlessMode"),Yr=d("extensions.sandboxExtensions"),Qr="SANDBOX_EXTENSION_SCRIPT_STATUS",Zr=d("MESSAGE_SERVICE"),en=P("SETTINGS_PANEL_EVENT"),tn="advanced",rn=P("MODAL_SHOW_EVENT"),nn=P("MODAL_CLOSE_EVENT"),sn=P("MODAL_UPDATE_EVENT"),on=d("client"),an=d("v2_client"),cn=d("ai_client"),_n=d("app.cookieManager"),un=d("app.storageProvider"),ln=d("image-blob-resolver"),dn=d("template-directives"),fn=(function(e){return e.Json="application/json",e.FormData="multipart/form-data",e.UrlEncoded="application/x-www-form-urlencoded",e.Text="text/plain",e})({}),pt=class{baseUrl="https://api.emailmaker.ru/wp-json";securityData=null;securityWorker;abortControllers=new Map;customFetch=(...e)=>fetch(...e);baseApiParams={credentials:"same-origin",headers:{},redirect:"follow",referrerPolicy:"no-referrer"};constructor(e={}){Object.assign(this,e)}setSecurityData=e=>{this.securityData=e};encodeQueryParam(e,t){return`${encodeURIComponent(e)}=${encodeURIComponent(typeof t=="number"?t:`${t}`)}`}addQueryParam(e,t){return this.encodeQueryParam(t,e[t])}addArrayQueryParam(e,t){return e[t].map(r=>this.encodeQueryParam(t,r)).join("&")}toQueryString(e){const t=e||{};return Object.keys(t).filter(r=>typeof t[r]<"u").map(r=>Array.isArray(t[r])?this.addArrayQueryParam(t,r):this.addQueryParam(t,r)).join("&")}addQueryParams(e){const t=this.toQueryString(e);return t?`?${t}`:""}contentFormatters={"application/json":e=>e!==null&&(typeof e=="object"||typeof e=="string")?JSON.stringify(e):e,"text/plain":e=>e!==null&&typeof e!="string"?JSON.stringify(e):e,"multipart/form-data":e=>Object.keys(e||{}).reduce((t,r)=>{const n=e[r];return t.append(r,n instanceof Blob?n:typeof n=="object"&&n!==null?JSON.stringify(n):`${n}`),t},new FormData),"application/x-www-form-urlencoded":e=>this.toQueryString(e)};mergeRequestParams(e,t){return{...this.baseApiParams,...e,...t||{},headers:{...this.baseApiParams.headers||{},...e.headers||{},...t&&t.headers||{}}}}createAbortSignal=e=>{if(this.abortControllers.has(e)){const r=this.abortControllers.get(e);return r?r.signal:void 0}const t=new AbortController;return this.abortControllers.set(e,t),t.signal};abortRequest=e=>{const t=this.abortControllers.get(e);t&&(t.abort(),this.abortControllers.delete(e))};async request({body:e,secure:t,path:r,type:n,query:s,format:o,baseUrl:i,cancelToken:a,extraQuery:c,proxyHandler:_,...u}){const f=(typeof t=="boolean"?t:this.baseApiParams.secure)&&this.securityWorker&&await this.securityWorker(this.securityData)||{},h=this.mergeRequestParams(u,f);c&&(s=s?{...s,...c}:c);const p=s&&this.toQueryString(s),I=this.contentFormatters[n||"application/json"],E=o||h.format,R=`${i||this.baseUrl||""}${r}${p?`?${p}`:""}`,We=_?_(R,{body:e,secure:t,path:r,type:n,query:s,format:o,baseUrl:i,cancelToken:a,extraQuery:c,proxyHandler:_,...u}):R,Z=new Request(We,{...h,headers:{...h.headers||{},...n&&n!=="multipart/form-data"?{"Content-Type":n}:{}},signal:(a?this.createAbortSignal(a):h.signal)||null,body:typeof e>"u"||e===null?null:I(e)});return this.customFetch(Z).then(async ee=>{const m=ee;m.data=null,m.error=null,m.meta={request:Z,response:m};const qe=E?await ee[E]().then(x=>(m.ok?m.data=x:m.error={data:x},m)).catch(x=>(m.error=x,m)):m;return a&&this.abortControllers.delete(a),qe})}},ht=d("prewarm.networkActivity");function Et(){let e=0;const t=new Set,r=()=>{t.forEach(n=>n())};return{begin(){e+=1,r();let n=!1;return()=>{n||(n=!0,e-=1,r())}},inFlight:()=>e,watch(n){return t.add(n),()=>t.delete(n)}}}function At(e){return e.getOrCreateInstance(ht,()=>Et())}var It=Symbol("rest.publicRequest"),K=d("rest.requestHandler"),mt=d("rest.responseHandler"),Se=d("rest.customFetch"),gt=(e,t)=>fetch(e,t),De=d("rest_transport"),Ot=e=>{e.inject(Se,{execute:async(t,r={})=>{const n=e.getServices(K),s={public:r[It]===!0},o=At(e).begin();try{let i=t instanceof Request?t:new Request(t,r);for(const _ of n){const u=await _.execute(i,s);u instanceof Request&&(i=u)}let a=await fetch(i);const c=e.getServices(mt);for(const _ of c)a=await _.execute(a,i);return a}finally{o()}}})};function pn(e,t){const r=e.getInstance(De);if(!r)throw new Error("[restApi] транспорт не зарегистрирован в контейнере");return Object.assign({},...t.map(n=>new n(r)))}var Tt="INJECTION";function St(e){return e.getState}function hn(e){if(!St(e)){e.dispose();return}const t=e.getState()[Tt];t&&(te.getInstance(t)?.dispose(),te.remove(t))}function En(e,t){for(const r of e)if(r&&t in r)return r[t]}function Dt(e){return Object.assign({},...e)}var Ne=["generic","stockImages","emFiles","cdn"];function z(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function oe(e){return!z(e)||"match"in e||"rewrite"in e||"proxyBase"in e?!1:Object.keys(e).some(t=>Ne.includes(t))}function ye(e){return e.length===0?[]:e.length===1?e[0]:e}function ve(e){let t=!1,r=[];for(const n of e)if(n!==void 0){if(t=!0,Array.isArray(n)){r=[...n,...r];continue}r=[n,...r]}if(t)return ye(r)}function Nt(e){return z(e)&&("value"in e||"replace"in e)}function ie(e,t){return t===void 0?e:Array.isArray(t)?[...t,...e]:[t,...e]}function yt(e){let t=!1,r=[],n=!1;for(const o of e)if(o!==void 0){if(Nt(o)){t=!0,o.replace&&(r=[],n=!0),o.value!==void 0&&(r=ie(r,o.value),n=!0);continue}r=ie(r,o),n=!0}const s=n?ye(r):void 0;if(!t)return s;if(s!==void 0)return{value:s}}function An(e){const t=e.filter(n=>n!==void 0);if(t.length===0)return;if(!t.some(n=>oe(n)))return ve(t);const r={};for(const n of Ne){const s=yt(e.map(o=>{if(o!==void 0)return oe(o)?o[n]:n==="generic"?o:void 0}));s!==void 0&&(r[n]=s)}return Object.keys(r).length>0?r:void 0}function In(e){return ve(e)}function vt(e){if(e!==void 0){if(Array.isArray(e))return{replace:!1,hosts:e};if(z(e)&&Array.isArray(e.value))return{replace:!!e.replace,hosts:e.value}}}function Ct(e,t){const r=[...e],n=new Set(r.map(s=>s.toLowerCase()));for(const s of t){const o=s.trim().replace(/:\d+$/,"");if(!o)continue;const i=o.toLowerCase();n.has(i)||(n.add(i),r.push(o))}return r}function bt(e){let t=[],r=!1;for(const n of e){const s=vt(n);s&&(r=!0,s.replace&&(t=[]),t=Ct(t,s.hosts))}return r?t:void 0}function mn(e){const t=e.filter(s=>s!==void 0);if(t.length===0)return;const r=Dt(t.map(({directHosts:s,...o})=>o)),n=bt(t.map(s=>s?.directHosts));return n!==void 0&&(r.directHosts=n),r}function J(e){return e?.backendProxy}function v(e){return e.replace(/\/$/,"")}function Ce(e){return/^https?:\/\//i.test(e)}function be(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Pt(e){const t=new Set;return e.filter(r=>!r.url||t.has(r.url)?!1:(t.add(r.url),!0))}function Lt(e){const t=J(e);return t?[t]:[]}function Rt(e){return{proxyEmFiles:!0,proxyAi:!1}}function xt(e,t){const r=Rt(t),n=t?.backendProxyPolicy;switch(e){case"emFiles":return n?.proxyEmFiles??r.proxyEmFiles;case"ai":return n?.proxyAi??r.proxyAi;default:return!0}}var wt={url:".+",url_encoded:".+",origin:"https?:\\/\\/[^\\/?#]+",origin_encoded:".+",proxy_url:"https?:\\/\\/[^\\/?#]+",proxy_url_encoded:".+",path:"[^?#]*",pathname:"[^?#]*",path_with_slash:"\\/[^?#]*",pathname_with_slash:"\\/[^?#]*",query:"[^#]*",search:"\\?[^#]*",hash:"#.*",fragment:".*",pathname_after_wp_json:"[^?#]*",pathname_after_wp_json_with_slash:"\\/[^?#]*",rest_namespace:"[^/?#]*",rest_version:"[^/?#]*",rest_route:"[^?#]*",rest_route_with_slash:"\\/[^?#]*"};function Mt(e){const t=[],r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\{([a-z_]+)\\\}/gi,(n,s)=>(t.push(s),`(${wt[s]||".+"})`));return{regex:new RegExp(`^${r}$`,"i"),tokens:t}}function Bt(e){return/[?#]/.test(e)||/\{(?:url|url_encoded|query|search|hash|fragment)\}/i.test(e)}function Ft(e,t){if(Bt(t))return e;try{const r=new URL(e);return`${r.origin}${r.pathname}`}catch{return e.split(/[?#]/)[0]||e}}function kt(e,t,r){if(r.endsWith("_encoded"))return!0;const n=e.slice(0,t),s=n.lastIndexOf("#"),o=n.lastIndexOf("?"),i=n.lastIndexOf("&"),a=n.lastIndexOf("=");return a>Math.max(o,i)&&a>s}function Ut(e){try{const t=new URL(e),r=t.pathname.replace(/^\/+/,""),n=t.search.replace(/^\?/,""),s=t.hash.replace(/^#/,""),o=r.replace(/^wp-json\/?/i,""),i=o?`/${o}`:"/",a=o.match(/^([^/]+)(?:\/([^/]+))?(?:\/(.*))?$/),c=a?.[1]||"",_=a?.[2]||"",u=a?.[3]||"";return{url:e,url_encoded:encodeURIComponent(e),origin:t.origin,origin_encoded:encodeURIComponent(t.origin),proxy_url:t.origin,proxy_url_encoded:encodeURIComponent(t.origin),path:r,pathname:r,path_with_slash:t.pathname||"/",pathname_with_slash:t.pathname||"/",query:n,search:t.search,hash:t.hash,fragment:s,pathname_after_wp_json:o,pathname_after_wp_json_with_slash:i,rest_namespace:c,rest_version:_,rest_route:u,rest_route_with_slash:u?`/${u}`:"/"}}catch{return}}function Y(e,t){if(!e)return{};if(Array.isArray(e)){for(const a of e){const c=Y(a,t);if(c!==void 0)return c}return}if(e==="*")return{};const r=Ft(t,e),{regex:n,tokens:s}=Mt(e),o=n.exec(r);if(!o)return;const i={};return s.forEach((a,c)=>{i[`matched_${a}`]=o[c+1]||""}),i}function M(e,t,r={}){const n=Ut(t);if(!n)return t;const s={...n,...r};let o="",i=0;const a=/\{([a-z_]+)\}/gi;let c;for(;c=a.exec(e);){o+=e.slice(i,c.index);const _=s[c[1]]??"",u=kt(e,c.index,c[1])?encodeURIComponent(_):_;o+=u,i=c.index+c[0].length}o+=e.slice(i);try{const _=new URL(o),u=new URL(t);return!o.includes("{search}")&&!o.includes("{query}")&&u.search&&u.searchParams.forEach((f,h)=>{_.searchParams.has(h)||_.searchParams.append(h,f)}),!o.includes("{hash}")&&!o.includes("{fragment}")&&u.hash&&!_.hash&&(_.hash=u.hash),_.toString()}catch{return o}}function ae(e,t){try{const r=new URL(t);return`${v(e)}/${r.pathname.replace(/^\//,"")}${r.search}${r.hash}`}catch{return t}}function ce(e,t){const r=v(e);return t?Ce(t)?t:t.startsWith("?")||t.startsWith("#")?`${r}${t}`:`${r}${t.startsWith("/")?"":"/"}${t}`:r}function Pe(e,t,r,n){const s=e.match;return s?Array.isArray(s)?s.some(o=>Pe({...e,match:o},t,r,n)):typeof s=="function"?!!s({url:t,method:n,requestType:r}):s==="*"?!0:Y(s,t)!==void 0:!0}function jt(e,t,r,n="generic"){if(e==null)return[];const s=Array.isArray(e)?e:[e],o=[];return s.forEach((i,a)=>{if(!i)return;if(typeof i=="string"){const f=i.includes("{")&&i.includes("}")?M(i,t):ae(i,t);o.push({key:`backend:${a}`,url:f,source:"resource"});return}if(!be(i)||!("rewrite"in i))return;const c=i;if(!Pe(c,t,n,r))return;const _=typeof c.match=="string"||Array.isArray(c.match)?Y(c.match,t)||{}:{},u=typeof c.proxyBase=="string"&&c.proxyBase.trim()?c.proxyBase.trim():void 0;(Array.isArray(c.rewrite)?c.rewrite:[c.rewrite]).filter(Boolean).forEach((f,h)=>{const p=typeof f=="function"?(()=>{const I=f({url:t,proxyBase:u,method:r,requestType:n,..._}),E=u&&!Ce(I)?ce(u,I):I;return E.includes("{")&&E.includes("}")?M(E,t,_):E})():u?M(ce(u,f),t,_):f.includes("{")&&f.includes("}")?M(f,t,_):ae(f,t);o.push({key:`backend:${c.id||"rule"}:${a}:${h}`,url:p,source:"resource"})})}),Pt(o)}function Ht(e){try{const t=new URL(e);return/(?:^|\/)wp-json\/em-files\/v\d+(?:\/|$)/i.test(t.pathname)?"emFiles":/(?:^|\/)wp-json\/ai-generator\/v\d+(?:\/|$)/i.test(t.pathname)?"ai":"generic"}catch{return"generic"}}function Gt(e,t=[]){return e==null||(Array.isArray(e)?e:[e]).forEach(r=>{if(r){if(typeof r=="string"){const n=r.split("{")[0]?.trim();n&&t.push(v(n));return}!be(r)||!("rewrite"in r)||(typeof r.proxyBase=="string"&&r.proxyBase.trim()&&t.push(v(r.proxyBase.trim())),(Array.isArray(r.rewrite)?r.rewrite:[r.rewrite]).forEach(n=>{if(typeof n!="string")return;const s=n.split("{")[0]?.trim();s&&t.push(v(s))}))}}),t}function Xt(e,t){return Lt(t).flatMap(r=>Gt(r)).filter(Boolean).some(r=>r&&e.startsWith(r))}function Vt(e,t){return!!J(t)&&xt(e,t)}function $t(e,t={}){const r=t.requestType||Ht(e);return Vt(r,t.config)?jt(J(t.config),e,t.method,r):[]}function Wt(e,t={}){return Xt(e,t.config)?[e]:$t(e,t).map(r=>r.url)}function D(e){for(;e.endsWith("/");)e=e.slice(0,e.length-1);return/\/wp-json$/i.test(e)?e:`${e}/wp-json`}function qt(...e){const t=e.filter(o=>o!=null);if(t.length===0)return;if(t.length===1)return t[0];const r=t.find(o=>o.aborted);if(r)return r;if(typeof AbortSignal<"u"&&typeof AbortSignal.any=="function")return AbortSignal.any(t);const n=new AbortController,s=o=>{n.signal.aborted||n.abort(o.reason)};for(const o of t)o.addEventListener("abort",()=>s(o),{once:!0});return n.signal}var _e=3e5,ue=15e3,A=null,le=!1;function Kt(){return!0}function zt(){const e=String({}.REACT_APP_OPENAPI_FAILOVER_TTL_MS||"").trim();if(!e)return _e;const t=Number(e);return Number.isFinite(t)&&t>0?t:_e}function Jt(){const e=String({}.REACT_APP_OPENAPI_FAILOVER_ATTEMPT_TIMEOUT_MS||"").trim();if(!e)return ue;const t=Number(e);return Number.isFinite(t)&&t>0?t:ue}function Yt(){const e="https://app.emailmaker.ru/api/".trim();return e?D(e):void 0}function Qt(e){const t=e.trim();if(!t)return[];if(t.startsWith("["))try{const r=JSON.parse(t);if(!Array.isArray(r))throw new Error("expected JSON array");return r.map(n=>String(n).trim()).filter(Boolean)}catch{return le||(le=!0),[]}return t.split(",").map(r=>r.trim()).filter(Boolean)}function Zt(e){const t=new Set,r=[];for(const n of e){const s=D(n);t.has(s)||(t.add(s),r.push(s))}return r}function Le(e){const t=String(e||"").trim();return t?D(t):Yt()}function Re(e,t=[]){return e?Zt([e,...t]).slice(0,3):[]}function xe(){return Qt(String({}.REACT_APP_OPENAPI_FAILOVER_BASE_URLS||"").trim())}function er(e=Date.now()){return A?e-A.switchedAt>=zt():!0}function we(e=Date.now()){A&&er(e)&&(A=null)}function S(e){if(!Kt())return!1;const t=Le(e);if(!t)return!1;const r=xe();return r.length===0?!1:Re(t,r).length>1}function L(e){const t=Le(e);if(!t)return[];const r=xe();return r.length===0?[t]:Re(t,r)}function Q(e){const t=L(e);if(t.length===0)return"";if(we(),A){const r=t.indexOf(A.activeUrl);if(r>=0)return t[r]}return t[0]}function Me(e){const t=L(e);if(t.length<=1||(we(),!A||!t.includes(A.activeUrl)))return t;const r=A.activeUrl;return[r,...t.filter(n=>n!==r)]}function tr(e){return Q(e)||void 0}function Be(e){const t=e||void 0;if(typeof AbortController>"u")return{signal:t,timeoutError:()=>{},done:()=>{}};const r=Jt(),n=new AbortController;let s;const o=setTimeout(()=>{s=rr(r),n.abort(s)},r);return{signal:qt(t,n.signal),timeoutError:()=>s,done:()=>clearTimeout(o)}}function rr(e){const t=`[apiOriginFailover] origin attempt timed out after ${e}ms`;if(typeof DOMException=="function")return new DOMException(t,"TimeoutError");const r=new Error(t);return r.name="TimeoutError",r}function Fe(e){return e===502||e===503||e===504}function ke(e){return!(e instanceof Error)&&!(e instanceof DOMException)?!1:e.name==="TimeoutError"?!0:e instanceof TypeError}var Ue;function gn(e){Ue=e}function B(e,t){if(!S(t))return;const r=L(t);if(r.length<=1)return;const n=r.indexOf(D(e));if(n<0)return;const s=n+1;if(s>=r.length)return;const o=r[s],i=A?.activeUrl;A={activeUrl:o,switchedAt:Date.now()},i!==o&&Ue?.()}function je(e,t){if(!S(t))return;const r=D(e),n=L(t);if(n.includes(r)){if(r===n[0]){A=null;return}A?.activeUrl!==r&&(A={activeUrl:r,switchedAt:Date.now()})}}function He(){A=null}var nr=e=>{const t=new FormData,r=(n,s,o)=>{if(s!=null){if(s instanceof Blob){n.append(o,s);return}if(Array.isArray(s)){s.forEach((i,a)=>{const c=o?`${o}[${a}]`:`${a}`;r(n,i,c)});return}if(typeof s=="object"){Object.keys(s).forEach(i=>{const a=s[i],c=o?`${o}[${i}]`:i;r(n,a,c)});return}n.append(o,String(s))}};return r(t,e),t},sr={baseUrl:D("https://app.emailmaker.ru/api/"),baseApiParams:{secure:!0,credentials:"same-origin",format:"json"},securityWorker:()=>({credentials:"same-origin"})},T=new Map;function or(e){const t=e?.getInstance(ot);return t?t.get()??t.bootstrap():void 0}var ir=class extends pt{container;constructor(e={},t){super(e),this.container=t}buildRequestUrl(e){const{path:t,baseUrl:r,extraQuery:n}=e;let{query:s}=e;n&&(s=s?{...s,...n}:n);const o=s&&this.toQueryString(s);return`${r||this.baseUrl||""}${t}${o?`?${o}`:""}`}buildRequestKey(e,t){return`${t.toUpperCase()} ${e}`}getBackendProxyCandidates(e,t){const r=or(this.container),n=this.container?.getInstance(at)!==void 0,s=Wt(e,{config:r,method:t,standalone:n}),o=s.length>0?s:[e],i=this.buildRequestKey(e,t),a=T.get(i);return!a||!o.includes(a)?o:[a,...o.filter(c=>c!==a)]}shouldRetryResponse(e){return e.status===502||e.status===503||e.status===504}resolveFailoverBaseUrl(){return String(this.baseUrl||"").trim()||void 0}async requestOnOrigin(e,t,r=!1){const n={...e,baseUrl:t},s=this.buildRequestUrl(n),o=n.method||"GET",i=this.buildRequestKey(s,o),a=this.getBackendProxyCandidates(s,o);let c,_;for(const u of a){const f=p=>p===s?u:p,h=r?Be(e.signal):void 0;try{const p=await super.request({...n,proxyHandler:f,...h?{signal:h.signal}:{}});if(!p.ok&&this.shouldRetryResponse(p)&&u!==a[a.length-1]){_=p,T.get(i)===u&&T.delete(i);continue}return T.set(i,u),p}catch(p){T.get(i)===u&&T.delete(i);const I=h?.timeoutError();if(I)throw I;if(c=p,(p instanceof DOMException||p instanceof Error)&&p.name==="AbortError")throw p}finally{h?.done()}}if(_)return _;throw c instanceof Error?c:new Error("Backend proxy chain failed")}async request(e){const t=String(e.baseUrl||"").trim();if(t)return this.requestOnOrigin(e,t);const r=this.resolveFailoverBaseUrl(),n=S(r),s=e.failoverAttemptTimeout??n,o=n?Me(r):r?[Q(r)]:[this.baseUrl].filter(Boolean);if(o.length===0)return this.requestOnOrigin(e,this.baseUrl);let i,a;for(let c=0;c<o.length;c++){const _=o[c],u=c===o.length-1;try{const f=await this.requestOnOrigin(e,_,s);if(!f.ok&&Fe(f.status)){if(a=f,!u){B(_,r);continue}break}return f.ok&&je(_,r),f}catch(f){if(!ke(f))throw f;i=f,u||B(_,r)}}if(n&&He(),a)return a;throw i instanceof Error?i:new Error("API origin failover chain failed")}};function ar(e={},t){const r=new ir({...sr,...e},t);return r.contentFormatters["multipart/form-data"]=nr,r}var cr=d("rest.clientFactory"),On=e=>{Ot(e);const t=ar({customFetch:e.getInstance(Se)?.execute??gt},e);e.inject(De,t)},de;(function(e){const t="https://racs.emcdn.ru/v3";function r(s,o){const i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(o)};return fetch(`${t}?resource=${s}&dataset=${document.location.hostname}`,i)}e.post=r;async function n(s,o=0){const i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:`{"filter":{},"limit":${o}}`};return await(await fetch(`${t}/get?resource=${s}&dataset=${document.location.hostname}`,i)).json()}e.getAll=n})(de||(de={}));function F(e,t){if(e!==t){if(!e||!t||typeof e!="object"||typeof t!="object")return!1;const r=Array.isArray(e),n=Array.isArray(t);if(r){if(!n)return!1;const a=e.length;if(t.length!==a)return!1;for(let c=0;c<a;c++)if(!F(e[c],t[c]))return!1}else if(n)return!1;const s=Object.keys(e),o=Object.keys(t),i=s.length;if(i!==o.length)return!1;for(let a=0;a<i;a++){const c=s[a];if(!t.hasOwnProperty(c)||!F(e[c],t[c]))return!1}}return!0}function _r(e){const t=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"="),r=atob(t),n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return new TextDecoder().decode(n)}function ur(e){const[t,r,n]=e.split("."),s=JSON.parse(_r(r));return{exp:s.exp,createdAt:s.iat,data:s}}var V=d("plugin.auth.token"),fe=new WeakMap,lr=3e4;function dr(e){let t;try{t=ur(e).exp}catch{return!0}return typeof t!="number"||!Number.isFinite(t)?!0:t*1e3<=Date.now()+lr}function fr(e,t,r,n){const s=fe.get(e);s&&(s.stale=!0);const o={stale:!1};fe.set(e,o),e.injectFactory(V,async(i,a)=>{if(o.stale)return"";try{let c=await a||void 0;if(!c){const _=e.getInstance(it);_&&(c=await _)}return t?!c||dr(c)?await t(r,n,c):c:""}catch{return""}},!0)}var pe=d("auth.oauthProvided"),he=new WeakMap;function Ge(e,t){const r=he.get(e)??{applied:!1};(!r.applied||r.getAuthToken!==t.getAuthToken||!F(r.user,t.user)||r.project!==t.project)&&(he.set(e,{applied:!0,getAuthToken:t.getAuthToken,user:t.user,project:t.project}),fr(e,t.getAuthToken,t.user,t.project))}function pr(e){if(e.getInstance(pe))return;e.inject(pe,!0);let t;e.getInstance(st)?.watch(r=>{t=r}),e.addService(K,{execute:async(r,n)=>{if(n?.public||!t?.getAuthToken)return;e.getInstance(V)===void 0&&Ge(e,t);const s=await e.getInstanceAsync(V);s&&r.headers.set("authorization",`Bearer ${s}`)}})}var Tn={text:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",lineHeight:21,lineHeightDim:"px",color:"#5a5a5a",contrastColor:"#FFFFFF",textAlign:"left",paddingBottom:10,paddingBottomDim:"px"},headings:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:24,fontSizeDim:"px",lineHeight:32,lineHeightDim:"px",color:"#333333",contrastColor:"#FFFFFF",textAlign:"left",paddingTop:20,paddingTopDim:"px",paddingBottom:20,paddingBottomDim:"px",letterSpacing:0,letterSpacingDim:"px",bold:!0,italic:!1},links:{color:"#1C52DC",contrastColor:"#FFFFFF",underline:!0},buttons:{fontFamily:["Safe Fonts","-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif"],fontSize:16,fontSizeDim:"px",letterSpacing:0,letterSpacingDim:"px",color:"#FFFFFF",contrastColor:"#1C52DC",bold:!1,italic:!1,backgroundColor:"#1C52DC",contrastBackgroundColor:"#FFFFFF",marginTop:10,marginTopDim:"px",marginBottom:10,marginBottomDim:"px",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},textAlign:"center",padding:{all:null,top:null,right:null,bottom:null,left:null}},block:{backgroundColor:"#FFFFFF",contrastBackgroundColor:"#1C52DC",padding:{all:null,top:null,right:null,bottom:null,left:null}},cards:{contrastBackgroundColor:"#1C52DC",contrastTextColor:"#FFFFFF",baseBackgroundColor:"#F8F8F8",baseTextColor:"#333333",border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null}}},Xe="ERROR",Sn="useblocks",Dn={em_token:"em_access_token",em_refresh_token:"em_refresh_token",em_admin_token:"em_admin_access_token",em_admin_refresh_token:"em_admin_refresh_token",em_impersonation:"em_impersonation",em_elements_view:"em_elements_view",em_new_block:"em_new_block",em_new_email:"em_new_email",em_id:"em_id",em_name:"em_name",em_email:"em_email",em_locale:"em_locale",em_carrotquest_hash:"em_carrotquest_hash",em_ducalis_hash:"em_ducalis_hash",em_email_subscription_consent:"em_email_subscription_consent",em_folder:"em_folder",promocode:"promocode",em_active_tab:"em_active_tab"},Nn={em_color_scheme:"em_color_scheme",em_code_mode_pane_sizes:"em_code_mode_pane_sizes",em_preview_pane_sizes:"em_preview_pane_sizes",em_default_sizes:"em_default_sizes",em_pane_sizes:"em_pane_sizes",em_test_emails:"em_test_emails",em_menu_is_locked:"em_menu_is_locked",em_code_mode_settings:"em_code_mode_settings",em_folder_is_open:"em_folder_is_open",em_active_tab:"em_active_tab",em_ai_settings:"em_ai_settings",em_last_active_page:"em_last_active_page",em_layout_convert_never_suggest:"em_layout_convert_never_suggest",em_filemanager_v2:"em_filemanager_v2",em_projects_v2:"em_projects_v2",em_translations_v2:"em_translations_v2",em_defer_chrome:"em_defer_chrome",em_stripo_import:"em_stripo_import",em_guest_locale:"em_guest_locale"},yn="light",vn="dark",Cn="(prefers-color-scheme: dark)",bn={MESSAGE:"message",INIT_PREVIEW:"init_preview",UPDATE_PREVIEW:"update_preview",UPDATE_EDITOR:"update_editor",UPDATE_EDITOR_POSITION:"update_editor_position",UPDATE_SIDE_MENU_EDITOR:"update_side_menu_editor",SAVE_EMAIL:"saveEmail",SANDBOX_ELEMENT_SETTINGS_SET:"sandbox_element_settings_set",SANDBOX_IMAGE_RESET:"sandbox_image_reset",SANDBOX_NATIVE_IMAGE_DROP_CLEAR:"sandbox_native-image-drop-clear",SANDBOX_EMAIL_SETTINGS_SET:"sandbox_email_settings_set",SANDBOX_BLOCK_SETTINGS_SET:"sandbox_block_settings_set",SANDBOX_ELEMENT_PARENT_GET:"sandbox_element_parent_get",SANDBOX_ELEMENT_PARENT_TABLE_GET:"sandbox_element_parent_table_get",SANDBOX_ELEMENT_PREV_GET:"sandbox_element_prev_get",SANDBOX_ELEMENT_NEXT_GET:"sandbox_element_next_get",SANDBOX_ELEMENT_REMOVE:"sandbox_element_remove",SANDBOX_ELEMENT_ACTIVE_RESET:"sandbox_element_active_reset",SANDBOX_ELEMENT_ACTIVE_SET:"sandbox_element_active_set",SANDBOX_ELEMENT_HOVER_SET:"sandbox_element_hover_set",SANDBOX_ELEMENT_IMG_LINK:"sandbox_element_img_link",SANDBOX_ELEMENT_TEXT:"sandbox_element_text",SANDBOX_EMAIL_CONTENT_GET:"sandbox_email_content_get",SANDBOX_SET_POSITION_TO_IMG:"sandbox_set_position_to_img",SANDBOX_SET_POSITION_TO_LINK:"sandbox_set_position_to_link",SANDBOX_ACCORDION_ADD_SECTION:"sandbox_accordion_add_section",SANDBOX_ACCORDION_REMOVE_SECTION:"sandbox_accordion_remove_section",APPLICATION_FOCUS_IN_IFRAME:"application_focus_in_iframe",APPLICATION_EMAIL_SETTINGS_SET:"application_email_settings_set",APPLICATION_BLOCK_SETTINGS_SET:"application_block_settings_set",APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",_APPLICATION_ELEMENT_SETTINGS_SET:"application_element_settings_set",APPLICATION_ELEMENT_SETTINGS_CLOSE:"application_element_settings_close",APPLICATION_ACTION:"application_action",APPLICATION_EBLOCK_ADD:"application_eblock_add",SANDBOX_EBLOCK_SET_EM_BLOCK_ID:"sandbox_eblock_set_em_block_id",SANDBOX_GLOBAL_BLOCK_REPLACE:"sandbox_global_block_replace",APPLICATION_SCROLL_TO:"application_scroll-to",APPLICATION_SCROLL_BLOCK_SHOW:"application_scroll-block-show",APPLICATION_SCROLL_BLOCK_HIDE:"application_scroll-block-hide",APPLICATION_DISCUSS_SET_ID:"application_discuss_set_id",APPLICATION_DISCUSS_GET_COMMENT:"application_discuss_get_comment",APPLICATION_DISCUSS_NO_COMMENT:"application_discuss_no_comment",APPLICATION_DISCUSS_SAVE_TARGET:"application_discuss_save_target",APPLICATION_IFRAME_SET_HEIGHT:"application_iframe_set_height",APPLICATION_COMMON_STYLES_UPDATE:"application_commonStyles_update",APPLICATION_EMAIL_CONTENT_GET:"application_email_content_get",APPLICATION_OPEN_IMAGE_AI_POPUP:"application_open-image-ai-popup",APPLICATION_OPEN_IMAGE_UPLOAD_POPUP:"application_open-image-upload-popup",APPLICATION_OPEN_IMAGE_EDIT_POPUP:"application_open-image-edit-popup",APPLICATION_OPEN_IMAGE_GIF_POPUP:"application_open-image-gif-popup",APPLICATION_OPEN_IMAGE_STOCK_POPUP:"application_open-image-stock-popup",APPLICATION_CLOSE_IMAGE_EDIT_POPUP:"application_close-image-edit-popup",APPLICATION_NATIVE_IMAGE_DROP:"application_native-image-drop",APPLICATION_SUBJECT_UPDATE:"application_subject_update",APPLICATION_PREHEADER_UPDATE:"application_preheader_update",APPLICATION_DOMPARSER_ERROR:"application_domparser_error",APPLICATION_SYNC_DRIFT:"application_sync_drift",APPLICATION_UPDATE_ENTITY:"application_update_entity",APPLICATION_IFRAME_DRAG_EVENT:"application_iframe_drag_event",APPLICATION_HAS_AMP:"application_has_amp",APPLICATION_CANVAS_IMAGE_GET:"application_canvas_image_get",APPLICATION_PREVIEW_ALERT_SHOW:"application_preview_alert_show",APPLICATION_ATOM_INSERTED:"application_atom_inserted",APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW:"application_template_not_em_alert_show",SANDBOX_WINDOW_CHARACTERISTIC:"sandbox_window-characteristic",SANDBOX_IFRAME_SETSIZE:"sandbox_iframe-setsize",SANDBOX_BLOCK_INSERT:"sandbox_block-insert",SANDBOX_ATOM_INSERT:"sandbox_atom-insert",SANDBOX_DRAG_CANCEL:"sandbox_drag-cancel",UPDATE_EDITOR_POSITION_FROM_EDITOR:"update_position_from_editor",UPDATE_EDITOR_POSITION_FROM_IFRAME:"update_position_from_iframe",SANDBOX_CHANGE_PREVIEW:"sandbox_change_preview",APPLICATION_CHANGE_PREVIEW:"application_change_preview",SANDBOX_LOCK_EDIT:"sandbox_lock_edit",SANDBOX_FLOATBLOCK_ADD:"sandbox_floatBlock_add",SANDBOX_FLOATBLOCK_REMOVE:"sandbox_floatBlock_remove",SANDBOX_FLOATBLOCK_COPY:"sandbox_floatBlock_copy",SANDBOX_FLOATBLOCK_SWAP:"sandbox_floatBlock_swap",EDITOR_CHANGE_FOCUS:"editor_change_focus",SANDBOX_RESIZED:"sandbox_resized",SANDBOX_LOCK_DISCUSS:"sandbox_lock_discuss",SANDBOX_DISCUSS_SET_TARGET:"sandbox_discuss_set_target",SANDBOX_DISCUSS_REMOVE_TARGET:"sandbox_discuss_remove_target",SANDBOX_DISCUSS_RESET:"sandbox_discuss_reset",SANDBOX_DISCUSS_GET_TARGET:"sandbox_discuss_get_target",SANDBOX_READY:"SANDBOX_READY",SANDBOX_FLOATBLOCK_WRAP:"sandbox_floatblock_wrap",SANDBOX_FLOATBLOCK_DIR:"sandbox_floatblock_dir",SANDBOX_SUBJECT_UPDATE:"sandbox_subject_update",SANDBOX_PREHEADER_UPDATE:"sandbox_preheader_update",SANDBOX_DRAG_EVENT:"sandbox_drag_event",SANDBOX_WHEEL:"sandbox_wheel",SANDBOX_ADD_MERGETAG:"sandbox_add_mergetag",SANDBOX_TRANSLATIONS:"sandbox_send_translations",SANDBOX_SET_THEME_VARIABLES:"sandbox_send_theme_variables",SANDBOX_SET_PROJECT_FONTS:"sandbox_set_project_fonts",SANDBOX_CANVAS_IMAGE_CACHE_SETUP:"sandbox_canvas_image_cache_setup",SANDBOX_SET_ENTITY:"sandbox_set_entity",SANDBOX_INIT_START:"sandbox_init_start",SANDBOX_INITED:"sandbox_inited",SANDBOX_UPDATE_ENTITY:"sandbox_update_entity",RELOAD:"reload",SANDBOX_ADD_EXTENSIONS:"sandbox_add_extensions",SANDBOX_REMOVE_EXTENSIONS:"sandbox_remove_extensions",SANDBOX_ADD_SCRIPT:"sandbox_add_script",SANDBOX_IS_EMAIL_EMPTY:"sandbox_is_email_empty",SANDBOX_SWITCH_THEME:"sandbox_switch_theme",SANDBOX_CANVAS_HEALTH:"sandbox_canvas_health"},Pn={language:"html",detectIndentation:!1,wordWrap:"on",wrappingIndent:"same",smoothScrolling:!0,automaticLayout:!0,tabSize:2,indentSize:2},hr=e=>{const t={current:Promise.resolve(),state:e,decorate:(r,n)=>(n&&(r=r.bind(n)),function(...s){const o=t.current.then(()=>r(...s));return t.current=o.then(i=>{t.state=i},i=>{}),o})};return t};function Ve(e){return function(t){return{setOptions:()=>{},instance:{},dispose:()=>{},...e(t)||{}}}}function Ln(e){return t=>{const r={},n=[];for(const i of e)n.push(i(t));for(const i of n)Object.assign(r,i.instance);return{instance:r,setOptions:async i=>{for(const a of n)await a.setOptions(i)},dispose:()=>{for(const i of n)i.dispose()}}}}function Er(e=Xe){const t=new Error(e);return t.name="AuthPipelineError",t}async function Ar(e,t,r,n){const s=n?.attemptTimeout??S(r),o=S(r)?Me(r):L(r).length>0?[Q(r)]:[];if(o.length===0)throw new Error("[apiOriginFailover] no API base URL configured");const i=e.startsWith("/")?e:`/${e}`;let a,c;for(let _=0;_<o.length;_++){const u=o[_],f=_===o.length-1,h=s?Be(t.signal):void 0;try{const p=await fetch(`${u}${i}`,{...t,...h?{signal:h.signal}:{}});if(!p.ok&&Fe(p.status)){if(a=p,!f){B(u,r);continue}break}return p.ok&&je(u,r),p}catch(p){const I=h?.timeoutError();if(!I&&!ke(p))throw p;c=I||p,f||B(u,r)}finally{h?.done()}}if(S(r)&&He(),a)return a;throw c instanceof Error?c:new Error("[apiOriginFailover] fetch chain failed")}function Ee(e){e.inject(y,void 0),e.inject(X,void 0)}var Rn=Ve(e=>{let t,r;const n=hr();return e.addService(K,{execute:n.decorate(async(s,o)=>{if(o?.public||!t)return;const i=String(e.getInstance(X)||"").trim();if(i){s.headers.append("authorization",`Bearer ${i}`);return}if(!e.getInstance(y))try{const a=e.getInstance(cr),c=String(a?.getOptions()?.baseUrl||"").trim(),_=tr(r||c||void 0);if(!_)throw new Error("JWT auth requires baseUrl");const u=await Ar("/jwt-auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)},_);if(!u.ok)throw new Error(`JWT auth failed: ${u.status}`);const f=await u.json(),h=String(f.token||"").trim();if(!h)throw new Error("JWT auth failed: empty token");e.inject(y,void 0),e.inject(X,h),s.headers.append("authorization",`Bearer ${h}`)}catch{throw e.inject(y,Xe),Er()}})}),{setOptions(s){const o=s.jwtAuth,i=String(s.baseUrl||"").trim()||void 0,a=!F(o,t),c=i!==r;if(t=o,r=i,!o){Ee(e);return}a||c?Ee(e):e.inject(y,void 0)}}}),xn=Ve(e=>(pr(e),{setOptions(t){Ge(e,t)}}));function Ir(e){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/([^a-zA-Z0-9_-])/g,"\\$1")}function $(e,t=document){try{const n=t.querySelector(e);if(n)return n}catch{return null}const r=t.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n]?.shadowRoot;if(!s)continue;const o=$(e,s);if(o)return o}return null}function $e(e,t=[]){const r=e.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n]?.shadowRoot;s&&(t.push(s),$e(s,t))}return t}function mr(e,t,r){if(e.isConnected)return e;const n=e.id?.trim();return n?gr(`#${Ir(n)}`,t,r):Promise.reject(C("Editor mount element was disconnected and has no id — pass a CSS selector or call init() again after the host remounts the container."))}function gr(e,t,r){if(Oe(r),typeof e<"u"){if(typeof e=="string"){const n=e,s=$(n);if(s)return s;const o=t.addDisposable(new O);return new Promise((i,a)=>{const c=E=>{o.dispose(),E()},_=()=>{c(()=>a(C(r?.reason)))};if(r?.aborted){_();return}r?.addEventListener("abort",_),o.addDispose(()=>r?.removeEventListener("abort",_));const u=document.body??document.documentElement;if(!u){c(()=>a(C("Document is not ready to observe mount element")));return}const f=new Set,h=new MutationObserver(()=>{const E=$(n);if(E){c(()=>i(E));return}I()}),p=E=>{f.has(E)||(f.add(E),h.observe(E,{attributes:!0,childList:!0,subtree:!0}))},I=()=>{const E=document.documentElement;if(E)for(const R of $e(E))p(R)};p(u),I(),o.addDispose(()=>h.disconnect())})}return e instanceof Element?mr(e,t,r):e}return e}var wn=new Map;export{lt as $,Dt as A,Dr as At,dn as B,Q as C,Nr as Ct,In as D,vr as Dt,qt as E,Cr as Et,K as F,Ze as Ft,Zr as G,Kr as H,De as I,Or as It,sn as J,nn as K,pn as L,k as Lt,hn as M,Tr as Mt,Se as N,te as Nt,An as O,C as Ot,It as P,d as Pt,qr as Q,fn as R,O as Rt,On as S,b as St,gn as T,br as Tt,zr as U,tn as V,Jr as W,Qr as X,Yr as Y,en as Z,Tn as _,re as _t,Ar as a,wr as at,F as b,Pr as bt,hr as c,Fr as ct,bn as d,at as dt,Wr as et,yn as f,Hr as ft,Sn as g,kr as gt,Cn as h,Ur as ht,Rn as i,ot as it,En as j,Oe as jt,mn as k,Sr as kt,Dn as l,st as lt,Pn as m,Gr as mt,gr as n,Vr as nt,Ln as o,Mr as ot,Nn as p,it as pt,rn as q,xn as r,$r as rt,Ve as s,Br as st,wn as t,xr as tt,vn as u,Xr as ut,pr as v,Rr as vt,tr as w,yr as wt,cr as x,q as xt,ur as y,Lr as yt,_n as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__emailmaker__.define(`static/umd-runtime/delivery-libs.js`,[`require`,`exports`,`module`,`static/umd-runtime/BWsm4pjU.js`,`@emailmaker/emailmaker/runtime/classnames`,`static/umd-runtime/ui-kit.js`,`@emailmaker/emailmaker/runtime/antd`,`static/umd-runtime/ui-kit-icons.js`,`@emailmaker/emailmaker/runtime/react`,`@emailmaker/emailmaker/runtime/react-dom`,`@emailmaker/emailmaker/runtime/react-dom/client`,`@emailmaker/emailmaker/runtime/react/jsx-runtime`,`@emailmaker/emailmaker/runtime/react/jsx-dev-runtime`,`@emailmaker/emailmaker/runtime/@ant-design/icons/es/components/AntdIcon`,`@emailmaker/emailmaker/runtime/@ant-design/cssinjs`,`@emailmaker/emailmaker/runtime/dayjs`],function(e,t,n){Object.defineProperty(t,Symbol.toStringTag,{value:`Module`});let r=e("./BWsm4pjU.js"),i=e("@emailmaker/emailmaker/runtime/classnames");i=r.r(i);let a=e("static/umd-runtime/ui-kit.js"),o=e("@emailmaker/emailmaker/runtime/antd"),s=e("static/umd-runtime/ui-kit-icons.js"),c=e("@emailmaker/emailmaker/runtime/react");c=r.r(c);let l=e("@emailmaker/emailmaker/runtime/react-dom");l=r.r(l);let u=e("@emailmaker/emailmaker/runtime/react-dom/client");u=r.r(u);let d=e("@emailmaker/emailmaker/runtime/react/jsx-runtime");d=r.r(d);let f=e("@emailmaker/emailmaker/runtime/react/jsx-dev-runtime");f=r.r(f);let p=e("@emailmaker/emailmaker/runtime/@ant-design/icons/es/components/AntdIcon");p=r.r(p);let m=e("@emailmaker/emailmaker/runtime/@ant-design/cssinjs");m=r.r(m);let h=e("@emailmaker/emailmaker/runtime/dayjs");h=r.r(h),Object.defineProperty(t,"AntDesignCssinjs",{enumerable:!0,get:function(){return m}}),Object.defineProperty(t,"AntDesignIconBase",{enumerable:!0,get:function(){return p}}),t.Classnames=i.default,Object.defineProperty(t,"Dayjs",{enumerable:!0,get:function(){return h}}),Object.defineProperty(t,"React",{enumerable:!0,get:function(){return c}}),Object.defineProperty(t,"ReactDom",{enumerable:!0,get:function(){return l}}),Object.defineProperty(t,"ReactDomClient",{enumerable:!0,get:function(){return u}}),Object.defineProperty(t,"ReactJsxDevRuntime",{enumerable:!0,get:function(){return f}}),Object.defineProperty(t,"ReactJsxRuntime",{enumerable:!0,get:function(){return d}}),t.antd$Alert=o.Alert,t.antd$App=o.App,t.antd$AutoComplete=o.AutoComplete,t.antd$Avatar=o.Avatar,t.antd$Breadcrumb=o.Breadcrumb,t.antd$Button=o.Button,t.antd$Card=o.Card,t.antd$Carousel=o.Carousel,t.antd$Cascader=o.Cascader,t.antd$Checkbox=o.Checkbox,t.antd$Col=o.Col,t.antd$ColorPicker=o.ColorPicker,t.antd$ConfigProvider=o.ConfigProvider,t.antd$DatePicker=o.DatePicker,t.antd$Divider=o.Divider,t.antd$Dropdown=o.Dropdown,t.antd$Empty=o.Empty,t.antd$Flex=o.Flex,t.antd$Form=o.Form,t.antd$Image=o.Image,t.antd$Input=o.Input,t.antd$InputNumber=o.InputNumber,t.antd$Layout=o.Layout,t.antd$List=o.List,t.antd$Menu=o.Menu,t.antd$Modal=o.Modal,t.antd$Pagination=o.Pagination,t.antd$Popconfirm=o.Popconfirm,t.antd$Progress=o.Progress,t.antd$Radio=o.Radio,t.antd$Result=o.Result,t.antd$Row=o.Row,t.antd$Segmented=o.Segmented,t.antd$Select=o.Select,t.antd$Skeleton=o.Skeleton,t.antd$Space=o.Space,t.antd$Spin=o.Spin,t.antd$Switch=o.Switch,t.antd$Table=o.Table,t.antd$Tabs=o.Tabs,t.antd$Tag=o.Tag,t.antd$Tooltip=o.Tooltip,t.antd$Tree=o.Tree,t.antd$Typography=o.Typography,t.antd$Upload=o.Upload,t.antd$theme=o.theme,t.icons$AI=s.AI,t.icons$AIRequests=s.AIRequests,t.icons$AMP=s.AMP,t.icons$AddImage=s.AddImage,t.icons$AddSlide=s.AddSlide,t.icons$AimOutlined=s.AimOutlined,t.icons$AlignCenterOutlined=s.AlignCenterOutlined,t.icons$AlignLeftOutlined=s.AlignLeftOutlined,t.icons$AlignRightOutlined=s.AlignRightOutlined,t.icons$AlignVerticalBottom=s.AlignVerticalBottom,t.icons$AlignVerticalCenter=s.AlignVerticalCenter,t.icons$AlignVerticalTop=s.AlignVerticalTop,t.icons$Anchor=s.Anchor,t.icons$AppstoreAddOutlined=s.AppstoreAddOutlined,t.icons$AppstoreOutlined=s.AppstoreOutlined,t.icons$ArrowLeftOutlined=s.ArrowLeftOutlined,t.icons$ArrowRightOutlined=s.ArrowRightOutlined,t.icons$ArrowUpOutlined=s.ArrowUpOutlined,t.icons$Atom=s.Atom,t.icons$BgPositionHorizontal=s.BgPositionHorizontal,t.icons$BgPositionVertical=s.BgPositionVertical,t.icons$Block=s.Block,t.icons$BoldOutlined=s.BoldOutlined,t.icons$BorderOuterOutlined=s.BorderOuterOutlined,t.icons$BorderRadius=s.BorderRadius,t.icons$BuildOutlined=s.BuildOutlined,t.icons$CalendarOutlined=s.CalendarOutlined,t.icons$ChatGpt=s.ChatGpt,t.icons$CheckCircleFilled=s.CheckCircleFilled,t.icons$CheckCircleOutlined=s.CheckCircleOutlined,t.icons$CheckCircleVerified=s.CheckCircleVerified,t.icons$CheckOutlined=s.CheckOutlined,t.icons$ChevronDownCustom=s.ChevronDownCustom,t.icons$ClearChat=s.ClearChat,t.icons$Close=s.Close,t.icons$CloseCircleFilled=s.CloseCircleFilled,t.icons$CloseOutlined=s.CloseOutlined,t.icons$CloudDownloadOutlined=s.CloudDownloadOutlined,t.icons$CloudUploadOutlined=s.CloudUploadOutlined,t.icons$Code=s.Code,t.icons$Column=s.Column,t.icons$ColumnHeightOutlined=s.ColumnHeightOutlined,t.icons$ColumnWidthOutlined=s.ColumnWidthOutlined,t.icons$CommentOutlined=s.CommentOutlined,t.icons$CopyOutlined=s.CopyOutlined,t.icons$CreateBlock=s.CreateBlock,t.icons$CreditCard02Icon=s.CreditCard02Icon,t.icons$DarkMode=s.DarkMode,t.icons$DeleteOutlined=s.DeleteOutlined,t.icons$DesktopOutlined=s.DesktopOutlined,t.icons$DotsHoriz=s.DotsHoriz,t.icons$DownOutlined=s.DownOutlined,t.icons$Edit=s.Edit,t.icons$EditOutlined=s.EditOutlined,t.icons$ElementAccordion=s.ElementAccordion,t.icons$ElementButton=s.ElementButton,t.icons$ElementCarousel=s.ElementCarousel,t.icons$ElementCountdown=s.ElementCountdown,t.icons$ElementDivider=s.ElementDivider,t.icons$ElementForm=s.ElementForm,t.icons$ElementImage=s.ElementImage,t.icons$ElementImageAI=s.ElementImageAI,t.icons$ElementListOL=s.ElementListOL,t.icons$ElementListUL=s.ElementListUL,t.icons$ElementSocial=s.ElementSocial,t.icons$ElementSpacer=s.ElementSpacer,t.icons$ElementTable=s.ElementTable,t.icons$ElementText=s.ElementText,t.icons$ElementTextAI=s.ElementTextAI,t.icons$ElementTitle=s.ElementTitle,t.icons$ElementVideo=s.ElementVideo,t.icons$Email=s.Email,t.icons$EmailConfirmation=s.EmailConfirmation,t.icons$EmailEnvelope=s.EmailEnvelope,t.icons$ExclamationCircleOutlined=s.ExclamationCircleOutlined,t.icons$EyeInvisibleOutlined=s.EyeInvisibleOutlined,t.icons$EyeOutlined=s.EyeOutlined,t.icons$FileImageOutlined=s.FileImageOutlined,t.icons$FileOutlined=s.FileOutlined,t.icons$FilePdfOutlined=s.FilePdfOutlined,t.icons$FileTextOutlined=s.FileTextOutlined,t.icons$FileWordOutlined=s.FileWordOutlined,t.icons$FileZipOutlined=s.FileZipOutlined,t.icons$FolderOpen=s.FolderOpen,t.icons$FontSizeOutlined=s.FontSizeOutlined,t.icons$Globe02Icon=s.Globe02Icon,t.icons$GoToParent=s.GoToParent,t.icons$Grid01Icon=s.Grid01Icon,t.icons$Group=s.Group,t.icons$HistoryOutlined=s.HistoryOutlined,t.icons$HolderOutlined=s.HolderOutlined,t.icons$Image=s.Image,t.icons$ImageAdd=s.ImageAdd,t.icons$InboxOutlined=s.InboxOutlined,t.icons$InfoCircleOutlined=s.InfoCircleOutlined,t.icons$IntegrationConfigure=s.IntegrationConfigure,t.icons$ItalicOutlined=s.ItalicOutlined,t.icons$LandscapeView=s.LandscapeView,t.icons$LayoutCol1=s.LayoutCol1,t.icons$LayoutCol2=s.LayoutCol2,t.icons$LayoutCol2WideLeft=s.LayoutCol2WideLeft,t.icons$LayoutCol2WideRight=s.LayoutCol2WideRight,t.icons$LayoutCol3=s.LayoutCol3,t.icons$LayoutCol4=s.LayoutCol4,t.icons$LightMode=s.LightMode,t.icons$LineHeightOutlined=s.LineHeightOutlined,t.icons$Link03=s.Link03,t.icons$LinkOutlined=s.LinkOutlined,t.icons$LoadingOutlined=s.LoadingOutlined,t.icons$Lock=s.Lock,t.icons$LockOutlined=s.LockOutlined,t.icons$MailOutlined=s.MailOutlined,t.icons$MenuOutlined=s.MenuOutlined,t.icons$MergeTags=s.MergeTags,t.icons$MixedView=s.MixedView,t.icons$MobileOutlined=s.MobileOutlined,t.icons$MoreOutlined=s.MoreOutlined,t.icons$Optimization=s.Optimization,t.icons$OrderedListOutlined=s.OrderedListOutlined,t.icons$PaddingBottom=s.PaddingBottom,t.icons$PaddingLeftRight=s.PaddingLeftRight,t.icons$PaddingTop=s.PaddingTop,t.icons$PanelLeft=s.PanelLeft,t.icons$Paragraph=s.Paragraph,t.icons$Percent02Icon=s.Percent02Icon,t.icons$PhoneOutlined=s.PhoneOutlined,t.icons$PicLeftOutlined=s.PicLeftOutlined,t.icons$PlayCircleOutlined=s.PlayCircleOutlined,t.icons$PlusCircleOutlined=s.PlusCircleOutlined,t.icons$PlusSquareOutlined=s.PlusSquareOutlined,t.icons$PortraitView=s.PortraitView,t.icons$RadiusUpleftOutlined=s.RadiusUpleftOutlined,t.icons$RedoOutlined=s.RedoOutlined,t.icons$Replacer=s.Replacer,t.icons$RightCircleOutlined=s.RightCircleOutlined,t.icons$RightOutlined=s.RightOutlined,t.icons$RollbackOutlined=s.RollbackOutlined,t.icons$Sale04Icon=s.Sale04Icon,t.icons$SaveBlock=s.SaveBlock,t.icons$SaveOutlined=s.SaveOutlined,t.icons$SearchOutlined=s.SearchOutlined,t.icons$SendOutlined=s.SendOutlined,t.icons$SettingOutlined=s.SettingOutlined,t.icons$ShareAltOutlined=s.ShareAltOutlined,t.icons$ShieldTickIcon=s.ShieldTickIcon,t.icons$SliderGroup=s.SliderGroup,t.icons$SnippetsOutlined=s.SnippetsOutlined,t.icons$Speed=s.Speed,t.icons$SplitCellsOutlined=s.SplitCellsOutlined,t.icons$SquareView=s.SquareView,t.icons$StrikethroughOutlined=s.StrikethroughOutlined,t.icons$Styles=s.Styles,t.icons$Subscript=s.Subscript,t.icons$Superscript=s.Superscript,t.icons$SwapHorizontalIcon=s.SwapHorizontalIcon,t.icons$SwapOutlined=s.SwapOutlined,t.icons$SyncOutlined=s.SyncOutlined,t.icons$Target=s.Target,t.icons$Typograf=s.Typograf,t.icons$UnLock=s.UnLock,t.icons$UnderlineOutlined=s.UnderlineOutlined,t.icons$UndoOutlined=s.UndoOutlined,t.icons$UnorderedListOutlined=s.UnorderedListOutlined,t.icons$UserOutlined=s.UserOutlined,t.icons$VideoCameraOutlined=s.VideoCameraOutlined,t.icons$Vimeo=s.Vimeo,t.icons$Web=s.Web,t.icons$WebHook=s.WebHook,t.icons$YoutubeOutlined=s.YoutubeOutlined,t.ui_kit$Alert=a.Alert,t.ui_kit$App=a.App,t.ui_kit$Breadcrumb=a.Breadcrumb,t.ui_kit$Button=a.Button,t.ui_kit$Card=a.Card,t.ui_kit$Carousel=a.Carousel,t.ui_kit$Cascader=a.Cascader,t.ui_kit$CheckableTag=a.CheckableTag,t.ui_kit$Checkbox=a.Checkbox,t.ui_kit$Col=a.Col,t.ui_kit$ColorPickerClearGlyph=a.ColorPickerClearGlyph,t.ui_kit$ColorPickerInput=a.ColorPickerInput,t.ui_kit$Comment=a.Comment,t.ui_kit$ControlFontFamily=a.ControlFontFamily,t.ui_kit$DatePicker=a.DatePicker,t.ui_kit$Divider=a.Divider,t.ui_kit$DraggableInputNumber=a.DraggableInputNumber,t.ui_kit$Dropdown=a.Dropdown,t.ui_kit$EmIcons=a.EmIcons,t.ui_kit$Flex=a.Flex,t.ui_kit$Form=a.Form,t.ui_kit$FormAlignControl=a.FormAlignControl,t.ui_kit$FormAlignTextControl=a.FormAlignTextControl,t.ui_kit$FormBackgroundSettings=a.FormBackgroundSettings,t.ui_kit$FormBorderInputs=a.FormBorderInputs,t.ui_kit$FormBorderRadiusInputs=a.FormBorderRadiusInputs,t.ui_kit$FormBoxShadowInputs=a.FormBoxShadowInputs,t.ui_kit$FormColorField=a.FormColorField,t.ui_kit$FormDirectionControl=a.FormDirectionControl,t.ui_kit$FormDisplayControl=a.FormDisplayControl,t.ui_kit$FormOptionsList=a.FormOptionsList,t.ui_kit$FormPaddingInputs=a.FormPaddingInputs,t.ui_kit$FormSection=a.FormSection,t.ui_kit$FormSizeInputs=a.FormSizeInputs,t.ui_kit$FormSwitchRow=a.FormSwitchRow,t.ui_kit$FormTypographyFields=a.FormTypographyFields,t.ui_kit$FormVerticalAlignControl=a.FormVerticalAlignControl,t.ui_kit$Image=a.Image,t.ui_kit$Input=a.Input,t.ui_kit$InputNumber=a.InputNumber,t.ui_kit$InputSelect=a.InputSelect,t.ui_kit$LIST_ITEM_BORDERLESS_CLASS=a.LIST_ITEM_BORDERLESS_CLASS,t.ui_kit$Layout=a.Layout,t.ui_kit$LimitsCounter=a.LimitsCounter,t.ui_kit$Link=a.Link,t.ui_kit$List=a.List,t.ui_kit$Modal=a.Modal,t.ui_kit$PageLoader=a.PageLoader,t.ui_kit$PanelForm=a.PanelForm,t.ui_kit$Password=a.Password,t.ui_kit$Popconfirm=a.Popconfirm,t.ui_kit$Progress=a.Progress,t.ui_kit$Radio=a.Radio,t.ui_kit$RadioColorFilter=a.RadioColorFilter,t.ui_kit$Result=a.Result,t.ui_kit$Row=a.Row,t.ui_kit$SearchInput=a.SearchInput,t.ui_kit$Segmented=a.Segmented,t.ui_kit$Select=a.Select,t.ui_kit$Skeleton=a.Skeleton,t.ui_kit$Space=a.Space,t.ui_kit$Spin=a.Spin,t.ui_kit$StyleProvider=a.StyleProvider,t.ui_kit$Switch=a.Switch,t.ui_kit$Tabs=a.Tabs,t.ui_kit$Tag=a.Tag,t.ui_kit$Text=a.Text,t.ui_kit$TextArea=a.TextArea,t.ui_kit$ThemeProvider=a.ThemeProvider,t.ui_kit$Title=a.Title,t.ui_kit$Tooltip=a.Tooltip,t.ui_kit$Typography=a.Typography,t.ui_kit$UiKitI18nProvider=a.UiKitI18nProvider,t.ui_kit$Upload=a.Upload,t.ui_kit$XCircleClearIcon=a.XCircleClearIcon,t.ui_kit$createTransformer=a.createTransformer,t.ui_kit$darkThemePreset=a.darkThemePreset,t.ui_kit$iconColors=a.iconColors,t.ui_kit$lightThemePreset=a.lightThemePreset,t.ui_kit$useToken=a.useToken});
|