useblocks 1.3.11-dev.2 → 1.3.11-dev.3

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.
Files changed (68) hide show
  1. package/README.md +1 -1
  2. package/iframe/.vite/manifest.json +4 -4
  3. package/iframe/{iframe-eblock.fd4347fc.html → iframe-eblock.5751e42b.html} +2 -2
  4. package/iframe/{iframe.fd4347fc.html → iframe.5751e42b.html} +2 -2
  5. package/iframe/js/elMarkupHelper.BpDXO-hq.js +279 -0
  6. package/iframe/js/{iframe-eblock.body.fd4347fc.js → iframe-eblock.body.5751e42b.js} +1 -1
  7. package/iframe/js/iframe-eblock.js +2 -2
  8. package/iframe/js/{iframe.body.fd4347fc.js → iframe.body.5751e42b.js} +1 -1
  9. package/iframe/js/iframe.js +2 -2
  10. package/package.json +1 -1
  11. package/runtime/react/index.js +1 -1
  12. package/static/core/{6ec347ff.js → 11009bdf.js} +1 -1
  13. package/static/core/{846cd365.js → 11dadbc0.js} +1 -1
  14. package/static/core/{31d22827.js → 1c06cdb7.js} +1 -1
  15. package/static/core/{31da6da0.js → 1c3a16fc.js} +1 -1
  16. package/static/core/{d48488c4.js → 1c7a6d45.js} +1 -1
  17. package/static/core/{ab741434.js → 257745eb.js} +1 -1
  18. package/static/core/{939d4a62.js → 261a3a42.js} +1 -1
  19. package/static/core/2bed6a18.js +7 -0
  20. package/static/core/347b0a0b.js +1 -0
  21. package/static/core/{2865f716.js → 3b65bc50.js} +1 -1
  22. package/static/core/{bbf48eb9.js → 3d8e2478.js} +1 -1
  23. package/static/core/{5fd45688.js → 3eeb4445.js} +1 -1
  24. package/static/core/{17c8ebc4.js → 467344d4.js} +1 -1
  25. package/static/core/{c5128299.js → 513e36bd.js} +1 -1
  26. package/static/core/{579d4466.js → 516f59e7.js} +1 -1
  27. package/static/core/{9d57053a.js → 58dca22f.js} +1 -1
  28. package/static/core/{9438888a.js → 5da33486.js} +1 -1
  29. package/static/core/{752288e6.js → 6172f09a.js} +1 -1
  30. package/static/core/{12963ed5.js → 62855b97.js} +1 -1
  31. package/static/core/{1fcc0627.js → 66113a18.js} +1 -1
  32. package/static/core/{7934ed7e.js → 71727873.js} +1 -1
  33. package/static/core/{c33a9c36.js → 76543cb2.js} +1 -1
  34. package/static/core/{e9281a4c.js → 7e329493.js} +1 -1
  35. package/static/core/{70749936.js → 8406bab5.js} +1 -1
  36. package/static/core/{925b75fb.js → 8845436d.js} +2 -2
  37. package/static/core/{e37da9a7.js → 94f9492b.js} +1 -1
  38. package/static/core/{153a5a27.js → aee84e3d.js} +1 -1
  39. package/static/core/{78500214.js → b55ae539.js} +1 -1
  40. package/static/core/{8d0796c1.js → b59c63d2.js} +1 -1
  41. package/static/core/{37bf0f7a.js → b9f553d7.js} +1 -1
  42. package/static/core/{b0edd3a1.js → bda2d9d5.js} +1 -1
  43. package/static/core/{9916b298.js → c0a3f7d0.js} +2 -2
  44. package/static/core/{4181d334.js → c13b3d4f.js} +1 -1
  45. package/static/core/{2d58a94b.js → d2cf6b4b.js} +1 -1
  46. package/static/core/{983a408d.js → d343e46e.js} +1 -1
  47. package/static/core/{3a5bea82.js → d9d5b376.js} +1 -1
  48. package/static/core/{cc4657d9.js → dd008ec2.js} +1 -1
  49. package/static/core/{3ca0af3d.js → e037a420.js} +1 -1
  50. package/static/core/{f8f52e6d.js → e698ec22.js} +1 -1
  51. package/static/core/{13a6a2d3.js → e7e888c1.js} +1 -1
  52. package/static/core/ed65b5c3.js +19 -0
  53. package/static/core/{66b856ca.js → ef035f6b.js} +1 -1
  54. package/static/core/{dda98b73.js → f1b8515a.js} +1 -1
  55. package/static/core/{ae251a52.js → f8585ce6.js} +1 -1
  56. package/static/esm/{f97f42d1.js → c5372168.js} +1 -1
  57. package/static/umd-runtime/{runtime.CQCs2kHH.js → runtime.Lgfb59e0.js} +1 -1
  58. package/useblocks-core.5751e42b.js +875 -0
  59. package/useblocks-esm.js +6 -6
  60. package/{useblocks-po.fd4347fc.js → useblocks-po.5751e42b.js} +1 -1
  61. package/useblocks.d.ts +2 -2
  62. package/useblocks.js +12 -12
  63. package/vendor/useblocks-ui-kit/package.json +1 -1
  64. package/iframe/js/elMarkupHelper.DLCHSWwj.js +0 -279
  65. package/static/core/4f5add14.js +0 -1
  66. package/static/core/68e393e4.js +0 -19
  67. package/static/core/f126c14c.js +0 -7
  68. package/useblocks-core.fd4347fc.js +0 -875
