email-builder-online 3.4.69 → 3.4.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -144,7 +144,7 @@ ${e}</tr>
|
|
|
144
144
|
`}tablecell(e,n){const r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
|
|
145
145
|
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return"<br>"}del(e){return`<del>${e}</del>`}link(e,n,r){const i=ZI(e);if(i===null)return r;e=i;let a='<a href="'+e+'"';return n&&(a+=' title="'+n+'"'),a+=">"+r+"</a>",a}image(e,n,r){const i=ZI(e);if(i===null)return r;e=i;let a=`<img src="${e}" alt="${r}"`;return n&&(a+=` title="${n}"`),a+=">",a}text(e){return e}}class GA{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,r){return""+r}image(e,n,r){return""+r}br(){return""}}class Ys{constructor(e){re(this,"options");re(this,"renderer");re(this,"textRenderer");this.options=e||Xu,this.options.renderer=this.options.renderer||new ty,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new GA}static parse(e,n){return new Ys(n).parse(e)}static parseInline(e,n){return new Ys(n).parseInline(e)}parse(e,n=!0){let r="";for(let i=0;i<e.length;i++){const a=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){const s=a,o=this.options.extensions.renderers[s.type].call({parser:this},s);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){r+=o||"";continue}}switch(a.type){case"space":continue;case"hr":{r+=this.renderer.hr();continue}case"heading":{const s=a;r+=this.renderer.heading(this.parseInline(s.tokens),s.depth,fce(this.parseInline(s.tokens,this.textRenderer)));continue}case"code":{const s=a;r+=this.renderer.code(s.text,s.lang,!!s.escaped);continue}case"table":{const s=a;let o="",l="";for(let u=0;u<s.header.length;u++)l+=this.renderer.tablecell(this.parseInline(s.header[u].tokens),{header:!0,align:s.align[u]});o+=this.renderer.tablerow(l);let c="";for(let u=0;u<s.rows.length;u++){const d=s.rows[u];l="";for(let p=0;p<d.length;p++)l+=this.renderer.tablecell(this.parseInline(d[p].tokens),{header:!1,align:s.align[p]});c+=this.renderer.tablerow(l)}r+=this.renderer.table(o,c);continue}case"blockquote":{const s=a,o=this.parse(s.tokens);r+=this.renderer.blockquote(o);continue}case"list":{const s=a,o=s.ordered,l=s.start,c=s.loose;let u="";for(let d=0;d<s.items.length;d++){const p=s.items[d],f=p.checked,m=p.task;let g="";if(p.task){const _=this.renderer.checkbox(!!f);c?p.tokens.length>0&&p.tokens[0].type==="paragraph"?(p.tokens[0].text=_+" "+p.tokens[0].text,p.tokens[0].tokens&&p.tokens[0].tokens.length>0&&p.tokens[0].tokens[0].type==="text"&&(p.tokens[0].tokens[0].text=_+" "+p.tokens[0].tokens[0].text)):p.tokens.unshift({type:"text",text:_+" "}):g+=_+" "}g+=this.parse(p.tokens,c),u+=this.renderer.listitem(g,m,!!f)}r+=this.renderer.list(u,o,l);continue}case"html":{const s=a;r+=this.renderer.html(s.text,s.block);continue}case"paragraph":{const s=a;r+=this.renderer.paragraph(this.parseInline(s.tokens));continue}case"text":{let s=a,o=s.tokens?this.parseInline(s.tokens):s.text;for(;i+1<e.length&&e[i+1].type==="text";)s=e[++i],o+=`
|
|
146
146
|
`+(s.tokens?this.parseInline(s.tokens):s.text);r+=n?this.renderer.paragraph(o):o;continue}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}parseInline(e,n){n=n||this.renderer;let r="";for(let i=0;i<e.length;i++){const a=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[a.type]){const s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=s||"";continue}}switch(a.type){case"escape":{const s=a;r+=n.text(s.text);break}case"html":{const s=a;r+=n.html(s.text);break}case"link":{const s=a;r+=n.link(s.href,s.title,this.parseInline(s.tokens,n));break}case"image":{const s=a;r+=n.image(s.href,s.title,s.text);break}case"strong":{const s=a;r+=n.strong(this.parseInline(s.tokens,n));break}case"em":{const s=a;r+=n.em(this.parseInline(s.tokens,n));break}case"codespan":{const s=a;r+=n.codespan(s.text);break}case"br":{r+=n.br();break}case"del":{const s=a;r+=n.del(this.parseInline(s.tokens,n));break}case"text":{const s=a;r+=n.text(s.text);break}default:{const s='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return r}}class qm{constructor(e){re(this,"options");this.options=e||Xu}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}}re(qm,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));var Ku,zk,o8;class Hce{constructor(...e){Uc(this,Ku);re(this,"defaults",LA());re(this,"options",this.setOptions);re(this,"parse",is(this,Ku,zk).call(this,Ws.lex,Ys.parse));re(this,"parseInline",is(this,Ku,zk).call(this,Ws.lexInline,Ys.parseInline));re(this,"Parser",Ys);re(this,"Renderer",ty);re(this,"TextRenderer",GA);re(this,"Lexer",Ws);re(this,"Tokenizer",Jb);re(this,"Hooks",qm);this.use(...e)}walkTokens(e,n){let r=[];for(const i of e)switch(r=r.concat(n.call(this,i)),i.type){case"table":{const a=i;for(const s of a.header)r=r.concat(this.walkTokens(s.tokens,n));for(const s of a.rows)for(const o of s)r=r.concat(this.walkTokens(o.tokens,n));break}case"list":{const a=i;r=r.concat(this.walkTokens(a.items,n));break}default:{const a=i;this.defaults.extensions?.childTokens?.[a.type]?this.defaults.extensions.childTokens[a.type].forEach(s=>{const o=a[s].flat(1/0);r=r.concat(this.walkTokens(o,n))}):a.tokens&&(r=r.concat(this.walkTokens(a.tokens,n)))}}return r}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const s=n.renderers[a.name];s?n.renderers[a.name]=function(...o){let l=a.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:n.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=n[a.level];s?s.unshift(a.tokenizer):n[a.level]=[a.tokenizer],a.start&&(a.level==="block"?n.startBlock?n.startBlock.push(a.start):n.startBlock=[a.start]:a.level==="inline"&&(n.startInline?n.startInline.push(a.start):n.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(n.childTokens[a.name]=a.childTokens)}),i.extensions=n),r.renderer){const a=this.defaults.renderer||new ty(this.defaults);for(const s in r.renderer){if(!(s in a))throw new Error(`renderer '${s}' does not exist`);if(s==="options")continue;const o=s,l=r.renderer[o],c=a[o];a[o]=(...u)=>{let d=l.apply(a,u);return d===!1&&(d=c.apply(a,u)),d||""}}i.renderer=a}if(r.tokenizer){const a=this.defaults.tokenizer||new Jb(this.defaults);for(const s in r.tokenizer){if(!(s in a))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const o=s,l=r.tokenizer[o],c=a[o];a[o]=(...u)=>{let d=l.apply(a,u);return d===!1&&(d=c.apply(a,u)),d}}i.tokenizer=a}if(r.hooks){const a=this.defaults.hooks||new qm;for(const s in r.hooks){if(!(s in a))throw new Error(`hook '${s}' does not exist`);if(s==="options")continue;const o=s,l=r.hooks[o],c=a[o];qm.passThroughHooks.has(s)?a[o]=u=>{if(this.defaults.async)return Promise.resolve(l.call(a,u)).then(p=>c.call(a,p));const d=l.call(a,u);return c.call(a,d)}:a[o]=(...u)=>{let d=l.apply(a,u);return d===!1&&(d=c.apply(a,u)),d}}i.hooks=a}if(r.walkTokens){const a=this.defaults.walkTokens,s=r.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),a&&(l=l.concat(a.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return Ws.lex(e,n??this.defaults)}parser(e,n){return Ys.parse(e,n??this.defaults)}}Ku=new WeakSet,zk=function(e,n){return(r,i)=>{const a={...i},s={...this.defaults,...a};this.defaults.async===!0&&a.async===!1&&(s.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),s.async=!0);const o=is(this,Ku,o8).call(this,!!s.silent,!!s.async);if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(s.hooks&&(s.hooks.options=s),s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(r):r).then(l=>e(l,s)).then(l=>s.hooks?s.hooks.processAllTokens(l):l).then(l=>s.walkTokens?Promise.all(this.walkTokens(l,s.walkTokens)).then(()=>l):l).then(l=>n(l,s)).then(l=>s.hooks?s.hooks.postprocess(l):l).catch(o);try{s.hooks&&(r=s.hooks.preprocess(r));let l=e(r,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=n(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(l){return o(l)}}},o8=function(e,n){return r=>{if(r.message+=`
|
|
147
|
-
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+na(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}};const Ru=new Hce;function In(t,e){return Ru.parse(t,e)}In.options=In.setOptions=function(t){return Ru.setOptions(t),In.defaults=Ru.defaults,XU(In.defaults),In};In.getDefaults=LA;In.defaults=Xu;In.use=function(...t){return Ru.use(...t),In.defaults=Ru.defaults,XU(In.defaults),In};In.walkTokens=function(t,e){return Ru.walkTokens(t,e)};In.parseInline=Ru.parseInline;In.Parser=Ys;In.parser=Ys.parse;In.Renderer=ty;In.TextRenderer=GA;In.Lexer=Ws;In.lexer=Ws.lex;In.Tokenizer=Jb;In.Hooks=qm;In.parse=In;In.options;In.setOptions;In.use;In.walkTokens;In.parseInline;Ys.parse;Ws.lex;function jce(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qce(t){const e=String(t?.text??"");if(t?.markdown===!0){const n=In.parse(e,{async:!1});return typeof n=="string"?n:String(n)}return`<p>${jce(e)}</p>`}function rp(t){const e={...t};for(const[n,r]of Object.entries(e)){const i=r.type;if(i==="CustomEditor"||i==="Wysiwyg")e[n]={...r,type:"NotionText"};else if(i==="Text"){const a=r.data??{},s=a.props??{},o=qce(s);e[n]={...r,type:"NotionText",data:{...a,props:{html:o}}}}}return e}const Gk="eb-component-tree-column:";function Vce(t,e){return`${Gk}${t}:${e}`}function l8(t){if(!t.startsWith(Gk))return null;const e=t.slice(Gk.length),n=e.lastIndexOf(":");if(n<=0)return null;const r=e.slice(0,n),i=Number(e.slice(n+1));return!Number.isInteger(i)||i<0||i>2?null:{parentBlockId:r,columnIndex:i}}const ny=385,uE="https://ddc4vowthkjlv.cloudfront.net/uploads/gallery/1/69cc1b1083b90.jpg";let QS=null;const Wce=2e3;function yg(){QS&&clearTimeout(QS),QS=setTimeout(()=>{const t=new CustomEvent("email-builder-auto-save",{detail:!0});window.dispatchEvent(t)},Wce)}const Yce=()=>({document:rp(JSON.parse(JSON.stringify(ace))),selectedBlockId:null,selectedSidebarTab:"styles",selectedMainTab:"editor",selectedScreenSize:"desktop",windowWidth:0,inspectorDrawerOpen:!0,componentTreeOpen:!1,samplesDrawerOpen:!0,inspectorDrawerWidth:ny,devMode:!1,imageUploading:{uploading:!1,id:""},disableEdition:!1,disableUpdate:!1,freeMode:!1,minHeight:"calc(100dvh - 65px)",color:{primary:"",secondary:""},galleryImages:!0,imagePlaceholder:uE,darkMode:!0,colorPicker:{paletteColors:ice,isLocked:!1},tour:!1,stickyHeader:!0,heightContent:"calc(100dvh - 50px)",containerGrow:!0,notionTextInlineEditingBlockId:null,highlightColor:"#FF6B35",showVersion:!1}),ue=QU(()=>Yce());D.createContext(ue);function c8(){const t=ue(e=>e.document[ue(n=>n.selectedBlockId)||""]);return t?t.type:null}function nM(t){return ue.setState({windowWidth:t})}function Kce(){return ue(t=>t.devMode)}function Qce(t){return ue.setState({devMode:t})}function HA(){return ue(t=>t.document)}function u8(t){return ue(e=>e.document[t])}function Xce(t){return ue(e=>e.document[t]?.type)}function Zce(t){return ue(e=>e.selectedBlockId===t)}function pf(){return ue(t=>t.selectedBlockId)}function vg(){return ue(t=>t.notionTextInlineEditingBlockId)}function Vm(t){const e=ue.getState().notionTextInlineEditingBlockId;return e&&e!==t&&window.dispatchEvent(new CustomEvent("notion-text-force-save",{detail:{blockId:e}})),ue.setState({notionTextInlineEditingBlockId:t})}function Jce(){return!!vg()}function eue(){return vg()}function tue(){return ue(t=>t.highlightColor)}function Sr(){return ue(t=>t.selectedScreenSize)}function jA(){return ue(t=>t.selectedMainTab)}function p_(t){return t==="preview"&&$a(null),ue.setState({inspectorDrawerOpen:t==="editor"}),ue.setState({selectedMainTab:t})}function _o(){return ue(t=>t.selectedSidebarTab)}function nue(){return ue(t=>t.inspectorDrawerOpen)}function qA(){return ue(t=>t.componentTreeOpen)}function Hk(){ue.setState(t=>({componentTreeOpen:!t.componentTreeOpen}))}function dE(){return ue(t=>t.imageUploading)}function VA(){return ue(t=>t.disableEdition)}let ry=null,rM=0;const rue=400;let Ou=!1,jk=!1;function ff(t,e){if(Ou||jk)return;const n=Date.now(),r=n-rM;if(e&&e===ry&&r<rue){Xb().future.length>0&&Zb({future:[]});return}const a=JSON.stringify(t),{past:s}=Xb();if(s.length>0&&s[s.length-1]===a)return;const o=[...s,a].slice(-50);Zb({past:o,future:[]}),ry=e??null,rM=n}function $a(t){const e=ue.getState().notionTextInlineEditingBlockId;e&&t!==null&&e!==t&&Vm(null);const n=ue.getState().document[t||""]?.type,r=Qb.includes(n||null)?"styles":"block-configuration",i={};return t!==null&&ue.getState().selectedMainTab==="editor"&&(i.inspectorDrawerOpen=!0),ue.setState({selectedBlockId:t,selectedSidebarTab:r,...i})}function iue(t){return ue.setState({selectedSidebarTab:t})}function f_(t){const e=rp(t);return lce(),ue.setState({document:e,selectedSidebarTab:"styles",selectedBlockId:null})}function d8(t){const e=ue.getState().document;jk=!0;let n;try{n=t()}finally{jk=!1}return ff(e,null),n}function iM(){const{past:t,future:e}=Xb();if(t.length!==0){Ou=!0;try{const n=ue.getState().document,r=JSON.stringify(n),i=[...t],a=i.pop(),s=JSON.parse(a);Zb({past:i,future:[...e,r]});const o=ue.getState().selectedBlockId,l=o&&!s[o];ue.setState({document:s,...l?{selectedBlockId:null}:{}})}finally{Ou=!1,ry=null}}}function aM(){const{past:t,future:e}=Xb();if(e.length!==0){Ou=!0;try{const n=ue.getState().document,r=JSON.stringify(n),i=[...e],a=i.pop(),s=JSON.parse(a);Zb({past:[...t,r],future:i});const o=ue.getState().selectedBlockId,l=o&&!s[o];ue.setState({document:s,...l?{selectedBlockId:null}:{}})}finally{Ou=!1,ry=null}}}function bu(t,e=!0){const n=ue.getState().document,r={...n,...t};e&&ff(n);const i=()=>{ue.setState({document:r}),yg()};return e?(D.startTransition(i),ue.getState()):i()}function iy(t){return ue.setState({selectedScreenSize:t})}function ip(t,e){return ue.setState({imageUploading:{uploading:t,id:e||""}})}function p8(t){return ue.setState({disableEdition:t})}function aue(){return ue.getState().document.root.data}function pE(){return ue(t=>t.document?.root?.data)}function sue(t){return ue.setState({color:t})}function oue(t){return ue.setState({galleryImages:t})}function ay(){return ue.getState().galleryImages}function lue(t){return ue.setState({imagePlaceholder:t})}function cue(){return ue.getState().imagePlaceholder}function uue(t){return ue.setState({freeMode:t})}function WA(){return ue.getState().freeMode}function due(t){return ue.setState({darkMode:t})}function pue(t){return ue.setState({stickyHeader:t})}function fue(t){return ue.setState({heightContent:t})}function mue(t){return ue.setState({containerGrow:t})}function hue(){return ue.getState().containerGrow}function gue(t){return ue.setState({showVersion:t})}function _ue(){return ue(t=>t.showVersion)}function Nh(t,e,n,r=!0){Zu({draggedId:e,targetId:t})&&console.warn("No se puede mover un elemento dentro de uno de sus propios hijos");const i=ue.getState().document,a=JSON.parse(JSON.stringify({...i})),s=u=>{if(!u||t===e)return u;const d=u.indexOf(e);return d<0?u:u.toSpliced(d,1)},o=u=>{if(!u||t===e)return u;const d=u.indexOf(t);if(d<0)return u;const p=n==="up"?d:d+1;return u.toSpliced(p,0,e)};let l=null,c=null;for(const[u,d]of Object.entries(a)){const p=d;if(c)break;switch(p.type){case"EmailLayout":p.data.childrenIds?.length&&p.data.childrenIds.includes(e)&&(c=u,a[u]={...p,data:{...p.data,childrenIds:s(p.data.childrenIds)}});break;case"Container":p.data.props?.childrenIds?.length&&p.data.props.childrenIds.includes(e)&&(c=u,a[u]={...p,data:{...p.data,props:{...p.data.props,childrenIds:s(p.data.props.childrenIds)}}});break;case"ColumnsContainer":if(p.data.props?.columns){let f=!1;const m=p.data.props.columns.map((g,_)=>g?.childrenIds?.includes(e)?(c=`${u}-column-${_}`,f=!0,{...g,childrenIds:s(g.childrenIds)}):g);f&&(a[u]={...p,data:{...p.data,props:{...p.data.props,columns:m}}})}break}}if(l=null,r)for(const[u,d]of Object.entries(a)){const p=d;if(l)break;switch(p.type){case"EmailLayout":p.data.childrenIds?.length&&p.data.childrenIds.includes(t)&&(l=u,a[u]={...p,data:{...p.data,childrenIds:o(p.data.childrenIds)}});break;case"Container":p.data.props?.childrenIds?.length&&p.data.props.childrenIds.includes(t)&&(l=u,a[u]={...p,data:{...p.data,props:{...p.data.props,childrenIds:o(p.data.props.childrenIds)}}});break;case"ColumnsContainer":if(p.data.props?.columns){const f=l8(t);if(f&&f.parentBlockId===u){l=u;const{columnIndex:g}=f,_=p.data.props.columns.map((b,y)=>{if(y!==g)return b;const v=[...b?.childrenIds||[]],E=n==="up"?0:v.length;return{...b,childrenIds:v.toSpliced(E,0,e)}});a[u]={...p,data:{...p.data,props:{...p.data.props,columns:_}}};break}const m=p.data.props.columns.map((g,_)=>g?.childrenIds?.includes(t)?(l=`${u}-column-${_}`,{...g,childrenIds:o(g.childrenIds)}):g);a[u]={...p,data:{...p.data,props:{...p.data.props,columns:m}}}}break}}return bu(a)}function bue({parentId:t,blockId:e,indexArray:n}){if(Zu({draggedId:e,targetId:t})){console.warn("No se puede mover un elemento dentro de uno de sus propios hijos");return}return d8(()=>{Nh("",e,"down",!1);const r=ue.getState().document,i=JSON.parse(JSON.stringify({...r}));if(!i[t])return;const a=i[t],s=[...a.data.props.columns||[]];return s[n||0]={childrenIds:[e]},i[t]={type:"ColumnsContainer",data:{...a.data,props:{...a.data.props,columns:s}}},bu(i)})}function yue({parentId:t,blockId:e}){if(Zu({draggedId:e,targetId:t})){console.warn("No se puede mover un elemento dentro de uno de sus propios hijos");return}return d8(()=>{Nh("",e,"down",!1);const n=ue.getState().document,r=JSON.parse(JSON.stringify({...n}));if(!r[t])return;const i=r[t];return r[t]={type:"Container",data:{...i.data,props:{...i.data.props,childrenIds:[e]}}},bu(r)})}function Zu({draggedId:t,targetId:e}){if(t===e)return!0;const n=l8(e),r=n?n.parentBlockId:e;if(t===r)return!0;const i=ue.getState().document;function a(s,o){const l=i[s];if(!l)return!1;let c=[];switch(l.type){case"EmailLayout":c=l.data.childrenIds||[];break;case"Container":c=l.data.props?.childrenIds||[];break;case"ColumnsContainer":l.data.props?.columns&&l.data.props.columns.forEach(u=>{u?.childrenIds&&(c=[...c,...u.childrenIds])});break}if(c.includes(o))return!0;for(const u of c)if(a(u,o))return!0;return!1}return a(t,r)}function vue(){return ue(t=>t.colorPicker)}function XS(t){ue.setState(e=>({colorPicker:{...e.colorPicker,...t}}))}function f8(t,e){if(Ou)return;const n=ue.getState().document,r=n[t];if(!r){console.warn(`Block ${t} not found`);return}const i=e(r);if(r===i)return;const a={...n,[t]:i};ff(n,t),D.startTransition(()=>{ue.setState({document:a})}),yg()}function Eue(t,e){if(Ou)return;const n=ue.getState().document,r=n[t];if(!r){console.warn(`Block ${t} not found`);return}const i=e(r);if(r===i)return;const a={...n,[t]:i};ff(n,t),ue.setState({document:a}),yg()}function Sue(t,e){f8(t,n=>{const r=typeof e=="function"?e(n.data.props):{...n.data.props,...e};return{...n,data:{...n.data,props:r}}})}function m_(t,e){Eue(t,n=>{const r=typeof e=="function"?e(n.data.props):{...n.data.props,...e};return{...n,data:{...n.data,props:r}}})}function qk(t,e,n,r){const i=ue.getState().document,a=i[t];if(!a)return;const s=a.type==="EmailLayout"?{...a,data:{...a.data,childrenIds:r}}:{...a,data:{...a.data,props:{...a.data?.props,childrenIds:r}}},o={...i,[e]:n,[t]:s};ff(i),D.startTransition(()=>{ue.setState({document:o})}),yg()}function Cue(t){const e=ue.getState().document,n={...e,...t};ff(e),D.startTransition(()=>{ue.setState({document:n})}),yg()}function Vk(t,e){f8(t,e)}const Tue=Ee([h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M7.35 18.5C8.66 17.56 10.26 17 12 17s3.34.56 4.65 1.5c-1.31.94-2.91 1.5-4.65 1.5s-3.34-.56-4.65-1.5m10.79-1.38C16.45 15.8 14.32 15 12 15s-4.45.8-6.14 2.12C4.7 15.73 4 13.95 4 12c0-4.42 3.58-8 8-8s8 3.58 8 8c0 1.95-.7 3.73-1.86 5.12"},"0"),h.jsx("path",{d:"M12 6c-1.93 0-3.5 1.57-3.5 3.5S10.07 13 12 13s3.5-1.57 3.5-3.5S13.93 6 12 6m0 5c-.83 0-1.5-.67-1.5-1.5S11.17 8 12 8s1.5.67 1.5 1.5S12.83 11 12 11"},"1")],"AccountCircleOutlined"),xue=Ee(h.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),YA=Ee(h.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"AddOutlined"),m8=Ee(h.jsx("path",{d:"M4 22H2V2h2zM22 7H6v3h16zm-6 7H6v3h10z"}),"AlignHorizontalLeftOutlined"),h8=Ee(h.jsx("path",{d:"M20 2h2v20h-2zM2 10h16V7H2zm6 7h10v-3H8z"}),"AlignHorizontalRightOutlined"),g8=Ee(h.jsx("path",{d:"M22 22H2v-2h20zM10 2H7v16h3zm7 6h-3v10h3z"}),"AlignVerticalBottomOutlined"),_8=Ee(h.jsx("path",{d:"M22 2v2H2V2zM7 22h3V6H7zm7-6h3V6h-3z"}),"AlignVerticalTopOutlined"),kue=Ee(h.jsx("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M12 17.5 6.5 12H10v-2h4v2h3.5zM5.12 5l.81-1h12l.94 1z"}),"Archive"),b8=Ee([h.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),h.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")],"ArticleOutlined"),wue=Ee(h.jsx("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatioOutlined"),Due=Ee(h.jsx("path",{d:"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5"}),"Attachment"),Wk=Ee(h.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z"}),"AutoAwesome"),Aue=Ee(h.jsx("path",{d:"M9 11H7v2h2zm4 4h-2v2h2zM9 3H7v2h2zm4 8h-2v2h2zM5 3H3v2h2zm8 4h-2v2h2zm4 4h-2v2h2zm-4-8h-2v2h2zm4 0h-2v2h2zm2 10h2v-2h-2zm0 4h2v-2h-2zM5 7H3v2h2zm14-4v2h2V3zm0 6h2V7h-2zM5 11H3v2h2zM3 21h18v-2H3zm2-6H3v2h2z"}),"BorderBottomOutlined"),Nue=Ee(h.jsx("path",{d:"M11 21h2v-2h-2zm0-4h2v-2h-2zm0-12h2V3h-2zm0 4h2V7h-2zm0 4h2v-2h-2zm-4 8h2v-2H7zM7 5h2V3H7zm0 8h2v-2H7zm-4 8h2V3H3zM19 9h2V7h-2zm-4 12h2v-2h-2zm4-4h2v-2h-2zm0-14v2h2V3zm0 10h2v-2h-2zm0 8h2v-2h-2zm-4-8h2v-2h-2zm0-8h2V3h-2z"}),"BorderLeftOutlined"),Rue=Ee(h.jsx("path",{d:"M13 7h-2v2h2zm0 4h-2v2h2zm4 0h-2v2h2zM3 3v18h18V3zm16 16H5V5h14zm-6-4h-2v2h2zm-4-4H7v2h2z"}),"BorderOuterOutlined"),Oue=Ee(h.jsx("path",{d:"M7 21h2v-2H7zM3 5h2V3H3zm4 0h2V3H7zm0 8h2v-2H7zm-4 8h2v-2H3zm8 0h2v-2h-2zm-8-8h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm8 8h2v-2h-2zm4-4h2v-2h-2zm4-10v18h2V3zm-4 18h2v-2h-2zm0-16h2V3h-2zm-4 8h2v-2h-2zm0-8h2V3h-2zm0 4h2V7h-2z"}),"BorderRightOutlined"),Iue=Ee(h.jsx("path",{d:"M7 21h2v-2H7zm0-8h2v-2H7zm4 0h2v-2h-2zm0 8h2v-2h-2zm-8-4h2v-2H3zm0 4h2v-2H3zm0-8h2v-2H3zm0-4h2V7H3zm8 8h2v-2h-2zm8-8h2V7h-2zm0 4h2v-2h-2zM3 3v2h18V3zm16 14h2v-2h-2zm-4 4h2v-2h-2zM11 9h2V7h-2zm8 12h2v-2h-2zm-4-8h2v-2h-2z"}),"BorderTopOutlined"),Mue=Ee(h.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),Pue=Ee(h.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),Lue=Ee(h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),fE=Ee(h.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Fue=Ee(h.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"CodeOutlined"),sM=Ee(h.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopyOutlined"),y8=Ee(h.jsx("path",{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 10H5V8h14z"}),"Crop32Outlined"),Bue=Ee(h.jsx("path",{d:"M19 5v2h-4V5zM9 5v6H5V5zm10 8v6h-4v-6zM9 17v2H5v-2zM21 3h-8v6h8zM11 3H3v10h8zm10 8h-8v10h8zm-10 4H3v6h8z"}),"DashboardOutlined"),$ue=Ee(h.jsx("path",{d:"M9 11H7v2h2zm4 0h-2v2h2zm4 0h-2v2h2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V9h14z"}),"DateRange"),Uue=Ee(h.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),zue=Ee(h.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline"),Gue=Ee(h.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),v8=Ee(h.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Hue=Ee(h.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),jue=Ee(h.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined"),que=Ee(h.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Email"),Vue=Ee(h.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8M12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4m3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"EmojiEmotions"),Wue=Ee(h.jsx("path",{d:"M17 12h-5v5h5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1zm3 18H5V8h14z"}),"Event"),Yue=Ee(h.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z"}),"FileDownloadOutlined"),oM=Ee(h.jsx("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenter"),Kue=Ee(h.jsx("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenterOutlined"),lM=Ee(h.jsx("path",{d:"M3 21h18v-2H3zm0-4h18v-2H3zm0-4h18v-2H3zm0-4h18V7H3zm0-6v2h18V3z"}),"FormatAlignJustify"),cM=Ee(h.jsx("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeft"),Que=Ee(h.jsx("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeftOutlined"),uM=Ee(h.jsx("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRight"),Xue=Ee(h.jsx("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRightOutlined"),Zue=Ee(h.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5"}),"FormatBold"),Jue=Ee(h.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),ede=Ee(h.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),E8=Ee(h.jsx("path",{d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5 5.27 5.27 4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6 1.52 0 2.9-.57 3.96-1.5l2.63 2.63 1.27-1.27z"}),"FormatColorReset"),tde=Ee(h.jsx("path",{d:"M2 20h20v4H2zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5zm4.42-5.61 2.03-5.79h.12l2.03 5.79z"}),"FormatColorText"),nde=Ee(h.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic"),ZS=Ee(h.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z"}),"FormatListBulleted"),dM=Ee(h.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered"),rde=Ee(h.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z"}),"FormatUnderlined"),S8=Ee(h.jsx("path",{d:"M10.27 12h3.46c.93 0 1.63-.83 1.48-1.75l-.3-1.79C14.67 7.04 13.44 6 12 6S9.33 7.04 9.09 8.47l-.3 1.79c-.15.91.55 1.74 1.48 1.74m-8.61-.89c-.13.26-.18.57-.1.88.16.69.76 1.03 1.53 1h1.95c.83 0 1.51-.58 1.51-1.29 0-.14-.03-.27-.07-.4-.01-.03-.01-.05.01-.08.09-.16.14-.34.14-.53 0-.31-.14-.6-.36-.82-.03-.03-.03-.06-.02-.1.07-.2.07-.43.01-.65-.16-.43-.55-.72-.99-.74-.03 0-.05-.01-.07-.03-.17-.21-.48-.35-.83-.35-.3 0-.57.1-.75.26-.03.03-.06.03-.09.02-.14-.06-.3-.09-.46-.09-.65 0-1.18.49-1.24 1.12 0 .02-.01.04-.03.06-.29.26-.46.65-.41 1.05.03.22.12.43.25.6.03.02.03.06.02.09m14.58 2.54c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9C6.68 14.13 6 15.21 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74m-15.02.93C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58m21.56 0c-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85M22 11v-.5c0-1.1-.9-2-2-2h-2c-.42 0-.65.48-.39.81l.7.63c-.19.31-.31.67-.31 1.06 0 1.1.9 2 2 2s2-.9 2-2"}),"Groups2"),C8=Ee(h.jsx("path",{d:"M13 6.99h3L12 3 8 6.99h3v10.02H8L12 21l4-3.99h-3z"}),"HeightOutlined"),T8=Ee(h.jsx("path",{fillRule:"evenodd",d:"M4 11h16v2H4z"}),"HorizontalRuleOutlined"),x8=Ee(h.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"}),"ImageOutlined"),k8=Ee(h.jsx("path",{d:"M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9"}),"ImageSearchOutlined"),JS=Ee(h.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),ide=Ee(h.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"}),"Language"),w8=Ee(h.jsx("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H8V4h12zm-7-2h2v-3h3V9h-3V6h-2v3h-3v2h3z"}),"LibraryAddOutlined"),KA=Ee(h.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),ade=Ee(h.jsx("path",{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42M5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7"}),"LocalOffer"),Eg=Ee(h.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock"),Sg=Ee(h.jsx("path",{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12z"}),"LockOpen"),sde=Ee(h.jsx("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h3l-1 1v2h12v-2l-1-1h3c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 13H4V5h16z"}),"MonitorOutlined"),ode=Ee(h.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),lde=Ee(h.jsx("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"}),"PhoneIphoneOutlined"),D8=Ee(h.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"}),"PhotoOutlined"),A8=Ee(h.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),Qf=Ee(h.jsx("path",{d:"M19 19h2v2h-2zm0-2h2v-2h-2zM3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm0-4h2V3H3zm4 0h2V3H7zm8 16h2v-2h-2zm-4 0h2v-2h-2zm4 0h2v-2h-2zm-8 0h2v-2H7zm-4 0h2v-2H3zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2z"}),"RoundedCorner"),cde=Ee(h.jsx("path",{d:"M19 19h2v2h-2zm0-2h2v-2h-2zM3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm0-4h2V3H3zm4 0h2V3H7zm8 16h2v-2h-2zm-4 0h2v-2h-2zm4 0h2v-2h-2zm-8 0h2v-2H7zm-4 0h2v-2H3zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2z"}),"RoundedCornerOutlined"),ude=Ee(h.jsx("path",{d:"M4 9h16v2H4zm0 4h10v2H4z"}),"ShortText"),N8=Ee(h.jsx("path",{d:"M22 9v6c0 1.1-.9 2-2 2h-1v-2h1V9H4v6h6v2H4c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2m-7.5 10 1.09-2.41L18 15.5l-2.41-1.09L14.5 12l-1.09 2.41L11 15.5l2.41 1.09zm2.5-5 .62-1.38L19 12l-1.38-.62L17 10l-.62 1.38L15 12l1.38.62zm-2.5 5 1.09-2.41L18 15.5l-2.41-1.09L14.5 12l-1.09 2.41L11 15.5l2.41 1.09zm2.5-5 .62-1.38L19 12l-1.38-.62L17 10l-.62 1.38L15 12l1.38.62z"}),"SmartButtonOutlined"),pM=Ee(h.jsx("path",{d:"M18 9v4H6V9H4v6h16V9z"}),"SpaceBar"),dde=Ee(h.jsx("path",{d:"M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34 1.02-2.34 1.7 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92M21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58.81 2.29 3.29 3.3 5.67 3.3 2.27 0 5.3-.89 5.3-4.05 0-.3-.01-1.16-.48-1.94H21z"}),"StrikethroughS"),pde=Ee(h.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),R8=Ee(h.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFieldsOutlined"),fde=Ee(h.jsx("path",{d:"M5 4v3h5.5v12h3V7H19V4z"}),"Title"),mde=Ee(h.jsx("path",{d:"M16 13h-3V3h-2v10H8l4 4zM4 19v2h16v-2z"}),"VerticalAlignBottomOutlined"),hde=Ee(h.jsx("path",{d:"M8 19h3v4h2v-4h3l-4-4zm8-14h-3V1h-2v4H8l4 4zM4 11v2h16v-2z"}),"VerticalAlignCenterOutlined"),gde=Ee(h.jsx("path",{d:"M8 11h3v10h2V11h3l-4-4zM4 3v2h16V3z"}),"VerticalAlignTopOutlined"),O8=Ee(h.jsx("path",{d:"M3 5v14h18V5zm5.33 12H5V7h3.33zm5.34 0h-3.33V7h3.33zM19 17h-3.33V7H19z"}),"ViewColumnOutlined"),I8=Ee(h.jsx("path",{d:"m16.66 4.52 2.83 2.83-2.83 2.83-2.83-2.83zM9 5v4H5V5zm10 10v4h-4v-4zM9 15v4H5v-4zm7.66-13.31L11 7.34 16.66 13l5.66-5.66zM11 3H3v8h8zm10 10h-8v8h8zm-10 0H3v8h8z"}),"WidgetsOutlined"),_de=Ee(h.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2M4 18V6h2v12zm4 0V6h8v12zm12 0h-2V6h2z"}),"WidthWideOutlined");var mn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(mn||(mn={}));var fM;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(fM||(fM={}));const We=mn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bl=t=>{switch(typeof t){case"undefined":return We.undefined;case"string":return We.string;case"number":return Number.isNaN(t)?We.nan:We.number;case"boolean":return We.boolean;case"function":return We.function;case"bigint":return We.bigint;case"symbol":return We.symbol;case"object":return Array.isArray(t)?We.array:t===null?We.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?We.promise:typeof Map<"u"&&t instanceof Map?We.map:typeof Set<"u"&&t instanceof Set?We.set:typeof Date<"u"&&t instanceof Date?We.date:We.object;default:return We.unknown}},Se=mn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Iu=class M8 extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof M8))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,mn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Iu.create=t=>new Iu(t);const Yk=(t,e)=>{let n;switch(t.code){case Se.invalid_type:t.received===We.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,mn.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${mn.joinValues(t.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${mn.joinValues(t.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${mn.joinValues(t.options)}, received '${t.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:mn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Se.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Se.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=e.defaultError,mn.assertNever(t)}return{message:n}};let bde=Yk;function yde(){return bde}const vde=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}};function Ue(t,e){const n=yde(),r=vde({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Yk?void 0:Yk].filter(i=>!!i)});t.common.issues.push(r)}let da=class P8{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Dt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,s=await i.value;r.push({key:a,value:s})}return P8.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return Dt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}};const Dt=Object.freeze({status:"aborted"}),_m=t=>({status:"dirty",value:t}),Ja=t=>({status:"valid",value:t}),mM=t=>t.status==="aborted",hM=t=>t.status==="dirty",kp=t=>t.status==="valid",sy=t=>typeof Promise<"u"&&t instanceof Promise;var Je;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Je||(Je={}));let oo=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const gM=(t,e)=>{if(kp(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Iu(t.common.issues);return this._error=n,this._error}}};function Gt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}let nn=class{get description(){return this._def.description}_getType(e){return Bl(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Bl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new da,ctx:{common:e.parent.common,data:e.data,parsedType:Bl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(sy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bl(e)},i=this._parseSync({data:e,path:r.path,parent:r});return gM(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bl(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return kp(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>kp(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bl(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(sy(i)?i:Promise.resolve(i));return gM(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:Se.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Mu({schema:this,typeName:At.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Yo.create(this,this._def)}nullable(){return Pu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wp.create(this)}promise(){return py.create(this,this._def)}or(e){return ly.create([this,e],this._def)}and(e){return cy.create(this,e,this._def)}transform(e){return new Mu({...Gt(this._def),schema:this,typeName:At.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new fy({...Gt(this._def),innerType:this,defaultValue:n,typeName:At.ZodDefault})}brand(){return new z8({typeName:At.ZodBranded,type:this,...Gt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new my({...Gt(this._def),innerType:this,catchValue:n,typeName:At.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hde.create(this,e)}readonly(){return hy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const Ede=/^c[^\s-]{8,}$/i,Sde=/^[0-9a-z]+$/,Cde=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tde=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xde=/^[a-z0-9_-]{21}$/i,kde=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wde=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Dde=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ade="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let e1;const Nde=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rde=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ode=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ide=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mde=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pde=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L8="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Lde=new RegExp(`^${L8}$`);function F8(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Fde(t){return new RegExp(`^${F8(t)}$`)}function Bde(t){let e=`${L8}T${F8(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function $de(t,e){return!!((e==="v4"||!e)&&Nde.test(t)||(e==="v6"||!e)&&Ode.test(t))}function Ude(t,e){if(!kde.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function zde(t,e){return!!((e==="v4"||!e)&&Rde.test(t)||(e==="v6"||!e)&&Ide.test(t))}let oy=class bm extends nn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==We.string){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_type,expected:We.string,received:a.parsedType}),Dt}const r=new da;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?Ue(i,{code:Se.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&Ue(i,{code:Se.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Dde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"email",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")e1||(e1=new RegExp(Ade,"u")),e1.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"emoji",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Tde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"uuid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")xde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"nanoid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Ede.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"cuid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")Sde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"cuid2",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Cde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"ulid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ue(i,{validation:"url",code:Se.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"regex",code:Se.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Bde(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Lde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Fde(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?wde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"duration",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?$de(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"ip",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?Ude(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"jwt",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?zde(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"cidr",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Mde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"base64",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?Pde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"base64url",code:Se.invalid_string,message:a.message}),r.dirty()):mn.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Se.invalid_string,...Je.errToObj(r)})}_addCheck(e){return new bm({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Je.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Je.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Je.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Je.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Je.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Je.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Je.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Je.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Je.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Je.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Je.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Je.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Je.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Je.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Je.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Je.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Je.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Je.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Je.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Je.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Je.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Je.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Je.errToObj(n)})}nonempty(e){return this.min(1,Je.errToObj(e))}trim(){return new bm({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new bm({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new bm({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};oy.create=t=>new oy({checks:[],typeName:At.ZodString,coerce:t?.coerce??!1,...Gt(t)});function Gde(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}let Kk=class Qk extends nn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==We.number){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_type,expected:We.number,received:a.parsedType}),Dt}let r;const i=new da;for(const a of this._def.checks)a.kind==="int"?mn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Gde(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.not_finite,message:a.message}),i.dirty()):mn.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Je.toString(n))}setLimit(e,n,r,i){return new Qk({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new Qk({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Je.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Je.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&mn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Kk.create=t=>new Kk({checks:[],typeName:At.ZodNumber,coerce:t?.coerce||!1,...Gt(t)});let _M=class Xk extends nn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==We.bigint)return this._getInvalidInput(e);let r;const i=new da;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):mn.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ue(n,{code:Se.invalid_type,expected:We.bigint,received:n.parsedType}),Dt}gte(e,n){return this.setLimit("min",e,!0,Je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Je.toString(n))}setLimit(e,n,r,i){return new Xk({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new Xk({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_M.create=t=>new _M({checks:[],typeName:At.ZodBigInt,coerce:t?.coerce??!1,...Gt(t)});let Zk=class extends nn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==We.boolean){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.boolean,received:r.parsedType}),Dt}return Ja(e.data)}};Zk.create=t=>new Zk({typeName:At.ZodBoolean,coerce:t?.coerce||!1,...Gt(t)});let bM=class B8 extends nn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==We.date){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_type,expected:We.date,received:a.parsedType}),Dt}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_date}),Dt}const r=new da;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):mn.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new B8({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Je.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Je.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};bM.create=t=>new bM({checks:[],coerce:t?.coerce||!1,typeName:At.ZodDate,...Gt(t)});let yM=class extends nn{_parse(e){if(this._getType(e)!==We.symbol){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.symbol,received:r.parsedType}),Dt}return Ja(e.data)}};yM.create=t=>new yM({typeName:At.ZodSymbol,...Gt(t)});let Jk=class extends nn{_parse(e){if(this._getType(e)!==We.undefined){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.undefined,received:r.parsedType}),Dt}return Ja(e.data)}};Jk.create=t=>new Jk({typeName:At.ZodUndefined,...Gt(t)});let ew=class extends nn{_parse(e){if(this._getType(e)!==We.null){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.null,received:r.parsedType}),Dt}return Ja(e.data)}};ew.create=t=>new ew({typeName:At.ZodNull,...Gt(t)});let vM=class extends nn{constructor(){super(...arguments),this._any=!0}_parse(e){return Ja(e.data)}};vM.create=t=>new vM({typeName:At.ZodAny,...Gt(t)});let EM=class extends nn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ja(e.data)}};EM.create=t=>new EM({typeName:At.ZodUnknown,...Gt(t)});let fc=class extends nn{_parse(e){const n=this._getOrReturnCtx(e);return Ue(n,{code:Se.invalid_type,expected:We.never,received:n.parsedType}),Dt}};fc.create=t=>new fc({typeName:At.ZodNever,...Gt(t)});let SM=class extends nn{_parse(e){if(this._getType(e)!==We.undefined){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.void,received:r.parsedType}),Dt}return Ja(e.data)}};SM.create=t=>new SM({typeName:At.ZodVoid,...Gt(t)});let wp=class fb extends nn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==We.array)return Ue(n,{code:Se.invalid_type,expected:We.array,received:n.parsedType}),Dt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(Ue(n,{code:s?Se.too_big:Se.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ue(n,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ue(n,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new oo(n,s,n.path,o)))).then(s=>da.mergeArray(r,s));const a=[...n.data].map((s,o)=>i.type._parseSync(new oo(n,s,n.path,o)));return da.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new fb({...this._def,minLength:{value:e,message:Je.toString(n)}})}max(e,n){return new fb({...this._def,maxLength:{value:e,message:Je.toString(n)}})}length(e,n){return new fb({...this._def,exactLength:{value:e,message:Je.toString(n)}})}nonempty(e){return this.min(1,e)}};wp.create=(t,e)=>new wp({type:t,minLength:null,maxLength:null,exactLength:null,typeName:At.ZodArray,...Gt(e)});function Fd(t){if(t instanceof rl){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Yo.create(Fd(r))}return new rl({...t._def,shape:()=>e})}else return t instanceof wp?new wp({...t._def,type:Fd(t.element)}):t instanceof Yo?Yo.create(Fd(t.unwrap())):t instanceof Pu?Pu.create(Fd(t.unwrap())):t instanceof Rh?Rh.create(t.items.map(e=>Fd(e))):t}let rl=class ss extends nn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=mn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==We.object){const c=this._getOrReturnCtx(e);return Ue(c,{code:Se.invalid_type,expected:We.object,received:c.parsedType}),Dt}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof fc&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=a[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new oo(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof fc){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(Ue(i,{code:Se.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new oo(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,p=await u.value;c.push({key:d,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>da.mergeObjectSync(r,c)):da.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Je.errToObj,new ss({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Je.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ss({...this._def,unknownKeys:"strip"})}passthrough(){return new ss({...this._def,unknownKeys:"passthrough"})}extend(e){return new ss({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ss({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:At.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ss({...this._def,catchall:e})}pick(e){const n={};for(const r of mn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ss({...this._def,shape:()=>n})}omit(e){const n={};for(const r of mn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new ss({...this._def,shape:()=>n})}deepPartial(){return Fd(this)}partial(e){const n={};for(const r of mn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new ss({...this._def,shape:()=>n})}required(e){const n={};for(const r of mn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Yo;)a=a._def.innerType;n[r]=a}return new ss({...this._def,shape:()=>n})}keyof(){return U8(mn.objectKeys(this.shape))}};rl.create=(t,e)=>new rl({shape:()=>t,unknownKeys:"strip",catchall:fc.create(),typeName:At.ZodObject,...Gt(e)});rl.strictCreate=(t,e)=>new rl({shape:()=>t,unknownKeys:"strict",catchall:fc.create(),typeName:At.ZodObject,...Gt(e)});rl.lazycreate=(t,e)=>new rl({shape:t,unknownKeys:"strip",catchall:fc.create(),typeName:At.ZodObject,...Gt(e)});let ly=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new Iu(o.ctx.common.issues));return Ue(n,{code:Se.invalid_union,unionErrors:s}),Dt}if(n.common.async)return Promise.all(r.map(async a=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(l=>new Iu(l));return Ue(n,{code:Se.invalid_union,unionErrors:o}),Dt}}get options(){return this._def.options}};ly.create=(t,e)=>new ly({options:t,typeName:At.ZodUnion,...Gt(e)});const Fo=t=>t instanceof rw?Fo(t.schema):t instanceof Mu?Fo(t.innerType()):t instanceof dy?[t.value]:t instanceof mE?t.options:t instanceof aw?mn.objectValues(t.enum):t instanceof fy?Fo(t._def.innerType):t instanceof Jk?[void 0]:t instanceof ew?[null]:t instanceof Yo?[void 0,...Fo(t.unwrap())]:t instanceof Pu?[null,...Fo(t.unwrap())]:t instanceof z8||t instanceof hy?Fo(t.unwrap()):t instanceof my?Fo(t._def.innerType):[];class QA extends nn{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==We.object)return Ue(n,{code:Se.invalid_type,expected:We.object,received:n.parsedType}),Dt;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(Ue(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const a of n){const s=Fo(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new QA({typeName:At.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Gt(r)})}}function tw(t,e){const n=Bl(t),r=Bl(e);if(t===e)return{valid:!0,data:t};if(n===We.object&&r===We.object){const i=mn.objectKeys(e),a=mn.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const l=tw(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===We.array&&r===We.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],l=tw(s,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===We.date&&r===We.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}let cy=class extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(mM(a)||mM(s))return Dt;const o=tw(a.value,s.value);return o.valid?((hM(a)||hM(s))&&n.dirty(),{status:n.value,value:o.data}):(Ue(r,{code:Se.invalid_intersection_types}),Dt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};cy.create=(t,e,n)=>new cy({left:t,right:e,typeName:At.ZodIntersection,...Gt(n)});let Rh=class $8 extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.array)return Ue(r,{code:Se.invalid_type,expected:We.array,received:r.parsedType}),Dt;if(r.data.length<this._def.items.length)return Ue(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Dt;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new oo(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>da.mergeArray(n,s)):da.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new $8({...this._def,rest:e})}};Rh.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rh({items:t,typeName:At.ZodTuple,rest:null,...Gt(e)})};class uy extends nn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.object)return Ue(r,{code:Se.invalid_type,expected:We.object,received:r.parsedType}),Dt;const i=[],a=this._def.keyType,s=this._def.valueType;for(const o in r.data)i.push({key:a._parse(new oo(r,o,r.path,o)),value:s._parse(new oo(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?da.mergeObjectAsync(n,i):da.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof nn?new uy({keyType:e,valueType:n,typeName:At.ZodRecord,...Gt(r)}):new uy({keyType:oy.create(),valueType:e,typeName:At.ZodRecord,...Gt(n)})}}let CM=class extends nn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.map)return Ue(r,{code:Se.invalid_type,expected:We.map,received:r.parsedType}),Dt;const i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new oo(r,o,r.path,[c,"key"])),value:a._parse(new oo(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Dt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Dt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}};CM.create=(t,e,n)=>new CM({valueType:e,keyType:t,typeName:At.ZodMap,...Gt(n)});let TM=class nw extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.set)return Ue(r,{code:Se.invalid_type,expected:We.set,received:r.parsedType}),Dt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ue(r,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ue(r,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Dt;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>a._parse(new oo(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new nw({...this._def,minSize:{value:e,message:Je.toString(n)}})}max(e,n){return new nw({...this._def,maxSize:{value:e,message:Je.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};TM.create=(t,e)=>new TM({valueType:t,minSize:null,maxSize:null,typeName:At.ZodSet,...Gt(e)});let rw=class extends nn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};rw.create=(t,e)=>new rw({getter:t,typeName:At.ZodLazy,...Gt(e)});let dy=class extends nn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ue(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),Dt}return{status:"valid",value:e.data}}get value(){return this._def.value}};dy.create=(t,e)=>new dy({value:t,typeName:At.ZodLiteral,...Gt(e)});function U8(t,e){return new mE({values:t,typeName:At.ZodEnum,...Gt(e)})}let mE=class iw extends nn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ue(n,{expected:mn.joinValues(r),received:n.parsedType,code:Se.invalid_type}),Dt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ue(n,{received:n.data,code:Se.invalid_enum_value,options:r}),Dt}return Ja(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return iw.create(e,{...this._def,...n})}exclude(e,n=this._def){return iw.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};mE.create=U8;let aw=class extends nn{_parse(e){const n=mn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==We.string&&r.parsedType!==We.number){const i=mn.objectValues(n);return Ue(r,{expected:mn.joinValues(i),received:r.parsedType,code:Se.invalid_type}),Dt}if(this._cache||(this._cache=new Set(mn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=mn.objectValues(n);return Ue(r,{received:r.data,code:Se.invalid_enum_value,options:i}),Dt}return Ja(e.data)}get enum(){return this._def.values}};aw.create=(t,e)=>new aw({values:t,typeName:At.ZodNativeEnum,...Gt(e)});let py=class extends nn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==We.promise&&n.common.async===!1)return Ue(n,{code:Se.invalid_type,expected:We.promise,received:n.parsedType}),Dt;const r=n.parsedType===We.promise?n.data:Promise.resolve(n.data);return Ja(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};py.create=(t,e)=>new py({type:t,typeName:At.ZodPromise,...Gt(e)});let Mu=class extends nn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===At.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{Ue(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return Dt;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?Dt:l.status==="dirty"||n.value==="dirty"?_m(l.value):l});{if(n.value==="aborted")return Dt;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?Dt:o.status==="dirty"||n.value==="dirty"?_m(o.value):o}}if(i.type==="refinement"){const s=o=>{const l=i.refinement(o,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Dt:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Dt:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!kp(s))return Dt;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>kp(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):Dt);mn.assertNever(i)}};Mu.create=(t,e,n)=>new Mu({schema:t,typeName:At.ZodEffects,effect:e,...Gt(n)});Mu.createWithPreprocess=(t,e,n)=>new Mu({schema:e,effect:{type:"preprocess",transform:t},typeName:At.ZodEffects,...Gt(n)});let Yo=class extends nn{_parse(e){return this._getType(e)===We.undefined?Ja(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Yo.create=(t,e)=>new Yo({innerType:t,typeName:At.ZodOptional,...Gt(e)});let Pu=class extends nn{_parse(e){return this._getType(e)===We.null?Ja(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pu.create=(t,e)=>new Pu({innerType:t,typeName:At.ZodNullable,...Gt(e)});let fy=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===We.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};fy.create=(t,e)=>new fy({innerType:t,typeName:At.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Gt(e)});let my=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sy(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Iu(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Iu(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};my.create=(t,e)=>new my({innerType:t,typeName:At.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Gt(e)});let xM=class extends nn{_parse(e){if(this._getType(e)!==We.nan){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.nan,received:r.parsedType}),Dt}return{status:"valid",value:e.data}}};xM.create=t=>new xM({typeName:At.ZodNaN,...Gt(t)});let z8=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Hde=class G8 extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Dt:a.status==="dirty"?(n.dirty(),_m(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Dt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new G8({in:e,out:n,typeName:At.ZodPipeline})}},hy=class extends nn{_parse(e){const n=this._def.innerType._parse(e),r=i=>(kp(i)&&(i.value=Object.freeze(i.value)),i);return sy(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};hy.create=(t,e)=>new hy({innerType:t,typeName:At.ZodReadonly,...Gt(e)});var At;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(At||(At={}));const Pt=oy.create,Le=Kk.create,Dp=Zk.create;fc.create;const Wm=wp.create,xt=rl.create,ap=ly.create,jde=QA.create;cy.create;const H8=Rh.create,qde=uy.create,sw=dy.create,yr=mE.create;py.create;Yo.create;Pu.create;function h_(t,e){return!t||t&&t[e]===0?"initial":t[e]!==void 0?`${t[e]}px solid ${t?.color??"black"}`:"initial"}function ki({className:t,background:e,backgroundColor:n,padding:r={top:0,right:0,bottom:0,left:0},width:i,align:a,children:s,border:o,borderRadius:l,isParent:c=!0,overflow:u="visible"}){const d=t?`a${t}`:"",p={width:i,minWidth:i,borderRadius:l??"initial",borderTop:h_(o,"top"),borderBottom:h_(o,"bottom"),borderLeft:h_(o,"left"),borderRight:h_(o,"right"),overflow:u,borderCollapse:"initial"};return e&&String(e).trim()!==""?p.background=e:n&&(p.backgroundColor=n),h.jsx("table",{className:t,width:i,border:0,cellSpacing:"0",cellPadding:"0",style:p,children:h.jsxs("tbody",{children:[h.jsxs("tr",{height:r.top,style:{height:`${r.top}px`},className:c?`t${t}`:`it${t}`,children:[h.jsx("td",{style:{width:`${r.left}px`},className:c?`l${t}`:`il${t}`}),h.jsx("td",{}),h.jsx("td",{style:{width:`${r.right}px`},className:c?`r${t}`:`ir${t}`})]}),h.jsxs("tr",{children:[h.jsx("td",{style:{width:`${r.left}px`},className:c?`l${t}`:`il${t}`}),h.jsx("td",{className:d,align:a,children:s}),h.jsx("td",{style:{width:`${r.right}px`},className:c?`r${t}`:`ir${t}`})]}),h.jsxs("tr",{height:r.bottom,style:{height:`${r.bottom}px`},className:c?`b${t}`:`ib${t}`,children:[h.jsx("td",{style:{width:`${r.left}px`},className:c?`l${t}`:`il${t}`}),h.jsx("td",{}),h.jsx("td",{style:{width:`${r.right}px`},className:c?`r${t}`:`ir${t}`})]})]})})}const Ju=(t,e)=>{const n=/#([0-9a-fA-F]{3,6})\b/;return n.test(t)?t.replace(n,e):t.trim()===""?e:t.replace(/^(\S+)/,`$1 ${e}`)};function gy(t){const e=t?.shape??"rectangle";if(typeof e=="string")switch(e){case"rectangle":return;case"pill":return 9999;default:return}else if(typeof e=="object"&&e!==null){const{topLeft:n=0,topRight:r=0,bottomLeft:i=0,bottomRight:a=0}=e;return`${r}px ${n}px ${a}px ${i}px`}}function Vde(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=(e>>>0)*16777619;return e>>>0}function Wde(t){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";if(t===0)return"a";let n="";for(;t>0;)n=e[t%62]+n,t=Math.floor(t/62);return n}function tn(t){const e=Vde(t);return`b${Wde(e)}`}const kM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),j8=xt({style:xt({textAlign:yr(["left","center","right"]).optional().nullable(),padding:kM,mobilePadding:kM,backgroundColor:Pt().optional()}).passthrough().optional().nullable(),props:xt({size:Le().gt(0).optional().nullable(),shape:yr(["circle","square","rounded"]).optional().nullable(),imageUrl:Pt().optional().nullable(),alt:Pt().optional().nullable()}).optional().nullable()}).passthrough(),lu={size:64,imageUrl:"",alt:"",shape:"square"};function q8({style:t,props:e,blockId:n}){const r=e?.size??lu.size,i=e?.imageUrl??lu.imageUrl,a=e?.alt??lu.alt;e?.shape??lu.shape;const s=dE(),o={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},l=h.jsx(ki,{isParent:!1,children:h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:a??"",src:i??"",width:r,style:{width:r,height:"auto",outline:"none",border:"none",textDecoration:"none",verticalAlign:t?.contentAlignment??"middle",display:"inline-block",maxWidth:"100%",opacity:s.uploading&&s.id===n?.5:1,transition:"opacity 0.2s ease-in-out"}}),s.uploading&&s.id===n&&h.jsx("div",{style:o,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})]})}),c=tn(n);return h.jsx(ki,{className:`${c}`,padding:t.padding,backgroundColor:t.backgroundColor,align:t.textAlign,width:"100%",children:l})}function es({title:t,children:e}){return h.jsxs(Ah,{sx:{padding:"0!important",paddingTop:"1rem!important"},children:[h.jsx(er,{sx:{fontWeight:"bold",mb:2,pb:1,color:"text.primary",fontSize:"1.25rem",borderBottom:n=>`1px solid ${n.palette.divider}`},children:t}),h.jsx(Mn,{spacing:2,gap:1,mb:3,pt:1,children:e})]})}const Wn=({label:t})=>{const e=dr();return t?h.jsx("p",{style:{fontWeight:"bold",color:e.palette.text.primary},children:t}):null},ri=({children:t})=>h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.3rem"},children:t.map(e=>e)}),Yde=me(tt)(({theme:t})=>({display:"flex",alignItems:"center",border:`1px solid ${t.palette.divider}`,borderRadius:"8px",padding:"4px",minWidth:58,maxWidth:"fit-content",backgroundColor:t.palette.background.paper,"&:hover":{borderColor:t.palette.primary.main},"&:focus-within":{borderColor:t.palette.primary.main,boxShadow:`0 0 0 1px ${t.palette.primary.main}`}})),Kde=me("input")(({theme:t})=>({border:"none",outline:"none",background:"transparent",textAlign:"center",width:"27px",minWidth:"27px",maxWidth:"27px",padding:"0!important",lineHeight:"normal",fontSize:"0.9rem",color:t.palette.text.primary,"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"&[type=number]":{MozAppearance:"textfield"}})),wM=me(Qt)(({theme:t})=>({padding:"0",color:t.palette.primary.main,"&:hover":{backgroundColor:Ae(t.palette.primary.main,.04)},"& .MuiSvgIcon-root":{fontSize:14}}));function vr({iconLabel:t,label:e,value:n,setValue:r,units:i,min:a=0,max:s,step:o=void 0,marks:l=!0,...c}){const u=n??a,[d,p]=D.useState(u.toString()),f=E=>{let C=E;C<a&&(C=a),s!==void 0&&C>s&&(C=s),r(C),p(C.toString())},m=E=>{const C=E.target.value;if(p(C),C!==""){const T=Number(C);isNaN(T)||T>=a&&r(T)}},g=()=>{if(d===""||isNaN(Number(d)))p(u.toString());else{const E=Number(d);f(E)}},_=E=>{E.key==="Enter"&&g()};D.useEffect(()=>{p((n??a).toString())},[n,a]);const b=()=>{const E=u+1;f(E)},y=()=>{const E=u-1;f(E)},v=(E,C)=>{typeof C=="number"&&r(C)};return h.jsxs(ri,{children:[h.jsx(Wn,{label:e}),h.jsxs(Mn,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",width:"100%",children:[h.jsx(tt,{sx:{minWidth:24,lineHeight:1,flexShrink:0},children:t}),h.jsx(woe,{...c,value:u,min:a,max:s||1e3,step:o,color:"primary",marks:l,onChange:v}),h.jsxs(Yde,{children:[h.jsx(Kde,{type:"number",value:d,onChange:m,onBlur:g,onKeyDown:_,min:a,max:s,step:o}),h.jsxs(tt,{sx:{display:"flex",flexDirection:"column",ml:.5},children:[h.jsx(wM,{onClick:b,disabled:s!==void 0&&u>=s,children:h.jsx("svg",{width:"15",height:"10",viewBox:"0 0 24 12",children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"m6 9l6-6l6 6"})})}),h.jsx(wM,{onClick:y,disabled:u<=a,children:h.jsx("svg",{width:"15",height:"10",viewBox:"0 0 24 12",style:{transform:"rotate(180deg)"},children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"m6 9l6-6l6 6"})})})]})]}),h.jsx(er,{variant:"caption",color:"text.secondary",sx:{fontSize:"16px",ml:"4px!important"},children:i})]})]})}function ru({label:t,defaultValue:e,onChange:n,...r}){const[i,a]=D.useState(e??0);return e!=i&&a(e),h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(vr,{value:i??0,setValue:s=>{a(s),n(s)},...r})]})}function Qde(t,e){const n=D.useRef(null),r=D.useRef(t),i=D.useRef([]);r.current=t;const a=D.useCallback((...s)=>{i.current=s,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...s),n.current=null},e)},[e]);return a.flush=D.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null,r.current(...i.current))},[]),a}const sp=36,XA=8,hE={width:"100%","& .MuiInputBase-root":{"&:not(.MuiInputBase-multiline)":{height:`${sp}px`}},"& .MuiOutlinedInput-root":{borderRadius:`${XA}px`,"&:not(.MuiInputBase-multiline)":{height:`${sp}px`}},"& .MuiInputBase-input":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"12px",height:"unset"}},Xde={width:"100%",height:`${sp}px`,paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"12px",display:"flex",alignItems:"center",borderRadius:`${XA}px`};function Lu({helperText:t,label:e,placeholder:n,rows:r,InputProps:i,defaultValue:a,onChange:s}){const[o,l]=D.useState(a);D.useEffect(()=>{o!==a&&l(a)},[a]);const c=Qde(d=>{s(d)},150),u=typeof r=="number"&&r>1;return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx(Wn,{label:e}),h.jsx(df,{fullWidth:!0,multiline:u,minRows:r,variant:"outlined",placeholder:n,helperText:t,InputProps:i,value:o,sx:hE,onChange:d=>{const p=d.target.value;l(p),c(p)},onBlur:()=>{c.flush()}})]})}function Zde({onClick:t,disabled:e,primary:n=!1}){const{t:r}=Ot.useTranslation("inspector");return h.jsx(Qt,{"aria-label":r("inputs.common.close"),onClick:t,disabled:e,sx:{position:"absolute",right:8,top:8,color:i=>n?"brand.blue":i.palette.grey[500],"&:hover":{opacity:.8}},children:h.jsx(fE,{})})}function Jde({imageUrl:t,saving:e=!1}){return h.jsxs(Bre,{sx:{position:"relative"},children:[e&&h.jsx(Mn,{justifyContent:"center",alignItems:"center",sx:{position:"absolute",top:7,left:0,width:"100%",height:"314px",zIndex:20,backgroundColor:"#212121AA",mb:1},children:h.jsx(pc,{size:48,thickness:6,color:"inherit",sx:{color:"white"}})}),h.jsx(qre,{component:"img",sx:{objectFit:"contain",width:"100%",height:"326px"},image:t,alt:"Generated Image"})]})}function epe({value:t,onChange:e,disabled:n}){return h.jsxs(h.Fragment,{children:[h.jsx(er,{sx:{fontSize:"14px",fontWeight:700},children:"Image description"}),h.jsx(df,{disabled:n,autoFocus:!0,margin:"dense",id:"prompt",placeholder:"Enter a detailed description here...",type:"text",fullWidth:!0,multiline:!0,rows:4,variant:"outlined",value:t,onChange:r=>e(r.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:"8px"}}})]})}const tpe=t=>({400:{code:400,title:t.title||"Invalid Request",message:t.message||"The request was invalid. Please check your input and try again.",action:t.action||"Modify your prompt and try again"},401:{code:401,title:t.title||"Authentication Required",message:t.message||"You need to be authenticated to perform this action.",action:t.action||"Please log in and try again"},403:{code:403,title:t.title||"Access Denied",message:t.message||"You don't have permission to perform this action.",action:t.action||"Contact support if you believe this is a mistake"},404:{code:404,title:t.title||"Not Found",message:t.message||"The requested resource was not found.",action:t.action||"Try again or use a different prompt"},422:{code:422,title:t.title||"Invalid Input",message:t.message||"The provided input cannot be processed.",action:t.action||"Modify your prompt and try again"},429:{code:429,title:t.title||"Too Many Requests",message:t.message||"You've made too many requests. Please wait a moment.",action:t.action||"Please wait a few minutes before trying again"},500:{code:500,title:t.title||"Server Error",message:t.message||"An unexpected error occurred on our servers.",action:t.action||"Please try again later"},502:{code:502,title:t.title||"Bad Gateway",message:t.message||"The server received an invalid response.",action:t.action||"Please try again later"},503:{code:503,title:t.title||"Service Unavailable",message:t.message||"The service is temporarily unavailable.",action:t.action||"Please try again later"}})[t.code]||{code:t.code,title:"Unexpected Error",message:"An unexpected error occurred.",action:"Please try again later"};function V8({src:t,style:e}){const{t:n}=Ot.useTranslation("inspector"),[r,i]=D.useState(!1),[a,s]=D.useState(!1),[o,l]=D.useState(""),[c,u]=D.useState(null),[d,p]=D.useState(!1),[f,m]=D.useState(null),[g,_]=D.useState(!1),b=()=>{i(!0),m(null)},y=()=>{a||(i(!1),s(!1),u(null),l(""),p(!1),m(null),_(!1))},v=()=>{const T=c&&!d?"store-ai-image":"request-ai-image",S=c&&!d?c:o;m(null),T==="store-ai-image"?(_(!0),s(!1),setTimeout(()=>{s(!1),y()},2e3)):s(!0),window.dispatchEvent(new CustomEvent(T,{detail:S}))},E=()=>{p(!0),u(null),m(null),_(!1)};D.useEffect(()=>{const T=S=>{const{detail:x}=S;if(s(!1),x.error){m(tpe(x.error));return}if(!x.success||!x.url){m({code:0,title:"Generation Failed",message:"Failed to generate the image.",action:"Please try again"});return}u(x.url),p(!1)};return window.addEventListener("generated-image",T),()=>{window.removeEventListener("generated-image",T)}},[]),D.useEffect(()=>{y()},[t]);const C=!c||d;return h.jsxs(h.Fragment,{children:[h.jsx(di,{style:e,startIcon:h.jsx(Wk,{className:"w-4 h-4"}),variant:"contained",onClick:b,children:n("inputs.aiImageGeneration.generate")}),h.jsx(Iie,{open:r,onClose:y,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{bgcolor:"background.paper",color:"text.primary",borderRadius:"8px"}},children:h.jsxs("form",{onSubmit:T=>{T.preventDefault(),v()},children:[h.jsxs(eae,{sx:{fontWeight:700,fontSize:"24px",color:f?"error.main":"inherit"},children:[n(f?"inputs.aiImageGeneration.titleError":a?"inputs.aiImageGeneration.titleLoading":c?"inputs.aiImageGeneration.titleReady":"inputs.aiImageGeneration.titleCreate"),h.jsx(Zde,{onClick:y,disabled:a,primary:!0})]}),h.jsxs(qie,{children:[h.jsx(Qie,{sx:{pb:1,color:f?"error.dark":"inherit"},children:n(f?"inputs.aiImageGeneration.descriptionError":a?"inputs.aiImageGeneration.descriptionLoading":C?"inputs.aiImageGeneration.descriptionCreate":"inputs.aiImageGeneration.descriptionReady")}),c&&!d?h.jsxs(Mn,{sx:{position:"relative"},children:[h.jsx(Jde,{imageUrl:c,saving:g}),h.jsxs(tc,{variant:"outlined",severity:"warning",icon:!1,children:[n("inputs.aiImageGeneration.warningRegenerate")," ",h.jsx("b",{children:n("inputs.aiImageGeneration.warningInsertFirst")})," ",n("inputs.aiImageGeneration.warningFirst")]})]}):a&&!c?h.jsx(Mn,{justifyContent:"center",alignItems:"center",sx:{backgroundColor:T=>T.palette.mainColor[50],height:"326px",width:"100%"},children:h.jsx(pc,{size:48,thickness:6})}):h.jsx(epe,{value:o,onChange:l,disabled:a})]}),!a&&h.jsxs(Bie,{className:"p-6",children:[c&&!d&&h.jsx(di,{startIcon:h.jsx(A8,{className:"w-4 h-4"}),onClick:E,variant:"outlined",disabled:a,children:n("inputs.aiImageGeneration.regenerate")}),!c&&!d&&h.jsx(di,{onClick:y,variant:"text",disabled:d,children:n("inputs.aiImageGeneration.cancel")}),h.jsxs(di,{startIcon:c&&!d?h.jsx(Due,{className:"w-4 h-4"}):h.jsx(Wk,{className:"w-4 h-4"}),onClick:v,variant:"contained",disabled:!o||o?.length<20,children:[n(c&&!d?"inputs.aiImageGeneration.insertImage":"inputs.aiImageGeneration.generateImage"),a&&h.jsx(pc,{size:16,className:"ml-2"})]})]})]})})]})}const npe=({className:t,...e})=>h.jsx("svg",{width:"15",height:"10",viewBox:"0 0 24 12",className:t,"aria-hidden":"true",focusable:"false",...e,children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"m6 3l6 6l6-6"})}),rpe=me(PA)(({theme:t})=>({fontFamily:t.typography.fontFamily,color:t.palette.text.primary,backgroundColor:t.palette.background.input??t.palette.grey[100],width:"100%",height:`${sp}px`,"&.MuiInputBase-root, &.MuiOutlinedInput-root":{height:`${sp}px`,minHeight:`${sp}px`,boxSizing:"border-box",borderRadius:`${XA}px`,border:`1px solid ${t.palette.divider}`},"&& .MuiSelect-select, && .MuiInputBase-input":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"36px",lineHeight:"20px",minHeight:"unset"},"& .MuiSelect-icon":{color:t.palette.secondary.main,right:12,top:"calc(50% - 4px)",transition:"transform 200ms ease",pointerEvents:"none"},"& .MuiSelect-iconOpen":{transform:"rotate(180deg)"},"&:hover":{backgroundColor:t.palette.grey[200]},"&.Mui-focused":{borderColor:t.palette.primary.main}})),mc=D.forwardRef((t,e)=>{const n=dr(),r={backgroundColor:n.palette.background.input??n.palette.grey[100],marginTop:"4px",borderRadius:"10px",border:`1px solid ${n.palette.divider}`,boxShadow:`0 1px 3px ${Ae("#000000",.6)}`,color:n.palette.text.primary},i={...t.MenuProps?.PaperProps,sx:{...typeof t.MenuProps?.PaperProps?.sx=="object"&&t.MenuProps.PaperProps?.sx,...r}},a=t.MenuProps?.slotProps??{},s=a.paper??{};return h.jsx(rpe,{ref:e,...t,IconComponent:npe,MenuProps:{...t.MenuProps,PaperProps:i,slotProps:{...a,paper:{...s,...i,sx:{...typeof s.sx=="object"&&s.sx,...typeof t.MenuProps?.PaperProps?.sx=="object"&&t.MenuProps.PaperProps?.sx,...r}}}}})});mc.displayName="CustomSelect";const ipe=({defaultValue:t,onChange:e,values:n})=>{const r=pf(),{t:i}=Ot.useTranslation("inspector"),a=dr(),s=()=>h.jsx(xh,{viewBox:"0 0 18 18",fontSize:"small",children:h.jsx("path",{d:"M9.00015 6.75V8.25M9.00015 11.25H9.00765M3.804 14.25H14.1963C15.351 14.25 16.0727 13 15.4953 12L10.2992 3C9.72184 2 8.27846 2 7.70111 3L2.50496 12C1.92761 13 2.6493 14.25 3.804 14.25Z",stroke:"#F59E0B",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})}),o=Y=>{if(!Y)return{url:"",repeat:"no-repeat",position:"center center",size:"cover"};const te=Y.match(/url\("([^"]+)"\)/),Oe=te?te[1]:"";let ye="no-repeat";Y.includes("repeat-x")?ye="repeat-x":Y.includes("repeat-y")?ye="repeat-y":Y.includes("repeat")&&!Y.includes("no-repeat")&&(ye="repeat");let be="center center";const he=["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"];for(const nt of he)if(Y.includes(nt)){be=nt;break}let Ke="cover";return Y.includes("contain")?Ke="contain":Y.includes("auto")&&(Ke="auto"),{url:Oe,repeat:ye,position:be,size:Ke}},l=Y=>Y.url?`url("${Y.url}") ${Y.repeat} ${Y.position} / ${Y.size}`:"",[c,u]=D.useState(t||null),[d,p]=D.useState(o(t)),[f,m]=D.useState(!1),[g,_]=D.useState(()=>!!window.__emailBuilderEnableAI),[,b]=D.useState(null),[y,v]=D.useState(o(t).url||""),[E,C]=D.useState(!1),[T,S]=D.useState(""),[x,k]=D.useState(!1),w=D.useRef(null),A=WA(),[L,O]=D.useState(null);D.useEffect(()=>{const Y=window.__emailBuilderCustomImageProvider;Y&&(O(Y),setTimeout(()=>{r&&window.dispatchEvent(new CustomEvent("email-builder-image-panel-opened",{detail:{blockId:r,currentImageUrl:d.url||null,alt:null}}))},100))},[]);const[I,P]=D.useState(()=>sessionStorage.getItem("hideBackgroundImageWarning")==="true"),M=(Y,te)=>{const Oe={...d,...Y};if(p(Oe),Oe.url){const ye=l(Oe);u(ye),e(ye,te)}else console.error("Update params error: ",Oe)},F=(Y,te)=>{if(!Y)return!1;const Oe=Y?.toLowerCase(),ye=Oe.includes(".svg")||Oe.includes("svg"),be=te&&(te.includes("image/svg+xml")||te.includes("svg"));return ye||!!be},U=async Y=>{try{C(!0),S(""),k(!1);try{new URL(Y)}catch{return S("Invalid URL format"),!1}const te=new AbortController,Oe=setTimeout(()=>te.abort(),1e4);try{const ye=await fetch(Y,{method:"HEAD",signal:te.signal});if(clearTimeout(Oe),!ye.ok)return S(`HTTP ${ye.status}: ${ye.statusText}`),!1;const be=ye.headers.get("content-type");return["image/","image/svg+xml","text/xml","application/xml"].some(nt=>be&&be.toLowerCase().includes(nt.toLowerCase()))?(F(Y,be)&&k(!0),S(""),!0):(S("URL does not point to an image"),!1)}catch(ye){return clearTimeout(Oe),ye.name==="AbortError"?(S("Request timeout - URL took too long to respond"),!1):new Promise(be=>{const he=new Image,Ke=setTimeout(()=>{S("Request timeout - URL took too long to respond"),be(!1)},1e4);he.onload=()=>{clearTimeout(Ke),F(Y)&&k(!0),S(""),be(!0)},he.onerror=()=>{clearTimeout(Ke),S("Cannot access image - CORS policy, network error, or invalid URL"),be(!1)},he.src=Y})}}catch{return S("Unexpected error occurred while validating URL"),!1}finally{C(!1)}},j=async()=>{y.trim()&&await U(y.trim())&&M({url:y.trim()})},V=Y=>{Y.key==="Enter"&&j()},X=Y=>{v(Y.target.value),T&&S(""),x&&k(!1)},W=Y=>{const te=["image/png","image/jpeg","image/gif"],ye=Array.from(Y),be=ye.filter(Ke=>te.includes(Ke.type)&&Ke.size<=5242880);if(be.length!==ye.length&&alert(i("inputs.common.invalidFiles")),be.length===0)return;const he=be.map(Ke=>new Promise(nt=>{const pt=new FileReader;pt.onload=Jt=>nt(Jt.target?.result),pt.readAsDataURL(Ke)}));Promise.all(he).then(Ke=>{const nt={images:Ke,id:r||"",styles:n};window.dispatchEvent(new CustomEvent("email-builder-upload-image",{detail:nt})),ip(!0,r||"")})},ge=Y=>{Y.preventDefault(),m(!0)},ie=()=>{m(!1)},we=Y=>{Y.preventDefault(),m(!1);const te=Y.dataTransfer.files;W(te)},ne=()=>{const Y=new CustomEvent("toggle-media-library",{detail:!0});window.dispatchEvent(Y)},Ce=()=>{p({url:"",repeat:"no-repeat",position:"center center",size:"cover"}),u(null),e(null),v(""),k(!1)},de=Y=>{switch(Y){case"top left":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M5.26523 9.79159L5.17094 5.17183M5.17094 5.17183L9.79071 5.26611M5.17094 5.17183L10.8278 10.8287",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"top center":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M4.7998 7.33333L7.9998 4M7.9998 4L11.1998 7.33333M7.9998 4V12",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"top right":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M6.20841 5.2662L10.8282 5.17192M10.8282 5.17192L10.7339 9.79169M10.8282 5.17192L5.17132 10.8288",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"center left":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M7.33333 11.2002L4 8.00019M4 8.00019L7.33333 4.8002M4 8.00019L12 8.0002",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"center center":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M2.40039 5.20039V2.40039M2.40039 2.40039H5.20039M2.40039 2.40039L5.90039 5.90039M13.6004 5.20039V2.40039M13.6004 2.40039H10.8004M13.6004 2.40039L10.1004 5.90039M2.40039 10.8004V13.6004M2.40039 13.6004H5.20039M2.40039 13.6004L5.90039 10.1004M13.6004 13.6004L10.1004 10.1004M13.6004 13.6004V10.8004M13.6004 13.6004H10.8004",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"center right":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M8.66667 4.7998L12 7.9998M12 7.9998L8.66667 11.1998M12 7.9998L4 7.9998",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"bottom left":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9.79062 10.7348L5.17085 10.8291M5.17085 10.8291L5.26513 6.20929M5.17085 10.8291L10.8277 5.1722",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"bottom center":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M11.1998 8.66667L7.9998 12M7.9998 12L4.7998 8.66667M7.9998 12L7.99981 4",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"bottom right":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M10.7338 6.20938L10.8281 10.8291M10.8281 10.8291L6.20831 10.7349M10.8281 10.8291L5.17122 5.17229",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});default:return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M2.40039 5.20039V2.40039M2.40039 2.40039H5.20039M2.40039 2.40039L5.90039 5.90039M13.6004 5.20039V2.40039M13.6004 2.40039H10.8004M13.6004 2.40039L10.1004 5.90039M2.40039 10.8004V13.6004M2.40039 13.6004H5.20039M2.40039 13.6004L5.90039 10.1004M13.6004 13.6004L10.1004 10.1004M13.6004 13.6004V10.8004M13.6004 13.6004H10.8004",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})}},Te=Y=>({"top left":i("inputs.backgroundImage.positions.topLeft"),"top center":i("inputs.backgroundImage.positions.topCenter"),"top right":i("inputs.backgroundImage.positions.topRight"),"center left":i("inputs.backgroundImage.positions.centerLeft"),"center center":i("inputs.backgroundImage.positions.center"),"center right":i("inputs.backgroundImage.positions.centerRight"),"bottom left":i("inputs.backgroundImage.positions.bottomLeft"),"bottom center":i("inputs.backgroundImage.positions.bottomCenter"),"bottom right":i("inputs.backgroundImage.positions.bottomRight")})[Y]??i("inputs.backgroundImage.positions.center");return D.useEffect(()=>{const Y=window.__emailBuilderEnableAI;Y!==void 0&&_(!!Y);const te=Oe=>{const{detail:ye}=Oe;_(!!ye)};return window.addEventListener("email-builder-ai-generation",te),()=>{window.removeEventListener("email-builder-ai-generation",te)}},[]),D.useEffect(()=>{const Y=be=>{const{detail:he}=be;ip(!1,he.id||""),M({url:he.url},he.styles),p8(!1),v(he.url)},te=be=>{ip(be?.detail?.uploading??!1,be?.detail?.id??"")},Oe=()=>{w?.current?.click()},ye=be=>{const{detail:he}=be;if(he&&!he.includes("url("))M({url:he},he.styles),v(he);else{const Ke=o(he);p(Ke),u(he),e(he),v(Ke.url)}};return window.addEventListener("email-builder-set-image",ye),window.addEventListener("email-builder-upload-image-receive",Y),window.addEventListener("email-builder-upload-file",Oe),window.addEventListener("email-builder-toggle-upload-file",te),()=>{window.removeEventListener("email-builder-upload-image-receive",Y),window.removeEventListener("email-builder-set-image",ye),window.removeEventListener("email-builder-upload-file",Oe),window.removeEventListener("email-builder-toggle-upload-file",te)}},[d]),D.useEffect(()=>{t&&k(F(d.url))},[t,d.url]),D.useEffect(()=>{if(t!==c){const Y=o(t);p(Y),u(t||null),v(Y.url||"")}},[t]),h.jsxs(ri,{children:[h.jsxs(tt,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.label")}),!I&&h.jsx(Ut,{title:i("inputs.backgroundImage.warningTooltip"),placement:"top",children:h.jsx(Qt,{size:"small",sx:{p:0},children:h.jsx(s,{})})})]}),L?h.jsx(tt,{sx:{mb:2},children:L}):h.jsx("div",{style:{display:"flex",gap:8},children:A?h.jsxs(tt,{sx:{width:"100%"},children:[h.jsxs(Mn,{direction:"row",spacing:1,children:[h.jsx(df,{fullWidth:!0,placeholder:i("inputs.image.urlPlaceholder"),value:y,onChange:X,onKeyPress:V,error:!!T,disabled:E,sx:hE}),h.jsx(di,{variant:"contained",onClick:j,disabled:!y.trim()||E,sx:{minWidth:"auto",px:2,position:"relative"},children:E?h.jsx(pc,{size:20,color:"inherit"}):i("inputs.common.add")})]}),T&&h.jsx(tc,{severity:"error",sx:{mt:1,fontSize:"0.875rem",maxHeight:"70px"},children:T}),x&&h.jsx(tc,{severity:"warning",sx:{mt:1,fontSize:"0.875rem"},action:h.jsx(Qt,{"aria-label":i("inputs.common.close"),color:"inherit",size:"small",onClick:()=>{k(!1)},children:h.jsx(fE,{fontSize:"inherit"})}),children:i("inputs.common.svgWarning")}),d.url&&h.jsxs(tt,{sx:{position:"relative",maxWidth:"50%",display:"block",margin:"0.5rem auto 0 auto"},children:[h.jsx("img",{src:d.url||"",alt:"",style:{width:"100%",objectFit:"contain",aspectRatio:"1 / 1",height:"auto",borderRadius:"8px",border:`2px solid ${a.palette.divider}`,backgroundColor:a.palette.background.paper,backgroundImage:`linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%), linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"}}),h.jsx(Qt,{onClick:Ce,sx:{position:"absolute",top:5,right:5,backgroundColor:"background.paper",color:"error.main",padding:1,width:35,height:35,"&:hover":{backgroundColor:"error.50"}},size:"small",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:h.jsx("path",{d:"M16 9.5V19.5H8V9.5H16ZM14.5 3.5H9.5L8.5 4.5H5V6.5H19V4.5H15.5L14.5 3.5ZM18 7.5H6V19.5C6 20.6 6.9 21.5 8 21.5H16C17.1 21.5 18 20.6 18 19.5V7.5Z",fill:"currentColor"})})})]})]}):h.jsxs(h.Fragment,{children:[d.url&&h.jsxs(tt,{sx:{position:"relative",maxWidth:"40%",minWidth:"40%"},children:[h.jsx("div",{style:{borderRadius:"8px",border:`2px solid ${a.palette.divider}`,height:"100%",backgroundColor:a.palette.background.paper,backgroundImage:`linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%), linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"},children:h.jsx("img",{src:d.url||"",alt:"",style:{width:"100%",objectFit:"contain",aspectRatio:"1 / 1",height:"100%"}})}),h.jsx(Qt,{onClick:Ce,sx:{position:"absolute",top:5,right:5,backgroundColor:"background.paper",color:"error.main",padding:1,width:35,height:35,"&:hover":{backgroundColor:"error.50"}},size:"small",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:h.jsx("path",{d:"M16 9.5V19.5H8V9.5H16ZM14.5 3.5H9.5L8.5 4.5H5V6.5H19V4.5H15.5L14.5 3.5ZM18 7.5H6V19.5C6 20.6 6.9 21.5 8 21.5H16C17.1 21.5 18 20.6 18 19.5V7.5Z",fill:"currentColor"})})})]}),h.jsxs(tt,{onDragOver:ge,onDragLeave:ie,onDrop:we,sx:{width:"100%",minWidth:"40%",border:"2px solid",borderColor:f?"primary.main":"divider",borderRadius:"8px",padding:"24px 8px 36px 8px",textAlign:"center",bgcolor:f?"primary.50":"background.paper",transition:"all 0.2s ease"},children:[h.jsx(tt,{sx:{display:"flex",justifyContent:"center"},children:h.jsx(D8,{sx:{fontSize:32,color:"primary"}})}),h.jsxs("label",{style:{cursor:"pointer"},children:[h.jsx("input",{ref:w,type:"file",style:{display:"none"},accept:"image/png,image/jpeg,image/gif",multiple:!0,onChange:Y=>{const te=Y.target.files;te&&te.length>0&&W(Array.from(te))}}),h.jsx(er,{component:"span",sx:{fontWeight:"bold",color:"primary.main","&:hover":{fontWeight:"bold",color:"primary.secondary"}},children:i("inputs.common.uploadFile")}),h.jsxs(er,{component:"span",sx:{fontWeight:"bold",color:"text.secondary"},children:[" ",i("inputs.common.dragAndDrop")]})]}),h.jsx(er,{variant:"body2",sx:{color:"text.secondary",mt:1},children:i("inputs.common.fileInfo")})]})]})}),d.url&&h.jsxs(tt,{sx:{mt:2},children:[h.jsxs(tt,{sx:{mb:2},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.fillType")}),h.jsxs(hg,{value:d.size,exclusive:!0,onChange:(Y,te)=>{te!==null&&M({size:te})},size:"small",fullWidth:!0,children:[h.jsx(En,{value:"cover",children:i("inputs.backgroundImage.fillOptions.cover")}),h.jsx(En,{value:"contain",children:i("inputs.backgroundImage.fillOptions.contain")}),h.jsx(En,{value:"auto",children:i("inputs.backgroundImage.fillOptions.auto")})]})]}),h.jsxs(Mn,{direction:"row",spacing:2,sx:{mb:2},children:[h.jsxs("div",{style:{flex:1},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.repeat")}),h.jsxs(mc,{style:{width:"100%"},value:d.repeat,size:"small",onChange:Y=>M({repeat:Y.target.value}),children:[h.jsx(ds,{value:"no-repeat",children:i("inputs.backgroundImage.repeatOptions.none")}),h.jsx(ds,{value:"repeat",children:i("inputs.backgroundImage.repeatOptions.repeat")}),h.jsx(ds,{value:"repeat-x",children:i("inputs.backgroundImage.repeatOptions.repeatX")}),h.jsx(ds,{value:"repeat-y",children:i("inputs.backgroundImage.repeatOptions.repeatY")})]})]}),h.jsxs("div",{style:{flex:1},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.position")}),h.jsx(mc,{style:{width:"100%"},value:d.position,size:"small",onChange:Y=>M({position:Y.target.value}),renderValue:Y=>h.jsxs(tt,{sx:{display:"flex",alignItems:"center",gap:1,paddingRight:"1rem"},children:[de(Y),Te(Y)]}),children:["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"].map(Y=>h.jsx(ds,{sx:{padding:"0.5rem 1rem 0.5rem 0.5rem!important "},value:Y,children:h.jsxs(tt,{sx:{display:"flex",alignItems:"center",gap:1},children:[de(Y),Te(Y)]})},Y))})]})]})]}),!L&&!A&&x&&h.jsx(tc,{severity:"warning",sx:{mt:1,fontSize:"0.875rem"},children:i("inputs.common.svgWarning")}),(!L&&ay()&&!A||L&&g)&&h.jsxs(h.Fragment,{children:[h.jsxs(Mn,{direction:"row",alignItems:"center",spacing:1,sx:{mt:2},children:[h.jsx(yi,{sx:{flexGrow:1}}),h.jsx(er,{sx:{color:"text.secondary"},children:i("inputs.backgroundImage.or")}),h.jsx(yi,{sx:{flexGrow:1}})]}),h.jsx(Mn,{flexDirection:"row",gap:2,sx:{mt:2},children:!L&&ay()&&!A&&h.jsx(di,{variant:"outlined",onClick:ne,startIcon:h.jsx(k8,{}),sx:{width:"100%"},children:i("inputs.backgroundImage.browseGallery")})})]}),!L&&g&&h.jsx(V8,{src:d.url,style:{width:"100%",margin:0}})]})};function mf(){return(mf=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function gE(t,e){if(t==null)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)e.indexOf(n=a[r])>=0||(i[n]=t[n]);return i}function Oh(t){var e=D.useRef(t),n=D.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var Ih=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Ym=function(t){return"touches"in t},ow=function(t){return t&&t.ownerDocument.defaultView||self},DM=function(t,e,n){var r=t.getBoundingClientRect(),i=Ym(e)?(function(a,s){for(var o=0;o<a.length;o++)if(a[o].identifier===s)return a[o];return a[0]})(e.touches,n):e;return{left:Ih((i.pageX-(r.left+ow(t).pageXOffset))/r.width),top:Ih((i.pageY-(r.top+ow(t).pageYOffset))/r.height)}},AM=function(t){!Ym(t)&&t.preventDefault()},W8=D.memo(function(t){var e=t.onMove,n=t.onKey,r=gE(t,["onMove","onKey"]),i=D.useRef(null),a=Oh(e),s=Oh(n),o=D.useRef(null),l=D.useRef(!1),c=D.useMemo(function(){var f=function(_){AM(_),(Ym(_)?_.touches.length>0:_.buttons>0)&&i.current?a(DM(i.current,_,o.current)):g(!1)},m=function(){return g(!1)};function g(_){var b=l.current,y=ow(i.current),v=_?y.addEventListener:y.removeEventListener;v(b?"touchmove":"mousemove",f),v(b?"touchend":"mouseup",m)}return[function(_){var b=_.nativeEvent,y=i.current;if(y&&(AM(b),!(function(E,C){return C&&!Ym(E)})(b,l.current)&&y)){if(Ym(b)){l.current=!0;var v=b.changedTouches||[];v.length&&(o.current=v[0].identifier)}y.focus(),a(DM(y,b,o.current)),g(!0)}},function(_){var b=_.which||_.keyCode;b<37||b>40||(_.preventDefault(),s({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},g]},[s,a]),u=c[0],d=c[1],p=c[2];return D.useEffect(function(){return p},[p]),D.createElement("div",mf({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),ZA=function(t){return t.filter(Boolean).join(" ")},Y8=function(t){var e=t.color,n=t.left,r=t.top,i=r===void 0?.5:r,a=ZA(["react-colorful__pointer",t.className]);return D.createElement("div",{className:a,style:{top:100*i+"%",left:100*n+"%"}},D.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},ei=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},ape=function(t){return upe(lw(t))},lw=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?ei(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?ei(parseInt(t.substring(6,8),16)/255,2):1}},spe=function(t){return cpe(lpe(t))},ope=function(t){var e=t.s,n=t.v,r=t.a,i=(200-e)*n/100;return{h:ei(t.h),s:ei(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:ei(i/2),a:ei(r,2)}},cw=function(t){var e=ope(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},lpe=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),s=r*(1-n),o=r*(1-(e-a)*n),l=r*(1-(1-e+a)*n),c=a%6;return{r:ei(255*[r,o,s,s,l,r][c]),g:ei(255*[l,r,r,o,s,s][c]),b:ei(255*[s,s,l,r,r,o][c]),a:ei(i,2)}},g_=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},cpe=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=i<1?g_(ei(255*i)):"";return"#"+g_(e)+g_(n)+g_(r)+a},upe=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),s=a-Math.min(e,n,r),o=s?a===e?(n-r)/s:a===n?2+(r-e)/s:4+(e-n)/s:0;return{h:ei(60*(o<0?o+6:o)),s:ei(a?s/a*100:0),v:ei(a/255*100),a:i}},dpe=D.memo(function(t){var e=t.hue,n=t.onChange,r=ZA(["react-colorful__hue",t.className]);return D.createElement("div",{className:r},D.createElement(W8,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Ih(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":ei(e),"aria-valuemax":"360","aria-valuemin":"0"},D.createElement(Y8,{className:"react-colorful__hue-pointer",left:e/360,color:cw({h:e,s:100,v:100,a:1})})))}),ppe=D.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:cw({h:e.h,s:100,v:100,a:1})};return D.createElement("div",{className:"react-colorful__saturation",style:r},D.createElement(W8,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Ih(e.s+100*i.left,0,100),v:Ih(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ei(e.s)+"%, Brightness "+ei(e.v)+"%"},D.createElement(Y8,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:cw(e)})))}),K8=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},fpe=function(t,e){return t.toLowerCase()===e.toLowerCase()||K8(lw(t),lw(e))};function mpe(t,e,n){var r=Oh(n),i=D.useState(function(){return t.toHsva(e)}),a=i[0],s=i[1],o=D.useRef({color:e,hsva:a});D.useEffect(function(){if(!t.equal(e,o.current.color)){var c=t.toHsva(e);o.current={hsva:c,color:e},s(c)}},[e,t]),D.useEffect(function(){var c;K8(a,o.current.hsva)||t.equal(c=t.fromHsva(a),o.current.color)||(o.current={hsva:a,color:c},r(c))},[a,t,r]);var l=D.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[a,l]}var hpe=typeof window<"u"?D.useLayoutEffect:D.useEffect,gpe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},NM=new Map,_pe=function(t){hpe(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!NM.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,NM.set(e,n);var r=gpe();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},bpe=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,a=t.onChange,s=gE(t,["className","colorModel","color","onChange"]),o=D.useRef(null);_pe(o);var l=mpe(n,i,a),c=l[0],u=l[1],d=ZA(["react-colorful",e]);return D.createElement("div",mf({},s,{ref:o,className:d}),D.createElement(ppe,{hsva:c,onChange:u}),D.createElement(dpe,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},ype={defaultColor:"000",toHsva:ape,fromHsva:function(t){return spe({h:t.h,s:t.s,v:t.v,a:1})},equal:fpe},vpe=function(t){return D.createElement(bpe,mf({},t,{colorModel:ype}))},Epe=/^#?([0-9A-F]{3,8})$/i,Spe=function(t){var e=t.color,n=e===void 0?"":e,r=t.onChange,i=t.onBlur,a=t.escape,s=t.validate,o=t.format,l=t.process,c=gE(t,["color","onChange","onBlur","escape","validate","format","process"]),u=D.useState(function(){return a(n)}),d=u[0],p=u[1],f=Oh(r),m=Oh(i),g=D.useCallback(function(b){var y=a(b.target.value);p(y),s(y)&&f(l?l(y):y)},[a,l,s,f]),_=D.useCallback(function(b){s(b.target.value)||p(a(n)),m(b)},[n,a,s,m]);return D.useEffect(function(){p(a(n))},[n,a]),D.createElement("input",mf({},c,{value:o?o(d):d,spellCheck:"false",onChange:g,onBlur:_}))},RM=function(t){return"#"+t},Cpe=function(t){var e=t.prefixed,n=t.alpha,r=gE(t,["prefixed","alpha"]),i=D.useCallback(function(s){return s.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),a=D.useCallback(function(s){return(function(o,l){var c=Epe.exec(o),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8})(s,n)},[n]);return D.createElement(Spe,mf({},r,{escape:i,format:e?RM:void 0,process:RM,validate:a}))};const OM={width:24,height:24};function Tpe({paletteColors:t,isLocked:e,onToggleLock:n,onChange:r}){const i=dr(),a=t.slice(30);return h.jsxs(Mn,{spacing:1,children:[h.jsx("div",{style:{height:1,width:"100%",margin:"8px 0",backgroundColor:i.palette.grey[400]}}),h.jsxs(tt,{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"4px",children:[a.map((s,o)=>h.jsx(di,{sx:{...OM,backgroundColor:s,border:"1px solid",margin:"0!important",borderColor:i.palette.grey[50],minWidth:24,display:"inline-flex","&:hover":{backgroundColor:s,borderColor:"grey.500"}},onClick:()=>r&&r(s)},o+29)),n&&h.jsx(di,{onClick:n,sx:{backgroundColor:"transparent",border:"1px solid",...OM,minWidth:24,margin:"0!important",borderColor:e?i.palette.error.main:i.palette.divider,display:"inline-flex",color:e?i.palette.error.main:i.palette.text.secondary,"&:hover":{backgroundColor:e?i.palette.error.light+"20":"action.hover",borderColor:e?i.palette.error.main:i.palette.text.secondary}},title:e?"Unlock recent colors":"Lock recent colors",children:e?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})]})]})}const xpe={p:1,".react-colorful__pointer ":{width:16,height:16},".react-colorful__saturation":{mb:1,borderRadius:"8px"},".react-colorful__last-control":{borderRadius:"8px"},".react-colorful__hue-pointer":{width:"4px",borderRadius:"8px",height:24,cursor:"col-resize"},".react-colorful__saturation-pointer":{cursor:"all-scroll"},input:{padding:1,border:"1px solid",borderColor:"grey.300",borderRadius:"8px",width:"100%"}},IM=(t,e)=>{if(!t||t.trim()==="")return e;const r=e.slice(-5),i=e.slice(0,30),a=r.filter(o=>o!==t&&o!==""),s=[t,...a].slice(0,5);for(;s.length<5;)s.push("");return[...i,...s]};function uw({value:t,nullable:e,onChange:n}){const[r,i]=D.useState(t||"#000000"),[a,s]=D.useState(null),{paletteColors:o,isLocked:l}=vue(),[c,u]=D.useState(!1),d=dr(),p=D.useCallback(b=>{if(l)return;a&&clearTimeout(a);const y=setTimeout(()=>{const v=IM(b,o);XS({paletteColors:v})},300);s(y)},[a,l,o]),f=()=>{const b=!l;if(XS({isLocked:b}),!b&&r){const y=IM(r,o);XS({isLocked:b,paletteColors:y})}},m=b=>{u(!0),i(b)},g=()=>{n(r),p(r)},_=b=>{i(b),n(b),p(b)};return D.useEffect(()=>{t!==r&&i(t||"#000000")},[t]),D.useEffect(()=>()=>{a&&clearTimeout(a)},[a]),h.jsxs(Mn,{spacing:1,sx:xpe,children:[h.jsx(vpe,{color:r,onChange:m,onMouseUp:g,onTouchEnd:g,onMouseLeave:b=>c?g():null}),h.jsx(Tpe,{isLocked:l,onToggleLock:f,paletteColors:o,value:t,nullable:e,onChange:b=>{b?(i(b),n(b),p(b)):n(null)}}),h.jsxs(tt,{pt:1,display:"flex",gap:1,alignItems:"center",children:[h.jsx(Cpe,{prefixed:!0,color:r,onChange:_,style:{flex:1,backgroundColor:d.palette.background.paper,color:d.palette.text.primary,padding:"1px 4px",fontSize:"12px"}}),e&&h.jsx(di,{onClick:()=>n&&n(null),sx:{backgroundColor:"transparent",width:24,height:24,minWidth:24,margin:"0!important",borderColor:d.palette.divider,display:"inline-flex","&:hover":{backgroundColor:"action.hover",borderColor:d.palette.text.secondary}},children:h.jsx(E8,{color:"primary",fontSize:"small"})})]})]})}function Q8({label:t,defaultValue:e,onChange:n,nullable:r,compact:i=!1,...a}){const[s,o]=D.useState(null),[l,c]=D.useState(e),{t:u}=Ot.useTranslation("inspector");D.useEffect(()=>{l!==e&&c(e)},[e]);const d=b=>{o(b.currentTarget)},p=i?{border:"1px solid",borderColor:"cadet.400",width:28,height:28,borderRadius:"8px",bgcolor:"#FFFFFF"}:{border:t?"1px solid":"",borderColor:"cadet.400",width:"100%",height:36,paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"12px",borderRadius:"8px",bgcolor:"#FFFFFF"},f=b=>{c(b),n(b)},m=()=>!r||typeof l!="string"||l.trim().length===0?null:h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:u("inputs.background.reset"),placement:"left",children:h.jsx(tt,{sx:{minWidth:24,lineHeight:1,flexShrink:0,pr:"4px",display:"grid",placeItems:"center"},onClick:()=>f(null),children:h.jsx(E8,{sx:{color:"primary.main"}})})}),g=l?h.jsx(Ha,{onClick:d,sx:{...p,bgcolor:l}}):h.jsx(Ha,{onClick:d,sx:{...p},children:h.jsx(YA,{fontSize:"small"})}),_=h.jsx(RA,{anchorEl:s,open:!!s,onClose:()=>o(null),sx:{"& .MuiPaper-root":{boxShadow:"0 4px 6px rgba(0, 0, 0, 0.4);",borderRadius:1,maxWidth:"200px",transform:"translateX(-100%) !important;"}},MenuListProps:{sx:{height:"auto",padding:0}},children:h.jsx(uw,{value:l||"",nullable:r,onChange:b=>f(b)})});return i?h.jsxs(h.Fragment,{children:[g,_]}):h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsxs(Mn,{direction:"row",alignContent:"center",spacing:1,children:[g,m()]}),_]})}function yu(t){return h.jsx(Q8,{...t,nullable:!1})}function t1(t){return h.jsx(Q8,{...t,nullable:!0})}const MM=({mobile:t=!1,label:e,borderColor:n,borderTop:r,borderBottom:i,borderLeft:a,borderRight:s,onChange:o})=>{const{t:l}=Ot.useTranslation("inspector"),c=()=>t?{top:"borderTopMobile",bottom:"borderBottomMobile",left:"borderLeftMobile",right:"borderRightMobile"}:{top:"borderTop",bottom:"borderBottom",left:"borderLeft",right:"borderRight"},u=S=>{const x=Object.values(S);return x.every(k=>k===x[0])},d=c(),p={[d.top]:r??0,[d.bottom]:i??0,[d.left]:a??0,[d.right]:s??0},[f,m]=D.useState(()=>u(p)?"all":"custom"),[g,_]=D.useState(n??"#000000"),[b,y]=D.useState(p);D.useEffect(()=>{n!==g&&_(n??"#000000");const S={[d.top]:r??0,[d.bottom]:i??0,[d.left]:a??0,[d.right]:s??0};Object.keys(S).some(k=>b[k]!==S[k])&&(y(S),u(S)||m("custom"))},[n,r,i,a,s,t]);const v=()=>{if(f!=="all"){const S=b[d.top]??0;C(S),m("all")}else m("custom")},E=S=>{_(S),o({borderColor:S,...b})},C=S=>{const x={[d.top]:S,[d.bottom]:S,[d.left]:S,[d.right]:S};y(x),o({...x,borderColor:g})},T=(S,x)=>{y(w=>({...w,[x]:S}));const k={...b,borderColor:g,[x]:S};u(k)||m("custom"),o(k)};return h.jsxs("div",{children:[h.jsxs(Mn,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:e}),h.jsxs(Mn,{direction:"row",spacing:1,alignItems:"center",children:[h.jsx(yu,{defaultValue:g,onChange:E,compact:!0}),h.jsx(Ut,{title:l(f==="all"?"border.unlockBorders":"border.lockBordersTogether"),children:h.jsx(Qt,{size:"small",onClick:v,sx:{color:f==="all"?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:f==="all"?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]})]}),f==="all"&&h.jsx(ru,{label:"",iconLabel:h.jsx(Rue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.top],onChange:C}),f==="custom"&&h.jsxs(Mn,{spacing:2,children:[h.jsx(ru,{label:"",iconLabel:h.jsx(Iue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.top],onChange:S=>T(S,d.top)}),h.jsx(ru,{label:"",iconLabel:h.jsx(Aue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.bottom],onChange:S=>T(S,d.bottom)}),h.jsx(ru,{label:"",iconLabel:h.jsx(Nue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.left],onChange:S=>T(S,d.left)}),h.jsx(ru,{label:"",iconLabel:h.jsx(Oue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.right],onChange:S=>T(S,d.right)})]})]})},X8=[{key:"INHERIT",label:"Inherit",value:"inherit"},{key:"LATO",label:"Lato",value:'"Lato", sans-serif'},{key:"MERRIWEATHER",label:"Merriweather",value:'"Merriweather", serif'},{key:"MONTSERRAT",label:"Montserrat",value:'"Montserrat", sans-serif'},{key:"OPEN_SANS",label:"Open Sans",value:'"Open Sans", sans-serif'},{key:"OSWALD",label:"Oswald",value:'"Oswald", sans-serif'},{key:"PACIFICO",label:"Pacifico",value:'"Pacifico", cursive'},{key:"PLAYFAIR",label:"Playfair",value:'"Playfair", serif'},{key:"ROBOTO",label:"Roboto",value:'"Roboto", sans-serif'},{key:"MODERN_SANS",label:"Modern sans",value:'"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif'}],kpe={FAMILY:"MODERN_SANS"},hf=yr(["MODERN_SANS","LATO","MERRIWEATHER","MONTSERRAT","OPEN_SANS","OSWALD","PACIFICO","PLAYFAIR","ROBOTO","INHERIT"]).nullable().optional(),PM=t=>X8.find(e=>e.key===t)?.value;function il(t){const e=aue();let n=PM(t);return n||(n=PM(e?.fontFamily),n||"inherit")}const wpe=X8.map(t=>h.jsx(ds,{value:t.key,sx:{fontFamily:t.value},children:t.label},t.key));function Z8({label:t,onChange:e,defaultValue:n}){const r="INHERIT",[i,a]=D.useState(n??r);D.useEffect(()=>{i!==n&&a(n??r)},[n]);const s=o=>{const l=o?.target?.value;a(l),e(l===null?null:l)};return h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(mc,{style:{width:"100%"},value:i,size:"small",onChange:s,children:wpe})]})}function LM({label:t,defaultValue:e=16,onChange:n,maxValue:r,minValue:i,step:a}){const[s,o]=D.useState(e);D.useEffect(()=>{s!==e&&o(e)},[e]);const l=c=>{o(c),n(c)};return h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(vr,{iconLabel:h.jsx(R8,{sx:{fontSize:16,color:"text.primary"}}),value:s,setValue:l,units:"px",step:a??2,min:i||8,max:r||48})]})}function kc({label:t,children:e,defaultValue:n,onChange:r}){const[i,a]=D.useState(n);return D.useEffect(()=>{n!==i&&a(n)},[n]),h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(tt,{sx:{...Xde,paddingLeft:"0px",paddingRight:"0px"},children:h.jsx(hg,{exclusive:!0,fullWidth:!0,value:i,size:"small",sx:{width:"100%"},onChange:(s,o)=>{if(typeof o!="string")throw new Error("RadioGroupInput can only receive string values");a(o),r(o)},children:e})})]})}function Dpe({label:t,defaultValue:e,onChange:n}){const[r,i]=D.useState(e);return D.useEffect(()=>{r!==e&&i(e)},[e]),h.jsxs(kc,{label:t,defaultValue:r,onChange:a=>{i(a),n(a)},children:[h.jsx(En,{value:"normal",children:"Regular"}),h.jsx(En,{value:"bold",children:"Bold"})]})}const FM=({label:t,defaultValue:e,onChange:n})=>{const{t:r}=Ot.useTranslation("inspector"),i=t??r("inputs.common.height");return h.jsx(vr,{label:i,iconLabel:h.jsx(C8,{sx:{color:"text.secondary"}}),units:"px",step:1,min:1,max:100,marks:!1,value:e??1,setValue:n})},Ape=[{key:"1",value:"1",label:"Simple (1.0)"},{key:"1.15",value:"1.15",label:"Compact (1.15)"},{key:"1.5",value:"1.5",label:"Normal (1.5)"},{key:"2",value:"2",label:"Relaxed (2.0)"},{key:"2.5",value:"2.5",label:"Wide (2.5)"},{key:"3",value:"3",label:"Loose (3.0)"},{key:"4",value:"4",label:"Very Loose (4.0)"}],Npe=Ape.map(t=>h.jsx(ds,{value:t.key,children:t.label},t.key));function Rpe({label:t,onChange:e,defaultValue:n}){const r="INHERIT",[i,a]=D.useState(n?.toString()??r);D.useEffect(()=>{i!==n?.toString()&&a(n?.toString()??r)},[n]);const s=o=>{const l=o?.target?.value;a(l),e(l===r?null:parseFloat(l))};return h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsxs(mc,{style:{width:"100%"},value:i,size:"small",onChange:s,children:[h.jsx(ds,{value:r,children:"Default value"}),Npe]})]})}function BM({label:t,defaultValue:e,onChange:n}){const{t:i}=Ot.useTranslation("inspector"),[a,s]=D.useState(()=>e||{top:0,left:0,bottom:0,right:0});D.useEffect(()=>{e&&(e.top!==a.top||e.left!==a.left||e.bottom!==a.bottom||e.right!==a.right)&&s(e)},[e]);const[o,l]=D.useState(!1);function c(d,p){let f;o?f={top:p,bottom:p,left:p,right:p}:f={...a,[d]:p},s(f),n(f)}const u=()=>{if(!o){const d={top:a.top,bottom:a.top,left:a.top,right:a.top};s(d),n(d)}l(!o)};return h.jsxs(ri,{children:[h.jsxs(Mn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:t}),h.jsx(Ut,{title:i(o?"inputs.responsiveSize.unlockTooltip":"inputs.responsiveSize.lockTooltip"),children:h.jsx(Qt,{size:"small",onClick:u,sx:{marginTop:"0!important",color:o?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:o?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]}),o?h.jsx(vr,{iconLabel:h.jsx("span",{children:i("inputs.responsiveSize.allSides")}),value:a.top,setValue:d=>c("top",d),units:"px",step:16,min:0,max:120,marks:!0}):h.jsxs(h.Fragment,{children:[h.jsx(vr,{iconLabel:h.jsx(_8,{sx:{fontSize:16,color:"text.primary"}}),value:a.top,setValue:d=>c("top",d),units:"px",step:16,min:0,max:120,marks:!0}),h.jsx(vr,{iconLabel:h.jsx(g8,{sx:{fontSize:16,color:"text.primary"}}),value:a.bottom,setValue:d=>c("bottom",d),units:"px",step:16,min:0,max:120,marks:!0}),h.jsx(vr,{iconLabel:h.jsx(m8,{sx:{fontSize:16,color:"text.primary"}}),value:a.left,setValue:d=>c("left",d),units:"px",step:16,min:0,max:120,marks:!0}),h.jsx(vr,{iconLabel:h.jsx(h8,{sx:{fontSize:16,color:"text.primary"}}),value:a.right,setValue:d=>c("right",d),units:"px",step:16,min:0,max:120,marks:!0})]})]})}const Ope=({label:t,defaultValue:e,onChange:n,maxValue:r=600,shapeSteps:i=8})=>{const{t:a}=Ot.useTranslation("inspector"),[s,o]=D.useState(()=>typeof e=="object"&&e!==null?"rectangle":e||"rectangle"),[l,c]=D.useState(()=>typeof e=="object"&&e!==null?e:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0}),[u,d]=D.useState(!1);D.useEffect(()=>{typeof e=="object"&&e!==null?(c(e),o("rounded")):e&&o(e)},[e]);const p=b=>{o(b),n(b==="rounded"?l:b)},f=(b,y)=>{let v;u?v={topLeft:y,topRight:y,bottomLeft:y,bottomRight:y}:v={...l,[b]:y},c(v),n(v)},m=()=>{if(!u){const b={topLeft:l.topLeft,topRight:l.topLeft,bottomLeft:l.topLeft,bottomRight:l.topLeft};c(b),n(b)}d(!u)},g=r,_=t||a("shape.label");return h.jsxs(h.Fragment,{children:[h.jsxs(kc,{label:_,defaultValue:s,onChange:p,children:[h.jsx(En,{value:"rectangle",children:a("shape.square")}),h.jsx(En,{value:"pill",children:a("shape.pill")}),h.jsx(En,{value:"rounded",children:a("shape.custom")})]}),s==="rounded"&&h.jsxs(Mn,{spacing:2,alignItems:"flexStart",pb:1,children:[h.jsxs(Mn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:a("shape.borderRadius")}),h.jsx(Ut,{title:a(u?"shape.unlockTooltip":"shape.lockTooltip"),children:h.jsx(Qt,{size:"small",onClick:m,sx:{marginTop:"0!important",color:u?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:u?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]}),u?h.jsx(h.Fragment,{children:h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16}}),value:l.topRight,setValue:b=>f("topLeft",b),units:"px",min:0,step:i,marks:i>1,max:g})}):h.jsxs(h.Fragment,{children:[h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(0deg)"}}),value:l.topLeft,setValue:b=>f("topLeft",b),units:"px",min:0,step:i,marks:i>1,max:g}),h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(270deg)"}}),value:l.topRight,setValue:b=>f("topRight",b),units:"px",min:0,step:i,marks:i>1,max:g}),h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(180deg)"}}),value:l.bottomLeft,setValue:b=>f("bottomLeft",b),units:"px",min:0,step:i,marks:i>1,max:g}),h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(90deg)"}}),value:l.bottomRight,setValue:b=>f("bottomRight",b),units:"px",min:0,step:i,marks:i>1,max:g})]})]})]})};function $M({label:t,defaultValue:e,onChange:n}){const[r,i]=D.useState(e??"left");return D.useEffect(()=>{e!==r&&i(e??"left")},[e]),h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsxs(kc,{label:"",defaultValue:r,onChange:a=>{i(a),n(a)},children:[h.jsx(En,{value:"left",children:h.jsx(Que,{fontSize:"small"})}),h.jsx(En,{value:"center",children:h.jsx(Kue,{fontSize:"small"})}),h.jsx(En,{value:"right",children:h.jsx(Xue,{fontSize:"small"})})]})]})}const UM=({label:t,defaultValue:e,onChange:n,step:r,...i})=>{const{t:a}=Ot.useTranslation("inspector"),s=t??a("inputs.common.width");return h.jsx(vr,{label:s,iconLabel:h.jsx(C8,{sx:{color:"text.primary",transform:"rotate(90deg)"}}),units:"%",step:r,min:1,max:100,marks:!1,value:e??1,setValue:n,...i})};function Ipe({name:t,value:e,onChange:n,shapeMaxValue:r,shapeSteps:i}){const a=Sr(),s=pE(),{t:o}=Ot.useTranslation("inspector"),l=(f,m)=>{const g=e[f],_=e[m];return g??_},c=(f,m)=>{n(m?{...e,...m,[t]:f}:{...e,[t]:f})},u=f=>{n({...e,...f})},p=(()=>{switch(t){case"textAlignMobile":return l("textAlignMobile","textAlign");case"mobilePadding":return l("mobilePadding","padding");case"fontSizeMobile":return l("fontSizeMobile","fontSize")??16;case"heightMobile":return l("heightMobile","height");case"widthMobile":return l("widthMobile","width");case"borderMobile":return{borderTop:l("borderTopMobile","borderTop"),borderBottom:l("borderBottomMobile","borderBottom"),borderLeft:l("borderLeftMobile","borderLeft"),borderRight:l("borderRightMobile","borderRight")};default:return e[t]??null}})();switch(t){case"backgroundColor":return h.jsx(t1,{label:o("properties.backgroundColor"),defaultValue:p??s?.canvasColor,onChange:c});case"background":return h.jsx(ipe,{defaultValue:p,onChange:(f,m)=>c(f,m),values:e});case"borderColor":return h.jsx(t1,{label:o("properties.border"),defaultValue:p,onChange:c});case"borderRadius":return h.jsx(ru,{iconLabel:h.jsx(cde,{}),units:"px",step:4,marks:!0,min:0,max:48,label:o("properties.borderRadius"),defaultValue:p,onChange:c});case"color":return h.jsx(t1,{label:o("properties.color"),defaultValue:p,onChange:c});case"fontFamily":return h.jsx(Z8,{label:o("properties.fontFamily"),defaultValue:p,onChange:c});case"fontWeight":return h.jsx(Dpe,{label:o("properties.fontWeight"),defaultValue:p,onChange:c});case"textAlign":return a==="desktop"&&h.jsx($M,{label:o("properties.alignment"),defaultValue:p,onChange:c});case"textAlignMobile":return a!="desktop"&&h.jsx($M,{label:o("properties.alignment"),defaultValue:p,onChange:c});case"padding":return a==="desktop"&&h.jsx(BM,{label:o("properties.padding"),defaultValue:p,onChange:c});case"mobilePadding":return a!="desktop"&&h.jsx(BM,{label:o("properties.padding"),defaultValue:p,onChange:c});case"fontSize":return a==="desktop"&&h.jsx(LM,{maxValue:80,step:8,label:o("properties.fontSize"),defaultValue:p??16,onChange:c});case"fontSizeMobile":return a!="desktop"&&h.jsx(LM,{maxValue:80,step:8,label:o("properties.fontSize"),defaultValue:p,onChange:c});case"lineHeight":return h.jsx(Rpe,{label:o("properties.lineHeight"),defaultValue:p??1.5,onChange:c});case"shape":return h.jsx(Ope,{shapeSteps:i,maxValue:r,label:o("properties.shape"),defaultValue:p,onChange:c});case"height":return a==="desktop"&&h.jsx(FM,{label:o("properties.height"),defaultValue:p,onChange:c});case"heightMobile":return a!="desktop"&&h.jsx(FM,{label:o("properties.height"),defaultValue:p,onChange:c});case"width":return a==="desktop"&&h.jsx(UM,{label:o("properties.width"),defaultValue:p,onChange:c});case"widthMobile":return a!="desktop"&&h.jsx(UM,{label:o("properties.width"),defaultValue:p,onChange:c});case"border":return a==="desktop"&&h.jsx(MM,{label:o("properties.border"),borderColor:e.borderColor??null,borderTop:e.borderTop??null,borderBottom:e.borderBottom??null,borderLeft:e.borderLeft??null,borderRight:e.borderRight??null,onChange:u});case"borderMobile":return a!="desktop"&&h.jsx(MM,{mobile:!0,label:o("properties.border"),borderColor:e.borderColor??null,borderTop:p.borderTop??null,borderBottom:p.borderBottom??null,borderLeft:p.borderLeft??null,borderRight:p.borderRight??null,onChange:u});default:return null}}function Ci({names:t,value:e,onChange:n,disabledCSSValidation:r=!1,shapeMaxValue:i,shapeSteps:a}){const s=_o(),o=c8();return(r||s=="css"||Qb.includes(o||""))&&h.jsx(h.Fragment,{children:t.map(l=>h.jsx(Ipe,{shapeMaxValue:i,shapeSteps:a,name:l,value:e||{},onChange:n},l))})}const JA=t=>t?["http","mailto:","tel:","sms:","whatsapp:"].some(n=>t.startsWith(n))?t:`//${t}`:"#",_y=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),Cg=t=>t?{top:t?.top??0,right:t?.right??0,bottom:t?.bottom??0,left:t?.left??0}:{top:0,right:0,bottom:0,left:0},Mpe=xt({topLeft:Le().min(0).optional(),topRight:Le().min(0).optional(),bottomLeft:Le().min(0).optional(),bottomRight:Le().min(0).optional()}),e2=xt({style:xt({padding:_y,mobilePadding:_y,background:Pt().nullable().optional(),backgroundColor:Pt().regex(/^#[0-9a-fA-F]{6}$/).optional().nullable(),textAlign:yr(["center","left","right"]).optional().nullable(),textAlignMobile:yr(["center","left","right"]).optional().nullable(),shape:ap([yr(["rectangle","pill"]),Mpe]).optional().nullable()}),props:xt({touched:Dp().optional().nullable(),scale:Le().optional().nullable(),size:Pt().optional().nullable(),sizeMobile:Pt().optional().nullable(),width:Le().optional().nullable(),widthMobile:Le().optional().nullable(),scaleMobile:Le().optional().nullable(),touchedMobile:Dp().optional().nullable(),original_width:Le().optional().nullable(),height:Le().optional().nullable(),url:Pt().optional().nullable(),alt:Pt().optional().nullable(),linkHref:Pt().optional().nullable(),contentAlignment:yr(["top","middle","bottom"]).optional().nullable()}).optional().nullable()}).passthrough();function J8({style:t,props:e,blockId:n}){const r=Sr(),i=dE(),a={padding:Cg(r=="desktop"?t?.padding:t?.mobilePadding??t?.padding),backgroundColor:t?.backgroundColor??void 0,textAlign:r=="desktop"?t?.textAlign??void 0:t?.textAlignMobile??t?.textAlign??void 0},s=(_,b)=>_==="fill"?"100%":_==="scale"?`${b}%`:e?.width,o=e?.linkHref??null,l=r=="desktop"?s(e?.size,e?.scale):s(e?.sizeMobile,e?.scaleMobile),c={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},u=t?.background??"",d=t?.backgroundColor,p=d?Ju(u,d):u,f=_=>{const b=_.currentTarget;setTimeout(()=>{if(!e?.width&&b.offsetWidth){const y=b.offsetWidth;Sue(n,{...e,width:y})}},100)},m=h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:e?.alt??"",src:e?.url??"",width:l,onLoad:f,style:{width:l,height:"auto",outline:"none",border:"none",textDecoration:"none",verticalAlign:e?.contentAlignment??"middle",display:"inline-block",maxWidth:"100%",opacity:i.uploading&&i.id===n?.5:1,transition:"opacity 0.2s ease-in-out",borderRadius:gy(t)}}),i.uploading&&i.id===n&&h.jsx("div",{style:c,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})]}),g=tn(n);return o?h.jsx(ki,{className:`${g}`,padding:a.padding,background:p,align:a.textAlign,width:"100%",children:h.jsx("a",{href:JA(o),style:{textDecoration:"none",display:"block",width:"100%",height:"100%"},target:"_blank",children:m})}):h.jsx(ki,{className:`${g}`,padding:a.padding,background:p,align:a.textAlign,width:"100%",children:m})}const ez=({data:t,setData:e,blockId:n})=>{const{t:r}=Ot.useTranslation("inspector"),[i,a]=D.useState(!1),[s,o]=D.useState(()=>!!window.__emailBuilderEnableAI),[,l]=D.useState(null),[c,u]=D.useState(""),[d,p]=D.useState(!1),[f,m]=D.useState(""),[g,_]=D.useState(!1),b=D.useRef(null),y=WA(),[v,E]=D.useState(null);D.useEffect(()=>{const M=window.__emailBuilderCustomImageProvider;M&&(E(M),setTimeout(()=>{n&&window.dispatchEvent(new CustomEvent("email-builder-image-panel-opened",{detail:{blockId:n,currentImageUrl:t.props?.url||null,alt:t.props?.alt||null}}))},100))},[]);const C=M=>{const F=e2.safeParse(M);F.success?(e(F.data),l(null)):l(F.error)},T=(M,F)=>{const U=M.toLowerCase(),j=U.includes(".svg")||U.includes("svg"),V=F&&(F.includes("image/svg+xml")||F.includes("svg"));return j||!!V},S=async M=>{try{p(!0),m(""),_(!1);try{new URL(M)}catch{return m(r("inputs.image.invalidUrl")),!1}const F=new AbortController,U=setTimeout(()=>F.abort(),1e4);try{const j=await fetch(M,{method:"HEAD",signal:F.signal});if(clearTimeout(U),!j.ok)return m(`HTTP ${j.status}: ${j.statusText}`),!1;const V=j.headers.get("content-type");return["image/","image/svg+xml","text/xml","application/xml"].some(ge=>V&&V.toLowerCase().includes(ge.toLowerCase()))?(T(M,V)&&_(!0),m(""),!0):(m(r("inputs.image.notImage")),!1)}catch(j){return clearTimeout(U),j.name==="AbortError"?(m(r("inputs.image.timeout")),!1):new Promise(V=>{const X=new Image,W=setTimeout(()=>{m(r("inputs.image.timeout")),V(!1)},1e4);X.onload=()=>{clearTimeout(W),T(M)&&_(!0),m(""),V(!0)},X.onerror=()=>{clearTimeout(W),m("Cannot access image - CORS policy, network error, or invalid URL"),V(!1)},X.src=M})}}catch{return m("Unexpected error occurred while validating URL"),!1}finally{p(!1)}},x=async()=>{c.trim()&&await S(c.trim())&&(C({...t,props:{...t.props,url:c.trim()}}),u(""))},k=M=>{M.key==="Enter"&&x()},w=M=>{u(M.target.value),f&&m(""),g&&_(!1)},A=M=>{const F=["image/png","image/jpeg","image/gif"],j=M.filter(X=>F.includes(X.type)&&X.size<=5242880);if(j.length!==M.length&&alert(r("inputs.common.invalidFiles")),j.length===0)return;const V=j.map(X=>new Promise(W=>{const ge=new FileReader;ge.onload=ie=>W(ie.target?.result),ge.readAsDataURL(X)}));Promise.all(V).then(X=>{const W={images:X,id:n||""};window.dispatchEvent(new CustomEvent("email-builder-upload-image",{detail:W})),ip(!0,n||"")})},L=M=>{M.preventDefault(),a(!0)},O=M=>{const F=M.currentTarget.getBoundingClientRect(),U=M.clientX,j=M.clientY;(U<F.left||U>=F.right||j<F.top||j>=F.bottom)&&a(!1)},I=M=>{M.preventDefault(),a(!1);const F=Array.from(M.dataTransfer.files);F.length>0&&A(F)},P=()=>{const M=new CustomEvent("toggle-media-library",{detail:!0});window.dispatchEvent(M)};return D.useEffect(()=>{const M=window.__emailBuilderEnableAI;M!==void 0&&o(!!M);const F=U=>{const{detail:j}=U;o(!!j)};return window.addEventListener("email-builder-ai-generation",F),()=>{window.removeEventListener("email-builder-ai-generation",F)}},[]),D.useEffect(()=>{const M=V=>{const{detail:X}=V;ip(!1,X.id||""),C({...t,props:{...t.props,url:X.url}}),p8(!1)},F=V=>{ip(V?.detail?.uploading??!1,V?.detail?.id??"")},U=()=>{b?.current?.click()},j=V=>{const{detail:X}=V;C({...t,props:{...t.props,url:X}})};return window.addEventListener("email-builder-set-image",j),window.addEventListener("email-builder-upload-image-receive",M),window.addEventListener("email-builder-upload-file",U),window.addEventListener("email-builder-toggle-upload-file",F),()=>{window.removeEventListener("email-builder-toggle-upload-file",F),window.removeEventListener("email-builder-upload-image-receive",M),window.removeEventListener("email-builder-set-image",j),window.removeEventListener("email-builder-upload-file",U)}},[t]),D.useEffect(()=>{t.props?.url&&_(T(t.props.url))},[t.props?.url]),h.jsxs(Mn,{gap:1,children:[v?h.jsx(tt,{sx:{mb:2},children:v}):h.jsx("div",{style:{display:"flex",gap:8},children:y?h.jsxs(ri,{children:[h.jsx(Wn,{label:r("inputs.image.urlLabel")}),h.jsxs(Mn,{direction:"row",spacing:1,children:[h.jsx(df,{fullWidth:!0,placeholder:r("inputs.image.urlPlaceholder"),value:c,onChange:w,onKeyPress:k,error:!!f,disabled:d,sx:{...hE,"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:f?"error.main":"#E5E5E5"},"&:hover fieldset":{borderColor:f?"error.main":"primary.main"},"&.Mui-focused fieldset":{borderColor:f?"error.main":"primary.main"}}}}),h.jsx(di,{variant:"contained",onClick:x,disabled:!c.trim()||d,sx:{minWidth:"auto",px:2,position:"relative"},children:d?h.jsx(pc,{size:20,color:"inherit"}):r("inputs.common.add")})]}),f&&h.jsx(tc,{severity:"error",sx:{mt:1,fontSize:"0.875rem","& .MuiAlert-message":{padding:"4px 0",display:"flex",flexDirection:"column",justifyContent:"space-around"}},children:f}),g&&h.jsx(tc,{severity:"warning",sx:{mt:1,marginX:"4px",fontSize:"0.875rem",top:0,"& .MuiAlert-message":{padding:"4px 0",display:"flex",flexDirection:"column",justifyContent:"space-around"}},action:h.jsx(Qt,{"aria-label":r("inputs.common.close"),color:"inherit",size:"small",onClick:()=>{_(!1)},children:h.jsx(fE,{fontSize:"inherit"})}),children:r("inputs.common.svgWarning")}),h.jsx("img",{src:t.props?.url,alt:t.props?.alt,style:{width:"70%",margin:"0.5rem auto 0 auto",objectFit:"contain",display:"block",aspectRatio:"1 / 1",height:"auto",borderRadius:"8px",border:"2px solid #E5E5E5",backgroundColor:"#fff",backgroundImage:"linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"}})]}):h.jsxs(h.Fragment,{children:[h.jsx("img",{src:t.props?.url,alt:t.props?.alt,style:{width:"50%",objectFit:"contain",aspectRatio:"1 / 1",height:"auto",borderRadius:"8px",border:"2px solid #E5E5E5",backgroundColor:"#ffffff",backgroundImage:"linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"}}),h.jsxs(tt,{onDragOver:L,onDragLeave:O,onDrop:I,sx:{width:"100%",border:"2px solid",borderColor:i?"primary.main":"#E5E5E5",borderRadius:"8px",padding:4,textAlign:"center",bgcolor:i?"primary.50":"background.paper",transition:"all 0.2s ease"},children:[h.jsx(tt,{sx:{display:"flex",justifyContent:"center",mb:2},children:h.jsx(D8,{sx:{fontSize:32,color:"primary"}})}),h.jsxs("label",{style:{cursor:"pointer"},children:[h.jsx("input",{ref:b,type:"file",style:{display:"none"},accept:"image/png,image/jpeg,image/gif",multiple:!0,onChange:M=>{const F=M.target.files;F&&F.length>0&&A(Array.from(F))}}),h.jsx(er,{component:"span",sx:{fontWeight:"bold",color:"primary.main","&:hover":{fontWeight:"bold",color:"primary.secondary"}},children:r("inputs.common.uploadFile")}),h.jsxs(er,{component:"span",sx:{fontWeight:"bold",color:"text.secondary"},children:[" ",r("inputs.common.dragAndDrop")]})]}),h.jsx(er,{variant:"body2",sx:{color:"text.secondary",mt:1},children:r("inputs.common.fileInfo")})]})]})}),!v&&!y&&g&&h.jsx(tc,{severity:"warning",sx:{fontSize:"0.875rem","& .MuiAlert-message":{padding:"4px 0",display:"flex",flexDirection:"column",justifyContent:"space-around"}},children:"SVG images may not display correctly in Outlook email clients. Consider using PNG or JPG format for better compatibility."}),(!v&&(ay()&&!y||s)||v&&s)&&h.jsxs(Mn,{direction:"row",alignItems:"center",spacing:1,children:[h.jsx(yi,{sx:{flexGrow:1}}),h.jsx(er,{sx:{color:"text.secondary"},children:"or"}),h.jsx(yi,{sx:{flexGrow:1}})]}),h.jsx(h.Fragment,{children:h.jsxs(Mn,{flexDirection:"row",gap:2,children:[!v&&ay()&&!y&&h.jsx(di,{variant:"outlined",onClick:P,startIcon:h.jsx(k8,{}),sx:{color:"mainColor.main",borderColor:"mainColor.light","&:hover":{borderColor:"mainColor.main",backgroundColor:"action.hover"}},style:{width:"100%"},children:"Browse gallery"}),s&&h.jsx(V8,{src:t.props?.url,style:{width:"100%",margin:0}})]})})]})};function Ppe({data:t,setData:e}){const[,n]=D.useState(null),r=pf(),{t:i}=Ot.useTranslation("inspector"),a=c=>{const u=j8.safeParse(c);u.success?(e(u.data),n(null)):n(u.error)},s=t.props?.size??lu.size,o=t.props?.alt??lu.alt;t.props?.shape??lu.shape;const l=_o();return D.useEffect(()=>{const c=u=>{const{detail:d}=u;a({...t,props:{...t.props,alt:o}}),a({...t,props:{...t.props,imageUrl:d}})};return window.addEventListener("email-builder-set-image",c),()=>{window.removeEventListener("email-builder-set-image",c)}},[t,a]),h.jsxs(es,{title:i("inputs.panels.avatar.title"),children:[l=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(ez,{data:t,setData:c=>e({...t,props:{...t.props,imageUrl:c.props.url,alt:o}}),blockId:r}),h.jsx(ru,{label:i("inputs.panels.avatar.sizeLabel"),iconLabel:h.jsx(wue,{sx:{color:"text.secondary"}}),units:"px",step:3,min:32,max:256,defaultValue:s,onChange:c=>{a({...t,props:{...t.props,size:c}})}}),h.jsx(Lu,{label:i("inputs.panels.avatar.altLabel"),defaultValue:o,onChange:c=>{a({...t,props:{...t.props,alt:c}})}})]}),h.jsx(Ci,{names:["textAlign","backgroundColor","padding","mobilePadding"],value:t.style,onChange:c=>a({...t,style:c})})]})}const Xf=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),zM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),Lpe=t=>({top:t?.top??0,right:t?.right??0,bottom:t?.bottom??0,left:t?.left??0}),Fpe=xt({topLeft:Le().min(0).optional(),topRight:Le().min(0).optional(),bottomLeft:Le().min(0).optional(),bottomRight:Le().min(0).optional()}),GM=xt({top:Le().min(0).optional(),bottom:Le().min(0).optional(),left:Le().min(0).optional(),right:Le().min(0).optional()}),tz=xt({style:xt({backgroundColor:Xf,fontSize:Le().min(0).optional().nullable(),fontSizeMobile:Le().min(0).optional().nullable(),fontFamily:hf,background:Pt().nullable().optional(),buttonBackgroundColor:Xf,buttonTextColor:Xf,fontWeight:yr(["bold","normal"]).optional().nullable(),textAlign:yr(["left","center","right"]).optional().nullable(),textAlignMobile:yr(["left","center","right"]).optional().nullable(),padding:zM,mobilePadding:zM,shape:ap([yr(["rectangle","pill"]),Fpe]).optional().nullable()}).passthrough().optional().nullable(),props:xt({buttonBackgroundColor:Xf,buttonTextColor:Xf,fullWidth:Dp().optional().nullable(),fullWidthMobile:Dp().optional().nullable(),size:ap([yr(["x-small","small","medium"]),GM]).optional().nullable(),sizeMobile:ap([yr(["x-small","small","medium"]),GM]).optional().nullable(),text:Pt().optional().nullable(),url:Pt().optional().nullable()}).optional().nullable()}).passthrough();function HM(t){if(typeof t!="string")return t;switch(t){case"x-small":return{top:4,bottom:4,right:8,left:8};case"small":return{top:8,bottom:8,right:12,left:12};case"medium":default:return{top:12,bottom:12,left:20,right:20}}}const jl={text:"",url:"",fullWidth:!1,size:"medium",buttonBackgroundColor:"#999999"};function nz({style:t,props:e,blockId:n}){const r=pE(),i=Sr(),s=!VA(),o=e?.text??jl.text,l=e?.url??jl.url,c=i==="desktop"?e?.fullWidth??!1:e?.fullWidthMobile??e?.fullWidth??!1,u=t?.buttonTextColor??e?.buttonTextColor??r.textColor,d=t?.buttonBackgroundColor??e?.buttonBackgroundColor??jl.buttonBackgroundColor,p={backgroundColor:t?.backgroundColor??void 0,textAlign:i=="desktop"?t?.textAlign??void 0:t?.textAlignMobile??t?.textAlign,padding:Lpe(i=="desktop"?t?.padding:t?.mobilePadding??t?.padding)},f={color:u,fontSize:i=="desktop"?t?.fontSize??16:t?.fontSizeMobile??t?.fontSize??16,fontFamily:il(t?.fontFamily),fontWeight:t?.fontWeight??"bold",display:"inline-block",textDecoration:"none"},m={color:t?.borderColor??void 0,top:i=="desktop"?t?.borderTop??void 0:t?.borderTopMobile??t?.borderTop,bottom:i=="desktop"?t?.borderBottom??void 0:t?.borderBottomMobile??t?.borderBottom,left:i=="desktop"?t?.borderLeft??void 0:t?.borderLeftMobile??t?.borderLeft,right:i=="desktop"?t?.borderRight??void 0:t?.borderRightMobile??t?.borderRight},g=t?.background??"",_=t?.backgroundColor,b=_?Ju(g,_):g,y=tn(n);return h.jsx(ki,{background:b,backgroundColor:_,padding:p.padding,align:p.textAlign,width:"100%",className:`c${y}`,children:h.jsx("a",{href:JA(l),target:"_blank",className:`abtn-${y}`,onClick:s?v=>v.preventDefault():void 0,children:h.jsx(ki,{className:y,padding:i=="desktop"?HM(e?.size):HM(e?.sizeMobile??e?.size),borderRadius:gy(t),background:d,backgroundColor:d,isParent:!1,align:"center",width:c?"100%":void 0,border:m,children:h.jsx("span",{className:`btn${y}`,style:f,children:o})})})})}function Bpe({size:t,sizeMobile:e,onChange:n,label:r,maxValue:i=100,paddingSteps:a=8}){const{t:s}=Ot.useTranslation("inspector"),o=r??s("inputs.common.size"),l=Sr(),[c,u]=D.useState(()=>{const y=l==="desktop"?t:e!==void 0?e:t;return typeof y=="object"&&y!==null?y:{top:8,bottom:8,left:16,right:16}}),[d,p]=D.useState(!1);D.useEffect(()=>{const y=l==="desktop"?t:e!==void 0?e:t;typeof y=="object"&&y!==null&&u(y)},[t,e,l]);const f=()=>{const y=l==="desktop"?t:e!==void 0?e:t;return typeof y=="object"&&y!==null?"custom":y},m=y=>{if(l==="desktop"){const v={size:y==="custom"?c:y};e==null&&(v.sizeMobile=y==="custom"?c:y),n(v)}else n({sizeMobile:y==="custom"?c:y})},g=(y,v)=>{let E;d?E={top:v,bottom:v,left:v,right:v}:E={...c,[y]:v},u(E),n(l==="desktop"?{size:E}:{sizeMobile:E})},_=()=>{if(!d){const v={top:16,bottom:16,left:16,right:16};u(v),n(l==="desktop"?{size:v}:{sizeMobile:v})}p(!d)},b=f();return h.jsxs(Mn,{spacing:2,children:[h.jsxs(kc,{label:o,defaultValue:b,onChange:m,children:[h.jsx(En,{value:"x-small",children:s("inputs.responsiveSize.options.xSmall")}),h.jsx(En,{value:"small",children:s("inputs.responsiveSize.options.small")}),h.jsx(En,{value:"medium",children:s("inputs.responsiveSize.options.medium")}),h.jsx(En,{value:"custom",children:s("inputs.responsiveSize.options.custom")})]}),b==="custom"&&h.jsxs(Mn,{spacing:2,alignItems:"flexStart",pb:1,children:[h.jsxs(Mn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:s("inputs.responsiveSize.customPadding")}),h.jsx(Ut,{title:s(d?"inputs.responsiveSize.unlockTooltip":"inputs.responsiveSize.lockTooltip"),children:h.jsx(Qt,{size:"small",onClick:_,sx:{marginTop:"0!important",color:d?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:d?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]}),d?h.jsx(vr,{iconLabel:s("inputs.responsiveSize.allSides"),value:c.top,setValue:y=>g("top",y),units:"px",min:0,step:a,marks:a>1,max:i}):h.jsxs(h.Fragment,{children:[h.jsx(vr,{iconLabel:h.jsx(_8,{sx:{fontSize:16}}),value:c.top,setValue:y=>g("top",y),units:"px",min:0,step:a,marks:a>1,max:i}),h.jsx(vr,{iconLabel:h.jsx(g8,{sx:{fontSize:16}}),value:c.bottom,setValue:y=>g("bottom",y),units:"px",min:0,step:a,marks:a>1,max:i}),h.jsx(vr,{iconLabel:h.jsx(m8,{sx:{fontSize:16}}),value:c.left,setValue:y=>g("left",y),units:"px",min:0,step:a,marks:a>1,max:i}),h.jsx(vr,{iconLabel:h.jsx(h8,{sx:{fontSize:16}}),value:c.right,setValue:y=>g("right",y),units:"px",min:0,step:a,marks:a>1,max:i})]})]})]})}function $pe({fullWidth:t,fullWidthMobile:e,onChange:n,label:r="Width"}){const i=Sr(),{t:a}=Ot.useTranslation("inspector"),s=()=>i==="desktop"?t:e!==void 0?e:t,o=c=>{const u=c==="FULL_WIDTH";if(i==="desktop"){const d={fullWidth:u};e==null&&(d.fullWidthMobile=u),n(d)}else n({fullWidthMobile:u})},l=s();return h.jsxs(kc,{label:r,defaultValue:l?"FULL_WIDTH":"AUTO",onChange:o,children:[h.jsx(En,{value:"FULL_WIDTH",children:a("inputs.width.full")}),h.jsx(En,{value:"AUTO",children:a("inputs.width.auto")})]})}function Upe({data:t,setData:e}){const[,n]=D.useState(null),r=pE(),{t:i}=Ot.useTranslation("inspector"),a=g=>{const _=tz.safeParse(g);_.success?(e(_.data),n(null)):n(_.error)},s=t.props?.text??jl.text,o=t.props?.url??jl.url,l=t.props?.fullWidth??jl.fullWidth,c=t.props?.size??jl.size,u=t.style?.buttonTextColor??t.props?.buttonTextColor??r.textColor,d=t.style?.buttonBackgroundColor??t.props?.buttonBackgroundColor??jl.buttonBackgroundColor,p=t.props?.fullWidthMobile,f=t.props?.sizeMobile,m=_o();return h.jsxs(es,{title:i("inputs.panels.button.title"),children:[m=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(Ci,{disabledCSSValidation:!0,names:["fontFamily","fontSize","fontSizeMobile","fontWeight"],value:t.style,onChange:g=>a({...t,style:g})}),h.jsx(Lu,{label:i("inputs.panels.button.textLabel"),defaultValue:s,onChange:g=>a({...t,props:{...t.props,text:g}})}),h.jsx(Lu,{label:i("inputs.panels.button.targetLabel"),placeholder:i("inputs.panels.button.targetPlaceholder"),defaultValue:o,onChange:g=>a({...t,props:{...t.props,url:g}})}),h.jsx($pe,{label:i("properties.width"),fullWidth:l,fullWidthMobile:p,onChange:g=>a({...t,props:{...t.props,...g}})}),h.jsx(Bpe,{size:c,sizeMobile:f,onChange:g=>a({...t,props:{...t.props,...g}})})]}),h.jsx(Ci,{names:["shape","textAlign","textAlignMobile","backgroundColor","border","borderMobile","padding","mobilePadding"],value:t.style,shapeMaxValue:80,onChange:g=>a({...t,style:g})}),m==="css"&&h.jsxs(h.Fragment,{children:[h.jsx(yu,{label:i("inputs.panels.button.textColor"),defaultValue:u,onChange:g=>a({...t,style:{...t.style,buttonTextColor:g}})}),h.jsx(yu,{label:i("inputs.panels.button.buttonColor"),defaultValue:d,onChange:g=>a({...t,style:{...t.style,buttonBackgroundColor:g}})})]})]})}const zpe=H8([Le().nullish(),Le().nullish(),Le().nullish()]).optional().nullable(),rz=xt({style:xt({background:Pt().nullable().optional(),backgroundColor:Pt().nullable().optional(),padding:_y,mobilePadding:_y}).optional().nullable(),props:xt({fixedWidths:zpe,columnsCount:ap([sw(2),sw(3)]).optional().nullable(),layout:Pt().optional().nullable(),contentAlignment:yr(["top","middle","bottom"]).optional().nullable(),contentAlignmentMobile:yr(["top","middle","bottom"]).optional().nullable()}).optional().nullable()}).passthrough(),Gpe={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},Km={columnsCount:2,contentAlignment:"middle"};function dw({style:t,columns:e,props:n,blockId:r}){const i=Sr(),a=dE(),s={padding:Cg(i=="desktop"?t?.padding:t?.mobilePadding??t?.padding)},o={columnsCount:n?.columnsCount??Km.columnsCount,contentAlignment:i=="desktop"?n?.contentAlignment??Km.contentAlignment:n?.contentAlignmentMobile??n?.contentAlignment??Km.contentAlignment,fixedWidths:n?.fixedWidths,blockId:r},l=t?.background??"",c=t?.backgroundColor,u=c?Ju(l,c):l,d=tn(r);return h.jsxs(ki,{background:u,backgroundColor:c,className:`${d}`,padding:s.padding,width:"100%",children:[a.uploading&&a.id===r?h.jsx("div",{style:Gpe,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}):h.jsx(h.Fragment,{}),h.jsx("table",{border:0,cellSpacing:"0",cellPadding:"0",style:{width:"100%"},children:h.jsx("tbody",{style:{width:"100%"},children:h.jsxs("tr",{style:{width:"100%"},children:[h.jsx(n1,{index:0,props:o,columns:e}),h.jsx(n1,{index:1,props:o,columns:e}),h.jsx(n1,{index:2,props:o,columns:e})]})})})]})}function n1({index:t,props:e,columns:n}){const r=e?.contentAlignment??Km.contentAlignment;if((e?.columnsCount??Km.columnsCount)===2&&t===2)return null;const a={boxSizing:"border-box",verticalAlign:r,width:`${e.fixedWidths?.[t]}%`??void 0},s=(n&&n[t])??null,o=e.blockId?tn(e.blockId):"";return h.jsx("td",{className:`col${o}`,style:a,children:s})}const Hpe=rz.shape.props.unwrap().unwrap().shape,t2=xt({style:rz.shape.style,props:xt({...Hpe,columns:H8([xt({childrenIds:Wm(Pt())}),xt({childrenIds:Wm(Pt())}),xt({childrenIds:Wm(Pt())})])}).optional().nullable()}).passthrough(),jpe=(t,e,n)=>{if(!t||!document)return;const r=tn(t),i=document.querySelector(`.${r}`);if(!i)return;const a=i.parentElement;if(!a)return;const s=Math.ceil(a.getBoundingClientRect().width);n.props?.touched||n.props?.width!==s&&e({...n,props:{...n.props,width:s}})},qpe=t=>{if(!t||!document)return;const e=tn(t),n=document.querySelector(`.${e}`);if(!n)return;const r=n.parentElement;if(!r)return;const i=Math.ceil(r.getBoundingClientRect().width);return i||null},Vpe={desktop:"contentAlignment",mobile:"contentAlignmentMobile"};function Wpe({data:t,updateData:e}){const{t:n}=Ot.useTranslation("inspector"),r=Sr(),i=Vpe[r]||"contentAlignment",a=t.props?.[i]??t.props?.contentAlignment,s=o=>{e({...t,props:{...t.props,[i]:o}})};return h.jsxs(kc,{label:n("inputs.alignment.label"),defaultValue:a,onChange:s,children:[h.jsx(En,{value:"top",children:h.jsx(gde,{fontSize:"small"})}),h.jsx(En,{value:"middle",children:h.jsx(hde,{fontSize:"small"})}),h.jsx(En,{value:"bottom",children:h.jsx(mde,{fontSize:"small"})})]})}const Zf={grid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(100px, 1fr))",gap:"16px",width:"100%"},card:{cursor:"pointer",border:"1px solid #e5e7eb",borderRadius:"8px",backgroundColor:"primary"},cardContent:{padding:"8px"},layoutPreview:{display:"flex",gap:"4px",height:"30px",width:"100%",justifyContent:"space-between"}},Ype=({defaultValue:t,onChange:e,columns:n})=>{const{t:r}=Ot.useTranslation("inspector"),[i,a]=D.useState(t||"layout-50-50"),s=dr();D.useEffect(()=>{i!==t&&a(t==="layout-33-34-33"?"layout-33-33-33":t)},[t]);const o=[{id:"layout-50-50",distribution:[50,50,null]},{id:"layout-55-45",distribution:[55,45,null]},{id:"layout-45-55",distribution:[45,55,null]},{id:"layout-60-40",distribution:[60,40,null]},{id:"layout-40-60",distribution:[40,60,null]},{id:"layout-70-30",distribution:[70,30,null]},{id:"layout-30-70",distribution:[30,70,null]},{id:"layout-75-25",distribution:[75,25,null]},{id:"layout-25-75",distribution:[25,75,null]},{id:"layout-80-20",distribution:[80,20,null]},{id:"layout-20-80",distribution:[20,80,null]}],l=[{id:"layout-33-33-33",distribution:[33.34,33.33,33.33]},{id:"layout-30-40-30",distribution:[30,40,30]},{id:"layout-25-50-25",distribution:[25,50,25]},{id:"layout-20-60-20",distribution:[20,60,20]},{id:"layout-50-25-25",distribution:[50,25,25]},{id:"layout-25-25-50",distribution:[25,25,50]},{id:"layout-60-20-20",distribution:[60,20,20]},{id:"layout-20-20-60",distribution:[20,20,60]},{id:"layout-40-30-30",distribution:[40,30,30]},{id:"layout-30-30-40",distribution:[30,30,40]},{id:"layout-40-20-40",distribution:[40,20,40]}],[c,u]=D.useState(l),d=(p,f)=>{a(p),e({layout:p,fixedWidths:f})};return D.useEffect(()=>{if(n===2)u(o),o.findIndex(p=>p.id==t)===-1&&d("layout-50-50",[50,50,null]);else{if(u(l),t==="layout-33-34-33"){d("layout-33-33-33",[33.34,33.33,33.33]);return}l.findIndex(p=>p.id==t)===-1&&d("layout-33-33-33",[33.34,33.33,33.33])}},[n]),D.useEffect(()=>{t==="layout-33-34-33"&&d("layout-33-33-33",[33.34,33.33,33.33])},[t]),h.jsxs(ri,{children:[h.jsx(Wn,{label:r("inputs.layout.label")}),h.jsx("div",{style:Zf.grid,children:c.map((p,f)=>h.jsx("div",{onClick:()=>d(p.id,p.distribution),style:{...Zf.card,gridColumn:f===0?"span 2":void 0,border:i===p.id?`2px solid ${s.palette.secondary.main}`:Zf.card.border},children:h.jsx("div",{style:Zf.cardContent,children:h.jsx("div",{style:Zf.layoutPreview,children:p.distribution.map((m,g)=>h.jsx("div",{style:{width:`${m}%`,backgroundColor:i===p.id?s.palette.secondary.main:"#e5e7eb",borderRadius:"4px",transition:"background-color 0.2s ease",display:"grid",placeItems:"center",fontSize:"12px",color:i===p.id?"white":"black"}},g))})})},p.id))})]})};function Kpe({data:t,setData:e}){const[,n]=D.useState(null),[r,i]=D.useState(t.props?.columnsCount??2),a=_o(),s=Sr(),{t:o}=Ot.useTranslation("inspector"),l=f=>{const m=ue.getState().document,g=f.filter(_=>m[_]?.type==="Image");s==="desktop"&&g.map(_=>jpe(_,e,m[_].data))},c=f=>{const m=t2.safeParse(f);m.success?(m.data.props.columns.map(g=>l(g.childrenIds)),e(m.data),r&&m.data.props?.columnsCount!==r&&i(m.data.props?.columnsCount??2),n(null)):(console.error("Error on columns: ",m.error),n(m.error))},u={layout:"layout-50-50",fixedWidths:[50,50,null],columnsCount:2},d={layout:"layout-33-34-33",fixedWidths:[33,34,33],columnsCount:3},p=f=>{const m=t.props.columns.length===2?[...t.props.columns,{childrenIds:[]}]:[...t.props.columns];return f==="2"?{...u,columns:m}:{...d,columns:m}};return h.jsxs(es,{title:o("inputs.panels.columns.title"),children:[a=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsxs(kc,{label:o("inputs.panels.columns.countLabel"),defaultValue:t.props?.columnsCount===2?"2":"3",onChange:f=>{const m=p(f);c({...t,props:{...t.props,...m}})},children:[h.jsx(En,{style:{fontWeight:"bold"},value:"2",children:"2"}),h.jsx(En,{style:{fontWeight:"bold"},value:"3",children:"3"})]}),h.jsx(Ype,{columns:t.props?.columnsCount??3,defaultValue:t.props?.layout,onChange:({layout:f,fixedWidths:m})=>{const g=t.props.columns.length===2?[...t.props.columns,{childrenIds:[]}]:t.props.columns;c({...t,props:{...t.props,layout:f,fixedWidths:m,columns:g}})}})]}),a=="css"&&h.jsxs(h.Fragment,{children:[h.jsx(Wpe,{data:t,updateData:e}),h.jsx(Ci,{names:["backgroundColor","background","padding","mobilePadding"],value:t.style,onChange:f=>c({...t,style:f})})]})]})}const jM=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),qM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),Qpe=xt({topLeft:Le().min(0).optional(),topRight:Le().min(0).optional(),bottomLeft:Le().min(0).optional(),bottomRight:Le().min(0).optional()}),VM={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},Xpe=xt({style:xt({backgroundColor:jM,background:Pt().nullable().optional(),borderColor:jM,borderRadius:Le().optional().nullable(),borderTop:Le().optional().nullable(),borderBottom:Le().optional().nullable(),borderLeft:Le().optional().nullable(),borderRight:Le().optional().nullable(),borderTopMobile:Le().optional().nullable(),borderBottomMobile:Le().optional().nullable(),borderLeftMobile:Le().optional().nullable(),borderRightMobile:Le().optional().nullable(),shape:ap([yr(["rectangle","pill"]),Qpe]).optional().nullable(),padding:qM,mobilePadding:qM}).optional().nullable()}).passthrough();function iz({style:t,children:e,blockId:n}){const r=Sr(),i=dE(),a={border:{color:t?.borderColor??void 0,top:r=="desktop"?t?.borderTop??void 0:t?.borderTopMobile??t?.borderTop,bottom:r=="desktop"?t?.borderBottom??void 0:t?.borderBottomMobile??t?.borderBottom,left:r=="desktop"?t?.borderLeft??void 0:t?.borderLeftMobile??t?.borderLeft,right:r=="desktop"?t?.borderRight??void 0:t?.borderRightMobile??t?.borderRight},padding:Cg(r=="desktop"?t?.padding:t?.mobilePadding??t?.padding)},s=t?.background??"",o=t?.backgroundColor,l=o?Ju(s,o):s,c=tn(n);return e?h.jsx(ki,{className:`${c}`,background:l,backgroundColor:t?.backgroundColor,borderRadius:gy(t),padding:a.padding,width:"100%",border:a.border,children:h.jsxs(h.Fragment,{children:[i.uploading&&i.id===n&&h.jsx("div",{style:VM,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}),e]})}):h.jsx(ki,{className:`${c}`,background:l,backgroundColor:o,borderRadius:gy(t),padding:a.padding,width:"100%",border:a.border,children:h.jsx("div",{children:i.uploading&&i.id===n&&h.jsx("div",{style:VM,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})})})}const az=xt({style:Xpe.shape.style,props:xt({childrenIds:Wm(Pt()).optional().nullable()}).optional().nullable()}).passthrough();function sz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=a=>{const s=az.safeParse(a);s.success?(e(s.data),n(null)):n(s.error)};return h.jsx(es,{title:r("inputs.panels.container.title"),children:h.jsx(Ci,{names:["backgroundColor","background","border","borderMobile","shape","padding","mobilePadding"],value:t.style,shapeSteps:30,onChange:a=>i({...t,style:a})})})}const Zpe=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),WM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),oz=xt({style:xt({background:Pt().nullable().optional(),backgroundColor:Zpe,padding:WM,mobilePadding:WM,height:Le().optional().nullable(),heightMobile:Le().optional().nullable(),color:Pt().optional().nullable(),width:Le().optional().nullable(),widthMobile:Le().optional().nullable(),textAlign:Pt().optional().nullable(),textAlignMobile:Pt().optional().nullable()}).passthrough().optional().nullable()}).passthrough(),qc={height:1,color:"#333333",width:100,textAlign:"left"};function lz({style:t,blockId:e}){const n=Sr(),r=Cg(n==="desktop"?t?.padding:t?.mobilePadding??t?.padding),i=n==="desktop"?t?.height??qc.height:t?.heightMobile??t?.height??qc.height,a=t?.color??qc.color,s=n==="desktop"?(t?.width??qc.width)+"%":(t?.widthMobile??t?.width??qc.width)+"%",o=n==="desktop"?t?.textAlign??qc.textAlign:t?.textAlignMobile??t?.textAlign??qc.textAlign,l=t?.background??"",c=t?.backgroundColor??"",u=c?Ju(l,c):l,d=tn(e);return h.jsx(ki,{className:`c${d}`,background:u,backgroundColor:c,width:"100%",padding:r,align:o,children:h.jsx(ki,{display:"inline-block",className:`${d}`,background:a,backgroundColor:c,width:s,padding:{top:i,bottom:0,left:0,right:0},isParent:!1,children:h.jsx("div",{})})})}function cz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=a=>{const s=oz.safeParse(a);s.success?(e(s.data),n(null)):n(s.error)};return h.jsx(es,{title:r("inputs.panels.divider.title"),children:h.jsx(Ci,{names:["width","widthMobile","height","heightMobile","color","backgroundColor","textAlign","textAlignMobile","padding","mobilePadding"],value:t.style,onChange:a=>i({...t,style:a})})})}const Jf=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),uz=xt({backdropColor:Jf,borderColor:Jf,borderRadius:Le().optional().nullable(),canvasColor:Jf,textColor:Jf,fontFamily:hf,childrenIds:Wm(Pt()).optional().nullable(),linkGlobal:xt({linkColor:Jf,underline:Dp()}).optional().nullable(),showVersion:Dp().optional().nullable()}),Jpe=({label:t,linkColor:e,underline:n=!1,onChange:r})=>{const[i,a]=D.useState(e??"#FF0000"),[s,o]=D.useState(n),l=dr(),{t:c}=Ot.useTranslation("inspector"),u=t??c("inputs.links.color"),d=s?"enabled":"disabled",p={container:{width:"100%"},toggleGroup:{width:"100%",backgroundColor:l.palette.background.paper,padding:"4px",borderRadius:"8px"},toggleButton:{flex:1,padding:"6px 16px",textTransform:"none",fontSize:"14px",color:l.palette.text.primary,"&.Mui-selected":{backgroundColor:l.palette.grey[200],color:l.palette.text.primary,"&:hover":{backgroundColor:l.palette.grey[300]}},"&:hover":{backgroundColor:l.palette.grey[100]}}};D.useEffect(()=>{e!==i&&a(e??"#FF0000")},[e]),D.useEffect(()=>{n!==s&&o(n)},[n]);const f=g=>{const _=g??"#FF0000";a(_),r({linkColor:_,underline:s})},m=(g,_)=>{if(!_)return;const b=_==="enabled";o(b),r({linkColor:i,underline:b})};return h.jsxs(ri,{children:[h.jsx(yu,{label:u,defaultValue:i,onChange:f}),h.jsx(Wn,{label:c("inputs.links.underline")}),h.jsx(tt,{sx:p.container,children:h.jsxs(hg,{value:d,exclusive:!0,onChange:m,sx:p.toggleGroup,children:[h.jsx(En,{value:"enabled",sx:p.toggleButton,children:h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:c("inputs.links.underlineOn"),children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 40 40",role:"img","aria-label":"aiia subrayado",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("title",{children:"aiia subrayado"}),h.jsx("rect",{width:"20",height:"20",fill:"none"}),h.jsx("text",{x:"50%",y:"26",textAnchor:"middle",fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif",fontSize:"24",fill:"currentColor",children:"aiia"}),h.jsx("line",{x1:"6",y1:"31",x2:"34",y2:"31",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})})}),h.jsx(En,{value:"disabled",sx:p.toggleButton,children:h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:c("inputs.links.underlineOff"),children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 40 40",role:"img","aria-label":"aiia",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("title",{children:"aiia"}),h.jsx("rect",{width:"20",height:"20",fill:"none"}),h.jsx("text",{x:"50%",y:"26",textAnchor:"middle",fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif",fontSize:"24",fill:"currentColor",children:"aiia"})]})})})]})})]})},efe="email-builder-online",tfe="3.4.69",r1={name:efe,version:tfe};function dz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=_ue(),a=s=>{const o=uz.safeParse(s);o.success?(e(o.data),n(null)):n(o.error)};return h.jsxs(es,{title:r("inputs.panels.emailLayout.title"),children:[h.jsx(yu,{label:r("inputs.panels.emailLayout.backgroundColor"),defaultValue:t.backdropColor??"#F5F5F5",onChange:s=>a({...t,backdropColor:s})}),h.jsx(yu,{label:r("inputs.panels.emailLayout.canvasColor"),defaultValue:t.canvasColor??"#FFFFFF",onChange:s=>a({...t,canvasColor:s})}),h.jsx(Z8,{label:r("inputs.panels.emailLayout.fontFamily"),defaultValue:t.fontFamily||kpe.FAMILY,onChange:s=>a({...t,fontFamily:s})}),h.jsx(yu,{label:r("inputs.panels.emailLayout.textColor"),defaultValue:t.textColor??"#262626",onChange:s=>a({...t,textColor:s})}),h.jsx(Jpe,{label:r("inputs.panels.emailLayout.linksLabel"),linkColor:t.linkGlobal?.linkColor||"#000000",underline:t.linkGlobal?.underline||!1,onChange:s=>a({...t,linkGlobal:s})}),i&&h.jsx(tt,{color:"text.secondary",sx:{display:"flex",justifyContent:"flex-end",mt:2},children:h.jsxs(tt,{sx:{textAlign:"right"},children:[h.jsxs(er,{variant:"body2",children:[r("inputs.panels.emailLayout.version"),": ",r1.version]}),h.jsx(jae,{href:`https://www.npmjs.com/package/${r1.name}`,target:"_blank",rel:"noopener noreferrer",sx:{fontSize:"0.875rem",mt:.5,display:"inline-block"},children:r1.name})]})})]})}const YM=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),nfe=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),rfe=t=>t?`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`:void 0,pz=xt({props:xt({text:Pt().optional().nullable(),level:yr(["h1","h2","h3"]).optional().nullable()}).optional().nullable(),style:xt({color:YM,backgroundColor:YM,fontFamily:hf,fontWeight:yr(["bold","normal"]).optional().nullable(),textAlign:yr(["left","center","right"]).optional().nullable(),padding:nfe}).optional().nullable()}),by={level:"h2",text:""};function fz({props:t,style:e}){const n=t?.level??by.level,r=t?.text??by.text,i={color:e?.color??void 0,backgroundColor:e?.backgroundColor??void 0,fontWeight:e?.fontWeight??"bold",textAlign:e?.textAlign??void 0,margin:0,fontFamily:il(e?.fontFamily),fontSize:ife(n),padding:rfe(e?.padding)};switch(n){case"h1":return h.jsx("h1",{style:i,children:r});case"h2":return h.jsx("h2",{style:i,children:r});case"h3":return h.jsx("h3",{style:i,children:r})}}function ife(t){switch(t){case"h1":return 32;case"h2":return 24;case"h3":return 20}}function afe({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=s=>{const o=pz.safeParse(s);o.success?(e(o.data),n(null)):n(o.error)},a=_o();return h.jsxs(es,{title:r("inputs.panels.heading.title"),children:[a=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(Lu,{label:r("inputs.panels.heading.contentLabel"),rows:3,defaultValue:t.props?.text??by.text,onChange:s=>{i({...t,props:{...t.props,text:s}})}}),h.jsxs(kc,{label:r("inputs.panels.heading.levelLabel"),defaultValue:t.props?.level??by.level,onChange:s=>{i({...t,props:{...t.props,level:s}})},children:[h.jsx(En,{value:"h1",children:"H1"}),h.jsx(En,{value:"h2",children:"H2"}),h.jsx(En,{value:"h3",children:"H3"})]})]}),h.jsx(Ci,{names:["color","backgroundColor","fontFamily","fontWeight","textAlign","padding","mobilePadding"],value:t.style,onChange:s=>i({...t,style:s})})]})}const KM=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),sfe=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),ofe=t=>t?`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`:void 0,mz=xt({style:xt({color:KM,backgroundColor:KM,fontFamily:hf,fontSize:Le().min(0).optional().nullable(),textAlign:yr(["left","right","center"]).optional().nullable(),padding:sfe}).optional().nullable(),props:xt({contents:Pt().optional().nullable()}).optional().nullable()});function hz({style:t,props:e}){const n=e?.contents,r={color:t?.color??void 0,backgroundColor:t?.backgroundColor??void 0,fontFamily:il(t?.fontFamily),fontSize:t?.fontSize??void 0,textAlign:t?.textAlign??void 0,padding:ofe(t?.padding)};return n?h.jsx("div",{style:r,dangerouslySetInnerHTML:{__html:n}}):h.jsx("div",{style:r})}function lfe({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=s=>{const o=mz.safeParse(s);o.success?(e(o.data),n(null)):n(o.error)},a=_o();return h.jsxs(es,{title:r("inputs.panels.html.title"),children:[a=="block-configuration"&&h.jsx(h.Fragment,{children:h.jsx(Lu,{label:r("inputs.panels.html.contentLabel"),rows:5,defaultValue:t.props?.contents??"",onChange:s=>i({...t,props:{...t.props,contents:s}})})}),h.jsx(Ci,{names:["color","backgroundColor","fontFamily","fontSize","textAlign","padding","mobilePadding"],value:t.style,onChange:s=>i({...t,style:s})})]})}const cfe=(t,e,n)=>{const r=Sr();D.useEffect(()=>{const i=()=>{if(!t||!document||r=="mobile")return;const o=tn(t),l=document.querySelector(`.${o}`);if(!l)return;const c=l.parentElement;if(!c)return;const u=Math.ceil(c.getBoundingClientRect().width);n.props?.size===void 0||n.props?.size==="original"||n.props?.touched&&n.props?.width<=u||n.props?.width!==u&&!n.props?.touched&&e({...n,props:{...n.props,width:u}})};i();const a=new ResizeObserver(i),s=document.querySelector(`.${tn(t)}`);return s?.parentElement&&a.observe(s.parentElement),()=>{a.disconnect()}},[t,e,n,r])},ufe=({defaultValue:t="original",scale:e=100,onChange:n})=>{const[r,i]=D.useState(t),[a,s]=D.useState(e);Sr();const o=dr(),{t:l}=Ot.useTranslation("inspector"),c={container:{width:"100%"},label:{color:o.palette.text.primary},toggleGroup:{width:"100%",backgroundColor:o.palette.background.paper,padding:"4px",borderRadius:"8px"},toggleButton:{flex:1,padding:"6px 16px",textTransform:"none",fontSize:"14px",color:o.palette.text.primary,"&.Mui-selected":{backgroundColor:o.palette.grey[200],color:o.palette.text.primary,"&:hover":{backgroundColor:o.palette.grey[300]}},"&:hover":{backgroundColor:o.palette.grey[100]}},sliderContainer:{marginTop:"16px",padding:"0 8px"},slider:{"& .MuiSlider-thumb":{backgroundColor:o.palette.primary.main,"&:hover":{boxShadow:`0 0 0 8px ${o.palette.primary.main}20`}},"& .MuiSlider-rail":{backgroundColor:o.palette.grey[300]},"& .MuiSlider-track":{backgroundColor:o.palette.primary.main}},scaleValue:{color:o.palette.text.secondary}};D.useEffect(()=>{(t!==r||e!==a)&&(t!==r&&i(t),t==="scale"&&s(e))},[t,e]);const u=(p,f)=>{f!==null&&(i(f),n&&n({mode:f,scale:f==="scale"?a:void 0}))},d=p=>{s(p),n&&n({mode:r,scale:p})};return h.jsxs(ri,{children:[h.jsx(Wn,{label:l("inputs.sizeSelector.label")}),h.jsxs(tt,{sx:c.container,children:[h.jsxs(hg,{value:r,exclusive:!0,onChange:u,sx:c.toggleGroup,children:[h.jsx(En,{value:"original",sx:c.toggleButton,children:l("inputs.sizeSelector.contain")}),h.jsx(En,{value:"fill",sx:c.toggleButton,children:l("inputs.sizeSelector.cover")}),h.jsx(En,{value:"scale",sx:c.toggleButton,children:l("inputs.sizeSelector.scale")})]}),h.jsx(EU,{in:r==="scale",children:h.jsx(tt,{sx:c.sliderContainer,children:h.jsx(vr,{iconLabel:h.jsx(_de,{}),value:a,setValue:d,marks:!1,units:"%",min:1,max:100})})})]})]})};function dfe({data:t,setData:e}){const[n,r]=D.useState(null),i=pf(),a=_o(),s=Sr(),{t:o}=Ot.useTranslation("inspector");cfe(i||"",e,t),D.useEffect(()=>{i&&window.dispatchEvent(new CustomEvent("email-builder-image-panel-opened",{detail:{blockId:i,currentImageUrl:t.props?.url||null,alt:t.props?.alt||null}}))},[i,t.props?.url,t.props?.alt]);const l=D.useCallback(g=>{const _=e2.safeParse(g);_.success?JSON.stringify(t)!==JSON.stringify(_.data)&&(e(_.data),r(null)):r(_.error)},[t,e]),c=D.useCallback((g,_,b)=>{const y=qpe(i)||Kd,v={...g.props};if(b&&(v.touchedMobile=!0),_.mode==="original"){const E=g.props?.original_width??null;return b?{...v,sizeMobile:_.mode,widthMobile:E}:{...v,size:_.mode,width:E,sizeMobile:v.touchedMobile?v.sizeMobile:_.mode,widthMobile:v.touchedMobile?v.widthMobile:E}}if(_.mode==="fill")return b?{...v,sizeMobile:_.mode,widthMobile:null}:{...v,size:_.mode,width:null,sizeMobile:v.touchedMobile?v.sizeMobile:_.mode,widthMobile:v.touchedMobile?v.widthMobile:null};if(_.mode==="scale"){const E=Math.ceil(y/100*_.scale);return b?{...v,sizeMobile:_.mode,scaleMobile:_.scale,widthMobile:E}:{...v,size:_.mode,scale:_.scale,width:E,sizeMobile:v.touchedMobile?v.sizeMobile:_.mode,scaleMobile:v.touchedMobile?v.scaleMobile:_.scale,widthMobile:v.touchedMobile?v.widthMobile:E}}return v},[i]),u=D.useCallback((g,_)=>{const b=c(t,g,_);l({...t,props:b})},[t,l,c]),d=D.useMemo(()=>s!=="desktop"?{size:t.props?.touchedMobile?t.props?.sizeMobile:t.props?.size??"original",scale:t.props?.touchedMobile?t.props?.scaleMobile:t.props?.scale}:{size:t.props?.size??"original",scale:t.props?.scale},[s,t.props?.touchedMobile,t.props?.sizeMobile,t.props?.size,t.props?.scaleMobile,t.props?.scale]),p=D.useCallback(g=>{l({...t,props:{...t.props,alt:g}})},[t,l]),f=D.useCallback(g=>{const _=g.trim().length===0?null:g.trim();l({...t,props:{...t.props,linkHref:_}})},[t,l]),m=D.useCallback(g=>{l({...t,style:g})},[t,l]);return h.jsxs(es,{title:o("inputs.panels.image.title"),children:[a==="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(ez,{data:t,setData:e,blockId:i}),h.jsx(Lu,{label:o("inputs.panels.image.altLabel"),placeholder:o("inputs.panels.image.altPlaceholder"),defaultValue:t.props?.alt??"",onChange:p}),h.jsx(Lu,{label:o("inputs.panels.image.urlLabel"),placeholder:o("inputs.panels.image.urlPlaceholder"),defaultValue:t.props?.linkHref??"",onChange:f}),h.jsx(ufe,{defaultValue:d.size,scale:d.scale??void 0,onChange:g=>u(g,s!=="desktop")})]}),h.jsx(Ci,{names:["textAlign","textAlignMobile","backgroundColor","shape","padding","mobilePadding"],value:t.style,shapeMaxValue:300,shapeSteps:20,onChange:m})]})}var vn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(vn||(vn={}));var QM;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(QM||(QM={}));const Ze=vn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$l=t=>{switch(typeof t){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return Number.isNaN(t)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(t)?Ze.array:t===null?Ze.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ze.promise:typeof Map<"u"&&t instanceof Map?Ze.map:typeof Set<"u"&&t instanceof Set?Ze.set:typeof Date<"u"&&t instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}},ke=vn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class al extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof al))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,vn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}al.create=t=>new al(t);const pw=(t,e)=>{let n;switch(t.code){case ke.invalid_type:t.received===Ze.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ke.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,vn.jsonStringifyReplacer)}`;break;case ke.unrecognized_keys:n=`Unrecognized key(s) in object: ${vn.joinValues(t.keys,", ")}`;break;case ke.invalid_union:n="Invalid input";break;case ke.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${vn.joinValues(t.options)}`;break;case ke.invalid_enum_value:n=`Invalid enum value. Expected ${vn.joinValues(t.options)}, received '${t.received}'`;break;case ke.invalid_arguments:n="Invalid function arguments";break;case ke.invalid_return_type:n="Invalid function return type";break;case ke.invalid_date:n="Invalid date";break;case ke.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:vn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ke.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ke.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ke.custom:n="Invalid input";break;case ke.invalid_intersection_types:n="Intersection results could not be merged";break;case ke.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ke.not_finite:n="Number must be finite";break;default:n=e.defaultError,vn.assertNever(t)}return{message:n}};let pfe=pw;function ffe(){return pfe}const mfe=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}};function He(t,e){const n=ffe(),r=mfe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===pw?void 0:pw].filter(i=>!!i)});t.common.issues.push(r)}class pa{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Mt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,s=await i.value;r.push({key:a,value:s})}return pa.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return Mt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}}const Mt=Object.freeze({status:"aborted"}),ym=t=>({status:"dirty",value:t}),ts=t=>({status:"valid",value:t}),XM=t=>t.status==="aborted",ZM=t=>t.status==="dirty",Ap=t=>t.status==="valid",yy=t=>typeof Promise<"u"&&t instanceof Promise;var et;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(et||(et={}));class hc{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const JM=(t,e)=>{if(Ap(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new al(t.common.issues);return this._error=n,this._error}}};function Xt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}class hn{get description(){return this._def.description}_getType(e){return $l(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:$l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pa,ctx:{common:e.parent.common,data:e.data,parsedType:$l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(yy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$l(e)},i=this._parseSync({data:e,path:r.path,parent:r});return JM(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$l(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return Ap(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Ap(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$l(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(yy(i)?i:Promise.resolve(i));return JM(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:ke.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Op({schema:this,typeName:Lt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return nc.create(this,this._def)}nullable(){return Ip.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return to.create(this)}promise(){return Cy.create(this,this._def)}or(e){return Ey.create([this,e],this._def)}and(e){return Sy.create(this,e,this._def)}transform(e){return new Op({...Xt(this._def),schema:this,typeName:Lt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new mw({...Xt(this._def),innerType:this,defaultValue:n,typeName:Lt.ZodDefault})}brand(){return new Ffe({typeName:Lt.ZodBranded,type:this,...Xt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new hw({...Xt(this._def),innerType:this,catchValue:n,typeName:Lt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return n2.create(this,e)}readonly(){return gw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hfe=/^c[^\s-]{8,}$/i,gfe=/^[0-9a-z]+$/,_fe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bfe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yfe=/^[a-z0-9_-]{21}$/i,vfe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Efe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sfe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cfe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let i1;const Tfe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xfe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,kfe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,wfe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dfe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Afe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gz="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Nfe=new RegExp(`^${gz}$`);function _z(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Rfe(t){return new RegExp(`^${_z(t)}$`)}function Ofe(t){let e=`${gz}T${_z(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Ife(t,e){return!!((e==="v4"||!e)&&Tfe.test(t)||(e==="v6"||!e)&&kfe.test(t))}function Mfe(t,e){if(!vfe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Pfe(t,e){return!!((e==="v4"||!e)&&xfe.test(t)||(e==="v6"||!e)&&wfe.test(t))}class Ql extends hn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ze.string){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_type,expected:Ze.string,received:a.parsedType}),Mt}const r=new pa;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?He(i,{code:ke.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&He(i,{code:ke.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Sfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"email",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")i1||(i1=new RegExp(Cfe,"u")),i1.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"emoji",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")bfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"uuid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")yfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"nanoid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")hfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"cuid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")gfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"cuid2",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")_fe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"ulid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),He(i,{validation:"url",code:ke.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"regex",code:ke.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Ofe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Nfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Rfe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?Efe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"duration",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Ife(e.data,a.version)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"ip",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?Mfe(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"jwt",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?Pfe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"cidr",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Dfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"base64",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?Afe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"base64url",code:ke.invalid_string,message:a.message}),r.dirty()):vn.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:ke.invalid_string,...et.errToObj(r)})}_addCheck(e){return new Ql({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...et.errToObj(e)})}url(e){return this._addCheck({kind:"url",...et.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...et.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...et.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...et.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...et.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...et.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...et.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...et.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...et.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...et.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...et.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...et.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...et.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...et.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...et.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...et.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...et.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...et.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...et.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...et.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...et.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...et.errToObj(n)})}nonempty(e){return this.min(1,et.errToObj(e))}trim(){return new Ql({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ql({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ql({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ql.create=t=>new Ql({checks:[],typeName:Lt.ZodString,coerce:t?.coerce??!1,...Xt(t)});function Lfe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}class Np extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ze.number){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_type,expected:Ze.number,received:a.parsedType}),Mt}let r;const i=new pa;for(const a of this._def.checks)a.kind==="int"?vn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),He(r,{code:ke.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Lfe(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),He(r,{code:ke.not_finite,message:a.message}),i.dirty()):vn.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,et.toString(n))}gt(e,n){return this.setLimit("min",e,!1,et.toString(n))}lte(e,n){return this.setLimit("max",e,!0,et.toString(n))}lt(e,n){return this.setLimit("max",e,!1,et.toString(n))}setLimit(e,n,r,i){return new Np({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Np({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:et.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:et.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&vn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Np.create=t=>new Np({checks:[],typeName:Lt.ZodNumber,coerce:t?.coerce||!1,...Xt(t)});class Mh extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ze.bigint)return this._getInvalidInput(e);let r;const i=new pa;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):vn.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return He(n,{code:ke.invalid_type,expected:Ze.bigint,received:n.parsedType}),Mt}gte(e,n){return this.setLimit("min",e,!0,et.toString(n))}gt(e,n){return this.setLimit("min",e,!1,et.toString(n))}lte(e,n){return this.setLimit("max",e,!0,et.toString(n))}lt(e,n){return this.setLimit("max",e,!1,et.toString(n))}setLimit(e,n,r,i){return new Mh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Mh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Mh.create=t=>new Mh({checks:[],typeName:Lt.ZodBigInt,coerce:t?.coerce??!1,...Xt(t)});class eP extends hn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ze.boolean){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.boolean,received:r.parsedType}),Mt}return ts(e.data)}}eP.create=t=>new eP({typeName:Lt.ZodBoolean,coerce:t?.coerce||!1,...Xt(t)});class vy extends hn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ze.date){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_type,expected:Ze.date,received:a.parsedType}),Mt}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_date}),Mt}const r=new pa;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):vn.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new vy({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:et.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:et.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}vy.create=t=>new vy({checks:[],coerce:t?.coerce||!1,typeName:Lt.ZodDate,...Xt(t)});class tP extends hn{_parse(e){if(this._getType(e)!==Ze.symbol){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.symbol,received:r.parsedType}),Mt}return ts(e.data)}}tP.create=t=>new tP({typeName:Lt.ZodSymbol,...Xt(t)});class nP extends hn{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.undefined,received:r.parsedType}),Mt}return ts(e.data)}}nP.create=t=>new nP({typeName:Lt.ZodUndefined,...Xt(t)});class rP extends hn{_parse(e){if(this._getType(e)!==Ze.null){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.null,received:r.parsedType}),Mt}return ts(e.data)}}rP.create=t=>new rP({typeName:Lt.ZodNull,...Xt(t)});class iP extends hn{constructor(){super(...arguments),this._any=!0}_parse(e){return ts(e.data)}}iP.create=t=>new iP({typeName:Lt.ZodAny,...Xt(t)});class aP extends hn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ts(e.data)}}aP.create=t=>new aP({typeName:Lt.ZodUnknown,...Xt(t)});class gc extends hn{_parse(e){const n=this._getOrReturnCtx(e);return He(n,{code:ke.invalid_type,expected:Ze.never,received:n.parsedType}),Mt}}gc.create=t=>new gc({typeName:Lt.ZodNever,...Xt(t)});class sP extends hn{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.void,received:r.parsedType}),Mt}return ts(e.data)}}sP.create=t=>new sP({typeName:Lt.ZodVoid,...Xt(t)});class to extends hn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ze.array)return He(n,{code:ke.invalid_type,expected:Ze.array,received:n.parsedType}),Mt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(He(n,{code:s?ke.too_big:ke.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(He(n,{code:ke.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(He(n,{code:ke.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new hc(n,s,n.path,o)))).then(s=>pa.mergeArray(r,s));const a=[...n.data].map((s,o)=>i.type._parseSync(new hc(n,s,n.path,o)));return pa.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new to({...this._def,minLength:{value:e,message:et.toString(n)}})}max(e,n){return new to({...this._def,maxLength:{value:e,message:et.toString(n)}})}length(e,n){return new to({...this._def,exactLength:{value:e,message:et.toString(n)}})}nonempty(e){return this.min(1,e)}}to.create=(t,e)=>new to({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Lt.ZodArray,...Xt(e)});function Bd(t){if(t instanceof Dr){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=nc.create(Bd(r))}return new Dr({...t._def,shape:()=>e})}else return t instanceof to?new to({...t._def,type:Bd(t.element)}):t instanceof nc?nc.create(Bd(t.unwrap())):t instanceof Ip?Ip.create(Bd(t.unwrap())):t instanceof Fu?Fu.create(t.items.map(e=>Bd(e))):t}class Dr extends hn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=vn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ze.object){const c=this._getOrReturnCtx(e);return He(c,{code:ke.invalid_type,expected:Ze.object,received:c.parsedType}),Mt}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof gc&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=a[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new hc(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof gc){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(He(i,{code:ke.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new hc(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,p=await u.value;c.push({key:d,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>pa.mergeObjectSync(r,c)):pa.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return et.errToObj,new Dr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:et.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Dr({...this._def,unknownKeys:"strip"})}passthrough(){return new Dr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Dr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Lt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Dr({...this._def,catchall:e})}pick(e){const n={};for(const r of vn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Dr({...this._def,shape:()=>n})}omit(e){const n={};for(const r of vn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Dr({...this._def,shape:()=>n})}deepPartial(){return Bd(this)}partial(e){const n={};for(const r of vn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new Dr({...this._def,shape:()=>n})}required(e){const n={};for(const r of vn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof nc;)a=a._def.innerType;n[r]=a}return new Dr({...this._def,shape:()=>n})}keyof(){return bz(vn.objectKeys(this.shape))}}Dr.create=(t,e)=>new Dr({shape:()=>t,unknownKeys:"strip",catchall:gc.create(),typeName:Lt.ZodObject,...Xt(e)});Dr.strictCreate=(t,e)=>new Dr({shape:()=>t,unknownKeys:"strict",catchall:gc.create(),typeName:Lt.ZodObject,...Xt(e)});Dr.lazycreate=(t,e)=>new Dr({shape:t,unknownKeys:"strip",catchall:gc.create(),typeName:Lt.ZodObject,...Xt(e)});class Ey extends hn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new al(o.ctx.common.issues));return He(n,{code:ke.invalid_union,unionErrors:s}),Mt}if(n.common.async)return Promise.all(r.map(async a=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(l=>new al(l));return He(n,{code:ke.invalid_union,unionErrors:o}),Mt}}get options(){return this._def.options}}Ey.create=(t,e)=>new Ey({options:t,typeName:Lt.ZodUnion,...Xt(e)});function fw(t,e){const n=$l(t),r=$l(e);if(t===e)return{valid:!0,data:t};if(n===Ze.object&&r===Ze.object){const i=vn.objectKeys(e),a=vn.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const l=fw(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===Ze.array&&r===Ze.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],l=fw(s,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Ze.date&&r===Ze.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Sy extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(XM(a)||XM(s))return Mt;const o=fw(a.value,s.value);return o.valid?((ZM(a)||ZM(s))&&n.dirty(),{status:n.value,value:o.data}):(He(r,{code:ke.invalid_intersection_types}),Mt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sy.create=(t,e,n)=>new Sy({left:t,right:e,typeName:Lt.ZodIntersection,...Xt(n)});class Fu extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.array)return He(r,{code:ke.invalid_type,expected:Ze.array,received:r.parsedType}),Mt;if(r.data.length<this._def.items.length)return He(r,{code:ke.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Mt;!this._def.rest&&r.data.length>this._def.items.length&&(He(r,{code:ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new hc(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>pa.mergeArray(n,s)):pa.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new Fu({...this._def,rest:e})}}Fu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fu({items:t,typeName:Lt.ZodTuple,rest:null,...Xt(e)})};class oP extends hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.map)return He(r,{code:ke.invalid_type,expected:Ze.map,received:r.parsedType}),Mt;const i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new hc(r,o,r.path,[c,"key"])),value:a._parse(new hc(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Mt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Mt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}}oP.create=(t,e,n)=>new oP({valueType:e,keyType:t,typeName:Lt.ZodMap,...Xt(n)});class Ph extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.set)return He(r,{code:ke.invalid_type,expected:Ze.set,received:r.parsedType}),Mt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(He(r,{code:ke.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(He(r,{code:ke.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Mt;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>a._parse(new hc(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new Ph({...this._def,minSize:{value:e,message:et.toString(n)}})}max(e,n){return new Ph({...this._def,maxSize:{value:e,message:et.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Ph.create=(t,e)=>new Ph({valueType:t,minSize:null,maxSize:null,typeName:Lt.ZodSet,...Xt(e)});class lP extends hn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}lP.create=(t,e)=>new lP({getter:t,typeName:Lt.ZodLazy,...Xt(e)});class cP extends hn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return He(n,{received:n.data,code:ke.invalid_literal,expected:this._def.value}),Mt}return{status:"valid",value:e.data}}get value(){return this._def.value}}cP.create=(t,e)=>new cP({value:t,typeName:Lt.ZodLiteral,...Xt(e)});function bz(t,e){return new Rp({values:t,typeName:Lt.ZodEnum,...Xt(e)})}class Rp extends hn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return He(n,{expected:vn.joinValues(r),received:n.parsedType,code:ke.invalid_type}),Mt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return He(n,{received:n.data,code:ke.invalid_enum_value,options:r}),Mt}return ts(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Rp.create(e,{...this._def,...n})}exclude(e,n=this._def){return Rp.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Rp.create=bz;class uP extends hn{_parse(e){const n=vn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ze.string&&r.parsedType!==Ze.number){const i=vn.objectValues(n);return He(r,{expected:vn.joinValues(i),received:r.parsedType,code:ke.invalid_type}),Mt}if(this._cache||(this._cache=new Set(vn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=vn.objectValues(n);return He(r,{received:r.data,code:ke.invalid_enum_value,options:i}),Mt}return ts(e.data)}get enum(){return this._def.values}}uP.create=(t,e)=>new uP({values:t,typeName:Lt.ZodNativeEnum,...Xt(e)});class Cy extends hn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.promise&&n.common.async===!1)return He(n,{code:ke.invalid_type,expected:Ze.promise,received:n.parsedType}),Mt;const r=n.parsedType===Ze.promise?n.data:Promise.resolve(n.data);return ts(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cy.create=(t,e)=>new Cy({type:t,typeName:Lt.ZodPromise,...Xt(e)});class Op extends hn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{He(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return Mt;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?Mt:l.status==="dirty"||n.value==="dirty"?ym(l.value):l});{if(n.value==="aborted")return Mt;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?Mt:o.status==="dirty"||n.value==="dirty"?ym(o.value):o}}if(i.type==="refinement"){const s=o=>{const l=i.refinement(o,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Mt:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Mt:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ap(s))return Mt;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Ap(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):Mt);vn.assertNever(i)}}Op.create=(t,e,n)=>new Op({schema:t,typeName:Lt.ZodEffects,effect:e,...Xt(n)});Op.createWithPreprocess=(t,e,n)=>new Op({schema:e,effect:{type:"preprocess",transform:t},typeName:Lt.ZodEffects,...Xt(n)});class nc extends hn{_parse(e){return this._getType(e)===Ze.undefined?ts(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nc.create=(t,e)=>new nc({innerType:t,typeName:Lt.ZodOptional,...Xt(e)});class Ip extends hn{_parse(e){return this._getType(e)===Ze.null?ts(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ip.create=(t,e)=>new Ip({innerType:t,typeName:Lt.ZodNullable,...Xt(e)});class mw extends hn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}mw.create=(t,e)=>new mw({innerType:t,typeName:Lt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Xt(e)});class hw extends hn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return yy(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new al(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new al(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}hw.create=(t,e)=>new hw({innerType:t,typeName:Lt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Xt(e)});class dP extends hn{_parse(e){if(this._getType(e)!==Ze.nan){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.nan,received:r.parsedType}),Mt}return{status:"valid",value:e.data}}}dP.create=t=>new dP({typeName:Lt.ZodNaN,...Xt(t)});class Ffe extends hn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class n2 extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Mt:a.status==="dirty"?(n.dirty(),ym(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Mt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new n2({in:e,out:n,typeName:Lt.ZodPipeline})}}class gw extends hn{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Ap(i)&&(i.value=Object.freeze(i.value)),i);return yy(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}gw.create=(t,e)=>new gw({innerType:t,typeName:Lt.ZodReadonly,...Xt(e)});var Lt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Lt||(Lt={}));const ls=Ql.create,Qd=Np.create;gc.create;const Bfe=to.create,mb=Dr.create;Ey.create;Sy.create;Fu.create;const __=Rp.create;Cy.create;nc.create;Ip.create;const pP=ls().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),fP=mb({top:Qd(),bottom:Qd(),right:Qd(),left:Qd()}).optional().nullable(),yz=mb({style:mb({color:pP,backgroundColor:pP,background:ls().nullable().optional(),fontSize:Qd().gte(0).optional().nullable(),fontFamily:hf,fontWeight:__(["bold","normal"]).optional().nullable(),textAlign:__(["left","center","right"]).optional().nullable(),padding:fP,mobilePadding:fP,optionSize:__(["small","medium","large"]).optional().nullable(),theme:__(["light","dark","colored"]).optional().nullable()}).passthrough().optional().nullable(),gap:Qd().optional(),items:Bfe(mb({id:ls(),key:ls(),label:ls(),iconName:ls(),theme:ls(),size:ls(),sizePx:ls(),url:ls(),href:ls().optional().nullable()}))}).passthrough();function vz({style:t,items:e,blockId:n,gap:r=1,gapMobile:i}){const a=Sr(),s=t?.background??"",o=t?.backgroundColor,l=o?Ju(s,o):s,c={color:t?.color??void 0,background:l,backgroundColor:t?.backgroundColor,fontSize:t?.fontSize??16,fontFamily:il(t?.fontFamily),fontWeight:t?.fontWeight??void 0,textAlign:a=="desktop"?t?.textAlign:t?.textAlignMobile??t?.textAlign,padding:a=="desktop"?t?.padding:t?.mobilePadding??t?.padding},u=a==="desktop"?r:i??r,d=tn(n),f=!VA();return h.jsx($fe,{blockId:`${d}`,items:e,wStyle:c,gap:u,isEditorMode:f})}const $fe=({items:t,blockId:e,wStyle:n,gap:r,isEditorMode:i})=>{const a=s=>{switch(s){case 0:return"first";case t.length-1:return"last";default:return"inside"}};return h.jsx(ki,{className:e,background:n.background,backgroundColor:n.backgroundColor,padding:n?.padding,align:n.textAlign,width:"100%",children:h.jsx("table",{style:{display:"inline-block"},border:0,cellSpacing:"0",cellPadding:"0",children:h.jsx("tbody",{children:h.jsx("tr",{children:t.map((s,o)=>{const l=a(o);return h.jsxs(D.Fragment,{children:[l!=="first"&&h.jsx("td",{className:`gap-${e}`,width:Math.ceil(r/2)}),h.jsx("td",{id:`${s.id}-${s.url}`,width:s.sizePx,style:{textAlign:"center",whiteSpace:"nowrap"},children:h.jsx("a",{target:"_blank",href:i?void 0:JA(s.href),onClick:i?c=>c.preventDefault():void 0,style:{textDecoration:"none",pointerEvents:i?"none":void 0},children:h.jsx("img",{src:s.url,alt:s.key,style:{width:s.sizePx||36,height:s.sizePx||36,display:"block"}})},`item_${o}`)},`${s.id}-${s.url}`),l!=="last"&&h.jsx("td",{className:`gap-${e}`,width:Math.ceil(r/2)})]},s.id)})})})})})},Ufe="https://maildrill-dev.s3.us-east-2.amazonaws.com/icons/",zfe={positive:!0,original:!0,negative:!0},Gfe={small:!0,medium:!0,large:!0,xlarge:!0},K={theme:"positive",size:"medium"},bn=(t,e,n="medium")=>{const r=r2.find(a=>a.key===n)?.value,i=Ez.find(a=>a.key===e)?.value;return`${Ufe}${t}_${i}_${r}.png`},An=t=>r2.find(e=>e.key===t)?.value||"36px",r2=[{value:"24px",key:"small",label:"Small"},{value:"36px",key:"medium",label:"Medium"},{value:"48px",key:"large",label:"Large"}],Ez=[{value:"Positive",key:"positive",label:"Light"},{value:"Original",key:"original",label:"Color"},{value:"Negative",key:"negative",label:"Dark"}],hb=[{key:"facebook",label:"Facebook",iconName:"Facebook",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Facebook",K.theme,K.size),href:"https://www.facebook.com/your-profile"},{key:"web",label:"Web",iconName:"Web",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Web",K.theme,K.size),href:"https://www.google.com"},{key:"mail",label:"Mail",iconName:"Mail",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Mail",K.theme,K.size),href:"https://mail.google.com/"},{key:"apple",label:"Apple",iconName:"Apple",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Apple",K.theme,K.size),href:"https://www.apple.com/"},{key:"bluesky",label:"Bluesky",iconName:"Bluesky",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Bluesky",K.theme,K.size),href:"https://bsky.app/"},{key:"clubhouse",label:"ClubHouse",iconName:"Clubhouse",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Clubhouse",K.theme,K.size),href:"https://www.clubhouse.com/"},{key:"dribbble",label:"Dribbble",iconName:"Dribbble",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Dribbble",K.theme,K.size),href:"https://dribbble.com/"},{key:"figma",label:"Figma",iconName:"Figma",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Figma",K.theme,K.size),href:"https://www.figma.com/"},{key:"github",label:"Github",iconName:"Github",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Github",K.theme,K.size),href:"https://github.com/"},{key:"google",label:"Google",iconName:"Google",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Google",K.theme,K.size),href:"https://google.com/"},{key:"instagram",label:"Instagram",iconName:"Instagram",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Instagram",K.theme,K.size),href:"https://www.instagram.com/your-profile"},{key:"linkedin",label:"LinkedIn",iconName:"LinkedIn",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("LinkedIn",K.theme,K.size),href:"https://www.linkedin.com/in/your-profile"},{key:"medium-social",label:"Medium",iconName:"Medium",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Medium",K.theme,K.size),href:"https://medium.com/"},{key:"messenger",label:"Messenger",iconName:"Messenger",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Messenger",K.theme,K.size),href:"https://www.messenger.com/"},{key:"pinterest",label:"Pinterest",iconName:"Pinterest",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Pinterest",K.theme,K.size),href:"https://www.pinterest.com/"},{key:"reddit",label:"Reddit",iconName:"Reddit",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Reddit",K.theme,K.size),href:"https://www.reddit.com/"},{key:"signal",label:"Signal",iconName:"Signal",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Signal",K.theme,K.size),href:"https://signal.org/"},{key:"snapchat",label:"Snapchat",iconName:"Snapchat",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Snapchat",K.theme,K.size),href:"https://www.snapchat.com/"},{key:"spotify",label:"Spotify",iconName:"Spotify",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Spotify",K.theme,K.size),href:"https://www.spotify.com/"},{key:"telegram",label:"Telegram",iconName:"Telegram",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Telegram",K.theme,K.size),href:"https://t.me/your-profile"},{key:"threads",label:"Threads",iconName:"Threads",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Threads",K.theme,K.size),href:"https://www.threads.net/"},{key:"tiktok",label:"TikTok",iconName:"TikTok",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("TikTok",K.theme,K.size),href:"https://www.tiktok.com/@your-profile"},{key:"tumblr",label:"Tumblr",iconName:"Tumblr",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Tumblr",K.theme,K.size),href:"https://www.tumblr.com/"},{key:"twitch",label:"Twitch",iconName:"Twitch",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Twitch",K.theme,K.size),href:"https://www.twitch.tv/"},{key:"vk",label:"VK",iconName:"VK",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("VK",K.theme,K.size),href:"https://vk.com/"},{key:"whatsapp",label:"WhatsApp",iconName:"WhatsApp",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("WhatsApp",K.theme,K.size),href:"https://www.whatsapp.com/"},{key:"x",label:"X",iconName:"X",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("X",K.theme,K.size),href:"https://x.com/your-profile"},{key:"youtube",label:"YouTube",iconName:"YouTube",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("YouTube",K.theme,K.size),href:"https://www.youtube.com/channel/your-channel-id"}];function vm(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const Hfe=({element:t,index:e,moveItem:n,onSelectChange:r,onUrlChange:i,onRemove:a,onDuplicate:s,canRemove:o,theme:l})=>{const c=D.useRef(null),[u,d]=D.useState(null),{t:p}=Ot.useTranslation("inspector"),f=k=>{const w=k.getClientOffset(),A=c.current?.getBoundingClientRect();if(!w||!A)return null;const L=(A.bottom-A.top)/2;return w.y-A.top<L?"up":"down"},[{handlerId:m,isOver:g},_]=dc.useDrop(()=>({accept:"social-media-item",collect(k){return{handlerId:k.getHandlerId(),isOver:k.isOver({shallow:!0})}},hover(k,w){if(!c.current)return;if(k.index===e){d(null);return}if(!w.isOver({shallow:!0})){d(null);return}const O=f(w);d(O)},drop(k,w){if(d(null),!c.current)return;const A=k.index,L=e;if(A===L)return;const O=f(w);let I=L;O==="down"&&(I=L+1),A<I&&(I=I-1),setTimeout(()=>{n(A,I)},0),k.index=I},end:()=>{d(null)}}),[t.id,e,n]),[{isDragging:b},y]=dc.useDrag(()=>({type:"social-media-item",item:()=>({id:t.id,index:e}),collect:k=>({isDragging:k.isDragging()}),end:()=>{d(null)}}),[t.id,e]);D.useEffect(()=>{g||d(null)},[g]);const v=b?.4:1;D.useEffect(()=>{if(c.current&&y&&_){const k=c.current;y(k),_(k)}},[y,_]);const E=()=>{setTimeout(()=>a(e),0)},C=()=>{setTimeout(()=>s(e),0)},T=k=>{const w=k.target.value;setTimeout(()=>r(e,w,t),0)},S=k=>{const w=k.target.value;setTimeout(()=>i(e,w,t),0)},x=()=>h.jsxs("div",{style:{height:"3px",background:l.palette.secondary.main,position:"relative",color:l.palette.secondary.main,margin:"4px 0"},children:[h.jsx("svg",{style:{position:"absolute",left:"-25px",top:"50%",transform:"translateY(-50%)"},width:"20",height:"20",viewBox:"0 0 32 32",children:h.jsx("path",{fill:"currentColor",d:"M28 12H10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2M10 4v6h18V4zm18 26H10a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2m-18-8v6h18v-6zm-1-6l-5.586-5.586L2 11.828L6.172 16L2 20.172l1.414 1.414z"})}),h.jsx("svg",{style:{position:"absolute",right:"-25px",top:"50%",transform:"translateY(-50%) scaleX(-1)"},width:"20",height:"20",viewBox:"0 0 32 32",children:h.jsx("path",{fill:"currentColor",d:"M28 12H10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2M10 4v6h18V4zm18 26H10a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2m-18-8v6h18v-6zm-1-6l-5.586-5.586L2 11.828L6.172 16L2 20.172l1.414 1.414z"})})]});return h.jsxs(h.Fragment,{children:[u==="up"&&h.jsx(x,{}),h.jsxs(Mn,{ref:c,"data-handler-id":m,sx:{border:1,borderColor:"divider",padding:1,paddingTop:0,borderRadius:1,backgroundColor:"background.paper",marginBottom:1.5,opacity:v,cursor:b?"grabbing":"grab",boxShadow:b?l.shadows[3]:"none"},gap:1,children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:`1px solid ${l.palette.divider}`},children:[h.jsx("div",{style:{display:"flex",alignItems:"center"},children:h.jsx(v8,{sx:{color:b?"primary.main":"text.secondary",cursor:"grab",marginLeft:-.9,"&:hover":{color:"primary.main"}}})}),h.jsxs("div",{children:[h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:"Duplicate",placement:"left",children:h.jsx(Qt,{color:"primary",size:"small",onClick:C,children:h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M18 2.5H9C7.9 2.5 7 3.4 7 4.5V16.5C7 17.6 7.9 18.5 9 18.5H18C19.1 18.5 20 17.6 20 16.5V4.5C20 3.4 19.1 2.5 18 2.5ZM18 16.5H9V4.5H18V16.5ZM3 15.5V13.5H5V15.5H3ZM3 10H5V12H3V10ZM10 20.5H12V22.5H10V20.5ZM3 19V17H5V19H3ZM5 22.5C3.9 22.5 3 21.6 3 20.5H5V22.5ZM8.5 22.5H6.5V20.5H8.5V22.5ZM13.5 22.5V20.5H15.5C15.5 21.6 14.6 22.5 13.5 22.5ZM5 6.5V8.5H3C3 7.4 3.9 6.5 5 6.5Z",fill:"currentColor"})})})}),o&&h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:"Remove",placement:"left",children:h.jsx(Qt,{color:"error",size:"small",onClick:E,children:h.jsx(zue,{sx:{fontSize:20}})})})]})]}),h.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"0.5rem"},children:[h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"40px auto",gap:"4px",alignItems:"center"},children:[h.jsx(Wn,{label:p("inputs.social.icon")}),h.jsx(mc,{fullWidth:!0,labelId:"demo-simple-select-label",id:"demo-simple-select",value:t.key,size:"small",onChange:T,children:hb.map(k=>h.jsx(ds,{value:k.key,children:k.label},`${t.id}_${k.key}`))})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"40px auto",gap:"4px",alignItems:"center"},children:[h.jsx(Wn,{label:p("inputs.social.url")}),h.jsx(df,{size:"small",fullWidth:!0,value:t.href??"",onChange:S,variant:"outlined",placeholder:"https://your-website.com",sx:hE})]})]})]}),u==="down"&&h.jsx(x,{})]})};function jfe({items:t=[],onChange:e}){const{t:n}=Ot.useTranslation("inspector"),r=dr(),[i,a]=D.useState(()=>t.map(_=>({..._,id:_.id||vm()}))),[s,o]=D.useState(t[0]?.theme||"default"),[l,c]=D.useState(t[0]?.size||"medium");D.useEffect(()=>{t.length>0&&(o(t[0].theme),c(t[0].size),a(t.map(_=>({..._,id:_.id||vm()}))))},[t]);const u=(_,b)=>{a(y=>{const v=[...y],[E]=v.splice(_,1);return v.splice(b,0,E),e&&setTimeout(()=>e(v),0),v})},d=()=>{a(_=>{const b={...hb[0],theme:s,size:l,sizePx:An(l),url:bn(hb[0].iconName,s,l),id:vm()},y=[..._,b];return e&&setTimeout(()=>e(y),0),y})},p=_=>{a(b=>{const y=b.filter((v,E)=>E!==_);return e&&setTimeout(()=>e(y),0),y})},f=(_,b,y)=>{let v=[...i];if(b in zfe?(o(b),v=v.map(E=>{const C=bn(E.iconName,b,E.size);return{...E,theme:b,url:C}})):b in Gfe&&(c(b),v=v.map(E=>{const C=bn(E.iconName,E.theme,b),T=An(b);return{...E,size:b,sizePx:T,url:C}})),_!==null&&y){const E=hb.find(C=>C.key===b);E&&(v=v.map((C,T)=>{const S={key:E.key,label:E.label,iconName:E.iconName,href:E.href},x=bn(S.iconName,y.theme,y.size);return T===_?{...C,...S,url:x,id:y.id}:C}))}a(v),e&&setTimeout(()=>e(v),0)},m=(_,b,y)=>{const v=i.map((E,C)=>C===_?{...y,href:b}:E);a(v),e&&setTimeout(()=>e(v),0)},g=_=>{a(b=>{const y={...JSON.parse(JSON.stringify(b[_])),id:vm()},v=[...b.slice(0,_+1),y,...b.slice(_+1)];return e&&setTimeout(()=>e(v),0),v})};return h.jsxs(h.Fragment,{children:[h.jsxs("div",{style:{marginBottom:"1rem",display:"grid",gridTemplateColumns:"repeat(2,1fr)",gap:"1rem"},children:[h.jsxs(ri,{children:[h.jsx(Wn,{label:n("inputs.social.theme")}),h.jsx(mc,{fullWidth:!0,labelId:"theme-selector",id:"theme-selector",value:s,size:"small",onChange:_=>f(null,_.target.value,null),children:Ez.map(_=>h.jsx(ds,{value:_.key,children:_.label},`${_.key}`))})]}),h.jsxs(ri,{children:[h.jsx(Wn,{label:n("inputs.social.size")}),h.jsx(mc,{fullWidth:!0,labelId:"size-selector",id:"size-selector",value:l,size:"small",onChange:_=>f(null,_.target.value,null),children:r2.map(_=>h.jsx(ds,{value:_.key,children:_.label},`${_.key}`))})]})]}),i?.map((_,b)=>h.jsx(Hfe,{element:_,index:b,moveItem:u,onSelectChange:f,onUrlChange:m,onRemove:p,onDuplicate:g,canRemove:i.length>1,theme:r},_.id)),h.jsx(di,{onClick:d,sx:{borderRadius:1},variant:"contained",endIcon:h.jsx(xue,{}),children:"Add"})]})}const qfe=({data:t,setData:e})=>{const[,n]=D.useState(null),r=Sr(),{t:i}=Ot.useTranslation("inspector"),a=u=>{const d=yz.safeParse(u);d.success?(e(d.data),n(null)):n(d.error)},s=u=>{a({...t,items:u})},o=u=>{a({...t,style:u})},l=(u,d=!1)=>{if(d){a({...t,gapMobile:u});return}a({...t,gap:u})},c=_o();return h.jsxs(es,{title:i("inputs.panels.social.title"),children:[c=="block-configuration"&&h.jsx(tt,{sx:{minWidth:120,margin:1},children:h.jsx(jfe,{items:t?.items||[],onChange:s})}),c=="css"&&h.jsxs(h.Fragment,{children:[h.jsxs(ri,{children:[h.jsx(Wn,{label:i("inputs.panels.social.gap")}),r=="desktop"?h.jsx(vr,{iconLabel:h.jsx(pM,{sx:{color:"text.primary"}}),value:t?.gap??4,setValue:l,marks:!0,step:4,units:"px",min:0,max:40}):h.jsx(vr,{iconLabel:h.jsx(pM,{sx:{color:"text.primary"}}),value:t?.gapMobile??t?.gap??4,setValue:u=>l(u,!0),marks:!0,step:4,units:"px",min:0,max:40})]}),h.jsx(Ci,{names:["textAlign","textAlignMobile","backgroundColor","padding","mobilePadding"],value:t.style,onChange:u=>o(u)})]})]})},Vfe=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),Sz=xt({style:xt({height:Le().optional().nullable(),heightMobile:Le().optional().nullable(),background:Pt().nullable().optional(),backgroundColor:Vfe}).optional().nullable()}),mP={height:16};function Cz({style:t,blockId:e}){const r=Sr()==="desktop"?t?.height??mP.height:t?.heightMobile??t?.height??mP.height,i=t?.background??"",a=t?.backgroundColor??"",s=a?Ju(i,a):i,o={width:"100%",minWidth:"100%",backgroundColor:a||void 0,background:s||void 0},l=tn(e);return h.jsx("table",{className:l,width:"100%",style:o,children:h.jsx("tbody",{children:h.jsx("tr",{className:`it${l}`,height:r,style:{height:r},children:h.jsx("td",{})})})})}function Tz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=a=>{const s=Sz.safeParse(a);s.success?(e(s.data),n(null)):n(s.error)};return h.jsx(es,{title:r("inputs.panels.spacer.title"),children:h.jsx(Ci,{names:["height","heightMobile","backgroundColor"],value:t.style,onChange:a=>i({...t,style:a})})})}function Wfe({data:t,setData:e}){const n=_o(),{t:r}=Ot.useTranslation("inspector"),i=t.style||{},a=s=>{const o={...i||{},...s||{}};e({...t,style:o})};return h.jsxs(es,{title:r("inputs.panels.notionText.title","Text"),children:[n==="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{style:{display:"flex",gap:"8px"},children:[h.jsx("div",{style:{flex:1},children:h.jsx(Ci,{disabledCSSValidation:!0,names:["fontFamily"],value:i,onChange:a})}),h.jsx("div",{style:{flex:1},children:h.jsx(Ci,{disabledCSSValidation:!0,names:["lineHeight"],value:i,onChange:a})})]}),h.jsx(Ci,{disabledCSSValidation:!0,names:["fontSize","fontSizeMobile"],value:i,onChange:a})]}),n==="css"&&h.jsx(Ci,{names:["backgroundColor","border","borderMobile","padding","mobilePadding"],value:i,onChange:a})]})}function hP(t){return h.jsx(tt,{sx:{m:3,p:1,border:"1px dashed",borderColor:"divider"},children:h.jsx(er,{color:"text.secondary",children:t})})}function Yfe(){const t=pf(),e=u8(t||""),n=D.useCallback(a=>{t&&Vk(t,()=>a)},[t]);if(!t)return hP("Click on a block to inspect.");if(!e)return hP(`Block with id ${t} was not found. Click on a block to reset.`);const{data:r,type:i}=e;switch(i){case"Avatar":return h.jsx(Ppe,{data:r,setData:a=>n({type:i,data:a})},t);case"Button":return h.jsx(Upe,{data:r,setData:a=>n({type:i,data:a})},t);case"ColumnsContainer":return h.jsx(Kpe,{data:r,setData:a=>n({type:i,data:a})},t);case"Container":return h.jsx(sz,{data:r,setData:a=>n({type:i,data:a})},t);case"Divider":return h.jsx(cz,{data:r,setData:a=>n({type:i,data:a})},t);case"Heading":return h.jsx(afe,{data:r,setData:a=>n({type:i,data:a})},t);case"Html":return h.jsx(lfe,{data:r,setData:a=>n({type:i,data:a})},t);case"Image":return h.jsx(dfe,{data:r,setData:a=>n({type:i,data:a})},t);case"EmailLayout":return h.jsx(dz,{data:r,setData:a=>n({type:i,data:a})},t);case"Spacer":return h.jsx(Tz,{data:r,setData:a=>n({type:i,data:a})},t);case"NotionText":return h.jsx(Wfe,{data:r,setData:a=>n({type:i,data:a})},t);case"SocialMedia":return h.jsx(qfe,{data:r,setData:a=>n({type:i,data:a})},t);default:return h.jsx("pre",{children:JSON.stringify(e,null," ")})}}const Kfe=D.memo(Yfe),Qfe={EmailLayout:{label:"Email",iconName:"DashboardOutlined"},NotionText:{label:"Text",iconName:"ArticleOutlined"},SocialMedia:{label:"Social",iconName:"Groups2"},Button:{label:"Button",iconName:"SmartButtonOutlined"},Image:{label:"Image",iconName:"ImageOutlined"},Divider:{label:"Divider",iconName:"HorizontalRuleOutlined"},Spacer:{label:"Spacer",iconName:"Crop32Outlined"},ColumnsContainer:{label:"Columns",iconName:"ViewColumnOutlined"},Container:{label:"Container",iconName:"LibraryAddOutlined"},Heading:{label:"Heading",iconName:"Title"},Html:{label:"HTML",iconName:"CodeOutlined"},Avatar:{label:"Avatar",iconName:"AccountCircleOutlined"}},Xfe=t=>e=>e.document[t];function Zfe(t){if(!t)return[];switch(t.type){case"EmailLayout":return t.data?.childrenIds||[];case"Container":return t.data?.props?.childrenIds||[];case"ColumnsContainer":return t.data?.props?.columns?.flatMap(e=>e.childrenIds||[])||[];default:return[]}}function xz(t,e,n){const r=Zfe(t[e]);for(const i of r)if(i===n||xz(t,i,n))return!0;return!1}function Jfe(t,e,n,r){if(!r)return!1;const i=t[e];if(!i||i.type!=="ColumnsContainer")return!1;const a=i.data?.props?.columns?.[n]?.childrenIds||[];for(const s of a)if(s===r||xz(t,s,r))return!0;return!1}function eme(t){const e=t.document;if(!e||!e.root)return null;function n(i,a){const s=a.document[i];if(!s)return[];switch(s.type){case"EmailLayout":return s.data?.childrenIds||[];case"Container":return s.data?.props?.childrenIds||[];case"ColumnsContainer":return s.data?.props?.columns?.flatMap(o=>o.childrenIds||[])||[];default:return[]}}function r(i,a,s){const o=s.document[i],l=o?.type??"Unknown",c=Qfe[l]??{label:l,iconName:"WidgetsOutlined"};if(l==="ColumnsContainer"){const p=o.data?.props?.columns,m=o.data?.props?.columnsCount===2?2:3,g=[];for(let _=0;_<m;_++){const b=p?.[_]?.childrenIds??[],y=Vce(i,_);g.push({blockId:y,type:"ColumnSlot",label:"",iconName:"WidgetsOutlined",children:b.map(v=>r(v,a+2,s)),depth:a+1,columnSlot:{parentBlockId:i,columnIndex:_,columnsCount:m}})}return{blockId:i,type:l,label:c.label,iconName:c.iconName,children:g,depth:a}}const d=n(i,s).map(p=>r(p,a+1,s));return{blockId:i,type:l,label:c.label,iconName:c.iconName,children:d,depth:a}}return r("root",0,t)}function tme(t){return ue(t)}function nme(t){return ue(Xfe(t))}function rme(){const t=pf(),e=nme(t??"root"),n=D.useCallback(s=>{t&&Vk(t,()=>s)},[t]),r=D.useCallback(s=>{Vk("root",()=>s)},[]);if(!e)return null;const{data:i,type:a}=e;switch(a){case"Container":return h.jsx(sz,{data:i,setData:s=>n({type:a,data:s})},t);case"Divider":return h.jsx(cz,{data:i,setData:s=>n({type:a,data:s})},t);case"Spacer":return h.jsx(Tz,{data:i,setData:s=>n({type:a,data:s})},t);case"EmailLayout":return h.jsx(dz,{data:i,setData:s=>r({type:a,data:s})},"root");default:return h.jsx("pre",{children:JSON.stringify(e,null," ")})}}function ime({sticky:t,heightContent:e}){const n=_o(),r=c8(),i=pf(),a=Sr(),s=dr(),{t:o}=Ot.useTranslation("inspector"),l=()=>{const f={position:"absolute",top:"1rem",right:"0rem",height:"24px",lineHeight:"normal",width:"fit",fontSize:"12px"};switch(n){case"block-configuration":case"css":return h.jsxs("div",{style:{position:"relative"},children:[h.jsx(Vb,{color:"primary",sx:f,label:`${o(a==="desktop"?"header.desktop":"header.mobile")}`}),h.jsx(Kfe,{})]});case"styles":return h.jsxs("div",{style:{position:"relative"},children:[h.jsx(rme,{}),h.jsx(Vb,{color:"primary",sx:f,label:`${o(a==="desktop"?"header.desktop":"header.mobile")}`})]})}},c=()=>h.jsx("svg",{style:{marginRight:"4px",color:"inherit"},width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",children:h.jsx("path",{d:"M3.83398 5H17.1673M3.83398 10H17.1673M3.83398 15H9.66732",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),u=()=>h.jsx("svg",{style:{marginRight:"4px",color:"inherit"},width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:h.jsx("path",{d:"M5.83333 17.5C3.99238 17.5 2.5 16.0076 2.5 14.1667V4.16667C2.5 3.24619 3.24619 2.5 4.16667 2.5H7.5C8.42047 2.5 9.16667 3.24619 9.16667 4.16667V14.1667C9.16667 16.0076 7.67428 17.5 5.83333 17.5ZM5.83333 17.5H15.8333C16.7538 17.5 17.5 16.7538 17.5 15.8333V12.5C17.5 11.5795 16.7538 10.8333 15.8333 10.8333H13.8807M9.16669 6.11927L10.5474 4.73858C11.1983 4.0877 12.2535 4.0877 12.9044 4.73858L15.2614 7.0956C15.9123 7.74647 15.9123 8.80175 15.2614 9.45262L8.19036 16.5237M5.83333 14.1667H5.84167",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});D.useEffect(()=>{const f=m=>{const g=m.target;nM(g.innerWidth)};return window&&nM(window.innerWidth),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[n]);const d=(f,m)=>{iue(m)},p=t?e?`calc(${e} - ${kl})`:void 0:e??void 0;return h.jsxs(Ah,{sx:f=>({width:ny,padding:"0!important",margin:"0!important",height:p,maxHeight:p,display:"flex",flexDirection:"column",overflow:"hidden",position:t?"sticky":"static",top:t?kl:0,backgroundColor:`${f.palette.background.paper} !important`}),children:[h.jsx(tt,{sx:{position:"sticky",top:0,zIndex:1,backgroundColor:`${s.palette.background.paper} !important`},children:h.jsxs(HU,{sx:{backgroundColor:`${s.palette.background.paper} !important`},value:n,onChange:d,children:[i!=null&&!Qb.includes(r||"")&&[h.jsx(ou,{sx:{height:kl,minHeight:kl,fontWeight:"bold"},value:"block-configuration",label:o("header.content"),icon:h.jsx(c,{}),iconPosition:"start"},"block-configuration"),h.jsx(ou,{sx:{height:kl,minHeight:kl,fontWeight:"bold"},value:"css",label:o("header.styles"),icon:h.jsx(u,{}),iconPosition:"start"},"css")],Qb.includes(r)&&[h.jsx(ou,{sx:{height:kl,minHeight:kl,fontWeight:"bold"},value:"styles",label:o("header.styles"),icon:h.jsx(u,{}),iconPosition:"start"},"styles")]]})}),h.jsx(Ah,{sx:f=>({flex:"1 1 auto",minHeight:0,overflowY:"auto",px:2,backgroundColor:`${f.palette.background.paper} !important`}),children:l()})]})}const kz=({children:t,topOffset:e=0,zIndex:n=10,className:r="",style:i={},disabled:a=!1,threshold:s=null,...o})=>{const[l,c]=D.useState(!1),[u,d]=D.useState({width:0,height:0}),[p,f]=D.useState({left:0}),[m,g]=D.useState(0),[_,b]=D.useState(!1),y=D.useRef(null),v=D.useRef(null),E=D.useRef(null);D.useEffect(()=>{if(a){c(!1),b(!1),g(0);return}const S=v.current,x=y.current;if(!S||!x)return;let k=null;s&&(s.startsWith("#")?k=document.getElementById(s.slice(1)):(s.startsWith("."),k=document.querySelector(s)));const w=()=>{const P=x.getBoundingClientRect();d({width:P.width,height:P.height}),f({left:P.left})},A=()=>{if(!k||!x)return{offset:0,isPushed:!1};const P=k.getBoundingClientRect(),M=x.getBoundingClientRect(),F=e+M.height;if(P.top<F){const U=F-P.top,j=M.height+20;return{offset:-Math.min(U,j),isPushed:!0}}return{offset:0,isPushed:!1}},L=new IntersectionObserver(([P])=>{const M=!P.isIntersecting;if(M&&!l&&w(),c(M),M&&s){const{offset:F,isPushed:U}=A();g(F),b(U)}else M||(g(0),b(!1))},{threshold:0,rootMargin:`-${e}px 0px 0px 0px`}),O=new ResizeObserver(()=>{w()}),I=()=>{if(s&&l){const{offset:P,isPushed:M}=A();g(P),b(M)}};return L.observe(S),O.observe(x),s&&window.addEventListener("scroll",I,{passive:!0}),w(),()=>{L.disconnect(),O.disconnect(),s&&window.removeEventListener("scroll",I)}},[e,l,a,s]);const C=!a&&l,T=C?`${e+m}px`:"auto";return h.jsxs("div",{ref:E,className:r,...o,children:[!a&&h.jsx("div",{ref:v,style:{height:"1px",position:"absolute",top:`-${e+1}px`,left:0,right:0,pointerEvents:"none"}}),C&&h.jsx("div",{style:{height:`${u.height}px`,width:`${u.width}px`}}),h.jsx("div",{ref:y,style:{position:C?"fixed":"static",top:T,width:"auto",height:"auto",zIndex:C?n:"auto",transition:_?"none":"box-shadow 0.2s ease-in-out, top 0.3s ease-out",..._&&m<-u.height*.3&&{opacity:Math.max(0,1+(m+u.height*.3)/(u.height*.7))},...i},children:t})]})};var wz=WU();function Kr(t){this.content=t}Kr.prototype={constructor:Kr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),a=r.content.slice();return i==-1?a.push(n||t,e):(a[i+1]=e,n&&(a[i]=n)),new Kr(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Kr(n)},addToStart:function(t,e){return new Kr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Kr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),a=r.find(t);return i.splice(a==-1?i.length:a,0,e,n),new Kr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Kr.from(t),t.size?new Kr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Kr.from(t),t.size?new Kr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Kr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Kr.from=function(t){if(t instanceof Kr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Kr(e)};function Dz(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),a=e.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let s=0;i.text[s]==a.text[s];s++)n++;return n}if(i.content.size||a.content.size){let s=Dz(i.content,a.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Az(t,e,n,r){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let s=t.child(--i),o=e.child(--a),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let c=0,u=Math.min(s.text.length,o.text.length);for(;c<u&&s.text[s.text.length-c-1]==o.text[o.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let c=Az(s.content,o.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class fe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,a){for(let s=0,o=0;o<n;s++){let l=this.content[s],c=o+l.nodeSize;if(c>e&&r(l,i+o,a||null,s)!==!1&&l.content.size){let u=o+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let a="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let c=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&r&&(s?s=!1:a+=r),a+=c},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new fe(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let a=0,s=0;s<n;a++){let o=this.content[a],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),i+=o.nodeSize),s=l}return new fe(r,i)}cutByIndex(e,n){return e==n?fe.empty:e==0&&n==this.content.length?this:new fe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new fe(i,a)}addToStart(e){return new fe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new fe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Dz(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Az(this,e,n,r)}findIndex(e){if(e==0)return b_(0,e);if(e==this.size)return b_(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),a=r+i.nodeSize;if(a>=e)return a==e?b_(n+1,a):b_(n,r);r=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return fe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new fe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return fe.empty;let n,r=0;for(let i=0;i<e.length;i++){let a=e[i];r+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(n||(n=e.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new fe(n||e,r)}static from(e){if(!e)return fe.empty;if(e instanceof fe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new fe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}fe.empty=new fe([],0);const a1={index:0,offset:0};function b_(t,e){return a1.index=t,a1.offset=e,a1}function Ty(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ty(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ty(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let zn=class _w{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))n||(n=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!r&&a.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(a)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ty(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return _w.none;if(e instanceof _w)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};zn.none=[];class xy extends Error{}class Be{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Rz(this.content,e+this.openStart,n);return r&&new Be(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Be(Nz(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Be.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Be(fe.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)r++;for(let a=e.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new Be(e,r,i)}}Be.empty=new Be(fe.empty,0,0);function Nz(t,e,n){let{index:r,offset:i}=t.findIndex(e),a=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(i==e||a.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,a.copy(Nz(a.content,e-i-1,n-i-1)))}function Rz(t,e,n,r){let{index:i,offset:a}=t.findIndex(e),s=t.maybeChild(i);if(a==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=Rz(s.content,e-a-1,n,s);return o&&t.replaceChild(i,s.copy(o))}function ame(t,e,n){if(n.openStart>t.depth)throw new xy("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new xy("Inconsistent open depths");return Oz(t,e,n,0)}function Oz(t,e,n,r){let i=t.index(r),a=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=Oz(t,e,n,r+1);return a.copy(a.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Eu(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=sme(n,t);return Eu(a,Mz(t,s,o,e,r))}else return Eu(a,ky(t,e,r))}function Iz(t,e){if(!e.type.compatibleContent(t.type))throw new xy("Cannot join "+e.type.name+" onto "+t.type.name)}function bw(t,e,n){let r=t.node(n);return Iz(r,e.node(n)),r}function vu(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Qm(t,e,n,r){let i=(e||t).node(n),a=0,s=e?e.index(n):i.childCount;t&&(a=t.index(n),t.depth>n?a++:t.textOffset&&(vu(t.nodeAfter,r),a++));for(let o=a;o<s;o++)vu(i.child(o),r);e&&e.depth==n&&e.textOffset&&vu(e.nodeBefore,r)}function Eu(t,e){return t.type.checkContent(e),t.copy(e)}function Mz(t,e,n,r,i){let a=t.depth>i&&bw(t,e,i+1),s=r.depth>i&&bw(n,r,i+1),o=[];return Qm(null,t,i,o),a&&s&&e.index(i)==n.index(i)?(Iz(a,s),vu(Eu(a,Mz(t,e,n,r,i+1)),o)):(a&&vu(Eu(a,ky(t,e,i+1)),o),Qm(e,n,i,o),s&&vu(Eu(s,ky(n,r,i+1)),o)),Qm(r,null,i,o),new fe(o)}function ky(t,e,n){let r=[];if(Qm(null,t,n,r),t.depth>n){let i=bw(t,e,n+1);vu(Eu(i,ky(t,e,n+1)),r)}return Qm(e,null,n,r),new fe(r)}function sme(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let a=n-1;a>=0;a--)i=e.node(a).copy(fe.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Lh{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let a=0;a<e;a++)i+=r.child(a).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return zn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var s=0;s<a.length;s++)a[s].type.spec.inclusive===!1&&(!i||!a[s].isInSet(i.marks))&&(a=a[s--].removeFromSet(a));return a}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<r.length;a++)r[a].type.spec.inclusive===!1&&(!i||!r[a].isInSet(i.marks))&&(r=r[a--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new wy(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,a=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(a),c=a-l;if(r.push(s,o,i+l),!c||(s=s.child(o),s.isText))break;a=c-1,i+=l+1}return new Lh(n,r,a)}static resolveCached(e,n){let r=gP.get(e);if(r)for(let a=0;a<r.elts.length;a++){let s=r.elts[a];if(s.pos==n)return s}else gP.set(e,r=new ome);let i=r.elts[r.i]=Lh.resolve(e,n);return r.i=(r.i+1)%lme,i}}class ome{constructor(){this.elts=[],this.i=0}}const lme=12,gP=new WeakMap;class wy{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const cme=Object.create(null);let rc=class yw{constructor(e,n,r,i=zn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||fe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ty(this.attrs,n||e.defaultAttrs||cme)&&zn.sameSet(this.marks,r||zn.none)}copy(e=null){return e==this.content?this:new yw(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new yw(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Be.empty;let i=this.resolve(e),a=this.resolve(n),s=r?0:i.sharedDepth(n),o=i.start(s),c=i.node(s).content.cut(i.pos-o,a.pos-o);return new Be(c,i.depth-s,a.depth-s)}replace(e,n,r){return ame(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Lh.resolveCached(this,e)}resolveNoCache(e){return Lh.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,a=>(r.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Pz(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=fe.empty,i=0,a=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,a),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(r),s=a&&a.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=zn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!zn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=fe.fromJSON(e,n.content),a=e.nodeType(n.type).create(n.attrs,i,r);return a.type.checkAttrs(a.attrs),a}};rc.prototype.text=void 0;class Dy extends rc{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pz(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Dy(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Dy(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Pz(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Bu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new ume(e,n);if(r.next==null)return Bu.empty;let i=Lz(r);r.next&&r.err("Unexpected trailing text");let a=_me(gme(i));return bme(a,r),a}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let a=n;i&&a<r;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function a(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return fe.from(o.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=a(d,o.concat(u));if(p)return p}}return null}return a(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),a=i.match;if(a.matchType(e)){let s=[];for(let o=i;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<a.next.length;s++){let{type:o,next:l}=a.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let a=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)a+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return a}).join(`
|
|
147
|
+
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+na(r.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(r);throw r}};const Ru=new Hce;function In(t,e){return Ru.parse(t,e)}In.options=In.setOptions=function(t){return Ru.setOptions(t),In.defaults=Ru.defaults,XU(In.defaults),In};In.getDefaults=LA;In.defaults=Xu;In.use=function(...t){return Ru.use(...t),In.defaults=Ru.defaults,XU(In.defaults),In};In.walkTokens=function(t,e){return Ru.walkTokens(t,e)};In.parseInline=Ru.parseInline;In.Parser=Ys;In.parser=Ys.parse;In.Renderer=ty;In.TextRenderer=GA;In.Lexer=Ws;In.lexer=Ws.lex;In.Tokenizer=Jb;In.Hooks=qm;In.parse=In;In.options;In.setOptions;In.use;In.walkTokens;In.parseInline;Ys.parse;Ws.lex;function jce(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function qce(t){const e=String(t?.text??"");if(t?.markdown===!0){const n=In.parse(e,{async:!1});return typeof n=="string"?n:String(n)}return`<p>${jce(e)}</p>`}function rp(t){const e={...t};for(const[n,r]of Object.entries(e)){const i=r.type;if(i==="CustomEditor"||i==="Wysiwyg")e[n]={...r,type:"NotionText"};else if(i==="Text"){const a=r.data??{},s=a.props??{},o=qce(s);e[n]={...r,type:"NotionText",data:{...a,props:{html:o}}}}}return e}const Gk="eb-component-tree-column:";function Vce(t,e){return`${Gk}${t}:${e}`}function l8(t){if(!t.startsWith(Gk))return null;const e=t.slice(Gk.length),n=e.lastIndexOf(":");if(n<=0)return null;const r=e.slice(0,n),i=Number(e.slice(n+1));return!Number.isInteger(i)||i<0||i>2?null:{parentBlockId:r,columnIndex:i}}const ny=385,uE="https://ddc4vowthkjlv.cloudfront.net/uploads/gallery/1/69cc1b1083b90.jpg";let QS=null;const Wce=2e3;function yg(){QS&&clearTimeout(QS),QS=setTimeout(()=>{const t=new CustomEvent("email-builder-auto-save",{detail:!0});window.dispatchEvent(t)},Wce)}const Yce=()=>({document:rp(JSON.parse(JSON.stringify(ace))),selectedBlockId:null,selectedSidebarTab:"styles",selectedMainTab:"editor",selectedScreenSize:"desktop",windowWidth:0,inspectorDrawerOpen:!0,componentTreeOpen:!1,samplesDrawerOpen:!0,inspectorDrawerWidth:ny,devMode:!1,imageUploading:{uploading:!1,id:""},disableEdition:!1,disableUpdate:!1,freeMode:!1,minHeight:"calc(100dvh - 65px)",color:{primary:"",secondary:""},galleryImages:!0,imagePlaceholder:uE,darkMode:!0,colorPicker:{paletteColors:ice,isLocked:!1},tour:!1,stickyHeader:!0,heightContent:"calc(100dvh - 50px)",containerGrow:!0,notionTextInlineEditingBlockId:null,highlightColor:"#FF6B35",showVersion:!1}),ue=QU(()=>Yce());D.createContext(ue);function c8(){const t=ue(e=>e.document[ue(n=>n.selectedBlockId)||""]);return t?t.type:null}function nM(t){return ue.setState({windowWidth:t})}function Kce(){return ue(t=>t.devMode)}function Qce(t){return ue.setState({devMode:t})}function HA(){return ue(t=>t.document)}function u8(t){return ue(e=>e.document[t])}function Xce(t){return ue(e=>e.document[t]?.type)}function Zce(t){return ue(e=>e.selectedBlockId===t)}function pf(){return ue(t=>t.selectedBlockId)}function vg(){return ue(t=>t.notionTextInlineEditingBlockId)}function Vm(t){const e=ue.getState().notionTextInlineEditingBlockId;return e&&e!==t&&window.dispatchEvent(new CustomEvent("notion-text-force-save",{detail:{blockId:e}})),ue.setState({notionTextInlineEditingBlockId:t})}function Jce(){return!!vg()}function eue(){return vg()}function tue(){return ue(t=>t.highlightColor)}function Sr(){return ue(t=>t.selectedScreenSize)}function jA(){return ue(t=>t.selectedMainTab)}function p_(t){return t==="preview"&&$a(null),ue.setState({inspectorDrawerOpen:t==="editor"}),ue.setState({selectedMainTab:t})}function _o(){return ue(t=>t.selectedSidebarTab)}function nue(){return ue(t=>t.inspectorDrawerOpen)}function qA(){return ue(t=>t.componentTreeOpen)}function Hk(){ue.setState(t=>({componentTreeOpen:!t.componentTreeOpen}))}function dE(){return ue(t=>t.imageUploading)}function VA(){return ue(t=>t.disableEdition)}let ry=null,rM=0;const rue=400;let Ou=!1,jk=!1;function ff(t,e){if(Ou||jk)return;const n=Date.now(),r=n-rM;if(e&&e===ry&&r<rue){Xb().future.length>0&&Zb({future:[]});return}const a=JSON.stringify(t),{past:s}=Xb();if(s.length>0&&s[s.length-1]===a)return;const o=[...s,a].slice(-50);Zb({past:o,future:[]}),ry=e??null,rM=n}function $a(t){const e=ue.getState().notionTextInlineEditingBlockId;e&&t!==null&&e!==t&&Vm(null);const n=ue.getState().document[t||""]?.type,r=Qb.includes(n||null)?"styles":"block-configuration",i={};return t!==null&&ue.getState().selectedMainTab==="editor"&&(i.inspectorDrawerOpen=!0),ue.setState({selectedBlockId:t,selectedSidebarTab:r,...i})}function iue(t){return ue.setState({selectedSidebarTab:t})}function f_(t){const e=rp(t);return lce(),ue.setState({document:e,selectedSidebarTab:"styles",selectedBlockId:null})}function d8(t){const e=ue.getState().document;jk=!0;let n;try{n=t()}finally{jk=!1}return ff(e,null),n}function iM(){const{past:t,future:e}=Xb();if(t.length!==0){Ou=!0;try{const n=ue.getState().document,r=JSON.stringify(n),i=[...t],a=i.pop(),s=JSON.parse(a);Zb({past:i,future:[...e,r]});const o=ue.getState().selectedBlockId,l=o&&!s[o];ue.setState({document:s,...l?{selectedBlockId:null}:{}})}finally{Ou=!1,ry=null}}}function aM(){const{past:t,future:e}=Xb();if(e.length!==0){Ou=!0;try{const n=ue.getState().document,r=JSON.stringify(n),i=[...e],a=i.pop(),s=JSON.parse(a);Zb({past:[...t,r],future:i});const o=ue.getState().selectedBlockId,l=o&&!s[o];ue.setState({document:s,...l?{selectedBlockId:null}:{}})}finally{Ou=!1,ry=null}}}function bu(t,e=!0){const n=ue.getState().document,r={...n,...t};e&&ff(n);const i=()=>{ue.setState({document:r}),yg()};return e?(D.startTransition(i),ue.getState()):i()}function iy(t){return ue.setState({selectedScreenSize:t})}function ip(t,e){return ue.setState({imageUploading:{uploading:t,id:e||""}})}function p8(t){return ue.setState({disableEdition:t})}function aue(){return ue.getState().document.root.data}function pE(){return ue(t=>t.document?.root?.data)}function sue(t){return ue.setState({color:t})}function oue(t){return ue.setState({galleryImages:t})}function ay(){return ue.getState().galleryImages}function lue(t){return ue.setState({imagePlaceholder:t})}function cue(){return ue.getState().imagePlaceholder}function uue(t){return ue.setState({freeMode:t})}function WA(){return ue.getState().freeMode}function due(t){return ue.setState({darkMode:t})}function pue(t){return ue.setState({stickyHeader:t})}function fue(t){return ue.setState({heightContent:t})}function mue(t){return ue.setState({containerGrow:t})}function hue(){return ue.getState().containerGrow}function gue(t){return ue.setState({showVersion:t})}function _ue(){return ue(t=>t.showVersion)}function Nh(t,e,n,r=!0){Zu({draggedId:e,targetId:t})&&console.warn("No se puede mover un elemento dentro de uno de sus propios hijos");const i=ue.getState().document,a=JSON.parse(JSON.stringify({...i})),s=u=>{if(!u||t===e)return u;const d=u.indexOf(e);return d<0?u:u.toSpliced(d,1)},o=u=>{if(!u||t===e)return u;const d=u.indexOf(t);if(d<0)return u;const p=n==="up"?d:d+1;return u.toSpliced(p,0,e)};let l=null,c=null;for(const[u,d]of Object.entries(a)){const p=d;if(c)break;switch(p.type){case"EmailLayout":p.data.childrenIds?.length&&p.data.childrenIds.includes(e)&&(c=u,a[u]={...p,data:{...p.data,childrenIds:s(p.data.childrenIds)}});break;case"Container":p.data.props?.childrenIds?.length&&p.data.props.childrenIds.includes(e)&&(c=u,a[u]={...p,data:{...p.data,props:{...p.data.props,childrenIds:s(p.data.props.childrenIds)}}});break;case"ColumnsContainer":if(p.data.props?.columns){let f=!1;const m=p.data.props.columns.map((g,_)=>g?.childrenIds?.includes(e)?(c=`${u}-column-${_}`,f=!0,{...g,childrenIds:s(g.childrenIds)}):g);f&&(a[u]={...p,data:{...p.data,props:{...p.data.props,columns:m}}})}break}}if(l=null,r)for(const[u,d]of Object.entries(a)){const p=d;if(l)break;switch(p.type){case"EmailLayout":p.data.childrenIds?.length&&p.data.childrenIds.includes(t)&&(l=u,a[u]={...p,data:{...p.data,childrenIds:o(p.data.childrenIds)}});break;case"Container":p.data.props?.childrenIds?.length&&p.data.props.childrenIds.includes(t)&&(l=u,a[u]={...p,data:{...p.data,props:{...p.data.props,childrenIds:o(p.data.props.childrenIds)}}});break;case"ColumnsContainer":if(p.data.props?.columns){const f=l8(t);if(f&&f.parentBlockId===u){l=u;const{columnIndex:g}=f,_=p.data.props.columns.map((b,y)=>{if(y!==g)return b;const v=[...b?.childrenIds||[]],E=n==="up"?0:v.length;return{...b,childrenIds:v.toSpliced(E,0,e)}});a[u]={...p,data:{...p.data,props:{...p.data.props,columns:_}}};break}const m=p.data.props.columns.map((g,_)=>g?.childrenIds?.includes(t)?(l=`${u}-column-${_}`,{...g,childrenIds:o(g.childrenIds)}):g);a[u]={...p,data:{...p.data,props:{...p.data.props,columns:m}}}}break}}return bu(a)}function bue({parentId:t,blockId:e,indexArray:n}){if(Zu({draggedId:e,targetId:t})){console.warn("No se puede mover un elemento dentro de uno de sus propios hijos");return}return d8(()=>{Nh("",e,"down",!1);const r=ue.getState().document,i=JSON.parse(JSON.stringify({...r}));if(!i[t])return;const a=i[t],s=[...a.data.props.columns||[]];return s[n||0]={childrenIds:[e]},i[t]={type:"ColumnsContainer",data:{...a.data,props:{...a.data.props,columns:s}}},bu(i)})}function yue({parentId:t,blockId:e}){if(Zu({draggedId:e,targetId:t})){console.warn("No se puede mover un elemento dentro de uno de sus propios hijos");return}return d8(()=>{Nh("",e,"down",!1);const n=ue.getState().document,r=JSON.parse(JSON.stringify({...n}));if(!r[t])return;const i=r[t];return r[t]={type:"Container",data:{...i.data,props:{...i.data.props,childrenIds:[e]}}},bu(r)})}function Zu({draggedId:t,targetId:e}){if(t===e)return!0;const n=l8(e),r=n?n.parentBlockId:e;if(t===r)return!0;const i=ue.getState().document;function a(s,o){const l=i[s];if(!l)return!1;let c=[];switch(l.type){case"EmailLayout":c=l.data.childrenIds||[];break;case"Container":c=l.data.props?.childrenIds||[];break;case"ColumnsContainer":l.data.props?.columns&&l.data.props.columns.forEach(u=>{u?.childrenIds&&(c=[...c,...u.childrenIds])});break}if(c.includes(o))return!0;for(const u of c)if(a(u,o))return!0;return!1}return a(t,r)}function vue(){return ue(t=>t.colorPicker)}function XS(t){ue.setState(e=>({colorPicker:{...e.colorPicker,...t}}))}function f8(t,e){if(Ou)return;const n=ue.getState().document,r=n[t];if(!r){console.warn(`Block ${t} not found`);return}const i=e(r);if(r===i)return;const a={...n,[t]:i};ff(n,t),D.startTransition(()=>{ue.setState({document:a})}),yg()}function Eue(t,e){if(Ou)return;const n=ue.getState().document,r=n[t];if(!r){console.warn(`Block ${t} not found`);return}const i=e(r);if(r===i)return;const a={...n,[t]:i};ff(n,t),ue.setState({document:a}),yg()}function Sue(t,e){f8(t,n=>{const r=typeof e=="function"?e(n.data.props):{...n.data.props,...e};return{...n,data:{...n.data,props:r}}})}function m_(t,e){Eue(t,n=>{const r=typeof e=="function"?e(n.data.props):{...n.data.props,...e};return{...n,data:{...n.data,props:r}}})}function qk(t,e,n,r){const i=ue.getState().document,a=i[t];if(!a)return;const s=a.type==="EmailLayout"?{...a,data:{...a.data,childrenIds:r}}:{...a,data:{...a.data,props:{...a.data?.props,childrenIds:r}}},o={...i,[e]:n,[t]:s};ff(i),D.startTransition(()=>{ue.setState({document:o})}),yg()}function Cue(t){const e=ue.getState().document,n={...e,...t};ff(e),D.startTransition(()=>{ue.setState({document:n})}),yg()}function Vk(t,e){f8(t,e)}const Tue=Ee([h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M7.35 18.5C8.66 17.56 10.26 17 12 17s3.34.56 4.65 1.5c-1.31.94-2.91 1.5-4.65 1.5s-3.34-.56-4.65-1.5m10.79-1.38C16.45 15.8 14.32 15 12 15s-4.45.8-6.14 2.12C4.7 15.73 4 13.95 4 12c0-4.42 3.58-8 8-8s8 3.58 8 8c0 1.95-.7 3.73-1.86 5.12"},"0"),h.jsx("path",{d:"M12 6c-1.93 0-3.5 1.57-3.5 3.5S10.07 13 12 13s3.5-1.57 3.5-3.5S13.93 6 12 6m0 5c-.83 0-1.5-.67-1.5-1.5S11.17 8 12 8s1.5.67 1.5 1.5S12.83 11 12 11"},"1")],"AccountCircleOutlined"),xue=Ee(h.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),YA=Ee(h.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"AddOutlined"),m8=Ee(h.jsx("path",{d:"M4 22H2V2h2zM22 7H6v3h16zm-6 7H6v3h10z"}),"AlignHorizontalLeftOutlined"),h8=Ee(h.jsx("path",{d:"M20 2h2v20h-2zM2 10h16V7H2zm6 7h10v-3H8z"}),"AlignHorizontalRightOutlined"),g8=Ee(h.jsx("path",{d:"M22 22H2v-2h20zM10 2H7v16h3zm7 6h-3v10h3z"}),"AlignVerticalBottomOutlined"),_8=Ee(h.jsx("path",{d:"M22 2v2H2V2zM7 22h3V6H7zm7-6h3V6h-3z"}),"AlignVerticalTopOutlined"),kue=Ee(h.jsx("path",{d:"m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27M12 17.5 6.5 12H10v-2h4v2h3.5zM5.12 5l.81-1h12l.94 1z"}),"Archive"),b8=Ee([h.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),h.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")],"ArticleOutlined"),wue=Ee(h.jsx("path",{d:"M19 12h-2v3h-3v2h5zM7 9h3V7H5v5h2zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16.01H3V4.99h18z"}),"AspectRatioOutlined"),Due=Ee(h.jsx("path",{d:"M2 12.5C2 9.46 4.46 7 7.5 7H18c2.21 0 4 1.79 4 4s-1.79 4-4 4H9.5C8.12 15 7 13.88 7 12.5S8.12 10 9.5 10H17v2H9.41c-.55 0-.55 1 0 1H18c1.1 0 2-.9 2-2s-.9-2-2-2H7.5C5.57 9 4 10.57 4 12.5S5.57 16 7.5 16H17v2H7.5C4.46 18 2 15.54 2 12.5"}),"Attachment"),Wk=Ee(h.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z"}),"AutoAwesome"),Aue=Ee(h.jsx("path",{d:"M9 11H7v2h2zm4 4h-2v2h2zM9 3H7v2h2zm4 8h-2v2h2zM5 3H3v2h2zm8 4h-2v2h2zm4 4h-2v2h2zm-4-8h-2v2h2zm4 0h-2v2h2zm2 10h2v-2h-2zm0 4h2v-2h-2zM5 7H3v2h2zm14-4v2h2V3zm0 6h2V7h-2zM5 11H3v2h2zM3 21h18v-2H3zm2-6H3v2h2z"}),"BorderBottomOutlined"),Nue=Ee(h.jsx("path",{d:"M11 21h2v-2h-2zm0-4h2v-2h-2zm0-12h2V3h-2zm0 4h2V7h-2zm0 4h2v-2h-2zm-4 8h2v-2H7zM7 5h2V3H7zm0 8h2v-2H7zm-4 8h2V3H3zM19 9h2V7h-2zm-4 12h2v-2h-2zm4-4h2v-2h-2zm0-14v2h2V3zm0 10h2v-2h-2zm0 8h2v-2h-2zm-4-8h2v-2h-2zm0-8h2V3h-2z"}),"BorderLeftOutlined"),Rue=Ee(h.jsx("path",{d:"M13 7h-2v2h2zm0 4h-2v2h2zm4 0h-2v2h2zM3 3v18h18V3zm16 16H5V5h14zm-6-4h-2v2h2zm-4-4H7v2h2z"}),"BorderOuterOutlined"),Oue=Ee(h.jsx("path",{d:"M7 21h2v-2H7zM3 5h2V3H3zm4 0h2V3H7zm0 8h2v-2H7zm-4 8h2v-2H3zm8 0h2v-2h-2zm-8-8h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm8 8h2v-2h-2zm4-4h2v-2h-2zm4-10v18h2V3zm-4 18h2v-2h-2zm0-16h2V3h-2zm-4 8h2v-2h-2zm0-8h2V3h-2zm0 4h2V7h-2z"}),"BorderRightOutlined"),Iue=Ee(h.jsx("path",{d:"M7 21h2v-2H7zm0-8h2v-2H7zm4 0h2v-2h-2zm0 8h2v-2h-2zm-8-4h2v-2H3zm0 4h2v-2H3zm0-8h2v-2H3zm0-4h2V7H3zm8 8h2v-2h-2zm8-8h2V7h-2zm0 4h2v-2h-2zM3 3v2h18V3zm16 14h2v-2h-2zm-4 4h2v-2h-2zM11 9h2V7h-2zm8 12h2v-2h-2zm-4-8h2v-2h-2z"}),"BorderTopOutlined"),Mue=Ee(h.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),Pue=Ee(h.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}),"Cancel"),Lue=Ee(h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"}),"CheckCircle"),fE=Ee(h.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Fue=Ee(h.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"CodeOutlined"),sM=Ee(h.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"}),"ContentCopyOutlined"),y8=Ee(h.jsx("path",{d:"M19 6H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 10H5V8h14z"}),"Crop32Outlined"),Bue=Ee(h.jsx("path",{d:"M19 5v2h-4V5zM9 5v6H5V5zm10 8v6h-4v-6zM9 17v2H5v-2zM21 3h-8v6h8zM11 3H3v10h8zm10 8h-8v10h8zm-10 4H3v6h8z"}),"DashboardOutlined"),$ue=Ee(h.jsx("path",{d:"M9 11H7v2h2zm4 0h-2v2h2zm4 0h-2v2h2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V9h14z"}),"DateRange"),Uue=Ee(h.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),zue=Ee(h.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline"),Gue=Ee(h.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),v8=Ee(h.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Hue=Ee(h.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),jue=Ee(h.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined"),que=Ee(h.jsx("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 4-8 5-8-5V6l8 5 8-5z"}),"Email"),Vue=Ee(h.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M8.5 8c.83 0 1.5.67 1.5 1.5S9.33 11 8.5 11 7 10.33 7 9.5 7.67 8 8.5 8M12 18c-2.28 0-4.22-1.66-5-4h10c-.78 2.34-2.72 4-5 4m3.5-7c-.83 0-1.5-.67-1.5-1.5S14.67 8 15.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"EmojiEmotions"),Wue=Ee(h.jsx("path",{d:"M17 12h-5v5h5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1zm3 18H5V8h14z"}),"Event"),Yue=Ee(h.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z"}),"FileDownloadOutlined"),oM=Ee(h.jsx("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenter"),Kue=Ee(h.jsx("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenterOutlined"),lM=Ee(h.jsx("path",{d:"M3 21h18v-2H3zm0-4h18v-2H3zm0-4h18v-2H3zm0-4h18V7H3zm0-6v2h18V3z"}),"FormatAlignJustify"),cM=Ee(h.jsx("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeft"),Que=Ee(h.jsx("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeftOutlined"),uM=Ee(h.jsx("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRight"),Xue=Ee(h.jsx("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRightOutlined"),Zue=Ee(h.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5"}),"FormatBold"),Jue=Ee(h.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),ede=Ee(h.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),E8=Ee(h.jsx("path",{d:"M18 14c0-4-6-10.8-6-10.8s-1.33 1.51-2.73 3.52l8.59 8.59c.09-.42.14-.86.14-1.31m-.88 3.12L12.5 12.5 5.27 5.27 4 6.55l3.32 3.32C6.55 11.32 6 12.79 6 14c0 3.31 2.69 6 6 6 1.52 0 2.9-.57 3.96-1.5l2.63 2.63 1.27-1.27z"}),"FormatColorReset"),tde=Ee(h.jsx("path",{d:"M2 20h20v4H2zm3.49-3h2.42l1.27-3.58h5.65L16.09 17h2.42L13.25 3h-2.5zm4.42-5.61 2.03-5.79h.12l2.03 5.79z"}),"FormatColorText"),nde=Ee(h.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic"),ZS=Ee(h.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z"}),"FormatListBulleted"),dM=Ee(h.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered"),rde=Ee(h.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z"}),"FormatUnderlined"),S8=Ee(h.jsx("path",{d:"M10.27 12h3.46c.93 0 1.63-.83 1.48-1.75l-.3-1.79C14.67 7.04 13.44 6 12 6S9.33 7.04 9.09 8.47l-.3 1.79c-.15.91.55 1.74 1.48 1.74m-8.61-.89c-.13.26-.18.57-.1.88.16.69.76 1.03 1.53 1h1.95c.83 0 1.51-.58 1.51-1.29 0-.14-.03-.27-.07-.4-.01-.03-.01-.05.01-.08.09-.16.14-.34.14-.53 0-.31-.14-.6-.36-.82-.03-.03-.03-.06-.02-.1.07-.2.07-.43.01-.65-.16-.43-.55-.72-.99-.74-.03 0-.05-.01-.07-.03-.17-.21-.48-.35-.83-.35-.3 0-.57.1-.75.26-.03.03-.06.03-.09.02-.14-.06-.3-.09-.46-.09-.65 0-1.18.49-1.24 1.12 0 .02-.01.04-.03.06-.29.26-.46.65-.41 1.05.03.22.12.43.25.6.03.02.03.06.02.09m14.58 2.54c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9C6.68 14.13 6 15.21 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74m-15.02.93C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58m21.56 0c-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24v-1.57c0-.81-.48-1.53-1.22-1.85M22 11v-.5c0-1.1-.9-2-2-2h-2c-.42 0-.65.48-.39.81l.7.63c-.19.31-.31.67-.31 1.06 0 1.1.9 2 2 2s2-.9 2-2"}),"Groups2"),C8=Ee(h.jsx("path",{d:"M13 6.99h3L12 3 8 6.99h3v10.02H8L12 21l4-3.99h-3z"}),"HeightOutlined"),T8=Ee(h.jsx("path",{fillRule:"evenodd",d:"M4 11h16v2H4z"}),"HorizontalRuleOutlined"),x8=Ee(h.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"}),"ImageOutlined"),k8=Ee(h.jsx("path",{d:"M18 13v7H4V6h5.02c.05-.71.22-1.38.48-2H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-5zm-1.5 5h-11l2.75-3.53 1.96 2.36 2.75-3.54zm2.8-9.11c.44-.7.7-1.51.7-2.39C20 4.01 17.99 2 15.5 2S11 4.01 11 6.5s2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21 13.42 22.42 12zM15.5 9C14.12 9 13 7.88 13 6.5S14.12 4 15.5 4 18 5.12 18 6.5 16.88 9 15.5 9"}),"ImageSearchOutlined"),JS=Ee(h.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),ide=Ee(h.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2m6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56M12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96M4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56m2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8M12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96M14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2m.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56M16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2z"}),"Language"),w8=Ee(h.jsx("path",{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H8V4h12zm-7-2h2v-3h3V9h-3V6h-2v3h-3v2h3z"}),"LibraryAddOutlined"),KA=Ee(h.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),ade=Ee(h.jsx("path",{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42M5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7"}),"LocalOffer"),Eg=Ee(h.jsx("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1z"}),"Lock"),Sg=Ee(h.jsx("path",{d:"M12 17c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m0 12H6V10h12z"}),"LockOpen"),sde=Ee(h.jsx("path",{d:"M20 3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h3l-1 1v2h12v-2l-1-1h3c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 13H4V5h16z"}),"MonitorOutlined"),ode=Ee(h.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),lde=Ee(h.jsx("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"}),"PhoneIphoneOutlined"),D8=Ee(h.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4.86 8.86-3 3.87L9 13.14 6 17h12z"}),"PhotoOutlined"),A8=Ee(h.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),Qf=Ee(h.jsx("path",{d:"M19 19h2v2h-2zm0-2h2v-2h-2zM3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm0-4h2V3H3zm4 0h2V3H7zm8 16h2v-2h-2zm-4 0h2v-2h-2zm4 0h2v-2h-2zm-8 0h2v-2H7zm-4 0h2v-2H3zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2z"}),"RoundedCorner"),cde=Ee(h.jsx("path",{d:"M19 19h2v2h-2zm0-2h2v-2h-2zM3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm0-4h2V3H3zm4 0h2V3H7zm8 16h2v-2h-2zm-4 0h2v-2h-2zm4 0h2v-2h-2zm-8 0h2v-2H7zm-4 0h2v-2H3zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2z"}),"RoundedCornerOutlined"),ude=Ee(h.jsx("path",{d:"M4 9h16v2H4zm0 4h10v2H4z"}),"ShortText"),N8=Ee(h.jsx("path",{d:"M22 9v6c0 1.1-.9 2-2 2h-1v-2h1V9H4v6h6v2H4c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2m-7.5 10 1.09-2.41L18 15.5l-2.41-1.09L14.5 12l-1.09 2.41L11 15.5l2.41 1.09zm2.5-5 .62-1.38L19 12l-1.38-.62L17 10l-.62 1.38L15 12l1.38.62zm-2.5 5 1.09-2.41L18 15.5l-2.41-1.09L14.5 12l-1.09 2.41L11 15.5l2.41 1.09zm2.5-5 .62-1.38L19 12l-1.38-.62L17 10l-.62 1.38L15 12l1.38.62z"}),"SmartButtonOutlined"),pM=Ee(h.jsx("path",{d:"M18 9v4H6V9H4v6h16V9z"}),"SpaceBar"),dde=Ee(h.jsx("path",{d:"M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34 1.02-2.34 1.7 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92M21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58.81 2.29 3.29 3.3 5.67 3.3 2.27 0 5.3-.89 5.3-4.05 0-.3-.01-1.16-.48-1.94H21z"}),"StrikethroughS"),pde=Ee(h.jsx("path",{d:"M14 17H4v2h10zm6-8H4v2h16zM4 15h16v-2H4zM4 5v2h16V5z"}),"Subject"),R8=Ee(h.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFieldsOutlined"),fde=Ee(h.jsx("path",{d:"M5 4v3h5.5v12h3V7H19V4z"}),"Title"),mde=Ee(h.jsx("path",{d:"M16 13h-3V3h-2v10H8l4 4zM4 19v2h16v-2z"}),"VerticalAlignBottomOutlined"),hde=Ee(h.jsx("path",{d:"M8 19h3v4h2v-4h3l-4-4zm8-14h-3V1h-2v4H8l4 4zM4 11v2h16v-2z"}),"VerticalAlignCenterOutlined"),gde=Ee(h.jsx("path",{d:"M8 11h3v10h2V11h3l-4-4zM4 3v2h16V3z"}),"VerticalAlignTopOutlined"),O8=Ee(h.jsx("path",{d:"M3 5v14h18V5zm5.33 12H5V7h3.33zm5.34 0h-3.33V7h3.33zM19 17h-3.33V7H19z"}),"ViewColumnOutlined"),I8=Ee(h.jsx("path",{d:"m16.66 4.52 2.83 2.83-2.83 2.83-2.83-2.83zM9 5v4H5V5zm10 10v4h-4v-4zM9 15v4H5v-4zm7.66-13.31L11 7.34 16.66 13l5.66-5.66zM11 3H3v8h8zm10 10h-8v8h8zm-10 0H3v8h8z"}),"WidgetsOutlined"),_de=Ee(h.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2M4 18V6h2v12zm4 0V6h8v12zm12 0h-2V6h2z"}),"WidthWideOutlined");var mn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(mn||(mn={}));var fM;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(fM||(fM={}));const We=mn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Bl=t=>{switch(typeof t){case"undefined":return We.undefined;case"string":return We.string;case"number":return Number.isNaN(t)?We.nan:We.number;case"boolean":return We.boolean;case"function":return We.function;case"bigint":return We.bigint;case"symbol":return We.symbol;case"object":return Array.isArray(t)?We.array:t===null?We.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?We.promise:typeof Map<"u"&&t instanceof Map?We.map:typeof Set<"u"&&t instanceof Set?We.set:typeof Date<"u"&&t instanceof Date?We.date:We.object;default:return We.unknown}},Se=mn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Iu=class M8 extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof M8))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,mn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Iu.create=t=>new Iu(t);const Yk=(t,e)=>{let n;switch(t.code){case Se.invalid_type:t.received===We.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,mn.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${mn.joinValues(t.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${mn.joinValues(t.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${mn.joinValues(t.options)}, received '${t.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:mn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Se.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Se.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=e.defaultError,mn.assertNever(t)}return{message:n}};let bde=Yk;function yde(){return bde}const vde=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}};function Ue(t,e){const n=yde(),r=vde({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===Yk?void 0:Yk].filter(i=>!!i)});t.common.issues.push(r)}let da=class P8{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Dt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,s=await i.value;r.push({key:a,value:s})}return P8.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return Dt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}};const Dt=Object.freeze({status:"aborted"}),_m=t=>({status:"dirty",value:t}),Ja=t=>({status:"valid",value:t}),mM=t=>t.status==="aborted",hM=t=>t.status==="dirty",kp=t=>t.status==="valid",sy=t=>typeof Promise<"u"&&t instanceof Promise;var Je;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Je||(Je={}));let oo=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const gM=(t,e)=>{if(kp(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Iu(t.common.issues);return this._error=n,this._error}}};function Gt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}let nn=class{get description(){return this._def.description}_getType(e){return Bl(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Bl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new da,ctx:{common:e.parent.common,data:e.data,parsedType:Bl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(sy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bl(e)},i=this._parseSync({data:e,path:r.path,parent:r});return gM(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bl(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return kp(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>kp(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Bl(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(sy(i)?i:Promise.resolve(i));return gM(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:Se.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Mu({schema:this,typeName:At.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Yo.create(this,this._def)}nullable(){return Pu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wp.create(this)}promise(){return py.create(this,this._def)}or(e){return ly.create([this,e],this._def)}and(e){return cy.create(this,e,this._def)}transform(e){return new Mu({...Gt(this._def),schema:this,typeName:At.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new fy({...Gt(this._def),innerType:this,defaultValue:n,typeName:At.ZodDefault})}brand(){return new z8({typeName:At.ZodBranded,type:this,...Gt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new my({...Gt(this._def),innerType:this,catchValue:n,typeName:At.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Hde.create(this,e)}readonly(){return hy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const Ede=/^c[^\s-]{8,}$/i,Sde=/^[0-9a-z]+$/,Cde=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tde=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,xde=/^[a-z0-9_-]{21}$/i,kde=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wde=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Dde=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ade="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let e1;const Nde=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rde=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ode=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ide=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Mde=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pde=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L8="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Lde=new RegExp(`^${L8}$`);function F8(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Fde(t){return new RegExp(`^${F8(t)}$`)}function Bde(t){let e=`${L8}T${F8(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function $de(t,e){return!!((e==="v4"||!e)&&Nde.test(t)||(e==="v6"||!e)&&Ode.test(t))}function Ude(t,e){if(!kde.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function zde(t,e){return!!((e==="v4"||!e)&&Rde.test(t)||(e==="v6"||!e)&&Ide.test(t))}let oy=class bm extends nn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==We.string){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_type,expected:We.string,received:a.parsedType}),Dt}const r=new da;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?Ue(i,{code:Se.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&Ue(i,{code:Se.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Dde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"email",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")e1||(e1=new RegExp(Ade,"u")),e1.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"emoji",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Tde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"uuid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")xde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"nanoid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Ede.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"cuid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")Sde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"cuid2",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")Cde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"ulid",code:Se.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Ue(i,{validation:"url",code:Se.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"regex",code:Se.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Bde(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Lde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Fde(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?wde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"duration",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?$de(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"ip",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?Ude(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"jwt",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?zde(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"cidr",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Mde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"base64",code:Se.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?Pde.test(e.data)||(i=this._getOrReturnCtx(e,i),Ue(i,{validation:"base64url",code:Se.invalid_string,message:a.message}),r.dirty()):mn.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Se.invalid_string,...Je.errToObj(r)})}_addCheck(e){return new bm({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Je.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Je.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Je.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Je.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Je.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Je.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Je.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Je.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Je.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Je.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Je.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Je.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Je.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Je.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Je.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Je.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Je.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...Je.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Je.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Je.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Je.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Je.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Je.errToObj(n)})}nonempty(e){return this.min(1,Je.errToObj(e))}trim(){return new bm({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new bm({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new bm({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};oy.create=t=>new oy({checks:[],typeName:At.ZodString,coerce:t?.coerce??!1,...Gt(t)});function Gde(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}let Kk=class Qk extends nn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==We.number){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_type,expected:We.number,received:a.parsedType}),Dt}let r;const i=new da;for(const a of this._def.checks)a.kind==="int"?mn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Gde(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.not_finite,message:a.message}),i.dirty()):mn.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Je.toString(n))}setLimit(e,n,r,i){return new Qk({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new Qk({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Je.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Je.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&mn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Kk.create=t=>new Kk({checks:[],typeName:At.ZodNumber,coerce:t?.coerce||!1,...Gt(t)});let _M=class Xk extends nn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==We.bigint)return this._getInvalidInput(e);let r;const i=new da;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Ue(r,{code:Se.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):mn.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Ue(n,{code:Se.invalid_type,expected:We.bigint,received:n.parsedType}),Dt}gte(e,n){return this.setLimit("min",e,!0,Je.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Je.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Je.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Je.toString(n))}setLimit(e,n,r,i){return new Xk({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Je.toString(i)}]})}_addCheck(e){return new Xk({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};_M.create=t=>new _M({checks:[],typeName:At.ZodBigInt,coerce:t?.coerce??!1,...Gt(t)});let Zk=class extends nn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==We.boolean){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.boolean,received:r.parsedType}),Dt}return Ja(e.data)}};Zk.create=t=>new Zk({typeName:At.ZodBoolean,coerce:t?.coerce||!1,...Gt(t)});let bM=class B8 extends nn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==We.date){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_type,expected:We.date,received:a.parsedType}),Dt}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return Ue(a,{code:Se.invalid_date}),Dt}const r=new da;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Ue(i,{code:Se.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):mn.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new B8({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Je.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Je.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};bM.create=t=>new bM({checks:[],coerce:t?.coerce||!1,typeName:At.ZodDate,...Gt(t)});let yM=class extends nn{_parse(e){if(this._getType(e)!==We.symbol){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.symbol,received:r.parsedType}),Dt}return Ja(e.data)}};yM.create=t=>new yM({typeName:At.ZodSymbol,...Gt(t)});let Jk=class extends nn{_parse(e){if(this._getType(e)!==We.undefined){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.undefined,received:r.parsedType}),Dt}return Ja(e.data)}};Jk.create=t=>new Jk({typeName:At.ZodUndefined,...Gt(t)});let ew=class extends nn{_parse(e){if(this._getType(e)!==We.null){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.null,received:r.parsedType}),Dt}return Ja(e.data)}};ew.create=t=>new ew({typeName:At.ZodNull,...Gt(t)});let vM=class extends nn{constructor(){super(...arguments),this._any=!0}_parse(e){return Ja(e.data)}};vM.create=t=>new vM({typeName:At.ZodAny,...Gt(t)});let EM=class extends nn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ja(e.data)}};EM.create=t=>new EM({typeName:At.ZodUnknown,...Gt(t)});let fc=class extends nn{_parse(e){const n=this._getOrReturnCtx(e);return Ue(n,{code:Se.invalid_type,expected:We.never,received:n.parsedType}),Dt}};fc.create=t=>new fc({typeName:At.ZodNever,...Gt(t)});let SM=class extends nn{_parse(e){if(this._getType(e)!==We.undefined){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.void,received:r.parsedType}),Dt}return Ja(e.data)}};SM.create=t=>new SM({typeName:At.ZodVoid,...Gt(t)});let wp=class fb extends nn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==We.array)return Ue(n,{code:Se.invalid_type,expected:We.array,received:n.parsedType}),Dt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(Ue(n,{code:s?Se.too_big:Se.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ue(n,{code:Se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ue(n,{code:Se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new oo(n,s,n.path,o)))).then(s=>da.mergeArray(r,s));const a=[...n.data].map((s,o)=>i.type._parseSync(new oo(n,s,n.path,o)));return da.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new fb({...this._def,minLength:{value:e,message:Je.toString(n)}})}max(e,n){return new fb({...this._def,maxLength:{value:e,message:Je.toString(n)}})}length(e,n){return new fb({...this._def,exactLength:{value:e,message:Je.toString(n)}})}nonempty(e){return this.min(1,e)}};wp.create=(t,e)=>new wp({type:t,minLength:null,maxLength:null,exactLength:null,typeName:At.ZodArray,...Gt(e)});function Fd(t){if(t instanceof rl){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Yo.create(Fd(r))}return new rl({...t._def,shape:()=>e})}else return t instanceof wp?new wp({...t._def,type:Fd(t.element)}):t instanceof Yo?Yo.create(Fd(t.unwrap())):t instanceof Pu?Pu.create(Fd(t.unwrap())):t instanceof Rh?Rh.create(t.items.map(e=>Fd(e))):t}let rl=class ss extends nn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=mn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==We.object){const c=this._getOrReturnCtx(e);return Ue(c,{code:Se.invalid_type,expected:We.object,received:c.parsedType}),Dt}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof fc&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=a[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new oo(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof fc){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(Ue(i,{code:Se.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new oo(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,p=await u.value;c.push({key:d,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>da.mergeObjectSync(r,c)):da.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Je.errToObj,new ss({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:Je.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ss({...this._def,unknownKeys:"strip"})}passthrough(){return new ss({...this._def,unknownKeys:"passthrough"})}extend(e){return new ss({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ss({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:At.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ss({...this._def,catchall:e})}pick(e){const n={};for(const r of mn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ss({...this._def,shape:()=>n})}omit(e){const n={};for(const r of mn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new ss({...this._def,shape:()=>n})}deepPartial(){return Fd(this)}partial(e){const n={};for(const r of mn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new ss({...this._def,shape:()=>n})}required(e){const n={};for(const r of mn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Yo;)a=a._def.innerType;n[r]=a}return new ss({...this._def,shape:()=>n})}keyof(){return U8(mn.objectKeys(this.shape))}};rl.create=(t,e)=>new rl({shape:()=>t,unknownKeys:"strip",catchall:fc.create(),typeName:At.ZodObject,...Gt(e)});rl.strictCreate=(t,e)=>new rl({shape:()=>t,unknownKeys:"strict",catchall:fc.create(),typeName:At.ZodObject,...Gt(e)});rl.lazycreate=(t,e)=>new rl({shape:t,unknownKeys:"strip",catchall:fc.create(),typeName:At.ZodObject,...Gt(e)});let ly=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new Iu(o.ctx.common.issues));return Ue(n,{code:Se.invalid_union,unionErrors:s}),Dt}if(n.common.async)return Promise.all(r.map(async a=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(l=>new Iu(l));return Ue(n,{code:Se.invalid_union,unionErrors:o}),Dt}}get options(){return this._def.options}};ly.create=(t,e)=>new ly({options:t,typeName:At.ZodUnion,...Gt(e)});const Fo=t=>t instanceof rw?Fo(t.schema):t instanceof Mu?Fo(t.innerType()):t instanceof dy?[t.value]:t instanceof mE?t.options:t instanceof aw?mn.objectValues(t.enum):t instanceof fy?Fo(t._def.innerType):t instanceof Jk?[void 0]:t instanceof ew?[null]:t instanceof Yo?[void 0,...Fo(t.unwrap())]:t instanceof Pu?[null,...Fo(t.unwrap())]:t instanceof z8||t instanceof hy?Fo(t.unwrap()):t instanceof my?Fo(t._def.innerType):[];class QA extends nn{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==We.object)return Ue(n,{code:Se.invalid_type,expected:We.object,received:n.parsedType}),Dt;const r=this.discriminator,i=n.data[r],a=this.optionsMap.get(i);return a?n.common.async?a._parseAsync({data:n.data,path:n.path,parent:n}):a._parseSync({data:n.data,path:n.path,parent:n}):(Ue(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const a of n){const s=Fo(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of s){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,a)}}return new QA({typeName:At.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Gt(r)})}}function tw(t,e){const n=Bl(t),r=Bl(e);if(t===e)return{valid:!0,data:t};if(n===We.object&&r===We.object){const i=mn.objectKeys(e),a=mn.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const l=tw(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===We.array&&r===We.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],l=tw(s,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===We.date&&r===We.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}let cy=class extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(mM(a)||mM(s))return Dt;const o=tw(a.value,s.value);return o.valid?((hM(a)||hM(s))&&n.dirty(),{status:n.value,value:o.data}):(Ue(r,{code:Se.invalid_intersection_types}),Dt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};cy.create=(t,e,n)=>new cy({left:t,right:e,typeName:At.ZodIntersection,...Gt(n)});let Rh=class $8 extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.array)return Ue(r,{code:Se.invalid_type,expected:We.array,received:r.parsedType}),Dt;if(r.data.length<this._def.items.length)return Ue(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Dt;!this._def.rest&&r.data.length>this._def.items.length&&(Ue(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new oo(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>da.mergeArray(n,s)):da.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new $8({...this._def,rest:e})}};Rh.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rh({items:t,typeName:At.ZodTuple,rest:null,...Gt(e)})};class uy extends nn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.object)return Ue(r,{code:Se.invalid_type,expected:We.object,received:r.parsedType}),Dt;const i=[],a=this._def.keyType,s=this._def.valueType;for(const o in r.data)i.push({key:a._parse(new oo(r,o,r.path,o)),value:s._parse(new oo(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?da.mergeObjectAsync(n,i):da.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof nn?new uy({keyType:e,valueType:n,typeName:At.ZodRecord,...Gt(r)}):new uy({keyType:oy.create(),valueType:e,typeName:At.ZodRecord,...Gt(n)})}}let CM=class extends nn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.map)return Ue(r,{code:Se.invalid_type,expected:We.map,received:r.parsedType}),Dt;const i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new oo(r,o,r.path,[c,"key"])),value:a._parse(new oo(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Dt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Dt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}};CM.create=(t,e,n)=>new CM({valueType:e,keyType:t,typeName:At.ZodMap,...Gt(n)});let TM=class nw extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==We.set)return Ue(r,{code:Se.invalid_type,expected:We.set,received:r.parsedType}),Dt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ue(r,{code:Se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ue(r,{code:Se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Dt;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>a._parse(new oo(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new nw({...this._def,minSize:{value:e,message:Je.toString(n)}})}max(e,n){return new nw({...this._def,maxSize:{value:e,message:Je.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};TM.create=(t,e)=>new TM({valueType:t,minSize:null,maxSize:null,typeName:At.ZodSet,...Gt(e)});let rw=class extends nn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};rw.create=(t,e)=>new rw({getter:t,typeName:At.ZodLazy,...Gt(e)});let dy=class extends nn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Ue(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),Dt}return{status:"valid",value:e.data}}get value(){return this._def.value}};dy.create=(t,e)=>new dy({value:t,typeName:At.ZodLiteral,...Gt(e)});function U8(t,e){return new mE({values:t,typeName:At.ZodEnum,...Gt(e)})}let mE=class iw extends nn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Ue(n,{expected:mn.joinValues(r),received:n.parsedType,code:Se.invalid_type}),Dt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Ue(n,{received:n.data,code:Se.invalid_enum_value,options:r}),Dt}return Ja(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return iw.create(e,{...this._def,...n})}exclude(e,n=this._def){return iw.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};mE.create=U8;let aw=class extends nn{_parse(e){const n=mn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==We.string&&r.parsedType!==We.number){const i=mn.objectValues(n);return Ue(r,{expected:mn.joinValues(i),received:r.parsedType,code:Se.invalid_type}),Dt}if(this._cache||(this._cache=new Set(mn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=mn.objectValues(n);return Ue(r,{received:r.data,code:Se.invalid_enum_value,options:i}),Dt}return Ja(e.data)}get enum(){return this._def.values}};aw.create=(t,e)=>new aw({values:t,typeName:At.ZodNativeEnum,...Gt(e)});let py=class extends nn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==We.promise&&n.common.async===!1)return Ue(n,{code:Se.invalid_type,expected:We.promise,received:n.parsedType}),Dt;const r=n.parsedType===We.promise?n.data:Promise.resolve(n.data);return Ja(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};py.create=(t,e)=>new py({type:t,typeName:At.ZodPromise,...Gt(e)});let Mu=class extends nn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===At.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{Ue(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return Dt;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?Dt:l.status==="dirty"||n.value==="dirty"?_m(l.value):l});{if(n.value==="aborted")return Dt;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?Dt:o.status==="dirty"||n.value==="dirty"?_m(o.value):o}}if(i.type==="refinement"){const s=o=>{const l=i.refinement(o,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Dt:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Dt:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!kp(s))return Dt;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>kp(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):Dt);mn.assertNever(i)}};Mu.create=(t,e,n)=>new Mu({schema:t,typeName:At.ZodEffects,effect:e,...Gt(n)});Mu.createWithPreprocess=(t,e,n)=>new Mu({schema:e,effect:{type:"preprocess",transform:t},typeName:At.ZodEffects,...Gt(n)});let Yo=class extends nn{_parse(e){return this._getType(e)===We.undefined?Ja(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Yo.create=(t,e)=>new Yo({innerType:t,typeName:At.ZodOptional,...Gt(e)});let Pu=class extends nn{_parse(e){return this._getType(e)===We.null?Ja(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Pu.create=(t,e)=>new Pu({innerType:t,typeName:At.ZodNullable,...Gt(e)});let fy=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===We.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};fy.create=(t,e)=>new fy({innerType:t,typeName:At.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Gt(e)});let my=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sy(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Iu(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Iu(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};my.create=(t,e)=>new my({innerType:t,typeName:At.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Gt(e)});let xM=class extends nn{_parse(e){if(this._getType(e)!==We.nan){const r=this._getOrReturnCtx(e);return Ue(r,{code:Se.invalid_type,expected:We.nan,received:r.parsedType}),Dt}return{status:"valid",value:e.data}}};xM.create=t=>new xM({typeName:At.ZodNaN,...Gt(t)});let z8=class extends nn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Hde=class G8 extends nn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Dt:a.status==="dirty"?(n.dirty(),_m(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Dt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new G8({in:e,out:n,typeName:At.ZodPipeline})}},hy=class extends nn{_parse(e){const n=this._def.innerType._parse(e),r=i=>(kp(i)&&(i.value=Object.freeze(i.value)),i);return sy(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};hy.create=(t,e)=>new hy({innerType:t,typeName:At.ZodReadonly,...Gt(e)});var At;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(At||(At={}));const Pt=oy.create,Le=Kk.create,Dp=Zk.create;fc.create;const Wm=wp.create,xt=rl.create,ap=ly.create,jde=QA.create;cy.create;const H8=Rh.create,qde=uy.create,sw=dy.create,yr=mE.create;py.create;Yo.create;Pu.create;function h_(t,e){return!t||t&&t[e]===0?"initial":t[e]!==void 0?`${t[e]}px solid ${t?.color??"black"}`:"initial"}function ki({className:t,background:e,backgroundColor:n,padding:r={top:0,right:0,bottom:0,left:0},width:i,align:a,children:s,border:o,borderRadius:l,isParent:c=!0,overflow:u="visible"}){const d=t?`a${t}`:"",p={width:i,minWidth:i,borderRadius:l??"initial",borderTop:h_(o,"top"),borderBottom:h_(o,"bottom"),borderLeft:h_(o,"left"),borderRight:h_(o,"right"),overflow:u,borderCollapse:"initial"};return e&&String(e).trim()!==""?p.background=e:n&&(p.backgroundColor=n),h.jsx("table",{className:t,width:i,border:0,cellSpacing:"0",cellPadding:"0",style:p,children:h.jsxs("tbody",{children:[h.jsxs("tr",{height:r.top,style:{height:`${r.top}px`},className:c?`t${t}`:`it${t}`,children:[h.jsx("td",{style:{width:`${r.left}px`},className:c?`l${t}`:`il${t}`}),h.jsx("td",{}),h.jsx("td",{style:{width:`${r.right}px`},className:c?`r${t}`:`ir${t}`})]}),h.jsxs("tr",{children:[h.jsx("td",{style:{width:`${r.left}px`},className:c?`l${t}`:`il${t}`}),h.jsx("td",{className:d,align:a,children:s}),h.jsx("td",{style:{width:`${r.right}px`},className:c?`r${t}`:`ir${t}`})]}),h.jsxs("tr",{height:r.bottom,style:{height:`${r.bottom}px`},className:c?`b${t}`:`ib${t}`,children:[h.jsx("td",{style:{width:`${r.left}px`},className:c?`l${t}`:`il${t}`}),h.jsx("td",{}),h.jsx("td",{style:{width:`${r.right}px`},className:c?`r${t}`:`ir${t}`})]})]})})}const Ju=(t,e)=>{const n=/#([0-9a-fA-F]{3,6})\b/;return n.test(t)?t.replace(n,e):t.trim()===""?e:t.replace(/^(\S+)/,`$1 ${e}`)};function gy(t){const e=t?.shape??"rectangle";if(typeof e=="string")switch(e){case"rectangle":return;case"pill":return 9999;default:return}else if(typeof e=="object"&&e!==null){const{topLeft:n=0,topRight:r=0,bottomLeft:i=0,bottomRight:a=0}=e;return`${r}px ${n}px ${a}px ${i}px`}}function Vde(t){let e=2166136261;for(let n=0;n<t.length;n++)e^=t.charCodeAt(n),e=(e>>>0)*16777619;return e>>>0}function Wde(t){const e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";if(t===0)return"a";let n="";for(;t>0;)n=e[t%62]+n,t=Math.floor(t/62);return n}function tn(t){const e=Vde(t);return`b${Wde(e)}`}const kM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),j8=xt({style:xt({textAlign:yr(["left","center","right"]).optional().nullable(),padding:kM,mobilePadding:kM,backgroundColor:Pt().optional()}).passthrough().optional().nullable(),props:xt({size:Le().gt(0).optional().nullable(),shape:yr(["circle","square","rounded"]).optional().nullable(),imageUrl:Pt().optional().nullable(),alt:Pt().optional().nullable()}).optional().nullable()}).passthrough(),lu={size:64,imageUrl:"",alt:"",shape:"square"};function q8({style:t,props:e,blockId:n}){const r=e?.size??lu.size,i=e?.imageUrl??lu.imageUrl,a=e?.alt??lu.alt;e?.shape??lu.shape;const s=dE(),o={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},l=h.jsx(ki,{isParent:!1,children:h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:a??"",src:i??"",width:r,style:{width:r,height:"auto",outline:"none",border:"none",textDecoration:"none",verticalAlign:t?.contentAlignment??"middle",display:"inline-block",maxWidth:"100%",opacity:s.uploading&&s.id===n?.5:1,transition:"opacity 0.2s ease-in-out"}}),s.uploading&&s.id===n&&h.jsx("div",{style:o,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})]})}),c=tn(n);return h.jsx(ki,{className:`${c}`,padding:t.padding,backgroundColor:t.backgroundColor,align:t.textAlign,width:"100%",children:l})}function es({title:t,children:e}){return h.jsxs(Ah,{sx:{padding:"0!important",paddingTop:"1rem!important"},children:[h.jsx(er,{sx:{fontWeight:"bold",mb:2,pb:1,color:"text.primary",fontSize:"1.25rem",borderBottom:n=>`1px solid ${n.palette.divider}`},children:t}),h.jsx(Mn,{spacing:2,gap:1,mb:3,pt:1,children:e})]})}const Wn=({label:t})=>{const e=dr();return t?h.jsx("p",{style:{fontWeight:"bold",color:e.palette.text.primary},children:t}):null},ri=({children:t})=>h.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.3rem"},children:t.map(e=>e)}),Yde=me(tt)(({theme:t})=>({display:"flex",alignItems:"center",border:`1px solid ${t.palette.divider}`,borderRadius:"8px",padding:"4px",minWidth:58,maxWidth:"fit-content",backgroundColor:t.palette.background.paper,"&:hover":{borderColor:t.palette.primary.main},"&:focus-within":{borderColor:t.palette.primary.main,boxShadow:`0 0 0 1px ${t.palette.primary.main}`}})),Kde=me("input")(({theme:t})=>({border:"none",outline:"none",background:"transparent",textAlign:"center",width:"27px",minWidth:"27px",maxWidth:"27px",padding:"0!important",lineHeight:"normal",fontSize:"0.9rem",color:t.palette.text.primary,"&::-webkit-outer-spin-button, &::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},"&[type=number]":{MozAppearance:"textfield"}})),wM=me(Qt)(({theme:t})=>({padding:"0",color:t.palette.primary.main,"&:hover":{backgroundColor:Ae(t.palette.primary.main,.04)},"& .MuiSvgIcon-root":{fontSize:14}}));function vr({iconLabel:t,label:e,value:n,setValue:r,units:i,min:a=0,max:s,step:o=void 0,marks:l=!0,...c}){const u=n??a,[d,p]=D.useState(u.toString()),f=E=>{let C=E;C<a&&(C=a),s!==void 0&&C>s&&(C=s),r(C),p(C.toString())},m=E=>{const C=E.target.value;if(p(C),C!==""){const T=Number(C);isNaN(T)||T>=a&&r(T)}},g=()=>{if(d===""||isNaN(Number(d)))p(u.toString());else{const E=Number(d);f(E)}},_=E=>{E.key==="Enter"&&g()};D.useEffect(()=>{p((n??a).toString())},[n,a]);const b=()=>{const E=u+1;f(E)},y=()=>{const E=u-1;f(E)},v=(E,C)=>{typeof C=="number"&&r(C)};return h.jsxs(ri,{children:[h.jsx(Wn,{label:e}),h.jsxs(Mn,{direction:"row",alignItems:"center",spacing:2,justifyContent:"space-between",width:"100%",children:[h.jsx(tt,{sx:{minWidth:24,lineHeight:1,flexShrink:0},children:t}),h.jsx(woe,{...c,value:u,min:a,max:s||1e3,step:o,color:"primary",marks:l,onChange:v}),h.jsxs(Yde,{children:[h.jsx(Kde,{type:"number",value:d,onChange:m,onBlur:g,onKeyDown:_,min:a,max:s,step:o}),h.jsxs(tt,{sx:{display:"flex",flexDirection:"column",ml:.5},children:[h.jsx(wM,{onClick:b,disabled:s!==void 0&&u>=s,children:h.jsx("svg",{width:"15",height:"10",viewBox:"0 0 24 12",children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"m6 9l6-6l6 6"})})}),h.jsx(wM,{onClick:y,disabled:u<=a,children:h.jsx("svg",{width:"15",height:"10",viewBox:"0 0 24 12",style:{transform:"rotate(180deg)"},children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"m6 9l6-6l6 6"})})})]})]}),h.jsx(er,{variant:"caption",color:"text.secondary",sx:{fontSize:"16px",ml:"4px!important"},children:i})]})]})}function ru({label:t,defaultValue:e,onChange:n,...r}){const[i,a]=D.useState(e??0);return e!=i&&a(e),h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(vr,{value:i??0,setValue:s=>{a(s),n(s)},...r})]})}function Qde(t,e){const n=D.useRef(null),r=D.useRef(t),i=D.useRef([]);r.current=t;const a=D.useCallback((...s)=>{i.current=s,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current(...s),n.current=null},e)},[e]);return a.flush=D.useCallback(()=>{n.current&&(clearTimeout(n.current),n.current=null,r.current(...i.current))},[]),a}const sp=36,XA=8,hE={width:"100%","& .MuiInputBase-root":{"&:not(.MuiInputBase-multiline)":{height:`${sp}px`}},"& .MuiOutlinedInput-root":{borderRadius:`${XA}px`,"&:not(.MuiInputBase-multiline)":{height:`${sp}px`}},"& .MuiInputBase-input":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"12px",height:"unset"}},Xde={width:"100%",height:`${sp}px`,paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"12px",display:"flex",alignItems:"center",borderRadius:`${XA}px`};function Lu({helperText:t,label:e,placeholder:n,rows:r,InputProps:i,defaultValue:a,onChange:s}){const[o,l]=D.useState(a);D.useEffect(()=>{o!==a&&l(a)},[a]);const c=Qde(d=>{s(d)},150),u=typeof r=="number"&&r>1;return h.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[h.jsx(Wn,{label:e}),h.jsx(df,{fullWidth:!0,multiline:u,minRows:r,variant:"outlined",placeholder:n,helperText:t,InputProps:i,value:o,sx:hE,onChange:d=>{const p=d.target.value;l(p),c(p)},onBlur:()=>{c.flush()}})]})}function Zde({onClick:t,disabled:e,primary:n=!1}){const{t:r}=Ot.useTranslation("inspector");return h.jsx(Qt,{"aria-label":r("inputs.common.close"),onClick:t,disabled:e,sx:{position:"absolute",right:8,top:8,color:i=>n?"brand.blue":i.palette.grey[500],"&:hover":{opacity:.8}},children:h.jsx(fE,{})})}function Jde({imageUrl:t,saving:e=!1}){return h.jsxs(Bre,{sx:{position:"relative"},children:[e&&h.jsx(Mn,{justifyContent:"center",alignItems:"center",sx:{position:"absolute",top:7,left:0,width:"100%",height:"314px",zIndex:20,backgroundColor:"#212121AA",mb:1},children:h.jsx(pc,{size:48,thickness:6,color:"inherit",sx:{color:"white"}})}),h.jsx(qre,{component:"img",sx:{objectFit:"contain",width:"100%",height:"326px"},image:t,alt:"Generated Image"})]})}function epe({value:t,onChange:e,disabled:n}){return h.jsxs(h.Fragment,{children:[h.jsx(er,{sx:{fontSize:"14px",fontWeight:700},children:"Image description"}),h.jsx(df,{disabled:n,autoFocus:!0,margin:"dense",id:"prompt",placeholder:"Enter a detailed description here...",type:"text",fullWidth:!0,multiline:!0,rows:4,variant:"outlined",value:t,onChange:r=>e(r.target.value),sx:{mt:.5,"& .MuiOutlinedInput-root":{borderRadius:"8px"}}})]})}const tpe=t=>({400:{code:400,title:t.title||"Invalid Request",message:t.message||"The request was invalid. Please check your input and try again.",action:t.action||"Modify your prompt and try again"},401:{code:401,title:t.title||"Authentication Required",message:t.message||"You need to be authenticated to perform this action.",action:t.action||"Please log in and try again"},403:{code:403,title:t.title||"Access Denied",message:t.message||"You don't have permission to perform this action.",action:t.action||"Contact support if you believe this is a mistake"},404:{code:404,title:t.title||"Not Found",message:t.message||"The requested resource was not found.",action:t.action||"Try again or use a different prompt"},422:{code:422,title:t.title||"Invalid Input",message:t.message||"The provided input cannot be processed.",action:t.action||"Modify your prompt and try again"},429:{code:429,title:t.title||"Too Many Requests",message:t.message||"You've made too many requests. Please wait a moment.",action:t.action||"Please wait a few minutes before trying again"},500:{code:500,title:t.title||"Server Error",message:t.message||"An unexpected error occurred on our servers.",action:t.action||"Please try again later"},502:{code:502,title:t.title||"Bad Gateway",message:t.message||"The server received an invalid response.",action:t.action||"Please try again later"},503:{code:503,title:t.title||"Service Unavailable",message:t.message||"The service is temporarily unavailable.",action:t.action||"Please try again later"}})[t.code]||{code:t.code,title:"Unexpected Error",message:"An unexpected error occurred.",action:"Please try again later"};function V8({src:t,style:e}){const{t:n}=Ot.useTranslation("inspector"),[r,i]=D.useState(!1),[a,s]=D.useState(!1),[o,l]=D.useState(""),[c,u]=D.useState(null),[d,p]=D.useState(!1),[f,m]=D.useState(null),[g,_]=D.useState(!1),b=()=>{i(!0),m(null)},y=()=>{a||(i(!1),s(!1),u(null),l(""),p(!1),m(null),_(!1))},v=()=>{const T=c&&!d?"store-ai-image":"request-ai-image",S=c&&!d?c:o;m(null),T==="store-ai-image"?(_(!0),s(!1),setTimeout(()=>{s(!1),y()},2e3)):s(!0),window.dispatchEvent(new CustomEvent(T,{detail:S}))},E=()=>{p(!0),u(null),m(null),_(!1)};D.useEffect(()=>{const T=S=>{const{detail:x}=S;if(s(!1),x.error){m(tpe(x.error));return}if(!x.success||!x.url){m({code:0,title:"Generation Failed",message:"Failed to generate the image.",action:"Please try again"});return}u(x.url),p(!1)};return window.addEventListener("generated-image",T),()=>{window.removeEventListener("generated-image",T)}},[]),D.useEffect(()=>{y()},[t]);const C=!c||d;return h.jsxs(h.Fragment,{children:[h.jsx(di,{style:e,startIcon:h.jsx(Wk,{className:"w-4 h-4"}),variant:"contained",onClick:b,children:n("inputs.aiImageGeneration.generate")}),h.jsx(Iie,{open:r,onClose:y,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{bgcolor:"background.paper",color:"text.primary",borderRadius:"8px"}},children:h.jsxs("form",{onSubmit:T=>{T.preventDefault(),v()},children:[h.jsxs(eae,{sx:{fontWeight:700,fontSize:"24px",color:f?"error.main":"inherit"},children:[n(f?"inputs.aiImageGeneration.titleError":a?"inputs.aiImageGeneration.titleLoading":c?"inputs.aiImageGeneration.titleReady":"inputs.aiImageGeneration.titleCreate"),h.jsx(Zde,{onClick:y,disabled:a,primary:!0})]}),h.jsxs(qie,{children:[h.jsx(Qie,{sx:{pb:1,color:f?"error.dark":"inherit"},children:n(f?"inputs.aiImageGeneration.descriptionError":a?"inputs.aiImageGeneration.descriptionLoading":C?"inputs.aiImageGeneration.descriptionCreate":"inputs.aiImageGeneration.descriptionReady")}),c&&!d?h.jsxs(Mn,{sx:{position:"relative"},children:[h.jsx(Jde,{imageUrl:c,saving:g}),h.jsxs(tc,{variant:"outlined",severity:"warning",icon:!1,children:[n("inputs.aiImageGeneration.warningRegenerate")," ",h.jsx("b",{children:n("inputs.aiImageGeneration.warningInsertFirst")})," ",n("inputs.aiImageGeneration.warningFirst")]})]}):a&&!c?h.jsx(Mn,{justifyContent:"center",alignItems:"center",sx:{backgroundColor:T=>T.palette.mainColor[50],height:"326px",width:"100%"},children:h.jsx(pc,{size:48,thickness:6})}):h.jsx(epe,{value:o,onChange:l,disabled:a})]}),!a&&h.jsxs(Bie,{className:"p-6",children:[c&&!d&&h.jsx(di,{startIcon:h.jsx(A8,{className:"w-4 h-4"}),onClick:E,variant:"outlined",disabled:a,children:n("inputs.aiImageGeneration.regenerate")}),!c&&!d&&h.jsx(di,{onClick:y,variant:"text",disabled:d,children:n("inputs.aiImageGeneration.cancel")}),h.jsxs(di,{startIcon:c&&!d?h.jsx(Due,{className:"w-4 h-4"}):h.jsx(Wk,{className:"w-4 h-4"}),onClick:v,variant:"contained",disabled:!o||o?.length<20,children:[n(c&&!d?"inputs.aiImageGeneration.insertImage":"inputs.aiImageGeneration.generateImage"),a&&h.jsx(pc,{size:16,className:"ml-2"})]})]})]})})]})}const npe=({className:t,...e})=>h.jsx("svg",{width:"15",height:"10",viewBox:"0 0 24 12",className:t,"aria-hidden":"true",focusable:"false",...e,children:h.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"m6 3l6 6l6-6"})}),rpe=me(PA)(({theme:t})=>({fontFamily:t.typography.fontFamily,color:t.palette.text.primary,backgroundColor:t.palette.background.input??t.palette.grey[100],width:"100%",height:`${sp}px`,"&.MuiInputBase-root, &.MuiOutlinedInput-root":{height:`${sp}px`,minHeight:`${sp}px`,boxSizing:"border-box",borderRadius:`${XA}px`,border:`1px solid ${t.palette.divider}`},"&& .MuiSelect-select, && .MuiInputBase-input":{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"36px",lineHeight:"20px",minHeight:"unset"},"& .MuiSelect-icon":{color:t.palette.secondary.main,right:12,top:"calc(50% - 4px)",transition:"transform 200ms ease",pointerEvents:"none"},"& .MuiSelect-iconOpen":{transform:"rotate(180deg)"},"&:hover":{backgroundColor:t.palette.grey[200]},"&.Mui-focused":{borderColor:t.palette.primary.main}})),mc=D.forwardRef((t,e)=>{const n=dr(),r={backgroundColor:n.palette.background.input??n.palette.grey[100],marginTop:"4px",borderRadius:"10px",border:`1px solid ${n.palette.divider}`,boxShadow:`0 1px 3px ${Ae("#000000",.6)}`,color:n.palette.text.primary},i={...t.MenuProps?.PaperProps,sx:{...typeof t.MenuProps?.PaperProps?.sx=="object"&&t.MenuProps.PaperProps?.sx,...r}},a=t.MenuProps?.slotProps??{},s=a.paper??{};return h.jsx(rpe,{ref:e,...t,IconComponent:npe,MenuProps:{...t.MenuProps,PaperProps:i,slotProps:{...a,paper:{...s,...i,sx:{...typeof s.sx=="object"&&s.sx,...typeof t.MenuProps?.PaperProps?.sx=="object"&&t.MenuProps.PaperProps?.sx,...r}}}}})});mc.displayName="CustomSelect";const ipe=({defaultValue:t,onChange:e,values:n})=>{const r=pf(),{t:i}=Ot.useTranslation("inspector"),a=dr(),s=()=>h.jsx(xh,{viewBox:"0 0 18 18",fontSize:"small",children:h.jsx("path",{d:"M9.00015 6.75V8.25M9.00015 11.25H9.00765M3.804 14.25H14.1963C15.351 14.25 16.0727 13 15.4953 12L10.2992 3C9.72184 2 8.27846 2 7.70111 3L2.50496 12C1.92761 13 2.6493 14.25 3.804 14.25Z",stroke:"#F59E0B",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})}),o=Y=>{if(!Y)return{url:"",repeat:"no-repeat",position:"center center",size:"cover"};const te=Y.match(/url\("([^"]+)"\)/),Oe=te?te[1]:"";let ye="no-repeat";Y.includes("repeat-x")?ye="repeat-x":Y.includes("repeat-y")?ye="repeat-y":Y.includes("repeat")&&!Y.includes("no-repeat")&&(ye="repeat");let be="center center";const he=["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"];for(const nt of he)if(Y.includes(nt)){be=nt;break}let Ke="cover";return Y.includes("contain")?Ke="contain":Y.includes("auto")&&(Ke="auto"),{url:Oe,repeat:ye,position:be,size:Ke}},l=Y=>Y.url?`url("${Y.url}") ${Y.repeat} ${Y.position} / ${Y.size}`:"",[c,u]=D.useState(t||null),[d,p]=D.useState(o(t)),[f,m]=D.useState(!1),[g,_]=D.useState(()=>!!window.__emailBuilderEnableAI),[,b]=D.useState(null),[y,v]=D.useState(o(t).url||""),[E,C]=D.useState(!1),[T,S]=D.useState(""),[x,k]=D.useState(!1),w=D.useRef(null),A=WA(),[L,O]=D.useState(null);D.useEffect(()=>{const Y=window.__emailBuilderCustomImageProvider;Y&&(O(Y),setTimeout(()=>{r&&window.dispatchEvent(new CustomEvent("email-builder-image-panel-opened",{detail:{blockId:r,currentImageUrl:d.url||null,alt:null}}))},100))},[]);const[I,P]=D.useState(()=>sessionStorage.getItem("hideBackgroundImageWarning")==="true"),M=(Y,te)=>{const Oe={...d,...Y};if(p(Oe),Oe.url){const ye=l(Oe);u(ye),e(ye,te)}else console.error("Update params error: ",Oe)},F=(Y,te)=>{if(!Y)return!1;const Oe=Y?.toLowerCase(),ye=Oe.includes(".svg")||Oe.includes("svg"),be=te&&(te.includes("image/svg+xml")||te.includes("svg"));return ye||!!be},U=async Y=>{try{C(!0),S(""),k(!1);try{new URL(Y)}catch{return S("Invalid URL format"),!1}const te=new AbortController,Oe=setTimeout(()=>te.abort(),1e4);try{const ye=await fetch(Y,{method:"HEAD",signal:te.signal});if(clearTimeout(Oe),!ye.ok)return S(`HTTP ${ye.status}: ${ye.statusText}`),!1;const be=ye.headers.get("content-type");return["image/","image/svg+xml","text/xml","application/xml"].some(nt=>be&&be.toLowerCase().includes(nt.toLowerCase()))?(F(Y,be)&&k(!0),S(""),!0):(S("URL does not point to an image"),!1)}catch(ye){return clearTimeout(Oe),ye.name==="AbortError"?(S("Request timeout - URL took too long to respond"),!1):new Promise(be=>{const he=new Image,Ke=setTimeout(()=>{S("Request timeout - URL took too long to respond"),be(!1)},1e4);he.onload=()=>{clearTimeout(Ke),F(Y)&&k(!0),S(""),be(!0)},he.onerror=()=>{clearTimeout(Ke),S("Cannot access image - CORS policy, network error, or invalid URL"),be(!1)},he.src=Y})}}catch{return S("Unexpected error occurred while validating URL"),!1}finally{C(!1)}},j=async()=>{y.trim()&&await U(y.trim())&&M({url:y.trim()})},V=Y=>{Y.key==="Enter"&&j()},X=Y=>{v(Y.target.value),T&&S(""),x&&k(!1)},W=Y=>{const te=["image/png","image/jpeg","image/gif"],ye=Array.from(Y),be=ye.filter(Ke=>te.includes(Ke.type)&&Ke.size<=5242880);if(be.length!==ye.length&&alert(i("inputs.common.invalidFiles")),be.length===0)return;const he=be.map(Ke=>new Promise(nt=>{const pt=new FileReader;pt.onload=Jt=>nt(Jt.target?.result),pt.readAsDataURL(Ke)}));Promise.all(he).then(Ke=>{const nt={images:Ke,id:r||"",styles:n};window.dispatchEvent(new CustomEvent("email-builder-upload-image",{detail:nt})),ip(!0,r||"")})},ge=Y=>{Y.preventDefault(),m(!0)},ie=()=>{m(!1)},we=Y=>{Y.preventDefault(),m(!1);const te=Y.dataTransfer.files;W(te)},ne=()=>{const Y=new CustomEvent("toggle-media-library",{detail:!0});window.dispatchEvent(Y)},Ce=()=>{p({url:"",repeat:"no-repeat",position:"center center",size:"cover"}),u(null),e(null),v(""),k(!1)},de=Y=>{switch(Y){case"top left":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M5.26523 9.79159L5.17094 5.17183M5.17094 5.17183L9.79071 5.26611M5.17094 5.17183L10.8278 10.8287",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"top center":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M4.7998 7.33333L7.9998 4M7.9998 4L11.1998 7.33333M7.9998 4V12",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"top right":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M6.20841 5.2662L10.8282 5.17192M10.8282 5.17192L10.7339 9.79169M10.8282 5.17192L5.17132 10.8288",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"center left":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M7.33333 11.2002L4 8.00019M4 8.00019L7.33333 4.8002M4 8.00019L12 8.0002",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"center center":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M2.40039 5.20039V2.40039M2.40039 2.40039H5.20039M2.40039 2.40039L5.90039 5.90039M13.6004 5.20039V2.40039M13.6004 2.40039H10.8004M13.6004 2.40039L10.1004 5.90039M2.40039 10.8004V13.6004M2.40039 13.6004H5.20039M2.40039 13.6004L5.90039 10.1004M13.6004 13.6004L10.1004 10.1004M13.6004 13.6004V10.8004M13.6004 13.6004H10.8004",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"center right":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M8.66667 4.7998L12 7.9998M12 7.9998L8.66667 11.1998M12 7.9998L4 7.9998",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"bottom left":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M9.79062 10.7348L5.17085 10.8291M5.17085 10.8291L5.26513 6.20929M5.17085 10.8291L10.8277 5.1722",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"bottom center":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M11.1998 8.66667L7.9998 12M7.9998 12L4.7998 8.66667M7.9998 12L7.99981 4",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});case"bottom right":return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M10.7338 6.20938L10.8281 10.8291M10.8281 10.8291L6.20831 10.7349M10.8281 10.8291L5.17122 5.17229",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})});default:return h.jsx("svg",{style:{color:"currentColor"},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M2.40039 5.20039V2.40039M2.40039 2.40039H5.20039M2.40039 2.40039L5.90039 5.90039M13.6004 5.20039V2.40039M13.6004 2.40039H10.8004M13.6004 2.40039L10.1004 5.90039M2.40039 10.8004V13.6004M2.40039 13.6004H5.20039M2.40039 13.6004L5.90039 10.1004M13.6004 13.6004L10.1004 10.1004M13.6004 13.6004V10.8004M13.6004 13.6004H10.8004",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})}},Te=Y=>({"top left":i("inputs.backgroundImage.positions.topLeft"),"top center":i("inputs.backgroundImage.positions.topCenter"),"top right":i("inputs.backgroundImage.positions.topRight"),"center left":i("inputs.backgroundImage.positions.centerLeft"),"center center":i("inputs.backgroundImage.positions.center"),"center right":i("inputs.backgroundImage.positions.centerRight"),"bottom left":i("inputs.backgroundImage.positions.bottomLeft"),"bottom center":i("inputs.backgroundImage.positions.bottomCenter"),"bottom right":i("inputs.backgroundImage.positions.bottomRight")})[Y]??i("inputs.backgroundImage.positions.center");return D.useEffect(()=>{const Y=window.__emailBuilderEnableAI;Y!==void 0&&_(!!Y);const te=Oe=>{const{detail:ye}=Oe;_(!!ye)};return window.addEventListener("email-builder-ai-generation",te),()=>{window.removeEventListener("email-builder-ai-generation",te)}},[]),D.useEffect(()=>{const Y=be=>{const{detail:he}=be;ip(!1,he.id||""),M({url:he.url},he.styles),p8(!1),v(he.url)},te=be=>{ip(be?.detail?.uploading??!1,be?.detail?.id??"")},Oe=()=>{w?.current?.click()},ye=be=>{const{detail:he}=be;if(he&&!he.includes("url("))M({url:he},he.styles),v(he);else{const Ke=o(he);p(Ke),u(he),e(he),v(Ke.url)}};return window.addEventListener("email-builder-set-image",ye),window.addEventListener("email-builder-upload-image-receive",Y),window.addEventListener("email-builder-upload-file",Oe),window.addEventListener("email-builder-toggle-upload-file",te),()=>{window.removeEventListener("email-builder-upload-image-receive",Y),window.removeEventListener("email-builder-set-image",ye),window.removeEventListener("email-builder-upload-file",Oe),window.removeEventListener("email-builder-toggle-upload-file",te)}},[d]),D.useEffect(()=>{t&&k(F(d.url))},[t,d.url]),D.useEffect(()=>{if(t!==c){const Y=o(t);p(Y),u(t||null),v(Y.url||"")}},[t]),h.jsxs(ri,{children:[h.jsxs(tt,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.label")}),!I&&h.jsx(Ut,{title:i("inputs.backgroundImage.warningTooltip"),placement:"top",children:h.jsx(Qt,{size:"small",sx:{p:0},children:h.jsx(s,{})})})]}),L?h.jsx(tt,{sx:{mb:2},children:L}):h.jsx("div",{style:{display:"flex",gap:8},children:A?h.jsxs(tt,{sx:{width:"100%"},children:[h.jsxs(Mn,{direction:"row",spacing:1,children:[h.jsx(df,{fullWidth:!0,placeholder:i("inputs.image.urlPlaceholder"),value:y,onChange:X,onKeyPress:V,error:!!T,disabled:E,sx:hE}),h.jsx(di,{variant:"contained",onClick:j,disabled:!y.trim()||E,sx:{minWidth:"auto",px:2,position:"relative"},children:E?h.jsx(pc,{size:20,color:"inherit"}):i("inputs.common.add")})]}),T&&h.jsx(tc,{severity:"error",sx:{mt:1,fontSize:"0.875rem",maxHeight:"70px"},children:T}),x&&h.jsx(tc,{severity:"warning",sx:{mt:1,fontSize:"0.875rem"},action:h.jsx(Qt,{"aria-label":i("inputs.common.close"),color:"inherit",size:"small",onClick:()=>{k(!1)},children:h.jsx(fE,{fontSize:"inherit"})}),children:i("inputs.common.svgWarning")}),d.url&&h.jsxs(tt,{sx:{position:"relative",maxWidth:"50%",display:"block",margin:"0.5rem auto 0 auto"},children:[h.jsx("img",{src:d.url||"",alt:"",style:{width:"100%",objectFit:"contain",aspectRatio:"1 / 1",height:"auto",borderRadius:"8px",border:`2px solid ${a.palette.divider}`,backgroundColor:a.palette.background.paper,backgroundImage:`linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%), linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"}}),h.jsx(Qt,{onClick:Ce,sx:{position:"absolute",top:5,right:5,backgroundColor:"background.paper",color:"error.main",padding:1,width:35,height:35,"&:hover":{backgroundColor:"error.50"}},size:"small",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:h.jsx("path",{d:"M16 9.5V19.5H8V9.5H16ZM14.5 3.5H9.5L8.5 4.5H5V6.5H19V4.5H15.5L14.5 3.5ZM18 7.5H6V19.5C6 20.6 6.9 21.5 8 21.5H16C17.1 21.5 18 20.6 18 19.5V7.5Z",fill:"currentColor"})})})]})]}):h.jsxs(h.Fragment,{children:[d.url&&h.jsxs(tt,{sx:{position:"relative",maxWidth:"40%",minWidth:"40%"},children:[h.jsx("div",{style:{borderRadius:"8px",border:`2px solid ${a.palette.divider}`,height:"100%",backgroundColor:a.palette.background.paper,backgroundImage:`linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%), linear-gradient(45deg, ${a.palette.action.hover} 25%, transparent 25%, transparent 75%, ${a.palette.action.hover} 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"},children:h.jsx("img",{src:d.url||"",alt:"",style:{width:"100%",objectFit:"contain",aspectRatio:"1 / 1",height:"100%"}})}),h.jsx(Qt,{onClick:Ce,sx:{position:"absolute",top:5,right:5,backgroundColor:"background.paper",color:"error.main",padding:1,width:35,height:35,"&:hover":{backgroundColor:"error.50"}},size:"small",children:h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",children:h.jsx("path",{d:"M16 9.5V19.5H8V9.5H16ZM14.5 3.5H9.5L8.5 4.5H5V6.5H19V4.5H15.5L14.5 3.5ZM18 7.5H6V19.5C6 20.6 6.9 21.5 8 21.5H16C17.1 21.5 18 20.6 18 19.5V7.5Z",fill:"currentColor"})})})]}),h.jsxs(tt,{onDragOver:ge,onDragLeave:ie,onDrop:we,sx:{width:"100%",minWidth:"40%",border:"2px solid",borderColor:f?"primary.main":"divider",borderRadius:"8px",padding:"24px 8px 36px 8px",textAlign:"center",bgcolor:f?"primary.50":"background.paper",transition:"all 0.2s ease"},children:[h.jsx(tt,{sx:{display:"flex",justifyContent:"center"},children:h.jsx(D8,{sx:{fontSize:32,color:"primary"}})}),h.jsxs("label",{style:{cursor:"pointer"},children:[h.jsx("input",{ref:w,type:"file",style:{display:"none"},accept:"image/png,image/jpeg,image/gif",multiple:!0,onChange:Y=>{const te=Y.target.files;te&&te.length>0&&W(Array.from(te))}}),h.jsx(er,{component:"span",sx:{fontWeight:"bold",color:"primary.main","&:hover":{fontWeight:"bold",color:"primary.secondary"}},children:i("inputs.common.uploadFile")}),h.jsxs(er,{component:"span",sx:{fontWeight:"bold",color:"text.secondary"},children:[" ",i("inputs.common.dragAndDrop")]})]}),h.jsx(er,{variant:"body2",sx:{color:"text.secondary",mt:1},children:i("inputs.common.fileInfo")})]})]})}),d.url&&h.jsxs(tt,{sx:{mt:2},children:[h.jsxs(tt,{sx:{mb:2},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.fillType")}),h.jsxs(hg,{value:d.size,exclusive:!0,onChange:(Y,te)=>{te!==null&&M({size:te})},size:"small",fullWidth:!0,children:[h.jsx(En,{value:"cover",children:i("inputs.backgroundImage.fillOptions.cover")}),h.jsx(En,{value:"contain",children:i("inputs.backgroundImage.fillOptions.contain")}),h.jsx(En,{value:"auto",children:i("inputs.backgroundImage.fillOptions.auto")})]})]}),h.jsxs(Mn,{direction:"row",spacing:2,sx:{mb:2},children:[h.jsxs("div",{style:{flex:1},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.repeat")}),h.jsxs(mc,{style:{width:"100%"},value:d.repeat,size:"small",onChange:Y=>M({repeat:Y.target.value}),children:[h.jsx(ds,{value:"no-repeat",children:i("inputs.backgroundImage.repeatOptions.none")}),h.jsx(ds,{value:"repeat",children:i("inputs.backgroundImage.repeatOptions.repeat")}),h.jsx(ds,{value:"repeat-x",children:i("inputs.backgroundImage.repeatOptions.repeatX")}),h.jsx(ds,{value:"repeat-y",children:i("inputs.backgroundImage.repeatOptions.repeatY")})]})]}),h.jsxs("div",{style:{flex:1},children:[h.jsx(Wn,{label:i("inputs.backgroundImage.position")}),h.jsx(mc,{style:{width:"100%"},value:d.position,size:"small",onChange:Y=>M({position:Y.target.value}),renderValue:Y=>h.jsxs(tt,{sx:{display:"flex",alignItems:"center",gap:1,paddingRight:"1rem"},children:[de(Y),Te(Y)]}),children:["top left","top center","top right","center left","center center","center right","bottom left","bottom center","bottom right"].map(Y=>h.jsx(ds,{sx:{padding:"0.5rem 1rem 0.5rem 0.5rem!important "},value:Y,children:h.jsxs(tt,{sx:{display:"flex",alignItems:"center",gap:1},children:[de(Y),Te(Y)]})},Y))})]})]})]}),!L&&!A&&x&&h.jsx(tc,{severity:"warning",sx:{mt:1,fontSize:"0.875rem"},children:i("inputs.common.svgWarning")}),(!L&&ay()&&!A||L&&g)&&h.jsxs(h.Fragment,{children:[h.jsxs(Mn,{direction:"row",alignItems:"center",spacing:1,sx:{mt:2},children:[h.jsx(yi,{sx:{flexGrow:1}}),h.jsx(er,{sx:{color:"text.secondary"},children:i("inputs.backgroundImage.or")}),h.jsx(yi,{sx:{flexGrow:1}})]}),h.jsx(Mn,{flexDirection:"row",gap:2,sx:{mt:2},children:!L&&ay()&&!A&&h.jsx(di,{variant:"outlined",onClick:ne,startIcon:h.jsx(k8,{}),sx:{width:"100%"},children:i("inputs.backgroundImage.browseGallery")})})]}),!L&&g&&h.jsx(V8,{src:d.url,style:{width:"100%",margin:0}})]})};function mf(){return(mf=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function gE(t,e){if(t==null)return{};var n,r,i={},a=Object.keys(t);for(r=0;r<a.length;r++)e.indexOf(n=a[r])>=0||(i[n]=t[n]);return i}function Oh(t){var e=D.useRef(t),n=D.useRef(function(r){e.current&&e.current(r)});return e.current=t,n.current}var Ih=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t<e?e:t},Ym=function(t){return"touches"in t},ow=function(t){return t&&t.ownerDocument.defaultView||self},DM=function(t,e,n){var r=t.getBoundingClientRect(),i=Ym(e)?(function(a,s){for(var o=0;o<a.length;o++)if(a[o].identifier===s)return a[o];return a[0]})(e.touches,n):e;return{left:Ih((i.pageX-(r.left+ow(t).pageXOffset))/r.width),top:Ih((i.pageY-(r.top+ow(t).pageYOffset))/r.height)}},AM=function(t){!Ym(t)&&t.preventDefault()},W8=D.memo(function(t){var e=t.onMove,n=t.onKey,r=gE(t,["onMove","onKey"]),i=D.useRef(null),a=Oh(e),s=Oh(n),o=D.useRef(null),l=D.useRef(!1),c=D.useMemo(function(){var f=function(_){AM(_),(Ym(_)?_.touches.length>0:_.buttons>0)&&i.current?a(DM(i.current,_,o.current)):g(!1)},m=function(){return g(!1)};function g(_){var b=l.current,y=ow(i.current),v=_?y.addEventListener:y.removeEventListener;v(b?"touchmove":"mousemove",f),v(b?"touchend":"mouseup",m)}return[function(_){var b=_.nativeEvent,y=i.current;if(y&&(AM(b),!(function(E,C){return C&&!Ym(E)})(b,l.current)&&y)){if(Ym(b)){l.current=!0;var v=b.changedTouches||[];v.length&&(o.current=v[0].identifier)}y.focus(),a(DM(y,b,o.current)),g(!0)}},function(_){var b=_.which||_.keyCode;b<37||b>40||(_.preventDefault(),s({left:b===39?.05:b===37?-.05:0,top:b===40?.05:b===38?-.05:0}))},g]},[s,a]),u=c[0],d=c[1],p=c[2];return D.useEffect(function(){return p},[p]),D.createElement("div",mf({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:i,onKeyDown:d,tabIndex:0,role:"slider"}))}),ZA=function(t){return t.filter(Boolean).join(" ")},Y8=function(t){var e=t.color,n=t.left,r=t.top,i=r===void 0?.5:r,a=ZA(["react-colorful__pointer",t.className]);return D.createElement("div",{className:a,style:{top:100*i+"%",left:100*n+"%"}},D.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:e}}))},ei=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n},ape=function(t){return upe(lw(t))},lw=function(t){return t[0]==="#"&&(t=t.substring(1)),t.length<6?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?ei(parseInt(t[3]+t[3],16)/255,2):1}:{r:parseInt(t.substring(0,2),16),g:parseInt(t.substring(2,4),16),b:parseInt(t.substring(4,6),16),a:t.length===8?ei(parseInt(t.substring(6,8),16)/255,2):1}},spe=function(t){return cpe(lpe(t))},ope=function(t){var e=t.s,n=t.v,r=t.a,i=(200-e)*n/100;return{h:ei(t.h),s:ei(i>0&&i<200?e*n/100/(i<=100?i:200-i)*100:0),l:ei(i/2),a:ei(r,2)}},cw=function(t){var e=ope(t);return"hsl("+e.h+", "+e.s+"%, "+e.l+"%)"},lpe=function(t){var e=t.h,n=t.s,r=t.v,i=t.a;e=e/360*6,n/=100,r/=100;var a=Math.floor(e),s=r*(1-n),o=r*(1-(e-a)*n),l=r*(1-(1-e+a)*n),c=a%6;return{r:ei(255*[r,o,s,s,l,r][c]),g:ei(255*[l,r,r,o,s,s][c]),b:ei(255*[s,s,l,r,r,o][c]),a:ei(i,2)}},g_=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},cpe=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=i<1?g_(ei(255*i)):"";return"#"+g_(e)+g_(n)+g_(r)+a},upe=function(t){var e=t.r,n=t.g,r=t.b,i=t.a,a=Math.max(e,n,r),s=a-Math.min(e,n,r),o=s?a===e?(n-r)/s:a===n?2+(r-e)/s:4+(e-n)/s:0;return{h:ei(60*(o<0?o+6:o)),s:ei(a?s/a*100:0),v:ei(a/255*100),a:i}},dpe=D.memo(function(t){var e=t.hue,n=t.onChange,r=ZA(["react-colorful__hue",t.className]);return D.createElement("div",{className:r},D.createElement(W8,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Ih(e+360*i.left,0,360)})},"aria-label":"Hue","aria-valuenow":ei(e),"aria-valuemax":"360","aria-valuemin":"0"},D.createElement(Y8,{className:"react-colorful__hue-pointer",left:e/360,color:cw({h:e,s:100,v:100,a:1})})))}),ppe=D.memo(function(t){var e=t.hsva,n=t.onChange,r={backgroundColor:cw({h:e.h,s:100,v:100,a:1})};return D.createElement("div",{className:"react-colorful__saturation",style:r},D.createElement(W8,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Ih(e.s+100*i.left,0,100),v:Ih(e.v-100*i.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+ei(e.s)+"%, Brightness "+ei(e.v)+"%"},D.createElement(Y8,{className:"react-colorful__saturation-pointer",top:1-e.v/100,left:e.s/100,color:cw(e)})))}),K8=function(t,e){if(t===e)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0},fpe=function(t,e){return t.toLowerCase()===e.toLowerCase()||K8(lw(t),lw(e))};function mpe(t,e,n){var r=Oh(n),i=D.useState(function(){return t.toHsva(e)}),a=i[0],s=i[1],o=D.useRef({color:e,hsva:a});D.useEffect(function(){if(!t.equal(e,o.current.color)){var c=t.toHsva(e);o.current={hsva:c,color:e},s(c)}},[e,t]),D.useEffect(function(){var c;K8(a,o.current.hsva)||t.equal(c=t.fromHsva(a),o.current.color)||(o.current={hsva:a,color:c},r(c))},[a,t,r]);var l=D.useCallback(function(c){s(function(u){return Object.assign({},u,c)})},[]);return[a,l]}var hpe=typeof window<"u"?D.useLayoutEffect:D.useEffect,gpe=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},NM=new Map,_pe=function(t){hpe(function(){var e=t.current?t.current.ownerDocument:document;if(e!==void 0&&!NM.has(e)){var n=e.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,NM.set(e,n);var r=gpe();r&&n.setAttribute("nonce",r),e.head.appendChild(n)}},[])},bpe=function(t){var e=t.className,n=t.colorModel,r=t.color,i=r===void 0?n.defaultColor:r,a=t.onChange,s=gE(t,["className","colorModel","color","onChange"]),o=D.useRef(null);_pe(o);var l=mpe(n,i,a),c=l[0],u=l[1],d=ZA(["react-colorful",e]);return D.createElement("div",mf({},s,{ref:o,className:d}),D.createElement(ppe,{hsva:c,onChange:u}),D.createElement(dpe,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},ype={defaultColor:"000",toHsva:ape,fromHsva:function(t){return spe({h:t.h,s:t.s,v:t.v,a:1})},equal:fpe},vpe=function(t){return D.createElement(bpe,mf({},t,{colorModel:ype}))},Epe=/^#?([0-9A-F]{3,8})$/i,Spe=function(t){var e=t.color,n=e===void 0?"":e,r=t.onChange,i=t.onBlur,a=t.escape,s=t.validate,o=t.format,l=t.process,c=gE(t,["color","onChange","onBlur","escape","validate","format","process"]),u=D.useState(function(){return a(n)}),d=u[0],p=u[1],f=Oh(r),m=Oh(i),g=D.useCallback(function(b){var y=a(b.target.value);p(y),s(y)&&f(l?l(y):y)},[a,l,s,f]),_=D.useCallback(function(b){s(b.target.value)||p(a(n)),m(b)},[n,a,s,m]);return D.useEffect(function(){p(a(n))},[n,a]),D.createElement("input",mf({},c,{value:o?o(d):d,spellCheck:"false",onChange:g,onBlur:_}))},RM=function(t){return"#"+t},Cpe=function(t){var e=t.prefixed,n=t.alpha,r=gE(t,["prefixed","alpha"]),i=D.useCallback(function(s){return s.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),a=D.useCallback(function(s){return(function(o,l){var c=Epe.exec(o),u=c?c[1].length:0;return u===3||u===6||!!l&&u===4||!!l&&u===8})(s,n)},[n]);return D.createElement(Spe,mf({},r,{escape:i,format:e?RM:void 0,process:RM,validate:a}))};const OM={width:24,height:24};function Tpe({paletteColors:t,isLocked:e,onToggleLock:n,onChange:r}){const i=dr(),a=t.slice(30);return h.jsxs(Mn,{spacing:1,children:[h.jsx("div",{style:{height:1,width:"100%",margin:"8px 0",backgroundColor:i.palette.grey[400]}}),h.jsxs(tt,{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"4px",children:[a.map((s,o)=>h.jsx(di,{sx:{...OM,backgroundColor:s,border:"1px solid",margin:"0!important",borderColor:i.palette.grey[50],minWidth:24,display:"inline-flex","&:hover":{backgroundColor:s,borderColor:"grey.500"}},onClick:()=>r&&r(s)},o+29)),n&&h.jsx(di,{onClick:n,sx:{backgroundColor:"transparent",border:"1px solid",...OM,minWidth:24,margin:"0!important",borderColor:e?i.palette.error.main:i.palette.divider,display:"inline-flex",color:e?i.palette.error.main:i.palette.text.secondary,"&:hover":{backgroundColor:e?i.palette.error.light+"20":"action.hover",borderColor:e?i.palette.error.main:i.palette.text.secondary}},title:e?"Unlock recent colors":"Lock recent colors",children:e?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})]})]})}const xpe={p:1,".react-colorful__pointer ":{width:16,height:16},".react-colorful__saturation":{mb:1,borderRadius:"8px"},".react-colorful__last-control":{borderRadius:"8px"},".react-colorful__hue-pointer":{width:"4px",borderRadius:"8px",height:24,cursor:"col-resize"},".react-colorful__saturation-pointer":{cursor:"all-scroll"},input:{padding:1,border:"1px solid",borderColor:"grey.300",borderRadius:"8px",width:"100%"}},IM=(t,e)=>{if(!t||t.trim()==="")return e;const r=e.slice(-5),i=e.slice(0,30),a=r.filter(o=>o!==t&&o!==""),s=[t,...a].slice(0,5);for(;s.length<5;)s.push("");return[...i,...s]};function uw({value:t,nullable:e,onChange:n}){const[r,i]=D.useState(t||"#000000"),[a,s]=D.useState(null),{paletteColors:o,isLocked:l}=vue(),[c,u]=D.useState(!1),d=dr(),p=D.useCallback(b=>{if(l)return;a&&clearTimeout(a);const y=setTimeout(()=>{const v=IM(b,o);XS({paletteColors:v})},300);s(y)},[a,l,o]),f=()=>{const b=!l;if(XS({isLocked:b}),!b&&r){const y=IM(r,o);XS({isLocked:b,paletteColors:y})}},m=b=>{u(!0),i(b)},g=()=>{n(r),p(r)},_=b=>{i(b),n(b),p(b)};return D.useEffect(()=>{t!==r&&i(t||"#000000")},[t]),D.useEffect(()=>()=>{a&&clearTimeout(a)},[a]),h.jsxs(Mn,{spacing:1,sx:xpe,children:[h.jsx(vpe,{color:r,onChange:m,onMouseUp:g,onTouchEnd:g,onMouseLeave:b=>c?g():null}),h.jsx(Tpe,{isLocked:l,onToggleLock:f,paletteColors:o,value:t,nullable:e,onChange:b=>{b?(i(b),n(b),p(b)):n(null)}}),h.jsxs(tt,{pt:1,display:"flex",gap:1,alignItems:"center",children:[h.jsx(Cpe,{prefixed:!0,color:r,onChange:_,style:{flex:1,backgroundColor:d.palette.background.paper,color:d.palette.text.primary,padding:"1px 4px",fontSize:"12px"}}),e&&h.jsx(di,{onClick:()=>n&&n(null),sx:{backgroundColor:"transparent",width:24,height:24,minWidth:24,margin:"0!important",borderColor:d.palette.divider,display:"inline-flex","&:hover":{backgroundColor:"action.hover",borderColor:d.palette.text.secondary}},children:h.jsx(E8,{color:"primary",fontSize:"small"})})]})]})}function Q8({label:t,defaultValue:e,onChange:n,nullable:r,compact:i=!1,...a}){const[s,o]=D.useState(null),[l,c]=D.useState(e),{t:u}=Ot.useTranslation("inspector");D.useEffect(()=>{l!==e&&c(e)},[e]);const d=b=>{o(b.currentTarget)},p=i?{border:"1px solid",borderColor:"cadet.400",width:28,height:28,borderRadius:"8px",bgcolor:"#FFFFFF"}:{border:t?"1px solid":"",borderColor:"cadet.400",width:"100%",height:36,paddingTop:"8px",paddingBottom:"8px",paddingLeft:"12px",paddingRight:"12px",borderRadius:"8px",bgcolor:"#FFFFFF"},f=b=>{c(b),n(b)},m=()=>!r||typeof l!="string"||l.trim().length===0?null:h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:u("inputs.background.reset"),placement:"left",children:h.jsx(tt,{sx:{minWidth:24,lineHeight:1,flexShrink:0,pr:"4px",display:"grid",placeItems:"center"},onClick:()=>f(null),children:h.jsx(E8,{sx:{color:"primary.main"}})})}),g=l?h.jsx(Ha,{onClick:d,sx:{...p,bgcolor:l}}):h.jsx(Ha,{onClick:d,sx:{...p},children:h.jsx(YA,{fontSize:"small"})}),_=h.jsx(RA,{anchorEl:s,open:!!s,onClose:()=>o(null),sx:{"& .MuiPaper-root":{boxShadow:"0 4px 6px rgba(0, 0, 0, 0.4);",borderRadius:1,maxWidth:"200px",transform:"translateX(-100%) !important;"}},MenuListProps:{sx:{height:"auto",padding:0}},children:h.jsx(uw,{value:l||"",nullable:r,onChange:b=>f(b)})});return i?h.jsxs(h.Fragment,{children:[g,_]}):h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsxs(Mn,{direction:"row",alignContent:"center",spacing:1,children:[g,m()]}),_]})}function yu(t){return h.jsx(Q8,{...t,nullable:!1})}function t1(t){return h.jsx(Q8,{...t,nullable:!0})}const MM=({mobile:t=!1,label:e,borderColor:n,borderTop:r,borderBottom:i,borderLeft:a,borderRight:s,onChange:o})=>{const{t:l}=Ot.useTranslation("inspector"),c=()=>t?{top:"borderTopMobile",bottom:"borderBottomMobile",left:"borderLeftMobile",right:"borderRightMobile"}:{top:"borderTop",bottom:"borderBottom",left:"borderLeft",right:"borderRight"},u=S=>{const x=Object.values(S);return x.every(k=>k===x[0])},d=c(),p={[d.top]:r??0,[d.bottom]:i??0,[d.left]:a??0,[d.right]:s??0},[f,m]=D.useState(()=>u(p)?"all":"custom"),[g,_]=D.useState(n??"#000000"),[b,y]=D.useState(p);D.useEffect(()=>{n!==g&&_(n??"#000000");const S={[d.top]:r??0,[d.bottom]:i??0,[d.left]:a??0,[d.right]:s??0};Object.keys(S).some(k=>b[k]!==S[k])&&(y(S),u(S)||m("custom"))},[n,r,i,a,s,t]);const v=()=>{if(f!=="all"){const S=b[d.top]??0;C(S),m("all")}else m("custom")},E=S=>{_(S),o({borderColor:S,...b})},C=S=>{const x={[d.top]:S,[d.bottom]:S,[d.left]:S,[d.right]:S};y(x),o({...x,borderColor:g})},T=(S,x)=>{y(w=>({...w,[x]:S}));const k={...b,borderColor:g,[x]:S};u(k)||m("custom"),o(k)};return h.jsxs("div",{children:[h.jsxs(Mn,{direction:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:e}),h.jsxs(Mn,{direction:"row",spacing:1,alignItems:"center",children:[h.jsx(yu,{defaultValue:g,onChange:E,compact:!0}),h.jsx(Ut,{title:l(f==="all"?"border.unlockBorders":"border.lockBordersTogether"),children:h.jsx(Qt,{size:"small",onClick:v,sx:{color:f==="all"?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:f==="all"?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]})]}),f==="all"&&h.jsx(ru,{label:"",iconLabel:h.jsx(Rue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.top],onChange:C}),f==="custom"&&h.jsxs(Mn,{spacing:2,children:[h.jsx(ru,{label:"",iconLabel:h.jsx(Iue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.top],onChange:S=>T(S,d.top)}),h.jsx(ru,{label:"",iconLabel:h.jsx(Aue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.bottom],onChange:S=>T(S,d.bottom)}),h.jsx(ru,{label:"",iconLabel:h.jsx(Nue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.left],onChange:S=>T(S,d.left)}),h.jsx(ru,{label:"",iconLabel:h.jsx(Oue,{sx:{color:"text.secondary"}}),units:"px",step:1,min:0,max:8,defaultValue:b[d.right],onChange:S=>T(S,d.right)})]})]})},X8=[{key:"INHERIT",label:"Inherit",value:"inherit"},{key:"LATO",label:"Lato",value:'"Lato", sans-serif'},{key:"MERRIWEATHER",label:"Merriweather",value:'"Merriweather", serif'},{key:"MONTSERRAT",label:"Montserrat",value:'"Montserrat", sans-serif'},{key:"OPEN_SANS",label:"Open Sans",value:'"Open Sans", sans-serif'},{key:"OSWALD",label:"Oswald",value:'"Oswald", sans-serif'},{key:"PACIFICO",label:"Pacifico",value:'"Pacifico", cursive'},{key:"PLAYFAIR",label:"Playfair",value:'"Playfair", serif'},{key:"ROBOTO",label:"Roboto",value:'"Roboto", sans-serif'},{key:"MODERN_SANS",label:"Modern sans",value:'"Helvetica Neue", "Arial Nova", "Nimbus Sans", Arial, sans-serif'}],kpe={FAMILY:"MODERN_SANS"},hf=yr(["MODERN_SANS","LATO","MERRIWEATHER","MONTSERRAT","OPEN_SANS","OSWALD","PACIFICO","PLAYFAIR","ROBOTO","INHERIT"]).nullable().optional(),PM=t=>X8.find(e=>e.key===t)?.value;function il(t){const e=aue();let n=PM(t);return n||(n=PM(e?.fontFamily),n||"inherit")}const wpe=X8.map(t=>h.jsx(ds,{value:t.key,sx:{fontFamily:t.value},children:t.label},t.key));function Z8({label:t,onChange:e,defaultValue:n}){const r="INHERIT",[i,a]=D.useState(n??r);D.useEffect(()=>{i!==n&&a(n??r)},[n]);const s=o=>{const l=o?.target?.value;a(l),e(l===null?null:l)};return h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(mc,{style:{width:"100%"},value:i,size:"small",onChange:s,children:wpe})]})}function LM({label:t,defaultValue:e=16,onChange:n,maxValue:r,minValue:i,step:a}){const[s,o]=D.useState(e);D.useEffect(()=>{s!==e&&o(e)},[e]);const l=c=>{o(c),n(c)};return h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(vr,{iconLabel:h.jsx(R8,{sx:{fontSize:16,color:"text.primary"}}),value:s,setValue:l,units:"px",step:a??2,min:i||8,max:r||48})]})}function kc({label:t,children:e,defaultValue:n,onChange:r}){const[i,a]=D.useState(n);return D.useEffect(()=>{n!==i&&a(n)},[n]),h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsx(tt,{sx:{...Xde,paddingLeft:"0px",paddingRight:"0px"},children:h.jsx(hg,{exclusive:!0,fullWidth:!0,value:i,size:"small",sx:{width:"100%"},onChange:(s,o)=>{if(typeof o!="string")throw new Error("RadioGroupInput can only receive string values");a(o),r(o)},children:e})})]})}function Dpe({label:t,defaultValue:e,onChange:n}){const[r,i]=D.useState(e);return D.useEffect(()=>{r!==e&&i(e)},[e]),h.jsxs(kc,{label:t,defaultValue:r,onChange:a=>{i(a),n(a)},children:[h.jsx(En,{value:"normal",children:"Regular"}),h.jsx(En,{value:"bold",children:"Bold"})]})}const FM=({label:t,defaultValue:e,onChange:n})=>{const{t:r}=Ot.useTranslation("inspector"),i=t??r("inputs.common.height");return h.jsx(vr,{label:i,iconLabel:h.jsx(C8,{sx:{color:"text.secondary"}}),units:"px",step:1,min:1,max:100,marks:!1,value:e??1,setValue:n})},Ape=[{key:"1",value:"1",label:"Simple (1.0)"},{key:"1.15",value:"1.15",label:"Compact (1.15)"},{key:"1.5",value:"1.5",label:"Normal (1.5)"},{key:"2",value:"2",label:"Relaxed (2.0)"},{key:"2.5",value:"2.5",label:"Wide (2.5)"},{key:"3",value:"3",label:"Loose (3.0)"},{key:"4",value:"4",label:"Very Loose (4.0)"}],Npe=Ape.map(t=>h.jsx(ds,{value:t.key,children:t.label},t.key));function Rpe({label:t,onChange:e,defaultValue:n}){const r="INHERIT",[i,a]=D.useState(n?.toString()??r);D.useEffect(()=>{i!==n?.toString()&&a(n?.toString()??r)},[n]);const s=o=>{const l=o?.target?.value;a(l),e(l===r?null:parseFloat(l))};return h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsxs(mc,{style:{width:"100%"},value:i,size:"small",onChange:s,children:[h.jsx(ds,{value:r,children:"Default value"}),Npe]})]})}function BM({label:t,defaultValue:e,onChange:n}){const{t:i}=Ot.useTranslation("inspector"),[a,s]=D.useState(()=>e||{top:0,left:0,bottom:0,right:0});D.useEffect(()=>{e&&(e.top!==a.top||e.left!==a.left||e.bottom!==a.bottom||e.right!==a.right)&&s(e)},[e]);const[o,l]=D.useState(!1);function c(d,p){let f;o?f={top:p,bottom:p,left:p,right:p}:f={...a,[d]:p},s(f),n(f)}const u=()=>{if(!o){const d={top:a.top,bottom:a.top,left:a.top,right:a.top};s(d),n(d)}l(!o)};return h.jsxs(ri,{children:[h.jsxs(Mn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:t}),h.jsx(Ut,{title:i(o?"inputs.responsiveSize.unlockTooltip":"inputs.responsiveSize.lockTooltip"),children:h.jsx(Qt,{size:"small",onClick:u,sx:{marginTop:"0!important",color:o?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:o?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]}),o?h.jsx(vr,{iconLabel:h.jsx("span",{children:i("inputs.responsiveSize.allSides")}),value:a.top,setValue:d=>c("top",d),units:"px",step:16,min:0,max:120,marks:!0}):h.jsxs(h.Fragment,{children:[h.jsx(vr,{iconLabel:h.jsx(_8,{sx:{fontSize:16,color:"text.primary"}}),value:a.top,setValue:d=>c("top",d),units:"px",step:16,min:0,max:120,marks:!0}),h.jsx(vr,{iconLabel:h.jsx(g8,{sx:{fontSize:16,color:"text.primary"}}),value:a.bottom,setValue:d=>c("bottom",d),units:"px",step:16,min:0,max:120,marks:!0}),h.jsx(vr,{iconLabel:h.jsx(m8,{sx:{fontSize:16,color:"text.primary"}}),value:a.left,setValue:d=>c("left",d),units:"px",step:16,min:0,max:120,marks:!0}),h.jsx(vr,{iconLabel:h.jsx(h8,{sx:{fontSize:16,color:"text.primary"}}),value:a.right,setValue:d=>c("right",d),units:"px",step:16,min:0,max:120,marks:!0})]})]})}const Ope=({label:t,defaultValue:e,onChange:n,maxValue:r=600,shapeSteps:i=8})=>{const{t:a}=Ot.useTranslation("inspector"),[s,o]=D.useState(()=>typeof e=="object"&&e!==null?"rectangle":e||"rectangle"),[l,c]=D.useState(()=>typeof e=="object"&&e!==null?e:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0}),[u,d]=D.useState(!1);D.useEffect(()=>{typeof e=="object"&&e!==null?(c(e),o("rounded")):e&&o(e)},[e]);const p=b=>{o(b),n(b==="rounded"?l:b)},f=(b,y)=>{let v;u?v={topLeft:y,topRight:y,bottomLeft:y,bottomRight:y}:v={...l,[b]:y},c(v),n(v)},m=()=>{if(!u){const b={topLeft:l.topLeft,topRight:l.topLeft,bottomLeft:l.topLeft,bottomRight:l.topLeft};c(b),n(b)}d(!u)},g=r,_=t||a("shape.label");return h.jsxs(h.Fragment,{children:[h.jsxs(kc,{label:_,defaultValue:s,onChange:p,children:[h.jsx(En,{value:"rectangle",children:a("shape.square")}),h.jsx(En,{value:"pill",children:a("shape.pill")}),h.jsx(En,{value:"rounded",children:a("shape.custom")})]}),s==="rounded"&&h.jsxs(Mn,{spacing:2,alignItems:"flexStart",pb:1,children:[h.jsxs(Mn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:a("shape.borderRadius")}),h.jsx(Ut,{title:a(u?"shape.unlockTooltip":"shape.lockTooltip"),children:h.jsx(Qt,{size:"small",onClick:m,sx:{marginTop:"0!important",color:u?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:u?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]}),u?h.jsx(h.Fragment,{children:h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16}}),value:l.topRight,setValue:b=>f("topLeft",b),units:"px",min:0,step:i,marks:i>1,max:g})}):h.jsxs(h.Fragment,{children:[h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(0deg)"}}),value:l.topLeft,setValue:b=>f("topLeft",b),units:"px",min:0,step:i,marks:i>1,max:g}),h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(270deg)"}}),value:l.topRight,setValue:b=>f("topRight",b),units:"px",min:0,step:i,marks:i>1,max:g}),h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(180deg)"}}),value:l.bottomLeft,setValue:b=>f("bottomLeft",b),units:"px",min:0,step:i,marks:i>1,max:g}),h.jsx(vr,{iconLabel:h.jsx(Qf,{sx:{fontSize:16,transform:"rotate(90deg)"}}),value:l.bottomRight,setValue:b=>f("bottomRight",b),units:"px",min:0,step:i,marks:i>1,max:g})]})]})]})};function $M({label:t,defaultValue:e,onChange:n}){const[r,i]=D.useState(e??"left");return D.useEffect(()=>{e!==r&&i(e??"left")},[e]),h.jsxs(ri,{children:[h.jsx(Wn,{label:t}),h.jsxs(kc,{label:"",defaultValue:r,onChange:a=>{i(a),n(a)},children:[h.jsx(En,{value:"left",children:h.jsx(Que,{fontSize:"small"})}),h.jsx(En,{value:"center",children:h.jsx(Kue,{fontSize:"small"})}),h.jsx(En,{value:"right",children:h.jsx(Xue,{fontSize:"small"})})]})]})}const UM=({label:t,defaultValue:e,onChange:n,step:r,...i})=>{const{t:a}=Ot.useTranslation("inspector"),s=t??a("inputs.common.width");return h.jsx(vr,{label:s,iconLabel:h.jsx(C8,{sx:{color:"text.primary",transform:"rotate(90deg)"}}),units:"%",step:r,min:1,max:100,marks:!1,value:e??1,setValue:n,...i})};function Ipe({name:t,value:e,onChange:n,shapeMaxValue:r,shapeSteps:i}){const a=Sr(),s=pE(),{t:o}=Ot.useTranslation("inspector"),l=(f,m)=>{const g=e[f],_=e[m];return g??_},c=(f,m)=>{n(m?{...e,...m,[t]:f}:{...e,[t]:f})},u=f=>{n({...e,...f})},p=(()=>{switch(t){case"textAlignMobile":return l("textAlignMobile","textAlign");case"mobilePadding":return l("mobilePadding","padding");case"fontSizeMobile":return l("fontSizeMobile","fontSize")??16;case"heightMobile":return l("heightMobile","height");case"widthMobile":return l("widthMobile","width");case"borderMobile":return{borderTop:l("borderTopMobile","borderTop"),borderBottom:l("borderBottomMobile","borderBottom"),borderLeft:l("borderLeftMobile","borderLeft"),borderRight:l("borderRightMobile","borderRight")};default:return e[t]??null}})();switch(t){case"backgroundColor":return h.jsx(t1,{label:o("properties.backgroundColor"),defaultValue:p??s?.canvasColor,onChange:c});case"background":return h.jsx(ipe,{defaultValue:p,onChange:(f,m)=>c(f,m),values:e});case"borderColor":return h.jsx(t1,{label:o("properties.border"),defaultValue:p,onChange:c});case"borderRadius":return h.jsx(ru,{iconLabel:h.jsx(cde,{}),units:"px",step:4,marks:!0,min:0,max:48,label:o("properties.borderRadius"),defaultValue:p,onChange:c});case"color":return h.jsx(t1,{label:o("properties.color"),defaultValue:p,onChange:c});case"fontFamily":return h.jsx(Z8,{label:o("properties.fontFamily"),defaultValue:p,onChange:c});case"fontWeight":return h.jsx(Dpe,{label:o("properties.fontWeight"),defaultValue:p,onChange:c});case"textAlign":return a==="desktop"&&h.jsx($M,{label:o("properties.alignment"),defaultValue:p,onChange:c});case"textAlignMobile":return a!="desktop"&&h.jsx($M,{label:o("properties.alignment"),defaultValue:p,onChange:c});case"padding":return a==="desktop"&&h.jsx(BM,{label:o("properties.padding"),defaultValue:p,onChange:c});case"mobilePadding":return a!="desktop"&&h.jsx(BM,{label:o("properties.padding"),defaultValue:p,onChange:c});case"fontSize":return a==="desktop"&&h.jsx(LM,{maxValue:80,step:8,label:o("properties.fontSize"),defaultValue:p??16,onChange:c});case"fontSizeMobile":return a!="desktop"&&h.jsx(LM,{maxValue:80,step:8,label:o("properties.fontSize"),defaultValue:p,onChange:c});case"lineHeight":return h.jsx(Rpe,{label:o("properties.lineHeight"),defaultValue:p??1.5,onChange:c});case"shape":return h.jsx(Ope,{shapeSteps:i,maxValue:r,label:o("properties.shape"),defaultValue:p,onChange:c});case"height":return a==="desktop"&&h.jsx(FM,{label:o("properties.height"),defaultValue:p,onChange:c});case"heightMobile":return a!="desktop"&&h.jsx(FM,{label:o("properties.height"),defaultValue:p,onChange:c});case"width":return a==="desktop"&&h.jsx(UM,{label:o("properties.width"),defaultValue:p,onChange:c});case"widthMobile":return a!="desktop"&&h.jsx(UM,{label:o("properties.width"),defaultValue:p,onChange:c});case"border":return a==="desktop"&&h.jsx(MM,{label:o("properties.border"),borderColor:e.borderColor??null,borderTop:e.borderTop??null,borderBottom:e.borderBottom??null,borderLeft:e.borderLeft??null,borderRight:e.borderRight??null,onChange:u});case"borderMobile":return a!="desktop"&&h.jsx(MM,{mobile:!0,label:o("properties.border"),borderColor:e.borderColor??null,borderTop:p.borderTop??null,borderBottom:p.borderBottom??null,borderLeft:p.borderLeft??null,borderRight:p.borderRight??null,onChange:u});default:return null}}function Ci({names:t,value:e,onChange:n,disabledCSSValidation:r=!1,shapeMaxValue:i,shapeSteps:a}){const s=_o(),o=c8();return(r||s=="css"||Qb.includes(o||""))&&h.jsx(h.Fragment,{children:t.map(l=>h.jsx(Ipe,{shapeMaxValue:i,shapeSteps:a,name:l,value:e||{},onChange:n},l))})}const JA=t=>t?["http","mailto:","tel:","sms:","whatsapp:"].some(n=>t.startsWith(n))?t:`//${t}`:"#",_y=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),Cg=t=>t?{top:t?.top??0,right:t?.right??0,bottom:t?.bottom??0,left:t?.left??0}:{top:0,right:0,bottom:0,left:0},Mpe=xt({topLeft:Le().min(0).optional(),topRight:Le().min(0).optional(),bottomLeft:Le().min(0).optional(),bottomRight:Le().min(0).optional()}),e2=xt({style:xt({padding:_y,mobilePadding:_y,background:Pt().nullable().optional(),backgroundColor:Pt().regex(/^#[0-9a-fA-F]{6}$/).optional().nullable(),textAlign:yr(["center","left","right"]).optional().nullable(),textAlignMobile:yr(["center","left","right"]).optional().nullable(),shape:ap([yr(["rectangle","pill"]),Mpe]).optional().nullable()}),props:xt({touched:Dp().optional().nullable(),scale:Le().optional().nullable(),size:Pt().optional().nullable(),sizeMobile:Pt().optional().nullable(),width:Le().optional().nullable(),widthMobile:Le().optional().nullable(),scaleMobile:Le().optional().nullable(),touchedMobile:Dp().optional().nullable(),original_width:Le().optional().nullable(),height:Le().optional().nullable(),url:Pt().optional().nullable(),alt:Pt().optional().nullable(),linkHref:Pt().optional().nullable(),contentAlignment:yr(["top","middle","bottom"]).optional().nullable()}).optional().nullable()}).passthrough();function J8({style:t,props:e,blockId:n}){const r=Sr(),i=dE(),a={padding:Cg(r=="desktop"?t?.padding:t?.mobilePadding??t?.padding),backgroundColor:t?.backgroundColor??void 0,textAlign:r=="desktop"?t?.textAlign??void 0:t?.textAlignMobile??t?.textAlign??void 0},s=(_,b)=>_==="fill"?"100%":_==="scale"?`${b}%`:e?.width,o=e?.linkHref??null,l=r=="desktop"?s(e?.size,e?.scale):s(e?.sizeMobile,e?.scaleMobile),c={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},u=t?.background??"",d=t?.backgroundColor,p=d?Ju(u,d):u,f=_=>{const b=_.currentTarget;setTimeout(()=>{if(!e?.width&&b.offsetWidth){const y=b.offsetWidth;Sue(n,{...e,width:y})}},100)},m=h.jsxs(h.Fragment,{children:[h.jsx("img",{alt:e?.alt??"",src:e?.url??"",width:l,onLoad:f,style:{width:l,height:"auto",outline:"none",border:"none",textDecoration:"none",verticalAlign:e?.contentAlignment??"middle",display:"inline-block",maxWidth:"100%",opacity:i.uploading&&i.id===n?.5:1,transition:"opacity 0.2s ease-in-out",borderRadius:gy(t)}}),i.uploading&&i.id===n&&h.jsx("div",{style:c,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})]}),g=tn(n);return o?h.jsx(ki,{className:`${g}`,padding:a.padding,background:p,align:a.textAlign,width:"100%",children:h.jsx("a",{href:JA(o),style:{textDecoration:"none",display:"block",width:"100%",height:"100%"},target:"_blank",children:m})}):h.jsx(ki,{className:`${g}`,padding:a.padding,background:p,align:a.textAlign,width:"100%",children:m})}const ez=({data:t,setData:e,blockId:n})=>{const{t:r}=Ot.useTranslation("inspector"),[i,a]=D.useState(!1),[s,o]=D.useState(()=>!!window.__emailBuilderEnableAI),[,l]=D.useState(null),[c,u]=D.useState(""),[d,p]=D.useState(!1),[f,m]=D.useState(""),[g,_]=D.useState(!1),b=D.useRef(null),y=WA(),[v,E]=D.useState(null);D.useEffect(()=>{const M=window.__emailBuilderCustomImageProvider;M&&(E(M),setTimeout(()=>{n&&window.dispatchEvent(new CustomEvent("email-builder-image-panel-opened",{detail:{blockId:n,currentImageUrl:t.props?.url||null,alt:t.props?.alt||null}}))},100))},[]);const C=M=>{const F=e2.safeParse(M);F.success?(e(F.data),l(null)):l(F.error)},T=(M,F)=>{const U=M.toLowerCase(),j=U.includes(".svg")||U.includes("svg"),V=F&&(F.includes("image/svg+xml")||F.includes("svg"));return j||!!V},S=async M=>{try{p(!0),m(""),_(!1);try{new URL(M)}catch{return m(r("inputs.image.invalidUrl")),!1}const F=new AbortController,U=setTimeout(()=>F.abort(),1e4);try{const j=await fetch(M,{method:"HEAD",signal:F.signal});if(clearTimeout(U),!j.ok)return m(`HTTP ${j.status}: ${j.statusText}`),!1;const V=j.headers.get("content-type");return["image/","image/svg+xml","text/xml","application/xml"].some(ge=>V&&V.toLowerCase().includes(ge.toLowerCase()))?(T(M,V)&&_(!0),m(""),!0):(m(r("inputs.image.notImage")),!1)}catch(j){return clearTimeout(U),j.name==="AbortError"?(m(r("inputs.image.timeout")),!1):new Promise(V=>{const X=new Image,W=setTimeout(()=>{m(r("inputs.image.timeout")),V(!1)},1e4);X.onload=()=>{clearTimeout(W),T(M)&&_(!0),m(""),V(!0)},X.onerror=()=>{clearTimeout(W),m("Cannot access image - CORS policy, network error, or invalid URL"),V(!1)},X.src=M})}}catch{return m("Unexpected error occurred while validating URL"),!1}finally{p(!1)}},x=async()=>{c.trim()&&await S(c.trim())&&(C({...t,props:{...t.props,url:c.trim()}}),u(""))},k=M=>{M.key==="Enter"&&x()},w=M=>{u(M.target.value),f&&m(""),g&&_(!1)},A=M=>{const F=["image/png","image/jpeg","image/gif"],j=M.filter(X=>F.includes(X.type)&&X.size<=5242880);if(j.length!==M.length&&alert(r("inputs.common.invalidFiles")),j.length===0)return;const V=j.map(X=>new Promise(W=>{const ge=new FileReader;ge.onload=ie=>W(ie.target?.result),ge.readAsDataURL(X)}));Promise.all(V).then(X=>{const W={images:X,id:n||""};window.dispatchEvent(new CustomEvent("email-builder-upload-image",{detail:W})),ip(!0,n||"")})},L=M=>{M.preventDefault(),a(!0)},O=M=>{const F=M.currentTarget.getBoundingClientRect(),U=M.clientX,j=M.clientY;(U<F.left||U>=F.right||j<F.top||j>=F.bottom)&&a(!1)},I=M=>{M.preventDefault(),a(!1);const F=Array.from(M.dataTransfer.files);F.length>0&&A(F)},P=()=>{const M=new CustomEvent("toggle-media-library",{detail:!0});window.dispatchEvent(M)};return D.useEffect(()=>{const M=window.__emailBuilderEnableAI;M!==void 0&&o(!!M);const F=U=>{const{detail:j}=U;o(!!j)};return window.addEventListener("email-builder-ai-generation",F),()=>{window.removeEventListener("email-builder-ai-generation",F)}},[]),D.useEffect(()=>{const M=V=>{const{detail:X}=V;ip(!1,X.id||""),C({...t,props:{...t.props,url:X.url}}),p8(!1)},F=V=>{ip(V?.detail?.uploading??!1,V?.detail?.id??"")},U=()=>{b?.current?.click()},j=V=>{const{detail:X}=V;C({...t,props:{...t.props,url:X}})};return window.addEventListener("email-builder-set-image",j),window.addEventListener("email-builder-upload-image-receive",M),window.addEventListener("email-builder-upload-file",U),window.addEventListener("email-builder-toggle-upload-file",F),()=>{window.removeEventListener("email-builder-toggle-upload-file",F),window.removeEventListener("email-builder-upload-image-receive",M),window.removeEventListener("email-builder-set-image",j),window.removeEventListener("email-builder-upload-file",U)}},[t]),D.useEffect(()=>{t.props?.url&&_(T(t.props.url))},[t.props?.url]),h.jsxs(Mn,{gap:1,children:[v?h.jsx(tt,{sx:{mb:2},children:v}):h.jsx("div",{style:{display:"flex",gap:8},children:y?h.jsxs(ri,{children:[h.jsx(Wn,{label:r("inputs.image.urlLabel")}),h.jsxs(Mn,{direction:"row",spacing:1,children:[h.jsx(df,{fullWidth:!0,placeholder:r("inputs.image.urlPlaceholder"),value:c,onChange:w,onKeyPress:k,error:!!f,disabled:d,sx:{...hE,"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:f?"error.main":"#E5E5E5"},"&:hover fieldset":{borderColor:f?"error.main":"primary.main"},"&.Mui-focused fieldset":{borderColor:f?"error.main":"primary.main"}}}}),h.jsx(di,{variant:"contained",onClick:x,disabled:!c.trim()||d,sx:{minWidth:"auto",px:2,position:"relative"},children:d?h.jsx(pc,{size:20,color:"inherit"}):r("inputs.common.add")})]}),f&&h.jsx(tc,{severity:"error",sx:{mt:1,fontSize:"0.875rem","& .MuiAlert-message":{padding:"4px 0",display:"flex",flexDirection:"column",justifyContent:"space-around"}},children:f}),g&&h.jsx(tc,{severity:"warning",sx:{mt:1,marginX:"4px",fontSize:"0.875rem",top:0,"& .MuiAlert-message":{padding:"4px 0",display:"flex",flexDirection:"column",justifyContent:"space-around"}},action:h.jsx(Qt,{"aria-label":r("inputs.common.close"),color:"inherit",size:"small",onClick:()=>{_(!1)},children:h.jsx(fE,{fontSize:"inherit"})}),children:r("inputs.common.svgWarning")}),h.jsx("img",{src:t.props?.url,alt:t.props?.alt,style:{width:"70%",margin:"0.5rem auto 0 auto",objectFit:"contain",display:"block",aspectRatio:"1 / 1",height:"auto",borderRadius:"8px",border:"2px solid #E5E5E5",backgroundColor:"#fff",backgroundImage:"linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"}})]}):h.jsxs(h.Fragment,{children:[h.jsx("img",{src:t.props?.url,alt:t.props?.alt,style:{width:"50%",objectFit:"contain",aspectRatio:"1 / 1",height:"auto",borderRadius:"8px",border:"2px solid #E5E5E5",backgroundColor:"#ffffff",backgroundImage:"linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%), linear-gradient(45deg, #d0d0d0 25%, transparent 25%, transparent 75%, #d0d0d0 75%)",backgroundSize:"20px 20px",backgroundPosition:"0 0, 10px 10px"}}),h.jsxs(tt,{onDragOver:L,onDragLeave:O,onDrop:I,sx:{width:"100%",border:"2px solid",borderColor:i?"primary.main":"#E5E5E5",borderRadius:"8px",padding:4,textAlign:"center",bgcolor:i?"primary.50":"background.paper",transition:"all 0.2s ease"},children:[h.jsx(tt,{sx:{display:"flex",justifyContent:"center",mb:2},children:h.jsx(D8,{sx:{fontSize:32,color:"primary"}})}),h.jsxs("label",{style:{cursor:"pointer"},children:[h.jsx("input",{ref:b,type:"file",style:{display:"none"},accept:"image/png,image/jpeg,image/gif",multiple:!0,onChange:M=>{const F=M.target.files;F&&F.length>0&&A(Array.from(F))}}),h.jsx(er,{component:"span",sx:{fontWeight:"bold",color:"primary.main","&:hover":{fontWeight:"bold",color:"primary.secondary"}},children:r("inputs.common.uploadFile")}),h.jsxs(er,{component:"span",sx:{fontWeight:"bold",color:"text.secondary"},children:[" ",r("inputs.common.dragAndDrop")]})]}),h.jsx(er,{variant:"body2",sx:{color:"text.secondary",mt:1},children:r("inputs.common.fileInfo")})]})]})}),!v&&!y&&g&&h.jsx(tc,{severity:"warning",sx:{fontSize:"0.875rem","& .MuiAlert-message":{padding:"4px 0",display:"flex",flexDirection:"column",justifyContent:"space-around"}},children:"SVG images may not display correctly in Outlook email clients. Consider using PNG or JPG format for better compatibility."}),(!v&&(ay()&&!y||s)||v&&s)&&h.jsxs(Mn,{direction:"row",alignItems:"center",spacing:1,children:[h.jsx(yi,{sx:{flexGrow:1}}),h.jsx(er,{sx:{color:"text.secondary"},children:"or"}),h.jsx(yi,{sx:{flexGrow:1}})]}),h.jsx(h.Fragment,{children:h.jsxs(Mn,{flexDirection:"row",gap:2,children:[!v&&ay()&&!y&&h.jsx(di,{variant:"outlined",onClick:P,startIcon:h.jsx(k8,{}),sx:{color:"mainColor.main",borderColor:"mainColor.light","&:hover":{borderColor:"mainColor.main",backgroundColor:"action.hover"}},style:{width:"100%"},children:"Browse gallery"}),s&&h.jsx(V8,{src:t.props?.url,style:{width:"100%",margin:0}})]})})]})};function Ppe({data:t,setData:e}){const[,n]=D.useState(null),r=pf(),{t:i}=Ot.useTranslation("inspector"),a=c=>{const u=j8.safeParse(c);u.success?(e(u.data),n(null)):n(u.error)},s=t.props?.size??lu.size,o=t.props?.alt??lu.alt;t.props?.shape??lu.shape;const l=_o();return D.useEffect(()=>{const c=u=>{const{detail:d}=u;a({...t,props:{...t.props,alt:o}}),a({...t,props:{...t.props,imageUrl:d}})};return window.addEventListener("email-builder-set-image",c),()=>{window.removeEventListener("email-builder-set-image",c)}},[t,a]),h.jsxs(es,{title:i("inputs.panels.avatar.title"),children:[l=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(ez,{data:t,setData:c=>e({...t,props:{...t.props,imageUrl:c.props.url,alt:o}}),blockId:r}),h.jsx(ru,{label:i("inputs.panels.avatar.sizeLabel"),iconLabel:h.jsx(wue,{sx:{color:"text.secondary"}}),units:"px",step:3,min:32,max:256,defaultValue:s,onChange:c=>{a({...t,props:{...t.props,size:c}})}}),h.jsx(Lu,{label:i("inputs.panels.avatar.altLabel"),defaultValue:o,onChange:c=>{a({...t,props:{...t.props,alt:c}})}})]}),h.jsx(Ci,{names:["textAlign","backgroundColor","padding","mobilePadding"],value:t.style,onChange:c=>a({...t,style:c})})]})}const Xf=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),zM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),Lpe=t=>({top:t?.top??0,right:t?.right??0,bottom:t?.bottom??0,left:t?.left??0}),Fpe=xt({topLeft:Le().min(0).optional(),topRight:Le().min(0).optional(),bottomLeft:Le().min(0).optional(),bottomRight:Le().min(0).optional()}),GM=xt({top:Le().min(0).optional(),bottom:Le().min(0).optional(),left:Le().min(0).optional(),right:Le().min(0).optional()}),tz=xt({style:xt({backgroundColor:Xf,fontSize:Le().min(0).optional().nullable(),fontSizeMobile:Le().min(0).optional().nullable(),fontFamily:hf,background:Pt().nullable().optional(),buttonBackgroundColor:Xf,buttonTextColor:Xf,fontWeight:yr(["bold","normal"]).optional().nullable(),textAlign:yr(["left","center","right"]).optional().nullable(),textAlignMobile:yr(["left","center","right"]).optional().nullable(),padding:zM,mobilePadding:zM,shape:ap([yr(["rectangle","pill"]),Fpe]).optional().nullable()}).passthrough().optional().nullable(),props:xt({buttonBackgroundColor:Xf,buttonTextColor:Xf,fullWidth:Dp().optional().nullable(),fullWidthMobile:Dp().optional().nullable(),size:ap([yr(["x-small","small","medium"]),GM]).optional().nullable(),sizeMobile:ap([yr(["x-small","small","medium"]),GM]).optional().nullable(),text:Pt().optional().nullable(),url:Pt().optional().nullable()}).optional().nullable()}).passthrough();function HM(t){if(typeof t!="string")return t;switch(t){case"x-small":return{top:4,bottom:4,right:8,left:8};case"small":return{top:8,bottom:8,right:12,left:12};case"medium":default:return{top:12,bottom:12,left:20,right:20}}}const jl={text:"",url:"",fullWidth:!1,size:"medium",buttonBackgroundColor:"#999999"};function nz({style:t,props:e,blockId:n}){const r=pE(),i=Sr(),s=!VA(),o=e?.text??jl.text,l=e?.url??jl.url,c=i==="desktop"?e?.fullWidth??!1:e?.fullWidthMobile??e?.fullWidth??!1,u=t?.buttonTextColor??e?.buttonTextColor??r.textColor,d=t?.buttonBackgroundColor??e?.buttonBackgroundColor??jl.buttonBackgroundColor,p={backgroundColor:t?.backgroundColor??void 0,textAlign:i=="desktop"?t?.textAlign??void 0:t?.textAlignMobile??t?.textAlign,padding:Lpe(i=="desktop"?t?.padding:t?.mobilePadding??t?.padding)},f={color:u,fontSize:i=="desktop"?t?.fontSize??16:t?.fontSizeMobile??t?.fontSize??16,fontFamily:il(t?.fontFamily),fontWeight:t?.fontWeight??"bold",display:"inline-block",textDecoration:"none"},m={color:t?.borderColor??void 0,top:i=="desktop"?t?.borderTop??void 0:t?.borderTopMobile??t?.borderTop,bottom:i=="desktop"?t?.borderBottom??void 0:t?.borderBottomMobile??t?.borderBottom,left:i=="desktop"?t?.borderLeft??void 0:t?.borderLeftMobile??t?.borderLeft,right:i=="desktop"?t?.borderRight??void 0:t?.borderRightMobile??t?.borderRight},g=t?.background??"",_=t?.backgroundColor,b=_?Ju(g,_):g,y=tn(n);return h.jsx(ki,{background:b,backgroundColor:_,padding:p.padding,align:p.textAlign,width:"100%",className:`c${y}`,children:h.jsx("a",{href:JA(l),target:"_blank",className:`abtn-${y}`,onClick:s?v=>v.preventDefault():void 0,children:h.jsx(ki,{className:y,padding:i=="desktop"?HM(e?.size):HM(e?.sizeMobile??e?.size),borderRadius:gy(t),background:d,backgroundColor:d,isParent:!1,align:"center",width:c?"100%":void 0,border:m,children:h.jsx("span",{className:`btn${y}`,style:f,children:o})})})})}function Bpe({size:t,sizeMobile:e,onChange:n,label:r,maxValue:i=100,paddingSteps:a=8}){const{t:s}=Ot.useTranslation("inspector"),o=r??s("inputs.common.size"),l=Sr(),[c,u]=D.useState(()=>{const y=l==="desktop"?t:e!==void 0?e:t;return typeof y=="object"&&y!==null?y:{top:8,bottom:8,left:16,right:16}}),[d,p]=D.useState(!1);D.useEffect(()=>{const y=l==="desktop"?t:e!==void 0?e:t;typeof y=="object"&&y!==null&&u(y)},[t,e,l]);const f=()=>{const y=l==="desktop"?t:e!==void 0?e:t;return typeof y=="object"&&y!==null?"custom":y},m=y=>{if(l==="desktop"){const v={size:y==="custom"?c:y};e==null&&(v.sizeMobile=y==="custom"?c:y),n(v)}else n({sizeMobile:y==="custom"?c:y})},g=(y,v)=>{let E;d?E={top:v,bottom:v,left:v,right:v}:E={...c,[y]:v},u(E),n(l==="desktop"?{size:E}:{sizeMobile:E})},_=()=>{if(!d){const v={top:16,bottom:16,left:16,right:16};u(v),n(l==="desktop"?{size:v}:{sizeMobile:v})}p(!d)},b=f();return h.jsxs(Mn,{spacing:2,children:[h.jsxs(kc,{label:o,defaultValue:b,onChange:m,children:[h.jsx(En,{value:"x-small",children:s("inputs.responsiveSize.options.xSmall")}),h.jsx(En,{value:"small",children:s("inputs.responsiveSize.options.small")}),h.jsx(En,{value:"medium",children:s("inputs.responsiveSize.options.medium")}),h.jsx(En,{value:"custom",children:s("inputs.responsiveSize.options.custom")})]}),b==="custom"&&h.jsxs(Mn,{spacing:2,alignItems:"flexStart",pb:1,children:[h.jsxs(Mn,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",children:[h.jsx(Wn,{label:s("inputs.responsiveSize.customPadding")}),h.jsx(Ut,{title:s(d?"inputs.responsiveSize.unlockTooltip":"inputs.responsiveSize.lockTooltip"),children:h.jsx(Qt,{size:"small",onClick:_,sx:{marginTop:"0!important",color:d?"primary.main":"text.secondary","&:hover":{backgroundColor:"action.hover"}},children:d?h.jsx(Eg,{fontSize:"small"}):h.jsx(Sg,{fontSize:"small"})})})]}),d?h.jsx(vr,{iconLabel:s("inputs.responsiveSize.allSides"),value:c.top,setValue:y=>g("top",y),units:"px",min:0,step:a,marks:a>1,max:i}):h.jsxs(h.Fragment,{children:[h.jsx(vr,{iconLabel:h.jsx(_8,{sx:{fontSize:16}}),value:c.top,setValue:y=>g("top",y),units:"px",min:0,step:a,marks:a>1,max:i}),h.jsx(vr,{iconLabel:h.jsx(g8,{sx:{fontSize:16}}),value:c.bottom,setValue:y=>g("bottom",y),units:"px",min:0,step:a,marks:a>1,max:i}),h.jsx(vr,{iconLabel:h.jsx(m8,{sx:{fontSize:16}}),value:c.left,setValue:y=>g("left",y),units:"px",min:0,step:a,marks:a>1,max:i}),h.jsx(vr,{iconLabel:h.jsx(h8,{sx:{fontSize:16}}),value:c.right,setValue:y=>g("right",y),units:"px",min:0,step:a,marks:a>1,max:i})]})]})]})}function $pe({fullWidth:t,fullWidthMobile:e,onChange:n,label:r="Width"}){const i=Sr(),{t:a}=Ot.useTranslation("inspector"),s=()=>i==="desktop"?t:e!==void 0?e:t,o=c=>{const u=c==="FULL_WIDTH";if(i==="desktop"){const d={fullWidth:u};e==null&&(d.fullWidthMobile=u),n(d)}else n({fullWidthMobile:u})},l=s();return h.jsxs(kc,{label:r,defaultValue:l?"FULL_WIDTH":"AUTO",onChange:o,children:[h.jsx(En,{value:"FULL_WIDTH",children:a("inputs.width.full")}),h.jsx(En,{value:"AUTO",children:a("inputs.width.auto")})]})}function Upe({data:t,setData:e}){const[,n]=D.useState(null),r=pE(),{t:i}=Ot.useTranslation("inspector"),a=g=>{const _=tz.safeParse(g);_.success?(e(_.data),n(null)):n(_.error)},s=t.props?.text??jl.text,o=t.props?.url??jl.url,l=t.props?.fullWidth??jl.fullWidth,c=t.props?.size??jl.size,u=t.style?.buttonTextColor??t.props?.buttonTextColor??r.textColor,d=t.style?.buttonBackgroundColor??t.props?.buttonBackgroundColor??jl.buttonBackgroundColor,p=t.props?.fullWidthMobile,f=t.props?.sizeMobile,m=_o();return h.jsxs(es,{title:i("inputs.panels.button.title"),children:[m=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(Ci,{disabledCSSValidation:!0,names:["fontFamily","fontSize","fontSizeMobile","fontWeight"],value:t.style,onChange:g=>a({...t,style:g})}),h.jsx(Lu,{label:i("inputs.panels.button.textLabel"),defaultValue:s,onChange:g=>a({...t,props:{...t.props,text:g}})}),h.jsx(Lu,{label:i("inputs.panels.button.targetLabel"),placeholder:i("inputs.panels.button.targetPlaceholder"),defaultValue:o,onChange:g=>a({...t,props:{...t.props,url:g}})}),h.jsx($pe,{label:i("properties.width"),fullWidth:l,fullWidthMobile:p,onChange:g=>a({...t,props:{...t.props,...g}})}),h.jsx(Bpe,{size:c,sizeMobile:f,onChange:g=>a({...t,props:{...t.props,...g}})})]}),h.jsx(Ci,{names:["shape","textAlign","textAlignMobile","backgroundColor","border","borderMobile","padding","mobilePadding"],value:t.style,shapeMaxValue:80,onChange:g=>a({...t,style:g})}),m==="css"&&h.jsxs(h.Fragment,{children:[h.jsx(yu,{label:i("inputs.panels.button.textColor"),defaultValue:u,onChange:g=>a({...t,style:{...t.style,buttonTextColor:g}})}),h.jsx(yu,{label:i("inputs.panels.button.buttonColor"),defaultValue:d,onChange:g=>a({...t,style:{...t.style,buttonBackgroundColor:g}})})]})]})}const zpe=H8([Le().nullish(),Le().nullish(),Le().nullish()]).optional().nullable(),rz=xt({style:xt({background:Pt().nullable().optional(),backgroundColor:Pt().nullable().optional(),padding:_y,mobilePadding:_y}).optional().nullable(),props:xt({fixedWidths:zpe,columnsCount:ap([sw(2),sw(3)]).optional().nullable(),layout:Pt().optional().nullable(),contentAlignment:yr(["top","middle","bottom"]).optional().nullable(),contentAlignmentMobile:yr(["top","middle","bottom"]).optional().nullable()}).optional().nullable()}).passthrough(),Gpe={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},Km={columnsCount:2,contentAlignment:"middle"};function dw({style:t,columns:e,props:n,blockId:r}){const i=Sr(),a=dE(),s={padding:Cg(i=="desktop"?t?.padding:t?.mobilePadding??t?.padding)},o={columnsCount:n?.columnsCount??Km.columnsCount,contentAlignment:i=="desktop"?n?.contentAlignment??Km.contentAlignment:n?.contentAlignmentMobile??n?.contentAlignment??Km.contentAlignment,fixedWidths:n?.fixedWidths,blockId:r},l=t?.background??"",c=t?.backgroundColor,u=c?Ju(l,c):l,d=tn(r);return h.jsxs(ki,{background:u,backgroundColor:c,className:`${d}`,padding:s.padding,width:"100%",children:[a.uploading&&a.id===r?h.jsx("div",{style:Gpe,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}):h.jsx(h.Fragment,{}),h.jsx("table",{border:0,cellSpacing:"0",cellPadding:"0",style:{width:"100%"},children:h.jsx("tbody",{style:{width:"100%"},children:h.jsxs("tr",{style:{width:"100%"},children:[h.jsx(n1,{index:0,props:o,columns:e}),h.jsx(n1,{index:1,props:o,columns:e}),h.jsx(n1,{index:2,props:o,columns:e})]})})})]})}function n1({index:t,props:e,columns:n}){const r=e?.contentAlignment??Km.contentAlignment;if((e?.columnsCount??Km.columnsCount)===2&&t===2)return null;const a={boxSizing:"border-box",verticalAlign:r,width:`${e.fixedWidths?.[t]}%`??void 0},s=(n&&n[t])??null,o=e.blockId?tn(e.blockId):"";return h.jsx("td",{className:`col${o}`,style:a,children:s})}const Hpe=rz.shape.props.unwrap().unwrap().shape,t2=xt({style:rz.shape.style,props:xt({...Hpe,columns:H8([xt({childrenIds:Wm(Pt())}),xt({childrenIds:Wm(Pt())}),xt({childrenIds:Wm(Pt())})])}).optional().nullable()}).passthrough(),jpe=(t,e,n)=>{if(!t||!document)return;const r=tn(t),i=document.querySelector(`.${r}`);if(!i)return;const a=i.parentElement;if(!a)return;const s=Math.ceil(a.getBoundingClientRect().width);n.props?.touched||n.props?.width!==s&&e({...n,props:{...n.props,width:s}})},qpe=t=>{if(!t||!document)return;const e=tn(t),n=document.querySelector(`.${e}`);if(!n)return;const r=n.parentElement;if(!r)return;const i=Math.ceil(r.getBoundingClientRect().width);return i||null},Vpe={desktop:"contentAlignment",mobile:"contentAlignmentMobile"};function Wpe({data:t,updateData:e}){const{t:n}=Ot.useTranslation("inspector"),r=Sr(),i=Vpe[r]||"contentAlignment",a=t.props?.[i]??t.props?.contentAlignment,s=o=>{e({...t,props:{...t.props,[i]:o}})};return h.jsxs(kc,{label:n("inputs.alignment.label"),defaultValue:a,onChange:s,children:[h.jsx(En,{value:"top",children:h.jsx(gde,{fontSize:"small"})}),h.jsx(En,{value:"middle",children:h.jsx(hde,{fontSize:"small"})}),h.jsx(En,{value:"bottom",children:h.jsx(mde,{fontSize:"small"})})]})}const Zf={grid:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(100px, 1fr))",gap:"16px",width:"100%"},card:{cursor:"pointer",border:"1px solid #e5e7eb",borderRadius:"8px",backgroundColor:"primary"},cardContent:{padding:"8px"},layoutPreview:{display:"flex",gap:"4px",height:"30px",width:"100%",justifyContent:"space-between"}},Ype=({defaultValue:t,onChange:e,columns:n})=>{const{t:r}=Ot.useTranslation("inspector"),[i,a]=D.useState(t||"layout-50-50"),s=dr();D.useEffect(()=>{i!==t&&a(t==="layout-33-34-33"?"layout-33-33-33":t)},[t]);const o=[{id:"layout-50-50",distribution:[50,50,null]},{id:"layout-55-45",distribution:[55,45,null]},{id:"layout-45-55",distribution:[45,55,null]},{id:"layout-60-40",distribution:[60,40,null]},{id:"layout-40-60",distribution:[40,60,null]},{id:"layout-70-30",distribution:[70,30,null]},{id:"layout-30-70",distribution:[30,70,null]},{id:"layout-75-25",distribution:[75,25,null]},{id:"layout-25-75",distribution:[25,75,null]},{id:"layout-80-20",distribution:[80,20,null]},{id:"layout-20-80",distribution:[20,80,null]}],l=[{id:"layout-33-33-33",distribution:[33.34,33.33,33.33]},{id:"layout-30-40-30",distribution:[30,40,30]},{id:"layout-25-50-25",distribution:[25,50,25]},{id:"layout-20-60-20",distribution:[20,60,20]},{id:"layout-50-25-25",distribution:[50,25,25]},{id:"layout-25-25-50",distribution:[25,25,50]},{id:"layout-60-20-20",distribution:[60,20,20]},{id:"layout-20-20-60",distribution:[20,20,60]},{id:"layout-40-30-30",distribution:[40,30,30]},{id:"layout-30-30-40",distribution:[30,30,40]},{id:"layout-40-20-40",distribution:[40,20,40]}],[c,u]=D.useState(l),d=(p,f)=>{a(p),e({layout:p,fixedWidths:f})};return D.useEffect(()=>{if(n===2)u(o),o.findIndex(p=>p.id==t)===-1&&d("layout-50-50",[50,50,null]);else{if(u(l),t==="layout-33-34-33"){d("layout-33-33-33",[33.34,33.33,33.33]);return}l.findIndex(p=>p.id==t)===-1&&d("layout-33-33-33",[33.34,33.33,33.33])}},[n]),D.useEffect(()=>{t==="layout-33-34-33"&&d("layout-33-33-33",[33.34,33.33,33.33])},[t]),h.jsxs(ri,{children:[h.jsx(Wn,{label:r("inputs.layout.label")}),h.jsx("div",{style:Zf.grid,children:c.map((p,f)=>h.jsx("div",{onClick:()=>d(p.id,p.distribution),style:{...Zf.card,gridColumn:f===0?"span 2":void 0,border:i===p.id?`2px solid ${s.palette.secondary.main}`:Zf.card.border},children:h.jsx("div",{style:Zf.cardContent,children:h.jsx("div",{style:Zf.layoutPreview,children:p.distribution.map((m,g)=>h.jsx("div",{style:{width:`${m}%`,backgroundColor:i===p.id?s.palette.secondary.main:"#e5e7eb",borderRadius:"4px",transition:"background-color 0.2s ease",display:"grid",placeItems:"center",fontSize:"12px",color:i===p.id?"white":"black"}},g))})})},p.id))})]})};function Kpe({data:t,setData:e}){const[,n]=D.useState(null),[r,i]=D.useState(t.props?.columnsCount??2),a=_o(),s=Sr(),{t:o}=Ot.useTranslation("inspector"),l=f=>{const m=ue.getState().document,g=f.filter(_=>m[_]?.type==="Image");s==="desktop"&&g.map(_=>jpe(_,e,m[_].data))},c=f=>{const m=t2.safeParse(f);m.success?(m.data.props.columns.map(g=>l(g.childrenIds)),e(m.data),r&&m.data.props?.columnsCount!==r&&i(m.data.props?.columnsCount??2),n(null)):(console.error("Error on columns: ",m.error),n(m.error))},u={layout:"layout-50-50",fixedWidths:[50,50,null],columnsCount:2},d={layout:"layout-33-34-33",fixedWidths:[33,34,33],columnsCount:3},p=f=>{const m=t.props.columns.length===2?[...t.props.columns,{childrenIds:[]}]:[...t.props.columns];return f==="2"?{...u,columns:m}:{...d,columns:m}};return h.jsxs(es,{title:o("inputs.panels.columns.title"),children:[a=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsxs(kc,{label:o("inputs.panels.columns.countLabel"),defaultValue:t.props?.columnsCount===2?"2":"3",onChange:f=>{const m=p(f);c({...t,props:{...t.props,...m}})},children:[h.jsx(En,{style:{fontWeight:"bold"},value:"2",children:"2"}),h.jsx(En,{style:{fontWeight:"bold"},value:"3",children:"3"})]}),h.jsx(Ype,{columns:t.props?.columnsCount??3,defaultValue:t.props?.layout,onChange:({layout:f,fixedWidths:m})=>{const g=t.props.columns.length===2?[...t.props.columns,{childrenIds:[]}]:t.props.columns;c({...t,props:{...t.props,layout:f,fixedWidths:m,columns:g}})}})]}),a=="css"&&h.jsxs(h.Fragment,{children:[h.jsx(Wpe,{data:t,updateData:e}),h.jsx(Ci,{names:["backgroundColor","background","padding","mobilePadding"],value:t.style,onChange:f=>c({...t,style:f})})]})]})}const jM=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),qM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),Qpe=xt({topLeft:Le().min(0).optional(),topRight:Le().min(0).optional(),bottomLeft:Le().min(0).optional(),bottomRight:Le().min(0).optional()}),VM={position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"},Xpe=xt({style:xt({backgroundColor:jM,background:Pt().nullable().optional(),borderColor:jM,borderRadius:Le().optional().nullable(),borderTop:Le().optional().nullable(),borderBottom:Le().optional().nullable(),borderLeft:Le().optional().nullable(),borderRight:Le().optional().nullable(),borderTopMobile:Le().optional().nullable(),borderBottomMobile:Le().optional().nullable(),borderLeftMobile:Le().optional().nullable(),borderRightMobile:Le().optional().nullable(),shape:ap([yr(["rectangle","pill"]),Qpe]).optional().nullable(),padding:qM,mobilePadding:qM}).optional().nullable()}).passthrough();function iz({style:t,children:e,blockId:n}){const r=Sr(),i=dE(),a={border:{color:t?.borderColor??void 0,top:r=="desktop"?t?.borderTop??void 0:t?.borderTopMobile??t?.borderTop,bottom:r=="desktop"?t?.borderBottom??void 0:t?.borderBottomMobile??t?.borderBottom,left:r=="desktop"?t?.borderLeft??void 0:t?.borderLeftMobile??t?.borderLeft,right:r=="desktop"?t?.borderRight??void 0:t?.borderRightMobile??t?.borderRight},padding:Cg(r=="desktop"?t?.padding:t?.mobilePadding??t?.padding)},s=t?.background??"",o=t?.backgroundColor,l=o?Ju(s,o):s,c=tn(n);return e?h.jsx(ki,{className:`${c}`,background:l,backgroundColor:t?.backgroundColor,borderRadius:gy(t),padding:a.padding,width:"100%",border:a.border,children:h.jsxs(h.Fragment,{children:[i.uploading&&i.id===n&&h.jsx("div",{style:VM,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}),e]})}):h.jsx(ki,{className:`${c}`,background:l,backgroundColor:o,borderRadius:gy(t),padding:a.padding,width:"100%",border:a.border,children:h.jsx("div",{children:i.uploading&&i.id===n&&h.jsx("div",{style:VM,children:h.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-circle",style:{width:"32px",height:"32px",animation:"1s linear infinite spin",stroke:"currentColor"},children:h.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})})})}const az=xt({style:Xpe.shape.style,props:xt({childrenIds:Wm(Pt()).optional().nullable()}).optional().nullable()}).passthrough();function sz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=a=>{const s=az.safeParse(a);s.success?(e(s.data),n(null)):n(s.error)};return h.jsx(es,{title:r("inputs.panels.container.title"),children:h.jsx(Ci,{names:["backgroundColor","background","border","borderMobile","shape","padding","mobilePadding"],value:t.style,shapeSteps:30,onChange:a=>i({...t,style:a})})})}const Zpe=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),WM=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),oz=xt({style:xt({background:Pt().nullable().optional(),backgroundColor:Zpe,padding:WM,mobilePadding:WM,height:Le().optional().nullable(),heightMobile:Le().optional().nullable(),color:Pt().optional().nullable(),width:Le().optional().nullable(),widthMobile:Le().optional().nullable(),textAlign:Pt().optional().nullable(),textAlignMobile:Pt().optional().nullable()}).passthrough().optional().nullable()}).passthrough(),qc={height:1,color:"#333333",width:100,textAlign:"left"};function lz({style:t,blockId:e}){const n=Sr(),r=Cg(n==="desktop"?t?.padding:t?.mobilePadding??t?.padding),i=n==="desktop"?t?.height??qc.height:t?.heightMobile??t?.height??qc.height,a=t?.color??qc.color,s=n==="desktop"?(t?.width??qc.width)+"%":(t?.widthMobile??t?.width??qc.width)+"%",o=n==="desktop"?t?.textAlign??qc.textAlign:t?.textAlignMobile??t?.textAlign??qc.textAlign,l=t?.background??"",c=t?.backgroundColor??"",u=c?Ju(l,c):l,d=tn(e);return h.jsx(ki,{className:`c${d}`,background:u,backgroundColor:c,width:"100%",padding:r,align:o,children:h.jsx(ki,{display:"inline-block",className:`${d}`,background:a,backgroundColor:c,width:s,padding:{top:i,bottom:0,left:0,right:0},isParent:!1,children:h.jsx("div",{})})})}function cz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=a=>{const s=oz.safeParse(a);s.success?(e(s.data),n(null)):n(s.error)};return h.jsx(es,{title:r("inputs.panels.divider.title"),children:h.jsx(Ci,{names:["width","widthMobile","height","heightMobile","color","backgroundColor","textAlign","textAlignMobile","padding","mobilePadding"],value:t.style,onChange:a=>i({...t,style:a})})})}const Jf=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),uz=xt({backdropColor:Jf,borderColor:Jf,borderRadius:Le().optional().nullable(),canvasColor:Jf,textColor:Jf,fontFamily:hf,childrenIds:Wm(Pt()).optional().nullable(),linkGlobal:xt({linkColor:Jf,underline:Dp()}).optional().nullable(),showVersion:Dp().optional().nullable()}),Jpe=({label:t,linkColor:e,underline:n=!1,onChange:r})=>{const[i,a]=D.useState(e??"#FF0000"),[s,o]=D.useState(n),l=dr(),{t:c}=Ot.useTranslation("inspector"),u=t??c("inputs.links.color"),d=s?"enabled":"disabled",p={container:{width:"100%"},toggleGroup:{width:"100%",backgroundColor:l.palette.background.paper,padding:"4px",borderRadius:"8px"},toggleButton:{flex:1,padding:"6px 16px",textTransform:"none",fontSize:"14px",color:l.palette.text.primary,"&.Mui-selected":{backgroundColor:l.palette.grey[200],color:l.palette.text.primary,"&:hover":{backgroundColor:l.palette.grey[300]}},"&:hover":{backgroundColor:l.palette.grey[100]}}};D.useEffect(()=>{e!==i&&a(e??"#FF0000")},[e]),D.useEffect(()=>{n!==s&&o(n)},[n]);const f=g=>{const _=g??"#FF0000";a(_),r({linkColor:_,underline:s})},m=(g,_)=>{if(!_)return;const b=_==="enabled";o(b),r({linkColor:i,underline:b})};return h.jsxs(ri,{children:[h.jsx(yu,{label:u,defaultValue:i,onChange:f}),h.jsx(Wn,{label:c("inputs.links.underline")}),h.jsx(tt,{sx:p.container,children:h.jsxs(hg,{value:d,exclusive:!0,onChange:m,sx:p.toggleGroup,children:[h.jsx(En,{value:"enabled",sx:p.toggleButton,children:h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:c("inputs.links.underlineOn"),children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 40 40",role:"img","aria-label":"aiia subrayado",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("title",{children:"aiia subrayado"}),h.jsx("rect",{width:"20",height:"20",fill:"none"}),h.jsx("text",{x:"50%",y:"26",textAnchor:"middle",fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif",fontSize:"24",fill:"currentColor",children:"aiia"}),h.jsx("line",{x1:"6",y1:"31",x2:"34",y2:"31",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})})}),h.jsx(En,{value:"disabled",sx:p.toggleButton,children:h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:c("inputs.links.underlineOff"),children:h.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 40 40",role:"img","aria-label":"aiia",xmlns:"http://www.w3.org/2000/svg",children:[h.jsx("title",{children:"aiia"}),h.jsx("rect",{width:"20",height:"20",fill:"none"}),h.jsx("text",{x:"50%",y:"26",textAnchor:"middle",fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif",fontSize:"24",fill:"currentColor",children:"aiia"})]})})})]})})]})},efe="email-builder-online",tfe="3.4.70",r1={name:efe,version:tfe};function dz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=_ue(),a=s=>{const o=uz.safeParse(s);o.success?(e(o.data),n(null)):n(o.error)};return h.jsxs(es,{title:r("inputs.panels.emailLayout.title"),children:[h.jsx(yu,{label:r("inputs.panels.emailLayout.backgroundColor"),defaultValue:t.backdropColor??"#F5F5F5",onChange:s=>a({...t,backdropColor:s})}),h.jsx(yu,{label:r("inputs.panels.emailLayout.canvasColor"),defaultValue:t.canvasColor??"#FFFFFF",onChange:s=>a({...t,canvasColor:s})}),h.jsx(Z8,{label:r("inputs.panels.emailLayout.fontFamily"),defaultValue:t.fontFamily||kpe.FAMILY,onChange:s=>a({...t,fontFamily:s})}),h.jsx(yu,{label:r("inputs.panels.emailLayout.textColor"),defaultValue:t.textColor??"#262626",onChange:s=>a({...t,textColor:s})}),h.jsx(Jpe,{label:r("inputs.panels.emailLayout.linksLabel"),linkColor:t.linkGlobal?.linkColor||"#000000",underline:t.linkGlobal?.underline||!1,onChange:s=>a({...t,linkGlobal:s})}),i&&h.jsx(tt,{color:"text.secondary",sx:{display:"flex",justifyContent:"flex-end",mt:2},children:h.jsxs(tt,{sx:{textAlign:"right"},children:[h.jsxs(er,{variant:"body2",children:[r("inputs.panels.emailLayout.version"),": ",r1.version]}),h.jsx(jae,{href:`https://www.npmjs.com/package/${r1.name}`,target:"_blank",rel:"noopener noreferrer",sx:{fontSize:"0.875rem",mt:.5,display:"inline-block"},children:r1.name})]})})]})}const YM=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),nfe=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),rfe=t=>t?`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`:void 0,pz=xt({props:xt({text:Pt().optional().nullable(),level:yr(["h1","h2","h3"]).optional().nullable()}).optional().nullable(),style:xt({color:YM,backgroundColor:YM,fontFamily:hf,fontWeight:yr(["bold","normal"]).optional().nullable(),textAlign:yr(["left","center","right"]).optional().nullable(),padding:nfe}).optional().nullable()}),by={level:"h2",text:""};function fz({props:t,style:e}){const n=t?.level??by.level,r=t?.text??by.text,i={color:e?.color??void 0,backgroundColor:e?.backgroundColor??void 0,fontWeight:e?.fontWeight??"bold",textAlign:e?.textAlign??void 0,margin:0,fontFamily:il(e?.fontFamily),fontSize:ife(n),padding:rfe(e?.padding)};switch(n){case"h1":return h.jsx("h1",{style:i,children:r});case"h2":return h.jsx("h2",{style:i,children:r});case"h3":return h.jsx("h3",{style:i,children:r})}}function ife(t){switch(t){case"h1":return 32;case"h2":return 24;case"h3":return 20}}function afe({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=s=>{const o=pz.safeParse(s);o.success?(e(o.data),n(null)):n(o.error)},a=_o();return h.jsxs(es,{title:r("inputs.panels.heading.title"),children:[a=="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(Lu,{label:r("inputs.panels.heading.contentLabel"),rows:3,defaultValue:t.props?.text??by.text,onChange:s=>{i({...t,props:{...t.props,text:s}})}}),h.jsxs(kc,{label:r("inputs.panels.heading.levelLabel"),defaultValue:t.props?.level??by.level,onChange:s=>{i({...t,props:{...t.props,level:s}})},children:[h.jsx(En,{value:"h1",children:"H1"}),h.jsx(En,{value:"h2",children:"H2"}),h.jsx(En,{value:"h3",children:"H3"})]})]}),h.jsx(Ci,{names:["color","backgroundColor","fontFamily","fontWeight","textAlign","padding","mobilePadding"],value:t.style,onChange:s=>i({...t,style:s})})]})}const KM=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),sfe=xt({top:Le(),bottom:Le(),right:Le(),left:Le()}).optional().nullable(),ofe=t=>t?`${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`:void 0,mz=xt({style:xt({color:KM,backgroundColor:KM,fontFamily:hf,fontSize:Le().min(0).optional().nullable(),textAlign:yr(["left","right","center"]).optional().nullable(),padding:sfe}).optional().nullable(),props:xt({contents:Pt().optional().nullable()}).optional().nullable()});function hz({style:t,props:e}){const n=e?.contents,r={color:t?.color??void 0,backgroundColor:t?.backgroundColor??void 0,fontFamily:il(t?.fontFamily),fontSize:t?.fontSize??void 0,textAlign:t?.textAlign??void 0,padding:ofe(t?.padding)};return n?h.jsx("div",{style:r,dangerouslySetInnerHTML:{__html:n}}):h.jsx("div",{style:r})}function lfe({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=s=>{const o=mz.safeParse(s);o.success?(e(o.data),n(null)):n(o.error)},a=_o();return h.jsxs(es,{title:r("inputs.panels.html.title"),children:[a=="block-configuration"&&h.jsx(h.Fragment,{children:h.jsx(Lu,{label:r("inputs.panels.html.contentLabel"),rows:5,defaultValue:t.props?.contents??"",onChange:s=>i({...t,props:{...t.props,contents:s}})})}),h.jsx(Ci,{names:["color","backgroundColor","fontFamily","fontSize","textAlign","padding","mobilePadding"],value:t.style,onChange:s=>i({...t,style:s})})]})}const cfe=(t,e,n)=>{const r=Sr();D.useEffect(()=>{const i=()=>{if(!t||!document||r=="mobile")return;const o=tn(t),l=document.querySelector(`.${o}`);if(!l)return;const c=l.parentElement;if(!c)return;const u=Math.ceil(c.getBoundingClientRect().width);n.props?.size===void 0||n.props?.size==="original"||n.props?.touched&&n.props?.width<=u||n.props?.width!==u&&!n.props?.touched&&e({...n,props:{...n.props,width:u}})};i();const a=new ResizeObserver(i),s=document.querySelector(`.${tn(t)}`);return s?.parentElement&&a.observe(s.parentElement),()=>{a.disconnect()}},[t,e,n,r])},ufe=({defaultValue:t="original",scale:e=100,onChange:n})=>{const[r,i]=D.useState(t),[a,s]=D.useState(e);Sr();const o=dr(),{t:l}=Ot.useTranslation("inspector"),c={container:{width:"100%"},label:{color:o.palette.text.primary},toggleGroup:{width:"100%",backgroundColor:o.palette.background.paper,padding:"4px",borderRadius:"8px"},toggleButton:{flex:1,padding:"6px 16px",textTransform:"none",fontSize:"14px",color:o.palette.text.primary,"&.Mui-selected":{backgroundColor:o.palette.grey[200],color:o.palette.text.primary,"&:hover":{backgroundColor:o.palette.grey[300]}},"&:hover":{backgroundColor:o.palette.grey[100]}},sliderContainer:{marginTop:"16px",padding:"0 8px"},slider:{"& .MuiSlider-thumb":{backgroundColor:o.palette.primary.main,"&:hover":{boxShadow:`0 0 0 8px ${o.palette.primary.main}20`}},"& .MuiSlider-rail":{backgroundColor:o.palette.grey[300]},"& .MuiSlider-track":{backgroundColor:o.palette.primary.main}},scaleValue:{color:o.palette.text.secondary}};D.useEffect(()=>{(t!==r||e!==a)&&(t!==r&&i(t),t==="scale"&&s(e))},[t,e]);const u=(p,f)=>{f!==null&&(i(f),n&&n({mode:f,scale:f==="scale"?a:void 0}))},d=p=>{s(p),n&&n({mode:r,scale:p})};return h.jsxs(ri,{children:[h.jsx(Wn,{label:l("inputs.sizeSelector.label")}),h.jsxs(tt,{sx:c.container,children:[h.jsxs(hg,{value:r,exclusive:!0,onChange:u,sx:c.toggleGroup,children:[h.jsx(En,{value:"original",sx:c.toggleButton,children:l("inputs.sizeSelector.contain")}),h.jsx(En,{value:"fill",sx:c.toggleButton,children:l("inputs.sizeSelector.cover")}),h.jsx(En,{value:"scale",sx:c.toggleButton,children:l("inputs.sizeSelector.scale")})]}),h.jsx(EU,{in:r==="scale",children:h.jsx(tt,{sx:c.sliderContainer,children:h.jsx(vr,{iconLabel:h.jsx(_de,{}),value:a,setValue:d,marks:!1,units:"%",min:1,max:100})})})]})]})};function dfe({data:t,setData:e}){const[n,r]=D.useState(null),i=pf(),a=_o(),s=Sr(),{t:o}=Ot.useTranslation("inspector");cfe(i||"",e,t),D.useEffect(()=>{i&&window.dispatchEvent(new CustomEvent("email-builder-image-panel-opened",{detail:{blockId:i,currentImageUrl:t.props?.url||null,alt:t.props?.alt||null}}))},[i,t.props?.url,t.props?.alt]);const l=D.useCallback(g=>{const _=e2.safeParse(g);_.success?JSON.stringify(t)!==JSON.stringify(_.data)&&(e(_.data),r(null)):r(_.error)},[t,e]),c=D.useCallback((g,_,b)=>{const y=qpe(i)||Kd,v={...g.props};if(b&&(v.touchedMobile=!0),_.mode==="original"){const E=g.props?.original_width??null;return b?{...v,sizeMobile:_.mode,widthMobile:E}:{...v,size:_.mode,width:E,sizeMobile:v.touchedMobile?v.sizeMobile:_.mode,widthMobile:v.touchedMobile?v.widthMobile:E}}if(_.mode==="fill")return b?{...v,sizeMobile:_.mode,widthMobile:null}:{...v,size:_.mode,width:null,sizeMobile:v.touchedMobile?v.sizeMobile:_.mode,widthMobile:v.touchedMobile?v.widthMobile:null};if(_.mode==="scale"){const E=Math.ceil(y/100*_.scale);return b?{...v,sizeMobile:_.mode,scaleMobile:_.scale,widthMobile:E}:{...v,size:_.mode,scale:_.scale,width:E,sizeMobile:v.touchedMobile?v.sizeMobile:_.mode,scaleMobile:v.touchedMobile?v.scaleMobile:_.scale,widthMobile:v.touchedMobile?v.widthMobile:E}}return v},[i]),u=D.useCallback((g,_)=>{const b=c(t,g,_);l({...t,props:b})},[t,l,c]),d=D.useMemo(()=>s!=="desktop"?{size:t.props?.touchedMobile?t.props?.sizeMobile:t.props?.size??"original",scale:t.props?.touchedMobile?t.props?.scaleMobile:t.props?.scale}:{size:t.props?.size??"original",scale:t.props?.scale},[s,t.props?.touchedMobile,t.props?.sizeMobile,t.props?.size,t.props?.scaleMobile,t.props?.scale]),p=D.useCallback(g=>{l({...t,props:{...t.props,alt:g}})},[t,l]),f=D.useCallback(g=>{const _=g.trim().length===0?null:g.trim();l({...t,props:{...t.props,linkHref:_}})},[t,l]),m=D.useCallback(g=>{l({...t,style:g})},[t,l]);return h.jsxs(es,{title:o("inputs.panels.image.title"),children:[a==="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsx(ez,{data:t,setData:e,blockId:i}),h.jsx(Lu,{label:o("inputs.panels.image.altLabel"),placeholder:o("inputs.panels.image.altPlaceholder"),defaultValue:t.props?.alt??"",onChange:p}),h.jsx(Lu,{label:o("inputs.panels.image.urlLabel"),placeholder:o("inputs.panels.image.urlPlaceholder"),defaultValue:t.props?.linkHref??"",onChange:f}),h.jsx(ufe,{defaultValue:d.size,scale:d.scale??void 0,onChange:g=>u(g,s!=="desktop")})]}),h.jsx(Ci,{names:["textAlign","textAlignMobile","backgroundColor","shape","padding","mobilePadding"],value:t.style,shapeMaxValue:300,shapeSteps:20,onChange:m})]})}var vn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const s of i)a[s]=s;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),s={};for(const o of a)s[o]=i[o];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&a.push(s);return a},t.find=(i,a)=>{for(const s of i)if(a(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(vn||(vn={}));var QM;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(QM||(QM={}));const Ze=vn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$l=t=>{switch(typeof t){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return Number.isNaN(t)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(t)?Ze.array:t===null?Ze.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Ze.promise:typeof Map<"u"&&t instanceof Map?Ze.map:typeof Set<"u"&&t instanceof Set?Ze.set:typeof Date<"u"&&t instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}},ke=vn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class al extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let o=r,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof al))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,vn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}al.create=t=>new al(t);const pw=(t,e)=>{let n;switch(t.code){case ke.invalid_type:t.received===Ze.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ke.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,vn.jsonStringifyReplacer)}`;break;case ke.unrecognized_keys:n=`Unrecognized key(s) in object: ${vn.joinValues(t.keys,", ")}`;break;case ke.invalid_union:n="Invalid input";break;case ke.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${vn.joinValues(t.options)}`;break;case ke.invalid_enum_value:n=`Invalid enum value. Expected ${vn.joinValues(t.options)}, received '${t.received}'`;break;case ke.invalid_arguments:n="Invalid function arguments";break;case ke.invalid_return_type:n="Invalid function return type";break;case ke.invalid_date:n="Invalid date";break;case ke.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:vn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ke.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ke.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ke.custom:n="Invalid input";break;case ke.invalid_intersection_types:n="Intersection results could not be merged";break;case ke.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ke.not_finite:n="Number must be finite";break;default:n=e.defaultError,vn.assertNever(t)}return{message:n}};let pfe=pw;function ffe(){return pfe}const mfe=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],s={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(s,{data:e,defaultError:o}).message;return{...i,path:a,message:o}};function He(t,e){const n=ffe(),r=mfe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===pw?void 0:pw].filter(i=>!!i)});t.common.issues.push(r)}class pa{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Mt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,s=await i.value;r.push({key:a,value:s})}return pa.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:s}=i;if(a.status==="aborted"||s.status==="aborted")return Mt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}}const Mt=Object.freeze({status:"aborted"}),ym=t=>({status:"dirty",value:t}),ts=t=>({status:"valid",value:t}),XM=t=>t.status==="aborted",ZM=t=>t.status==="dirty",Ap=t=>t.status==="valid",yy=t=>typeof Promise<"u"&&t instanceof Promise;var et;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(et||(et={}));class hc{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const JM=(t,e)=>{if(Ap(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new al(t.common.issues);return this._error=n,this._error}}};function Xt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,o)=>{const{message:l}=t;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??r??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??n??o.defaultError}},description:i}}class hn{get description(){return this._def.description}_getType(e){return $l(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:$l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pa,ctx:{common:e.parent.common,data:e.data,parsedType:$l(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(yy(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$l(e)},i=this._parseSync({data:e,path:r.path,parent:r});return JM(r,i)}"~validate"(e){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$l(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:n});return Ap(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Ap(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$l(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(yy(i)?i:Promise.resolve(i));return JM(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const s=e(i),o=()=>a.addIssue({code:ke.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Op({schema:this,typeName:Lt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return nc.create(this,this._def)}nullable(){return Ip.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return to.create(this)}promise(){return Cy.create(this,this._def)}or(e){return Ey.create([this,e],this._def)}and(e){return Sy.create(this,e,this._def)}transform(e){return new Op({...Xt(this._def),schema:this,typeName:Lt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new mw({...Xt(this._def),innerType:this,defaultValue:n,typeName:Lt.ZodDefault})}brand(){return new Ffe({typeName:Lt.ZodBranded,type:this,...Xt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new hw({...Xt(this._def),innerType:this,catchValue:n,typeName:Lt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return n2.create(this,e)}readonly(){return gw.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hfe=/^c[^\s-]{8,}$/i,gfe=/^[0-9a-z]+$/,_fe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bfe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yfe=/^[a-z0-9_-]{21}$/i,vfe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Efe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sfe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cfe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let i1;const Tfe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xfe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,kfe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,wfe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dfe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Afe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gz="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Nfe=new RegExp(`^${gz}$`);function _z(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function Rfe(t){return new RegExp(`^${_z(t)}$`)}function Ofe(t){let e=`${gz}T${_z(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function Ife(t,e){return!!((e==="v4"||!e)&&Tfe.test(t)||(e==="v6"||!e)&&kfe.test(t))}function Mfe(t,e){if(!vfe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Pfe(t,e){return!!((e==="v4"||!e)&&xfe.test(t)||(e==="v6"||!e)&&wfe.test(t))}class Ql extends hn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ze.string){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_type,expected:Ze.string,received:a.parsedType}),Mt}const r=new pa;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const s=e.data.length>a.value,o=e.data.length<a.value;(s||o)&&(i=this._getOrReturnCtx(e,i),s?He(i,{code:ke.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&He(i,{code:ke.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Sfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"email",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")i1||(i1=new RegExp(Cfe,"u")),i1.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"emoji",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")bfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"uuid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")yfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"nanoid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")hfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"cuid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")gfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"cuid2",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")_fe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"ulid",code:ke.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),He(i,{validation:"url",code:ke.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"regex",code:ke.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Ofe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?Nfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?Rfe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{code:ke.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?Efe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"duration",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?Ife(e.data,a.version)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"ip",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?Mfe(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"jwt",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?Pfe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"cidr",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?Dfe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"base64",code:ke.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?Afe.test(e.data)||(i=this._getOrReturnCtx(e,i),He(i,{validation:"base64url",code:ke.invalid_string,message:a.message}),r.dirty()):vn.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:ke.invalid_string,...et.errToObj(r)})}_addCheck(e){return new Ql({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...et.errToObj(e)})}url(e){return this._addCheck({kind:"url",...et.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...et.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...et.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...et.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...et.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...et.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...et.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...et.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...et.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...et.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...et.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...et.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...et.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...et.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...et.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...et.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...et.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...et.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...et.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...et.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...et.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...et.errToObj(n)})}nonempty(e){return this.min(1,et.errToObj(e))}trim(){return new Ql({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ql({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ql({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Ql.create=t=>new Ql({checks:[],typeName:Lt.ZodString,coerce:t?.coerce??!1,...Xt(t)});function Lfe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return a%s/10**i}class Np extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ze.number){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_type,expected:Ze.number,received:a.parsedType}),Mt}let r;const i=new pa;for(const a of this._def.checks)a.kind==="int"?vn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),He(r,{code:ke.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Lfe(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),He(r,{code:ke.not_finite,message:a.message}),i.dirty()):vn.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,et.toString(n))}gt(e,n){return this.setLimit("min",e,!1,et.toString(n))}lte(e,n){return this.setLimit("max",e,!0,et.toString(n))}lt(e,n){return this.setLimit("max",e,!1,et.toString(n))}setLimit(e,n,r,i){return new Np({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Np({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:et.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:et.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:et.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:et.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:et.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&vn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Np.create=t=>new Np({checks:[],typeName:Lt.ZodNumber,coerce:t?.coerce||!1,...Xt(t)});class Mh extends hn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ze.bigint)return this._getInvalidInput(e);let r;const i=new pa;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),He(r,{code:ke.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):vn.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return He(n,{code:ke.invalid_type,expected:Ze.bigint,received:n.parsedType}),Mt}gte(e,n){return this.setLimit("min",e,!0,et.toString(n))}gt(e,n){return this.setLimit("min",e,!1,et.toString(n))}lte(e,n){return this.setLimit("max",e,!0,et.toString(n))}lt(e,n){return this.setLimit("max",e,!1,et.toString(n))}setLimit(e,n,r,i){return new Mh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:et.toString(i)}]})}_addCheck(e){return new Mh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:et.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:et.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:et.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:et.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:et.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Mh.create=t=>new Mh({checks:[],typeName:Lt.ZodBigInt,coerce:t?.coerce??!1,...Xt(t)});class eP extends hn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ze.boolean){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.boolean,received:r.parsedType}),Mt}return ts(e.data)}}eP.create=t=>new eP({typeName:Lt.ZodBoolean,coerce:t?.coerce||!1,...Xt(t)});class vy extends hn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ze.date){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_type,expected:Ze.date,received:a.parsedType}),Mt}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return He(a,{code:ke.invalid_date}),Mt}const r=new pa;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),He(i,{code:ke.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):vn.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new vy({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:et.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:et.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}vy.create=t=>new vy({checks:[],coerce:t?.coerce||!1,typeName:Lt.ZodDate,...Xt(t)});class tP extends hn{_parse(e){if(this._getType(e)!==Ze.symbol){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.symbol,received:r.parsedType}),Mt}return ts(e.data)}}tP.create=t=>new tP({typeName:Lt.ZodSymbol,...Xt(t)});class nP extends hn{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.undefined,received:r.parsedType}),Mt}return ts(e.data)}}nP.create=t=>new nP({typeName:Lt.ZodUndefined,...Xt(t)});class rP extends hn{_parse(e){if(this._getType(e)!==Ze.null){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.null,received:r.parsedType}),Mt}return ts(e.data)}}rP.create=t=>new rP({typeName:Lt.ZodNull,...Xt(t)});class iP extends hn{constructor(){super(...arguments),this._any=!0}_parse(e){return ts(e.data)}}iP.create=t=>new iP({typeName:Lt.ZodAny,...Xt(t)});class aP extends hn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ts(e.data)}}aP.create=t=>new aP({typeName:Lt.ZodUnknown,...Xt(t)});class gc extends hn{_parse(e){const n=this._getOrReturnCtx(e);return He(n,{code:ke.invalid_type,expected:Ze.never,received:n.parsedType}),Mt}}gc.create=t=>new gc({typeName:Lt.ZodNever,...Xt(t)});class sP extends hn{_parse(e){if(this._getType(e)!==Ze.undefined){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.void,received:r.parsedType}),Mt}return ts(e.data)}}sP.create=t=>new sP({typeName:Lt.ZodVoid,...Xt(t)});class to extends hn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==Ze.array)return He(n,{code:ke.invalid_type,expected:Ze.array,received:n.parsedType}),Mt;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(s||o)&&(He(n,{code:s?ke.too_big:ke.too_small,minimum:o?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(He(n,{code:ke.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(He(n,{code:ke.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,o)=>i.type._parseAsync(new hc(n,s,n.path,o)))).then(s=>pa.mergeArray(r,s));const a=[...n.data].map((s,o)=>i.type._parseSync(new hc(n,s,n.path,o)));return pa.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new to({...this._def,minLength:{value:e,message:et.toString(n)}})}max(e,n){return new to({...this._def,maxLength:{value:e,message:et.toString(n)}})}length(e,n){return new to({...this._def,exactLength:{value:e,message:et.toString(n)}})}nonempty(e){return this.min(1,e)}}to.create=(t,e)=>new to({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Lt.ZodArray,...Xt(e)});function Bd(t){if(t instanceof Dr){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=nc.create(Bd(r))}return new Dr({...t._def,shape:()=>e})}else return t instanceof to?new to({...t._def,type:Bd(t.element)}):t instanceof nc?nc.create(Bd(t.unwrap())):t instanceof Ip?Ip.create(Bd(t.unwrap())):t instanceof Fu?Fu.create(t.items.map(e=>Bd(e))):t}class Dr extends hn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=vn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Ze.object){const c=this._getOrReturnCtx(e);return He(c,{code:ke.invalid_type,expected:Ze.object,received:c.parsedType}),Mt}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof gc&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||o.push(c);const l=[];for(const c of s){const u=a[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new hc(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof gc){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(He(i,{code:ke.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new hc(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,p=await u.value;c.push({key:d,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>pa.mergeObjectSync(r,c)):pa.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return et.errToObj,new Dr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:et.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Dr({...this._def,unknownKeys:"strip"})}passthrough(){return new Dr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Dr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Lt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Dr({...this._def,catchall:e})}pick(e){const n={};for(const r of vn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Dr({...this._def,shape:()=>n})}omit(e){const n={};for(const r of vn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new Dr({...this._def,shape:()=>n})}deepPartial(){return Bd(this)}partial(e){const n={};for(const r of vn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new Dr({...this._def,shape:()=>n})}required(e){const n={};for(const r of vn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof nc;)a=a._def.innerType;n[r]=a}return new Dr({...this._def,shape:()=>n})}keyof(){return bz(vn.objectKeys(this.shape))}}Dr.create=(t,e)=>new Dr({shape:()=>t,unknownKeys:"strip",catchall:gc.create(),typeName:Lt.ZodObject,...Xt(e)});Dr.strictCreate=(t,e)=>new Dr({shape:()=>t,unknownKeys:"strict",catchall:gc.create(),typeName:Lt.ZodObject,...Xt(e)});Dr.lazycreate=(t,e)=>new Dr({shape:t,unknownKeys:"strip",catchall:gc.create(),typeName:Lt.ZodObject,...Xt(e)});class Ey extends hn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(o=>new al(o.ctx.common.issues));return He(n,{code:ke.invalid_union,unionErrors:s}),Mt}if(n.common.async)return Promise.all(r.map(async a=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let a;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(l=>new al(l));return He(n,{code:ke.invalid_union,unionErrors:o}),Mt}}get options(){return this._def.options}}Ey.create=(t,e)=>new Ey({options:t,typeName:Lt.ZodUnion,...Xt(e)});function fw(t,e){const n=$l(t),r=$l(e);if(t===e)return{valid:!0,data:t};if(n===Ze.object&&r===Ze.object){const i=vn.objectKeys(e),a=vn.objectKeys(t).filter(o=>i.indexOf(o)!==-1),s={...t,...e};for(const o of a){const l=fw(t[o],e[o]);if(!l.valid)return{valid:!1};s[o]=l.data}return{valid:!0,data:s}}else if(n===Ze.array&&r===Ze.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const s=t[a],o=e[a],l=fw(s,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Ze.date&&r===Ze.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Sy extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,s)=>{if(XM(a)||XM(s))return Mt;const o=fw(a.value,s.value);return o.valid?((ZM(a)||ZM(s))&&n.dirty(),{status:n.value,value:o.data}):(He(r,{code:ke.invalid_intersection_types}),Mt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,s])=>i(a,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sy.create=(t,e,n)=>new Sy({left:t,right:e,typeName:Lt.ZodIntersection,...Xt(n)});class Fu extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.array)return He(r,{code:ke.invalid_type,expected:Ze.array,received:r.parsedType}),Mt;if(r.data.length<this._def.items.length)return He(r,{code:ke.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Mt;!this._def.rest&&r.data.length>this._def.items.length&&(He(r,{code:ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((s,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new hc(r,s,r.path,o)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>pa.mergeArray(n,s)):pa.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new Fu({...this._def,rest:e})}}Fu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fu({items:t,typeName:Lt.ZodTuple,rest:null,...Xt(e)})};class oP extends hn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.map)return He(r,{code:ke.invalid_type,expected:Ze.map,received:r.parsedType}),Mt;const i=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new hc(r,o,r.path,[c,"key"])),value:a._parse(new hc(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Mt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Mt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}}oP.create=(t,e,n)=>new oP({valueType:e,keyType:t,typeName:Lt.ZodMap,...Xt(n)});class Ph extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Ze.set)return He(r,{code:ke.invalid_type,expected:Ze.set,received:r.parsedType}),Mt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(He(r,{code:ke.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(He(r,{code:ke.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Mt;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>a._parse(new hc(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>s(l)):s(o)}min(e,n){return new Ph({...this._def,minSize:{value:e,message:et.toString(n)}})}max(e,n){return new Ph({...this._def,maxSize:{value:e,message:et.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Ph.create=(t,e)=>new Ph({valueType:t,minSize:null,maxSize:null,typeName:Lt.ZodSet,...Xt(e)});class lP extends hn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}lP.create=(t,e)=>new lP({getter:t,typeName:Lt.ZodLazy,...Xt(e)});class cP extends hn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return He(n,{received:n.data,code:ke.invalid_literal,expected:this._def.value}),Mt}return{status:"valid",value:e.data}}get value(){return this._def.value}}cP.create=(t,e)=>new cP({value:t,typeName:Lt.ZodLiteral,...Xt(e)});function bz(t,e){return new Rp({values:t,typeName:Lt.ZodEnum,...Xt(e)})}class Rp extends hn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return He(n,{expected:vn.joinValues(r),received:n.parsedType,code:ke.invalid_type}),Mt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return He(n,{received:n.data,code:ke.invalid_enum_value,options:r}),Mt}return ts(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Rp.create(e,{...this._def,...n})}exclude(e,n=this._def){return Rp.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Rp.create=bz;class uP extends hn{_parse(e){const n=vn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Ze.string&&r.parsedType!==Ze.number){const i=vn.objectValues(n);return He(r,{expected:vn.joinValues(i),received:r.parsedType,code:ke.invalid_type}),Mt}if(this._cache||(this._cache=new Set(vn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=vn.objectValues(n);return He(r,{received:r.data,code:ke.invalid_enum_value,options:i}),Mt}return ts(e.data)}get enum(){return this._def.values}}uP.create=(t,e)=>new uP({values:t,typeName:Lt.ZodNativeEnum,...Xt(e)});class Cy extends hn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.promise&&n.common.async===!1)return He(n,{code:ke.invalid_type,expected:Ze.promise,received:n.parsedType}),Mt;const r=n.parsedType===Ze.promise?n.data:Promise.resolve(n.data);return ts(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Cy.create=(t,e)=>new Cy({type:t,typeName:Lt.ZodPromise,...Xt(e)});class Op extends hn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:s=>{He(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const s=i.transform(r.data,a);if(r.common.async)return Promise.resolve(s).then(async o=>{if(n.value==="aborted")return Mt;const l=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return l.status==="aborted"?Mt:l.status==="dirty"||n.value==="dirty"?ym(l.value):l});{if(n.value==="aborted")return Mt;const o=this._def.schema._parseSync({data:s,path:r.path,parent:r});return o.status==="aborted"?Mt:o.status==="dirty"||n.value==="dirty"?ym(o.value):o}}if(i.type==="refinement"){const s=o=>{const l=i.refinement(o,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Mt:(o.status==="dirty"&&n.dirty(),s(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Mt:(o.status==="dirty"&&n.dirty(),s(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ap(s))return Mt;const o=i.transform(s.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Ap(s)?Promise.resolve(i.transform(s.value,a)).then(o=>({status:n.value,value:o})):Mt);vn.assertNever(i)}}Op.create=(t,e,n)=>new Op({schema:t,typeName:Lt.ZodEffects,effect:e,...Xt(n)});Op.createWithPreprocess=(t,e,n)=>new Op({schema:e,effect:{type:"preprocess",transform:t},typeName:Lt.ZodEffects,...Xt(n)});class nc extends hn{_parse(e){return this._getType(e)===Ze.undefined?ts(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}nc.create=(t,e)=>new nc({innerType:t,typeName:Lt.ZodOptional,...Xt(e)});class Ip extends hn{_parse(e){return this._getType(e)===Ze.null?ts(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ip.create=(t,e)=>new Ip({innerType:t,typeName:Lt.ZodNullable,...Xt(e)});class mw extends hn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===Ze.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}mw.create=(t,e)=>new mw({innerType:t,typeName:Lt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Xt(e)});class hw extends hn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return yy(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new al(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new al(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}hw.create=(t,e)=>new hw({innerType:t,typeName:Lt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Xt(e)});class dP extends hn{_parse(e){if(this._getType(e)!==Ze.nan){const r=this._getOrReturnCtx(e);return He(r,{code:ke.invalid_type,expected:Ze.nan,received:r.parsedType}),Mt}return{status:"valid",value:e.data}}}dP.create=t=>new dP({typeName:Lt.ZodNaN,...Xt(t)});class Ffe extends hn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class n2 extends hn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Mt:a.status==="dirty"?(n.dirty(),ym(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Mt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new n2({in:e,out:n,typeName:Lt.ZodPipeline})}}class gw extends hn{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Ap(i)&&(i.value=Object.freeze(i.value)),i);return yy(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}gw.create=(t,e)=>new gw({innerType:t,typeName:Lt.ZodReadonly,...Xt(e)});var Lt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Lt||(Lt={}));const ls=Ql.create,Qd=Np.create;gc.create;const Bfe=to.create,mb=Dr.create;Ey.create;Sy.create;Fu.create;const __=Rp.create;Cy.create;nc.create;Ip.create;const pP=ls().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),fP=mb({top:Qd(),bottom:Qd(),right:Qd(),left:Qd()}).optional().nullable(),yz=mb({style:mb({color:pP,backgroundColor:pP,background:ls().nullable().optional(),fontSize:Qd().gte(0).optional().nullable(),fontFamily:hf,fontWeight:__(["bold","normal"]).optional().nullable(),textAlign:__(["left","center","right"]).optional().nullable(),padding:fP,mobilePadding:fP,optionSize:__(["small","medium","large"]).optional().nullable(),theme:__(["light","dark","colored"]).optional().nullable()}).passthrough().optional().nullable(),gap:Qd().optional(),items:Bfe(mb({id:ls(),key:ls(),label:ls(),iconName:ls(),theme:ls(),size:ls(),sizePx:ls(),url:ls(),href:ls().optional().nullable()}))}).passthrough();function vz({style:t,items:e,blockId:n,gap:r=1,gapMobile:i}){const a=Sr(),s=t?.background??"",o=t?.backgroundColor,l=o?Ju(s,o):s,c={color:t?.color??void 0,background:l,backgroundColor:t?.backgroundColor,fontSize:t?.fontSize??16,fontFamily:il(t?.fontFamily),fontWeight:t?.fontWeight??void 0,textAlign:a=="desktop"?t?.textAlign:t?.textAlignMobile??t?.textAlign,padding:a=="desktop"?t?.padding:t?.mobilePadding??t?.padding},u=a==="desktop"?r:i??r,d=tn(n),f=!VA();return h.jsx($fe,{blockId:`${d}`,items:e,wStyle:c,gap:u,isEditorMode:f})}const $fe=({items:t,blockId:e,wStyle:n,gap:r,isEditorMode:i})=>{const a=s=>{switch(s){case 0:return"first";case t.length-1:return"last";default:return"inside"}};return h.jsx(ki,{className:e,background:n.background,backgroundColor:n.backgroundColor,padding:n?.padding,align:n.textAlign,width:"100%",children:h.jsx("table",{style:{display:"inline-block"},border:0,cellSpacing:"0",cellPadding:"0",children:h.jsx("tbody",{children:h.jsx("tr",{children:t.map((s,o)=>{const l=a(o);return h.jsxs(D.Fragment,{children:[l!=="first"&&h.jsx("td",{className:`gap-${e}`,width:Math.ceil(r/2)}),h.jsx("td",{id:`${s.id}-${s.url}`,width:s.sizePx,style:{textAlign:"center",whiteSpace:"nowrap"},children:h.jsx("a",{target:"_blank",href:i?void 0:JA(s.href),onClick:i?c=>c.preventDefault():void 0,style:{textDecoration:"none",pointerEvents:i?"none":void 0},children:h.jsx("img",{src:s.url,alt:s.key,style:{width:s.sizePx||36,height:s.sizePx||36,display:"block"}})},`item_${o}`)},`${s.id}-${s.url}`),l!=="last"&&h.jsx("td",{className:`gap-${e}`,width:Math.ceil(r/2)})]},s.id)})})})})})},Ufe="https://maildrill-dev.s3.us-east-2.amazonaws.com/icons/",zfe={positive:!0,original:!0,negative:!0},Gfe={small:!0,medium:!0,large:!0,xlarge:!0},K={theme:"positive",size:"medium"},bn=(t,e,n="medium")=>{const r=r2.find(a=>a.key===n)?.value,i=Ez.find(a=>a.key===e)?.value;return`${Ufe}${t}_${i}_${r}.png`},An=t=>r2.find(e=>e.key===t)?.value||"36px",r2=[{value:"24px",key:"small",label:"Small"},{value:"36px",key:"medium",label:"Medium"},{value:"48px",key:"large",label:"Large"}],Ez=[{value:"Positive",key:"positive",label:"Light"},{value:"Original",key:"original",label:"Color"},{value:"Negative",key:"negative",label:"Dark"}],hb=[{key:"facebook",label:"Facebook",iconName:"Facebook",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Facebook",K.theme,K.size),href:"https://www.facebook.com/your-profile"},{key:"web",label:"Web",iconName:"Web",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Web",K.theme,K.size),href:"https://www.google.com"},{key:"mail",label:"Mail",iconName:"Mail",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Mail",K.theme,K.size),href:"https://mail.google.com/"},{key:"apple",label:"Apple",iconName:"Apple",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Apple",K.theme,K.size),href:"https://www.apple.com/"},{key:"bluesky",label:"Bluesky",iconName:"Bluesky",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Bluesky",K.theme,K.size),href:"https://bsky.app/"},{key:"clubhouse",label:"ClubHouse",iconName:"Clubhouse",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Clubhouse",K.theme,K.size),href:"https://www.clubhouse.com/"},{key:"dribbble",label:"Dribbble",iconName:"Dribbble",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Dribbble",K.theme,K.size),href:"https://dribbble.com/"},{key:"figma",label:"Figma",iconName:"Figma",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Figma",K.theme,K.size),href:"https://www.figma.com/"},{key:"github",label:"Github",iconName:"Github",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Github",K.theme,K.size),href:"https://github.com/"},{key:"google",label:"Google",iconName:"Google",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Google",K.theme,K.size),href:"https://google.com/"},{key:"instagram",label:"Instagram",iconName:"Instagram",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Instagram",K.theme,K.size),href:"https://www.instagram.com/your-profile"},{key:"linkedin",label:"LinkedIn",iconName:"LinkedIn",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("LinkedIn",K.theme,K.size),href:"https://www.linkedin.com/in/your-profile"},{key:"medium-social",label:"Medium",iconName:"Medium",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Medium",K.theme,K.size),href:"https://medium.com/"},{key:"messenger",label:"Messenger",iconName:"Messenger",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Messenger",K.theme,K.size),href:"https://www.messenger.com/"},{key:"pinterest",label:"Pinterest",iconName:"Pinterest",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Pinterest",K.theme,K.size),href:"https://www.pinterest.com/"},{key:"reddit",label:"Reddit",iconName:"Reddit",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Reddit",K.theme,K.size),href:"https://www.reddit.com/"},{key:"signal",label:"Signal",iconName:"Signal",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Signal",K.theme,K.size),href:"https://signal.org/"},{key:"snapchat",label:"Snapchat",iconName:"Snapchat",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Snapchat",K.theme,K.size),href:"https://www.snapchat.com/"},{key:"spotify",label:"Spotify",iconName:"Spotify",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Spotify",K.theme,K.size),href:"https://www.spotify.com/"},{key:"telegram",label:"Telegram",iconName:"Telegram",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Telegram",K.theme,K.size),href:"https://t.me/your-profile"},{key:"threads",label:"Threads",iconName:"Threads",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Threads",K.theme,K.size),href:"https://www.threads.net/"},{key:"tiktok",label:"TikTok",iconName:"TikTok",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("TikTok",K.theme,K.size),href:"https://www.tiktok.com/@your-profile"},{key:"tumblr",label:"Tumblr",iconName:"Tumblr",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Tumblr",K.theme,K.size),href:"https://www.tumblr.com/"},{key:"twitch",label:"Twitch",iconName:"Twitch",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("Twitch",K.theme,K.size),href:"https://www.twitch.tv/"},{key:"vk",label:"VK",iconName:"VK",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("VK",K.theme,K.size),href:"https://vk.com/"},{key:"whatsapp",label:"WhatsApp",iconName:"WhatsApp",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("WhatsApp",K.theme,K.size),href:"https://www.whatsapp.com/"},{key:"x",label:"X",iconName:"X",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("X",K.theme,K.size),href:"https://x.com/your-profile"},{key:"youtube",label:"YouTube",iconName:"YouTube",theme:K.theme,size:K.size,sizePx:An(K.size),url:bn("YouTube",K.theme,K.size),href:"https://www.youtube.com/channel/your-channel-id"}];function vm(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const Hfe=({element:t,index:e,moveItem:n,onSelectChange:r,onUrlChange:i,onRemove:a,onDuplicate:s,canRemove:o,theme:l})=>{const c=D.useRef(null),[u,d]=D.useState(null),{t:p}=Ot.useTranslation("inspector"),f=k=>{const w=k.getClientOffset(),A=c.current?.getBoundingClientRect();if(!w||!A)return null;const L=(A.bottom-A.top)/2;return w.y-A.top<L?"up":"down"},[{handlerId:m,isOver:g},_]=dc.useDrop(()=>({accept:"social-media-item",collect(k){return{handlerId:k.getHandlerId(),isOver:k.isOver({shallow:!0})}},hover(k,w){if(!c.current)return;if(k.index===e){d(null);return}if(!w.isOver({shallow:!0})){d(null);return}const O=f(w);d(O)},drop(k,w){if(d(null),!c.current)return;const A=k.index,L=e;if(A===L)return;const O=f(w);let I=L;O==="down"&&(I=L+1),A<I&&(I=I-1),setTimeout(()=>{n(A,I)},0),k.index=I},end:()=>{d(null)}}),[t.id,e,n]),[{isDragging:b},y]=dc.useDrag(()=>({type:"social-media-item",item:()=>({id:t.id,index:e}),collect:k=>({isDragging:k.isDragging()}),end:()=>{d(null)}}),[t.id,e]);D.useEffect(()=>{g||d(null)},[g]);const v=b?.4:1;D.useEffect(()=>{if(c.current&&y&&_){const k=c.current;y(k),_(k)}},[y,_]);const E=()=>{setTimeout(()=>a(e),0)},C=()=>{setTimeout(()=>s(e),0)},T=k=>{const w=k.target.value;setTimeout(()=>r(e,w,t),0)},S=k=>{const w=k.target.value;setTimeout(()=>i(e,w,t),0)},x=()=>h.jsxs("div",{style:{height:"3px",background:l.palette.secondary.main,position:"relative",color:l.palette.secondary.main,margin:"4px 0"},children:[h.jsx("svg",{style:{position:"absolute",left:"-25px",top:"50%",transform:"translateY(-50%)"},width:"20",height:"20",viewBox:"0 0 32 32",children:h.jsx("path",{fill:"currentColor",d:"M28 12H10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2M10 4v6h18V4zm18 26H10a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2m-18-8v6h18v-6zm-1-6l-5.586-5.586L2 11.828L6.172 16L2 20.172l1.414 1.414z"})}),h.jsx("svg",{style:{position:"absolute",right:"-25px",top:"50%",transform:"translateY(-50%) scaleX(-1)"},width:"20",height:"20",viewBox:"0 0 32 32",children:h.jsx("path",{fill:"currentColor",d:"M28 12H10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2M10 4v6h18V4zm18 26H10a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h18a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2m-18-8v6h18v-6zm-1-6l-5.586-5.586L2 11.828L6.172 16L2 20.172l1.414 1.414z"})})]});return h.jsxs(h.Fragment,{children:[u==="up"&&h.jsx(x,{}),h.jsxs(Mn,{ref:c,"data-handler-id":m,sx:{border:1,borderColor:"divider",padding:1,paddingTop:0,borderRadius:1,backgroundColor:"background.paper",marginBottom:1.5,opacity:v,cursor:b?"grabbing":"grab",boxShadow:b?l.shadows[3]:"none"},gap:1,children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:`1px solid ${l.palette.divider}`},children:[h.jsx("div",{style:{display:"flex",alignItems:"center"},children:h.jsx(v8,{sx:{color:b?"primary.main":"text.secondary",cursor:"grab",marginLeft:-.9,"&:hover":{color:"primary.main"}}})}),h.jsxs("div",{children:[h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:"Duplicate",placement:"left",children:h.jsx(Qt,{color:"primary",size:"small",onClick:C,children:h.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M18 2.5H9C7.9 2.5 7 3.4 7 4.5V16.5C7 17.6 7.9 18.5 9 18.5H18C19.1 18.5 20 17.6 20 16.5V4.5C20 3.4 19.1 2.5 18 2.5ZM18 16.5H9V4.5H18V16.5ZM3 15.5V13.5H5V15.5H3ZM3 10H5V12H3V10ZM10 20.5H12V22.5H10V20.5ZM3 19V17H5V19H3ZM5 22.5C3.9 22.5 3 21.6 3 20.5H5V22.5ZM8.5 22.5H6.5V20.5H8.5V22.5ZM13.5 22.5V20.5H15.5C15.5 21.6 14.6 22.5 13.5 22.5ZM5 6.5V8.5H3C3 7.4 3.9 6.5 5 6.5Z",fill:"currentColor"})})})}),o&&h.jsx(Ut,{disableInteractive:!0,arrow:!0,title:"Remove",placement:"left",children:h.jsx(Qt,{color:"error",size:"small",onClick:E,children:h.jsx(zue,{sx:{fontSize:20}})})})]})]}),h.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"0.5rem"},children:[h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"40px auto",gap:"4px",alignItems:"center"},children:[h.jsx(Wn,{label:p("inputs.social.icon")}),h.jsx(mc,{fullWidth:!0,labelId:"demo-simple-select-label",id:"demo-simple-select",value:t.key,size:"small",onChange:T,children:hb.map(k=>h.jsx(ds,{value:k.key,children:k.label},`${t.id}_${k.key}`))})]}),h.jsxs("div",{style:{display:"grid",gridTemplateColumns:"40px auto",gap:"4px",alignItems:"center"},children:[h.jsx(Wn,{label:p("inputs.social.url")}),h.jsx(df,{size:"small",fullWidth:!0,value:t.href??"",onChange:S,variant:"outlined",placeholder:"https://your-website.com",sx:hE})]})]})]}),u==="down"&&h.jsx(x,{})]})};function jfe({items:t=[],onChange:e}){const{t:n}=Ot.useTranslation("inspector"),r=dr(),[i,a]=D.useState(()=>t.map(_=>({..._,id:_.id||vm()}))),[s,o]=D.useState(t[0]?.theme||"default"),[l,c]=D.useState(t[0]?.size||"medium");D.useEffect(()=>{t.length>0&&(o(t[0].theme),c(t[0].size),a(t.map(_=>({..._,id:_.id||vm()}))))},[t]);const u=(_,b)=>{a(y=>{const v=[...y],[E]=v.splice(_,1);return v.splice(b,0,E),e&&setTimeout(()=>e(v),0),v})},d=()=>{a(_=>{const b={...hb[0],theme:s,size:l,sizePx:An(l),url:bn(hb[0].iconName,s,l),id:vm()},y=[..._,b];return e&&setTimeout(()=>e(y),0),y})},p=_=>{a(b=>{const y=b.filter((v,E)=>E!==_);return e&&setTimeout(()=>e(y),0),y})},f=(_,b,y)=>{let v=[...i];if(b in zfe?(o(b),v=v.map(E=>{const C=bn(E.iconName,b,E.size);return{...E,theme:b,url:C}})):b in Gfe&&(c(b),v=v.map(E=>{const C=bn(E.iconName,E.theme,b),T=An(b);return{...E,size:b,sizePx:T,url:C}})),_!==null&&y){const E=hb.find(C=>C.key===b);E&&(v=v.map((C,T)=>{const S={key:E.key,label:E.label,iconName:E.iconName,href:E.href},x=bn(S.iconName,y.theme,y.size);return T===_?{...C,...S,url:x,id:y.id}:C}))}a(v),e&&setTimeout(()=>e(v),0)},m=(_,b,y)=>{const v=i.map((E,C)=>C===_?{...y,href:b}:E);a(v),e&&setTimeout(()=>e(v),0)},g=_=>{a(b=>{const y={...JSON.parse(JSON.stringify(b[_])),id:vm()},v=[...b.slice(0,_+1),y,...b.slice(_+1)];return e&&setTimeout(()=>e(v),0),v})};return h.jsxs(h.Fragment,{children:[h.jsxs("div",{style:{marginBottom:"1rem",display:"grid",gridTemplateColumns:"repeat(2,1fr)",gap:"1rem"},children:[h.jsxs(ri,{children:[h.jsx(Wn,{label:n("inputs.social.theme")}),h.jsx(mc,{fullWidth:!0,labelId:"theme-selector",id:"theme-selector",value:s,size:"small",onChange:_=>f(null,_.target.value,null),children:Ez.map(_=>h.jsx(ds,{value:_.key,children:_.label},`${_.key}`))})]}),h.jsxs(ri,{children:[h.jsx(Wn,{label:n("inputs.social.size")}),h.jsx(mc,{fullWidth:!0,labelId:"size-selector",id:"size-selector",value:l,size:"small",onChange:_=>f(null,_.target.value,null),children:r2.map(_=>h.jsx(ds,{value:_.key,children:_.label},`${_.key}`))})]})]}),i?.map((_,b)=>h.jsx(Hfe,{element:_,index:b,moveItem:u,onSelectChange:f,onUrlChange:m,onRemove:p,onDuplicate:g,canRemove:i.length>1,theme:r},_.id)),h.jsx(di,{onClick:d,sx:{borderRadius:1},variant:"contained",endIcon:h.jsx(xue,{}),children:"Add"})]})}const qfe=({data:t,setData:e})=>{const[,n]=D.useState(null),r=Sr(),{t:i}=Ot.useTranslation("inspector"),a=u=>{const d=yz.safeParse(u);d.success?(e(d.data),n(null)):n(d.error)},s=u=>{a({...t,items:u})},o=u=>{a({...t,style:u})},l=(u,d=!1)=>{if(d){a({...t,gapMobile:u});return}a({...t,gap:u})},c=_o();return h.jsxs(es,{title:i("inputs.panels.social.title"),children:[c=="block-configuration"&&h.jsx(tt,{sx:{minWidth:120,margin:1},children:h.jsx(jfe,{items:t?.items||[],onChange:s})}),c=="css"&&h.jsxs(h.Fragment,{children:[h.jsxs(ri,{children:[h.jsx(Wn,{label:i("inputs.panels.social.gap")}),r=="desktop"?h.jsx(vr,{iconLabel:h.jsx(pM,{sx:{color:"text.primary"}}),value:t?.gap??4,setValue:l,marks:!0,step:4,units:"px",min:0,max:40}):h.jsx(vr,{iconLabel:h.jsx(pM,{sx:{color:"text.primary"}}),value:t?.gapMobile??t?.gap??4,setValue:u=>l(u,!0),marks:!0,step:4,units:"px",min:0,max:40})]}),h.jsx(Ci,{names:["textAlign","textAlignMobile","backgroundColor","padding","mobilePadding"],value:t.style,onChange:u=>o(u)})]})]})},Vfe=Pt().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),Sz=xt({style:xt({height:Le().optional().nullable(),heightMobile:Le().optional().nullable(),background:Pt().nullable().optional(),backgroundColor:Vfe}).optional().nullable()}),mP={height:16};function Cz({style:t,blockId:e}){const r=Sr()==="desktop"?t?.height??mP.height:t?.heightMobile??t?.height??mP.height,i=t?.background??"",a=t?.backgroundColor??"",s=a?Ju(i,a):i,o={width:"100%",minWidth:"100%",backgroundColor:a||void 0,background:s||void 0},l=tn(e);return h.jsx("table",{className:l,width:"100%",style:o,children:h.jsx("tbody",{children:h.jsx("tr",{className:`it${l}`,height:r,style:{height:r},children:h.jsx("td",{})})})})}function Tz({data:t,setData:e}){const[,n]=D.useState(null),{t:r}=Ot.useTranslation("inspector"),i=a=>{const s=Sz.safeParse(a);s.success?(e(s.data),n(null)):n(s.error)};return h.jsx(es,{title:r("inputs.panels.spacer.title"),children:h.jsx(Ci,{names:["height","heightMobile","backgroundColor"],value:t.style,onChange:a=>i({...t,style:a})})})}function Wfe({data:t,setData:e}){const n=_o(),{t:r}=Ot.useTranslation("inspector"),i=t.style||{},a=s=>{const o={...i||{},...s||{}};e({...t,style:o})};return h.jsxs(es,{title:r("inputs.panels.notionText.title","Text"),children:[n==="block-configuration"&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{style:{display:"flex",gap:"8px"},children:[h.jsx("div",{style:{flex:1},children:h.jsx(Ci,{disabledCSSValidation:!0,names:["fontFamily"],value:i,onChange:a})}),h.jsx("div",{style:{flex:1},children:h.jsx(Ci,{disabledCSSValidation:!0,names:["lineHeight"],value:i,onChange:a})})]}),h.jsx(Ci,{disabledCSSValidation:!0,names:["fontSize","fontSizeMobile"],value:i,onChange:a})]}),n==="css"&&h.jsx(Ci,{names:["backgroundColor","border","borderMobile","padding","mobilePadding"],value:i,onChange:a})]})}function hP(t){return h.jsx(tt,{sx:{m:3,p:1,border:"1px dashed",borderColor:"divider"},children:h.jsx(er,{color:"text.secondary",children:t})})}function Yfe(){const t=pf(),e=u8(t||""),n=D.useCallback(a=>{t&&Vk(t,()=>a)},[t]);if(!t)return hP("Click on a block to inspect.");if(!e)return hP(`Block with id ${t} was not found. Click on a block to reset.`);const{data:r,type:i}=e;switch(i){case"Avatar":return h.jsx(Ppe,{data:r,setData:a=>n({type:i,data:a})},t);case"Button":return h.jsx(Upe,{data:r,setData:a=>n({type:i,data:a})},t);case"ColumnsContainer":return h.jsx(Kpe,{data:r,setData:a=>n({type:i,data:a})},t);case"Container":return h.jsx(sz,{data:r,setData:a=>n({type:i,data:a})},t);case"Divider":return h.jsx(cz,{data:r,setData:a=>n({type:i,data:a})},t);case"Heading":return h.jsx(afe,{data:r,setData:a=>n({type:i,data:a})},t);case"Html":return h.jsx(lfe,{data:r,setData:a=>n({type:i,data:a})},t);case"Image":return h.jsx(dfe,{data:r,setData:a=>n({type:i,data:a})},t);case"EmailLayout":return h.jsx(dz,{data:r,setData:a=>n({type:i,data:a})},t);case"Spacer":return h.jsx(Tz,{data:r,setData:a=>n({type:i,data:a})},t);case"NotionText":return h.jsx(Wfe,{data:r,setData:a=>n({type:i,data:a})},t);case"SocialMedia":return h.jsx(qfe,{data:r,setData:a=>n({type:i,data:a})},t);default:return h.jsx("pre",{children:JSON.stringify(e,null," ")})}}const Kfe=D.memo(Yfe),Qfe={EmailLayout:{label:"Email",iconName:"DashboardOutlined"},NotionText:{label:"Text",iconName:"ArticleOutlined"},SocialMedia:{label:"Social",iconName:"Groups2"},Button:{label:"Button",iconName:"SmartButtonOutlined"},Image:{label:"Image",iconName:"ImageOutlined"},Divider:{label:"Divider",iconName:"HorizontalRuleOutlined"},Spacer:{label:"Spacer",iconName:"Crop32Outlined"},ColumnsContainer:{label:"Columns",iconName:"ViewColumnOutlined"},Container:{label:"Container",iconName:"LibraryAddOutlined"},Heading:{label:"Heading",iconName:"Title"},Html:{label:"HTML",iconName:"CodeOutlined"},Avatar:{label:"Avatar",iconName:"AccountCircleOutlined"}},Xfe=t=>e=>e.document[t];function Zfe(t){if(!t)return[];switch(t.type){case"EmailLayout":return t.data?.childrenIds||[];case"Container":return t.data?.props?.childrenIds||[];case"ColumnsContainer":return t.data?.props?.columns?.flatMap(e=>e.childrenIds||[])||[];default:return[]}}function xz(t,e,n){const r=Zfe(t[e]);for(const i of r)if(i===n||xz(t,i,n))return!0;return!1}function Jfe(t,e,n,r){if(!r)return!1;const i=t[e];if(!i||i.type!=="ColumnsContainer")return!1;const a=i.data?.props?.columns?.[n]?.childrenIds||[];for(const s of a)if(s===r||xz(t,s,r))return!0;return!1}function eme(t){const e=t.document;if(!e||!e.root)return null;function n(i,a){const s=a.document[i];if(!s)return[];switch(s.type){case"EmailLayout":return s.data?.childrenIds||[];case"Container":return s.data?.props?.childrenIds||[];case"ColumnsContainer":return s.data?.props?.columns?.flatMap(o=>o.childrenIds||[])||[];default:return[]}}function r(i,a,s){const o=s.document[i],l=o?.type??"Unknown",c=Qfe[l]??{label:l,iconName:"WidgetsOutlined"};if(l==="ColumnsContainer"){const p=o.data?.props?.columns,m=o.data?.props?.columnsCount===2?2:3,g=[];for(let _=0;_<m;_++){const b=p?.[_]?.childrenIds??[],y=Vce(i,_);g.push({blockId:y,type:"ColumnSlot",label:"",iconName:"WidgetsOutlined",children:b.map(v=>r(v,a+2,s)),depth:a+1,columnSlot:{parentBlockId:i,columnIndex:_,columnsCount:m}})}return{blockId:i,type:l,label:c.label,iconName:c.iconName,children:g,depth:a}}const d=n(i,s).map(p=>r(p,a+1,s));return{blockId:i,type:l,label:c.label,iconName:c.iconName,children:d,depth:a}}return r("root",0,t)}function tme(t){return ue(t)}function nme(t){return ue(Xfe(t))}function rme(){const t=pf(),e=nme(t??"root"),n=D.useCallback(s=>{t&&Vk(t,()=>s)},[t]),r=D.useCallback(s=>{Vk("root",()=>s)},[]);if(!e)return null;const{data:i,type:a}=e;switch(a){case"Container":return h.jsx(sz,{data:i,setData:s=>n({type:a,data:s})},t);case"Divider":return h.jsx(cz,{data:i,setData:s=>n({type:a,data:s})},t);case"Spacer":return h.jsx(Tz,{data:i,setData:s=>n({type:a,data:s})},t);case"EmailLayout":return h.jsx(dz,{data:i,setData:s=>r({type:a,data:s})},"root");default:return h.jsx("pre",{children:JSON.stringify(e,null," ")})}}function ime({sticky:t,heightContent:e}){const n=_o(),r=c8(),i=pf(),a=Sr(),s=dr(),{t:o}=Ot.useTranslation("inspector"),l=()=>{const f={position:"absolute",top:"1rem",right:"0rem",height:"24px",lineHeight:"normal",width:"fit",fontSize:"12px"};switch(n){case"block-configuration":case"css":return h.jsxs("div",{style:{position:"relative"},children:[h.jsx(Vb,{color:"primary",sx:f,label:`${o(a==="desktop"?"header.desktop":"header.mobile")}`}),h.jsx(Kfe,{})]});case"styles":return h.jsxs("div",{style:{position:"relative"},children:[h.jsx(rme,{}),h.jsx(Vb,{color:"primary",sx:f,label:`${o(a==="desktop"?"header.desktop":"header.mobile")}`})]})}},c=()=>h.jsx("svg",{style:{marginRight:"4px",color:"inherit"},width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",children:h.jsx("path",{d:"M3.83398 5H17.1673M3.83398 10H17.1673M3.83398 15H9.66732",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),u=()=>h.jsx("svg",{style:{marginRight:"4px",color:"inherit"},width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:h.jsx("path",{d:"M5.83333 17.5C3.99238 17.5 2.5 16.0076 2.5 14.1667V4.16667C2.5 3.24619 3.24619 2.5 4.16667 2.5H7.5C8.42047 2.5 9.16667 3.24619 9.16667 4.16667V14.1667C9.16667 16.0076 7.67428 17.5 5.83333 17.5ZM5.83333 17.5H15.8333C16.7538 17.5 17.5 16.7538 17.5 15.8333V12.5C17.5 11.5795 16.7538 10.8333 15.8333 10.8333H13.8807M9.16669 6.11927L10.5474 4.73858C11.1983 4.0877 12.2535 4.0877 12.9044 4.73858L15.2614 7.0956C15.9123 7.74647 15.9123 8.80175 15.2614 9.45262L8.19036 16.5237M5.83333 14.1667H5.84167",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});D.useEffect(()=>{const f=m=>{const g=m.target;nM(g.innerWidth)};return window&&nM(window.innerWidth),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[n]);const d=(f,m)=>{iue(m)},p=t?e?`calc(${e} - ${kl})`:void 0:e??void 0;return h.jsxs(Ah,{sx:f=>({width:ny,padding:"0!important",margin:"0!important",height:p,maxHeight:p,display:"flex",flexDirection:"column",overflow:"hidden",position:t?"sticky":"static",top:t?kl:0,backgroundColor:`${f.palette.background.paper} !important`}),children:[h.jsx(tt,{sx:{position:"sticky",top:0,zIndex:1,backgroundColor:`${s.palette.background.paper} !important`},children:h.jsxs(HU,{sx:{backgroundColor:`${s.palette.background.paper} !important`},value:n,onChange:d,children:[i!=null&&!Qb.includes(r||"")&&[h.jsx(ou,{sx:{height:kl,minHeight:kl,fontWeight:"bold"},value:"block-configuration",label:o("header.content"),icon:h.jsx(c,{}),iconPosition:"start"},"block-configuration"),h.jsx(ou,{sx:{height:kl,minHeight:kl,fontWeight:"bold"},value:"css",label:o("header.styles"),icon:h.jsx(u,{}),iconPosition:"start"},"css")],Qb.includes(r)&&[h.jsx(ou,{sx:{height:kl,minHeight:kl,fontWeight:"bold"},value:"styles",label:o("header.styles"),icon:h.jsx(u,{}),iconPosition:"start"},"styles")]]})}),h.jsx(Ah,{sx:f=>({flex:"1 1 auto",minHeight:0,overflowY:"auto",px:2,backgroundColor:`${f.palette.background.paper} !important`}),children:l()})]})}const kz=({children:t,topOffset:e=0,zIndex:n=10,className:r="",style:i={},disabled:a=!1,threshold:s=null,...o})=>{const[l,c]=D.useState(!1),[u,d]=D.useState({width:0,height:0}),[p,f]=D.useState({left:0}),[m,g]=D.useState(0),[_,b]=D.useState(!1),y=D.useRef(null),v=D.useRef(null),E=D.useRef(null);D.useEffect(()=>{if(a){c(!1),b(!1),g(0);return}const S=v.current,x=y.current;if(!S||!x)return;let k=null;s&&(s.startsWith("#")?k=document.getElementById(s.slice(1)):(s.startsWith("."),k=document.querySelector(s)));const w=()=>{const P=x.getBoundingClientRect();d({width:P.width,height:P.height}),f({left:P.left})},A=()=>{if(!k||!x)return{offset:0,isPushed:!1};const P=k.getBoundingClientRect(),M=x.getBoundingClientRect(),F=e+M.height;if(P.top<F){const U=F-P.top,j=M.height+20;return{offset:-Math.min(U,j),isPushed:!0}}return{offset:0,isPushed:!1}},L=new IntersectionObserver(([P])=>{const M=!P.isIntersecting;if(M&&!l&&w(),c(M),M&&s){const{offset:F,isPushed:U}=A();g(F),b(U)}else M||(g(0),b(!1))},{threshold:0,rootMargin:`-${e}px 0px 0px 0px`}),O=new ResizeObserver(()=>{w()}),I=()=>{if(s&&l){const{offset:P,isPushed:M}=A();g(P),b(M)}};return L.observe(S),O.observe(x),s&&window.addEventListener("scroll",I,{passive:!0}),w(),()=>{L.disconnect(),O.disconnect(),s&&window.removeEventListener("scroll",I)}},[e,l,a,s]);const C=!a&&l,T=C?`${e+m}px`:"auto";return h.jsxs("div",{ref:E,className:r,...o,children:[!a&&h.jsx("div",{ref:v,style:{height:"1px",position:"absolute",top:`-${e+1}px`,left:0,right:0,pointerEvents:"none"}}),C&&h.jsx("div",{style:{height:`${u.height}px`,width:`${u.width}px`}}),h.jsx("div",{ref:y,style:{position:C?"fixed":"static",top:T,width:"auto",height:"auto",zIndex:C?n:"auto",transition:_?"none":"box-shadow 0.2s ease-in-out, top 0.3s ease-out",..._&&m<-u.height*.3&&{opacity:Math.max(0,1+(m+u.height*.3)/(u.height*.7))},...i},children:t})]})};var wz=WU();function Kr(t){this.content=t}Kr.prototype={constructor:Kr,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),a=r.content.slice();return i==-1?a.push(n||t,e):(a[i+1]=e,n&&(a[i]=n)),new Kr(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Kr(n)},addToStart:function(t,e){return new Kr([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Kr(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),a=r.find(t);return i.splice(a==-1?i.length:a,0,e,n),new Kr(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Kr.from(t),t.size?new Kr(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Kr.from(t),t.size?new Kr(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Kr.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};Kr.from=function(t){if(t instanceof Kr)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Kr(e)};function Dz(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),a=e.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let s=0;i.text[s]==a.text[s];s++)n++;return n}if(i.content.size||a.content.size){let s=Dz(i.content,a.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function Az(t,e,n,r){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let s=t.child(--i),o=e.child(--a),l=s.nodeSize;if(s==o){n-=l,r-=l;continue}if(!s.sameMarkup(o))return{a:n,b:r};if(s.isText&&s.text!=o.text){let c=0,u=Math.min(s.text.length,o.text.length);for(;c<u&&s.text[s.text.length-c-1]==o.text[o.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||o.content.size){let c=Az(s.content,o.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class fe{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,a){for(let s=0,o=0;o<n;s++){let l=this.content[s],c=o+l.nodeSize;if(c>e&&r(l,i+o,a||null,s)!==!1&&l.content.size){let u=o+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let a="",s=!0;return this.nodesBetween(e,n,(o,l)=>{let c=o.isText?o.text.slice(Math.max(e,l)-l,n-l):o.isLeaf?i?typeof i=="function"?i(o):i:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&r&&(s?s=!1:a+=r),a+=c},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new fe(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let a=0,s=0;s<n;a++){let o=this.content[a],l=s+o.nodeSize;l>e&&((s<e||l>n)&&(o.isText?o=o.cut(Math.max(0,e-s),Math.min(o.text.length,n-s)):o=o.cut(Math.max(0,e-s-1),Math.min(o.content.size,n-s-1))),r.push(o),i+=o.nodeSize),s=l}return new fe(r,i)}cutByIndex(e,n){return e==n?fe.empty:e==0&&n==this.content.length?this:new fe(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new fe(i,a)}addToStart(e){return new fe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new fe(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Dz(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Az(this,e,n,r)}findIndex(e){if(e==0)return b_(0,e);if(e==this.size)return b_(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),a=r+i.nodeSize;if(a>=e)return a==e?b_(n+1,a):b_(n,r);r=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return fe.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new fe(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return fe.empty;let n,r=0;for(let i=0;i<e.length;i++){let a=e[i];r+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(n||(n=e.slice(0,i)),n[n.length-1]=a.withText(n[n.length-1].text+a.text)):n&&n.push(a)}return new fe(n||e,r)}static from(e){if(!e)return fe.empty;if(e instanceof fe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new fe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}fe.empty=new fe([],0);const a1={index:0,offset:0};function b_(t,e){return a1.index=t,a1.offset=e,a1}function Ty(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ty(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ty(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let zn=class _w{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))n||(n=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!r&&a.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(a)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ty(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return _w.none;if(e instanceof _w)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};zn.none=[];class xy extends Error{}class Be{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Rz(this.content,e+this.openStart,n);return r&&new Be(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Be(Nz(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Be.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Be(fe.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.firstChild)r++;for(let a=e.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new Be(e,r,i)}}Be.empty=new Be(fe.empty,0,0);function Nz(t,e,n){let{index:r,offset:i}=t.findIndex(e),a=t.maybeChild(r),{index:s,offset:o}=t.findIndex(n);if(i==e||a.isText){if(o!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,a.copy(Nz(a.content,e-i-1,n-i-1)))}function Rz(t,e,n,r){let{index:i,offset:a}=t.findIndex(e),s=t.maybeChild(i);if(a==e||s.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let o=Rz(s.content,e-a-1,n,s);return o&&t.replaceChild(i,s.copy(o))}function ame(t,e,n){if(n.openStart>t.depth)throw new xy("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new xy("Inconsistent open depths");return Oz(t,e,n,0)}function Oz(t,e,n,r){let i=t.index(r),a=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=Oz(t,e,n,r+1);return a.copy(a.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,o=s.content;return Eu(s,o.cut(0,t.parentOffset).append(n.content).append(o.cut(e.parentOffset)))}else{let{start:s,end:o}=sme(n,t);return Eu(a,Mz(t,s,o,e,r))}else return Eu(a,ky(t,e,r))}function Iz(t,e){if(!e.type.compatibleContent(t.type))throw new xy("Cannot join "+e.type.name+" onto "+t.type.name)}function bw(t,e,n){let r=t.node(n);return Iz(r,e.node(n)),r}function vu(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Qm(t,e,n,r){let i=(e||t).node(n),a=0,s=e?e.index(n):i.childCount;t&&(a=t.index(n),t.depth>n?a++:t.textOffset&&(vu(t.nodeAfter,r),a++));for(let o=a;o<s;o++)vu(i.child(o),r);e&&e.depth==n&&e.textOffset&&vu(e.nodeBefore,r)}function Eu(t,e){return t.type.checkContent(e),t.copy(e)}function Mz(t,e,n,r,i){let a=t.depth>i&&bw(t,e,i+1),s=r.depth>i&&bw(n,r,i+1),o=[];return Qm(null,t,i,o),a&&s&&e.index(i)==n.index(i)?(Iz(a,s),vu(Eu(a,Mz(t,e,n,r,i+1)),o)):(a&&vu(Eu(a,ky(t,e,i+1)),o),Qm(e,n,i,o),s&&vu(Eu(s,ky(n,r,i+1)),o)),Qm(r,null,i,o),new fe(o)}function ky(t,e,n){let r=[];if(Qm(null,t,n,r),t.depth>n){let i=bw(t,e,n+1);vu(Eu(i,ky(t,e,n+1)),r)}return Qm(e,null,n,r),new fe(r)}function sme(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let a=n-1;a>=0;a--)i=e.node(a).copy(fe.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Lh{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let a=0;a<e;a++)i+=r.child(a).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return zn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let o=r;r=i,i=o}let a=r.marks;for(var s=0;s<a.length;s++)a[s].type.spec.inclusive===!1&&(!i||!a[s].isInSet(i.marks))&&(a=a[s--].removeFromSet(a));return a}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<r.length;a++)r[a].type.spec.inclusive===!1&&(!i||!r[a].isInSet(i.marks))&&(r=r[a--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new wy(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,a=n;for(let s=e;;){let{index:o,offset:l}=s.content.findIndex(a),c=a-l;if(r.push(s,o,i+l),!c||(s=s.child(o),s.isText))break;a=c-1,i+=l+1}return new Lh(n,r,a)}static resolveCached(e,n){let r=gP.get(e);if(r)for(let a=0;a<r.elts.length;a++){let s=r.elts[a];if(s.pos==n)return s}else gP.set(e,r=new ome);let i=r.elts[r.i]=Lh.resolve(e,n);return r.i=(r.i+1)%lme,i}}class ome{constructor(){this.elts=[],this.i=0}}const lme=12,gP=new WeakMap;class wy{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const cme=Object.create(null);let rc=class yw{constructor(e,n,r,i=zn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||fe.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ty(this.attrs,n||e.defaultAttrs||cme)&&zn.sameSet(this.marks,r||zn.none)}copy(e=null){return e==this.content?this:new yw(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new yw(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Be.empty;let i=this.resolve(e),a=this.resolve(n),s=r?0:i.sharedDepth(n),o=i.start(s),c=i.node(s).content.cut(i.pos-o,a.pos-o);return new Be(c,i.depth-s,a.depth-s)}replace(e,n,r){return ame(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Lh.resolveCached(this,e)}resolveNoCache(e){return Lh.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,a=>(r.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Pz(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=fe.empty,i=0,a=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,a),o=s&&s.matchFragment(this.content,n);if(!o||!o.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(r),s=a&&a.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=zn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!zn.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=fe.fromJSON(e,n.content),a=e.nodeType(n.type).create(n.attrs,i,r);return a.type.checkAttrs(a.attrs),a}};rc.prototype.text=void 0;class Dy extends rc{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pz(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Dy(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Dy(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Pz(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Bu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new ume(e,n);if(r.next==null)return Bu.empty;let i=Lz(r);r.next&&r.err("Unexpected trailing text");let a=_me(gme(i));return bme(a,r),a}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let a=n;i&&a<r;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function a(s,o){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return fe.from(o.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=a(d,o.concat(u));if(p)return p}}return null}return a(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),a=i.match;if(a.matchType(e)){let s=[];for(let o=i;o.type;o=o.via)s.push(o.type);return s.reverse()}for(let s=0;s<a.next.length;s++){let{type:o,next:l}=a.next[s];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in n)&&(!i.type||l.validEnd)&&(r.push({match:o.contentMatch,type:o,via:i}),n[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let a=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)a+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return a}).join(`
|
|
148
148
|
`)}}Bu.empty=new Bu(!0);let ume=class{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function Lz(t){let e=[];do e.push(dme(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function dme(t){let e=[];do e.push(pme(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function pme(t){let e=hme(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=fme(t,e);else break;return e}function _P(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function fme(t,e){let n=_P(t),r=n;return t.eat(",")&&(t.next!="}"?r=_P(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function mme(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let a in n){let s=n[a];s.isInGroup(e)&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function hme(t){if(t.eat("(")){let e=Lz(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=mme(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function gme(t){let e=[[]];return i(a(t,0),n()),e;function n(){return e.push([])-1}function r(s,o,l){let c={term:l,to:o};return e[s].push(c),c}function i(s,o){s.forEach(l=>l.to=o)}function a(s,o){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(a(c,o)),[]);if(s.type=="seq")for(let l=0;;l++){let c=a(s.exprs[l],o);if(l==s.exprs.length-1)return c;i(c,o=n())}else if(s.type=="star"){let l=n();return r(o,l),i(a(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(a(s.expr,o),l),i(a(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(o)].concat(a(s.expr,o));if(s.type=="range"){let l=o;for(let c=0;c<s.min;c++){let u=n();i(a(s.expr,l),u),l=u}if(s.max==-1)i(a(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),i(a(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(o,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Fz(t,e){return e-t}function bP(t,e){let n=[];return r(e),n.sort(Fz);function r(i){let a=t[i];if(a.length==1&&!a[0].term)return r(a[0].to);n.push(i);for(let s=0;s<a.length;s++){let{term:o,to:l}=a[s];!o&&n.indexOf(l)==-1&&r(l)}}}function _me(t){let e=Object.create(null);return n(bP(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:o,to:l})=>{if(!o)return;let c;for(let u=0;u<i.length;u++)i[u][0]==o&&(c=i[u][1]);bP(t,l).forEach(u=>{c||i.push([o,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let a=e[r.join(",")]=new Bu(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let o=i[s][1].sort(Fz);a.next.push({type:i[s][0],next:e[o.join(",")]||n(o)})}return a}}function bme(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],a=!i.validEnd,s=[];for(let o=0;o<i.next.length;o++){let{type:l,next:c}=i.next[o];s.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),r.indexOf(c)==-1&&r.push(c)}a&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Bz(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function $z(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let a=t[r];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Uz(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let a=t[i];a.validate&&a.validate(e[i])}}function zz(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new vme(t,r,e[r]);return n}let yP=class Gz{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=zz(e,r.attrs),this.defaultAttrs=Bz(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Bu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:$z(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new rc(this,this.computeAttrs(e),fe.from(n),zn.setFrom(r))}createChecked(e=null,n,r){return n=fe.from(n),this.checkContent(n),new rc(this,this.computeAttrs(e),n,zn.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=fe.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),a=i&&i.fillBefore(fe.empty,!0);return a?new rc(this,e,n.append(a),zn.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Uz(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:zn.none:e}static compile(e,n){let r=Object.create(null);e.forEach((a,s)=>r[a]=new Gz(a,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let a in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function yme(t,e,n){let r=n.split("|");return i=>{let a=i===null?"null":typeof i;if(r.indexOf(a)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${a}`)}}class vme{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?yme(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class _E{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=zz(e,i.attrs),this.excluded=null;let a=Bz(this.attrs);this.instance=a?new zn(this,a):null}create(e=null){return!e&&this.instance?this.instance:new zn(this,$z(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((a,s)=>r[a]=new _E(a,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){Uz(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Hz{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Kr.from(e.nodes),n.marks=Kr.from(e.marks||{}),this.nodes=yP.compile(this.spec.nodes,this),this.marks=_E.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],s=a.spec.content||"",o=a.spec.marks;if(a.contentMatch=r[s]||(r[s]=Bu.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=o=="_"?null:o?vP(this,o.split(" ")):o==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],s=a.spec.excludes;a.excluded=s==null?[a]:s==""?[]:vP(this,s.split(" "))}this.nodeFromJSON=i=>rc.fromJSON(this,i),this.markFromJSON=i=>zn.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof yP){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Dy(r,r.defaultAttrs,e,zn.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function vP(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t.marks[i],s=a;if(a)n.push(a);else for(let o in t.marks){let l=t.marks[o];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Eme(t){return t.tag!=null}function Sme(t){return t.style!=null}class ic{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Eme(i))this.tags.push(i);else if(Sme(i)){let a=/[^=]*/.exec(i.style)[0];r.indexOf(a)<0&&r.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,n={}){let r=new SP(this,n,!1);return r.addAll(e,zn.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new SP(this,n,!0);return r.addAll(e,zn.none,n.from,n.to),Be.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(xme(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||n.matchesContext(a.context))){if(a.getAttrs){let s=a.getAttrs(e);if(s===!1)continue;a.attrs=s||void 0}return a}}}matchStyle(e,n,r,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let s=this.styles[a],o=s.style;if(!(o.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let a=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let o=n[s];if((o.priority==null?50:o.priority)<a)break}n.splice(s,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(s=>{r(s=CP(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(s=>{r(s=CP(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ic(e,ic.schemaRules(e)))}}const jz={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Cme={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qz={ol:!0,ul:!0},Fh=1,vw=2,Xm=4;function EP(t,e,n){return e!=null?(e?Fh:0)|(e==="full"?vw:0):t&&t.whitespace=="pre"?Fh|vw:n&~Xm}class y_{constructor(e,n,r,i,a,s){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=zn.none,this.match=a||(s&Xm?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(fe.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Fh)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let a=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let n=fe.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(fe.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!jz.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class SP{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,a,s=EP(null,n.preserveWhitespace,0)|(r?Xm:0);i?a=new y_(i.type,i.attrs,zn.none,!0,n.topMatch||i.type.contentMatch,s):r?a=new y_(null,null,zn.none,!0,null,s):a=new y_(e.schema.topNodeType,null,zn.none,!0,null,s),this.nodes=[a],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,a=i.options&vw?"full":this.localPreserveWS||(i.options&Fh)>0,{schema:s}=this.parser;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(a)if(a==="full")r=r.replace(/\r\n?/g,`
|
|
149
149
|
`);else if(s.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(s.linebreakReplacement.create())){let o=r.split(/\r?\n|\r/);for(let l=0;l<o.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),o[l]&&this.insertNode(s.text(o[l]),n,!/\S/.test(o[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],l=e.previousSibling;(!o||l&&l.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(r=r.slice(1))}r&&this.insertNode(s.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;qz.hasOwnProperty(s)&&this.parser.normalizeLists&&Tme(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Cme.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(jz.hasOwnProperty(s))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),c=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(a),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?o:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
150
150
|
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],s=r.getPropertyValue(a);if(s)for(let o=void 0;;){let l=this.parser.matchStyle(a,s,this,o);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)o=l;else break}}return n}addElementByRule(e,n,r,i){let a,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(a=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}a&&this.sync(o)&&this.open--}addAll(e,n,r,i){let a=r||0;for(let s=r?e.childNodes[r]:e.firstChild,o=i==null?null:e.childNodes[i];s!=o;s=s.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(s,n);this.findAtPoint(e,a)}findPlace(e,n,r){let i,a;for(let s=this.open,o=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+o)&&(i=c,a=l,!c.length))break;if(l.solid){if(r)break;o+=2}}if(!i)return null;this.sync(a);for(let s=0;s<i.length;s++)n=this.enterInner(i[s],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(n=this.enterInner(a,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let s=zn.none;for(let o of i.concat(e.marks))(a.type?a.type.allowsMarkType(o.type):TP(o.type,e.type))&&(s=o.addToSet(s));return a.content.push(e.mark(s)),!0}return!1}enter(e,n,r,i){let a=this.findPlace(e.create(n),r,!1);return a&&(a=this.enterInner(e,n,r,!0,i)),a}enterInner(e,n,r,i=!1,a){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=EP(e,a,s.options);s.options&Xm&&s.content.length==0&&(o|=Xm);let l=zn.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):TP(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new y_(e,n,l,i,null,o)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Fh)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),a=-(r?r.depth+1:0)+(i?0:1),s=(o,l)=>{for(;o>=0;o--){let c=n[o];if(c==""){if(o==n.length-1||o==0)continue;for(;l>=a;l--)if(s(o-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=a?r.node(l-a).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Tme(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&qz.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function xme(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function CP(t){let e={};for(let n in t)e[n]=t[n];return e}function TP(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let a=[],s=o=>{a.push(o);for(let l=0;l<o.edgeCount;l++){let{type:c,next:u}=o.edge(l);if(c==e||a.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}class ed{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=s1(n).createDocumentFragment());let i=r,a=[];return e.forEach(s=>{if(a.length||s.marks.length){let o=0,l=0;for(;o<a.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(a[o][0])||c.type.spec.spanning===!1)break;o++,l++}for(;o<a.length;)i=a.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(a.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=gb(s1(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,n);a&&((a.contentDOM||a.dom).appendChild(r),r=a.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&gb(s1(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return gb(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ed(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=xP(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return xP(e.marks)}}function xP(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function s1(t){return t.document||window.document}const kP=new WeakMap;function kme(t){let e=kP.get(t);return e===void 0&&kP.set(t,e=wme(t)),e}function wme(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function gb(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(a=kme(r))&&a.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let p=e[d];if(p===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:m}=gb(t,p,n,r);if(l.appendChild(f),m){if(o)throw new RangeError("Multiple content holes");o=m}}}return{dom:l,contentDOM:o}}const Vz=65535,Wz=Math.pow(2,16);function Dme(t,e){return t+e*Wz}function wP(t){return t&Vz}function Ame(t){return(t-(t&Vz))/Wz}const Yz=1,Kz=2,_b=4,Qz=8;class Ew{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Qz)>0}get deletedBefore(){return(this.delInfo&(Yz|_b))>0}get deletedAfter(){return(this.delInfo&(Kz|_b))>0}get deletedAcross(){return(this.delInfo&_b)>0}}class aa{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&aa.empty)return aa.empty}recover(e){let n=0,r=wP(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Ame(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[o+a],u=this.ranges[o+s],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,f=l+i+(p<0?0:u);if(r)return f;let m=e==(n<0?l:d)?null:Dme(o/3,e-l),g=e==l?Kz:e==d?Yz:_b;return(n<0?e!=l:e!=d)&&(g|=Qz),new Ew(f,g,m)}i+=u-c}return r?e+i:new Ew(e+i,0,null)}touches(e,n){let r=0,i=wP(n),a=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let l=this.ranges[o]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[o+a],u=l+c;if(e<=u&&o==i*3)return!0;r+=this.ranges[o+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let s=this.ranges[i],o=s-(this.inverted?a:0),l=s+(this.inverted?0:a),c=this.ranges[i+n],u=this.ranges[i+r];e(o,o+c,l,l+u),a+=u-c}}invert(){return new aa(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?aa.empty:new aa(e<0?[0,-e,0]:[0,0,e])}}aa.empty=new aa([]);class Bh{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Bh(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Bh;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let a=this.from;a<this.to;a++){let s=this._maps[a],o=s.mapResult(e,n);if(o.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(o.recover);continue}}i|=o.delInfo,e=o.pos}return r?e:new Ew(e,i,null)}}const o1=Object.create(null);class gi{getMap(){return aa.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=o1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in o1)throw new RangeError("Duplicate use of step JSON ID "+e);return o1[e]=n,n.prototype.jsonID=e,n}}class Rr{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Rr(e,null)}static fail(e){return new Rr(null,e)}static fromReplace(e,n,r,i){try{return Rr.ok(e.replace(n,r,i))}catch(a){if(a instanceof xy)return Rr.fail(a.message);throw a}}}function i2(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let a=t.child(i);a.content.size&&(a=a.copy(i2(a.content,e,a))),a.isInline&&(a=e(a,n,i)),r.push(a)}return fe.fromArray(r)}class Xl extends gi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),a=new Be(i2(n.content,(s,o)=>!s.isAtom||!o.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return Rr.fromReplace(e,this.from,this.to,a)}invert(){return new fs(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Xl(n.pos,r.pos,this.mark)}merge(e){return e instanceof Xl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Xl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Xl(n.from,n.to,e.markFromJSON(n.mark))}}gi.jsonID("addMark",Xl);class fs extends gi{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Be(i2(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Rr.fromReplace(e,this.from,this.to,r)}invert(){return new Xl(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new fs(n.pos,r.pos,this.mark)}merge(e){return e instanceof fs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new fs(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new fs(n.from,n.to,e.markFromJSON(n.mark))}}gi.jsonID("removeMark",fs);class Zl extends gi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Rr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Rr.fromReplace(e,this.pos,this.pos+1,new Be(fe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Zl(this.pos,n.marks[i]);return new Zl(this.pos,this.mark)}}return new $u(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Zl(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Zl(n.pos,e.markFromJSON(n.mark))}}gi.jsonID("addNodeMark",Zl);class $u extends gi{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Rr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Rr.fromReplace(e,this.pos,this.pos+1,new Be(fe.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Zl(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $u(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new $u(n.pos,e.markFromJSON(n.mark))}}gi.jsonID("removeNodeMark",$u);class Ur extends gi{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Sw(e,this.from,this.to)?Rr.fail("Structure replace would overwrite content"):Rr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new aa([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ur(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ur(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Ur)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Be.empty:new Be(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ur(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Be.empty:new Be(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ur(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ur(n.from,n.to,Be.fromJSON(e,n.slice),!!n.structure)}}gi.jsonID("replace",Ur);class jr extends gi{constructor(e,n,r,i,a,s,o=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=a,this.insert=s,this.structure=o}apply(e){if(this.structure&&(Sw(e,this.from,this.gapFrom)||Sw(e,this.gapTo,this.to)))return Rr.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Rr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Rr.fromReplace(e,this.from,this.to,r):Rr.fail("Content does not fit in gap")}getMap(){return new aa([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new jr(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new jr(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new jr(n.from,n.to,n.gapFrom,n.gapTo,Be.fromJSON(e,n.slice),n.insert,!!n.structure)}}gi.jsonID("replaceAround",jr);function Sw(t,e,n){let r=t.resolve(e),i=n-e,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let s=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function Nme(t,e,n,r){let i=[],a=[],s,o;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),f=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(s&&s.to==p&&s.mark.eq(d[g])?s.to=f:i.push(s=new fs(p,f,d[g])));o&&o.to==p?o.to=f:a.push(o=new Xl(p,f,r))}}),i.forEach(l=>t.step(l)),a.forEach(l=>t.step(l))}function Rme(t,e,n,r){let i=[],a=0;t.doc.nodesBetween(e,n,(s,o)=>{if(!s.isInline)return;a++;let l=null;if(r instanceof _E){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(o+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],p;for(let f=0;f<i.length;f++){let m=i[f];m.step==a-1&&d.eq(i[f].style)&&(p=m)}p?(p.to=c,p.step=a):i.push({style:d,from:Math.max(o,e),to:c,step:a})}}}),i.forEach(s=>t.step(new fs(s.from,s.to,s.style)))}function a2(t,e,n,r=n.contentMatch,i=!0){let a=t.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l<a.childCount;l++){let c=a.child(l),u=o+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new Ur(o,u,Be.empty));else{r=d;for(let p=0;p<c.marks.length;p++)n.allowsMarkType(c.marks[p].type)||t.step(new fs(o,u,c.marks[p]));if(i&&c.isText&&n.whitespace!="pre"){let p,f=/\r?\n|\r/g,m;for(;p=f.exec(c.text);)m||(m=new Be(fe.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new Ur(o+p.index,o+p.index+p[0].length,m))}}o=u}if(!r.validEnd){let l=r.fillBefore(fe.empty,!0);t.replace(o,o,new Be(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function Ome(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function gf(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,a=0;;--r){let s=t.$from.node(r),o=t.$from.index(r)+i,l=t.$to.indexAfter(r)-a;if(r<t.depth&&s.canReplace(o,l,n))return r;if(r==0||s.type.spec.isolating||!Ome(s,o,l))break;o&&(i=1),l<s.childCount&&(a=1)}return null}function Ime(t,e,n){let{$from:r,$to:i,depth:a}=e,s=r.before(a+1),o=i.after(a+1),l=s,c=o,u=fe.empty,d=0;for(let m=a,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=fe.from(r.node(m).copy(u)),d++):l--;let p=fe.empty,f=0;for(let m=a,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=fe.from(i.node(m).copy(p)),f++):c++;t.step(new jr(l,c,s,o,new Be(u.append(p),d,f),u.size-d,!0))}function s2(t,e,n=null,r=t){let i=Mme(t,e),a=i&&Pme(r,e);return a?i.map(DP).concat({type:e,attrs:n}).concat(a.map(DP)):null}function DP(t){return{type:t,attrs:null}}function Mme(t,e){let{parent:n,startIndex:r,endIndex:i}=t,a=n.contentMatchAt(r).findWrapping(e);if(!a)return null;let s=a.length?a[0]:e;return n.canReplaceWith(r,i,s)?a:null}function Pme(t,e){let{parent:n,startIndex:r,endIndex:i}=t,a=n.child(r),s=e.contentMatch.findWrapping(a.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function Lme(t,e,n){let r=fe.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let o=n[s].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=fe.from(n[s].type.create(n[s].attrs,r))}let i=e.start,a=e.end;t.step(new jr(i,a,i,a,new Be(r,0,0),n.length,!0))}function Fme(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,n,(s,o)=>{let l=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,l)&&Bme(t.doc,t.mapping.slice(a).map(o),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!m?c=!1:!f&&m&&(c=!0)}c===!1&&Zz(t,s,o,a),a2(t,t.mapping.slice(a).map(o,1),r,void 0,c===null);let u=t.mapping.slice(a),d=u.map(o,1),p=u.map(o+s.nodeSize,1);return t.step(new jr(d,p,d+1,p-1,new Be(fe.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Xz(t,s,o,a),!1}})}function Xz(t,e,n,r){e.forEach((i,a)=>{if(i.isText){let s,o=/\r?\n|\r/g;for(;s=o.exec(i.text);){let l=t.mapping.slice(r).map(n+1+a+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Zz(t,e,n,r){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+a);t.replaceWith(s,s+1,e.type.schema.text(`
|