@@ -0,0 +1,7 @@
1
+ __useblocks__.define("static/core/a73da823.js",["require","exports","module"],function(d,a,u){function s(c,l="application/octet-stream"){let t=c.trim(),i=l?.trim()||"application/octet-stream";const o=t.indexOf(",");if(t.startsWith("data:")&&o>=0){const e=t.slice(5,o).split(";")[0]?.trim();e&&(i=e),t=t.slice(o+1)}const m=t.replace(/\s/g,""),r=atob(m),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return new Blob([n],{type:i})}Object.defineProperty(a,"base64ToBlob",{enumerable:!0,get:function(){return s}})});
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(--ub-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(--ub-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(--ub-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(--ub-borderWidth) * 1px);border-color:var(--ub-colorFillSecondaryDarken);border-radius:calc(var(--ub-borderRadius) * 1px);width:100%;padding-left:0;display:inline-flex}.blocks-app .image-ai .image-ai__input-affix-wrapper:hover{border-color:var(--ub-borderColorHover)}.blocks-app .image-ai .image-ai__input-affix-wrapper.ant-input-affix-wrapper-focused{border-color:var(--ub-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(--ub-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(--ub-colorBorderSecondary);background:linear-gradient(180deg, var(--ub-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(--ub-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(--ub-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(--ub-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.__useblocks_styles__||(window.__useblocks_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-useblocks","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-useblocks","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
+ __useblocks__.define("static/core/2bed6a18.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/a42ab03f.js","static/core/1c3a16fc.js","static/core/ed65b5c3.js","static/core/a73da823.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper"],function(oe,kt,mn){const et=oe("./2ff39ddf.js"),be=oe("./cf7d1dd7.js"),s=oe("./a42ab03f.js"),we=oe("./1c3a16fc.js"),he=oe("./ed65b5c3.js"),xt=oe("./a73da823.js");let e=oe("react");e=et.__toESM(e);let t=oe("react/jsx-runtime"),m=oe("__delivery__/libs"),Et=oe("vite/preload-helper");var _t=et.__toESM(s.require_prop_types()),St=s.lazyRoute(()=>(0,Et.__vitePreload)(()=>Promise.resolve().then(()=>oe("./e037a420.js")),void 0,{}.url));function jt(r){return s.useSelector(s.selectSecondModal)?(0,t.jsx)(e.Suspense,{fallback:null,children:(0,t.jsx)(St,{...r})}):null}var Rt=({currentImageLink:r,newLink:o,previewDisplayUrl:i,resolvedPreviewObjectUrl:l,resolvedPreviewBlob:u,resolveImageBlob:c,onSave:f,uploadImageResultIsLoading:p})=>{const h=i||l;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"image-preview",children:[p&&(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"})}),h&&(0,t.jsx)("img",{alt:"uploadedImage",src:h})]})}),(0,t.jsx)(jt,{currentImageLink:r,prefetchedBlob:u,resolveImageBlob:c,newLink:o,onSave:f,uploadImageResultIsLoading:p})]})},_e={Pixel:"Pixel",Percent:"Percent"},tt={unit:_e.Percent,value:80};function Lt(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)}:tt:tt}function Ot(r,o){const i=Lt(r);let l;return i.unit===_e.Pixel?l=`${i.value}px`:l=`${100-i.value}%`,o?`${l} 0px 0px 0px`:`0px 0px ${l} 0px`}function nt({next:r,hasMore:o,children:i,loader:l,scrollThreshold:u=.8,endMessage:c,style:f,height:p,scrollableTarget:h,hasChildren:w,inverse:x=!1,pullDownToRefresh:A=!1,pullDownToRefreshContent:g,releaseToRefreshContent:E,pullDownToRefreshThreshold:I=100,refreshFunction:L,onScroll:b,dataLength:_,initialScrollY:S,className:T="",role:Q,tabIndex:z,id:P,...$}){const[K,V]=(0,e.useState)(!1),[q,W]=(0,e.useState)(!1),[B,re]=(0,e.useState)(0),k=(0,e.useRef)(null),H=(0,e.useRef)(null),G=(0,e.useRef)(null),ne=(0,e.useRef)(r);ne.current=r;const M=(0,e.useRef)(L);M.current=L;const J=(0,e.useRef)(I);J.current=I;const n=(0,e.useRef)(!1),C=(0,e.useRef)(!1),O=(0,e.useRef)(0),F=(0,e.useRef)(0),ae=(0,e.useRef)(0),D=(0,e.useCallback)(()=>h instanceof HTMLElement?h:typeof h=="string"?document.getElementById(h):null,[h]);(0,e.useEffect)(()=>{if(typeof _>"u")throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(A&&typeof L!="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 U=p?k.current:D();U&&U.scrollHeight>S&&U.scrollTo(0,S)}},[]),(0,e.useEffect)(()=>{n.current=!1,V(!1)},[_]),(0,e.useEffect)(()=>{if(!o||typeof IntersectionObserver>"u")return;const U=H.current;if(!U)return;const te=p?k.current:D(),j=new IntersectionObserver(([se])=>{!se.isIntersecting||n.current||(n.current=!0,V(!0),ne.current())},{root:te,rootMargin:Ot(u,x),threshold:0});return j.observe(U),()=>j.disconnect()},[o,u,x,p,D]),(0,e.useEffect)(()=>{var U;if(!b)return;const te=(U=p?k.current:D())!==null&&U!==void 0?U:typeof window<"u"?window:null;if(!te)return;const j=se=>{setTimeout(()=>b(se),0)};return te.addEventListener("scroll",j),()=>te.removeEventListener("scroll",j)},[b,p,D]),(0,e.useEffect)(()=>{var U,te;if(!A)return;const j=(U=p?k.current:D())!==null&&U!==void 0?U:typeof window<"u"?window:null;if(!j)return;if(!((te=G.current)===null||te===void 0)&&te.firstChild){const R=G.current.firstChild.getBoundingClientRect().height;ae.current=R,re(R)}const se=R=>{(j instanceof HTMLElement?j.scrollTop:document.documentElement.scrollTop)>0||(C.current=!0,R instanceof MouseEvent?O.current=R.pageY:R instanceof TouchEvent&&(O.current=R.touches[0].pageY),F.current=O.current,k.current&&(k.current.style.willChange="transform",k.current.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},ue=R=>{if(!C.current||(R instanceof MouseEvent?F.current=R.pageY:R instanceof TouchEvent&&(F.current=R.touches[0].pageY),F.current<O.current))return;const Z=F.current-O.current;Z>=J.current&&W(!0),!(Z>ae.current*1.5)&&k.current&&(k.current.style.overflow="visible",k.current.style.transform=`translate3d(0px, ${Z}px, 0px)`)},v=()=>{O.current=0,F.current=0,C.current=!1,W(R=>{var Z;return R&&((Z=M.current)===null||Z===void 0||Z.call(M)),!1}),requestAnimationFrame(()=>{k.current&&(k.current.style.overflow="auto",k.current.style.transform="none",k.current.style.willChange="unset")})};return j.addEventListener("touchstart",se),j.addEventListener("touchmove",ue),j.addEventListener("touchend",v),j.addEventListener("mousedown",se),j.addEventListener("mousemove",ue),j.addEventListener("mouseup",v),()=>{j.removeEventListener("touchstart",se),j.removeEventListener("touchmove",ue),j.removeEventListener("touchend",v),j.removeEventListener("mousedown",se),j.removeEventListener("mousemove",ue),j.removeEventListener("mouseup",v)}},[A,p,D]);const le={height:p??"auto",overflow:"auto",WebkitOverflowScrolling:"touch",...f},ee=w||!!(i&&i instanceof Array&&i.length),ce=A&&p?{overflow:"auto"}:{},Y=o?(0,t.jsx)("div",{ref:H,style:{height:1}}):null;return(0,t.jsx)("div",{style:ce,className:"infinite-scroll-component__outerdiv",children:(0,t.jsxs)("div",{...$,role:Q,tabIndex:z,id:P,className:["infinite-scroll-component",T].filter(Boolean).join(" "),ref:k,style:le,children:[A&&(0,t.jsx)("div",{style:{position:"relative"},ref:G,children:(0,t.jsx)("div",{style:{position:"absolute",left:0,right:0,top:-1*B},children:q?E:g})}),i,!K&&!ee&&o&&l,K&&o&&l,Y,!o&&c]})})}function Pt(r,o){if(r==null)return{};var i=Ut(r,o),l,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(r);for(u=0;u<c.length;u++)l=c[u],!(o.indexOf(l)>=0)&&Object.prototype.propertyIsEnumerable.call(r,l)&&(i[l]=r[l])}return i}function Ut(r,o){if(r==null)return{};for(var i={},l=Object.keys(r),u,c=0;c<l.length;c++)u=l[c],!(o.indexOf(u)>=0)&&(i[u]=r[u]);return i}function Ue(){return Ue=Object.assign||function(r){for(var o=1;o<arguments.length;o++){var i=arguments[o];for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l])}return r},Ue.apply(this,arguments)}function st(r,o){var i=Object.keys(r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(r);o&&(l=l.filter(function(u){return Object.getOwnPropertyDescriptor(r,u).enumerable})),i.push.apply(i,l)}return i}function Se(r){for(var o=1;o<arguments.length;o++){var i=arguments[o]!=null?arguments[o]:{};o%2?st(Object(i),!0).forEach(function(l){Dt(r,l,i[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):st(Object(i)).forEach(function(l){Object.defineProperty(r,l,Object.getOwnPropertyDescriptor(i,l))})}return r}function Dt(r,o,i){return o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r}var Mt={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0},Te=2,Be=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)||Te,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)||Te});let i=1/0,l=o.default||Te;for(let u in o){const c=parseInt(u);c>0&&r<=c&&c<i&&(i=c,l=o[u])}l=Math.max(1,parseInt(l)||1),this.state.columnCount!==l&&this.setState({columnCount:l})}itemsInColumns(){const r=this.state.columnCount,o=new Array(r),i=e.default.Children.toArray(this.props.children);for(let l=0;l<i.length;l++){const u=l%r;o[u]||(o[u]=[]),o[u].push(i[l])}return o}renderColumns(){const{column:r,columnAttrs:o={},columnClassName:i}=this.props,l=this.itemsInColumns(),u=`${100/l.length}%`;let c=i;c&&typeof c!="string"&&(this.logDeprecated('The property "columnClassName" requires a string'),typeof c>"u"&&(c="my-masonry-grid_column"));const f=Se(Se(Se({},r),o),{},{style:Se(Se({},o.style),{},{width:u}),className:c});return l.map((p,h)=>e.default.createElement("div",Ue({},f,{key:h}),p))}logDeprecated(r){}render(){const r=this.props,{children:o,breakpointCols:i,columnClassName:l,columnAttrs:u,column:c,className:f}=r,p=Pt(r,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let h=f;return typeof f!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof f>"u"&&(h="my-masonry-grid")),e.default.createElement("div",Ue({},p,{className:h}),this.renderColumns())}};Be.defaultProps=Mt;function Fe(r,o){return r?r.exhausted?{...r,src:null}:{...r,src:r.src||o||null}:null}function rt({items:r,getItemId:o,getRequestUrl:i,createController:l}){const[u,c]=(0,e.useState)({}),f=(0,e.useRef)(new Map),p=(0,e.useCallback)(h=>{const w=o(h),x=i(h),A=`${w}:${x}`;if(f.current.has(A))return{itemId:w,requestUrl:x,cacheKey:A,controller:f.current.get(A)};const g=l(x);return f.current.set(A,g),{itemId:w,requestUrl:x,cacheKey:A,controller:g}},[l,o,i]);return(0,e.useEffect)(()=>{const h=new Set,w={},x=r.map(A=>{const{itemId:g,cacheKey:E,controller:I}=p(A);h.add(E),w[g]=I.src;const L=Fe(I.handleChangeSrc?.(),I.src);return L?.changed&&L.src&&(w[g]=L.src),I.subscribeToSrcChange?.(b=>{const _=Fe(b,I.src);!_?.changed||!_.src||c(S=>S[g]===_.src?S:{...S,[g]:_.src})})}).filter(Boolean);return f.current.forEach((A,g)=>{h.has(g)||f.current.delete(g)}),c(w),()=>{x.forEach(A=>A?.())}},[p,r]),{getDisplaySrc:(0,e.useCallback)(h=>{const{itemId:w,requestUrl:x,controller:A}=p(h);return u[w]||A.src||x},[u,p]),handleLoad:(0,e.useCallback)(h=>{p(h).controller.handleSuccess()},[p]),handleError:(0,e.useCallback)(h=>{const{itemId:w,controller:x}=p(h),A=Fe(x.handleError(),x.src);A?.changed&&A.src&&c(g=>({...g,[w]:A.src}))},[p])}}var at="blocks",Gt=({setCurrentImageLink:r,setModalHeight:o,setModalWidth:i,setImageStockList:l,imageStockList:u,currentReq:c,setCurrentReq:f,inputRef:p,setStockLink:h,customRequest:w})=>{const x=s.useAppConfig(),A=s.useIsStandalone(),[g,E]=(0,e.useState)(!1),[I,L]=(0,e.useState)(2),{__:b}=s.useI18n(),_=s.useNotification(),[S]=s.useLazyGetUnsplashImageQuery(),[T]=s.useLazyGetSearchImageQuery(),Q=(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:b("Failed to load stock images through the configured proxy chain."),[b]),z=(0,e.useCallback)(n=>{_.error({id:"STOCK_IMAGES_SEARCH_FAILED",title:b("Failed to load stock images"),description:Q(n)})},[b,Q,_]),P=async()=>{g||(E(!0),T({query:c,page:I}).then(n=>{if(n?.error){z(n.error),E(!1);return}const C=n?.data?.results||[];l(O=>[...O,...C]),E(!1),L(O=>O+1)}).catch(()=>{E(!1)}))};(0,e.useEffect)(()=>{c.keywords!==""&&$()},[c.color,c.orientation]);const $=async()=>{const n=await T({query:c,page:1});if(n?.error){z(n.error),l([]);return}const C=n?.data?.results||[];C.length>0?(l(C),setTimeout(()=>{i(1060),o("84vh")},0)):l([])},[K,V]=(0,e.useState)(null),q=(0,e.useCallback)((n,C,O)=>`${n}${n.includes("?")?"&":"?"}w=${C}&q=${O}`,[]),W=(0,e.useCallback)(n=>be.getProxiedUrl(n,{config:x,standalone:A,resourceType:"stockImages",intent:"display"}),[x,A]),B=(0,e.useCallback)(n=>n.id,[]),re=(0,e.useCallback)(n=>q(n.urls.raw,644,96),[q]),{getDisplaySrc:k,handleLoad:H,handleError:G}=rt({items:u,getItemId:B,getRequestUrl:re,createController:W}),ne=n=>C=>{H(n),C.target.parentNode.classList.add("loaded")},M=n=>()=>{G(n)},J=(n,C,O)=>{S(C.download_location),V(O),setTimeout(()=>V(null),2e3),h(`${n.raw}&w=1200&q=96`),r(`${n.raw}&w=1200&q=96`),w(`${n.raw}&w=1200&q=96`)};return(0,t.jsxs)("div",{className:"stock-tab",children:[(0,t.jsxs)(m.ui_kit$Form,{onValuesChange:$,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:$,allowClear:!0,size:u.length>0?"medium":"large",placeholder:b("Search image"),value:c.keywords,onChange:n=>f(C=>({...C,keywords:n.target.value})),ref:p,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=>f(C=>({...C,orientation:n.target.value})),children:[(0,t.jsx)(m.ui_kit$Tooltip,{title:b("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:b("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:b("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:b("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=>f(C=>({...C,color:n.target.value})),options:[{value:"",colorClass:"all-colors",label:b("All")},{value:"black",colorClass:"black-color",label:b("Black")},{value:"black_and_white",colorClass:"bw-color",label:b("Black and White")},{value:"white",colorClass:"white-color",label:b("White")},{value:"orange",colorClass:"orange-color",label:b("Orange")},{value:"red",colorClass:"red-color",label:b("Red")},{value:"purple",colorClass:"purple-color",label:b("Purple")},{value:"magenta",colorClass:"magenta-color",label:b("Magenta")},{value:"green",colorClass:"green-color",label:b("Green")},{value:"teal",colorClass:"teal-color",label:b("Teal")},{value:"blue",colorClass:"blue-color",label:b("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)(nt,{dataLength:u&&u.length,next:P,hasMore:u,endMessage:(0,t.jsxs)(m.ui_kit$Divider,{plain:!0,children:[b("That`s all we could find.")," 🤐"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:null,children:(0,t.jsx)(Be,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column",children:u.map(n=>(0,t.jsxs)("div",{className:"list-item",onClick:()=>J(n.urls,n.links,n.id),children:[(0,t.jsx)("img",{className:K===n.id?"loaded-image":"",width:"322px",src:k(n),alt:n.description,onLoad:ne(n),onError:M(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=${at}&utm_medium=referral`,rel:"noreferrer",children:n.user.name})," ","on"," ",(0,t.jsx)("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${at}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),K===n.id&&(0,t.jsx)(m.ui_kit$Spin,{className:"ant-spin",size:"small"})]},n.id))})})})})]})};function ot(r){return/^(https?:)?\/\//i.test(r.trim())}function Nt(r){const o=r.trim();return ot(o)||/^data:/i.test(o)?o:`data:image/jpeg;base64, ${r}`}var Tt=({images:r,transitionDuration:o=1e3})=>{const[i,l]=(0,e.useState)([]);return(0,e.useEffect)(()=>{if(r.length>0){const u=r[r.length-1];l(c=>[...c,{src:u,opacity:0}]),setTimeout(()=>{l(c=>c.map((f,p)=>p===c.length-1?{...f,opacity:1}:f))},1e3)}},[r]),(0,t.jsx)("div",{className:"slideshow-container",children:i.map((u,c)=>(0,t.jsx)("img",{src:Nt(u.src),alt:`Slide ${c+1}`,className:"slideshow-image",style:{opacity:u.opacity,transition:`opacity ${o}ms linear`}},c))})};function Bt({setModalHeight:r,customRequest:o,aiTabRef:i,isImageUploaded:l,setIsImageUploaded:u,aiImageRequest:c,imageAiList:f,setImageAiList:p,isLoadingAi:h,setIsLoadingAi:w,onPluginAiImageLimitExceeded:x,onImageGenerateLimitExceeded:A}){const{__:g}=s.useI18n(),E=s.useAppConfig(),I=s.useNotification(),L=s.usePushToDataLayer(),{blockId:b}=s.useRouteParams(),_=s.useEditorProjectId(),S=s.useRouteEmailId(),T=s.useWpEntityId(),[Q]=s.useLazySendAiImageRequestQuery(),[z,{data:P=[]}]=s.useLazyGetAiImageSSEQuery(),$=s.useProjectPlanLimitPreflight(),K=E?.sendAIImageRequest||Q,V=E?.trigger||z,q=E?.handleLimitUsageEmitter||s.useEventEmitter(be.events.ON_LIMIT_ID),[W,B]=(0,e.useState)(0),[re,k]=(0,e.useState)(null),[H,G]=(0,e.useState)(!1),[ne,M]=(0,e.useState)(g("Evaluating the task")),[J,n]=(0,e.useState)(!1),C=(S?s.isEmailsV2Enabled():s.isBlocksV2Enabled())?T:S||b,{limits:O}=E?.limits?E:{limits:{ai_img_limit:0}},{ai_img_limit:F}=O,ae=!!(E.limits&&E.counters)&&!0,D=s.useEventEmitter(be.events.AI_IMAGE_REQUEST_ID).hasListeners(),le=he.shouldCountAiUsage({limitsInPlugin:ae,hostedAiActive:D}),ee=!D&&F>0&&W>=F,ce=(0,e.useCallback)(()=>{q.fire({name:"AiImgCount",count:W+1})},[q,W]),Y=(0,e.useMemo)(()=>!ee&&(!le||F===0||W<F),[ee,le,W,F]),U=(0,e.useCallback)(async()=>{M(g("Evaluating the task")),c!==""&&!h&&(w(!0),n(!0),p([]),L({event:"submit_form",action:"ai_image_generation",entity_id:S,project_id:_}),K({body:{project_id:_,request:"create-image",connection:"midjourney",message:c}}).then(({data:v,error:R})=>{if(R)throw R;if(v.data.status===401)throw new Error(s.ERROR);if(v?.data?._eventResult){p(v.data.task.images),w(!1),n(!1),M(g("Evaluating the task"));return}v?.data.status===200?(v?.data.task.id&&(M(v.data.task.message),k(v.data.task.id)),v.message&&I.success({id:"AI_IMAGE_SEND_SUCCESS",title:v.message,placement:"bottomRight",data:c}),V({task_id:v?.data.task.id,entity_id:C})):(w(!1),n(!1),I.error({id:"AI_IMAGE_SEND_ERROR",title:v?.message||g("Something went wrong, please try again"),placement:"bottomRight",data:c,innerException:v}))}).catch(v=>{w(!1),n(!1),(v?.error||v?.data)&&I.fromError("AI_IMAGE_SEND_ERROR",c,v.error||v)}))},[c,h,w,n,p,L,S,_,K,I,V,C,g]),te=(0,e.useCallback)(async()=>{Y?(le&&(B(v=>v+1),ce()),U()):ae&&(x?x():I.error({title:g("The usage limit has been exceeded"),description:g(`The maximum number of requests for the current subscription period has been reached.
7
+ Select the appropriate plan to fulfil more requests`),placement:"bottomRight"}))},[Y,ae,D,le,$,A,B,ce,U,I,g,x]);(0,e.useEffect)(()=>{ae&&B(E?.counters?.ai_img_counter||0)},[E,ae]);const j=s.useEventEmitter(be.events.AI_IMAGE_PROGRESS_ID);(0,e.useEffect)(()=>{const v=j.event(({progress:R,status:Z})=>{M(Z||`${Math.round(R)}%`)});return()=>v.dispose()},[j]);const se=(0,e.useCallback)(async v=>{if(!l){u(!0);try{const R=ot(v)?await(await fetch(v)).blob():xt.base64ToBlob(v);o({file:new File([R],"image.jpeg",{type:R.type||"image/jpeg"})})}catch{u(!1)}}},[l,u,o]),ue=(0,e.useCallback)(v=>{v.status!=="error"&&v.status!=="Canceled"?v.images?(M(v.status),v.progress===100&&(p(v.images),M(g("Evaluating the task")),k(null),n(!1))):(p([v.data]),w(!1)):(w(!1),n(!1),I.error({id:"AI_IMAGE_GET_ERROR",title:g("Something went wrong, please try again"),placement:"bottomRight",data:re}))},[p,M,g,w,r,re,I,n]);return(0,e.useEffect)(()=>{P.length>1&&ue(P[P.length-1])},[P,ue]),(0,e.useEffect)(()=>{(h||f.length>0)&&setTimeout(()=>{let v=550;i.current&&(v=i.current.offsetHeight+68),r(v)},0)},[i,P,f.length,h,r]),{aiImageCounter:W,setAiImageCounter:B,currentAiImgLimits:F,isFieldsDisabled:ee,canGenerateImage:Y,aiImageRequest:c,imageAiList:f,setImageAiList:p,isLoadingAi:h,setIsLoadingAi:w,loadingDuringGeneration:J,setLoadingDuringGeneration:n,requestStatus:ne,setRequestStatus:M,handleGenerate:te,handleLimitAiImgCount:ce,convertBase64ToFile:se,isShiftPressed:H,setIsShiftPressed:G,currentReqId:re,setCurrentReqId:k,limitsInPlugin:ae}}var Ft=({setModalHeight:r,customRequest:o,aiTabRef:i,inputAiRef:l,isImageUploaded:u,setIsImageUploaded:c,aiImageRequest:f,setAiImageRequest:p,imageAiList:h,setImageAiList:w,isLoadingAi:x,setIsLoadingAi:A})=>{const g=s.useAppNavigate();s.useDispatch();const E=s.useOpenPlanCatalog(),{__:I,_n:L}=s.useI18n(),b=s.useAppConfig(),[_,S]=(0,e.useState)(!1),[T,Q]=(0,e.useState)(null),{aiImageCounter:z,currentAiImgLimits:P,loadingDuringGeneration:$,requestStatus:K,handleGenerate:V,convertBase64ToFile:q,isShiftPressed:W,setIsShiftPressed:B,limitsInPlugin:re}=Bt({setModalHeight:r,customRequest:o,aiTabRef:i,isImageUploaded:u,setIsImageUploaded:c,aiImageRequest:f,imageAiList:h,setImageAiList:w,isLoadingAi:x,setIsLoadingAi:A,onPluginAiImageLimitExceeded:()=>S(!0),onImageGenerateLimitExceeded:Q}),k=_&&P>0?s.getAiTariffUpgradeStep(P):null,H=k?s.getLimitUpgradePresetDefinition(k.presetId):null,G=T?s.getLimitUpgradePresetDefinition(T.presetId):null,ne=(0,e.useCallback)(()=>S(!1),[]),M=(0,e.useCallback)(()=>Q(null),[]),J=s.useNativeExtraBuyAction(H?.usageResource,ne),n=s.useNativeExtraBuyAction(G?.usageResource,M),[C,O]=(0,e.useState)(!1),F=(0,e.useCallback)(()=>O(!0),[]),ae=(0,e.useCallback)(()=>O(!1),[]),D=(0,e.useCallback)(Y=>p(Y.target.value),[p]),le=(0,e.useCallback)(Y=>{Y.key==="Shift"?B(!0):Y.key==="Enter"&&!W&&(Y.preventDefault(),V())},[W,V,B]),ee=(0,e.useCallback)(Y=>{Y.key==="Shift"&&B(!1)},[B]),ce=h[h.length-1];return(0,t.jsxs)("div",{className:"image-ai",children:[H&&k?(0,t.jsx)(he.LimitUpgradeModal$1,{open:!0,onClose:ne,title:I(H.titleKey),subtitle:I(H.subtitleKey),usageResource:H.usageResource,previousDisplay:s.presetLimitDisplay(k.previousLimit),nextDisplay:s.presetLimitDisplay(k.nextLimit),secondaryAction:J,onChangePlan:()=>{S(!1),E()}}):null,G&&T?(0,t.jsx)(he.LimitUpgradeModal$1,{open:!0,onClose:M,title:I(G.titleKey),subtitle:I(G.subtitleKey),usageResource:G.usageResource,previousDisplay:s.presetLimitDisplay(T.previousLimit),nextDisplay:s.presetLimitDisplay(T.nextLimit),secondaryAction:n,onChangePlan:()=>{Q(null),E()}}):null,re&&(0,t.jsx)(m.ui_kit$LimitsCounter,{text:`${z} ${I("of")} ${P>0?P:"∞"} images ${L("was used","were used",z)}`,exceeded:P>0&&z>=P,style:{marginTop:-25},extra:(0,t.jsx)("span",{style:{textDecoration:"underline",cursor:"pointer"},onClick:()=>g(b.billingPageUrl||s.APP_ROUTES.billing),children:I("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${C?" ant-input-affix-wrapper-focused":""}`,children:[(0,t.jsx)(m.ui_kit$TextArea,{ref:l,onKeyDown:le,onKeyUp:ee,onFocus:F,onBlur:ae,autoSize:!0,allowClear:!0,className:"text-area-input-hybrid image-ai__textarea",placeholder:I("Generate image"),value:f,onChange:D,spellCheck:"false"}),(0,t.jsx)("span",{className:"ant-input-suffix image-ai__input-suffix",children:x||$?(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:V})})]})})})}),(x||h.length>0)&&(0,t.jsxs)("div",{className:"image-ai__preview",children:[x&&h.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:K})]})}),h.length>0&&(0,t.jsxs)("div",{className:"image-ai__image-item",children:[(0,t.jsx)(Tt,{images:h}),(0,t.jsx)("div",{className:"buttons",children:(0,t.jsx)(m.ui_kit$Button,{onClick:()=>q(ce),icon:(0,t.jsx)(s.EmIcons,{icon:"CheckOutlined",component:m.icons$CheckOutlined}),children:I("Use this one")})})]})]})]})},pn="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=",zt=({setNewLink:r,setCurrentImageLink:o,setModalHeight:i,setModalWidth:l,setImageGifList:u,imageGifList:c,currentReqGif:f,setCurrentReqGif:p,inputRef:h,setStockLink:w,customRequest:x})=>{const{__:A}=s.useI18n(),g=s.useAppConfig(),E=s.useIsStandalone(),I=s.useNotification(),[L,b]=(0,e.useState)(null),[_,S]=(0,e.useState)(!1),[T,Q]=(0,e.useState)(25),[z]=s.useLazyGetSearchGifQuery(),P=(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:A("Failed to load GIFs through the configured proxy chain."),[A]),$=(0,e.useCallback)(n=>{I.error({id:"STOCK_GIFS_SEARCH_FAILED",title:A("Failed to load GIFs"),description:P(n)})},[A,P,I]),K=async()=>{_||(S(!0),z({query:f,page:T}).then(n=>{if(n?.error){$(n.error),S(!1);return}u(C=>[...C,...n.data.data]),S(!1),Q(C=>C+25)}).catch(()=>{S(!1)}))},V=async()=>{const n=await z({query:f,page:0});if(n?.error){$(n.error),u([]);return}n?.data?.data?.length>0&&(u(n.data.data),setTimeout(()=>{i("84vh"),l(1060)},0))},q=(n,C)=>{b(C),setTimeout(()=>{b(null)},2e3),w(`${n}`),o(`${n}`),x(`${n}`)},W={default:3},B=(0,e.useCallback)(n=>be.getProxiedUrl(n,{config:g,standalone:E,resourceType:"generic",intent:"display"}),[g,E]),re=(0,e.useCallback)(n=>n.id,[]),k=(0,e.useCallback)(n=>n.images.downsized.url,[]),{getDisplaySrc:H,handleLoad:G,handleError:ne}=rt({items:c,getItemId:re,getRequestUrl:k,createController:B}),M=n=>C=>{G(n),C.target.parentNode.classList.add("loaded")},J=n=>()=>{ne(n)};return(0,t.jsxs)("div",{className:"stock-tab",children:[(0,t.jsxs)(m.ui_kit$Form,{onValuesChange:V,className:c.length>0?"serach-results":"",children:[(0,t.jsx)(m.ui_kit$Row,{gutter:24,children:(0,t.jsx)(m.ui_kit$Col,{span:c.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:V,allowClear:!0,size:c.length>0?"medium":"large",placeholder:A("Search GIFs"),value:f.keywords,onChange:n=>p(C=>({...C,keywords:n.target.value})),ref:h,spellCheck:"false",enterButton:!1})})})}),c.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:c.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)(nt,{dataLength:c&&c.length,next:K,hasMore:c,endMessage:(0,t.jsxs)(m.ui_kit$Divider,{plain:!0,children:[A("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)(Be,{breakpointCols:W,className:"my-masonry-grid",columnClassName:"my-masonry-grid_column",children:c.map((n,C)=>(0,t.jsxs)("div",{className:"list-item",onClick:()=>q(n.images.downsized.url,n.id),children:[(0,t.jsx)("img",{className:L===n.id?"loaded-image":"",width:"322px",src:H(n),alt:n.title,onLoad:M(n),onError:J(n)}),(0,t.jsx)("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:O=>O.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=)"}})}),L===n.id&&(0,t.jsx)(m.ui_kit$Spin,{className:"ant-spin",size:"small"})]},n.id+C))})})})})]})},it="IMG",lt="BACKGROUND",$t="GALLERY",Ie="EDITOR",me="UPLOAD",ze="STOCK",$e="GIF",Ke="AI",Kt={mode:"select"},Wt={mode:"save"},{Dragger:Vt}=m.ui_kit$Upload,Ht=(r,o="image")=>s.decodeFileNameFromUrl(r)??o,je=we.normalizeImageFormatForDisplay,Qt=(r,o)=>{const i=je(o);return!i||r.includes(".")?r:`${r}.${i}`},qt=(r,o)=>new File([r],Qt(Ht(o),r.type),{type:r.type||"application/octet-stream"}),ct=({dataProvider:r,usesBuiltInStorage:o})=>{const i=s.useAppConfig(),l=s.useIntegratorConfigValue("compressMaxSize"),u=s.useIsStandalone(),c=s.shouldInsertUploadLinkAsIs(i),{__:f}=s.useI18n(),p=s.useDispatch(),h=s.useEditorProjectId(),[w]=s.useLazyGetImageInfoQuery(),{modal:x}=m.ui_kit$App.useApp(),A=s.useNotification(),g=s.useSelector(s.selectActiveModal$1),{request:E,resolveImagePicker:I}=s.useImagePicker(),[L,b]=(0,e.useState)(""),[_,S]=(0,e.useState)(""),[T,Q]=(0,e.useState)(""),[z,P]=(0,e.useState)(""),[$,K]=(0,e.useState)(me),[V,q]=(0,e.useState)({width:"",height:"",size:"",format:""}),[W,B]=(0,e.useState)("success"),[re,k]=(0,e.useState)(!1),H=e.default.useRef(null),G=e.default.useRef(null),ne=e.default.useRef(null),M=e.default.useRef(null),J=e.default.useRef(null),n=e.default.useRef(null),C=e.default.useRef(null),O=e.default.useRef(null),F=e.default.useRef(null),[ae,D]=(0,e.useState)("auto"),[le,ee]=(0,e.useState)(572),[ce,Y]=(0,e.useState)(!1),[U,te]=(0,e.useState)({keywords:"",color:"",orientation:""}),[j,se]=(0,e.useState)({keywords:""}),[ue,v]=(0,e.useState)([]),[R,Z]=(0,e.useState)([]),[ut,Yt]=(0,e.useState)([]),[dt,ft]=(0,e.useState)(!1),[mt,We]=(0,e.useState)(""),[Zt,Re]=(0,e.useState)(!1),[Xt,De]=(0,e.useState)(0),pt=s.useProjectData(),gt=pt?.id!==void 0?String(pt.id):h||"",ht=s.useEventEmitter(be.events.UPLOAD_EVENT_ID),pe=we.useImageBlobResolver(),Le=e.default.useRef(""),ye=e.default.useRef(0),ke=e.default.useRef(""),[Jt,vt]=(0,e.useState)(""),[en,Ct]=(0,e.useState)(null),[tn,Ve]=(0,e.useState)(""),Me=(0,e.useCallback)(a=>{if(!(a instanceof Blob))return;ke.current&&URL.revokeObjectURL(ke.current);const d=URL.createObjectURL(a);ke.current=d,vt(d),Ct(a)},[]),ge=(0,e.useCallback)(()=>{ke.current&&(URL.revokeObjectURL(ke.current),ke.current=""),vt(""),Ct(null)},[]),ie=(0,e.useCallback)(()=>{Ve("")},[]),He=s.usePlanFeatureGate("element_ai_image"),Qe=s.usePlanFeatureGate("stock_photo"),qe=s.usePlanFeatureGate("stock_gif"),yt=s.usePlanFeatureGate("image_editor"),Ge=(0,e.useRef)(!1),Ye=a=>{Ge.current=!0,S(a)},nn=a=>{Ge.current=!1,S(a.target.value)},Oe=(0,e.useCallback)((a,d,y=f("The image could not be uploaded."))=>{const N=d instanceof Error?d.message:y;A.error({id:"IMAGE_UPLOAD_ERROR",data:a,title:f("Upload failed"),description:N})},[f,A]),sn=(0,e.useCallback)(a=>s.fireUploadImageEvent(ht,{file:a,project:gt}),[gt,ht]),Ae=he.useImageBlobFetch(),rn=(0,e.useCallback)(a=>pe.resolve(we.canonicalImageUrlKey(a),void 0,Ae),[Ae,pe]),Ze=async a=>{if(a)try{const d=await on(a);d&&Je(d)?await xe({file:d}):d||Oe({url:a},null,f("Failed to download image from URL."))}catch(d){Oe({url:a},d,f("Failed to process image URL."))}},At=(a,d)=>{const y=s.resolveUploadLinkAction(c,d,Ge.current);y==="insertAsIs"?(Ge.current=!1,Ne({url:a})):y==="upload"&&Ze(a)},Xe=e.default.useRef(At);Xe.current=At;const an=(0,e.useCallback)(()=>{const a=_.trim();a.toLowerCase().startsWith("http")&&Xe.current(a,"enter")},[_]);e.default.useEffect(()=>{if($!==me||!z)return;const a=_.trim();if(!a||!a.toLowerCase().startsWith("http"))return;const d=setTimeout(()=>{Xe.current(a,"timer")},1e3);return()=>{clearTimeout(d)}},[_,$,z]);const on=async a=>{try{const d=we.canonicalImageUrlKey(a),y=await pe.resolve(d,void 0,Ae);return qt(y,d)}catch{}};document.onpaste=function(a){const d=a.clipboardData?.items?.[0];if($===me&&z){if(d?.type?.indexOf("image")===0&&i.imageCenterLocalUploadEnabled!==!1){const N=d.getAsFile();Je(N);const X={file:N};S(""),xe(X);return}const y=a.clipboardData?.getData("text/plain");if(y&&y.trim().toLowerCase().startsWith("http")){a.preventDefault(),a.stopPropagation(),Ye(y.trim());return}d?.type?.indexOf("text")===0&&d.getAsString(N=>{if(N.trim().toLowerCase().startsWith("http"))Ye(N.trim());else if(N.toString().slice(1,5)==="meta"){const X=N.toString().split('"')[1];X&&Ye(X)}})}},(0,e.useEffect)(()=>{const a=d=>{let y=null;E?.kind==="background"?(y=lt,P(lt)):E?.kind==="img"&&(P(it),y=it),E?.currentUrl&&y&&(b(E.currentUrl),K(d))};g===s.MODALS.UPLOAD_IMAGE_MODAL||g===s.MODALS.UPLOAD_BACKGROUND_MODAL?a(Ie):g===s.MODALS.UPLOAD_IMAGE_MODAL_AI||g===s.MODALS.UPLOAD_BACKGROUND_MODAL_AI?(He.isLocked?(Re(!0),De(s.FEATURE_UPSELL_SLIDE.element_ai_image)):a(Ke),setTimeout(()=>F.current?.focus({cursor:"start"}),100)):g===s.MODALS.UPLOAD_IMAGE_MODAL_UPLOAD||g===s.MODALS.UPLOAD_BACKGROUND_MODAL_UPLOAD?(a(me),setTimeout(()=>n.current?.focus({cursor:"start"}),100)):g===s.MODALS.UPLOAD_IMAGE_MODAL_STOCK||g===s.MODALS.UPLOAD_BACKGROUND_MODAL_STOCK?(Qe.isLocked?(Re(!0),De(s.FEATURE_UPSELL_SLIDE.stock_photo)):a(ze),setTimeout(()=>O.current?.focus({cursor:"start"}),100)):g===s.MODALS.UPLOAD_IMAGE_MODAL_GIF||g===s.MODALS.UPLOAD_BACKGROUND_MODAL_GIF?(qe.isLocked?(Re(!0),De(s.FEATURE_UPSELL_SLIDE.stock_gif)):a($e),setTimeout(()=>C.current?.focus({cursor:"start"}),100)):g===s.MODALS.UPLOAD_IMAGE_MODAL_EDIT||g===s.MODALS.UPLOAD_BACKGROUND_MODAL_EDIT?(yt.isLocked?(Re(!0),De(s.FEATURE_UPSELL_SLIDE.image_editor)):a(Ie),p(s.openSecondModal(s.MODALS.IMAGE_EDITOR_MODAL))):P("")},[g,p,He.isLocked,Qe.isLocked,qe.isLocked,yt.isLocked,E]);const Ne=(0,e.useCallback)(({url:a=L||"",meta:d=Kt})=>{b(a),I({url:a,meta:d}),setTimeout(()=>{ie(),ge(),te({keywords:"",color:"",orientation:""}),se({keywords:""}),Z([]),v([]),P(""),We(""),ft(!1),Q(""),S(""),K(me)},200),p(s.closeModal$1()),p(s.closeSecondModal())},[L,ie,p,I,ge]),bt=(0,e.useCallback)((a,d)=>(D("auto"),k(!1),Ne({url:a,meta:Wt}),A.success({id:"IMAGE_UPLOAD_SUCCESS",data:d,title:f("The image was successfully uploaded.")}),a),[f,Ne,A]);(0,e.useEffect)(()=>{const a=c?"":_,d=a||T,y=we.canonicalImageUrlKey(d);if(!d||!y){B(""),Le.current&&pe.abandonKey(Le.current),Le.current="",ie(),ge();return}const N=Le.current;N&&N!==y&&(pe.abandonKey(N),ie(),ge()),Le.current=y;const X=new AbortController,de=a?800:0,ve=++ye.current,dn=setTimeout(async()=>{try{const Ee=async()=>{const fe=await pe.resolve(y,X.signal,Ae);if(ve!==ye.current)return;const{width:Ce,height:fn}=await he.getImageDimensionsFromBlob(fe);ve===ye.current&&(q({width:Ce,height:fn,size:(fe.size/1024).toFixed(2),format:je(fe.type)}),ie(),Me(fe))};if(u)await Ee();else{const fe=await he.resolveDataProviderPreview(r,y);if(fe?.previewUrl&&ve===ye.current){Ve(fe.previewUrl),ge();try{const{data:Ce}=await w(y);if(ve!==ye.current)return;Ce?q({width:Ce?.width,height:Ce?.height,size:Ce?.fileSize!=null?(Ce.fileSize/1024).toFixed(2):"",format:je(Ce?.format)}):await Ee()}catch{await Ee()}}else await Ee()}if(ve!==ye.current)return;B("success"),b(d),ee(572),setTimeout(()=>{let fe=0;G.current&&(fe=G.current.offsetHeight+62),D(fe)},0)}catch(Ee){if(Ee?.name==="AbortError"||X.signal.aborted||ve!==ye.current)return;ie(),ge(),B("error")}},de);return()=>{clearTimeout(dn),X.abort()}},[_,T,c,u,ie,Ae,w,pe,ge,r,Me]),(0,e.useEffect)(()=>{if(!L||_||T||!g)return;const a=we.canonicalImageUrlKey(L),d=new AbortController;let y=!1;const N=async()=>{const X=await pe.resolve(a,d.signal,Ae);if(y)return;const{width:de,height:ve}=await he.getImageDimensionsFromBlob(X);y||(ie(),Me(X),q({width:de,height:ve,size:(X.size/1024).toFixed(2),format:je(X.type)}))};return(async()=>{try{if(!u){const X=await he.resolveDataProviderPreview(r,a);if(X?.previewUrl&&!y){Ve(X.previewUrl),ge();try{const{data:de}=await w(a);if(y)return;de?q({width:de?.width,height:de?.height,size:de?.fileSize!=null?(de.fileSize/1024).toFixed(2):"",format:je(de?.format)}):await N();return}catch{await N()}}}await N()}catch{y||ie()}})(),()=>{y=!0,d.abort()}},[u,g,ie,L,Ae,w,pe,r,_,T,Me]);const ln=()=>{p(s.closeModal$1()),setTimeout(()=>{ie(),ge(),b(""),S(""),Z([]),Z([]),te({keywords:"",color:"",orientation:""}),se({keywords:""}),D("auto"),!dt&&We(""),ee(572),K(me)},200)},cn=a=>{a===$t?x.success({mask:{closable:!0},centered:!0,title:f("Coming soon"),content:f("The feature is under development."),okText:f("Ok. I'll be waiting"),onOk:()=>{}}):a===Ie&&L===""?x.warning({mask:{closable:!0},centered:!0,title:f(""),content:f("To preview and edit the uploaded image"),okText:f("Upload Image"),onOk:()=>{K(me)}}):(setTimeout(()=>{let d=0,y=0;a===me&&H.current?(U.keywords===""&&n.current?.focus({cursor:"start"}),d=300,y=572):a===Ie&&G.current?(d=G.current.offsetHeight+62,y=572):a===ze&&ne.current?(U.keywords===""&&O.current?.focus({cursor:"start"}),d=130,y=572,R.length>0&&(y=1060,d="84vh")):a===$e&&M.current?(U.keywords===""&&C.current?.focus({cursor:"start"}),d=130,y=572,ue.length>0&&(y=1060,d="84vh")):a===Ke&&J.current&&(mt===""&&ut.length===0?(F.current?.focus({cursor:"start"}),d=130):d=J.current.offsetHeight+82,y=572),D(d),ee(y)},0),K(a))};(0,e.useEffect)(()=>{U.keywords===""&&(n?.current?.focus({cursor:"start"}),Z([]),setTimeout(()=>{D("auto"),ee(572)},0))},[U,Z,D,ee]);const Je=a=>{const d=a.type==="image/jpeg"||a.type==="image/png"||a.type==="image/jpg"||a.type==="image/webp"||a.type==="image/gif"||a.type==="image/svg+xml";return d||A.error({id:"IMAGE_UPLOAD_WRONG_FORMAT",data:a,title:"Upload",description:"You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"}),d},wt=(0,e.useRef)(null),xe=async({file:a})=>{try{Y(!0);const d=a===wt.current?await s.prepareImageForEditorResult(a,i,void 0,{compressBySize:l!==void 0}):await s.prepareImageForEditorUpload(a,i),y=await sn(d);if(y.url)return bt(y.url,d),y.url;if(!s.shouldFallbackToBuiltInUpload(y,{isStandalone:u,targetIsOurBackend:!!o})){Oe(d,s.toUploadImageError(y));return}const N=await s.uploadFileViaDataProvider(d,r);if(N?.url)return bt(N.url,d),N.url;Oe(d,null);return}catch(d){Oe(a,d);return}finally{Y(!1)}},It=(0,e.useRef)(xe);It.current=xe;const un=(0,e.useCallback)(a=>(wt.current=a,It.current({file:a})),[]);let Pe=[{label:f("Upload"),key:me,children:(0,t.jsxs)("div",{ref:H,style:{paddingBottom:24},children:[i.imageCenterLocalUploadEnabled!==!1&&(0,t.jsxs)(Vt,{showUploadList:!1,name:"Image",beforeUpload:Je,customRequest:xe,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:f("Click to select, paste from the clipboard, or drag and drop")}),(0,t.jsx)("p",{className:"ant-upload-hint",children:f("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:W,children:(0,t.jsx)(m.ui_kit$Input,{ref:n,allowClear:!0,size:"large",placeholder:f("Paste image URL here"),value:_,onChange:nn,onPressEnter:an,spellCheck:"false"})})})]})}];return i.imageCenterStockEnabled&&!Qe.isLocked&&Pe.push({label:f("Stock"),key:ze,children:(0,t.jsx)("div",{ref:ne,style:{paddingBottom:24},children:(0,t.jsx)(Gt,{currentReq:U,setCurrentReq:te,imageStockList:R,setImageStockList:Z,setModalWidth:ee,setModalHeight:D,setStockLink:Q,setCurrentImageLink:b,inputRef:O,customRequest:Ze})})}),i.imageCenterGifEnabled&&!qe.isLocked&&Pe.push({label:f("GIF"),key:$e,children:(0,t.jsx)("div",{ref:M,style:{paddingBottom:24},children:(0,t.jsx)(zt,{currentReqGif:j,setCurrentReqGif:se,imageGifList:ue,setImageGifList:v,setModalWidth:ee,setModalHeight:D,setStockLink:Q,setCurrentImageLink:b,inputRef:C,customRequest:Ze})})}),i.elementAIimageEnabled&&!He.isLocked&&Pe.push({label:f("AI"),key:Ke,children:(0,t.jsx)("div",{ref:J,style:{paddingBottom:24},children:(0,t.jsx)(Ft,{setModalHeight:D,customRequest:xe,aiImageRequest:mt,setAiImageRequest:We,imageAiList:ut,setImageAiList:Yt,isLoadingAi:dt,setIsLoadingAi:ft,aiTabRef:J,inputAiRef:F,isImageUploaded:re,setIsImageUploaded:k})})}),i.imageCenterEditorEnabled&&Pe.push({label:"",key:Ie,children:(0,t.jsx)("div",{ref:G,children:(0,t.jsx)(Rt,{currentImageLink:L,newLink:_,previewDisplayUrl:tn,resolvedPreviewObjectUrl:Jt,resolvedPreviewBlob:en,resolveImageBlob:rn,imageSize:V,onSave:un,uploadImageResultIsLoading:ce||!1})})}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.ui_kit$Modal,{width:le,className:"image-center",title:f("Image Center"),style:{minHeight:390},open:!!z,onOk:Ne,onCancel:ln,footer:$===Ie?(0,t.jsx)(t.Fragment,{}):null,children:(0,t.jsx)(m.ui_kit$Spin,{spinning:ce,children:(0,t.jsx)(m.ui_kit$Tabs,{activeKey:$,onChange:cn,items:Pe,className:"modal-tabs",style:{height:ae,minHeight:130}})})}),(0,t.jsx)(s.PlanUpgradePrompt,{open:Zt,onCancel:()=>Re(!1),initialSlide:Xt})]})};ct.propTypes={dataProvider:_t.default.object},kt.default=ct});
@@ -0,0 +1 @@
1
+ __useblocks__.define("static/core/347b0a0b.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/a42ab03f.js","react","react/jsx-runtime","__delivery__/libs"],function(C,ve,Me){const F=C("./2ff39ddf.js"),he=C("./cf7d1dd7.js"),e=C("./a42ab03f.js");let o=C("react");o=F.__toESM(o);let A=C("react/jsx-runtime"),P=C("__delivery__/libs");var d=F.__toESM(e.require_prop_types()),Q=t=>t?.message??t?.data?.message??"The block was not saved.",X=({block:t=null,isEditableRights:z,rightCol:D,autoSaveBlockResult:Ee,disabled:ke,ownsDocument:O=!1})=>{const{__:m}=e.useI18n(),{blockId:J}=e.useRouteParams(),j=e.useEditorProjectId();let Be=e.useSelector(e.selectIsCodeMode$1),Se=e.useSelector(e.selectIsCodeMode$1);e.useDispatch();const l=e.useNotification(),B=e.useContentReader(),{document:K}=e.useDocumentSessionContext(),W=e.useStore(),Z=e.useSendPostMessage(),[ee,te]=(0,o.useState)(!1),[Te,ye]=(0,o.useState)(null),[Ie,_]=(0,o.useState)(!1),[M,Ce]=(0,o.useState)(0),[G,Oe]=(0,o.useState)(0),S=M!==G,T=(0,o.useCallback)(()=>Ce(s=>s+1),[]),Re=e.usePushToDataLayer(),se=e.useEventEmitter(he.events.ON_BLOCK_SAVEBUTTON_CLICK_ID),w=e.useAppConfig().saveHotkeyEnabled!==!1,x=e.useContainer(),H=(0,o.useRef)([]),V=(0,o.useRef)(!0);(0,o.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&ye(!0)},[]);const{data:N,refetch:oe}=e.useGetProjectQuery(+j,{skip:!+j}),[ae]=e.useAddTermMutation(),[q,$]=e.useEditBlockMutation(),[ie,U]=e.useAddBlockMutation(),[ne]=e.useEditProjectMutation(),{data:re}=e.useGetTermsQuery({project:N,kind:e.BLOCK_TAGS},{skip:!N?.id}),b=(0,o.useCallback)((s,r)=>{_(!0);let R=!1;const n=y=>{R||(R=!0,r?.(y))};if(!z&&t.lock&&S){n({ok:!1,reason:"locked",message:"No access to edit the block.",notified:!0}),l.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",title:m("No access to edit the block."),data:e.getBlockDesc(t)}),_(!1);return}if((t.tags?.length||t.blocktags?.length)>10&&S){n({ok:!1,reason:"failed",message:"Maximum 10 tags available.",notified:!0,refusal:"The block has more tags than allowed (10 at most), so nothing was saved."}),l.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",title:m("Maximum 10 tags available."),data:e.getBlockDesc(t)}),_(!1);return}if(t.type===""){n({ok:!1,reason:"failed",message:"The block type is not set.",notified:!0,refusal:"The block type is not set, so nothing was saved; ask the user to set it in the block settings."}),l.error({title:m("Set the type"),description:m("Please set the 'Type' field in the Settings section.")}),_(!1);return}const u=y=>{const ce=t.tags?.map(i=>{const g=re?.find(p=>p.name===i);return g?g.id:ae({project:N,kind:e.BLOCK_TAGS,name:i,parent:y}).then(({error:p,data:L})=>{if(p?.status===400)return e.existingTermIdFromError(p);if(L)return L.id;p&&(l.fromError("TAG_CREATING_ERROR",i,p),_(!1))})}),f=O&&K?K:void 0,de=(i=null)=>{let g=null;const p=f?.get().version,L=f?f.get().serverId==null:!!t?.isNew,me=f?.get().serverId??t?.id,_e=a=>{const v=a?.id;if(f&&p!==void 0){f.markSaved(p,L&&v!=null?String(v):void 0);const k=a;e.writeSourceReport(f,e.fromServerFacts(k&&{wpId:k.wpId,secretHash:k.secretHash}))}n({ok:!0}),W.dispatch(e.taxonomiesApi.endpoints.getTerms.initiate({project:N,kind:e.BLOCK_TAGS})),oe();const c=a,E=c.global_block?e.globalBlockMark(c):void 0;E&&Z({operation:e.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:E,...g?{emBlockVersion:g}:{}}}),S&&(l.success({id:"BLOCK_EDITING_SUCCESS",title:m("The block was successfully saved."),data:e.getBlockDesc(t)}),_(!1));const I=e.wpEmailTarget(c,j),h=I?.emailId??(e.isBlocksV2Enabled()?void 0:c.id);h!=null&&fetch(e.blockPreviewHref(e.BLOCK,I?.projectId??j,h,c.modified),{mode:"no-cors"}).then(()=>{})},ge=a=>n({ok:!1,reason:"failed",message:Q(a),notified:!0}),pe=e.getTaxonomy(t,e.EMAIL_TAGS).filter(a=>(i||t.blocktags).includes(a.id)).map(a=>a.name);if(L){if(f||U.status!=="pending")return ie({source:s,title:t.title===null?m("New block title"):t.title,project:t.project,type:t.type?t.type:"Other",description:t.description,html:B(),blocktags:i?i.join(","):t.blocktags,tags:pe,...t.is_template!==void 0?{is_template:t.is_template}:{},...e.hasOwnMeta(t)?{meta:t.meta}:{}}).then(async({data:a,error:v})=>{if(v)l.fromError("BLOCK_CREATING_ERROR",{title:t.title,html:B()},v),_(!1),ge(v);else{let c=a;const E=B();if(a?.global_block&&a?.id&&e.globalBlockMark(a)&&E){const I=new Date,h=e.injectEmBlockIdIntoBlockHtml(E,e.globalBlockMark(a),I);if(g=e.formatEmBlockVersion(I),h!==E){const k=await q({blockId:a.id,html:h});k.error?l.fromError("BLOCK_EDITING_ERROR",e.getBlockDesc(t),k.error):k.data&&(c=k.data)}}_e(c)}})}else if(f||$.status!=="pending"){const a=B(),v=new Date,c=t.global_block?e.globalBlockMark({...t,id:me}):void 0,E=c?e.injectEmBlockIdIntoBlockHtml(a,c,v):a;return c&&(g=e.formatEmBlockVersion(v)),q({blockId:me,source:s,title:t.title,project:t.project,type:t.type?t.type:"Other",description:t.description,html:E,...i||Array.isArray(t.tags)?{blocktags:i||t.blocktags,tags:pe}:{},...t.is_template!==void 0?{is_template:t.is_template}:{},...e.hasOwnMeta(t)?{meta:t.meta}:{}}).then(({data:I,error:h})=>{h&&S?(l.fromError("BLOCK_EDITING_ERROR",e.getBlockDesc(t),h),_(!1),ge(h)):_e(I)})}return n({ok:!1,reason:"failed",message:"Another block save is in progress."}),Promise.resolve()},ue=i=>{try{return f?e.runBlockSave(f,()=>de(i)):de(i)}catch(g){return Promise.reject(g)}},fe=i=>{l.fromError("BLOCK_EDITING_ERROR",e.getBlockDesc(t),i),_(!1),n({ok:!1,reason:"failed",message:Q(i),notified:!0})};ce?Promise.all(ce).then(i=>ue(i)).catch(fe):ue(null).catch(fe)};_(!0),u(void 0)},[U.status,ie,$.status,q,t,z,ae,ne,j,m,S,B,l,re,oe,W,Z,O,K]);(0,o.useEffect)(()=>{if(S){const s=b,r=H.current.splice(0),R=M-G>r.filter(({settle:n})=>n).length;se.fire({...t,html:B()}).then(n=>{n.some(u=>u===!1)?r.forEach(({settle:u})=>u?.({ok:!1,reason:"aborted",message:"The save was cancelled by the host."})):V.current?r.length?s(void 0,u=>r.forEach(({settle:y})=>y?.(u))):s():(r.forEach(({settle:u})=>u?.({ok:!1,reason:"failed",message:"The save button was removed."})),R&&s())}).catch(n=>{l.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",e.getBlockDesc(t),n,!0);const u=n instanceof Error?n.message:"The save button handler failed.";r.forEach(({settle:y})=>y?.({ok:!1,reason:"failed",message:u,notified:!0}))}),Oe(M)}},[S,M,G,b,se,t,B,l]),(0,o.useEffect)(()=>{V.current=!0;const s=H.current;return()=>{V.current=!1,s.splice(0).forEach(({settle:r})=>r?.({ok:!1,reason:"failed",message:"The save button was removed."}))}},[]),e.useCommand(e.SAVE_BLOCK_COMMAND_ID,(0,o.useCallback)(s=>{O&&(H.current.push(e.isSaveRequest(s)?s:{}),T())},[O,T])),(0,o.useEffect)(()=>O&&x?e.registerSaveListener(x,"block"):void 0,[O,x]);const Y=(0,o.useCallback)(s=>{(s.ctrlKey||s.metaKey)&&s.keyCode===83&&(s.preventDefault(),w&&T())},[w,T]);(0,o.useEffect)(()=>(document.addEventListener("keydown",Y),()=>{document.removeEventListener("keydown",Y)}),[Y]);const je=(0,o.useCallback)(s=>{const r=s.data.operation,R=s.data.action;r===e.EVENT_TYPES.APPLICATION_ACTION&&R==="save_email"&&w&&T()},[w,T]);e.useListenPostMessage(je),(0,o.useEffect)(()=>{const s=setTimeout(()=>{te(!0)},1e4);return()=>{clearTimeout(s)}},[]),(0,o.useEffect)(()=>{t.isNew&&!J&&ee&&(b(),te(!1))},[ee,t,b,J]);const Le=$.isLoading||ne.isLoading||U.isLoading||Ie,le=!!Ee?.isLoading,Ae=Le||le;return(0,A.jsx)(P.ui_kit$Tooltip,{title:m(Te?"Save by ⌘S":"Save by Ctrl+S"),placement:D?"right":"bottomRight",children:(0,A.jsx)("span",{className:"em-analytics__block-save-tooltip-target",children:(0,A.jsx)(P.ui_kit$Button,{type:"primary",block:D,disabled:ke||le,className:"em-analytics__block-save",icon:(0,A.jsx)(e.EmIcons,{icon:"SaveOutlined",component:P.icons$SaveOutlined}),onClick:s=>{const r=s.currentTarget;Re({event:"click",action:"save_block"}),T();try{r?.blur?.()}catch{}},loading:Ae,children:D||Be||Se?"":m("Save")})})})};X.propTypes={block:d.default.shape({id:d.default.string,isNew:d.default.bool,lock:d.default.bool,type:d.default.string,html:d.default.string,description:d.default.string,project:d.default.number,title:d.default.string}),isEditableRights:d.default.bool.isRequired,ownsDocument:d.default.bool},Object.defineProperty(ve,"SaveBlockBtn",{enumerable:!0,get:function(){return X}})});
@@ -1 +1 @@
1
- __useblocks__.define("static/core/2865f716.js",["require","exports","module","static/core/2ff39ddf.js","static/core/83a2a45e.js","static/core/f174fb08.js","static/core/17c8ebc4.js","static/core/6ec347ff.js","static/core/2d58a94b.js"],function(r,i,x){const b=r("./2ff39ddf.js"),s=r("./83a2a45e.js"),n=r("./f174fb08.js"),_=r("./17c8ebc4.js"),j=r("./6ec347ff.js"),d=r("./2d58a94b.js");function p(t){return t?.tagName===s.SCRIPT_STAND_IN.toUpperCase()}function a(t){return p(t)&&t.src?.startsWith("https://cdn.ampproject.org/v0")}var u=t=>a(t)||_.isAmpElement(t)||s.isForm(t),h=t=>{if(u(t))return!0;if(s.isElement(t)||s.isDocument(t)){for(const c of t.querySelectorAll("*"))if(u(c))return!0}return!1};async function y(t,c={amp:!0,text:!1},l){const A=c===!0||typeof c=="object"&&c.amp,E=c===!0||typeof c=="object"&&c.text;typeof t=="string"&&(t={code:t});let m;const o={html:"",ampHtml:"",text:""};try{o.html=t.code?await n.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{m=h(e.document),m&&await s.processAmp(e,"html")},l):""}catch(e){throw new Error("[useblocks] compileEmail: не удалось собрать html письма",{cause:e})}try{o.ampHtml=A&&t.code&&m?await n.prepareHTML(t.code||"",[800],t.utm_parameters,e=>{s.processAmp(e,"amp")},l):""}catch{}try{o.text=E&&t.code?await n.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{e.handleReadHtml(f=>{f.html=j.convert(f.contentDocument,d.EmailTextPlainConvertOptions)})}):""}catch{}return{...t,compiled:o}}i.compileEmail=y,i.isAmpScript=a,i.isScriptElement=p});
1
+ __useblocks__.define("static/core/3b65bc50.js",["require","exports","module","static/core/2ff39ddf.js","static/core/a42ab03f.js","static/core/b503e1b2.js","static/core/467344d4.js","static/core/11009bdf.js","static/core/d2cf6b4b.js"],function(r,i,x){const b=r("./2ff39ddf.js"),s=r("./a42ab03f.js"),n=r("./b503e1b2.js"),_=r("./467344d4.js"),j=r("./11009bdf.js"),d=r("./d2cf6b4b.js");function p(t){return t?.tagName===s.SCRIPT_STAND_IN.toUpperCase()}function a(t){return p(t)&&t.src?.startsWith("https://cdn.ampproject.org/v0")}var u=t=>a(t)||_.isAmpElement(t)||s.isForm(t),h=t=>{if(u(t))return!0;if(s.isElement(t)||s.isDocument(t)){for(const c of t.querySelectorAll("*"))if(u(c))return!0}return!1};async function y(t,c={amp:!0,text:!1},l){const A=c===!0||typeof c=="object"&&c.amp,E=c===!0||typeof c=="object"&&c.text;typeof t=="string"&&(t={code:t});let m;const o={html:"",ampHtml:"",text:""};try{o.html=t.code?await n.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{m=h(e.document),m&&await s.processAmp(e,"html")},l):""}catch(e){throw new Error("[useblocks] compileEmail: не удалось собрать html письма",{cause:e})}try{o.ampHtml=A&&t.code&&m?await n.prepareHTML(t.code||"",[800],t.utm_parameters,e=>{s.processAmp(e,"amp")},l):""}catch{}try{o.text=E&&t.code?await n.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{e.handleReadHtml(f=>{f.html=j.convert(f.contentDocument,d.EmailTextPlainConvertOptions)})}):""}catch{}return{...t,compiled:o}}i.compileEmail=y,i.isAmpScript=a,i.isScriptElement=p});
@@ -1,4 +1,4 @@
1
- __useblocks__.define("static/core/bbf48eb9.js",["require","exports","module","static/core/2ff39ddf.js","static/core/83a2a45e.js"],function(g,$,L){const T=g("./2ff39ddf.js"),u=g("./83a2a45e.js");function w(t,e){const d={bytes:0,hidden:0,byKind:{}};for(const n of e)if(!(n.finishedAt>t.end||n.finishedAt<t.start)){if(n.transferred===null){d.hidden+=1;continue}d.bytes+=n.transferred,d.byKind[n.kind]=(d.byKind[n.kind]??0)+n.transferred}return d}var y="core:module:";function v(t){const e=[...t].sort((n,r)=>n.start-r.start),d=[];return e.forEach(n=>{const r=d[d.length-1];if(r&&n.start<=r.end){r.end=Math.max(r.end,n.end);return}d.push({start:n.start,end:n.end})}),d}function A(t,e){const d=Math.max(0,t.end-t.start),n=v(e.map(r=>({start:Math.max(t.start,r.startedAt),end:Math.min(t.end,r.finishedAt)})).filter(r=>r.end>r.start)).reduce((r,o)=>r+(o.end-o.start),0);return{networkMs:n,quietMs:d-n}}function P(t){const e=new Map;t.forEach(n=>{if(!n.phase.startsWith(y))return;const r=n.phase.slice(12),o=r.lastIndexOf(":");if(o<=0)return;const s=r.slice(0,o),a=r.slice(o+1),i=e.get(s)??{};a==="ask"?(i.ask=n.at,n.parent&&(i.parent=n.parent)):a==="loaded"?i.loaded=n.at:a==="deps"?i.deps=n.at:a==="ready"&&(i.ready=n.at),e.set(s,i)});const d=[];return e.forEach((n,r)=>{if(n.ask===void 0||n.ready===void 0)return;const o=n.ask,s=n.ready,a=n.deps,i=n.loaded;d.push({id:r,parent:n.parent,askedAt:o,loadedAt:i,depsAt:a,readyAt:s,networkMs:i===void 0?0:i-o,waitingMs:a===void 0?0:a-(i??o),executionMs:a===void 0?0:s-a})}),d}function S(t){const e=new Map;t.forEach(o=>{if(o.parent===void 0)return;const s=e.get(o.parent)??[];s.push(o),e.set(o.parent,s)});let d=t.filter(o=>o.parent===void 0).reduce((o,s)=>o===void 0||s.readyAt>o.readyAt?s:o,void 0);const n=[],r=new Set;for(;d&&!r.has(d.id);)r.add(d.id),n.push(d),d=(e.get(d.id)??[]).reduce((o,s)=>o===void 0||s.readyAt>o.readyAt?s:o,void 0);return n}function E(t,e){const d=u.detectMount(t),n=u.requiredPhases(d),r=new Map;t.forEach(l=>{n.includes(l.phase)&&!r.has(l.phase)&&r.set(l.phase,l.at)});const o=[...r.entries()].sort((l,h)=>l[1]-h[1]),s=q(d),a=o.findIndex(([l])=>l===s),i=a===-1?o:o.slice(0,a+1);return i.slice(1).map(([l,h],m)=>{const[x,p]=i[m],f=A({start:p,end:h},e);return{from:x,to:l,startedAt:p,endedAt:h,durationMs:h-p,networkMs:f.networkMs,quietMs:f.quietMs}})}function q(t){return t==="headless"?u.PHASES.showEnd:u.PHASES.canvasSettled}function M(t,e){const d=t.find(n=>n.phase===e);return d?d.at:null}function j(t,e){return t===null?e:e===null?t:Math.max(t,e)}function z(t,e){const d=u.missingRequiredPhases(t),n=d.length===0,r=t.reduce((p,f)=>p===null||f.at<p?f.at:p,null),o=u.detectMount(t),s=M(t,u.PHASES.canvasPainted),a=o==="headless"?M(t,u.PHASES.showEnd):j(M(t,u.PHASES.canvasSettled),M(t,u.PHASES.editorVisible)),i=P(t),l=i.reduce((p,f)=>p+f.executionMs,0),h=r!==null&&n&&(o==="headless"||s!==null),m=o==="headless"?a:s,x=h&&m!==null?A({start:r,end:m},e):{networkMs:0,quietMs:0};return{startedAt:r,paintedAt:s,settledAt:a,totalMs:h&&s!==null?s-r:null,settledMs:h&&a!==null?a-r:null,settleGapMs:h&&a!==null&&s!==null?a-s:null,segments:h?E(t,e):[],complete:n,missingPhases:d,networkMs:x.networkMs,quietMs:x.quietMs,moduleExecutionMs:l,criticalPath:S(i),transferBeforeFrame:h&&r!==null&&m!==null?w({start:r,end:m},e):{bytes:0,hidden:0,byKind:{}}}}function c(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function H(){return"dev"}function k(t,e){return{mode:H(),summary:z(t,e),marks:[...t],resources:[...e]}}function b(t){return t===null?"—":`${Math.round(t)} мс`}function _(t){return t==="dev"?"dev-сервер — AMD-ядро не работает, слой модулей пуст":t==="build"?"собранная версия":"режим неизвестен"}function R(t){const{summary:e}=t,d=e.complete?'<span class="ok">прогон полный</span>':'<span class="bad">прогон неполный — в сравнение не идёт</span>',n=e.missingPhases.length===0?"":`<p class="bad">Не хватает фаз: ${e.missingPhases.map(c).join(", ")}</p>`;return`
1
+ __useblocks__.define("static/core/3d8e2478.js",["require","exports","module","static/core/2ff39ddf.js","static/core/a42ab03f.js"],function(g,$,L){const T=g("./2ff39ddf.js"),u=g("./a42ab03f.js");function w(t,e){const d={bytes:0,hidden:0,byKind:{}};for(const n of e)if(!(n.finishedAt>t.end||n.finishedAt<t.start)){if(n.transferred===null){d.hidden+=1;continue}d.bytes+=n.transferred,d.byKind[n.kind]=(d.byKind[n.kind]??0)+n.transferred}return d}var y="core:module:";function v(t){const e=[...t].sort((n,r)=>n.start-r.start),d=[];return e.forEach(n=>{const r=d[d.length-1];if(r&&n.start<=r.end){r.end=Math.max(r.end,n.end);return}d.push({start:n.start,end:n.end})}),d}function A(t,e){const d=Math.max(0,t.end-t.start),n=v(e.map(r=>({start:Math.max(t.start,r.startedAt),end:Math.min(t.end,r.finishedAt)})).filter(r=>r.end>r.start)).reduce((r,o)=>r+(o.end-o.start),0);return{networkMs:n,quietMs:d-n}}function P(t){const e=new Map;t.forEach(n=>{if(!n.phase.startsWith(y))return;const r=n.phase.slice(12),o=r.lastIndexOf(":");if(o<=0)return;const s=r.slice(0,o),a=r.slice(o+1),i=e.get(s)??{};a==="ask"?(i.ask=n.at,n.parent&&(i.parent=n.parent)):a==="loaded"?i.loaded=n.at:a==="deps"?i.deps=n.at:a==="ready"&&(i.ready=n.at),e.set(s,i)});const d=[];return e.forEach((n,r)=>{if(n.ask===void 0||n.ready===void 0)return;const o=n.ask,s=n.ready,a=n.deps,i=n.loaded;d.push({id:r,parent:n.parent,askedAt:o,loadedAt:i,depsAt:a,readyAt:s,networkMs:i===void 0?0:i-o,waitingMs:a===void 0?0:a-(i??o),executionMs:a===void 0?0:s-a})}),d}function S(t){const e=new Map;t.forEach(o=>{if(o.parent===void 0)return;const s=e.get(o.parent)??[];s.push(o),e.set(o.parent,s)});let d=t.filter(o=>o.parent===void 0).reduce((o,s)=>o===void 0||s.readyAt>o.readyAt?s:o,void 0);const n=[],r=new Set;for(;d&&!r.has(d.id);)r.add(d.id),n.push(d),d=(e.get(d.id)??[]).reduce((o,s)=>o===void 0||s.readyAt>o.readyAt?s:o,void 0);return n}function E(t,e){const d=u.detectMount(t),n=u.requiredPhases(d),r=new Map;t.forEach(l=>{n.includes(l.phase)&&!r.has(l.phase)&&r.set(l.phase,l.at)});const o=[...r.entries()].sort((l,h)=>l[1]-h[1]),s=q(d),a=o.findIndex(([l])=>l===s),i=a===-1?o:o.slice(0,a+1);return i.slice(1).map(([l,h],m)=>{const[x,p]=i[m],f=A({start:p,end:h},e);return{from:x,to:l,startedAt:p,endedAt:h,durationMs:h-p,networkMs:f.networkMs,quietMs:f.quietMs}})}function q(t){return t==="headless"?u.PHASES.showEnd:u.PHASES.canvasSettled}function M(t,e){const d=t.find(n=>n.phase===e);return d?d.at:null}function j(t,e){return t===null?e:e===null?t:Math.max(t,e)}function z(t,e){const d=u.missingRequiredPhases(t),n=d.length===0,r=t.reduce((p,f)=>p===null||f.at<p?f.at:p,null),o=u.detectMount(t),s=M(t,u.PHASES.canvasPainted),a=o==="headless"?M(t,u.PHASES.showEnd):j(M(t,u.PHASES.canvasSettled),M(t,u.PHASES.editorVisible)),i=P(t),l=i.reduce((p,f)=>p+f.executionMs,0),h=r!==null&&n&&(o==="headless"||s!==null),m=o==="headless"?a:s,x=h&&m!==null?A({start:r,end:m},e):{networkMs:0,quietMs:0};return{startedAt:r,paintedAt:s,settledAt:a,totalMs:h&&s!==null?s-r:null,settledMs:h&&a!==null?a-r:null,settleGapMs:h&&a!==null&&s!==null?a-s:null,segments:h?E(t,e):[],complete:n,missingPhases:d,networkMs:x.networkMs,quietMs:x.quietMs,moduleExecutionMs:l,criticalPath:S(i),transferBeforeFrame:h&&r!==null&&m!==null?w({start:r,end:m},e):{bytes:0,hidden:0,byKind:{}}}}function c(t){return t.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;")}function H(){return"dev"}function k(t,e){return{mode:H(),summary:z(t,e),marks:[...t],resources:[...e]}}function b(t){return t===null?"—":`${Math.round(t)} мс`}function _(t){return t==="dev"?"dev-сервер — AMD-ядро не работает, слой модулей пуст":t==="build"?"собранная версия":"режим неизвестен"}function R(t){const{summary:e}=t,d=e.complete?'<span class="ok">прогон полный</span>':'<span class="bad">прогон неполный — в сравнение не идёт</span>',n=e.missingPhases.length===0?"":`<p class="bad">Не хватает фаз: ${e.missingPhases.map(c).join(", ")}</p>`;return`
2
2
  <header>
3
3
  <h1>Куда ушло время до показа письма</h1>
4
4
  <p class="mode">${c(_(t.mode))}</p>
@@ -1 +1 @@
1
- __useblocks__.define("static/core/5fd45688.js",["require","exports","module","static/core/2ff39ddf.js","static/core/83a2a45e.js"],function(i,p,$){const P=i("./2ff39ddf.js"),d=i("./83a2a45e.js");var u={items_per_page:"/ página",jump_to:"Vá até",jump_to_confirm:"confirme",page:"Página",prev_page:"Página anterior",next_page:"Próxima página",prev_5:"5 páginas anteriores",next_5:"5 próximas páginas",prev_3:"3 páginas anteriores",next_3:"3 próximas páginas",page_size:"tamanho da página"};function n(r){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(r)}function l(r,e){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(h){return Object.getOwnPropertyDescriptor(r,h).enumerable})),a.push.apply(a,t)}return a}function c(r){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?l(Object(a),!0).forEach(function(t){v(r,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(a,t))})}return r}function v(r,e,a){return e=b(e),e in r?Object.defineProperty(r,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[e]=a,r}function b(r){var e=f(r,"string");return n(e)=="symbol"?e:String(e)}function f(r,e){if(n(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var t=a.call(r,e||"default");if(n(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var g=c(c({},d.commonLocale),{},{locale:"pt_BR",today:"Hoje",now:"Agora",backToToday:"Voltar para hoje",ok:"OK",clear:"Limpar",week:"Semana",month:"Mês",year:"Ano",timeSelect:"Selecionar hora",dateSelect:"Selecionar data",monthSelect:"Escolher mês",yearSelect:"Escolher ano",decadeSelect:"Escolher década",monthBeforeYear:!1,previousMonth:"Mês anterior (PageUp)",nextMonth:"Próximo mês (PageDown)",previousYear:"Ano anterior (Control + esquerda)",nextYear:"Próximo ano (Control + direita)",previousDecade:"Década anterior",nextDecade:"Próxima década",previousCentury:"Século anterior",nextCentury:"Próximo século",shortWeekDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}),s={placeholder:"Hora",rangePlaceholder:["Hora de início","Hora de término"]},m={lang:{placeholder:"Selecionar data",rangePlaceholder:["Data inicial","Data final"],...g},timePickerLocale:{...s}},x=m,o="${label} não é um ${type} válido",y={locale:"pt-br",Pagination:u,DatePicker:m,TimePicker:s,Calendar:x,global:{placeholder:"Por favor escolha",close:"Fechar",show:"Mostrar",hide:"Ocultar"},Table:{filterTitle:"Menu de Filtro",filterConfirm:"OK",filterReset:"Resetar",filterEmptyText:"Sem filtros",filterCheckAll:"Selecionar todos os itens",filterSearchPlaceholder:"Pesquisar nos filtros",emptyText:"Sem conteúdo",selectAll:"Selecionar página atual",selectInvert:"Inverter seleção",selectNone:"Apagar todo o conteúdo",selectionAll:"Selecionar todo o conteúdo",sortTitle:"Ordenar título",expand:"Expandir linha",collapse:"Colapsar linha",triggerDesc:"Clique organiza por descendente",triggerAsc:"Clique organiza por ascendente",cancelSort:"Clique para cancelar organização"},Tour:{Next:"Próximo",Previous:"Anterior",Finish:"Finalizar"},Modal:{okText:"OK",cancelText:"Cancelar",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancelar"},Transfer:{titles:["",""],searchPlaceholder:"Procurar",itemUnit:"item",itemsUnit:"items",remove:"Remover",selectCurrent:"Selecionar página atual",removeCurrent:"Remover página atual",selectAll:"Selecionar todos",removeAll:"Remover todos",selectInvert:"Inverter seleção atual"},Upload:{uploading:"Enviando...",removeFile:"Remover arquivo",uploadError:"Erro no envio",previewFile:"Visualizar arquivo",downloadFile:"Baixar arquivo"},Empty:{description:"Não há dados"},Icon:{icon:"ícone"},Text:{edit:"editar",copy:"copiar",copied:"copiado",expand:"expandir"},Form:{optional:"(opcional)",defaultValidateMessages:{default:"Erro ${label} na validação de campo",required:"Por favor, insira ${label}",enum:"${label} deve ser um dos seguinte: [${enum}]",whitespace:"${label} não pode ser um carácter vazio",date:{format:" O formato de data ${label} é inválido",parse:"${label} não pode ser convertido para uma data",invalid:"${label} é uma data inválida"},types:{string:o,method:o,array:o,object:o,number:o,date:o,boolean:o,integer:o,float:o,regexp:o,email:o,url:o,hex:o},string:{len:"${label} deve possuir ${len} caracteres",min:"${label} deve possuir ao menos ${min} caracteres",max:"${label} deve possuir no máximo ${max} caracteres",range:"${label} deve possuir entre ${min} e ${max} caracteres"},number:{len:"${label} deve ser igual à ${len}",min:"O valor mínimo de ${label} é ${min}",max:"O valor máximo de ${label} é ${max}",range:"${label} deve estar entre ${min} e ${max}"},array:{len:"Deve ser ${len} ${label}",min:"No mínimo ${min} ${label}",max:"No máximo ${max} ${label}",range:"A quantidade de ${label} deve estar entre ${min} e ${max}"},pattern:{mismatch:"${label} não se encaixa no padrão ${pattern}"}}}};p.default=y});
1
+ __useblocks__.define("static/core/3eeb4445.js",["require","exports","module","static/core/2ff39ddf.js","static/core/a42ab03f.js"],function(i,p,$){const P=i("./2ff39ddf.js"),d=i("./a42ab03f.js");var u={items_per_page:"/ página",jump_to:"Vá até",jump_to_confirm:"confirme",page:"Página",prev_page:"Página anterior",next_page:"Próxima página",prev_5:"5 páginas anteriores",next_5:"5 próximas páginas",prev_3:"3 páginas anteriores",next_3:"3 próximas páginas",page_size:"tamanho da página"};function n(r){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(r)}function l(r,e){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(h){return Object.getOwnPropertyDescriptor(r,h).enumerable})),a.push.apply(a,t)}return a}function c(r){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?l(Object(a),!0).forEach(function(t){v(r,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(a,t))})}return r}function v(r,e,a){return e=b(e),e in r?Object.defineProperty(r,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[e]=a,r}function b(r){var e=f(r,"string");return n(e)=="symbol"?e:String(e)}function f(r,e){if(n(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var t=a.call(r,e||"default");if(n(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var g=c(c({},d.commonLocale),{},{locale:"pt_BR",today:"Hoje",now:"Agora",backToToday:"Voltar para hoje",ok:"OK",clear:"Limpar",week:"Semana",month:"Mês",year:"Ano",timeSelect:"Selecionar hora",dateSelect:"Selecionar data",monthSelect:"Escolher mês",yearSelect:"Escolher ano",decadeSelect:"Escolher década",monthBeforeYear:!1,previousMonth:"Mês anterior (PageUp)",nextMonth:"Próximo mês (PageDown)",previousYear:"Ano anterior (Control + esquerda)",nextYear:"Próximo ano (Control + direita)",previousDecade:"Década anterior",nextDecade:"Próxima década",previousCentury:"Século anterior",nextCentury:"Próximo século",shortWeekDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}),s={placeholder:"Hora",rangePlaceholder:["Hora de início","Hora de término"]},m={lang:{placeholder:"Selecionar data",rangePlaceholder:["Data inicial","Data final"],...g},timePickerLocale:{...s}},x=m,o="${label} não é um ${type} válido",y={locale:"pt-br",Pagination:u,DatePicker:m,TimePicker:s,Calendar:x,global:{placeholder:"Por favor escolha",close:"Fechar",show:"Mostrar",hide:"Ocultar"},Table:{filterTitle:"Menu de Filtro",filterConfirm:"OK",filterReset:"Resetar",filterEmptyText:"Sem filtros",filterCheckAll:"Selecionar todos os itens",filterSearchPlaceholder:"Pesquisar nos filtros",emptyText:"Sem conteúdo",selectAll:"Selecionar página atual",selectInvert:"Inverter seleção",selectNone:"Apagar todo o conteúdo",selectionAll:"Selecionar todo o conteúdo",sortTitle:"Ordenar título",expand:"Expandir linha",collapse:"Colapsar linha",triggerDesc:"Clique organiza por descendente",triggerAsc:"Clique organiza por ascendente",cancelSort:"Clique para cancelar organização"},Tour:{Next:"Próximo",Previous:"Anterior",Finish:"Finalizar"},Modal:{okText:"OK",cancelText:"Cancelar",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancelar"},Transfer:{titles:["",""],searchPlaceholder:"Procurar",itemUnit:"item",itemsUnit:"items",remove:"Remover",selectCurrent:"Selecionar página atual",removeCurrent:"Remover página atual",selectAll:"Selecionar todos",removeAll:"Remover todos",selectInvert:"Inverter seleção atual"},Upload:{uploading:"Enviando...",removeFile:"Remover arquivo",uploadError:"Erro no envio",previewFile:"Visualizar arquivo",downloadFile:"Baixar arquivo"},Empty:{description:"Não há dados"},Icon:{icon:"ícone"},Text:{edit:"editar",copy:"copiar",copied:"copiado",expand:"expandir"},Form:{optional:"(opcional)",defaultValidateMessages:{default:"Erro ${label} na validação de campo",required:"Por favor, insira ${label}",enum:"${label} deve ser um dos seguinte: [${enum}]",whitespace:"${label} não pode ser um carácter vazio",date:{format:" O formato de data ${label} é inválido",parse:"${label} não pode ser convertido para uma data",invalid:"${label} é uma data inválida"},types:{string:o,method:o,array:o,object:o,number:o,date:o,boolean:o,integer:o,float:o,regexp:o,email:o,url:o,hex:o},string:{len:"${label} deve possuir ${len} caracteres",min:"${label} deve possuir ao menos ${min} caracteres",max:"${label} deve possuir no máximo ${max} caracteres",range:"${label} deve possuir entre ${min} e ${max} caracteres"},number:{len:"${label} deve ser igual à ${len}",min:"O valor mínimo de ${label} é ${min}",max:"O valor máximo de ${label} é ${max}",range:"${label} deve estar entre ${min} e ${max}"},array:{len:"Deve ser ${len} ${label}",min:"No mínimo ${min} ${label}",max:"No máximo ${max} ${label}",range:"A quantidade de ${label} deve estar entre ${min} e ${max}"},pattern:{mismatch:"${label} não se encaixa no padrão ${pattern}"}}}};p.default=y});
@@ -1 +1 @@
1
- __useblocks__.define("static/core/17c8ebc4.js",["require","exports","module","static/core/83a2a45e.js"],function(u,t,m){const r=u("./83a2a45e.js");var n="https://cdn.ampproject.org/v0",i=`${n}.js`,c=`script[src='${i}']`;function a(e){return r.isElement(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function s(e){return r.isScriptElement(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}Object.defineProperty(t,"AMP_BASE_SCRIPT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(t,"AMP_BASE_SELECTOR",{enumerable:!0,get:function(){return c}}),Object.defineProperty(t,"AMP_SCRIPTS_PATH",{enumerable:!0,get:function(){return n}}),Object.defineProperty(t,"isAmpElement",{enumerable:!0,get:function(){return a}}),Object.defineProperty(t,"isAmpScript",{enumerable:!0,get:function(){return s}})});
1
+ __useblocks__.define("static/core/467344d4.js",["require","exports","module","static/core/a42ab03f.js"],function(u,t,m){const r=u("./a42ab03f.js");var n="https://cdn.ampproject.org/v0",i=`${n}.js`,c=`script[src='${i}']`;function a(e){return r.isElement(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function s(e){return r.isScriptElement(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}Object.defineProperty(t,"AMP_BASE_SCRIPT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(t,"AMP_BASE_SELECTOR",{enumerable:!0,get:function(){return c}}),Object.defineProperty(t,"AMP_SCRIPTS_PATH",{enumerable:!0,get:function(){return n}}),Object.defineProperty(t,"isAmpElement",{enumerable:!0,get:function(){return a}}),Object.defineProperty(t,"isAmpScript",{enumerable:!0,get:function(){return s}})});
@@ -1 +1 @@
1
- __useblocks__.define("static/core/c5128299.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/83a2a45e.js","static/core/e37da9a7.js","static/core/e9281a4c.js","static/core/579d4466.js"],function(c,h,j){const O=c("./2ff39ddf.js"),D=c("./cf7d1dd7.js"),e=c("./83a2a45e.js"),p=c("./e37da9a7.js"),m=c("./e9281a4c.js"),y=c("./579d4466.js");var w={8:"error",4:"warning",2:"info",1:"hint"},S=()=>e.err("unavailable","A block is open, not an email; read its code with document.getHtml.");function f(t){return e.isBlockSessionKey(e.peekEmailDocuments(t)?.sessionKey())}function d(t){try{return t.getInstance(D.PLUGIN_COLLECTION_ID)?.use("EmailSettingsApi")}catch{return}}async function g(t,i,o){const{compileEmail:n}=await e.loadEmailCompiler();return n(await i.getEmailSnapshot(),{amp:!1,text:o},e.getTemplateDirectivesPolicy(t).keepWrappedOnOutput)}function v(t){return f(t)?S():e.featureRefusal(t,"export_html","the compiled email")}function k(t){const{id:i,date:o,modified:n,authorName:r,author:s,subject:a,title:u,isAutosave:l}=t;return{id:i===void 0?void 0:String(i),date:o??n,author:r??s,subject:a,title:u,isAutosave:l}}async function R(t,i){const o=e.peekEmailDocuments(t),n=o?.current()?.get().serverId;if(!o||n==null)return e.err("unavailable","The document has no saved revisions yet.");const r=e.featureRefusal(t,"version_history","revision history");if(r)return r;if(e.isBlockSessionKey(o.sessionKey())){if(!e.canReadBlockHistory(t))return{revisions:[],hasMore:!1};const{revisions:u,hasMore:l}=await e.resolveBlockHistoryPort(t).readRevisions(String(n),i,{wpId:e.openDocumentWpId(t,n)});return{revisions:u.map(k),hasMore:l}}if(!await e.isEmailHistoryAvailable(t))return e.planRefusal("Revision history is not available on this plan.");const{revisions:s,hasMore:a}=await e.resolveEmailHistoryPort(t).readRevisions(String(n),i,{wpId:e.openDocumentWpId(t,n)});return{revisions:s.map(k),hasMore:a}}function E(t,i){return e.openDocument(t)?e.isReadOnly(t)?e.readOnlyError():e.featureRefusal(t,"code_editor","the email code")??(e.markupHasContent(i)?void 0:e.err("invalidArgs",'"html" must not be empty: with no text, pictures or other visible elements it would erase the whole email.')):e.noDocument()}function b(t,{caller:i}){return i==="agent"&&e.getAgentService(t).answerOpen?e.err("undoConflict","The edits of this answer are not closed yet, so undo and redo are not possible now. Undo becomes available after the answer ends: tell the user about it."):void 0}function _(t){return{"document.replaceHtml":{precheck:i=>E(t,i.html),consent:i=>{const o=e.agentTranslator(t);return{title:o.__("Replace the whole email with new markup"),...e.detailsOf(e.markupSize(o,i.html))}}}}}function T(t,i){return{"document.getHtml":async({output:o})=>{const n=e.openDocument(t);return n?o!=="email"?n.getContent():v(t)??(await g(t,i,!1)).compiled.html:e.noDocument()},"document.getText":async()=>e.openDocument(t)?v(t)??(await g(t,i,!0)).compiled.text:e.noDocument(),"document.setHeaders":async o=>{const n=e.openDocument(t);if(!n)return e.noDocument();if(f(t))return e.err("unavailable","A block has no subject or preheader; open an email to set them.");if(e.isReadOnly(t))return e.readOnlyError();if(e.getAppConfig(t).lockPreheaderAndTitle===!0)return e.err("disabled","The subject and the preheader are locked in this editor.");const r=(o.subject!==void 0?e.featureRefusal(t,"theme_editing","the subject"):void 0)??(o.preheader!==void 0?e.featureRefusal(t,"preheader_editing","the preheader"):void 0);if(r)return r;const s=Object.fromEntries(Object.entries(o).filter(([,a])=>a!==void 0));return e.writeEmailAttributes(n,s),await e.settleHeaders(t),e.ok()},"document.getSettings":async()=>{const o=await d(t)?.getEmailLayoutSettings();return o?m.editableLayoutSettings(o):e.noDocument()},"document.setSettings":async({settings:o})=>{const n=d(t);if(!n||!e.openDocument(t))return e.noDocument();if(f(t))return e.err("unavailable","A block has no email layout settings; open an email to set them.");if(e.isReadOnly(t))return e.readOnlyError();const r=m.layoutSettingsRefusal(o);return r||(e.isCanvasOpen(t)?(await n.setEmailLayoutSettings(o),e.getMessageService(t).send({operation:e.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:o}),await e.askCanvasElement(t,{op:"settle"}).then(s=>s.ok,()=>!1)?e.ok():e.ok({canvasPending:!0})):e.err("unavailable","The canvas is not open."))},"document.getContentStyles":async()=>await d(t)?.getEmailContentStyles()??e.noDocument(),"document.setContentStyles":async({styles:o})=>{const n=d(t);if(!n||!e.openDocument(t))return e.noDocument();if(e.isReadOnly(t))return e.readOnlyError();const r=m.contentStylesRefusal(t,o,await n.getEmailContentStyles());return r||(await n.setEmailContentStyles(o),e.openDocument(t)?.markUnsaved(),e.ok())},"document.replaceHtml":({html:o})=>{const n=e.peekEmailDocuments(t),r=n?.current();if(!n||!r)return e.noDocument();const s=E(t,o);return s||(e.replaceDocumentContent(r,n.history(),o,{undoable:!0}),e.ok())},"history.undo":(o,n)=>{const r=e.undoPlanRefusal(t)??b(t,n);if(r)return r;const s=e.peekEmailDocuments(t)?.history();return s?.canUndo()?e.isReadOnly(t)?e.readOnlyError():s.tryUndo()?e.ok():e.err("nothingToUndo","The last step could not be undone: the text changed under it."):e.err("nothingToUndo","There is nothing to undo.")},"history.redo":(o,n)=>{const r=e.undoPlanRefusal(t)??b(t,n);if(r)return r;const s=e.peekEmailDocuments(t)?.history();return s?.canRedo()?e.isReadOnly(t)?e.readOnlyError():s.tryRedo()?e.ok():e.err("nothingToRedo","The step could not be redone: the text changed under it."):e.err("nothingToRedo","There is nothing to redo.")},"history.listRevisions":({page:o})=>R(t,o??1),"check.code":async()=>{const o=e.openDocument(t);return o?(await e.validateEmailCode(o.getContent())).map(({severity:n,message:r,startLineNumber:s,startColumn:a,endLineNumber:u,endColumn:l})=>({severity:w[n]??"error",message:r,startLineNumber:s,startColumn:a,endLineNumber:u,endColumn:l})):e.noDocument()},"check.codeSize":()=>{const o=e.openDocument(t);if(!o)return e.noDocument();const n=e.getCodeSize(o.getContent());return{sizeBytes:n,sizeKb:Math.round(n/1024),limitKb:90,exceeded:e.isCodeSizeExceeded(n,90)}},"block.list":async o=>{if(o.source==="gallery"){const r=await y.galleryBlockList(t);return e.isResult(r)?r:p.blockListPage(r.map(({id:s,title:a,description:u,type:l})=>({id:s,title:a,description:u,type:l})),o)}const n=await y.readProjectBlocks(t);return n?p.blockListPage(n.map(({id:r,title:s,description:a,type:u,global_block:l})=>({id:r,title:s,description:a,type:u,global:l===!0})),o):e.blocksNotLoaded()}}}h.agentDocumentGates=_,h.agentDocumentHandlers=T});
1
+ __useblocks__.define("static/core/513e36bd.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/a42ab03f.js","static/core/94f9492b.js","static/core/7e329493.js","static/core/516f59e7.js"],function(c,h,j){const O=c("./2ff39ddf.js"),D=c("./cf7d1dd7.js"),e=c("./a42ab03f.js"),p=c("./94f9492b.js"),m=c("./7e329493.js"),y=c("./516f59e7.js");var w={8:"error",4:"warning",2:"info",1:"hint"},S=()=>e.err("unavailable","A block is open, not an email; read its code with document.getHtml.");function f(t){return e.isBlockSessionKey(e.peekEmailDocuments(t)?.sessionKey())}function d(t){try{return t.getInstance(D.PLUGIN_COLLECTION_ID)?.use("EmailSettingsApi")}catch{return}}async function g(t,i,o){const{compileEmail:n}=await e.loadEmailCompiler();return n(await i.getEmailSnapshot(),{amp:!1,text:o},e.getTemplateDirectivesPolicy(t).keepWrappedOnOutput)}function v(t){return f(t)?S():e.featureRefusal(t,"export_html","the compiled email")}function k(t){const{id:i,date:o,modified:n,authorName:r,author:s,subject:a,title:u,isAutosave:l}=t;return{id:i===void 0?void 0:String(i),date:o??n,author:r??s,subject:a,title:u,isAutosave:l}}async function R(t,i){const o=e.peekEmailDocuments(t),n=o?.current()?.get().serverId;if(!o||n==null)return e.err("unavailable","The document has no saved revisions yet.");const r=e.featureRefusal(t,"version_history","revision history");if(r)return r;if(e.isBlockSessionKey(o.sessionKey())){if(!e.canReadBlockHistory(t))return{revisions:[],hasMore:!1};const{revisions:u,hasMore:l}=await e.resolveBlockHistoryPort(t).readRevisions(String(n),i,{wpId:e.openDocumentWpId(t,n)});return{revisions:u.map(k),hasMore:l}}if(!await e.isEmailHistoryAvailable(t))return e.planRefusal("Revision history is not available on this plan.");const{revisions:s,hasMore:a}=await e.resolveEmailHistoryPort(t).readRevisions(String(n),i,{wpId:e.openDocumentWpId(t,n)});return{revisions:s.map(k),hasMore:a}}function E(t,i){return e.openDocument(t)?e.isReadOnly(t)?e.readOnlyError():e.featureRefusal(t,"code_editor","the email code")??(e.markupHasContent(i)?void 0:e.err("invalidArgs",'"html" must not be empty: with no text, pictures or other visible elements it would erase the whole email.')):e.noDocument()}function b(t,{caller:i}){return i==="agent"&&e.getAgentService(t).answerOpen?e.err("undoConflict","The edits of this answer are not closed yet, so undo and redo are not possible now. Undo becomes available after the answer ends: tell the user about it."):void 0}function _(t){return{"document.replaceHtml":{precheck:i=>E(t,i.html),consent:i=>{const o=e.agentTranslator(t);return{title:o.__("Replace the whole email with new markup"),...e.detailsOf(e.markupSize(o,i.html))}}}}}function T(t,i){return{"document.getHtml":async({output:o})=>{const n=e.openDocument(t);return n?o!=="email"?n.getContent():v(t)??(await g(t,i,!1)).compiled.html:e.noDocument()},"document.getText":async()=>e.openDocument(t)?v(t)??(await g(t,i,!0)).compiled.text:e.noDocument(),"document.setHeaders":async o=>{const n=e.openDocument(t);if(!n)return e.noDocument();if(f(t))return e.err("unavailable","A block has no subject or preheader; open an email to set them.");if(e.isReadOnly(t))return e.readOnlyError();if(e.getAppConfig(t).lockPreheaderAndTitle===!0)return e.err("disabled","The subject and the preheader are locked in this editor.");const r=(o.subject!==void 0?e.featureRefusal(t,"theme_editing","the subject"):void 0)??(o.preheader!==void 0?e.featureRefusal(t,"preheader_editing","the preheader"):void 0);if(r)return r;const s=Object.fromEntries(Object.entries(o).filter(([,a])=>a!==void 0));return e.writeEmailAttributes(n,s),await e.settleHeaders(t),e.ok()},"document.getSettings":async()=>{const o=await d(t)?.getEmailLayoutSettings();return o?m.editableLayoutSettings(o):e.noDocument()},"document.setSettings":async({settings:o})=>{const n=d(t);if(!n||!e.openDocument(t))return e.noDocument();if(f(t))return e.err("unavailable","A block has no email layout settings; open an email to set them.");if(e.isReadOnly(t))return e.readOnlyError();const r=m.layoutSettingsRefusal(o);return r||(e.isCanvasOpen(t)?(await n.setEmailLayoutSettings(o),e.getMessageService(t).send({operation:e.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:o}),await e.askCanvasElement(t,{op:"settle"}).then(s=>s.ok,()=>!1)?e.ok():e.ok({canvasPending:!0})):e.err("unavailable","The canvas is not open."))},"document.getContentStyles":async()=>await d(t)?.getEmailContentStyles()??e.noDocument(),"document.setContentStyles":async({styles:o})=>{const n=d(t);if(!n||!e.openDocument(t))return e.noDocument();if(e.isReadOnly(t))return e.readOnlyError();const r=m.contentStylesRefusal(t,o,await n.getEmailContentStyles());return r||(await n.setEmailContentStyles(o),e.openDocument(t)?.markUnsaved(),e.ok())},"document.replaceHtml":({html:o})=>{const n=e.peekEmailDocuments(t),r=n?.current();if(!n||!r)return e.noDocument();const s=E(t,o);return s||(e.replaceDocumentContent(r,n.history(),o,{undoable:!0}),e.ok())},"history.undo":(o,n)=>{const r=e.undoPlanRefusal(t)??b(t,n);if(r)return r;const s=e.peekEmailDocuments(t)?.history();return s?.canUndo()?e.isReadOnly(t)?e.readOnlyError():s.tryUndo()?e.ok():e.err("nothingToUndo","The last step could not be undone: the text changed under it."):e.err("nothingToUndo","There is nothing to undo.")},"history.redo":(o,n)=>{const r=e.undoPlanRefusal(t)??b(t,n);if(r)return r;const s=e.peekEmailDocuments(t)?.history();return s?.canRedo()?e.isReadOnly(t)?e.readOnlyError():s.tryRedo()?e.ok():e.err("nothingToRedo","The step could not be redone: the text changed under it."):e.err("nothingToRedo","There is nothing to redo.")},"history.listRevisions":({page:o})=>R(t,o??1),"check.code":async()=>{const o=e.openDocument(t);return o?(await e.validateEmailCode(o.getContent())).map(({severity:n,message:r,startLineNumber:s,startColumn:a,endLineNumber:u,endColumn:l})=>({severity:w[n]??"error",message:r,startLineNumber:s,startColumn:a,endLineNumber:u,endColumn:l})):e.noDocument()},"check.codeSize":()=>{const o=e.openDocument(t);if(!o)return e.noDocument();const n=e.getCodeSize(o.getContent());return{sizeBytes:n,sizeKb:Math.round(n/1024),limitKb:90,exceeded:e.isCodeSizeExceeded(n,90)}},"block.list":async o=>{if(o.source==="gallery"){const r=await y.galleryBlockList(t);return e.isResult(r)?r:p.blockListPage(r.map(({id:s,title:a,description:u,type:l})=>({id:s,title:a,description:u,type:l})),o)}const n=await y.readProjectBlocks(t);return n?p.blockListPage(n.map(({id:r,title:s,description:a,type:u,global_block:l})=>({id:r,title:s,description:a,type:u,global:l===!0})),o):e.blocksNotLoaded()}}}h.agentDocumentGates=_,h.agentDocumentHandlers=T});
@@ -1 +1 @@
1
- __useblocks__.define("static/core/579d4466.js",["require","exports","module","static/core/cf7d1dd7.js","static/core/83a2a45e.js","static/core/c33a9c36.js"],function(n,c,f){const s=n("./cf7d1dd7.js"),r=n("./83a2a45e.js"),d=n("./c33a9c36.js");function j(e){const t=e.getInstance(s.STORE_ID);return t?t.dispatch:void 0}async function i(e,t,o){const l=j(e);if(!l)return;const u=l(t);try{const a=await u;return a.error===void 0?a.data??o:void 0}finally{u.unsubscribe?.()}}function g(e){const t=r.getCurrentProjectId(e);return i(e,r.blocksApi.endpoints.getBlocks.initiate(r.projectBlocksArgs(t===void 0?void 0:String(t))),[])}async function p(e){const t=r.getCurrentProjectId(e);return await i(e,r.blocksApi.endpoints.getTemplateBlocks.initiate(r.templateBlocksArgs(t===void 0?void 0:String(t))),[])??r.err("unavailable","The block gallery could not be loaded.")}async function b(e,t){const o=e.getInstance(s.STORE_ID);return o?d.blockHtmlForInsert(()=>o.getState(),t):void 0}Object.defineProperty(c,"galleryBlockList",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"projectBlockHtml",{enumerable:!0,get:function(){return b}}),Object.defineProperty(c,"readProjectBlocks",{enumerable:!0,get:function(){return g}})});
1
+ __useblocks__.define("static/core/516f59e7.js",["require","exports","module","static/core/cf7d1dd7.js","static/core/a42ab03f.js","static/core/76543cb2.js"],function(n,c,f){const s=n("./cf7d1dd7.js"),r=n("./a42ab03f.js"),d=n("./76543cb2.js");function j(e){const t=e.getInstance(s.STORE_ID);return t?t.dispatch:void 0}async function i(e,t,o){const l=j(e);if(!l)return;const u=l(t);try{const a=await u;return a.error===void 0?a.data??o:void 0}finally{u.unsubscribe?.()}}function g(e){const t=r.getCurrentProjectId(e);return i(e,r.blocksApi.endpoints.getBlocks.initiate(r.projectBlocksArgs(t===void 0?void 0:String(t))),[])}async function p(e){const t=r.getCurrentProjectId(e);return await i(e,r.blocksApi.endpoints.getTemplateBlocks.initiate(r.templateBlocksArgs(t===void 0?void 0:String(t))),[])??r.err("unavailable","The block gallery could not be loaded.")}async function b(e,t){const o=e.getInstance(s.STORE_ID);return o?d.blockHtmlForInsert(()=>o.getState(),t):void 0}Object.defineProperty(c,"galleryBlockList",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"projectBlockHtml",{enumerable:!0,get:function(){return b}}),Object.defineProperty(c,"readProjectBlocks",{enumerable:!0,get:function(){return g}})});
@@ -1 +1 @@
1
- __useblocks__.define("static/core/9d57053a.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/83a2a45e.js","vite/preload-helper"],function(i,p,E){const M=i("./2ff39ddf.js"),f=i("./cf7d1dd7.js"),t=i("./83a2a45e.js");let g=i("vite/preload-helper");var v=10,_=100,c=new WeakMap;function w(r,n){const e=c.get(r)??new Map;for(n.forEach(s=>{e.delete(s.id),e.set(s.id,s)});e.size>_;)e.delete(e.keys().next().value);c.set(r,e)}function k(r){const n=()=>r.getInstance(f.STORE_ID)?.dispatch;return{"image.search":async({keywords:e,orientation:s,page:a})=>{const o=t.standaloneRefusal(r,"Stock photos")??t.featureRefusal(r,"stock_photo","stock photos");if(o)return o;if(!e.trim())return t.err("invalidArgs",'"keywords" must not be empty.');if(a!==void 0&&(!Number.isInteger(a)||a<1))return t.err("invalidArgs",'"page" must be a whole number from 1.');const l=n();if(!l)return t.err("unavailable","Stock photos need the editor interface.");const u={keywords:e.trim(),color:"",orientation:s??""},d=l(t.imageApi.endpoints.getSearchImage.initiate({query:u,page:a??1}));try{const m=await d;if(m.error)return t.err("searchFailed","The stock photo service failed.");const h=(m.data?.results??[]).slice(0,v);return w(r,h),{images:h.map(({id:b,description:y,alt_description:I,user:j,width:A,height:F})=>({id:b,description:y||I||"",author:j?.name??"",width:A,height:F}))}}finally{d.unsubscribe?.()}},"image.pick":({id:e})=>{const s=t.featureRefusal(r,"stock_photo","stock photos");if(s)return s;const a=c.get(r)?.get(e);if(!a)return t.err("notFound",`There is no found photo "${e}": search with \`image.search\` first.`);const o=n()?.(t.imageApi.endpoints.getUnsplashImage.initiate(a.links.download_location));return Promise.resolve(o).catch(()=>{}).finally(()=>o?.unsubscribe?.()),{url:`${a.urls.raw}&w=1200&q=96`}},"file.upload":async({url:e})=>{if(!/^https?:\/\//i.test(e.trim()))return t.err("invalidArgs",'"url" must be an http(s) address.');const{isUploadFailure:s,saveImageFromUrl:a}=await(0,g.__vitePreload)(async()=>{const{isUploadFailure:l,saveImageFromUrl:u}=await Promise.resolve().then(()=>i("./846cd365.js"));return{isUploadFailure:l,saveImageFromUrl:u}},void 0,{}.url),o=await a(r,e.trim());return s(o)?t.err(o.code,o.message):{url:o}}}}p.agentImageHandlers=k});
1
+ __useblocks__.define("static/core/58dca22f.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/a42ab03f.js","vite/preload-helper"],function(i,p,E){const M=i("./2ff39ddf.js"),f=i("./cf7d1dd7.js"),t=i("./a42ab03f.js");let g=i("vite/preload-helper");var v=10,_=100,c=new WeakMap;function w(r,n){const e=c.get(r)??new Map;for(n.forEach(s=>{e.delete(s.id),e.set(s.id,s)});e.size>_;)e.delete(e.keys().next().value);c.set(r,e)}function k(r){const n=()=>r.getInstance(f.STORE_ID)?.dispatch;return{"image.search":async({keywords:e,orientation:s,page:a})=>{const o=t.standaloneRefusal(r,"Stock photos")??t.featureRefusal(r,"stock_photo","stock photos");if(o)return o;if(!e.trim())return t.err("invalidArgs",'"keywords" must not be empty.');if(a!==void 0&&(!Number.isInteger(a)||a<1))return t.err("invalidArgs",'"page" must be a whole number from 1.');const l=n();if(!l)return t.err("unavailable","Stock photos need the editor interface.");const u={keywords:e.trim(),color:"",orientation:s??""},d=l(t.imageApi.endpoints.getSearchImage.initiate({query:u,page:a??1}));try{const m=await d;if(m.error)return t.err("searchFailed","The stock photo service failed.");const h=(m.data?.results??[]).slice(0,v);return w(r,h),{images:h.map(({id:b,description:y,alt_description:I,user:j,width:A,height:F})=>({id:b,description:y||I||"",author:j?.name??"",width:A,height:F}))}}finally{d.unsubscribe?.()}},"image.pick":({id:e})=>{const s=t.featureRefusal(r,"stock_photo","stock photos");if(s)return s;const a=c.get(r)?.get(e);if(!a)return t.err("notFound",`There is no found photo "${e}": search with \`image.search\` first.`);const o=n()?.(t.imageApi.endpoints.getUnsplashImage.initiate(a.links.download_location));return Promise.resolve(o).catch(()=>{}).finally(()=>o?.unsubscribe?.()),{url:`${a.urls.raw}&w=1200&q=96`}},"file.upload":async({url:e})=>{if(!/^https?:\/\//i.test(e.trim()))return t.err("invalidArgs",'"url" must be an http(s) address.');const{isUploadFailure:s,saveImageFromUrl:a}=await(0,g.__vitePreload)(async()=>{const{isUploadFailure:l,saveImageFromUrl:u}=await Promise.resolve().then(()=>i("./11dadbc0.js"));return{isUploadFailure:l,saveImageFromUrl:u}},void 0,{}.url),o=await a(r,e.trim());return s(o)?t.err(o.code,o.message):{url:o}}}}p.agentImageHandlers=k});
@@ -1 +1 @@
1
- __useblocks__.define("static/core/9438888a.js",["require","exports","module","static/core/2ff39ddf.js","static/core/83a2a45e.js","static/core/e37da9a7.js"],function(o,l,m){const u=o("./2ff39ddf.js"),e=o("./83a2a45e.js"),s=o("./e37da9a7.js");var a=["text","header","image","button","spacer","divider","list-ul","list-ol","video"],h=["1","2","3","4","1:2","2:1"],c=["productCarousel","singleImagePreview","dealAnnotation","dealCard"],t=e.Arg.element(),r="Pass a reference from element.getTree.",n=e.Arg.optional(e.Arg.string()),i="During your answer or a batch it is refused with `undoConflict`: the edits are not closed yet, and undo becomes available after the answer, so tell the user about it.",d={"document.getHtml":{description:'Returns the HTML of the open document. `output: "editor"` (default) is the markup the editor keeps, with its service attributes; `output: "email"` is the compiled email as recipients get it, closed by the plan when it has no HTML export.',args:e.Arg.object({output:e.Arg.optional(e.Arg.enum("editor","email"))})},"document.getText":{description:"Returns the plain-text version of the email as recipients get it, without markup. Closed by the plan when it has no HTML export."},"document.setHeaders":{description:"Sets the subject, the preheader (preview text after the subject) and the title of the email; omitted fields stay. The title follows the subject while they are equal. The plan can close the subject and the preheader, not the title. On the open canvas `history.undo` brings the subject and the preheader back together with the markup, but do not count on it: these fields come back for sure only when the user takes back the whole answer.",args:e.Arg.object({subject:e.Arg.optional(e.Arg.string()),preheader:e.Arg.optional(e.Arg.string()),title:e.Arg.optional(e.Arg.string())})},"document.getSettings":{description:"Returns the layout settings of the whole email: background, width, responsiveness."},"document.setSettings":{description:'Changes layout settings of the whole email; pass only the fields to change, in the form `document.getSettings` returns (for example `{ "backgroundColor": "#ffffff", "width": { "value": 600, "dim": "px" } }`). Other fields are refused: common styles go to `document.setContentStyles`. A background address that is executable or holds "<" or "-->" is refused with `invalidArgs`. Needs the open canvas and an email, not a block; `history.undo` reverts it as one step. `canvasPending: true` in the answer means the settings are written, but the canvas has not confirmed them yet.',args:e.Arg.object({settings:e.Arg.object({})})},"document.getContentStyles":{description:"Returns the common styles of the email content: text, headings, links, buttons, block, cards."},"document.setContentStyles":{description:'Changes the common styles of the email content; pass only the groups and fields to change, in the form `document.getContentStyles` returns (for example `{ "text": { "fontSize": 16 } }`). Another group, a group that is not an object or a font name with one of < > " { } ; \\ or a stray single quote is refused with `invalidArgs`; fields and Google fonts closed by the plan with `lockedByPlan`. `history.undo` does not revert it: it comes back only when the user takes back the whole answer.',args:e.Arg.object({styles:e.Arg.object({})})},"document.replaceHtml":{description:"Replaces the whole document with new HTML in one undo step. Prefer element commands for local changes: this one rewrites everything. Start from `document.getHtml` and keep its service attributes. `html` with no text, pictures or other visible elements is refused with `invalidArgs`. Closed when the plan has no code editing: use element commands then.",args:e.Arg.object({html:e.Arg.string()})},"history.undo":{description:`Undoes the last step of document edits. Fields of the email outside the undo history are not its job: common styles and UTM marks stay, and the subject and the preheader come back only on the open canvas, with the markup; all of them come back when the user takes back the whole answer. ${i}`},"history.redo":{description:`Redoes the last undone step of document edits. ${i}`},"history.listRevisions":{description:"Lists saved revisions of the open document, newest first, one page at a time: id, date, author, subject, title and `isAutosave`, without the content. Rows with `isAutosave: true` are automatic snapshots. Pass an id to `history.restoreRevision` to go back to that version. Closed by the plan when it has no revision history.",args:e.Arg.object({page:e.Arg.optional(e.Arg.number())})},"check.code":{description:"Checks the HTML of the open document and lists the problems: unclosed tags, wrong nesting, bad attributes."},"check.codeSize":{description:"Returns the code size of the email, as the editor's code size badge shows it; Gmail clips emails over 90 KB."},"block.list":{description:"Lists blocks that can be inserted into the email with block.insert. `source` picks where they come from: `project` (default) are the blocks saved in this project, in the look of the user: look there first. `gallery` are the shared ready-made blocks of the editor: use them when the project has nothing that fits. "+s.BLOCK_LIST_HINT,args:e.Arg.object(s.BLOCK_LIST_ARGS)},"check.links":{description:"Checks every link of the open email as it is now over the network and lists them with a status (valid, warnings, errors) and the HTTP code. A new email must be saved first. Paid: each call uses the plan limit."},"check.images":{description:"Checks every image of the open email as it is now over the network and lists them with a status, the HTTP code, size in kilobytes and dimensions. A new email must be saved first. Paid: each call uses the plan limit."},"check.spam":{description:"Scores the open email as it is now with SpamAssassin and lists the rules that matched, lowest weight first; a higher score means more likely spam. A new email must be saved first. Paid: each call uses the plan limit. An editor without a server has no spam check: the answer is `unavailable`."},"element.getTree":{description:"Returns the elements of the open document as a tree: each node has a reference, a kind (row, column, cell, text, image, button, link, spacer, ...) and the start of its text. Use the references in other element commands. References die when the element is deleted, the host rewrites it (undo, code editor) or the document changes; read the tree again then. `truncated: true` means part of the tree is cut: read it with `root` and a larger `depth`.",args:e.Arg.object({root:e.Arg.optional(t),depth:e.Arg.optional(e.Arg.number())})},"element.find":{description:"Finds elements in the whole document (or inside `inside`) without selecting them. All given conditions must match: `kind` (image, button, link, text, row, ...), `textContains`, and `where` on image src and alt or link href: an empty string matches a missing or empty value, other strings match by case-insensitive substring. Returns references with kind, text start and src/alt/href, at most `limit` (50 by default, up to 200), and `total`. To change many found elements in one call, pass element.setProps calls to agent.batch.",args:e.Arg.object({kind:e.Arg.optional(e.Arg.string()),textContains:e.Arg.optional(e.Arg.string()),where:e.Arg.optional(e.Arg.object({alt:e.Arg.optional(e.Arg.string()),src:e.Arg.optional(e.Arg.string()),href:e.Arg.optional(e.Arg.string())})),inside:e.Arg.optional(t),limit:e.Arg.optional(e.Arg.number())})},"text.replace":{description:'Replaces every occurrence of a phrase in the visible text of the document (or inside `inside`) in one undo step; links, image addresses, variables and code are not touched, and neither are the subject, preheader and image alt. Finds whole words by default, in any alphabet: "cat" does not touch "concat", even when part of it is bold; pass `wholeWord: false` to match inside words. Case-insensitive unless `matchCase`. A phrase split by formatting (part of it bold) is not found. Returns `replaced`, the number of replacements, and up to 5 `examples` of `{ before, after }` with some text around.',args:e.Arg.object({find:e.Arg.string(),replace:e.Arg.string(),matchCase:e.Arg.optional(e.Arg.boolean()),wholeWord:e.Arg.optional(e.Arg.boolean()),inside:e.Arg.optional(t)})},"element.get":{description:`Selects the element like a user click and returns what the inspector shows: kind, caption and settings. element.setProps takes the same setting names. ${r}`,args:e.Arg.object({element:t})},"element.select":{description:`Selects the element like a user click: the inspector opens its settings. ${r}`,args:e.Arg.object({element:t})},"ui.highlight":{description:"Outlines the element on the canvas for a while (1.5 s by default, up to 10 s) to show the user what you mean. Neither selects nor changes anything.",args:e.Arg.object({element:t,durationMs:e.Arg.optional(e.Arg.number())})},"element.setProps":{description:'Changes inspector settings of the element in one undo step: link, image source and alt, sizes, paddings, colors, fonts, visibility. Pass only the fields you change, named as element.get returns them; do not send back an address already in the email that holds a template directive: "<" in it is refused. Returns a fresh reference: the element may be rebuilt. `unchanged: true` in the answer means the document did not change: check the setting names with element.get; the value may also be the same already. A field or a new Google font closed by the plan is refused with `lockedByPlan`. An address that is executable or holds "<" or "-->", a font that is not a string or an array of strings and a font name with one of < > " { } ; \\ or a stray single quote are refused with `invalidArgs`.',args:e.Arg.object({element:t,props:e.Arg.object({})})},"element.setText":{description:"Replaces the whole text of a text, header, button or link element in one undo step, keeping its look (font, color, bold header). Plain text only: markup characters stay text, a line break becomes a new line. A cell with one text element inside takes its text too. Refused for text with a list, a picture or a variable: use text.replace. The preheader is refused with `readOnly`: it goes through document.setHeaders.",args:e.Arg.object({element:t,text:e.Arg.string()})},"row.insert":{description:'Inserts an empty row of the palette with columns before or after a row, or at the end of the document without `at`, in one undo step: "1" one column, "2" two equal, "1:2" narrow and wide, "2:1" wide and narrow, "3", "4". Returns the row and its column references; fill the columns with element.insert and place "inside". Prefer a saved block of the project (block.list, block.insert) when one fits.',args:e.Arg.object({columns:e.Arg.enum(...h),at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"document.getMarkupRules":{description:'Returns the markup rules of email rows (em="block" rows, layout tables, columns, em="atom" atoms, buttons, mobile classes). Read them once before writing rows for row.insertHtml.'},"row.insertHtml":{description:'Inserts rows you wrote in the editor markup (document.getMarkupRules): an optional <link em-class="em-font-..."> of a font on https: and <style em="styles">, then one or more <tr em="block">. Without `at` the rows go after the last row, in the given order, in one undo step. Rows are checked first: `invalidMarkup` lists the broken rules, nothing is inserted; fix and send again. Scripts, other style sheets, event handlers and executable addresses, also inside conditional comments and CSS, are cut. An <em-replace> variable is refused with `lockedByPlan` when the plan has no variables; one with "<" or ">" in `text` is a broken rule: add it with element.insertVariable. A .preheader node is refused with `lockedByPlan` when the plan closes the preheader. Returns the references of the new rows. If the open email changes meanwhile, the answer is `unavailable`. If a row after the first fails, the answer is `partialInsert`: its message names the rows that went in and the reason, the rows stay in the document as one undo step. Prefer a saved block of the project (block.list) when one fits.',args:e.Arg.object({html:e.Arg.string(),at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"element.insert":{description:`Inserts a new element of the palette (${a.join(", ")}) before or after an element, or at the end inside a row or a column, in one undo step. Returns the reference of the new element; change it with element.setProps.`,args:e.Arg.object({kind:e.Arg.enum(...a),at:e.Arg.object({element:t,place:e.Arg.enum("before","after","inside")})})},"block.insert":{description:"Inserts a block (an id from block.list, with the same `source`: `project` by default, `gallery` for a shared block) before or after a row, in one undo step; without `at` the block goes where a click on the block panel puts it. A gallery block keeps its own colors and fonts: it is not recolored to the common styles of the email. A block with a .preheader node is refused with `lockedByPlan` when the plan closes the preheader. `unavailable` means the open email changed meanwhile. Returns the reference of the new row.",args:e.Arg.object({block:e.Arg.string(),source:s.BLOCK_SOURCE_ARG,at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"element.delete":{description:`Deletes the element or the row in one undo step. Refused with \`readOnly\` when the element or something inside it is locked by the integrator, and for the preheader or a row with it: it goes through document.setHeaders. ${r}`,args:e.Arg.object({element:t})},"element.clone":{description:"Duplicates the element or the row right after it in one undo step and returns the reference of the copy.",args:e.Arg.object({element:t})},"element.move":{description:"Moves the row one place up or down in one undo step; `cannotMove` when it is already first or last.",args:e.Arg.object({element:t,direction:e.Arg.enum("up","down")})},"agent.batch":{description:'Runs up to 100 tool calls in order in one request, with all their edits in one undo step, for example element.setProps for each element found by element.find, each with its own props. Each call is checked as if called alone. Before the first call the user is asked once about all calls that need consent: if the user declines, no call runs and the answer is `declined`; a yes covers the whole batch. A call refused by a check before that window comes back in `failed` with `completed: 0`, nothing run. After that the batch stops at the first failed call: the answer is still a success, `failed` names the call and the calls before it stay done, so check `failed`. Returns the result of each finished call. To use a result in a later call of the same batch, pass `{ "$result": "0.element" }` as the value: the number of the call, then an own field of its result. A call that needs consent cannot take such a reference, because the window has to show the data: the batch is refused with `invalidArgs` in `failed`, nothing run; run the earlier calls first and write the value out in a separate batch. Tools of ui.* wait for the user and are not allowed in a batch, except ui.highlight.',args:e.Arg.object({calls:e.Arg.array(e.Arg.object({tool:e.Arg.string(),args:e.Arg.optional(e.Arg.object({}))}))})},"image.search":{description:"Searches free stock photos by keywords (the Stock tab of the image window) and returns up to 10 of them with an id, a description, the author and the size. There are no URLs: pass the chosen id to `image.pick`. An editor without a server has no stock photos: the answer is `unavailable`.",args:e.Arg.object({keywords:e.Arg.string(),orientation:e.Arg.optional(e.Arg.enum("landscape","portrait","squarish")),page:e.Arg.optional(e.Arg.number())})},"image.pick":{description:"Takes a photo found by `image.search` and returns its `url` for an image element. Reports the use to the photo service, as the image window does. Closed by the plan like `image.search`.",args:e.Arg.object({id:e.Arg.string()})},"file.upload":{description:"Downloads an image (JPG, PNG, WEBP, GIF or SVG) from a URL and stores it in the project storage the way the image window does; returns the stored image `url`. Use it for images that are not yet in the project storage.",args:e.Arg.object({url:e.Arg.string()})},"gallery.listTemplates":{description:"Lists the email templates of the gallery, one page at a time (page 1 by default; an empty list means no more pages). Use an id with document.applyTemplate. Not available in the plugin.",args:e.Arg.object({page:e.Arg.optional(e.Arg.number())})},"document.applyTemplate":{description:"Replaces the whole content of the open email with a gallery template (an id from gallery.listTemplates) in one undo step. Only the markup is taken: subject, preheader and common styles of the email stay. Not available in the plugin or for a block.",args:e.Arg.object({template:e.Arg.string()})},"project.getStyles":{description:"Returns the brand styles of the project: palette colors, fonts and social links. Use them for colors and fonts of new content. Not available in the plugin."},"document.getUtm":{description:"Returns the UTM marks added to all links when the email is exported; empty ones are empty strings."},"document.setUtm":{description:"Sets UTM marks that are added to all links when the email is exported; omitted marks stay, an empty string clears a mark. Returns all five marks after the change. `history.undo` does not revert them: they come back only when the user takes back the whole answer.",args:e.Arg.object({params:e.Arg.object({utm_source:n,utm_medium:n,utm_campaign:n,utm_term:n,utm_content:n})})},"document.setAnnotations":{description:"Writes Gmail annotations (promotions tab markup) into the email, replacing the existing ones. `annotationType` is `productCarousel` or `singleImagePreview` (needs `cards` with an image and an https link; a discount is given in percent in `discountPercent` and needs a numeric `price`), `dealAnnotation` (needs one of `description`, `discountCode`, dates) or `dealCard` (needs `description` and `offerPageUrl` or `merchantHomepageUrl`). Dates are ISO 8601 strings. Returns `changed: false` when the email already has exactly this markup.",args:e.Arg.object({annotationType:e.Arg.enum(...c),logo:n,description:n,discountCode:n,availabilityStarts:n,availabilityEnds:n,offerPageUrl:n,merchantHomepageUrl:n,cards:e.Arg.optional(e.Arg.array(e.Arg.object({image:n,url:n,headline:n,price:n,priceCurrency:n,discountPercent:n})))})},"document.removeAnnotations":{description:"Cuts the Gmail annotations markup out of the email in one undo step. Returns `changed: false` when there was none."},"history.restoreRevision":{description:'Goes back to an earlier saved version: replaces the email with a revision (markup, subject, preheader, styles). `history.undo` brings back the markup, and on the open canvas the subject and the preheader with it; styles stay from the revision. All of them come back for sure only when the user takes back the whole answer. Use it for "restore the previous version"; to take back the last edit of this session use `history.undo` instead. Take `revision` from `history.listRevisions`: the first row is normally the saved state of the email, so going back one version means the first row below it without `isAutosave`. Returns the restored `revision` with its `date` and `subject` when known and `unsaved: true`: the document stays unsaved until it is saved. Closed by the plan when it has no revision history.',args:e.Arg.object({revision:e.Arg.string()})},"variable.list":{description:"Lists the merge variables of this editor: `name` is the menu path shown to the user, `value` is the ready text with the delimiters of the sending service. Pass a `value` to element.insertVariable."},"element.insertVariable":{description:"Appends a merge variable (a `value` from variable.list) to the end of a text, header, button or link element in one undo step. It goes after the existing content: write the text first with element.setText, then add the variable; a space before it is part of that text. Refused for an element with a list or a table. Returns a reference to the element.",args:e.Arg.object({element:t,variable:e.Arg.string()})},"element.applyTypograf":{description:"Cleans typography of the text in one undo step: non-breaking spaces after short words and numbers, proper dashes and quotes. Without `element` it runs over the whole email; with the reference of a text element it runs over the whole cell of that text, like the button of the editor, so other text in the same cell changes too. Selects the element like a user click. Buttons, links and images are refused with that reference. Text locked by the integrator and the preheader stay as they are.",args:e.Arg.object({element:e.Arg.optional(t)})},"column.add":{description:'Adds an empty column at the end of a row (up to 8 columns) in one undo step; the other columns get narrower. Pass a row reference (kind "row") or any of its columns (kind "column" or "floatingBlock"). Returns the row reference and `columns`, the references of all its columns in order; fill the new one with element.insert and place "inside".',args:e.Arg.object({element:t})},"column.remove":{description:'Removes a column of a row together with its content in one undo step; the other columns get wider. Pass the column reference (kind "column" or "floatingBlock"). A row keeps at least one column. Refused with `readOnly` when the column or something inside it is locked by the integrator. Returns the row reference and `columns`.',args:e.Arg.object({element:t})},"column.swap":{description:'Swaps two columns of the same row in one undo step: content and width move together. Pass both column references (kind "column" or "floatingBlock"). Returns the row reference and `columns` in the new order.',args:e.Arg.object({element:t,with:t})},"accordion.addSection":{description:'Adds a section at the end of an accordion (kind "accordion", AMP emails) in one undo step, as a copy of its first section with the given plain `title` and `text` (markup characters stay text, a line break becomes a new line). Returns a fresh reference to the accordion, which is rebuilt, and `sections`, their count.',args:e.Arg.object({element:t,title:e.Arg.string(),text:e.Arg.optional(e.Arg.string())})},"accordion.removeSection":{description:"Removes a section of an accordion by its number (counted from 0) with its content in one undo step. An accordion keeps at least one section. Refused with `readOnly` when something inside the section is locked by the integrator. Returns a fresh reference to the accordion and `sections`, their count.",args:e.Arg.object({element:t,index:e.Arg.number()})},"export.download":{description:"Downloads the email in a format of the Export menu, as a click on it: the browser saves the file for the user. html — the code, zip — code with images, text — plain text, markdown, outlook — an .oft/.eml for Outlook, pdf, png — a picture. For an AMP email `variant` picks the AMP or the HTML version of code and text. The editor may first ask the user about a large code size. Returns when the export has started.",args:e.Arg.object({format:e.Arg.enum(...e.EXPORT_FORMATS),variant:e.Arg.optional(e.Arg.enum("html","amp"))})},"document.import":{description:"Replaces the whole open email with an imported one, as the Import menu item does with a chosen file: an .html, .htm, .eml or .zip by `url`, or `html` you pass with something to show: text, a picture or another visible element. Any other file and empty `html` are refused with `invalidArgs`: an extension in the address decides, whatever type the server answers with, and the type counts only for an address without one. A file without an email inside is refused with `importFailed`. Images of the file are uploaded to the project. One undo step.",args:e.Arg.object({url:e.Arg.optional(e.Arg.string()),html:e.Arg.optional(e.Arg.string())})},"send.testEmail":{description:"Sends the open email as it is now to up to 10 addresses, as the Send a test email window does. Without `subject` it goes with the subject of the email. Asks the user first and spends the test-send limit. An editor without a server has no test emails: the answer is `unavailable`.",args:e.Arg.object({recipients:e.Arg.array(e.Arg.string()),subject:e.Arg.optional(e.Arg.string())})}};l.AGENT_COMMAND_DETAILS=d});
1
+ __useblocks__.define("static/core/5da33486.js",["require","exports","module","static/core/2ff39ddf.js","static/core/a42ab03f.js","static/core/94f9492b.js"],function(o,l,m){const u=o("./2ff39ddf.js"),e=o("./a42ab03f.js"),s=o("./94f9492b.js");var a=["text","header","image","button","spacer","divider","list-ul","list-ol","video"],h=["1","2","3","4","1:2","2:1"],c=["productCarousel","singleImagePreview","dealAnnotation","dealCard"],t=e.Arg.element(),r="Pass a reference from element.getTree.",n=e.Arg.optional(e.Arg.string()),i="During your answer or a batch it is refused with `undoConflict`: the edits are not closed yet, and undo becomes available after the answer, so tell the user about it.",d={"document.getHtml":{description:'Returns the HTML of the open document. `output: "editor"` (default) is the markup the editor keeps, with its service attributes; `output: "email"` is the compiled email as recipients get it, closed by the plan when it has no HTML export.',args:e.Arg.object({output:e.Arg.optional(e.Arg.enum("editor","email"))})},"document.getText":{description:"Returns the plain-text version of the email as recipients get it, without markup. Closed by the plan when it has no HTML export."},"document.setHeaders":{description:"Sets the subject, the preheader (preview text after the subject) and the title of the email; omitted fields stay. The title follows the subject while they are equal. The plan can close the subject and the preheader, not the title. On the open canvas `history.undo` brings the subject and the preheader back together with the markup, but do not count on it: these fields come back for sure only when the user takes back the whole answer.",args:e.Arg.object({subject:e.Arg.optional(e.Arg.string()),preheader:e.Arg.optional(e.Arg.string()),title:e.Arg.optional(e.Arg.string())})},"document.getSettings":{description:"Returns the layout settings of the whole email: background, width, responsiveness."},"document.setSettings":{description:'Changes layout settings of the whole email; pass only the fields to change, in the form `document.getSettings` returns (for example `{ "backgroundColor": "#ffffff", "width": { "value": 600, "dim": "px" } }`). Other fields are refused: common styles go to `document.setContentStyles`. A background address that is executable or holds "<" or "-->" is refused with `invalidArgs`. Needs the open canvas and an email, not a block; `history.undo` reverts it as one step. `canvasPending: true` in the answer means the settings are written, but the canvas has not confirmed them yet.',args:e.Arg.object({settings:e.Arg.object({})})},"document.getContentStyles":{description:"Returns the common styles of the email content: text, headings, links, buttons, block, cards."},"document.setContentStyles":{description:'Changes the common styles of the email content; pass only the groups and fields to change, in the form `document.getContentStyles` returns (for example `{ "text": { "fontSize": 16 } }`). Another group, a group that is not an object or a font name with one of < > " { } ; \\ or a stray single quote is refused with `invalidArgs`; fields and Google fonts closed by the plan with `lockedByPlan`. `history.undo` does not revert it: it comes back only when the user takes back the whole answer.',args:e.Arg.object({styles:e.Arg.object({})})},"document.replaceHtml":{description:"Replaces the whole document with new HTML in one undo step. Prefer element commands for local changes: this one rewrites everything. Start from `document.getHtml` and keep its service attributes. `html` with no text, pictures or other visible elements is refused with `invalidArgs`. Closed when the plan has no code editing: use element commands then.",args:e.Arg.object({html:e.Arg.string()})},"history.undo":{description:`Undoes the last step of document edits. Fields of the email outside the undo history are not its job: common styles and UTM marks stay, and the subject and the preheader come back only on the open canvas, with the markup; all of them come back when the user takes back the whole answer. ${i}`},"history.redo":{description:`Redoes the last undone step of document edits. ${i}`},"history.listRevisions":{description:"Lists saved revisions of the open document, newest first, one page at a time: id, date, author, subject, title and `isAutosave`, without the content. Rows with `isAutosave: true` are automatic snapshots. Pass an id to `history.restoreRevision` to go back to that version. Closed by the plan when it has no revision history.",args:e.Arg.object({page:e.Arg.optional(e.Arg.number())})},"check.code":{description:"Checks the HTML of the open document and lists the problems: unclosed tags, wrong nesting, bad attributes."},"check.codeSize":{description:"Returns the code size of the email, as the editor's code size badge shows it; Gmail clips emails over 90 KB."},"block.list":{description:"Lists blocks that can be inserted into the email with block.insert. `source` picks where they come from: `project` (default) are the blocks saved in this project, in the look of the user: look there first. `gallery` are the shared ready-made blocks of the editor: use them when the project has nothing that fits. "+s.BLOCK_LIST_HINT,args:e.Arg.object(s.BLOCK_LIST_ARGS)},"check.links":{description:"Checks every link of the open email as it is now over the network and lists them with a status (valid, warnings, errors) and the HTTP code. A new email must be saved first. Paid: each call uses the plan limit."},"check.images":{description:"Checks every image of the open email as it is now over the network and lists them with a status, the HTTP code, size in kilobytes and dimensions. A new email must be saved first. Paid: each call uses the plan limit."},"check.spam":{description:"Scores the open email as it is now with SpamAssassin and lists the rules that matched, lowest weight first; a higher score means more likely spam. A new email must be saved first. Paid: each call uses the plan limit. An editor without a server has no spam check: the answer is `unavailable`."},"element.getTree":{description:"Returns the elements of the open document as a tree: each node has a reference, a kind (row, column, cell, text, image, button, link, spacer, ...) and the start of its text. Use the references in other element commands. References die when the element is deleted, the host rewrites it (undo, code editor) or the document changes; read the tree again then. `truncated: true` means part of the tree is cut: read it with `root` and a larger `depth`.",args:e.Arg.object({root:e.Arg.optional(t),depth:e.Arg.optional(e.Arg.number())})},"element.find":{description:"Finds elements in the whole document (or inside `inside`) without selecting them. All given conditions must match: `kind` (image, button, link, text, row, ...), `textContains`, and `where` on image src and alt or link href: an empty string matches a missing or empty value, other strings match by case-insensitive substring. Returns references with kind, text start and src/alt/href, at most `limit` (50 by default, up to 200), and `total`. To change many found elements in one call, pass element.setProps calls to agent.batch.",args:e.Arg.object({kind:e.Arg.optional(e.Arg.string()),textContains:e.Arg.optional(e.Arg.string()),where:e.Arg.optional(e.Arg.object({alt:e.Arg.optional(e.Arg.string()),src:e.Arg.optional(e.Arg.string()),href:e.Arg.optional(e.Arg.string())})),inside:e.Arg.optional(t),limit:e.Arg.optional(e.Arg.number())})},"text.replace":{description:'Replaces every occurrence of a phrase in the visible text of the document (or inside `inside`) in one undo step; links, image addresses, variables and code are not touched, and neither are the subject, preheader and image alt. Finds whole words by default, in any alphabet: "cat" does not touch "concat", even when part of it is bold; pass `wholeWord: false` to match inside words. Case-insensitive unless `matchCase`. A phrase split by formatting (part of it bold) is not found. Returns `replaced`, the number of replacements, and up to 5 `examples` of `{ before, after }` with some text around.',args:e.Arg.object({find:e.Arg.string(),replace:e.Arg.string(),matchCase:e.Arg.optional(e.Arg.boolean()),wholeWord:e.Arg.optional(e.Arg.boolean()),inside:e.Arg.optional(t)})},"element.get":{description:`Selects the element like a user click and returns what the inspector shows: kind, caption and settings. element.setProps takes the same setting names. ${r}`,args:e.Arg.object({element:t})},"element.select":{description:`Selects the element like a user click: the inspector opens its settings. ${r}`,args:e.Arg.object({element:t})},"ui.highlight":{description:"Outlines the element on the canvas for a while (1.5 s by default, up to 10 s) to show the user what you mean. Neither selects nor changes anything.",args:e.Arg.object({element:t,durationMs:e.Arg.optional(e.Arg.number())})},"element.setProps":{description:'Changes inspector settings of the element in one undo step: link, image source and alt, sizes, paddings, colors, fonts, visibility. Pass only the fields you change, named as element.get returns them; do not send back an address already in the email that holds a template directive: "<" in it is refused. Returns a fresh reference: the element may be rebuilt. `unchanged: true` in the answer means the document did not change: check the setting names with element.get; the value may also be the same already. A field or a new Google font closed by the plan is refused with `lockedByPlan`. An address that is executable or holds "<" or "-->", a font that is not a string or an array of strings and a font name with one of < > " { } ; \\ or a stray single quote are refused with `invalidArgs`.',args:e.Arg.object({element:t,props:e.Arg.object({})})},"element.setText":{description:"Replaces the whole text of a text, header, button or link element in one undo step, keeping its look (font, color, bold header). Plain text only: markup characters stay text, a line break becomes a new line. A cell with one text element inside takes its text too. Refused for text with a list, a picture or a variable: use text.replace. The preheader is refused with `readOnly`: it goes through document.setHeaders.",args:e.Arg.object({element:t,text:e.Arg.string()})},"row.insert":{description:'Inserts an empty row of the palette with columns before or after a row, or at the end of the document without `at`, in one undo step: "1" one column, "2" two equal, "1:2" narrow and wide, "2:1" wide and narrow, "3", "4". Returns the row and its column references; fill the columns with element.insert and place "inside". Prefer a saved block of the project (block.list, block.insert) when one fits.',args:e.Arg.object({columns:e.Arg.enum(...h),at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"document.getMarkupRules":{description:'Returns the markup rules of email rows (em="block" rows, layout tables, columns, em="atom" atoms, buttons, mobile classes). Read them once before writing rows for row.insertHtml.'},"row.insertHtml":{description:'Inserts rows you wrote in the editor markup (document.getMarkupRules): an optional <link em-class="em-font-..."> of a font on https: and <style em="styles">, then one or more <tr em="block">. Without `at` the rows go after the last row, in the given order, in one undo step. Rows are checked first: `invalidMarkup` lists the broken rules, nothing is inserted; fix and send again. Scripts, other style sheets, event handlers and executable addresses, also inside conditional comments and CSS, are cut. An <em-replace> variable is refused with `lockedByPlan` when the plan has no variables; one with "<" or ">" in `text` is a broken rule: add it with element.insertVariable. A .preheader node is refused with `lockedByPlan` when the plan closes the preheader. Returns the references of the new rows. If the open email changes meanwhile, the answer is `unavailable`. If a row after the first fails, the answer is `partialInsert`: its message names the rows that went in and the reason, the rows stay in the document as one undo step. Prefer a saved block of the project (block.list) when one fits.',args:e.Arg.object({html:e.Arg.string(),at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"element.insert":{description:`Inserts a new element of the palette (${a.join(", ")}) before or after an element, or at the end inside a row or a column, in one undo step. Returns the reference of the new element; change it with element.setProps.`,args:e.Arg.object({kind:e.Arg.enum(...a),at:e.Arg.object({element:t,place:e.Arg.enum("before","after","inside")})})},"block.insert":{description:"Inserts a block (an id from block.list, with the same `source`: `project` by default, `gallery` for a shared block) before or after a row, in one undo step; without `at` the block goes where a click on the block panel puts it. A gallery block keeps its own colors and fonts: it is not recolored to the common styles of the email. A block with a .preheader node is refused with `lockedByPlan` when the plan closes the preheader. `unavailable` means the open email changed meanwhile. Returns the reference of the new row.",args:e.Arg.object({block:e.Arg.string(),source:s.BLOCK_SOURCE_ARG,at:e.Arg.optional(e.Arg.object({element:t,place:e.Arg.enum("before","after")}))})},"element.delete":{description:`Deletes the element or the row in one undo step. Refused with \`readOnly\` when the element or something inside it is locked by the integrator, and for the preheader or a row with it: it goes through document.setHeaders. ${r}`,args:e.Arg.object({element:t})},"element.clone":{description:"Duplicates the element or the row right after it in one undo step and returns the reference of the copy.",args:e.Arg.object({element:t})},"element.move":{description:"Moves the row one place up or down in one undo step; `cannotMove` when it is already first or last.",args:e.Arg.object({element:t,direction:e.Arg.enum("up","down")})},"agent.batch":{description:'Runs up to 100 tool calls in order in one request, with all their edits in one undo step, for example element.setProps for each element found by element.find, each with its own props. Each call is checked as if called alone. Before the first call the user is asked once about all calls that need consent: if the user declines, no call runs and the answer is `declined`; a yes covers the whole batch. A call refused by a check before that window comes back in `failed` with `completed: 0`, nothing run. After that the batch stops at the first failed call: the answer is still a success, `failed` names the call and the calls before it stay done, so check `failed`. Returns the result of each finished call. To use a result in a later call of the same batch, pass `{ "$result": "0.element" }` as the value: the number of the call, then an own field of its result. A call that needs consent cannot take such a reference, because the window has to show the data: the batch is refused with `invalidArgs` in `failed`, nothing run; run the earlier calls first and write the value out in a separate batch. Tools of ui.* wait for the user and are not allowed in a batch, except ui.highlight.',args:e.Arg.object({calls:e.Arg.array(e.Arg.object({tool:e.Arg.string(),args:e.Arg.optional(e.Arg.object({}))}))})},"image.search":{description:"Searches free stock photos by keywords (the Stock tab of the image window) and returns up to 10 of them with an id, a description, the author and the size. There are no URLs: pass the chosen id to `image.pick`. An editor without a server has no stock photos: the answer is `unavailable`.",args:e.Arg.object({keywords:e.Arg.string(),orientation:e.Arg.optional(e.Arg.enum("landscape","portrait","squarish")),page:e.Arg.optional(e.Arg.number())})},"image.pick":{description:"Takes a photo found by `image.search` and returns its `url` for an image element. Reports the use to the photo service, as the image window does. Closed by the plan like `image.search`.",args:e.Arg.object({id:e.Arg.string()})},"file.upload":{description:"Downloads an image (JPG, PNG, WEBP, GIF or SVG) from a URL and stores it in the project storage the way the image window does; returns the stored image `url`. Use it for images that are not yet in the project storage.",args:e.Arg.object({url:e.Arg.string()})},"gallery.listTemplates":{description:"Lists the email templates of the gallery, one page at a time (page 1 by default; an empty list means no more pages). Use an id with document.applyTemplate. Not available in the plugin.",args:e.Arg.object({page:e.Arg.optional(e.Arg.number())})},"document.applyTemplate":{description:"Replaces the whole content of the open email with a gallery template (an id from gallery.listTemplates) in one undo step. Only the markup is taken: subject, preheader and common styles of the email stay. Not available in the plugin or for a block.",args:e.Arg.object({template:e.Arg.string()})},"project.getStyles":{description:"Returns the brand styles of the project: palette colors, fonts and social links. Use them for colors and fonts of new content. Not available in the plugin."},"document.getUtm":{description:"Returns the UTM marks added to all links when the email is exported; empty ones are empty strings."},"document.setUtm":{description:"Sets UTM marks that are added to all links when the email is exported; omitted marks stay, an empty string clears a mark. Returns all five marks after the change. `history.undo` does not revert them: they come back only when the user takes back the whole answer.",args:e.Arg.object({params:e.Arg.object({utm_source:n,utm_medium:n,utm_campaign:n,utm_term:n,utm_content:n})})},"document.setAnnotations":{description:"Writes Gmail annotations (promotions tab markup) into the email, replacing the existing ones. `annotationType` is `productCarousel` or `singleImagePreview` (needs `cards` with an image and an https link; a discount is given in percent in `discountPercent` and needs a numeric `price`), `dealAnnotation` (needs one of `description`, `discountCode`, dates) or `dealCard` (needs `description` and `offerPageUrl` or `merchantHomepageUrl`). Dates are ISO 8601 strings. Returns `changed: false` when the email already has exactly this markup.",args:e.Arg.object({annotationType:e.Arg.enum(...c),logo:n,description:n,discountCode:n,availabilityStarts:n,availabilityEnds:n,offerPageUrl:n,merchantHomepageUrl:n,cards:e.Arg.optional(e.Arg.array(e.Arg.object({image:n,url:n,headline:n,price:n,priceCurrency:n,discountPercent:n})))})},"document.removeAnnotations":{description:"Cuts the Gmail annotations markup out of the email in one undo step. Returns `changed: false` when there was none."},"history.restoreRevision":{description:'Goes back to an earlier saved version: replaces the email with a revision (markup, subject, preheader, styles). `history.undo` brings back the markup, and on the open canvas the subject and the preheader with it; styles stay from the revision. All of them come back for sure only when the user takes back the whole answer. Use it for "restore the previous version"; to take back the last edit of this session use `history.undo` instead. Take `revision` from `history.listRevisions`: the first row is normally the saved state of the email, so going back one version means the first row below it without `isAutosave`. Returns the restored `revision` with its `date` and `subject` when known and `unsaved: true`: the document stays unsaved until it is saved. Closed by the plan when it has no revision history.',args:e.Arg.object({revision:e.Arg.string()})},"variable.list":{description:"Lists the merge variables of this editor: `name` is the menu path shown to the user, `value` is the ready text with the delimiters of the sending service. Pass a `value` to element.insertVariable."},"element.insertVariable":{description:"Appends a merge variable (a `value` from variable.list) to the end of a text, header, button or link element in one undo step. It goes after the existing content: write the text first with element.setText, then add the variable; a space before it is part of that text. Refused for an element with a list or a table. Returns a reference to the element.",args:e.Arg.object({element:t,variable:e.Arg.string()})},"element.applyTypograf":{description:"Cleans typography of the text in one undo step: non-breaking spaces after short words and numbers, proper dashes and quotes. Without `element` it runs over the whole email; with the reference of a text element it runs over the whole cell of that text, like the button of the editor, so other text in the same cell changes too. Selects the element like a user click. Buttons, links and images are refused with that reference. Text locked by the integrator and the preheader stay as they are.",args:e.Arg.object({element:e.Arg.optional(t)})},"column.add":{description:'Adds an empty column at the end of a row (up to 8 columns) in one undo step; the other columns get narrower. Pass a row reference (kind "row") or any of its columns (kind "column" or "floatingBlock"). Returns the row reference and `columns`, the references of all its columns in order; fill the new one with element.insert and place "inside".',args:e.Arg.object({element:t})},"column.remove":{description:'Removes a column of a row together with its content in one undo step; the other columns get wider. Pass the column reference (kind "column" or "floatingBlock"). A row keeps at least one column. Refused with `readOnly` when the column or something inside it is locked by the integrator. Returns the row reference and `columns`.',args:e.Arg.object({element:t})},"column.swap":{description:'Swaps two columns of the same row in one undo step: content and width move together. Pass both column references (kind "column" or "floatingBlock"). Returns the row reference and `columns` in the new order.',args:e.Arg.object({element:t,with:t})},"accordion.addSection":{description:'Adds a section at the end of an accordion (kind "accordion", AMP emails) in one undo step, as a copy of its first section with the given plain `title` and `text` (markup characters stay text, a line break becomes a new line). Returns a fresh reference to the accordion, which is rebuilt, and `sections`, their count.',args:e.Arg.object({element:t,title:e.Arg.string(),text:e.Arg.optional(e.Arg.string())})},"accordion.removeSection":{description:"Removes a section of an accordion by its number (counted from 0) with its content in one undo step. An accordion keeps at least one section. Refused with `readOnly` when something inside the section is locked by the integrator. Returns a fresh reference to the accordion and `sections`, their count.",args:e.Arg.object({element:t,index:e.Arg.number()})},"export.download":{description:"Downloads the email in a format of the Export menu, as a click on it: the browser saves the file for the user. html — the code, zip — code with images, text — plain text, markdown, outlook — an .oft/.eml for Outlook, pdf, png — a picture. For an AMP email `variant` picks the AMP or the HTML version of code and text. The editor may first ask the user about a large code size. Returns when the export has started.",args:e.Arg.object({format:e.Arg.enum(...e.EXPORT_FORMATS),variant:e.Arg.optional(e.Arg.enum("html","amp"))})},"document.import":{description:"Replaces the whole open email with an imported one, as the Import menu item does with a chosen file: an .html, .htm, .eml or .zip by `url`, or `html` you pass with something to show: text, a picture or another visible element. Any other file and empty `html` are refused with `invalidArgs`: an extension in the address decides, whatever type the server answers with, and the type counts only for an address without one. A file without an email inside is refused with `importFailed`. Images of the file are uploaded to the project. One undo step.",args:e.Arg.object({url:e.Arg.optional(e.Arg.string()),html:e.Arg.optional(e.Arg.string())})},"send.testEmail":{description:"Sends the open email as it is now to up to 10 addresses, as the Send a test email window does. Without `subject` it goes with the subject of the email. Asks the user first and spends the test-send limit. An editor without a server has no test emails: the answer is `unavailable`.",args:e.Arg.object({recipients:e.Arg.array(e.Arg.string()),subject:e.Arg.optional(e.Arg.string())})}};l.AGENT_COMMAND_DETAILS=d});
@@ -7,4 +7,4 @@ Minimum version required to store current data is: `+h+`.
7
7
  `);let d=I(y,A,N),p=new t(s.getSymbolSize(y));return v(p,y),T(p),x(p,y),M(p,A,0),y>=7&&C(p,y),B(p,d),isNaN(f)&&(f=n.getBestMask(p,M.bind(null,p,A))),n.applyMask(f,p),M(p,A,f),{modules:p,version:y,errorCorrectionLevel:A,maskPattern:f,segments:N}}o.create=function(g,y){if(g===void 0||g==="")throw Error("No input text");let A=a.M,f,N;return y!==void 0&&(A=a.from(y.errorCorrectionLevel,a.M),f=E.from(y.version),N=n.from(y.maskPattern),y.toSJISFunc&&s.setToSJISFunction(y.toSJISFunc)),R(g,f,A,N)}})),$=P.s((o=>{function s(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw Error("Color should be defined as hex string");let r=a.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw Error("Invalid hex color: "+a);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(e){return[e,e]}))),r.length===6&&r.push("F","F");let t=parseInt(r.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+r.slice(0,6).join("")}}o.getOptions=function(a){a||={},a.color||(a.color={});let r=a.margin===void 0||a.margin===null||a.margin<0?4:a.margin,t=a.width&&a.width>=21?a.width:void 0,e=a.scale||4;return{width:t,scale:t?4:e,margin:r,color:{dark:s(a.color.dark||"#000000ff"),light:s(a.color.light||"#ffffffff")},type:a.type,rendererOpts:a.rendererOpts||{}}},o.getScale=function(a,r){return r.width&&r.width>=a+r.margin*2?r.width/(a+r.margin*2):r.scale},o.getImageWidth=function(a,r){let t=o.getScale(a,r);return Math.floor((a+r.margin*2)*t)},o.qrToImageData=function(a,r,t){let e=r.modules.size,i=r.modules.data,n=o.getScale(e,t),u=Math.floor((e+t.margin*2)*n),c=t.margin*n,E=[t.color.light,t.color.dark];for(let w=0;w<u;w++)for(let l=0;l<u;l++){let m=(w*u+l)*4,v=t.color.light;if(w>=c&&l>=c&&w<u-c&&l<u-c){let T=Math.floor((w-c)/n),x=Math.floor((l-c)/n);v=E[+!!i[T*e+x]]}a[m++]=v.r,a[m++]=v.g,a[m++]=v.b,a[m]=v.a}}})),Et=P.s((o=>{var s=$();function a(t,e,i){t.clearRect(0,0,e.width,e.height),e.style||={},e.height=i,e.width=i,e.style.height=i+"px",e.style.width=i+"px"}function r(){try{return document.createElement("canvas")}catch{throw Error("You need to specify a canvas element")}}o.render=function(t,e,i){let n=i,u=e;n===void 0&&(!e||!e.getContext)&&(n=e,e=void 0),e||(u=r()),n=s.getOptions(n);let c=s.getImageWidth(t.modules.size,n),E=u.getContext("2d"),w=E.createImageData(c,c);return s.qrToImageData(w.data,t,n),a(E,u,c),E.putImageData(w,0,0),u},o.renderToDataURL=function(t,e,i){let n=i;n===void 0&&(!e||!e.getContext)&&(n=e,e=void 0),n||={};let u=o.render(t,e,n),c=n.type||"image/png",E=n.rendererOpts||{};return u.toDataURL(c,E.quality)}})),wt=P.s((o=>{var s=$();function a(e,i){let n=e.a/255,u=i+'="'+e.hex+'"';return n<1?u+" "+i+'-opacity="'+n.toFixed(2).slice(1)+'"':u}function r(e,i,n){let u=e+i;return n!==void 0&&(u+=" "+n),u}function t(e,i,n){let u="",c=0,E=!1,w=0;for(let l=0;l<e.length;l++){let m=Math.floor(l%i),v=Math.floor(l/i);!m&&!E&&(E=!0),e[l]?(w++,l>0&&m>0&&e[l-1]||(u+=E?r("M",m+n,.5+v+n):r("m",c,0),c=0,E=!1),m+1<i&&e[l+1]||(u+=r("h",w),w=0)):c++}return u}o.render=function(e,i,n){let u=s.getOptions(i),c=e.modules.size,E=e.modules.data,w=c+u.margin*2,l=u.color.light.a?"<path "+a(u.color.light,"fill")+' d="M0 0h'+w+"v"+w+'H0z"/>':"",m="<path "+a(u.color.dark,"stroke")+' d="'+t(E,c,u.margin)+'"/>',v='viewBox="0 0 '+w+" "+w+'"',T='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+v+' shape-rendering="crispEdges">'+l+m+`</svg>
8
8
  `;return typeof n=="function"&&n(null,T),T}})),yt=P.s((o=>{var s=tt(),a=vt(),r=Et(),t=wt();function e(i,n,u,c,E){let w=[].slice.call(arguments,1),l=w.length,m=typeof w[l-1]=="function";if(!m&&!s())throw Error("Callback required as last argument");if(m){if(l<2)throw Error("Too few arguments provided");l===2?(E=u,u=n,n=c=void 0):l===3&&(n.getContext&&E===void 0?(E=c,c=void 0):(E=c,c=u,u=n,n=void 0))}else{if(l<1)throw Error("Too few arguments provided");return l===1?(u=n,n=c=void 0):l===2&&!n.getContext&&(c=u,u=n,n=void 0),new Promise(function(v,T){try{v(i(a.create(u,c),n,c))}catch(x){T(x)}})}try{let v=a.create(u,c);E(null,i(v,n,c))}catch(v){E(v)}}o.create=a.create,o.toCanvas=e.bind(null,r.render),o.toDataURL=e.bind(null,r.renderToDataURL),o.toString=e.bind(null,function(i,n,u){return t.render(i,u)})})),At=yt();W.default=At});
9
9
 
10
- __useblocks__.define("static/core/752288e6.js",["require","exports","module","static/core/2ff39ddf.js","static/core/37bf0f7a.js","static/core/ff7d14e8.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper"],function(m,Z,ve){const G=m("./2ff39ddf.js"),P=m("./37bf0f7a.js"),y=m("./ff7d14e8.js");let o=m("react"),F=G.__toESM(o,1);o=G.__toESM(o);let r=m("react/jsx-runtime"),c=m("__delivery__/libs"),N=m("vite/preload-helper");var S=({size:C=24,color:R="currentColor",...s})=>F.createElement("svg",{viewBox:"0 0 24 24",width:C,height:C,stroke:R,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},F.createElement("path",{d:"m14 10 7-7m0 0h-6m6 0v6m-11 5-7 7m0 0h6m-6 0v-6"}));S.displayName="Expand01";var O=P.or(),t={"em-filemanager":"em-filemanager",emFilemanager:"em-filemanager",root:"root",controls:"controls",segmentedControl:"segmentedControl",sizeRow:"sizeRow",sizeRowLabel:"sizeRowLabel",sizeInputNumber:"sizeInputNumber",sizeSuffix:"sizeSuffix",colorGrid:"colorGrid",colorCell:"colorCell",colorCellLabel:"colorCellLabel",colorPickerFull:"colorPickerFull",bgExtras:"bgExtras",bgWarning:"bgWarning",previewSection:"previewSection",previewTitle:"previewTitle",previewWrap:"previewWrap",scanLine:"scanLine",scanLineBarcode:"scanLineBarcode",previewWrapBarcode:"previewWrapBarcode",previewCanvas:"previewCanvas",previewCanvasBarcode:"previewCanvasBarcode",actions:"actions"},z=80,D=600,ee=200,E=24,q=130,ae=60,re=280,te=72;function oe(){return typeof window>"u"?2:Math.min(3,Math.max(2,window.devicePixelRatio||2))}var le=({customRequest:C,state:R,setState:s})=>{let{t:l}=P.Rn(),{options:ie}=P.V(),Q=ie?.config?.iconStrokeWidth??1.75,V=(0,o.useRef)(null),{mode:d,rawText:x,foregroundHex:p,backgroundHex:f,transparentBackground:g,qrSidePx:j,barcodeBarHeightPx:k}=R,ne=(0,o.useCallback)(e=>s(a=>({...a,mode:e})),[s]),se=(0,o.useCallback)(e=>s(a=>({...a,rawText:e})),[s]),ce=(0,o.useCallback)(e=>s(a=>({...a,foregroundHex:e})),[s]),de=(0,o.useCallback)(e=>s(a=>({...a,backgroundHex:e})),[s]),he=(0,o.useCallback)(e=>s(a=>({...a,transparentBackground:e})),[s]),ue=(0,o.useCallback)(e=>s(a=>({...a,qrSidePx:e})),[s]),me=(0,o.useCallback)(e=>s(a=>({...a,barcodeBarHeightPx:e})),[s]),[T,xe]=(0,o.useState)(x),[$,b]=(0,o.useState)(null),[L,U]=(0,o.useState)(!1),_=(0,o.useMemo)(()=>(0,O.debounce)(e=>xe(e),300),[]);(0,o.useEffect)(()=>(_(x),()=>{_.cancel()}),[x,_]);let M=g?"#00000000":f,J=(0,o.useCallback)(async(e,a)=>{let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./8daf15a4.js")).then(i=>y.l(i.default)),void 0,{}.url)).default,h=a.trim(),u=Math.min(re,Math.max(z,j));if(!h){e.width=u,e.height=u;let i=e.getContext("2d");i&&i.clearRect(0,0,e.width,e.height);return}e.width=u,e.height=u,await n.toCanvas(e,h,{width:u,margin:2,color:{dark:p,light:M}})},[p,M,j]),K=(0,o.useCallback)(async(e,a)=>{let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./a6303cb2.js")).then(v=>y.l(v.default)),void 0,{}.url)).default,h=a.trim(),u=g?"rgba(0,0,0,0)":f,i=Math.min(te,Math.max(E,k)),W=Math.max(1,Math.round(i/42)),H=Math.max(4,Math.round(i*.07)),I=Math.max(10,Math.round(i*.15));if(!h){e.width=Math.round(i*4),e.height=Math.round(i*1.65);let v=e.getContext("2d");v&&v.clearRect(0,0,e.width,e.height);return}e.width=Math.round(i*4.2),e.height=Math.round(i*1.65),n(e,h,{format:"CODE128",displayValue:!0,background:u,lineColor:p,margin:H,width:W,height:i,fontSize:I})},[p,f,g,k]);(0,o.useEffect)(()=>{let e=V.current;if(!e)return;let a=!1;return(async()=>{try{d==="qr"?await J(e,T):await K(e,T),a||b(null)}catch(n){let h=n instanceof Error?n.message:String(n);if(!a){b(d==="barcode"?l("Barcode generation failed"):h);let u=e.getContext("2d");u&&u.clearRect(0,0,e.width,e.height)}}})(),()=>{a=!0}},[d,T,K,J,l]);let X=(0,o.useCallback)(async()=>{_.flush();let e=x.trim();if(!e)throw Error(l("Enter text or URL to preview"));let a=oe();if(d==="qr"){let w=Math.round(Math.min(D,Math.max(z,j))*a),B=document.createElement("canvas");B.width=w,B.height=w,await(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./8daf15a4.js")).then(A=>y.l(A.default)),void 0,{}.url)).default.toCanvas(B,e,{width:w,margin:2,color:{dark:p,light:M}});let Y=await new Promise(A=>B.toBlob(A,"image/png"));if(!Y)throw Error("PNG export failed");return Y}let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./a6303cb2.js")).then(w=>y.l(w.default)),void 0,{}.url)).default,h=document.createElement("canvas"),u=g?"rgba(0,0,0,0)":f,i=Math.min(q,Math.max(E,k)),W=Math.max(6,Math.round(i*.1)),H=Math.max(2,Math.round(i/36)),I=Math.max(12,Math.round(i*.16));n(h,e,{format:"CODE128",displayValue:!0,background:u,lineColor:p,margin:Math.round(W*a),width:Math.round(H*a),height:Math.round(i*a),fontSize:Math.round(I*a)});let v=await new Promise(w=>h.toBlob(w,"image/png"));if(!v)throw Error("PNG export failed");return v},[d,x,p,M,f,g,j,k,_,l]),pe=(0,o.useCallback)(async()=>{if(!L&&x.trim()){U(!0);try{let e;try{e=await X()}catch(n){let h=n instanceof Error?n.message:String(n);b(h);return}let a=new File([e],`${d==="qr"?"qr-code":"barcode"}-${Date.now()}.png`,{type:"image/png",lastModified:Date.now()});await Promise.resolve(C({file:a}))}finally{U(!1)}}},[C,X,d,x,L]),ge=!!x.trim()&&!$;return(0,r.jsx)("div",{className:t.root,children:(0,r.jsxs)("div",{className:t.controls,children:[(0,r.jsx)(c.antd$Segmented,{block:!0,className:t.segmentedControl,value:d,onChange:e=>{ne(e),b(null)},options:[{label:l("QR code"),value:"qr"},{label:l("Barcode"),value:"barcode"}]}),$&&(0,r.jsx)(c.antd$Alert,{type:"error",title:l("Validation error"),description:$,showIcon:!0,closable:!0,onClose:()=>b(null)}),(0,r.jsx)(c.antd$Input.TextArea,{value:x,onChange:e=>{se(e.target.value),b(null)},placeholder:l("Text or URL"),rows:3,spellCheck:!1,autoComplete:"off"}),(0,r.jsxs)("div",{className:t.sizeRow,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.sizeRowLabel,children:l(d==="qr"?"QR image size px":"Barcode bar height px")}),d==="qr"?(0,r.jsx)(c.antd$InputNumber,{className:t.sizeInputNumber,min:z,max:D,step:8,value:j,onChange:e=>ue(typeof e=="number"&&!Number.isNaN(e)?e:ee),prefix:(0,r.jsx)(S,{size:18,strokeWidth:Q}),suffix:(0,r.jsx)("span",{className:t.sizeSuffix,children:"px"}),"aria-label":l("QR image size px")}):(0,r.jsx)(c.antd$InputNumber,{className:t.sizeInputNumber,min:E,max:q,step:4,value:k,onChange:e=>me(typeof e=="number"&&!Number.isNaN(e)?e:ae),prefix:(0,r.jsx)(S,{size:18,strokeWidth:Q}),suffix:(0,r.jsx)("span",{className:t.sizeSuffix,children:"px"}),"aria-label":l("Barcode bar height px")})]}),(0,r.jsxs)("div",{className:t.colorGrid,children:[(0,r.jsxs)("div",{className:t.colorCell,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.colorCellLabel,children:l("Code color","Code color")}),(0,r.jsx)(c.antd$ColorPicker,{className:t.colorPickerFull,value:p,format:"hex",disabledAlpha:!0,showText:!0,onChange:(e,a)=>{let n=typeof e=="string"?e:e?.toHexString?e.toHexString():a;ce(n)}})]}),(0,r.jsxs)("div",{className:t.colorCell,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.colorCellLabel,children:l("Background color","Background color")}),(0,r.jsx)(c.antd$ColorPicker,{className:t.colorPickerFull,value:f,format:"hex",disabledAlpha:!0,showText:!0,disabled:g,onChange:(e,a)=>{let n=typeof e=="string"?e:e?.toHexString?e.toHexString():a;de(n)}})]}),(0,r.jsxs)("div",{className:t.bgExtras,children:[(0,r.jsx)(c.antd$Checkbox,{checked:g,onChange:e=>he(e.target.checked),children:l("Transparent background","Transparent background")}),g&&(0,r.jsx)(c.antd$Alert,{type:"warning",showIcon:!0,title:l("QR transparent background hint"),className:t.bgWarning})]})]}),(0,r.jsxs)("div",{className:t.previewSection,children:[(0,r.jsx)(c.antd$Typography.Text,{className:t.previewTitle,children:l("Preview","Preview")}),(0,r.jsxs)("div",{className:[t.previewWrap,d==="barcode"&&t.previewWrapBarcode].filter(Boolean).join(" "),children:[(0,r.jsx)("div",{className:[t.scanLine,d==="barcode"&&t.scanLineBarcode].filter(Boolean).join(" ")}),(0,r.jsx)("canvas",{ref:V,className:[t.previewCanvas,d==="barcode"&&t.previewCanvasBarcode].filter(Boolean).join(" "),"aria-label":l("Preview")})]})]}),(0,r.jsx)("div",{className:t.actions,children:(0,r.jsx)(c.antd$Button,{type:"primary",onClick:()=>{pe()},loading:L,disabled:!ge,children:l("Add to My files")})})]})})};Z.default=le});
10
+ __useblocks__.define("static/core/6172f09a.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b9f553d7.js","static/core/ff7d14e8.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper"],function(m,Z,ve){const G=m("./2ff39ddf.js"),P=m("./b9f553d7.js"),y=m("./ff7d14e8.js");let o=m("react"),F=G.__toESM(o,1);o=G.__toESM(o);let r=m("react/jsx-runtime"),c=m("__delivery__/libs"),N=m("vite/preload-helper");var S=({size:C=24,color:R="currentColor",...s})=>F.createElement("svg",{viewBox:"0 0 24 24",width:C,height:C,stroke:R,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},F.createElement("path",{d:"m14 10 7-7m0 0h-6m6 0v6m-11 5-7 7m0 0h6m-6 0v-6"}));S.displayName="Expand01";var O=P.or(),t={"em-filemanager":"em-filemanager",emFilemanager:"em-filemanager",root:"root",controls:"controls",segmentedControl:"segmentedControl",sizeRow:"sizeRow",sizeRowLabel:"sizeRowLabel",sizeInputNumber:"sizeInputNumber",sizeSuffix:"sizeSuffix",colorGrid:"colorGrid",colorCell:"colorCell",colorCellLabel:"colorCellLabel",colorPickerFull:"colorPickerFull",bgExtras:"bgExtras",bgWarning:"bgWarning",previewSection:"previewSection",previewTitle:"previewTitle",previewWrap:"previewWrap",scanLine:"scanLine",scanLineBarcode:"scanLineBarcode",previewWrapBarcode:"previewWrapBarcode",previewCanvas:"previewCanvas",previewCanvasBarcode:"previewCanvasBarcode",actions:"actions"},z=80,D=600,ee=200,E=24,q=130,ae=60,re=280,te=72;function oe(){return typeof window>"u"?2:Math.min(3,Math.max(2,window.devicePixelRatio||2))}var le=({customRequest:C,state:R,setState:s})=>{let{t:l}=P.Rn(),{options:ie}=P.V(),Q=ie?.config?.iconStrokeWidth??1.75,V=(0,o.useRef)(null),{mode:d,rawText:x,foregroundHex:p,backgroundHex:f,transparentBackground:g,qrSidePx:j,barcodeBarHeightPx:k}=R,ne=(0,o.useCallback)(e=>s(a=>({...a,mode:e})),[s]),se=(0,o.useCallback)(e=>s(a=>({...a,rawText:e})),[s]),ce=(0,o.useCallback)(e=>s(a=>({...a,foregroundHex:e})),[s]),de=(0,o.useCallback)(e=>s(a=>({...a,backgroundHex:e})),[s]),he=(0,o.useCallback)(e=>s(a=>({...a,transparentBackground:e})),[s]),ue=(0,o.useCallback)(e=>s(a=>({...a,qrSidePx:e})),[s]),me=(0,o.useCallback)(e=>s(a=>({...a,barcodeBarHeightPx:e})),[s]),[T,xe]=(0,o.useState)(x),[$,b]=(0,o.useState)(null),[L,U]=(0,o.useState)(!1),_=(0,o.useMemo)(()=>(0,O.debounce)(e=>xe(e),300),[]);(0,o.useEffect)(()=>(_(x),()=>{_.cancel()}),[x,_]);let M=g?"#00000000":f,J=(0,o.useCallback)(async(e,a)=>{let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./8daf15a4.js")).then(i=>y.l(i.default)),void 0,{}.url)).default,h=a.trim(),u=Math.min(re,Math.max(z,j));if(!h){e.width=u,e.height=u;let i=e.getContext("2d");i&&i.clearRect(0,0,e.width,e.height);return}e.width=u,e.height=u,await n.toCanvas(e,h,{width:u,margin:2,color:{dark:p,light:M}})},[p,M,j]),K=(0,o.useCallback)(async(e,a)=>{let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./a6303cb2.js")).then(v=>y.l(v.default)),void 0,{}.url)).default,h=a.trim(),u=g?"rgba(0,0,0,0)":f,i=Math.min(te,Math.max(E,k)),W=Math.max(1,Math.round(i/42)),H=Math.max(4,Math.round(i*.07)),I=Math.max(10,Math.round(i*.15));if(!h){e.width=Math.round(i*4),e.height=Math.round(i*1.65);let v=e.getContext("2d");v&&v.clearRect(0,0,e.width,e.height);return}e.width=Math.round(i*4.2),e.height=Math.round(i*1.65),n(e,h,{format:"CODE128",displayValue:!0,background:u,lineColor:p,margin:H,width:W,height:i,fontSize:I})},[p,f,g,k]);(0,o.useEffect)(()=>{let e=V.current;if(!e)return;let a=!1;return(async()=>{try{d==="qr"?await J(e,T):await K(e,T),a||b(null)}catch(n){let h=n instanceof Error?n.message:String(n);if(!a){b(d==="barcode"?l("Barcode generation failed"):h);let u=e.getContext("2d");u&&u.clearRect(0,0,e.width,e.height)}}})(),()=>{a=!0}},[d,T,K,J,l]);let X=(0,o.useCallback)(async()=>{_.flush();let e=x.trim();if(!e)throw Error(l("Enter text or URL to preview"));let a=oe();if(d==="qr"){let w=Math.round(Math.min(D,Math.max(z,j))*a),B=document.createElement("canvas");B.width=w,B.height=w,await(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./8daf15a4.js")).then(A=>y.l(A.default)),void 0,{}.url)).default.toCanvas(B,e,{width:w,margin:2,color:{dark:p,light:M}});let Y=await new Promise(A=>B.toBlob(A,"image/png"));if(!Y)throw Error("PNG export failed");return Y}let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./a6303cb2.js")).then(w=>y.l(w.default)),void 0,{}.url)).default,h=document.createElement("canvas"),u=g?"rgba(0,0,0,0)":f,i=Math.min(q,Math.max(E,k)),W=Math.max(6,Math.round(i*.1)),H=Math.max(2,Math.round(i/36)),I=Math.max(12,Math.round(i*.16));n(h,e,{format:"CODE128",displayValue:!0,background:u,lineColor:p,margin:Math.round(W*a),width:Math.round(H*a),height:Math.round(i*a),fontSize:Math.round(I*a)});let v=await new Promise(w=>h.toBlob(w,"image/png"));if(!v)throw Error("PNG export failed");return v},[d,x,p,M,f,g,j,k,_,l]),pe=(0,o.useCallback)(async()=>{if(!L&&x.trim()){U(!0);try{let e;try{e=await X()}catch(n){let h=n instanceof Error?n.message:String(n);b(h);return}let a=new File([e],`${d==="qr"?"qr-code":"barcode"}-${Date.now()}.png`,{type:"image/png",lastModified:Date.now()});await Promise.resolve(C({file:a}))}finally{U(!1)}}},[C,X,d,x,L]),ge=!!x.trim()&&!$;return(0,r.jsx)("div",{className:t.root,children:(0,r.jsxs)("div",{className:t.controls,children:[(0,r.jsx)(c.antd$Segmented,{block:!0,className:t.segmentedControl,value:d,onChange:e=>{ne(e),b(null)},options:[{label:l("QR code"),value:"qr"},{label:l("Barcode"),value:"barcode"}]}),$&&(0,r.jsx)(c.antd$Alert,{type:"error",title:l("Validation error"),description:$,showIcon:!0,closable:!0,onClose:()=>b(null)}),(0,r.jsx)(c.antd$Input.TextArea,{value:x,onChange:e=>{se(e.target.value),b(null)},placeholder:l("Text or URL"),rows:3,spellCheck:!1,autoComplete:"off"}),(0,r.jsxs)("div",{className:t.sizeRow,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.sizeRowLabel,children:l(d==="qr"?"QR image size px":"Barcode bar height px")}),d==="qr"?(0,r.jsx)(c.antd$InputNumber,{className:t.sizeInputNumber,min:z,max:D,step:8,value:j,onChange:e=>ue(typeof e=="number"&&!Number.isNaN(e)?e:ee),prefix:(0,r.jsx)(S,{size:18,strokeWidth:Q}),suffix:(0,r.jsx)("span",{className:t.sizeSuffix,children:"px"}),"aria-label":l("QR image size px")}):(0,r.jsx)(c.antd$InputNumber,{className:t.sizeInputNumber,min:E,max:q,step:4,value:k,onChange:e=>me(typeof e=="number"&&!Number.isNaN(e)?e:ae),prefix:(0,r.jsx)(S,{size:18,strokeWidth:Q}),suffix:(0,r.jsx)("span",{className:t.sizeSuffix,children:"px"}),"aria-label":l("Barcode bar height px")})]}),(0,r.jsxs)("div",{className:t.colorGrid,children:[(0,r.jsxs)("div",{className:t.colorCell,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.colorCellLabel,children:l("Code color","Code color")}),(0,r.jsx)(c.antd$ColorPicker,{className:t.colorPickerFull,value:p,format:"hex",disabledAlpha:!0,showText:!0,onChange:(e,a)=>{let n=typeof e=="string"?e:e?.toHexString?e.toHexString():a;ce(n)}})]}),(0,r.jsxs)("div",{className:t.colorCell,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.colorCellLabel,children:l("Background color","Background color")}),(0,r.jsx)(c.antd$ColorPicker,{className:t.colorPickerFull,value:f,format:"hex",disabledAlpha:!0,showText:!0,disabled:g,onChange:(e,a)=>{let n=typeof e=="string"?e:e?.toHexString?e.toHexString():a;de(n)}})]}),(0,r.jsxs)("div",{className:t.bgExtras,children:[(0,r.jsx)(c.antd$Checkbox,{checked:g,onChange:e=>he(e.target.checked),children:l("Transparent background","Transparent background")}),g&&(0,r.jsx)(c.antd$Alert,{type:"warning",showIcon:!0,title:l("QR transparent background hint"),className:t.bgWarning})]})]}),(0,r.jsxs)("div",{className:t.previewSection,children:[(0,r.jsx)(c.antd$Typography.Text,{className:t.previewTitle,children:l("Preview","Preview")}),(0,r.jsxs)("div",{className:[t.previewWrap,d==="barcode"&&t.previewWrapBarcode].filter(Boolean).join(" "),children:[(0,r.jsx)("div",{className:[t.scanLine,d==="barcode"&&t.scanLineBarcode].filter(Boolean).join(" ")}),(0,r.jsx)("canvas",{ref:V,className:[t.previewCanvas,d==="barcode"&&t.previewCanvasBarcode].filter(Boolean).join(" "),"aria-label":l("Preview")})]})]}),(0,r.jsx)("div",{className:t.actions,children:(0,r.jsx)(c.antd$Button,{type:"primary",onClick:()=>{pe()},loading:L,disabled:!ge,children:l("Add to My files")})})]})})};Z.default=le});
@@ -1 +1 @@
1
- __useblocks__.define("static/core/12963ed5.js",["require","exports","module","static/core/2ff39ddf.js","static/core/83a2a45e.js"],function(i,d,P){const h=i("./2ff39ddf.js"),p=i("./83a2a45e.js");var u={items_per_page:"/ pagina",jump_to:"vai a",jump_to_confirm:"Conferma",page:"Pagina",prev_page:"Pagina precedente",next_page:"Pagina successiva",prev_5:"Precedente 5 pagine",next_5:"Prossime 5 pagine",prev_3:"Precedente 3 pagine",next_3:"Prossime 3 pagine",page_size:"dimensioni della pagina"};function o(a){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(a)}function l(a,e){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(S){return Object.getOwnPropertyDescriptor(a,S).enumerable})),r.push.apply(r,n)}return r}function c(a){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l(Object(r),!0).forEach(function(n){g(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function g(a,e,r){return e=f(e),e in a?Object.defineProperty(a,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[e]=r,a}function f(a){var e=b(a,"string");return o(e)=="symbol"?e:String(e)}function b(a,e){if(o(a)!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var n=r.call(a,e||"default");if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var v=c(c({},p.commonLocale),{},{locale:"it_IT",today:"Oggi",now:"Adesso",backToToday:"Torna ad oggi",ok:"OK",clear:"Cancella",week:"Settimana",month:"Mese",year:"Anno",timeSelect:"Seleziona l'ora",dateSelect:"Seleziona la data",monthSelect:"Seleziona il mese",yearSelect:"Seleziona l'anno",decadeSelect:"Seleziona il decennio",previousMonth:"Il mese scorso (PageUp)",nextMonth:"Il prossimo mese (PageDown)",previousYear:"L'anno scorso (Control + sinistra)",nextYear:"L'anno prossimo (Control + destra)",previousDecade:"Ultimo decennio",nextDecade:"Prossimo decennio",previousCentury:"Secolo precedente",nextCentury:"Prossimo secolo",shortWeekDays:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],shortMonths:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"]}),s={placeholder:"Selezionare l'orario",rangePlaceholder:["Inizio orario","Fine orario"]},m={lang:{placeholder:"Selezionare la data",rangePlaceholder:["Data d'inizio","Data di fine"],...v},timePickerLocale:{...s}},y=m,t=" ${label} non è un ${type} valido",$={locale:"it",Pagination:u,DatePicker:m,TimePicker:s,Calendar:y,global:{placeholder:"Selezionare",close:"Chiudi",show:"Mostra",hide:"Nascondi"},Table:{filterTitle:"Menù Filtro",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"Senza filtri",filterCheckAll:"Seleziona tutti",filterSearchPlaceholder:"Cerca nei filtri",emptyText:"Senza dati",selectAll:"Seleziona pagina corrente",selectInvert:"Inverti selezione nella pagina corrente",selectNone:"Deseleziona tutto",selectionAll:"Seleziona tutto",sortTitle:"Ordina",expand:"Espandi riga",collapse:"Comprimi riga ",triggerDesc:"Clicca per ordinare in modo discendente",triggerAsc:"Clicca per ordinare in modo ascendente",cancelSort:"Clicca per eliminare l'ordinamento"},Tour:{Next:"Successivo",Previous:"Precedente",Finish:"Termina"},Modal:{okText:"OK",cancelText:"Annulla",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Annulla"},Transfer:{titles:["",""],searchPlaceholder:"Cerca qui",itemUnit:"elemento",itemsUnit:"elementi",remove:"Elimina",selectCurrent:"Seleziona la pagina corrente",removeCurrent:"Rimuovi la pagina corrente",selectAll:"Seleziona tutti i dati",removeAll:"Rimuovi tutti i dati",selectInvert:"Inverti la pagina corrente"},Upload:{uploading:"Caricamento...",removeFile:"Rimuovi il file",uploadError:"Errore di caricamento",previewFile:"Anteprima file",downloadFile:"Scarica file"},Empty:{description:"Nessun dato"},Icon:{icon:"icona"},Text:{edit:"modifica",copy:"copia",copied:"copia effettuata",expand:"espandi"},Form:{optional:"(opzionale)",defaultValidateMessages:{default:"Errore di convalida del campo ${label}",required:"Si prega di inserire ${label}",enum:"${label} deve essere uno di [${enum}]",whitespace:"${label} non può essere un carattere vuoto",date:{format:"Il formato della data ${label} non è valido",parse:"${label} non può essere convertito in una data",invalid:"${label} non è una data valida"},types:{string:t,method:t,array:t,object:t,number:t,date:t,boolean:t,integer:t,float:t,regexp:t,email:t,url:t,hex:t},string:{len:"${label} deve avere ${len} caratteri",min:"${label} deve contenere almeno ${min} caratteri",max:"${label} deve contenere fino a ${max} caratteri",range:"${label} deve contenere tra ${min}-${max} caratteri"},number:{len:"${label} deve essere uguale a ${len}",min:"${label} valore minimo è ${min}",max:"${label} valor e massimo è ${max}",range:"${label} deve essere compreso tra ${min}-${max}"},array:{len:"Deve essere ${len} ${label}",min:"Almeno ${min} ${label}",max:"Massimo ${max} ${label}",range:"Il totale di ${label} deve essere compreso tra ${min}-${max}"},pattern:{mismatch:"${label} non corrisponde al modello ${pattern}"}}},QRCode:{expired:"Codice QR scaduto",refresh:"Ricarica",scanned:"Scansionato"},ColorPicker:{presetEmpty:"Vuoto",transparent:"Trasparente",singleColor:"Tinta unita",gradientColor:"Gradiente"}};d.default=$});
1
+ __useblocks__.define("static/core/62855b97.js",["require","exports","module","static/core/2ff39ddf.js","static/core/a42ab03f.js"],function(i,d,P){const h=i("./2ff39ddf.js"),p=i("./a42ab03f.js");var u={items_per_page:"/ pagina",jump_to:"vai a",jump_to_confirm:"Conferma",page:"Pagina",prev_page:"Pagina precedente",next_page:"Pagina successiva",prev_5:"Precedente 5 pagine",next_5:"Prossime 5 pagine",prev_3:"Precedente 3 pagine",next_3:"Prossime 3 pagine",page_size:"dimensioni della pagina"};function o(a){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(a)}function l(a,e){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(S){return Object.getOwnPropertyDescriptor(a,S).enumerable})),r.push.apply(r,n)}return r}function c(a){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l(Object(r),!0).forEach(function(n){g(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function g(a,e,r){return e=f(e),e in a?Object.defineProperty(a,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[e]=r,a}function f(a){var e=b(a,"string");return o(e)=="symbol"?e:String(e)}function b(a,e){if(o(a)!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var n=r.call(a,e||"default");if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var v=c(c({},p.commonLocale),{},{locale:"it_IT",today:"Oggi",now:"Adesso",backToToday:"Torna ad oggi",ok:"OK",clear:"Cancella",week:"Settimana",month:"Mese",year:"Anno",timeSelect:"Seleziona l'ora",dateSelect:"Seleziona la data",monthSelect:"Seleziona il mese",yearSelect:"Seleziona l'anno",decadeSelect:"Seleziona il decennio",previousMonth:"Il mese scorso (PageUp)",nextMonth:"Il prossimo mese (PageDown)",previousYear:"L'anno scorso (Control + sinistra)",nextYear:"L'anno prossimo (Control + destra)",previousDecade:"Ultimo decennio",nextDecade:"Prossimo decennio",previousCentury:"Secolo precedente",nextCentury:"Prossimo secolo",shortWeekDays:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],shortMonths:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"]}),s={placeholder:"Selezionare l'orario",rangePlaceholder:["Inizio orario","Fine orario"]},m={lang:{placeholder:"Selezionare la data",rangePlaceholder:["Data d'inizio","Data di fine"],...v},timePickerLocale:{...s}},y=m,t=" ${label} non è un ${type} valido",$={locale:"it",Pagination:u,DatePicker:m,TimePicker:s,Calendar:y,global:{placeholder:"Selezionare",close:"Chiudi",show:"Mostra",hide:"Nascondi"},Table:{filterTitle:"Menù Filtro",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"Senza filtri",filterCheckAll:"Seleziona tutti",filterSearchPlaceholder:"Cerca nei filtri",emptyText:"Senza dati",selectAll:"Seleziona pagina corrente",selectInvert:"Inverti selezione nella pagina corrente",selectNone:"Deseleziona tutto",selectionAll:"Seleziona tutto",sortTitle:"Ordina",expand:"Espandi riga",collapse:"Comprimi riga ",triggerDesc:"Clicca per ordinare in modo discendente",triggerAsc:"Clicca per ordinare in modo ascendente",cancelSort:"Clicca per eliminare l'ordinamento"},Tour:{Next:"Successivo",Previous:"Precedente",Finish:"Termina"},Modal:{okText:"OK",cancelText:"Annulla",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Annulla"},Transfer:{titles:["",""],searchPlaceholder:"Cerca qui",itemUnit:"elemento",itemsUnit:"elementi",remove:"Elimina",selectCurrent:"Seleziona la pagina corrente",removeCurrent:"Rimuovi la pagina corrente",selectAll:"Seleziona tutti i dati",removeAll:"Rimuovi tutti i dati",selectInvert:"Inverti la pagina corrente"},Upload:{uploading:"Caricamento...",removeFile:"Rimuovi il file",uploadError:"Errore di caricamento",previewFile:"Anteprima file",downloadFile:"Scarica file"},Empty:{description:"Nessun dato"},Icon:{icon:"icona"},Text:{edit:"modifica",copy:"copia",copied:"copia effettuata",expand:"espandi"},Form:{optional:"(opzionale)",defaultValidateMessages:{default:"Errore di convalida del campo ${label}",required:"Si prega di inserire ${label}",enum:"${label} deve essere uno di [${enum}]",whitespace:"${label} non può essere un carattere vuoto",date:{format:"Il formato della data ${label} non è valido",parse:"${label} non può essere convertito in una data",invalid:"${label} non è una data valida"},types:{string:t,method:t,array:t,object:t,number:t,date:t,boolean:t,integer:t,float:t,regexp:t,email:t,url:t,hex:t},string:{len:"${label} deve avere ${len} caratteri",min:"${label} deve contenere almeno ${min} caratteri",max:"${label} deve contenere fino a ${max} caratteri",range:"${label} deve contenere tra ${min}-${max} caratteri"},number:{len:"${label} deve essere uguale a ${len}",min:"${label} valore minimo è ${min}",max:"${label} valor e massimo è ${max}",range:"${label} deve essere compreso tra ${min}-${max}"},array:{len:"Deve essere ${len} ${label}",min:"Almeno ${min} ${label}",max:"Massimo ${max} ${label}",range:"Il totale di ${label} deve essere compreso tra ${min}-${max}"},pattern:{mismatch:"${label} non corrisponde al modello ${pattern}"}}},QRCode:{expired:"Codice QR scaduto",refresh:"Ricarica",scanned:"Scansionato"},ColorPicker:{presetEmpty:"Vuoto",transparent:"Trasparente",singleColor:"Tinta unita",gradientColor:"Gradiente"}};d.default=$});