@grapesjs/studio-sdk-plugins 1.0.33 → 1.0.34

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.
@@ -1,70 +1,24 @@
1
- "use strict";const Q1=require("@ai-sdk/react"),Ar=require("ai"),c=require("react/jsx-runtime"),h=require("react"),Dn=require("react-dom"),nw=require("react-dom/client"),sw=require("marked"),rw=require("react-markdown"),ow=require("remark-gfm");function eb(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const et=eb(h),iw=eb(Dn),tb="app.grapesjs.com",nb="app-stage.grapesjs.com",aw="app2.grapesjs.com",lw="app-stage2.grapesjs.com",Ph=[tb,aw,nb,lw,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],sb="license:check:start",Id="license:check:end",Vs=()=>typeof window<"u",bo=e=>e&&e.stopPropagation(),cw=e=>e.getAttributeNames().reduce((t,n)=>({...t,[n]:e.getAttribute(n)||""}),{}),uw=(e,t)=>{const n=s=>s.key===e&&t();return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},dw=(e="")=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},fw=e=>uw("Escape",e),pw=(e,t={})=>{const n=ot(e)?{id:e,src:e}:e;return new Promise((s,r)=>{var p,g;const{loadedScripts:o}=t,{id:i,src:a}=n,l=document.querySelector(`script[src="${a}"]`);if(l){if((p=t.onScript)==null||p.call(t,l),o&&!o.get(a)){l.addEventListener("load",()=>s(i)),l.addEventListener("error",()=>r(i));return}return s(i)}const u=window.define;window.define=void 0;const d=()=>{o==null||o.set(a,!0),window.define=u},f=document.createElement("script");f.src=a,f.onload=()=>{s(i),d()},f.onerror=()=>{r(i),d()},document.head.appendChild(f),(g=t.onScript)==null||g.call(t,f)})},hw=e=>{const t=e.map(n=>pw(n));return Promise.allSettled(t)};function gw(e){const t=e.ownerDocument.createElement("script");return t.text=e.innerHTML,Array.from(e.attributes).forEach(n=>t.setAttribute(n.nodeName,n.nodeValue)),t}function _h(e){const t=s=>{var r;if(s.length){const o=s.shift(),i=gw(o);i.onerror=i.onload=t.bind(null,s),(r=o.parentNode)==null||r.replaceChild(i,o)}},n=Array.from(e.querySelectorAll("script"));t(n)}const rb=e=>new DOMParser().parseFromString(e,"text/html"),mw=(e="")=>rb(`<body>${e}</body>`).body.innerHTML,bw=(e="")=>rb(`<head>${e}</head>`).head.innerHTML,vw=(e="",t)=>{const s=new DOMParser().parseFromString(e,"text/html");if(t){const o=s.querySelectorAll("svg")[0].style||{},i=jw(t)?`${t}px`:t;o.width=i,o.height=i,o.fill="currentColor"}return new XMLSerializer().serializeToString(s)},Hf=({isDev:e,isStage:t,isPlatform:n})=>`${e?"":`https://${t?nb:tb}`}/${n?"platform-api":"api"}`,yw=(e,t)=>{try{return new RegExp(e,t)}catch{console.warn("Failed to create regexp",e);return}},ob=(e={})=>{const{width:t=300,height:n,text:s="IMAGE",bg:r="777",fg:o="white"}=e,i=n?`x${n}`:"";return`https://placehold.co/${t}${i}/${r}/${o}.png?text=${s}`},xw=ob(),Ff=()=>{const e=Vs()&&window.location.hostname;return!!e&&(Ph.includes(e)||Ph.some(t=>e.endsWith(t)))},Ts=e=>e&&e.charAt(0).toUpperCase()+e.substring(1),ww=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase()),Sw=()=>{},Cw=240,Lt=e=>typeof e<"u",ot=e=>typeof e=="string",jw=e=>typeof e=="number";function Ye(e){return typeof e=="function"}function ur(e){return e&&!Array.isArray(e)&&typeof e=="object"}const Ew=e=>!e||Object.keys(e).length===0,ni=(e,t)=>{const n=(e||"").toLocaleLowerCase(),s=(t||"").toLocaleLowerCase();return n.includes(s)},Pw=(e="")=>{const t=e[0]==="?"?e.substring(1):e,n=new URLSearchParams(t);return Object.fromEntries(n)},_w=(e=16)=>{let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=n.length;for(let r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*s));return t},Tw=e=>!!e.Components.getType("mjml"),Ac=e=>(e||"").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-._]+/g,"").replace(/--+/g,"-").trim(),Ow=(e,t=[])=>{const n=new Set(t);return(e||"").trim().replace(/\{\{\s*([a-zA-Z0-9_]*)\s*\}\}/g,(o,i)=>{const a=i.trim();return!a||!n.has(a)?"":`__var__${a}__`}).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-._/]+/g,"").replace(/--+/g,"-").replace(/^[-/]+|[-/]+$/g,"").replace(/__var__([a-zA-Z0-9_]+)__/g,(o,i)=>`{{ ${i} }}`)};async function Aw({path:e,baseApiUrl:t,method:n="GET",headers:s={},params:r,body:o}){const a=`${t||Hf({isDev:!1,isStage:!1})}${e}`,l={method:n,headers:{"Content-Type":"application/json",...s}};o&&(l.body=JSON.stringify(o));const u=r?new URLSearchParams(r).toString():"",d=u?`?${u}`:"",f=await fetch(`${a}${d}`,l);if(!f.ok)throw new Error(`HTTP error! status: ${f.status}`);return f.json()}var Ko=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(Ko||{}),nn=(e=>(e.Info="info",e.Error="error",e.Success="success",e.Warning="warning",e))(nn||{}),ie=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))(ie||{}),Tn=(e=>(e.layoutToggleId="studio:layoutToggle:",e.toggleBlocksPanel="studio:toggleBlocksPanel",e.pageSettingsUpdate="studio:pageSettingsUpdate",e.toggleDataSourcesPreview="studio:toggleDataSourcesPreview",e))(Tn||{}),Nr=(e=>(e.dark="dark",e.light="light",e.auto="auto",e))(Nr||{}),yt=(e=>(e.web="web",e.email="email",e.document="document",e.react="react",e))(yt||{});const Th={[Ko.free]:0,[Ko.startup]:10,[Ko.business]:20,[Ko.enterprise]:30};function Nw(e){const t=e;return t.init=n=>s=>e(s,n),t}const Mw=e=>Nw(e);async function Lw({editor:e,plan:t,pluginName:n,licenseKey:s,onLicenseCheckResponse:r,cleanup:o}){let i="",a=!1;const l=Ff(),u=f=>{console.warn("Cleanup plugin:",n,"Reason:",f),o()},d=(f={})=>{var v;const{error:p,sdkLicense:g}=f,m=(v=f.plan)==null?void 0:v.category;if(!(g||f.license)||p)u(p||"Invalid license");else if(m){const x=Th[t],y=Th[m];x>y&&u({pluginRequiredPlan:t,licensePlan:m})}};e.on(sb,f=>{i=f==null?void 0:f.baseApiUrl,a=!0}),e.on(Id,f=>{r==null||r(f),d(f)}),setTimeout(async()=>{if(!a){if(l)return;if(s){const f=await Rw({licenseKey:s,pluginName:n,baseApiUrl:i});r==null||r(f),f&&d(f)}else u("The `licenseKey` option not provided")}},2e3)}async function Rw(e){const{licenseKey:t,pluginName:n,baseApiUrl:s}=e;try{return(await Aw({baseApiUrl:s,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:n}})).result||{}}catch(r){return console.error("Error during SDK license check:",r),!1}}const Kt={accessToken:""},$w=()=>{Kt.timeout&&(clearTimeout(Kt.timeout),Kt.timeout=void 0),Kt.accessToken="",Kt.license=void 0},ib=async()=>{var t;let e={accessToken:""};try{const n=await((t=Kt.getAccessToken)==null?void 0:t.call(Kt));n&&(e=n)}catch(n){console.error(n)}if(!(e!=null&&e.accessToken)){Kt.getAccessToken&&console.error("Failed to get access token");return}if(Kt.accessToken=e.accessToken,e.expiresAt){const n=new Date(e.expiresAt).getTime();clearTimeout(Kt.timeout||void 0),Kt.timeout=setTimeout(ib,n-Date.now()-1)}},ab=e=>{var t;return((t=e.getModel().attributes.customData)==null?void 0:t.projectType)||"web"},kw=e=>ab(e)==="email",Yo=(e,t={})=>{var p;const{selectedComponents:n=[],withPageContent:s=!1,imageUrls:r=[]}=t,o=e.Pages.getSelected(),i=e.getSelected(),a=ab(e),l=Iw(e),u=l.length<=1&&((p=e.getWrapper())==null?void 0:p.components().length)===0,d=o?{id:o.getId(),name:o.getName(),content:s?zw(e):void 0}:void 0,f=i?{id:i.getId(),content:i.toHTML()}:void 0;return{isNewProject:u,selectedPage:d,selectedComponent:f,selectedComponents:n.map(g=>({id:g.getId(),content:""})),projectType:a,availablePages:l,globalStyles:Vw(e),installedPlugins:Dw(e),devices:Bw(e),isEmail:a==="email",imageUrls:r}},sn=(e,t,n)=>{const{layoutComponents:s}=n||{},r=t,o=r.type,i=o?s==null?void 0:s[o]:void 0,a=i?{...r,...i({editor:e,props:t})}:t;return e.runCommand(ie.layoutComponentRender,{components:a})};function Vw(e){return e.Css.getAll().filter(t=>!!t.get("groups")).map(t=>t.toCSS()).join(`
2
- `)}const Iw=e=>e.Pages.getAll().map(t=>({id:String(t.id),name:t.getName()})),Dw=e=>{const t=Fw(e);return(t==null?void 0:t.filter(n=>!!n.instructions).map(n=>({id:n.id,instructions:n.instructions})))||[]},Hw=e=>e.getModel().get("customData")??{},Fw=e=>e&&Hw(e).plugins||[];function Bw(e){return e.Devices.getAll().map(t=>t.toJSON())}function Ta(e){let t=e;return["generated_mjml","generated_html","generated_code"].forEach(n=>{t=t.replaceAll(`<${n}>`,"").replaceAll(`</${n}>`,"")}),t}const uo=(e="",t,n={})=>{!t||!e||(t.innerHTML=Ta(e),!n.skipScroll&&(t.insertAdjacentHTML("beforeend","<div></div>"),requestAnimationFrame(()=>{var s;return(s=t==null?void 0:t.lastElementChild)==null?void 0:s.scrollIntoView({block:"nearest"})})))},lb=e=>(e==null?void 0:e.toHTML({asDocument:!0,attributes:(t,n)=>(n&&(n.id=t.getId()),n)}))||"";function fo(e){const{Canvas:t,em:n}=e;t.getConfig().scrollableCanvas?t.toggleFramesEvents(!1):n.stopDefault()}function po(e){const{Canvas:t,em:n}=e;t.getConfig().scrollableCanvas?t.toggleFramesEvents(!0):n.runDefault()}const il=e=>{var o;const{error:t,abortMsg:n,msg:s}=e,r=t.name==="AbortError"||((o=t.message)==null?void 0:o.includes("abort"));return r||console.error(t),{error:r?n:s,abortedByUser:r?!0:void 0}};function zw(e){const t=e.getWrapper(),n=lb(t);return`<style>${e.getCss()||""}</style>${n}`}const cb=e=>{const{Components:t}=e,n=["STYLE","SCRIPT"],s=new Map,r=document.createElement("div");r.setAttribute("data-temp-els","true");const o=(i,a)=>{try{a.innerHTML=i.innerHTML,Array.from(i.attributes).forEach(l=>a.setAttribute(l.name,l.value))}catch{}};return{cleanup(){r==null||r.remove()},update:i=>{var p;const a=new DOMParser,l=Ta(i),u=a.parseFromString(`<body>${l}</body>`,"text/html"),d=Array.from(u.body.children),f=e.getWrapper();return(p=f==null?void 0:f.getEl())==null||p.appendChild(r),d.forEach(g=>{var b,v;let m=g.id;if(m){const x=s.get(m),y=t.getById(m),w=y==null?void 0:y.getEl();w&&(o(g,w),!x&&requestAnimationFrame(()=>w==null?void 0:w.scrollIntoView({block:"nearest"}))),s.set(m,{cmp:y,cmpEl:w,newNode:g})}else if(n.includes(g.tagName)){m=[((b=g.tagName)==null?void 0:b.toLowerCase())||"",...Array.from(g.attributes).map(y=>`${y.name}=${y.value}`)].join("__");const x=(v=s.get(m))==null?void 0:v.newNode;x?o(g,x):(r.appendChild(g),s.set(m,{newNode:g}))}}),s}}},ub=(e,t)=>{var u,d;const n=e.em.getEditor(),{Parser:s,Css:r}=n,{html:o,css:i}=s.parseHtml(t,{returnArray:!0}),a=o[0];e.getId()===((u=a==null?void 0:a.attributes)==null?void 0:u.id)?(e.components().reset(a.components),e.addAttributes({...a==null?void 0:a.attributes,class:(d=a==null?void 0:a.classes)==null?void 0:d.join(" ")}),i&&r.addCollection(i,{extend:!0})):e.components(t)};var es=(e=>(e.ADD_NEW_COMPONENT="addNewComponent",e.EDIT_COMPONENT="editComponent",e.REMOVE_COMPONENT="removeComponent",e.MOVE_COMPONENT="moveComponent",e.ADD_NEW_PAGE="addNewPage",e.ADD_NEW_PROJECT_PAGE="addNewProjectPage",e.GET_PAGE_CONTENT="getPageContent",e.LIST_PAGES="listPages",e.FETCH_WEBSITE="fetchWebsite",e.SHOW_PANEL="showPanel",e))(es||{}),Xs=(e=>(e.ADD_COMPONENT_CODE="addComponentCode",e.EDIT_COMPONENT_CODE="editComponentCode",e.ADD_PAGE_CODE="addPageCode",e.ADD_PROJECT_PAGE_CODE="addProjectPageCode",e))(Xs||{}),Ss=(e=>(e.getChatManager="aiChat:getChatManager",e.getChatState="aiChat:getChatState",e.getChatApi="aiChat:getChatApi",e))(Ss||{});function db(e,t){var g;const{componentId:n,position:s}=t;fo(e);const r=document.createElement("div");r.style.display="contents";const{Components:o}=e;let a=o.getById(n)||e.getSelected(),l=a==null?void 0:a.parent();const u=a==null?void 0:a.index(),d=a==null?void 0:a.getEl();let f="afterend",p;switch(s){case"before":f="beforebegin",a=l,p=u;break;case"beforeInside":f="afterbegin",p=0;break;case"afterInside":f="beforeend";break;case"after":f="afterend",a=l,p=(u??0)+1;break}return a||(a=e.getWrapper(),l=a,p=void 0),d?d==null||d.insertAdjacentElement(f,r):(g=l==null?void 0:l.getEl())==null||g.appendChild(r),{target:a,at:p,domPosition:f,tempTargetEl:d,tempDOM:r,cleanUp(){r==null||r.remove(),po(e)}}}function fb(e,t,n){const{target:s,at:r}=t,o=s==null?void 0:s.append(n,{at:r})[0];return o&&e.select(o),o}function Uw(e){const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const l=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){a||(a={type:Xs.ADD_COMPONENT_CODE,toolSetup:db(t,r.input),content:""},s.set(o,a)),i==="streaming"&&r.content&&(a.content=r.content,uo(r.content,a.toolSetup.tempDOM,{skipScroll:!0}));return}if(i==="done"&&a&&r.content){if(a.completed)return;fb(t,a.toolSetup,r.content),a.completed=!0,l()}if(i==="error"){l();return}}function Ww(e){fo(e);const t=cb(e);return{toUpdate:t,mapUpdates:new Map,cleanUp(){t.cleanup(),po(e)}}}function Gw(e,t){const n=e.getWrapper();t.mapUpdates.forEach(s=>{const{cmp:r,newNode:o}=s,{outerHTML:i}=o;r?ub(r,i):n==null||n.append(i)})}function qw(e){const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const l=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){a||(a={type:Xs.EDIT_COMPONENT_CODE,toolSetup:Ww(t),content:""},s.set(o,a)),i==="streaming"&&r.content&&(a.content=r.content,a.toolSetup.mapUpdates=a.toolSetup.toUpdate.update(r.content));return}if(i==="done"&&a&&r.content){if(a.completed)return;a.toolSetup.mapUpdates=a.toolSetup.toUpdate.update(r.content),Gw(t,a.toolSetup),a.completed=!0,l()}if(i==="error"){l();return}}function Kw(e,t){const{name:n}=t,{Pages:s,Components:r}=e;fo(e);const o=s.add({name:n,component:"<h1></h1>"},{select:!0}),i=o.getMainComponent();return i.once(r.events.render,()=>{const a=i.getEl();a&&uo(`<h1 style="font-family: system-ui; font-size: 2rem; font-weight: 300; text-align: center; padding: 1rem">
1
+ "use strict";const x1=require("@ai-sdk/react"),xr=require("ai"),l=require("react/jsx-runtime"),f=require("react"),Mn=require("react-dom"),yx=require("react-dom/client"),xx=require("marked"),wx=require("react-markdown"),Sx=require("remark-gfm");function w1(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const Xe=w1(f),Cx=w1(Mn),S1="app.grapesjs.com",C1="app-stage.grapesjs.com",jx="app2.grapesjs.com",Ex="app-stage2.grapesjs.com",oh=[S1,jx,C1,Ex,"localhost","127.0.0.1",".local-credentialless.webcontainer.io",".local.webcontainer.io","-sandpack.codesandbox.io"],j1="license:check:start",yd="license:check:end",Ts=()=>typeof window<"u",ao=e=>e&&e.stopPropagation(),Px=e=>e.getAttributeNames().reduce((t,n)=>({...t,[n]:e.getAttribute(n)||""}),{}),Tx=(e,t)=>{const n=s=>s.key===e&&t();return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},Ox=(e="")=>{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},_x=e=>Tx("Escape",e),Ax=(e,t={})=>{const n=nt(e)?{id:e,src:e}:e;return new Promise((s,r)=>{var h,g;const{loadedScripts:o}=t,{id:i,src:a}=n,c=document.querySelector(`script[src="${a}"]`);if(c){if((h=t.onScript)==null||h.call(t,c),o&&!o.get(a)){c.addEventListener("load",()=>s(i)),c.addEventListener("error",()=>r(i));return}return s(i)}const u=window.define;window.define=void 0;const d=()=>{o==null||o.set(a,!0),window.define=u},p=document.createElement("script");p.src=a,p.onload=()=>{s(i),d()},p.onerror=()=>{r(i),d()},document.head.appendChild(p),(g=t.onScript)==null||g.call(t,p)})},Mx=e=>{const t=e.map(n=>Ax(n));return Promise.allSettled(t)};function Lx(e){const t=e.ownerDocument.createElement("script");return t.text=e.innerHTML,Array.from(e.attributes).forEach(n=>t.setAttribute(n.nodeName,n.nodeValue)),t}function ih(e){const t=s=>{var r;if(s.length){const o=s.shift(),i=Lx(o);i.onerror=i.onload=t.bind(null,s),(r=o.parentNode)==null||r.replaceChild(i,o)}},n=Array.from(e.querySelectorAll("script"));t(n)}const E1=e=>new DOMParser().parseFromString(e,"text/html"),Nx=(e="")=>E1(`<body>${e}</body>`).body.innerHTML,$x=(e="")=>E1(`<head>${e}</head>`).head.innerHTML,kx=(e="",t)=>{const s=new DOMParser().parseFromString(e,"text/html");if(t){const o=s.querySelectorAll("svg")[0].style||{},i=Fx(t)?`${t}px`:t;o.width=i,o.height=i,o.fill="currentColor"}return new XMLSerializer().serializeToString(s)},yp=({isDev:e,isStage:t,isPlatform:n})=>`${e?"":`https://${t?C1:S1}`}/${n?"platform-api":"api"}`,Rx=(e,t)=>{try{return new RegExp(e,t)}catch{console.warn("Failed to create regexp",e);return}},P1=(e={})=>{const{width:t=300,height:n,text:s="IMAGE",bg:r="777",fg:o="white"}=e,i=n?`x${n}`:"";return`https://placehold.co/${t}${i}/${r}/${o}.png?text=${s}`},Ix=P1(),xp=()=>{const e=Ts()&&window.location.hostname;return!!e&&(oh.includes(e)||oh.some(t=>e.endsWith(t)))},vs=e=>e&&e.charAt(0).toUpperCase()+e.substring(1),Vx=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase()),Hx=()=>{},Dx=240,At=e=>typeof e<"u",nt=e=>typeof e=="string",Fx=e=>typeof e=="number";function Ke(e){return typeof e=="function"}function tr(e){return e&&!Array.isArray(e)&&typeof e=="object"}const Bx=e=>!e||Object.keys(e).length===0,Go=(e,t)=>{const n=(e||"").toLocaleLowerCase(),s=(t||"").toLocaleLowerCase();return n.includes(s)},zx=(e="")=>{const t=e[0]==="?"?e.substring(1):e,n=new URLSearchParams(t);return Object.fromEntries(n)},Ux=(e=16)=>{let t="";const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=n.length;for(let r=0;r<e;r++)t+=n.charAt(Math.floor(Math.random()*s));return t},Wx=e=>!!e.Components.getType("mjml"),mc=e=>(e||"").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-._]+/g,"").replace(/--+/g,"-").trim(),Gx=(e,t=[])=>{const n=new Set(t);return(e||"").trim().replace(/\{\{\s*([a-zA-Z0-9_]*)\s*\}\}/g,(o,i)=>{const a=i.trim();return!a||!n.has(a)?"":`__var__${a}__`}).replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-._/]+/g,"").replace(/--+/g,"-").replace(/^[-/]+|[-/]+$/g,"").replace(/__var__([a-zA-Z0-9_]+)__/g,(o,i)=>`{{ ${i} }}`)};async function qx({path:e,baseApiUrl:t,method:n="GET",headers:s={},params:r,body:o}){const a=`${t||yp({isDev:!1,isStage:!1})}${e}`,c={method:n,headers:{"Content-Type":"application/json",...s}};o&&(c.body=JSON.stringify(o));const u=r?new URLSearchParams(r).toString():"",d=u?`?${u}`:"",p=await fetch(`${a}${d}`,c);if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);return p.json()}var Vo=(e=>(e.free="free",e.startup="startup",e.business="business",e.enterprise="enterprise",e))(Vo||{}),Jt=(e=>(e.Info="info",e.Error="error",e.Success="success",e.Warning="warning",e))(Jt||{}),se=(e=>(e.toastAdd="studio:toastAdd",e.toastRemove="studio:toastRemove",e.dialogOpen="studio:dialogOpen",e.dialogClose="studio:dialogClose",e.dialogExportCode="studio:dialogExportCode",e.sidebarLeftSet="studio:sidebarLeft:set",e.sidebarLeftGet="studio:sidebarLeft:get",e.sidebarLeftToggle="studio:sidebarLeft:toggle",e.sidebarRightSet="studio:sidebarRight:set",e.sidebarRightGet="studio:sidebarRight:get",e.sidebarRightToggle="studio:sidebarRight:toggle",e.sidebarTopSet="studio:sidebarTop:set",e.sidebarTopGet="studio:sidebarTop:get",e.sidebarTopToggle="studio:sidebarTop:toggle",e.sidebarBottomSet="studio:sidebarBottom:set",e.sidebarBottomGet="studio:sidebarBottom:get",e.sidebarBottomToggle="studio:sidebarBottom:toggle",e.symbolAdd="studio:symbolAdd",e.symbolDetach="studio:symbolDetach",e.symbolOverride="studio:symbolOverride",e.symbolPropagateStyles="studio:propagateStyles",e.getPagesConfig="studio:getPagesConfig",e.setPagesConfig="studio:setPagesConfig",e.getPageSettings="studio:getPageSettings",e.setPageSettings="studio:setPageSettings",e.clearPage="studio:clearPage",e.projectFiles="studio:projectFiles",e.validateCode="studio:validateCode",e.canvasReload="studio:canvasReload",e.getBlocksPanel="studio:getBlocksPanel",e.setBlocksPanel="studio:setBlocksPanel",e.getStateContextMenu="studio:getStateContextMenu",e.setStateContextMenu="studio:setStateContextMenu",e.contextMenuComponent="studio:contextMenuComponent",e.layoutAdd="studio:layoutAdd",e.layoutRemove="studio:layoutRemove",e.layoutToggle="studio:layoutToggle",e.layoutUpdate="studio:layoutUpdate",e.layoutGet="studio:layoutGet",e.layoutConfigGet="studio:layoutConfigGet",e.layoutConfigSet="studio:layoutConfigSet",e.layoutComponentAdd="studio:layoutComponentAdd",e.layoutComponentGet="studio:layoutComponentGet",e.layoutComponentRemove="studio:layoutComponentRemove",e.layoutComponentRender="studio:layoutComponentRender",e.getStateTheme="studio:getStateTheme",e.setStateTheme="studio:setStateTheme",e.assetProviderGet="studio:assetProviderGet",e.assetProviderAdd="studio:assetProviderAdd",e.assetProviderRemove="studio:assetProviderRemove",e.fontGet="studio:fontGet",e.fontAdd="studio:fontAdd",e.fontRemove="studio:fontRemove",e.fontManagerOpen="studio:fontManagerOpen",e.menuFontLoad="studio:menuFontLoad",e.toggleStateDataSource="studio:toggleStateDataSource",e.getStateDataSource="studio:getStateDataSource",e.dataSourceSetGlobalData="studio:dataSourceSetGlobalData",e.dataSourceSetImporter="studio:dataSourceSetImporter",e.dataSourceSetExporter="studio:dataSourceSetExporter",e.setDragAbsolute="studio:setDragAbsolute",e))(se||{}),xn=(e=>(e.layoutToggleId="studio:layoutToggle:",e.toggleBlocksPanel="studio:toggleBlocksPanel",e.pageSettingsUpdate="studio:pageSettingsUpdate",e.toggleDataSourcesPreview="studio:toggleDataSourcesPreview",e))(xn||{}),wr=(e=>(e.dark="dark",e.light="light",e.auto="auto",e))(wr||{}),mt=(e=>(e.web="web",e.email="email",e.document="document",e.react="react",e))(mt||{});const ah={[Vo.free]:0,[Vo.startup]:10,[Vo.business]:20,[Vo.enterprise]:30};function Kx(e){const t=e;return t.init=n=>s=>e(s,n),t}const Zx=e=>Kx(e);async function Yx({editor:e,plan:t,pluginName:n,licenseKey:s,onLicenseCheckResponse:r,cleanup:o}){let i="",a=!1;const c=xp(),u=p=>{console.warn("Cleanup plugin:",n,"Reason:",p),o()},d=(p={})=>{var v;const{error:h,sdkLicense:g}=p,m=(v=p.plan)==null?void 0:v.category;if(!(g||p.license)||h)u(h||"Invalid license");else if(m){const x=ah[t],y=ah[m];x>y&&u({pluginRequiredPlan:t,licensePlan:m})}};e.on(j1,p=>{i=p==null?void 0:p.baseApiUrl,a=!0}),e.on(yd,p=>{r==null||r(p),d(p)}),setTimeout(async()=>{if(!a){if(c)return;if(s){const p=await Xx({licenseKey:s,pluginName:n,baseApiUrl:i});r==null||r(p),p&&d(p)}else u("The `licenseKey` option not provided")}},2e3)}async function Xx(e){const{licenseKey:t,pluginName:n,baseApiUrl:s}=e;try{return(await qx({baseApiUrl:s,path:`/sdk/${t||"na"}`,method:"POST",params:{d:window.location.hostname,pn:n}})).result||{}}catch(r){return console.error("Error during SDK license check:",r),!1}}const Ut={accessToken:""},Jx=()=>{Ut.timeout&&(clearTimeout(Ut.timeout),Ut.timeout=void 0),Ut.accessToken="",Ut.license=void 0},T1=async()=>{var t;let e={accessToken:""};try{const n=await((t=Ut.getAccessToken)==null?void 0:t.call(Ut));n&&(e=n)}catch(n){console.error(n)}if(!(e!=null&&e.accessToken)){Ut.getAccessToken&&console.error("Failed to get access token");return}if(Ut.accessToken=e.accessToken,e.expiresAt){const n=new Date(e.expiresAt).getTime();clearTimeout(Ut.timeout||void 0),Ut.timeout=setTimeout(T1,n-Date.now()-1)}},O1=e=>{var t;return((t=e.getModel().attributes.customData)==null?void 0:t.projectType)||"web"},Qx=e=>O1(e)==="email",Ho=(e,t={})=>{var h;const{selectedComponents:n=[],withPageContent:s=!1,imageUrls:r=[]}=t,o=e.Pages.getSelected(),i=e.getSelected(),a=O1(e),c=tw(e),u=c.length<=1&&((h=e.getWrapper())==null?void 0:h.components().length)===0,d=o?{id:o.getId(),name:o.getName(),content:s?iw(e):void 0}:void 0,p=i?{id:i.getId(),content:i.toHTML()}:void 0;return{isNewProject:u,selectedPage:d,selectedComponent:p,selectedComponents:n.map(g=>({id:g.getId(),content:""})),projectType:a,availablePages:c,globalStyles:ew(e),installedPlugins:nw(e),devices:ow(e),isEmail:a==="email",imageUrls:r}},Qt=(e,t,n)=>{const{layoutComponents:s}=n||{},r=t,o=r.type,i=o?s==null?void 0:s[o]:void 0,a=i?{...r,...i({editor:e,props:t})}:t;return e.runCommand(se.layoutComponentRender,{components:a})};function ew(e){return e.Css.getAll().filter(t=>!!t.get("groups")).map(t=>t.toCSS()).join(`
2
+ `)}const tw=e=>e.Pages.getAll().map(t=>({id:String(t.id),name:t.getName()})),nw=e=>{const t=rw(e);return(t==null?void 0:t.filter(n=>!!n.instructions).map(n=>({id:n.id,instructions:n.instructions})))||[]},sw=e=>e.getModel().get("customData")??{},rw=e=>e&&sw(e).plugins||[];function ow(e){return e.Devices.getAll().map(t=>t.toJSON())}function ma(e){let t=e;return["generated_mjml","generated_html","generated_code"].forEach(n=>{t=t.replaceAll(`<${n}>`,"").replaceAll(`</${n}>`,"")}),t}const eo=(e="",t,n={})=>{!t||!e||(t.innerHTML=ma(e),!n.skipScroll&&(t.insertAdjacentHTML("beforeend","<div></div>"),requestAnimationFrame(()=>{var s;return(s=t==null?void 0:t.lastElementChild)==null?void 0:s.scrollIntoView({block:"nearest"})})))},_1=e=>(e==null?void 0:e.toHTML({asDocument:!0,attributes:(t,n)=>(n&&(n.id=t.getId()),n)}))||"";function to(e){const{Canvas:t,em:n}=e;t.getConfig().scrollableCanvas?t.toggleFramesEvents(!1):n.stopDefault()}function no(e){const{Canvas:t,em:n}=e;t.getConfig().scrollableCanvas?t.toggleFramesEvents(!0):n.runDefault()}const Za=e=>{var o;const{error:t,abortMsg:n,msg:s}=e,r=t.name==="AbortError"||((o=t.message)==null?void 0:o.includes("abort"));return r||console.error(t),{error:r?n:s,abortedByUser:r?!0:void 0}};function iw(e){const t=e.getWrapper(),n=_1(t);return`<style>${e.getCss()||""}</style>${n}`}const A1=e=>{const{Components:t}=e,n=["STYLE","SCRIPT"],s=new Map,r=document.createElement("div");r.setAttribute("data-temp-els","true");const o=(i,a)=>{try{a.innerHTML=i.innerHTML,Array.from(i.attributes).forEach(c=>a.setAttribute(c.name,c.value))}catch{}};return{cleanup(){r==null||r.remove()},update:i=>{var h;const a=new DOMParser,c=ma(i),u=a.parseFromString(`<body>${c}</body>`,"text/html"),d=Array.from(u.body.children),p=e.getWrapper();return(h=p==null?void 0:p.getEl())==null||h.appendChild(r),d.forEach(g=>{var b,v;let m=g.id;if(m){const x=s.get(m),y=t.getById(m),w=y==null?void 0:y.getEl();w&&(o(g,w),!x&&requestAnimationFrame(()=>w==null?void 0:w.scrollIntoView({block:"nearest"}))),s.set(m,{cmp:y,cmpEl:w,newNode:g})}else if(n.includes(g.tagName)){m=[((b=g.tagName)==null?void 0:b.toLowerCase())||"",...Array.from(g.attributes).map(y=>`${y.name}=${y.value}`)].join("__");const x=(v=s.get(m))==null?void 0:v.newNode;x?o(g,x):(r.appendChild(g),s.set(m,{newNode:g}))}}),s}}},M1=(e,t)=>{var u,d;const n=e.em.getEditor(),{Parser:s,Css:r}=n,{html:o,css:i}=s.parseHtml(t,{returnArray:!0}),a=o[0];e.getId()===((u=a==null?void 0:a.attributes)==null?void 0:u.id)?(e.components().reset(a.components),e.addAttributes({...a==null?void 0:a.attributes,class:(d=a==null?void 0:a.classes)==null?void 0:d.join(" ")}),i&&r.addCollection(i,{extend:!0})):e.components(t)};var zn=(e=>(e.ADD_NEW_COMPONENT="addNewComponent",e.EDIT_COMPONENT="editComponent",e.REMOVE_COMPONENT="removeComponent",e.MOVE_COMPONENT="moveComponent",e.ADD_NEW_PAGE="addNewPage",e.ADD_NEW_PROJECT_PAGE="addNewProjectPage",e.GET_PAGE_CONTENT="getPageContent",e.LIST_PAGES="listPages",e.FETCH_WEBSITE="fetchWebsite",e.SHOW_PANEL="showPanel",e))(zn||{}),Fs=(e=>(e.ADD_COMPONENT_CODE="addComponentCode",e.EDIT_COMPONENT_CODE="editComponentCode",e.ADD_PAGE_CODE="addPageCode",e.ADD_PROJECT_PAGE_CODE="addProjectPageCode",e))(Fs||{}),ps=(e=>(e.getChatManager="aiChat:getChatManager",e.getChatState="aiChat:getChatState",e.getChatApi="aiChat:getChatApi",e))(ps||{});function L1(e,t){var g;const{componentId:n,position:s}=t;to(e);const r=document.createElement("div");r.style.display="contents";const{Components:o}=e;let a=o.getById(n)||e.getSelected(),c=a==null?void 0:a.parent();const u=a==null?void 0:a.index(),d=a==null?void 0:a.getEl();let p="afterend",h;switch(s){case"before":p="beforebegin",a=c,h=u;break;case"beforeInside":p="afterbegin",h=0;break;case"afterInside":p="beforeend";break;case"after":p="afterend",a=c,h=(u??0)+1;break}return a||(a=e.getWrapper(),c=a,h=void 0),d?d==null||d.insertAdjacentElement(p,r):(g=c==null?void 0:c.getEl())==null||g.appendChild(r),{target:a,at:h,domPosition:p,tempTargetEl:d,tempDOM:r,cleanUp(){r==null||r.remove(),no(e)}}}function N1(e,t,n){const{target:s,at:r}=t,o=s==null?void 0:s.append(n,{at:r})[0];return o&&e.select(o),o}function aw(e){const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const c=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){a||(a={type:Fs.ADD_COMPONENT_CODE,toolSetup:L1(t,r.input),content:""},s.set(o,a)),i==="streaming"&&r.content&&(a.content=r.content,eo(r.content,a.toolSetup.tempDOM,{skipScroll:!0}));return}if(i==="done"&&a&&r.content){if(a.completed)return;N1(t,a.toolSetup,r.content),a.completed=!0,c()}if(i==="error"){c();return}}function lw(e){to(e);const t=A1(e);return{toUpdate:t,mapUpdates:new Map,cleanUp(){t.cleanup(),no(e)}}}function cw(e,t){const n=e.getWrapper();t.mapUpdates.forEach(s=>{const{cmp:r,newNode:o}=s,{outerHTML:i}=o;r?M1(r,i):n==null||n.append(i)})}function uw(e){const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const c=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){a||(a={type:Fs.EDIT_COMPONENT_CODE,toolSetup:lw(t),content:""},s.set(o,a)),i==="streaming"&&r.content&&(a.content=r.content,a.toolSetup.mapUpdates=a.toolSetup.toUpdate.update(r.content));return}if(i==="done"&&a&&r.content){if(a.completed)return;a.toolSetup.mapUpdates=a.toolSetup.toUpdate.update(r.content),cw(t,a.toolSetup),a.completed=!0,c()}if(i==="error"){c();return}}function dw(e,t){const{name:n}=t,{Pages:s,Components:r}=e;to(e);const o=s.add({name:n,component:"<h1></h1>"},{select:!0}),i=o.getMainComponent();return i.once(r.events.render,()=>{const a=i.getEl();a&&eo(`<h1 style="font-family: system-ui; font-size: 2rem; font-weight: 300; text-align: center; padding: 1rem">
3
3
  Generating ${n?`"${n}" `:""}page...
4
- </h1>`,a,{skipScroll:!0})}),{pageId:o.getId(),cmpRoot:i,cleanUp(){po(e)}}}function Yw(e,t){const{cmpRoot:n}=e;n.components(t)}function Zw(e){const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const l=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){if(a||(a={type:Xs.ADD_PAGE_CODE,toolSetup:Kw(t,r.input),content:""},s.set(o,a)),i==="streaming"&&r.content){a.content=r.content;const u=a.toolSetup.cmpRoot.getEl();u&&uo(r.content,u,{skipScroll:!0})}return}if(i==="done"&&a&&r.content){if(a.completed)return;Yw(a.toolSetup,r.content),a.completed=!0,l()}if(i==="error"){l();return}}function Xw(e){fo(e);const t=e.getWrapper(),n=Yo(e);return{cmpRoot:t,isEmail:n.isEmail,pageName:"",cleanUp(){po(e)}}}function Jw(e,t,n){var r;const{Pages:s}=e;e.loadProjectData({pages:[{name:n,component:t}]}),(r=s.getSelected())==null||r.setName(n)}const pb="mjml-code-to-html";function Qw(e){var u;const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const l=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){if(a||(a={type:Xs.ADD_PROJECT_PAGE_CODE,toolSetup:Xw(t),content:""},s.set(o,a)),i==="streaming"&&r.content){a.content=r.content;const{isEmail:d,cmpRoot:f}=a.toolSetup,p=f.getEl();let g=r.content;if(d){const m=Ta(g);try{const b=(u=t.runCommand(pb,{mjml:m}))==null?void 0:u.html;b&&(g=b)}catch{}}p&&uo(g,p,{skipScroll:!0})}return}if(i==="done"&&a&&r.content){if(a.completed)return;Jw(t,r.content,r.input.name),a.completed=!0,l()}if(i==="error"){l();return}}const hb={[Xs.ADD_COMPONENT_CODE]:Uw,[Xs.EDIT_COMPONENT_CODE]:qw,[Xs.ADD_PAGE_CODE]:Zw,[Xs.ADD_PROJECT_PAGE_CODE]:Qw},eS=({editor:e,data:t,toolStatusProgress:n})=>{var i;if(t.type!=="data-tool-status")return;const s=t,r=((i=s.data)==null?void 0:i.name)||"",o=hb[r];o?o({editor:e,toolStatus:s,toolStatusProgress:n}):tS({toolStatus:s,toolStatusProgress:n})};function tS({toolStatus:e,toolStatusProgress:t}){const{id:n,data:s}=e;if(!n||!s)return;const{status:r,content:o}=s;let i=t.get(n);i||(i={type:"generic",content:"",completed:!1},t.set(n,i)),r==="streaming"&&o&&(i.content=o),r==="done"&&(o&&(i.content=o),t.delete(n)),r==="error"&&t.delete(n)}const nS={addComponent:"/api/ai/add-component-stream",editComponent:"/api/ai/edit-component-stream",addPage:"/api/ai/add-page-stream",generateProject:"/api/ai/generate-project-stream",scrapeWebsite:"/api/ai/scrape-website"};async function al(e,t,n={}){var u;const{onContent:s,abortController:r}=n,o=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:r==null?void 0:r.signal});if(!o.ok)throw new Error(`Failed to fetch: ${o.statusText}`);const i=(u=o.body)==null?void 0:u.getReader();if(!i)throw new Error("No reader available");const a=new TextDecoder;let l="";for(;;){if(r!=null&&r.signal.aborted){i.cancel();break}const{done:d,value:f}=await i.read();if(d)break;const p=a.decode(f);l+=p,s==null||s(l)}return Ta(l)}function Eu({lastUserMessage:e}){return(e==null?void 0:e.parts.filter(t=>Ar.isTextUIPart(t)).map(t=>t.text).join(""))||""}function sS(e,t={}){const n={...nS,...t},s={async execute(g,m){const{plan:b,name:v,imageUrls:x}=g,y=Eu(m);let w;try{w=db(e,g);const{tempDOM:S}=w,C=await al(n.addComponent,{userPrompt:`${y}
4
+ </h1>`,a,{skipScroll:!0})}),{pageId:o.getId(),cmpRoot:i,cleanUp(){no(e)}}}function pw(e,t){const{cmpRoot:n}=e;n.components(t)}function fw(e){const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const c=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){if(a||(a={type:Fs.ADD_PAGE_CODE,toolSetup:dw(t,r.input),content:""},s.set(o,a)),i==="streaming"&&r.content){a.content=r.content;const u=a.toolSetup.cmpRoot.getEl();u&&eo(r.content,u,{skipScroll:!0})}return}if(i==="done"&&a&&r.content){if(a.completed)return;pw(a.toolSetup,r.content),a.completed=!0,c()}if(i==="error"){c();return}}function hw(e){to(e);const t=e.getWrapper(),n=Ho(e);return{cmpRoot:t,isEmail:n.isEmail,pageName:"",cleanUp(){no(e)}}}function gw(e,t,n){var r;const{Pages:s}=e;e.loadProjectData({pages:[{name:n,component:t}]}),(r=s.getSelected())==null||r.setName(n)}const $1="mjml-code-to-html";function mw(e){var u;const{editor:t,toolStatus:n,toolStatusProgress:s}=e,{data:r,id:o}=n,{status:i}=r;let a=s.get(o);const c=()=>{a==null||a.toolSetup.cleanUp(),s.delete(o)};if(i==="in-progress"||i==="streaming"){if(a||(a={type:Fs.ADD_PROJECT_PAGE_CODE,toolSetup:hw(t),content:""},s.set(o,a)),i==="streaming"&&r.content){a.content=r.content;const{isEmail:d,cmpRoot:p}=a.toolSetup,h=p.getEl();let g=r.content;if(d){const m=ma(g);try{const b=(u=t.runCommand($1,{mjml:m}))==null?void 0:u.html;b&&(g=b)}catch{}}h&&eo(g,h,{skipScroll:!0})}return}if(i==="done"&&a&&r.content){if(a.completed)return;gw(t,r.content,r.input.name),a.completed=!0,c()}if(i==="error"){c();return}}const k1={[Fs.ADD_COMPONENT_CODE]:aw,[Fs.EDIT_COMPONENT_CODE]:uw,[Fs.ADD_PAGE_CODE]:fw,[Fs.ADD_PROJECT_PAGE_CODE]:mw},bw=({editor:e,data:t,toolStatusProgress:n})=>{var i;if(t.type!=="data-tool-status")return;const s=t,r=((i=s.data)==null?void 0:i.name)||"",o=k1[r];o?o({editor:e,toolStatus:s,toolStatusProgress:n}):vw({toolStatus:s,toolStatusProgress:n})};function vw({toolStatus:e,toolStatusProgress:t}){const{id:n,data:s}=e;if(!n||!s)return;const{status:r,content:o}=s;let i=t.get(n);i||(i={type:"generic",content:"",completed:!1},t.set(n,i)),r==="streaming"&&o&&(i.content=o),r==="done"&&(o&&(i.content=o),t.delete(n)),r==="error"&&t.delete(n)}const yw={addComponent:"/api/ai/add-component-stream",editComponent:"/api/ai/edit-component-stream",addPage:"/api/ai/add-page-stream",generateProject:"/api/ai/generate-project-stream",scrapeWebsite:"/api/ai/scrape-website"};async function Ya(e,t,n={}){var u;const{onContent:s,abortController:r}=n,o=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:r==null?void 0:r.signal});if(!o.ok)throw new Error(`Failed to fetch: ${o.statusText}`);const i=(u=o.body)==null?void 0:u.getReader();if(!i)throw new Error("No reader available");const a=new TextDecoder;let c="";for(;;){if(r!=null&&r.signal.aborted){i.cancel();break}const{done:d,value:p}=await i.read();if(d)break;const h=a.decode(p);c+=h,s==null||s(c)}return ma(c)}function uu({lastUserMessage:e}){return(e==null?void 0:e.parts.filter(t=>xr.isTextUIPart(t)).map(t=>t.text).join(""))||""}function xw(e,t={}){const n={...yw,...t},s={async execute(g,m){const{plan:b,name:v,imageUrls:x}=g,y=uu(m);let w;try{w=L1(e,g);const{tempDOM:S}=w,C=await Ya(n.addComponent,{userPrompt:`${y}
5
5
  ${b?`
6
6
  Plan: ${b}`:""}
7
7
  ${v?`
8
8
  Component Name: ${v}`:""}
9
- `.trim(),id:"",imageUrls:x,messages:[],trigger:m.toolCallId,projectContext:Yo(e,{imageUrls:x,withPageContent:!0})},{onContent:E=>uo(E,S,{skipScroll:!0}),abortController:m.abortController});if(!C)throw new Error("Failed to generate component content");const j=fb(e,w,C);return{newComponentId:j==null?void 0:j.getId(),newComponentName:v}}catch(S){return il({error:S,msg:"Failed to add component",abortMsg:"Cancelled adding component"})}finally{w==null||w.cleanUp()}}},r={async execute(g,m){const{plan:b,imageUrls:v}=g,x=e.getWrapper(),y=cb(e);let w=new Map;try{if(fo(e),await al(n.editComponent,{userPrompt:b,projectContext:Yo(e,{imageUrls:v,withPageContent:!0}),imageUrls:v,id:"",messages:[],trigger:m.toolCallId},{abortController:m.abortController,onContent:S=>{w=y.update(S)}}),!w.size)throw new Error("Failed to generate component content");return w.forEach(S=>{const{cmp:C,newNode:j}=S,{outerHTML:E}=j;C?ub(C,E):x==null||x.append(E)}),{success:!0}}catch(S){return il({error:S,msg:"Failed to edit component",abortMsg:"Cancelled editing component"})}finally{y.cleanup(),po(e)}}},o={async execute(g){const{componentId:m}=g,b=e.Components.getById(m);return b?(b.remove(),{success:!0}):{success:!1,error:`Component not found with ID '${m}'`}}},i={async execute(g){const{sourceId:m,targetId:b,targetIndex:v}=g,x=e.Components.getById(m),y=e.Components.getById(b);return x?y?(y.append(x,{at:v}),e.select(x,{scroll:!0}),{success:!0}):{success:!1,error:`Target component not found with ID '${b}'`}:{success:!1,error:`Source component not found with ID '${m}'`}}},a={async execute(g,m){const{name:b,plan:v,imageUrls:x}=g,{Pages:y,Components:w}=e;try{fo(e);const S=Eu(m),C=y.add({name:b,component:"<h1></h1>"},{select:!0}),j=C.getMainComponent(),E=T=>{const P=j.getEl();uo(T,P,{skipScroll:!0})};j.once(w.events.render,()=>{E(`<h1 style="font-family: system-ui; font-size: 2rem; font-weight: 300; text-align: center; padding: 1rem">
9
+ `.trim(),id:"",imageUrls:x,messages:[],trigger:m.toolCallId,projectContext:Ho(e,{imageUrls:x,withPageContent:!0})},{onContent:E=>eo(E,S,{skipScroll:!0}),abortController:m.abortController});if(!C)throw new Error("Failed to generate component content");const j=N1(e,w,C);return{newComponentId:j==null?void 0:j.getId(),newComponentName:v}}catch(S){return Za({error:S,msg:"Failed to add component",abortMsg:"Cancelled adding component"})}finally{w==null||w.cleanUp()}}},r={async execute(g,m){const{plan:b,imageUrls:v}=g,x=e.getWrapper(),y=A1(e);let w=new Map;try{if(to(e),await Ya(n.editComponent,{userPrompt:b,projectContext:Ho(e,{imageUrls:v,withPageContent:!0}),imageUrls:v,id:"",messages:[],trigger:m.toolCallId},{abortController:m.abortController,onContent:S=>{w=y.update(S)}}),!w.size)throw new Error("Failed to generate component content");return w.forEach(S=>{const{cmp:C,newNode:j}=S,{outerHTML:E}=j;C?M1(C,E):x==null||x.append(E)}),{success:!0}}catch(S){return Za({error:S,msg:"Failed to edit component",abortMsg:"Cancelled editing component"})}finally{y.cleanup(),no(e)}}},o={async execute(g){const{componentId:m}=g,b=e.Components.getById(m);return b?(b.remove(),{success:!0}):{success:!1,error:`Component not found with ID '${m}'`}}},i={async execute(g){const{sourceId:m,targetId:b,targetIndex:v}=g,x=e.Components.getById(m),y=e.Components.getById(b);return x?y?(y.append(x,{at:v}),e.select(x,{scroll:!0}),{success:!0}):{success:!1,error:`Target component not found with ID '${b}'`}:{success:!1,error:`Source component not found with ID '${m}'`}}},a={async execute(g,m){const{name:b,plan:v,imageUrls:x}=g,{Pages:y,Components:w}=e;try{to(e);const S=uu(m),C=y.add({name:b,component:"<h1></h1>"},{select:!0}),j=C.getMainComponent(),E=O=>{const P=j.getEl();eo(O,P,{skipScroll:!0})};j.once(w.events.render,()=>{E(`<h1 style="font-family: system-ui; font-size: 2rem; font-weight: 300; text-align: center; padding: 1rem">
10
10
  Generating ${b?`"${b}" `:""}page...
11
- </h1>`)});const _=await al(n.addPage,{userPrompt:`${S}
11
+ </h1>`)});const T=await Ya(n.addPage,{userPrompt:`${S}
12
12
  ${v?`
13
13
  Plan: ${v}`:""}
14
- `.trim(),id:"",imageUrls:x,messages:[],trigger:m.toolCallId,projectContext:Yo(e,{imageUrls:x,withPageContent:!0})},{onContent:E,abortController:m.abortController});if(!_)throw new Error("Failed to generate page content");return j.components(_),{success:!0,data:{pageId:C.getId(),pageName:b}}}catch(S){return il({error:S,msg:"Failed to create page",abortMsg:"Cancelled creating page"})}finally{po(e)}}},l={async execute(g){const{pageId:m}=g,b=e.Pages.get(m),v=b==null?void 0:b.getMainComponent();return v?{content:lb(v)}:{success:!1,error:"Page not found"}}},u={async execute(){return{pages:e.Pages.getAll().map(m=>({id:m.getId(),name:m.getName()}))}}},d={async execute(g){const{url:m,name:b}=g,v=await fetch(n.scrapeWebsite,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:m})});if(!v.ok)return{success:!1,error:"Failed to fetch website"};const x=await v.json();return e.Pages.add({name:b,component:x.html},{select:!0}),{success:!0,data:{pageName:b,subPages:x.subPages||[]}}}},f={async execute(g){const{panelId:m}=g;await new Promise(b=>setTimeout(b,1500));try{e.runCommand(`open:${m}`)}catch{return{success:!1,error:`Panel ${m} not found`}}return{success:!0}}},p={async execute(g,m){var S;const{name:b,plan:v,imageUrls:x}=g,y=Yo(e,{imageUrls:x,withPageContent:!0}),{isEmail:w}=y;fo(e);try{const{Pages:C}=e,j=e.getWrapper(),E=Eu(m),_=P=>{var M;let A="";if(w){const R=Ta(P);try{const F=(M=e.runCommand(pb,{mjml:R}))==null?void 0:M.html;F&&(A=F)}catch{}}else A=P;uo(A,j.getEl(),{skipScroll:!0})},T=await al(n.generateProject,{userPrompt:`${E}${v?`
15
- Plan: ${v}`:""}`,projectContext:y,imageUrls:x,id:"",messages:[],trigger:m.toolCallId},{abortController:m.abortController,onContent:_});return e.loadProjectData({pages:[{name:b,component:T}]}),(S=C.getSelected())==null||S.setName(b),{success:!0,data:{pageName:b}}}catch(C){return il({error:C,msg:"Failed to create a project page",abortMsg:"Cancelled creating project page"})}finally{po(e)}}};return{[es.ADD_NEW_COMPONENT]:s,[es.EDIT_COMPONENT]:r,[es.REMOVE_COMPONENT]:o,[es.MOVE_COMPONENT]:i,[es.ADD_NEW_PAGE]:a,[es.GET_PAGE_CONTENT]:l,[es.LIST_PAGES]:u,[es.FETCH_WEBSITE]:d,[es.SHOW_PANEL]:f,[es.ADD_NEW_PROJECT_PAGE]:p}}var rS={};class oS{constructor(t,n){var o;this.chatStates=new Map,this.editor=t,this.options=n;const s=sS(t);this.tools=((o=n.tools)==null?void 0:o.call(n,{defaultTools:s,editor:t}))||s;const{chat:r}=this.createChat();this.currentChatId=r.id}get currentChatState(){return this.chatStates.get(this.currentChatId)}getChat(t){return this.chatStates.get(t)}setCurrentChat(t){this.chatStates.get(t)&&(this.currentChatId=t)}removeChat(t){if(this.chatStates.delete(t),this.currentChatId===t){const n=this.chatStates.keys().next().value;if(n)this.currentChatId=n;else{const s=this.createChat();this.currentChatId=s.chat.id}}}createChat(t){const n=this.editor,s=new Map,r=new Set,o=new Set,{chatApi:i,onTool:a,body:l,defaultTransportOptions:u={},chatOptions:d={},onMessagesUpdate:f,messages:p}=this.options,{onFinish:g,onData:m,...b}=d,v=typeof p=="function",x=new Q1.Chat({id:t,messages:Array.isArray(p)?p:void 0,sendAutomaticallyWhen:Ar.lastAssistantMessageIsCompleteWithToolCalls,transport:new Ar.DefaultChatTransport({...u,async prepareSendMessagesRequest({headers:j,messages:E,body:_,id:T,trigger:P,credentials:A}){var $;const M={..._,id:T,trigger:P,messages:E.slice(-10),projectContext:Yo(n,{withPageContent:!0,selectedComponents:Array.from(o)}),userPrompt:""},R=typeof l=="function"?l({editor:n,body:M,messages:E}):l,{accessToken:F,license:L}=Kt,B=rS.NODE_ENV!=="production",q=`${Hf({isDev:B,isStage:!1,isPlatform:!0})}/ai/chat`;return{api:(!L||["enterprise","business"].includes((($=L==null?void 0:L.plan)==null?void 0:$.category)??"free"))&&typeof i<"u"?typeof i=="function"?i():i:q,headers:{...j,...F?{Authorization:`Bearer ${F}`}:{}},credentials:A,body:{...M,...R}}}}),onToolCall:async({toolCall:j})=>{a==null||a({toolCall:j});const E=!!hb[j.toolName];if(j.dynamic||E)return;const{toolName:_,input:T,toolCallId:P}=j,A=this.tools[_];if(A&&A.execute){const M=new AbortController;r.add(M);try{const{messages:R}=x,F=await Promise.race([A.execute(T||{},{editor:n,messages:R,lastUserMessage:R.findLast(L=>L.role==="user"),toolCallId:P,abortController:M}),new Promise((L,B)=>{M.signal.addEventListener("abort",()=>B(new Error("Aborted")))})]);if(F&&typeof F.error=="string")throw new Error(F.error);x.addToolOutput({tool:_,toolCallId:P,output:F})}catch(R){x.addToolOutput({tool:_,toolCallId:P,state:"output-error",errorText:R instanceof Error?R.message:"Unknown error"})}finally{r.delete(M)}}},onData(j){m==null||m(j),eS({editor:n,data:j,toolStatusProgress:s})},onFinish(j){f==null||f({messages:j.messages,editor:n}),j.isAbort&&(s.forEach(E=>{"toolSetup"in E&&E.toolSetup.cleanUp()}),s.clear()),g==null||g(j)},...b}),y=new Set,w={get messages(){return x.messages},get lastMessage(){return x.lastMessage},get status(){return x.status},get error(){return x.error},sendMessage:(...j)=>x.sendMessage(...j),setMessages:j=>{x.messages=j},clearError:()=>x.clearError(),stop:()=>x.stop(),setError:j=>{const E=j instanceof Error?j:new Error(String(j));x.setStatus({status:"error",error:E})}},S={chat:x,chatApi:w,isMessagesLoaded:!v,toolStatusProgress:s,toolAbortControllers:r,contextComponents:o,onUpdate:j=>(y.add(j),()=>{y.delete(j)}),emitUpdate:()=>{y.forEach(j=>j())}};this.chatStates.set(x.id,S);const C=()=>{x["~registerMessagesCallback"](()=>{x.status==="ready"&&(f==null||f({messages:x.messages,editor:n}))})};return v?p({editor:n}).then(j=>{x.messages=j,C()}).catch(j=>w.setError(j)).finally(()=>{S.isMessagesLoaded=!0,S.emitUpdate()}):C(),S}}var iS="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M11 7H13V13H11V7M11 15H13V17H11V15Z",aS="M11 2H13V7H21V10H13V14H18V17H13V22H11V17H6V14H11V10H3V7H11V2Z",lS="M4 22H2V2H4V22M22 7H6V10H22V7M16 14H6V17H16V14Z",cS="M20 2H22V22H20V2M2 10H18V7H2V10M8 17H18V14H8V17Z",uS="M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z",dS="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",fS="M9.5,13.09L10.91,14.5L6.41,19H10V21H3V14H5V17.59L9.5,13.09M10.91,9.5L9.5,10.91L5,6.41V10H3V3H10V5H6.41L10.91,9.5M14.5,13.09L19,17.59V14H21V21H14V19H17.59L13.09,14.5L14.5,13.09M13.09,9.5L17.59,5H14V3H21V10H19V6.41L14.5,10.91L13.09,9.5Z",pS="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z",hS="M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z",gS="M10.5 18H18V20H10.5C6.91 20 4 17.09 4 13.5S6.91 7 10.5 7H16.17L13.08 3.91L14.5 2.5L20 8L14.5 13.5L13.09 12.09L16.17 9H10.5C8 9 6 11 6 13.5S8 18 10.5 18Z",mS="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",bS="M3,21V3H21V21H3M5,5V19H19V5H5Z",vS="M3 16C3 18.8 5.2 21 8 21H10V19H8C6.3 19 5 17.7 5 16V14H3V16M21 8C21 5.2 18.8 3 16 3H14V5H16C17.7 5 19 6.3 19 8V10H21V8M16 21C18.8 21 21 18.8 21 16V14H19V16C19 17.7 17.7 19 16 19H14V21H16M8 3C5.2 3 3 5.2 3 8V10H5V8C5 6.3 6.3 5 8 5H10V3H8Z",yS="M15,21H17V19H15M19,21H21V19H19M7,21H9V19H7M11,21H13V19H11M19,17H21V15H19M19,13H21V11H19M3,3V21H5V5H21V3M19,9H21V7H19",xS="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",wS="M22,17H18V10H22M23,8H17A1,1 0 0,0 16,9V19A1,1 0 0,0 17,20H23A1,1 0 0,0 24,19V9A1,1 0 0,0 23,8M4,6H22V4H4A2,2 0 0,0 2,6V17H0V20H14V17H4V6Z",SS="M12,3C17.5,3 22,6.58 22,11C22,15.42 17.5,19 12,19C10.76,19 9.57,18.82 8.47,18.5C5.55,21 2,21 2,21C4.33,18.67 4.7,17.1 4.75,16.5C3.05,15.07 2,13.13 2,11C2,6.58 6.5,3 12,3Z",gb="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",CS="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z",jS="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",ES="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",PS="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",_S="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",TS="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",mb="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",OS="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z",AS="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",NS="M15,4V6H18V18H15V20H20V4M4,4V20H9V18H6V6H9V4H4Z",MS="M3,5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5M12.5,11H11.5A1.5,1.5 0 0,1 10,9.5A1.5,1.5 0 0,1 11.5,8H12.5A1.5,1.5 0 0,1 14,9.5H16A3.5,3.5 0 0,0 12.5,6H11.5A3.5,3.5 0 0,0 8,9.5A3.5,3.5 0 0,0 11.5,13H12.5A1.5,1.5 0 0,1 14,14.5A1.5,1.5 0 0,1 12.5,16H11.5A1.5,1.5 0 0,1 10,14.5H8A3.5,3.5 0 0,0 11.5,18H12.5A3.5,3.5 0 0,0 16,14.5A3.5,3.5 0 0,0 12.5,11Z",LS="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",RS="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",$S="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",kS="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5M19,15L17.74,17.74L15,19L17.74,20.25L19,23L20.25,20.25L23,19L20.25,17.74",VS="M12,3C7.58,3 4,4.79 4,7C4,9.21 7.58,11 12,11C16.42,11 20,9.21 20,7C20,4.79 16.42,3 12,3M4,9V12C4,14.21 7.58,16 12,16C16.42,16 20,14.21 20,12V9C20,11.21 16.42,13 12,13C7.58,13 4,11.21 4,9M4,14V17C4,19.21 7.58,21 12,21C16.42,21 20,19.21 20,17V14C20,16.21 16.42,18 12,18C7.58,18 4,16.21 4,14Z",IS="M23 19C22.9 19.2 22.8 19.4 22.7 19.5L18.3 15.1C20.5 15.6 22.2 17.1 23 19M12 5C15.9 5 18 6.5 18 7C18 7.5 15.9 8.9 12.2 9L14.1 10.9C15.6 10.7 17 10.3 18 9.7V12.5C17.7 12.7 17.4 12.9 17 13.1C18 13.1 19 13.3 20 13.7V7C20 4.8 16.4 3 12 3C10.1 3 8.4 3.3 7.1 3.9L8.7 5.5C9.5 5.2 10.7 5 12 5M22.1 21.5L20.8 22.8L20.2 22.2C19.2 22.7 18.1 23.1 17 23.1C14.3 23.1 11.9 21.4 11 19.1C11.6 17.7 12.6 16.6 13.9 15.9L12.4 14.4C11.7 14.8 11.1 15.4 10.5 16C8.8 15.9 7.2 15.5 5.9 14.8V17C5.9 17.3 7 18.2 8.9 18.6L8.8 19L9.1 19.7C9.3 20.1 9.4 20.4 9.6 20.8C6.4 20.3 4 18.8 4 17V7C4 6.7 4.1 6.4 4.2 6.1L1.1 3L2.4 1.7L22.1 21.5M12.1 14L8.7 10.6C7.6 10.4 6.7 10 5.9 9.6V12.4C7.2 13.4 9.5 13.9 11.9 13.9C12 14 12.1 14 12.1 14M18.8 20.7L17.7 19.6C17.6 19.9 17.3 20 17 20C16.4 20 16 19.6 16 19C16 18.7 16.1 18.4 16.4 18.2L15.3 17.1C14.8 17.6 14.5 18.2 14.5 18.9C14.5 20.3 15.6 21.4 17 21.4C17.7 21.5 18.4 21.2 18.8 20.7Z",DS="M9.1 19.7L8.8 19L9 18.6C7.1 18.1 6 17.3 6 17V14.8C7.3 15.4 8.8 15.8 10.6 16C11.3 15.2 12.2 14.5 13.1 14H12C9.6 14 7.3 13.4 6 12.5V9.6C7.5 10.4 9.6 11 12 11S16.5 10.5 18 9.6V12.4C17.7 12.6 17.4 12.8 17 13C18 13 19 13.2 20 13.6V7C20 4.8 16.4 3 12 3S4 4.8 4 7V17C4 18.8 6.4 20.3 9.7 20.8C9.5 20.5 9.3 20.1 9.1 19.7M12 5C15.9 5 18 6.5 18 7S15.9 9 12 9 6 7.5 6 7 8.1 5 12 5M17 18C17.6 18 18 18.4 18 19S17.6 20 17 20 16 19.6 16 19 16.4 18 17 18M17 15C14.3 15 11.9 16.7 11 19C11.9 21.3 14.3 23 17 23S22.1 21.3 23 19C22.1 16.7 19.7 15 17 15M17 21.5C15.6 21.5 14.5 20.4 14.5 19S15.6 16.5 17 16.5 19.5 17.6 19.5 19 18.4 21.5 17 21.5Z",HS="M12 3C7.58 3 4 4.79 4 7V17C4 19.21 7.59 21 12 21S20 19.21 20 17V7C20 4.79 16.42 3 12 3M18 17C18 17.5 15.87 19 12 19S6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16S16.39 15.55 18 14.77V17M18 12.45C16.7 13.4 14.42 14 12 14C9.58 14 7.3 13.4 6 12.45V9.64C7.47 10.47 9.61 11 12 11C14.39 11 16.53 10.47 18 9.64V12.45M12 9C8.13 9 6 7.5 6 7S8.13 5 12 5C15.87 5 18 6.5 18 7S15.87 9 12 9Z",FS="M20 13.09V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.46 21 12.9 21 13.33 20.94C13.12 20.33 13 19.68 13 19L13 18.95C12.68 19 12.35 19 12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.65 16 13.27 15.96 13.88 15.89C14.93 14.16 16.83 13 19 13C19.34 13 19.67 13.04 20 13.09M18 12.45C16.7 13.4 14.42 14 12 14S7.3 13.4 6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.45M12 9C8.13 9 6 7.5 6 7S8.13 5 12 5 18 6.5 18 7 15.87 9 12 9M20.41 19L22.54 21.12L21.12 22.54L19 20.41L16.88 22.54L15.47 21.12L17.59 19L15.47 16.88L16.88 15.47L19 17.59L21.12 15.47L22.54 16.88L20.41 19",BS="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",zS="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",US="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z",WS="M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z",GS="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",qS="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",KS="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z",YS="M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z",ZS="M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z",XS="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",JS="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",QS="M7,11H1V13H7V11M9.17,7.76L7.05,5.64L5.64,7.05L7.76,9.17L9.17,7.76M13,1H11V7H13V1M18.36,7.05L16.95,5.64L14.83,7.76L16.24,9.17L18.36,7.05M17,11V13H23V11H17M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M14.83,16.24L16.95,18.36L18.36,16.95L16.24,14.83L14.83,16.24M5.64,16.95L7.05,18.36L9.17,16.24L7.76,14.83L5.64,16.95M11,23H13V17H11V23Z",e2="M5,3A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5.5L18.5,3H17V9A1,1 0 0,1 16,10H8A1,1 0 0,1 7,9V3H5M12,4V9H15V4H12M7,12H17A1,1 0 0,1 18,13V19H6V13A1,1 0 0,1 7,12Z",t2="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",n2="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z",s2="M11,9H13V11H11V9M9,11H11V13H9V11M13,11H15V13H13V11M15,9H17V11H15V9M7,9H9V11H7V9M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M9,18H7V16H9V18M13,18H11V16H13V18M17,18H15V16H17V18M19,11H17V13H19V15H17V13H15V15H13V13H11V15H9V13H7V15H5V13H7V11H5V5H19V11Z",r2="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",o2="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",i2="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",a2="M22,16V4A2,2 0 0,0 20,2H8A2,2 0 0,0 6,4V16A2,2 0 0,0 8,18H20A2,2 0 0,0 22,16M11,12L13.03,14.71L16,11L20,16H8M2,6V20A2,2 0 0,0 4,22H18V20H4V6",l2="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",c2="M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z",u2="M12,16L19.36,10.27L21,9L12,2L3,9L4.63,10.27M12,18.54L4.62,12.81L3,14.07L12,21.07L21,14.07L19.37,12.8L12,18.54Z",d2="M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z",f2="M11 15H6L13 1V9H18L11 23V15Z",p2="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",h2="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z",g2="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",m2="M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.89 2 10V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V10C18 8.9 17.11 8 16 8H15V6C15 4.34 16.34 3 18 3C19.66 3 21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17C8.9 17 8 16.11 8 15C8 13.9 8.9 13 10 13Z",b2="M7,10L12,15L17,10H7Z",v2="M12,2A3,3 0 0,1 15,5V11A3,3 0 0,1 12,14A3,3 0 0,1 9,11V5A3,3 0 0,1 12,2M19,11C19,14.53 16.39,17.44 13,17.93V21H11V17.93C7.61,17.44 5,14.53 5,11H7A5,5 0 0,0 12,16A5,5 0 0,0 17,11H19Z",y2="M19,11C19,12.19 18.66,13.3 18.1,14.28L16.87,13.05C17.14,12.43 17.3,11.74 17.3,11H19M15,11.16L9,5.18V5A3,3 0 0,1 12,2A3,3 0 0,1 15,5V11L15,11.16M4.27,3L21,19.73L19.73,21L15.54,16.81C14.77,17.27 13.91,17.58 13,17.72V21H11V17.72C7.72,17.23 5,14.41 5,11H6.7C6.7,14 9.24,16.1 12,16.1C12.81,16.1 13.6,15.91 14.31,15.58L12.65,13.92L12,14A3,3 0 0,1 9,11V10.28L3,4.27L4.27,3Z",x2="M20 5L20 19L4 19L4 5H20M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M18 15H6V17H18V15M10 7H6V13H10V7M12 9H18V7H12V9M18 11H12V13H18V11Z",w2="M12,2C13.85,2 15.55,2.78 16.9,4.1L18.6,1.93L20.18,3.16L18.2,5.68C19.33,7.41 20,9.6 20,12C20,17.5 16.42,22 12,22C10.15,22 8.45,21.22 7.1,19.9L5.4,22.07L3.82,20.84L5.8,18.32C4.67,16.59 4,14.4 4,12C4,6.5 7.58,2 12,2M12,4C8.69,4 6,7.58 6,12C6,13.73 6.41,15.33 7.11,16.64L15.67,5.67C14.66,4.62 13.38,4 12,4M12,20C15.31,20 18,16.42 18,12C18,10.27 17.59,8.67 16.89,7.36L8.33,18.33C9.34,19.38 10.62,20 12,20Z",S2="M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",bb="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",C2="M2.53,19.65L3.87,20.21V11.18L1.44,17.04C1.03,18.06 1.5,19.23 2.53,19.65M22.03,15.95L17.07,4C16.76,3.23 16.03,2.77 15.26,2.75C15,2.75 14.73,2.79 14.47,2.9L7.1,5.95C6.35,6.26 5.89,7 5.87,7.75C5.86,8 5.91,8.29 6,8.55L11,20.5C11.29,21.28 12.03,21.74 12.81,21.75C13.07,21.75 13.33,21.7 13.58,21.6L20.94,18.55C21.96,18.13 22.45,16.96 22.03,15.95M7.88,8.75A1,1 0 0,1 6.88,7.75A1,1 0 0,1 7.88,6.75C8.43,6.75 8.88,7.2 8.88,7.75C8.88,8.3 8.43,8.75 7.88,8.75M5.88,19.75A2,2 0 0,0 7.88,21.75H9.33L5.88,13.41V19.75Z",j2="M12,2.5L8,7H16L12,2.5M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M8,17L12,21.5L16,17H8Z",E2="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",P2="M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z",_2="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",T2="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",O2="M16,7V3H14V7H10V3H8V7H8C7,7 6,8 6,9V14.5L9.5,18V21H14.5V18L18,14.5V9C18,8 17,7 16,7Z",A2="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",N2="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M12 4L20 12L12 20L4 12Z",M2="M12 2C11.5 2 11 2.19 10.59 2.59L7.29 5.88L12 10.58L16.71 5.88L13.41 2.59C13 2.19 12.5 2 12 2M5.88 7.29L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L5.88 16.71L10.58 12L5.88 7.29M18.12 7.29L13.42 12L18.12 16.71L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L18.12 7.29M12 13.42L7.29 18.12L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L16.71 18.12L12 13.42Z",L2="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M12 4L15.29 7.29L12 10.59L8.71 7.29L12 4M7.29 8.71L10.59 12L7.29 15.29L4 12L7.29 8.71M16.71 8.71L20 12L16.71 15.29L13.41 12L16.71 8.71M12 13.41L15.29 16.71L12 20L8.71 16.71L12 13.41Z",R2="M13.13 22.19L11.5 18.36C13.07 17.78 14.54 17 15.9 16.09L13.13 22.19M5.64 12.5L1.81 10.87L7.91 8.1C7 9.46 6.22 10.93 5.64 12.5M21.61 2.39C21.61 2.39 16.66 .269 11 5.93C8.81 8.12 7.5 10.53 6.65 12.64C6.37 13.39 6.56 14.21 7.11 14.77L9.24 16.89C9.79 17.45 10.61 17.63 11.36 17.35C13.5 16.53 15.88 15.19 18.07 13C23.73 7.34 21.61 2.39 21.61 2.39M14.54 9.46C13.76 8.68 13.76 7.41 14.54 6.63S16.59 5.85 17.37 6.63C18.14 7.41 18.15 8.68 17.37 9.46C16.59 10.24 15.32 10.24 14.54 9.46M8.88 16.53L7.47 15.12L8.88 16.53M6.24 22L9.88 18.36C9.54 18.27 9.21 18.12 8.91 17.91L4.83 22H6.24M2 22H3.41L8.18 17.24L6.76 15.83L2 20.59V22M2 19.17L6.09 15.09C5.88 14.79 5.73 14.47 5.64 14.12L2 17.76V19.17Z",$2="M18,18H6V6H18V18Z",k2="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z",V2="M11,2V4.07C7.38,4.53 4.53,7.38 4.07,11H2V13H4.07C4.53,16.62 7.38,19.47 11,19.93V22H13V19.93C16.62,19.47 19.47,16.62 19.93,13H22V11H19.93C19.47,7.38 16.62,4.53 13,4.07V2M11,6.08V8H13V6.09C15.5,6.5 17.5,8.5 17.92,11H16V13H17.91C17.5,15.5 15.5,17.5 13,17.92V16H11V17.91C8.5,17.5 6.5,15.5 6.08,13H8V11H6.09C6.5,8.5 8.5,6.5 11,6.08M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11Z",I2="M22.08,11.04H20.08V4H13.05V2H11.04V4H4V11.04H2V13.05H4V20.08H11.04V22.08H13.05V20.08H20.08V13.05H22.08V11.04M18.07,18.07H13.05V16.06H11.04V18.07H6V13.05H8.03V11.04H6V6H11.04V8.03H13.05V6H18.07V11.04H16.06V13.05H18.07V18.07M13.05,12.05A1,1 0 0,1 12.05,13.05C11.5,13.05 11.04,12.6 11.04,12.05C11.04,11.5 11.5,11.04 12.05,11.04C12.6,11.04 13.05,11.5 13.05,12.05Z",D2="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z",H2="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",F2="M17 6H7C3.69 6 1 8.69 1 12S3.69 18 7 18H17C20.31 18 23 15.31 23 12S20.31 6 17 6M17 16H7C4.79 16 3 14.21 3 12S4.79 8 7 8H17C19.21 8 21 9.79 21 12S19.21 16 17 16M17 9C15.34 9 14 10.34 14 12S15.34 15 17 15 20 13.66 20 12 18.66 9 17 9Z",B2="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z",z2="M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z",U2="M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z",W2="M13,3V9H21V3M13,21H21V11H13M3,21H11V15H3M3,13H11V3H3V13Z",G2="M21 18H2V20H21V18M19 10V14H4V10H19M20 8H3C2.45 8 2 8.45 2 9V15C2 15.55 2.45 16 3 16H20C20.55 16 21 15.55 21 15V9C21 8.45 20.55 8 20 8M21 4H2V6H21V4Z",q2="M13 3V11H21V3H13M3 21H11V13H3V21M3 3V11H11V3H3M13 16H16V13H18V16H21V18H18V21H16V18H13V16Z",K2="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",Y2="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z";const ue=ee;function ee(...e){return(Array.isArray(e[0])?e[0]:[...e]).filter(Boolean).flatMap(r=>typeof r=="string"?r.split(" ").map(o=>{if(o=o.replace(/gjs-/g,"gs-utl-"),!o.includes("gs-utl-")&&!o.startsWith("gs-")){const i=o.split(":"),a=i.pop(),l=i.join(":"),u=a==null?void 0:a.startsWith("!"),f=`gs-utl-${u?a==null?void 0:a.slice(1):a}`,p=u?`!${f}`:f;return l?`${l}:${p}`:p}return o}):r).join(" ")}const k=h.forwardRef(function({as:t,children:n,className:s,col:r,revert:o,full:i,nowrap:a,space:l,gap:u,justify:d,items:f,...p},g){const m=t||"div";return c.jsx(m,{ref:g,className:ee([s,"gs-utl-flex",r&&!o&&"gs-utl-flex-col",r&&o&&"gs-utl-flex-col-reverse",!r&&o&&"gs-utl-flex-row-reverse",i&&!r&&"gs-utl-w-full",i&&r&&"gs-utl-h-full",a?"gs-utl-flex-nowrap":"gs-utl-flex-wrap",l==="x2s"&&(r?"gs-utl-space-y-0.5":"gs-utl-space-x-0.5"),l==="xs"&&(r?"gs-utl-space-y-1":"gs-utl-space-x-1"),l==="s"&&(r?"gs-utl-space-y-2":"gs-utl-space-x-2"),l==="m"&&(r?"gs-utl-space-y-4":"gs-utl-space-x-4"),l==="l"&&(r?"gs-utl-space-y-6":"gs-utl-space-x-6"),l==="xl"&&(r?"gs-utl-space-y-8":"gs-utl-space-x-8"),u==="x2s"&&"gs-utl-gap-0.5",u==="xs"&&"gs-utl-gap-1",u==="s"&&"gs-utl-gap-2",u==="m"&&"gs-utl-gap-4",u==="l"&&"gs-utl-gap-6",u==="xl"&&"gs-utl-gap-8",f==="start"&&"gs-utl-items-start",f==="end"&&"gs-utl-items-end",f==="center"&&"gs-utl-items-center",d==="start"&&"gs-utl-justify-start",d==="end"&&"gs-utl-justify-end",d==="center"&&"gs-utl-justify-center",d==="between"&&"gs-utl-justify-between"]),...p,children:n})}),D=h.forwardRef(function({children:t,className:n,grow:s,...r},o){return c.jsx("div",{ref:o,className:ee([n,s&&"flex-1"]),...r,children:t})});function Bf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ll={exports:{}},cl={exports:{}},Je={};/** @license React v16.13.1
16
- * react-is.production.min.js
17
- *
18
- * Copyright (c) Facebook, Inc. and its affiliates.
19
- *
20
- * This source code is licensed under the MIT license found in the
21
- * LICENSE file in the root directory of this source tree.
22
- */var Oh;function Z2(){if(Oh)return Je;Oh=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(C){if(typeof C=="object"&&C!==null){var j=C.$$typeof;switch(j){case t:switch(C=C.type,C){case l:case u:case s:case o:case r:case f:return C;default:switch(C=C&&C.$$typeof,C){case a:case d:case m:case g:case i:return C;default:return j}}case n:return j}}}function S(C){return w(C)===u}return Je.AsyncMode=l,Je.ConcurrentMode=u,Je.ContextConsumer=a,Je.ContextProvider=i,Je.Element=t,Je.ForwardRef=d,Je.Fragment=s,Je.Lazy=m,Je.Memo=g,Je.Portal=n,Je.Profiler=o,Je.StrictMode=r,Je.Suspense=f,Je.isAsyncMode=function(C){return S(C)||w(C)===l},Je.isConcurrentMode=S,Je.isContextConsumer=function(C){return w(C)===a},Je.isContextProvider=function(C){return w(C)===i},Je.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},Je.isForwardRef=function(C){return w(C)===d},Je.isFragment=function(C){return w(C)===s},Je.isLazy=function(C){return w(C)===m},Je.isMemo=function(C){return w(C)===g},Je.isPortal=function(C){return w(C)===n},Je.isProfiler=function(C){return w(C)===o},Je.isStrictMode=function(C){return w(C)===r},Je.isSuspense=function(C){return w(C)===f},Je.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===s||C===u||C===o||C===r||C===f||C===p||typeof C=="object"&&C!==null&&(C.$$typeof===m||C.$$typeof===g||C.$$typeof===i||C.$$typeof===a||C.$$typeof===d||C.$$typeof===v||C.$$typeof===x||C.$$typeof===y||C.$$typeof===b)},Je.typeOf=w,Je}var Qe={},Ah;function X2(){if(Ah)return Qe;Ah=1;var e={};/** @license React v16.13.1
23
- * react-is.development.js
24
- *
25
- * Copyright (c) Facebook, Inc. and its affiliates.
26
- *
27
- * This source code is licensed under the MIT license found in the
28
- * LICENSE file in the root directory of this source tree.
29
- */return e.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,n=t?Symbol.for("react.element"):60103,s=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,l=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,d=t?Symbol.for("react.concurrent_mode"):60111,f=t?Symbol.for("react.forward_ref"):60112,p=t?Symbol.for("react.suspense"):60113,g=t?Symbol.for("react.suspense_list"):60120,m=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,v=t?Symbol.for("react.block"):60121,x=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function S(ne){return typeof ne=="string"||typeof ne=="function"||ne===r||ne===d||ne===i||ne===o||ne===p||ne===g||typeof ne=="object"&&ne!==null&&(ne.$$typeof===b||ne.$$typeof===m||ne.$$typeof===a||ne.$$typeof===l||ne.$$typeof===f||ne.$$typeof===x||ne.$$typeof===y||ne.$$typeof===w||ne.$$typeof===v)}function C(ne){if(typeof ne=="object"&&ne!==null){var Te=ne.$$typeof;switch(Te){case n:var ke=ne.type;switch(ke){case u:case d:case r:case i:case o:case p:return ke;default:var it=ke&&ke.$$typeof;switch(it){case l:case f:case b:case m:case a:return it;default:return Te}}case s:return Te}}}var j=u,E=d,_=l,T=a,P=n,A=f,M=r,R=b,F=m,L=s,B=i,q=o,H=p,$=!1;function I(ne){return $||($=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),O(ne)||C(ne)===u}function O(ne){return C(ne)===d}function V(ne){return C(ne)===l}function G(ne){return C(ne)===a}function W(ne){return typeof ne=="object"&&ne!==null&&ne.$$typeof===n}function K(ne){return C(ne)===f}function J(ne){return C(ne)===r}function Y(ne){return C(ne)===b}function U(ne){return C(ne)===m}function Q(ne){return C(ne)===s}function se(ne){return C(ne)===i}function de(ne){return C(ne)===o}function Se(ne){return C(ne)===p}Qe.AsyncMode=j,Qe.ConcurrentMode=E,Qe.ContextConsumer=_,Qe.ContextProvider=T,Qe.Element=P,Qe.ForwardRef=A,Qe.Fragment=M,Qe.Lazy=R,Qe.Memo=F,Qe.Portal=L,Qe.Profiler=B,Qe.StrictMode=q,Qe.Suspense=H,Qe.isAsyncMode=I,Qe.isConcurrentMode=O,Qe.isContextConsumer=V,Qe.isContextProvider=G,Qe.isElement=W,Qe.isForwardRef=K,Qe.isFragment=J,Qe.isLazy=Y,Qe.isMemo=U,Qe.isPortal=Q,Qe.isProfiler=se,Qe.isStrictMode=de,Qe.isSuspense=Se,Qe.isValidElementType=S,Qe.typeOf=C}(),Qe}var Nh;function vb(){if(Nh)return cl.exports;Nh=1;var e={};return e.NODE_ENV==="production"?cl.exports=Z2():cl.exports=X2(),cl.exports}/*
30
- object-assign
31
- (c) Sindre Sorhus
32
- @license MIT
33
- */var Pu,Mh;function J2(){if(Mh)return Pu;Mh=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function s(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function r(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var i={},a=0;a<10;a++)i["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Pu=r()?Object.assign:function(o,i){for(var a,l=s(o),u,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){u=e(a);for(var p=0;p<u.length;p++)n.call(a,u[p])&&(l[u[p]]=a[u[p]])}}return l},Pu}var _u,Lh;function zf(){if(Lh)return _u;Lh=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return _u=e,_u}var Tu,Rh;function yb(){return Rh||(Rh=1,Tu=Function.call.bind(Object.prototype.hasOwnProperty)),Tu}var Ou,$h;function Q2(){if($h)return Ou;$h=1;var e={},t=function(){};if(e.NODE_ENV!=="production"){var n=zf(),s={},r=yb();t=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function o(i,a,l,u,d){if(e.NODE_ENV!=="production"){for(var f in i)if(r(i,f)){var p;try{if(typeof i[f]!="function"){var g=Error((u||"React class")+": "+l+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}p=i[f](a,f,u,l,null,n)}catch(b){p=b}if(p&&!(p instanceof Error)&&t((u||"React class")+": type specification of "+l+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof p+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),p instanceof Error&&!(p.message in s)){s[p.message]=!0;var m=d?d():"";t("Failed "+l+" type: "+p.message+(m??""))}}}}return o.resetWarningCache=function(){e.NODE_ENV!=="production"&&(s={})},Ou=o,Ou}var Au,kh;function eC(){if(kh)return Au;kh=1;var e={},t=vb(),n=J2(),s=zf(),r=yb(),o=Q2(),i=function(){};e.NODE_ENV!=="production"&&(i=function(l){var u="Warning: "+l;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function a(){return null}return Au=function(l,u){var d=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function p(O){var V=O&&(d&&O[d]||O[f]);if(typeof V=="function")return V}var g="<<anonymous>>",m={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:w(),arrayOf:S,element:C(),elementType:j(),instanceOf:E,node:A(),objectOf:T,oneOf:_,oneOfType:P,shape:R,exact:F};function b(O,V){return O===V?O!==0||1/O===1/V:O!==O&&V!==V}function v(O,V){this.message=O,this.data=V&&typeof V=="object"?V:{},this.stack=""}v.prototype=Error.prototype;function x(O){if(e.NODE_ENV!=="production")var V={},G=0;function W(J,Y,U,Q,se,de,Se){if(Q=Q||g,de=de||U,Se!==s){if(u){var ne=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw ne.name="Invariant Violation",ne}else if(e.NODE_ENV!=="production"&&typeof console<"u"){var Te=Q+":"+U;!V[Te]&&G<3&&(i("You are manually calling a React.PropTypes validation function for the `"+de+"` prop on `"+Q+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),V[Te]=!0,G++)}}return Y[U]==null?J?Y[U]===null?new v("The "+se+" `"+de+"` is marked as required "+("in `"+Q+"`, but its value is `null`.")):new v("The "+se+" `"+de+"` is marked as required in "+("`"+Q+"`, but its value is `undefined`.")):null:O(Y,U,Q,se,de)}var K=W.bind(null,!1);return K.isRequired=W.bind(null,!0),K}function y(O){function V(G,W,K,J,Y,U){var Q=G[W],se=q(Q);if(se!==O){var de=H(Q);return new v("Invalid "+J+" `"+Y+"` of type "+("`"+de+"` supplied to `"+K+"`, expected ")+("`"+O+"`."),{expectedType:O})}return null}return x(V)}function w(){return x(a)}function S(O){function V(G,W,K,J,Y){if(typeof O!="function")return new v("Property `"+Y+"` of component `"+K+"` has invalid PropType notation inside arrayOf.");var U=G[W];if(!Array.isArray(U)){var Q=q(U);return new v("Invalid "+J+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+K+"`, expected an array."))}for(var se=0;se<U.length;se++){var de=O(U,se,K,J,Y+"["+se+"]",s);if(de instanceof Error)return de}return null}return x(V)}function C(){function O(V,G,W,K,J){var Y=V[G];if(!l(Y)){var U=q(Y);return new v("Invalid "+K+" `"+J+"` of type "+("`"+U+"` supplied to `"+W+"`, expected a single ReactElement."))}return null}return x(O)}function j(){function O(V,G,W,K,J){var Y=V[G];if(!t.isValidElementType(Y)){var U=q(Y);return new v("Invalid "+K+" `"+J+"` of type "+("`"+U+"` supplied to `"+W+"`, expected a single ReactElement type."))}return null}return x(O)}function E(O){function V(G,W,K,J,Y){if(!(G[W]instanceof O)){var U=O.name||g,Q=I(G[W]);return new v("Invalid "+J+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+K+"`, expected ")+("instance of `"+U+"`."))}return null}return x(V)}function _(O){if(!Array.isArray(O))return e.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function V(G,W,K,J,Y){for(var U=G[W],Q=0;Q<O.length;Q++)if(b(U,O[Q]))return null;var se=JSON.stringify(O,function(Se,ne){var Te=H(ne);return Te==="symbol"?String(ne):ne});return new v("Invalid "+J+" `"+Y+"` of value `"+String(U)+"` "+("supplied to `"+K+"`, expected one of "+se+"."))}return x(V)}function T(O){function V(G,W,K,J,Y){if(typeof O!="function")return new v("Property `"+Y+"` of component `"+K+"` has invalid PropType notation inside objectOf.");var U=G[W],Q=q(U);if(Q!=="object")return new v("Invalid "+J+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+K+"`, expected an object."));for(var se in U)if(r(U,se)){var de=O(U,se,K,J,Y+"."+se,s);if(de instanceof Error)return de}return null}return x(V)}function P(O){if(!Array.isArray(O))return e.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var V=0;V<O.length;V++){var G=O[V];if(typeof G!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+$(G)+" at index "+V+"."),a}function W(K,J,Y,U,Q){for(var se=[],de=0;de<O.length;de++){var Se=O[de],ne=Se(K,J,Y,U,Q,s);if(ne==null)return null;ne.data&&r(ne.data,"expectedType")&&se.push(ne.data.expectedType)}var Te=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new v("Invalid "+U+" `"+Q+"` supplied to "+("`"+Y+"`"+Te+"."))}return x(W)}function A(){function O(V,G,W,K,J){return L(V[G])?null:new v("Invalid "+K+" `"+J+"` supplied to "+("`"+W+"`, expected a ReactNode."))}return x(O)}function M(O,V,G,W,K){return new v((O||"React class")+": "+V+" type `"+G+"."+W+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+K+"`.")}function R(O){function V(G,W,K,J,Y){var U=G[W],Q=q(U);if(Q!=="object")return new v("Invalid "+J+" `"+Y+"` of type `"+Q+"` "+("supplied to `"+K+"`, expected `object`."));for(var se in O){var de=O[se];if(typeof de!="function")return M(K,J,Y,se,H(de));var Se=de(U,se,K,J,Y+"."+se,s);if(Se)return Se}return null}return x(V)}function F(O){function V(G,W,K,J,Y){var U=G[W],Q=q(U);if(Q!=="object")return new v("Invalid "+J+" `"+Y+"` of type `"+Q+"` "+("supplied to `"+K+"`, expected `object`."));var se=n({},G[W],O);for(var de in se){var Se=O[de];if(r(O,de)&&typeof Se!="function")return M(K,J,Y,de,H(Se));if(!Se)return new v("Invalid "+J+" `"+Y+"` key `"+de+"` supplied to `"+K+"`.\nBad object: "+JSON.stringify(G[W],null," ")+`
34
- Valid keys: `+JSON.stringify(Object.keys(O),null," "));var ne=Se(U,de,K,J,Y+"."+de,s);if(ne)return ne}return null}return x(V)}function L(O){switch(typeof O){case"number":case"string":case"undefined":return!0;case"boolean":return!O;case"object":if(Array.isArray(O))return O.every(L);if(O===null||l(O))return!0;var V=p(O);if(V){var G=V.call(O),W;if(V!==O.entries){for(;!(W=G.next()).done;)if(!L(W.value))return!1}else for(;!(W=G.next()).done;){var K=W.value;if(K&&!L(K[1]))return!1}}else return!1;return!0;default:return!1}}function B(O,V){return O==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function q(O){var V=typeof O;return Array.isArray(O)?"array":O instanceof RegExp?"object":B(V,O)?"symbol":V}function H(O){if(typeof O>"u"||O===null)return""+O;var V=q(O);if(V==="object"){if(O instanceof Date)return"date";if(O instanceof RegExp)return"regexp"}return V}function $(O){var V=H(O);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function I(O){return!O.constructor||!O.constructor.name?g:O.constructor.name}return m.checkPropTypes=o,m.resetWarningCache=o.resetWarningCache,m.PropTypes=m,m},Au}var Nu,Vh;function tC(){if(Vh)return Nu;Vh=1;var e=zf();function t(){}function n(){}return n.resetWarningCache=t,Nu=function(){function s(i,a,l,u,d,f){if(f!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}s.isRequired=s;function r(){return s}var o={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:r,element:s,elementType:s,instanceOf:r,node:s,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Nu}var Ih;function nC(){if(Ih)return ll.exports;Ih=1;var e={};if(e.NODE_ENV!=="production"){var t=vb(),n=!0;ll.exports=eC()(t.isElement,n)}else ll.exports=tC()();return ll.exports}var sC=function(e){var t={};function n(s){if(t[s])return t[s].exports;var r=t[s]={i:s,l:!1,exports:{}};return e[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(s,r,o){n.o(s,r)||Object.defineProperty(s,r,{enumerable:!0,get:o})},n.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},n.t=function(s,r){if(1&r&&(s=n(s)),8&r||4&r&&typeof s=="object"&&s&&s.__esModule)return s;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:s}),2&r&&typeof s!="string")for(var i in s)n.d(o,i,(function(a){return s[a]}).bind(null,i));return o},n.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(r,"a",r),r},n.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},n.p="",n(n.s=2)}([function(e,t){e.exports=nC()},function(e,t){e.exports=h},function(e,t,n){n.r(t);var s=n(1),r=n(0),o=function(){return(o=Object.assign||function(m){for(var b,v=1,x=arguments.length;v<x;v++)for(var y in b=arguments[v])Object.prototype.hasOwnProperty.call(b,y)&&(m[y]=b[y]);return m}).apply(this,arguments)},i=function(m,b){var v={};for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&b.indexOf(x)<0&&(v[x]=m[x]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(x=Object.getOwnPropertySymbols(m);y<x.length;y++)b.indexOf(x[y])<0&&Object.prototype.propertyIsEnumerable.call(m,x[y])&&(v[x[y]]=m[x[y]])}return v},a=0,l=s.forwardRef(function(m,b){var v=m.title,x=v===void 0?null:v,y=m.description,w=y===void 0?null:y,S=m.size,C=S===void 0?null:S,j=m.color,E=j===void 0?"currentColor":j,_=m.horizontal,T=_===void 0?null:_,P=m.vertical,A=P===void 0?null:P,M=m.rotate,R=M===void 0?null:M,F=m.spin,L=F===void 0?null:F,B=m.style,q=B===void 0?{}:B,H=m.children,$=i(m,["title","description","size","color","horizontal","vertical","rotate","spin","style","children"]);a++;var I,O=L!==null&&L,V=s.Children.map(H,function(J){var Y=J;O!==!0&&(O=(L===null?Y.props.spin:L)===!0);var U=Y.props.size;typeof C=="number"&&typeof Y.props.size=="number"&&(U=Y.props.size/C);var Q={size:U,color:E===null?Y.props.color:E,horizontal:T===null?Y.props.horizontal:T,vertical:A===null?Y.props.vertical:A,rotate:R===null?Y.props.rotate:R,spin:L===null?Y.props.spin:L,inStack:!0};return s.cloneElement(Y,Q)});C!==null&&(q.width=typeof C=="string"?C:1.5*C+"rem");var G,W="stack_labelledby_"+a,K="stack_describedby_"+a;if(x)I=w?W+" "+K:W;else if(G="presentation",w)throw new Error("title attribute required when description is set");return s.createElement("svg",o({ref:b,viewBox:"0 0 24 24",style:q,role:G,"aria-labelledby":I},$),x&&s.createElement("title",{id:W},x),w&&s.createElement("desc",{id:K},w),O&&s.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }","@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"),V)});l.displayName="Stack",l.propTypes={size:r.oneOfType([r.number,r.string]),color:r.string,horizontal:r.bool,vertical:r.bool,rotate:r.number,spin:r.oneOfType([r.bool,r.number]),children:r.oneOfType([r.arrayOf(r.node),r.node]).isRequired,className:r.string,style:r.object},l.defaultProps={size:null,color:null,horizontal:null,vertical:null,rotate:null,spin:null};var u=l;n.d(t,"Icon",function(){return g}),n.d(t,"Stack",function(){return u});var d=function(){return(d=Object.assign||function(m){for(var b,v=1,x=arguments.length;v<x;v++)for(var y in b=arguments[v])Object.prototype.hasOwnProperty.call(b,y)&&(m[y]=b[y]);return m}).apply(this,arguments)},f=function(m,b){var v={};for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&b.indexOf(x)<0&&(v[x]=m[x]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(x=Object.getOwnPropertySymbols(m);y<x.length;y++)b.indexOf(x[y])<0&&Object.prototype.propertyIsEnumerable.call(m,x[y])&&(v[x[y]]=m[x[y]])}return v},p=0,g=s.forwardRef(function(m,b){var v=m.path,x=m.id,y=x===void 0?++p:x,w=m.title,S=w===void 0?null:w,C=m.description,j=C===void 0?null:C,E=m.size,_=E===void 0?null:E,T=m.color,P=T===void 0?"currentColor":T,A=m.horizontal,M=A!==void 0&&A,R=m.vertical,F=R!==void 0&&R,L=m.rotate,B=L===void 0?0:L,q=m.spin,H=q!==void 0&&q,$=m.style,I=$===void 0?{}:$,O=m.inStack,V=O!==void 0&&O,G=f(m,["path","id","title","description","size","color","horizontal","vertical","rotate","spin","style","inStack"]),W={},K=[];_!==null&&(V?K.push("scale("+_+")"):(I.width=typeof _=="string"?_:1.5*_+"rem",I.height=I.width)),M&&K.push("scaleX(-1)"),F&&K.push("scaleY(-1)"),B!==0&&K.push("rotate("+B+"deg)"),P!==null&&(W.fill=P);var J=s.createElement("path",d({d:v,style:W},V?G:{})),Y=J;K.length>0&&(I.transform=K.join(" "),I.transformOrigin="center",V&&(Y=s.createElement("g",{style:I},J,s.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var U,Q=Y,se=H===!0||typeof H!="number"?2:H,de=!V&&(M||F);if(se<0&&(de=!de),H&&(Q=s.createElement("g",{style:{animation:"spin"+(de?"-inverse":"")+" linear "+Math.abs(se)+"s infinite",transformOrigin:"center"}},Y,!(M||F||B!==0)&&s.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),V)return Q;var Se,ne="icon_labelledby_"+y,Te="icon_describedby_"+y;if(S)U=j?ne+" "+Te:ne;else if(Se="presentation",j)throw new Error("title attribute required when description is set");return s.createElement("svg",d({ref:b,viewBox:"0 0 24 24",style:I,role:Se,"aria-labelledby":U},G),S&&s.createElement("title",{id:ne},S),j&&s.createElement("desc",{id:Te},j),!V&&H&&(de?s.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):s.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),Q)});g.displayName="Icon",g.propTypes={path:r.string.isRequired,size:r.oneOfType([r.number,r.string]),color:r.string,horizontal:r.bool,vertical:r.bool,rotate:r.number,spin:r.oneOfType([r.bool,r.number]),style:r.object,inStack:r.bool,className:r.string},g.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},t.default=g}]);const Wi=Bf(sC);var xb={exports:{}};/*!
14
+ `.trim(),id:"",imageUrls:x,messages:[],trigger:m.toolCallId,projectContext:Ho(e,{imageUrls:x,withPageContent:!0})},{onContent:E,abortController:m.abortController});if(!T)throw new Error("Failed to generate page content");return j.components(T),{success:!0,data:{pageId:C.getId(),pageName:b}}}catch(S){return Za({error:S,msg:"Failed to create page",abortMsg:"Cancelled creating page"})}finally{no(e)}}},c={async execute(g){const{pageId:m}=g,b=e.Pages.get(m),v=b==null?void 0:b.getMainComponent();return v?{content:_1(v)}:{success:!1,error:"Page not found"}}},u={async execute(){return{pages:e.Pages.getAll().map(m=>({id:m.getId(),name:m.getName()}))}}},d={async execute(g){const{url:m,name:b}=g,v=await fetch(n.scrapeWebsite,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:m})});if(!v.ok)return{success:!1,error:"Failed to fetch website"};const x=await v.json();return e.Pages.add({name:b,component:x.html},{select:!0}),{success:!0,data:{pageName:b,subPages:x.subPages||[]}}}},p={async execute(g){const{panelId:m}=g;await new Promise(b=>setTimeout(b,1500));try{e.runCommand(`open:${m}`)}catch{return{success:!1,error:`Panel ${m} not found`}}return{success:!0}}},h={async execute(g,m){var S;const{name:b,plan:v,imageUrls:x}=g,y=Ho(e,{imageUrls:x,withPageContent:!0}),{isEmail:w}=y;to(e);try{const{Pages:C}=e,j=e.getWrapper(),E=uu(m),T=P=>{var M;let _="";if(w){const N=ma(P);try{const H=(M=e.runCommand($1,{mjml:N}))==null?void 0:M.html;H&&(_=H)}catch{}}else _=P;eo(_,j.getEl(),{skipScroll:!0})},O=await Ya(n.generateProject,{userPrompt:`${E}${v?`
15
+ Plan: ${v}`:""}`,projectContext:y,imageUrls:x,id:"",messages:[],trigger:m.toolCallId},{abortController:m.abortController,onContent:T});return e.loadProjectData({pages:[{name:b,component:O}]}),(S=C.getSelected())==null||S.setName(b),{success:!0,data:{pageName:b}}}catch(C){return Za({error:C,msg:"Failed to create a project page",abortMsg:"Cancelled creating project page"})}finally{no(e)}}};return{[zn.ADD_NEW_COMPONENT]:s,[zn.EDIT_COMPONENT]:r,[zn.REMOVE_COMPONENT]:o,[zn.MOVE_COMPONENT]:i,[zn.ADD_NEW_PAGE]:a,[zn.GET_PAGE_CONTENT]:c,[zn.LIST_PAGES]:u,[zn.FETCH_WEBSITE]:d,[zn.SHOW_PANEL]:p,[zn.ADD_NEW_PROJECT_PAGE]:h}}var ww={NODE_ENV:"production"};class Sw{constructor(t,n){var o;this.chatStates=new Map,this.editor=t,this.options=n;const s=xw(t);this.tools=((o=n.tools)==null?void 0:o.call(n,{defaultTools:s,editor:t}))||s;const{chat:r}=this.createChat();this.currentChatId=r.id}get currentChatState(){return this.chatStates.get(this.currentChatId)}getChat(t){return this.chatStates.get(t)}setCurrentChat(t){this.chatStates.get(t)&&(this.currentChatId=t)}removeChat(t){if(this.chatStates.delete(t),this.currentChatId===t){const n=this.chatStates.keys().next().value;if(n)this.currentChatId=n;else{const s=this.createChat();this.currentChatId=s.chat.id}}}createChat(t){const n=this.editor,s=new Map,r=new Set,o=new Set,{chatApi:i,onTool:a,body:c,defaultTransportOptions:u={},chatOptions:d={},onMessagesUpdate:p,messages:h}=this.options,{onFinish:g,onData:m,...b}=d,v=typeof h=="function",x=new x1.Chat({id:t,messages:Array.isArray(h)?h:void 0,sendAutomaticallyWhen:xr.lastAssistantMessageIsCompleteWithToolCalls,transport:new xr.DefaultChatTransport({...u,async prepareSendMessagesRequest({headers:j,messages:E,body:T,id:O,trigger:P,credentials:_}){var $;const M={...T,id:O,trigger:P,messages:E.slice(-10),projectContext:Ho(n,{withPageContent:!0,selectedComponents:Array.from(o)}),userPrompt:""},N=typeof c=="function"?c({editor:n,body:M,messages:E}):c,{accessToken:H,license:L}=Ut,F=ww.NODE_ENV!=="production",G=`${yp({isDev:F,isStage:!1,isPlatform:!0})}/ai/chat`;return{api:(!L||["enterprise","business"].includes((($=L==null?void 0:L.plan)==null?void 0:$.category)??"free"))&&typeof i<"u"?typeof i=="function"?i():i:G,headers:{...j,...H?{Authorization:`Bearer ${H}`}:{}},credentials:_,body:{...M,...N}}}}),onToolCall:async({toolCall:j})=>{a==null||a({toolCall:j});const E=!!k1[j.toolName];if(j.dynamic||E)return;const{toolName:T,input:O,toolCallId:P}=j,_=this.tools[T];if(_&&_.execute){const M=new AbortController;r.add(M);try{const{messages:N}=x,H=await Promise.race([_.execute(O||{},{editor:n,messages:N,lastUserMessage:N.findLast(L=>L.role==="user"),toolCallId:P,abortController:M}),new Promise((L,F)=>{M.signal.addEventListener("abort",()=>F(new Error("Aborted")))})]);if(H&&typeof H.error=="string")throw new Error(H.error);x.addToolOutput({tool:T,toolCallId:P,output:H})}catch(N){x.addToolOutput({tool:T,toolCallId:P,state:"output-error",errorText:N instanceof Error?N.message:"Unknown error"})}finally{r.delete(M)}}},onData(j){m==null||m(j),bw({editor:n,data:j,toolStatusProgress:s})},onFinish(j){p==null||p({messages:j.messages,editor:n}),j.isAbort&&(s.forEach(E=>{"toolSetup"in E&&E.toolSetup.cleanUp()}),s.clear()),g==null||g(j)},...b}),y=new Set,w={get messages(){return x.messages},get lastMessage(){return x.lastMessage},get status(){return x.status},get error(){return x.error},sendMessage:(...j)=>x.sendMessage(...j),setMessages:j=>{x.messages=j},clearError:()=>x.clearError(),stop:()=>x.stop(),setError:j=>{const E=j instanceof Error?j:new Error(String(j));x.setStatus({status:"error",error:E})}},S={chat:x,chatApi:w,isMessagesLoaded:!v,toolStatusProgress:s,toolAbortControllers:r,contextComponents:o,onUpdate:j=>(y.add(j),()=>{y.delete(j)}),emitUpdate:()=>{y.forEach(j=>j())}};this.chatStates.set(x.id,S);const C=()=>{x["~registerMessagesCallback"](()=>{x.status==="ready"&&(p==null||p({messages:x.messages,editor:n}))})};return v?h({editor:n}).then(j=>{x.messages=j,C()}).catch(j=>w.setError(j)).finally(()=>{S.isMessagesLoaded=!0,S.emitUpdate()}):C(),S}}var Cw="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M11 7H13V13H11V7M11 15H13V17H11V15Z",jw="M11 2H13V7H21V10H13V14H18V17H13V22H11V17H6V14H11V10H3V7H11V2Z",Ew="M4 22H2V2H4V22M22 7H6V10H22V7M16 14H6V17H16V14Z",Pw="M20 2H22V22H20V2M2 10H18V7H2V10M8 17H18V14H8V17Z",Tw="M9.5,8.5L11,10L8,13L11,16L9.5,17.5L5,13L9.5,8.5M14.5,17.5L13,16L16,13L13,10L14.5,8.5L19,13L14.5,17.5M21,2H3A2,2 0 0,0 1,4V20A2,2 0 0,0 3,22H21A2,2 0 0,0 23,20V4A2,2 0 0,0 21,2M21,20H3V6H21V20Z",Ow="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",_w="M9.5,13.09L10.91,14.5L6.41,19H10V21H3V14H5V17.59L9.5,13.09M10.91,9.5L9.5,10.91L5,6.41V10H3V3H10V5H6.41L10.91,9.5M14.5,13.09L19,17.59V14H21V21H14V19H17.59L13.09,14.5L14.5,13.09M13.09,9.5L17.59,5H14V3H21V10H19V6.41L14.5,10.91L13.09,9.5Z",Aw="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z",Mw="M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z",Lw="M10.5 18H18V20H10.5C6.91 20 4 17.09 4 13.5S6.91 7 10.5 7H16.17L13.08 3.91L14.5 2.5L20 8L14.5 13.5L13.09 12.09L16.17 9H10.5C8 9 6 11 6 13.5S8 18 10.5 18Z",Nw="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",$w="M3,21V3H21V21H3M5,5V19H19V5H5Z",kw="M3 16C3 18.8 5.2 21 8 21H10V19H8C6.3 19 5 17.7 5 16V14H3V16M21 8C21 5.2 18.8 3 16 3H14V5H16C17.7 5 19 6.3 19 8V10H21V8M16 21C18.8 21 21 18.8 21 16V14H19V16C19 17.7 17.7 19 16 19H14V21H16M8 3C5.2 3 3 5.2 3 8V10H5V8C5 6.3 6.3 5 8 5H10V3H8Z",Rw="M15,21H17V19H15M19,21H21V19H19M7,21H9V19H7M11,21H13V19H11M19,17H21V15H19M19,13H21V11H19M3,3V21H5V5H21V3M19,9H21V7H19",Iw="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",Vw="M22,17H18V10H22M23,8H17A1,1 0 0,0 16,9V19A1,1 0 0,0 17,20H23A1,1 0 0,0 24,19V9A1,1 0 0,0 23,8M4,6H22V4H4A2,2 0 0,0 2,6V17H0V20H14V17H4V6Z",Hw="M12,3C17.5,3 22,6.58 22,11C22,15.42 17.5,19 12,19C10.76,19 9.57,18.82 8.47,18.5C5.55,21 2,21 2,21C4.33,18.67 4.7,17.1 4.75,16.5C3.05,15.07 2,13.13 2,11C2,6.58 6.5,3 12,3Z",R1="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",Dw="M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z",Fw="M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",Bw="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",zw="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",Uw="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",Ww="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",I1="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",Gw="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z",qw="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",Kw="M15,4V6H18V18H15V20H20V4M4,4V20H9V18H6V6H9V4H4Z",Zw="M3,5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5M12.5,11H11.5A1.5,1.5 0 0,1 10,9.5A1.5,1.5 0 0,1 11.5,8H12.5A1.5,1.5 0 0,1 14,9.5H16A3.5,3.5 0 0,0 12.5,6H11.5A3.5,3.5 0 0,0 8,9.5A3.5,3.5 0 0,0 11.5,13H12.5A1.5,1.5 0 0,1 14,14.5A1.5,1.5 0 0,1 12.5,16H11.5A1.5,1.5 0 0,1 10,14.5H8A3.5,3.5 0 0,0 11.5,18H12.5A3.5,3.5 0 0,0 16,14.5A3.5,3.5 0 0,0 12.5,11Z",Yw="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",Xw="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",Jw="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",Qw="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5M19,15L17.74,17.74L15,19L17.74,20.25L19,23L20.25,20.25L23,19L20.25,17.74",eS="M12,3C7.58,3 4,4.79 4,7C4,9.21 7.58,11 12,11C16.42,11 20,9.21 20,7C20,4.79 16.42,3 12,3M4,9V12C4,14.21 7.58,16 12,16C16.42,16 20,14.21 20,12V9C20,11.21 16.42,13 12,13C7.58,13 4,11.21 4,9M4,14V17C4,19.21 7.58,21 12,21C16.42,21 20,19.21 20,17V14C20,16.21 16.42,18 12,18C7.58,18 4,16.21 4,14Z",tS="M23 19C22.9 19.2 22.8 19.4 22.7 19.5L18.3 15.1C20.5 15.6 22.2 17.1 23 19M12 5C15.9 5 18 6.5 18 7C18 7.5 15.9 8.9 12.2 9L14.1 10.9C15.6 10.7 17 10.3 18 9.7V12.5C17.7 12.7 17.4 12.9 17 13.1C18 13.1 19 13.3 20 13.7V7C20 4.8 16.4 3 12 3C10.1 3 8.4 3.3 7.1 3.9L8.7 5.5C9.5 5.2 10.7 5 12 5M22.1 21.5L20.8 22.8L20.2 22.2C19.2 22.7 18.1 23.1 17 23.1C14.3 23.1 11.9 21.4 11 19.1C11.6 17.7 12.6 16.6 13.9 15.9L12.4 14.4C11.7 14.8 11.1 15.4 10.5 16C8.8 15.9 7.2 15.5 5.9 14.8V17C5.9 17.3 7 18.2 8.9 18.6L8.8 19L9.1 19.7C9.3 20.1 9.4 20.4 9.6 20.8C6.4 20.3 4 18.8 4 17V7C4 6.7 4.1 6.4 4.2 6.1L1.1 3L2.4 1.7L22.1 21.5M12.1 14L8.7 10.6C7.6 10.4 6.7 10 5.9 9.6V12.4C7.2 13.4 9.5 13.9 11.9 13.9C12 14 12.1 14 12.1 14M18.8 20.7L17.7 19.6C17.6 19.9 17.3 20 17 20C16.4 20 16 19.6 16 19C16 18.7 16.1 18.4 16.4 18.2L15.3 17.1C14.8 17.6 14.5 18.2 14.5 18.9C14.5 20.3 15.6 21.4 17 21.4C17.7 21.5 18.4 21.2 18.8 20.7Z",nS="M9.1 19.7L8.8 19L9 18.6C7.1 18.1 6 17.3 6 17V14.8C7.3 15.4 8.8 15.8 10.6 16C11.3 15.2 12.2 14.5 13.1 14H12C9.6 14 7.3 13.4 6 12.5V9.6C7.5 10.4 9.6 11 12 11S16.5 10.5 18 9.6V12.4C17.7 12.6 17.4 12.8 17 13C18 13 19 13.2 20 13.6V7C20 4.8 16.4 3 12 3S4 4.8 4 7V17C4 18.8 6.4 20.3 9.7 20.8C9.5 20.5 9.3 20.1 9.1 19.7M12 5C15.9 5 18 6.5 18 7S15.9 9 12 9 6 7.5 6 7 8.1 5 12 5M17 18C17.6 18 18 18.4 18 19S17.6 20 17 20 16 19.6 16 19 16.4 18 17 18M17 15C14.3 15 11.9 16.7 11 19C11.9 21.3 14.3 23 17 23S22.1 21.3 23 19C22.1 16.7 19.7 15 17 15M17 21.5C15.6 21.5 14.5 20.4 14.5 19S15.6 16.5 17 16.5 19.5 17.6 19.5 19 18.4 21.5 17 21.5Z",sS="M12 3C7.58 3 4 4.79 4 7V17C4 19.21 7.59 21 12 21S20 19.21 20 17V7C20 4.79 16.42 3 12 3M18 17C18 17.5 15.87 19 12 19S6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16S16.39 15.55 18 14.77V17M18 12.45C16.7 13.4 14.42 14 12 14C9.58 14 7.3 13.4 6 12.45V9.64C7.47 10.47 9.61 11 12 11C14.39 11 16.53 10.47 18 9.64V12.45M12 9C8.13 9 6 7.5 6 7S8.13 5 12 5C15.87 5 18 6.5 18 7S15.87 9 12 9Z",rS="M20 13.09V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.46 21 12.9 21 13.33 20.94C13.12 20.33 13 19.68 13 19L13 18.95C12.68 19 12.35 19 12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.65 16 13.27 15.96 13.88 15.89C14.93 14.16 16.83 13 19 13C19.34 13 19.67 13.04 20 13.09M18 12.45C16.7 13.4 14.42 14 12 14S7.3 13.4 6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.45M12 9C8.13 9 6 7.5 6 7S8.13 5 12 5 18 6.5 18 7 15.87 9 12 9M20.41 19L22.54 21.12L21.12 22.54L19 20.41L16.88 22.54L15.47 21.12L17.59 19L15.47 16.88L16.88 15.47L19 17.59L21.12 15.47L22.54 16.88L20.41 19",oS="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",iS="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",aS="M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z",lS="M22 6C22 4.9 21.1 4 20 4H4C2.9 4 2 4.9 2 6V18C2 19.1 2.9 20 4 20H20C21.1 20 22 19.1 22 18V6M20 6L12 11L4 6H20M20 18H4V8L12 13L20 8V18Z",cS="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",uS="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",dS="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z",pS="M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z",fS="M6.92,19L5,17.08L13.06,9L15,10.94M20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L13.84,6.41L11.91,4.5L10.5,5.91L11.92,7.33L3,16.25V21H7.75L16.67,12.08L18.09,13.5L19.5,12.09L17.58,10.17L20.7,7.05C21.1,6.65 21.1,6 20.71,5.63Z",hS="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",gS="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",mS="M7,11H1V13H7V11M9.17,7.76L7.05,5.64L5.64,7.05L7.76,9.17L9.17,7.76M13,1H11V7H13V1M18.36,7.05L16.95,5.64L14.83,7.76L16.24,9.17L18.36,7.05M17,11V13H23V11H17M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M14.83,16.24L16.95,18.36L18.36,16.95L16.24,14.83L14.83,16.24M5.64,16.95L7.05,18.36L9.17,16.24L7.76,14.83L5.64,16.95M11,23H13V17H11V23Z",bS="M5,3A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5.5L18.5,3H17V9A1,1 0 0,1 16,10H8A1,1 0 0,1 7,9V3H5M12,4V9H15V4H12M7,12H17A1,1 0 0,1 18,13V19H6V13A1,1 0 0,1 7,12Z",vS="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",yS="M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z",xS="M11,9H13V11H11V9M9,11H11V13H9V11M13,11H15V13H13V11M15,9H17V11H15V9M7,9H9V11H7V9M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M9,18H7V16H9V18M13,18H11V16H13V18M17,18H15V16H17V18M19,11H17V13H19V15H17V13H15V15H13V13H11V15H9V13H7V15H5V13H7V11H5V5H19V11Z",wS="M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z",SS="M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z",CS="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",jS="M22,16V4A2,2 0 0,0 20,2H8A2,2 0 0,0 6,4V16A2,2 0 0,0 8,18H20A2,2 0 0,0 22,16M11,12L13.03,14.71L16,11L20,16H8M2,6V20A2,2 0 0,0 4,22H18V20H4V6",ES="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",PS="M13.5,4A1.5,1.5 0 0,0 12,5.5A1.5,1.5 0 0,0 13.5,7A1.5,1.5 0 0,0 15,5.5A1.5,1.5 0 0,0 13.5,4M13.14,8.77C11.95,8.87 8.7,11.46 8.7,11.46C8.5,11.61 8.56,11.6 8.72,11.88C8.88,12.15 8.86,12.17 9.05,12.04C9.25,11.91 9.58,11.7 10.13,11.36C12.25,10 10.47,13.14 9.56,18.43C9.2,21.05 11.56,19.7 12.17,19.3C12.77,18.91 14.38,17.8 14.54,17.69C14.76,17.54 14.6,17.42 14.43,17.17C14.31,17 14.19,17.12 14.19,17.12C13.54,17.55 12.35,18.45 12.19,17.88C12,17.31 13.22,13.4 13.89,10.71C14,10.07 14.3,8.67 13.14,8.77Z",TS="M12,16L19.36,10.27L21,9L12,2L3,9L4.63,10.27M12,18.54L4.62,12.81L3,14.07L12,21.07L21,14.07L19.37,12.8L12,18.54Z",OS="M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z",_S="M11 15H6L13 1V9H18L11 23V15Z",AS="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",MS="M12,4V2A10,10 0 0,0 2,12H4A8,8 0 0,1 12,4Z",LS="M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z",NS="M18 1C15.24 1 13 3.24 13 6V8H4C2.9 8 2 8.89 2 10V20C2 21.11 2.9 22 4 22H16C17.11 22 18 21.11 18 20V10C18 8.9 17.11 8 16 8H15V6C15 4.34 16.34 3 18 3C19.66 3 21 4.34 21 6V8H23V6C23 3.24 20.76 1 18 1M10 13C11.1 13 12 13.89 12 15C12 16.11 11.11 17 10 17C8.9 17 8 16.11 8 15C8 13.9 8.9 13 10 13Z",$S="M7,10L12,15L17,10H7Z",kS="M12,2A3,3 0 0,1 15,5V11A3,3 0 0,1 12,14A3,3 0 0,1 9,11V5A3,3 0 0,1 12,2M19,11C19,14.53 16.39,17.44 13,17.93V21H11V17.93C7.61,17.44 5,14.53 5,11H7A5,5 0 0,0 12,16A5,5 0 0,0 17,11H19Z",RS="M19,11C19,12.19 18.66,13.3 18.1,14.28L16.87,13.05C17.14,12.43 17.3,11.74 17.3,11H19M15,11.16L9,5.18V5A3,3 0 0,1 12,2A3,3 0 0,1 15,5V11L15,11.16M4.27,3L21,19.73L19.73,21L15.54,16.81C14.77,17.27 13.91,17.58 13,17.72V21H11V17.72C7.72,17.23 5,14.41 5,11H6.7C6.7,14 9.24,16.1 12,16.1C12.81,16.1 13.6,15.91 14.31,15.58L12.65,13.92L12,14A3,3 0 0,1 9,11V10.28L3,4.27L4.27,3Z",IS="M20 5L20 19L4 19L4 5H20M20 3H4C2.89 3 2 3.89 2 5V19C2 20.11 2.89 21 4 21H20C21.11 21 22 20.11 22 19V5C22 3.89 21.11 3 20 3M18 15H6V17H18V15M10 7H6V13H10V7M12 9H18V7H12V9M18 11H12V13H18V11Z",VS="M12,2C13.85,2 15.55,2.78 16.9,4.1L18.6,1.93L20.18,3.16L18.2,5.68C19.33,7.41 20,9.6 20,12C20,17.5 16.42,22 12,22C10.15,22 8.45,21.22 7.1,19.9L5.4,22.07L3.82,20.84L5.8,18.32C4.67,16.59 4,14.4 4,12C4,6.5 7.58,2 12,2M12,4C8.69,4 6,7.58 6,12C6,13.73 6.41,15.33 7.11,16.64L15.67,5.67C14.66,4.62 13.38,4 12,4M12,20C15.31,20 18,16.42 18,12C18,10.27 17.59,8.67 16.89,7.36L8.33,18.33C9.34,19.38 10.62,20 12,20Z",HS="M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",V1="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",DS="M2.53,19.65L3.87,20.21V11.18L1.44,17.04C1.03,18.06 1.5,19.23 2.53,19.65M22.03,15.95L17.07,4C16.76,3.23 16.03,2.77 15.26,2.75C15,2.75 14.73,2.79 14.47,2.9L7.1,5.95C6.35,6.26 5.89,7 5.87,7.75C5.86,8 5.91,8.29 6,8.55L11,20.5C11.29,21.28 12.03,21.74 12.81,21.75C13.07,21.75 13.33,21.7 13.58,21.6L20.94,18.55C21.96,18.13 22.45,16.96 22.03,15.95M7.88,8.75A1,1 0 0,1 6.88,7.75A1,1 0 0,1 7.88,6.75C8.43,6.75 8.88,7.2 8.88,7.75C8.88,8.3 8.43,8.75 7.88,8.75M5.88,19.75A2,2 0 0,0 7.88,21.75H9.33L5.88,13.41V19.75Z",FS="M12,2.5L8,7H16L12,2.5M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M8,17L12,21.5L16,17H8Z",BS="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",zS="M6.62,10.79C8.06,13.62 10.38,15.94 13.21,17.38L15.41,15.18C15.69,14.9 16.08,14.82 16.43,14.93C17.55,15.3 18.75,15.5 20,15.5A1,1 0 0,1 21,16.5V20A1,1 0 0,1 20,21A17,17 0 0,1 3,4A1,1 0 0,1 4,3H7.5A1,1 0 0,1 8.5,4C8.5,5.25 8.7,6.45 9.07,7.57C9.18,7.92 9.1,8.31 8.82,8.59L6.62,10.79Z",US="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",WS="M17,13H13V17H11V13H7V11H11V7H13V11H17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",GS="M16,7V3H14V7H10V3H8V7H8C7,7 6,8 6,9V14.5L9.5,18V21H14.5V18L18,14.5V9C18,8 17,7 16,7Z",qS="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",KS="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M12 4L20 12L12 20L4 12Z",ZS="M12 2C11.5 2 11 2.19 10.59 2.59L7.29 5.88L12 10.58L16.71 5.88L13.41 2.59C13 2.19 12.5 2 12 2M5.88 7.29L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L5.88 16.71L10.58 12L5.88 7.29M18.12 7.29L13.42 12L18.12 16.71L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L18.12 7.29M12 13.42L7.29 18.12L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L16.71 18.12L12 13.42Z",YS="M12 2C11.5 2 11 2.19 10.59 2.59L2.59 10.59C1.8 11.37 1.8 12.63 2.59 13.41L10.59 21.41C11.37 22.2 12.63 22.2 13.41 21.41L21.41 13.41C22.2 12.63 22.2 11.37 21.41 10.59L13.41 2.59C13 2.19 12.5 2 12 2M12 4L15.29 7.29L12 10.59L8.71 7.29L12 4M7.29 8.71L10.59 12L7.29 15.29L4 12L7.29 8.71M16.71 8.71L20 12L16.71 15.29L13.41 12L16.71 8.71M12 13.41L15.29 16.71L12 20L8.71 16.71L12 13.41Z",XS="M13.13 22.19L11.5 18.36C13.07 17.78 14.54 17 15.9 16.09L13.13 22.19M5.64 12.5L1.81 10.87L7.91 8.1C7 9.46 6.22 10.93 5.64 12.5M21.61 2.39C21.61 2.39 16.66 .269 11 5.93C8.81 8.12 7.5 10.53 6.65 12.64C6.37 13.39 6.56 14.21 7.11 14.77L9.24 16.89C9.79 17.45 10.61 17.63 11.36 17.35C13.5 16.53 15.88 15.19 18.07 13C23.73 7.34 21.61 2.39 21.61 2.39M14.54 9.46C13.76 8.68 13.76 7.41 14.54 6.63S16.59 5.85 17.37 6.63C18.14 7.41 18.15 8.68 17.37 9.46C16.59 10.24 15.32 10.24 14.54 9.46M8.88 16.53L7.47 15.12L8.88 16.53M6.24 22L9.88 18.36C9.54 18.27 9.21 18.12 8.91 17.91L4.83 22H6.24M2 22H3.41L8.18 17.24L6.76 15.83L2 20.59V22M2 19.17L6.09 15.09C5.88 14.79 5.73 14.47 5.64 14.12L2 17.76V19.17Z",JS="M18,18H6V6H18V18Z",QS="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z",e2="M11,2V4.07C7.38,4.53 4.53,7.38 4.07,11H2V13H4.07C4.53,16.62 7.38,19.47 11,19.93V22H13V19.93C16.62,19.47 19.47,16.62 19.93,13H22V11H19.93C19.47,7.38 16.62,4.53 13,4.07V2M11,6.08V8H13V6.09C15.5,6.5 17.5,8.5 17.92,11H16V13H17.91C17.5,15.5 15.5,17.5 13,17.92V16H11V17.91C8.5,17.5 6.5,15.5 6.08,13H8V11H6.09C6.5,8.5 8.5,6.5 11,6.08M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11Z",t2="M22.08,11.04H20.08V4H13.05V2H11.04V4H4V11.04H2V13.05H4V20.08H11.04V22.08H13.05V20.08H20.08V13.05H22.08V11.04M18.07,18.07H13.05V16.06H11.04V18.07H6V13.05H8.03V11.04H6V6H11.04V8.03H13.05V6H18.07V11.04H16.06V13.05H18.07V18.07M13.05,12.05A1,1 0 0,1 12.05,13.05C11.5,13.05 11.04,12.6 11.04,12.05C11.04,11.5 11.5,11.04 12.05,11.04C12.6,11.04 13.05,11.5 13.05,12.05Z",n2="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z",s2="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6zm0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4zM7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",r2="M17 6H7C3.69 6 1 8.69 1 12S3.69 18 7 18H17C20.31 18 23 15.31 23 12S20.31 6 17 6M17 16H7C4.79 16 3 14.21 3 12S4.79 8 7 8H17C19.21 8 21 9.79 21 12S19.21 16 17 16M17 9C15.34 9 14 10.34 14 12S15.34 15 17 15 20 13.66 20 12 18.66 9 17 9Z",o2="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z",i2="M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z",a2="M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z",l2="M13,3V9H21V3M13,21H21V11H13M3,21H11V15H3M3,13H11V3H3V13Z",c2="M21 18H2V20H21V18M19 10V14H4V10H19M20 8H3C2.45 8 2 8.45 2 9V15C2 15.55 2.45 16 3 16H20C20.55 16 21 15.55 21 15V9C21 8.45 20.55 8 20 8M21 4H2V6H21V4Z",u2="M13 3V11H21V3H13M3 21H11V13H3V21M3 3V11H11V3H3M13 16H16V13H18V16H21V18H18V21H16V18H13V16Z",d2="M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",p2="M12.89,3L14.85,3.4L11.11,21L9.15,20.6L12.89,3M19.59,12L16,8.41V5.58L22.42,12L16,18.41V15.58L19.59,12M1.58,12L8,5.58V8.41L4.41,12L8,15.58V18.41L1.58,12Z";const ie=K;function K(...e){return(Array.isArray(e[0])?e[0]:[...e]).filter(Boolean).flatMap(r=>typeof r=="string"?r.split(" ").map(o=>{if(o=o.replace(/gjs-/g,"gs-utl-"),!o.includes("gs-utl-")&&!o.startsWith("gs-")){const i=o.split(":"),a=i.pop(),c=i.join(":"),u=a==null?void 0:a.startsWith("!"),p=`gs-utl-${u?a==null?void 0:a.slice(1):a}`,h=u?`!${p}`:p;return c?`${c}:${h}`:h}return o}):r).join(" ")}const k=f.forwardRef(function({as:t,children:n,className:s,col:r,revert:o,full:i,nowrap:a,space:c,gap:u,justify:d,items:p,...h},g){const m=t||"div";return l.jsx(m,{ref:g,className:K([s,"gs-utl-flex",r&&!o&&"gs-utl-flex-col",r&&o&&"gs-utl-flex-col-reverse",!r&&o&&"gs-utl-flex-row-reverse",i&&!r&&"gs-utl-w-full",i&&r&&"gs-utl-h-full",a?"gs-utl-flex-nowrap":"gs-utl-flex-wrap",c==="x2s"&&(r?"gs-utl-space-y-0.5":"gs-utl-space-x-0.5"),c==="xs"&&(r?"gs-utl-space-y-1":"gs-utl-space-x-1"),c==="s"&&(r?"gs-utl-space-y-2":"gs-utl-space-x-2"),c==="m"&&(r?"gs-utl-space-y-4":"gs-utl-space-x-4"),c==="l"&&(r?"gs-utl-space-y-6":"gs-utl-space-x-6"),c==="xl"&&(r?"gs-utl-space-y-8":"gs-utl-space-x-8"),u==="x2s"&&"gs-utl-gap-0.5",u==="xs"&&"gs-utl-gap-1",u==="s"&&"gs-utl-gap-2",u==="m"&&"gs-utl-gap-4",u==="l"&&"gs-utl-gap-6",u==="xl"&&"gs-utl-gap-8",p==="start"&&"gs-utl-items-start",p==="end"&&"gs-utl-items-end",p==="center"&&"gs-utl-items-center",d==="start"&&"gs-utl-justify-start",d==="end"&&"gs-utl-justify-end",d==="center"&&"gs-utl-justify-center",d==="between"&&"gs-utl-justify-between"]),...h,children:n})}),V=f.forwardRef(function({children:t,className:n,grow:s,...r},o){return l.jsx("div",{ref:o,className:K([n,s&&"flex-1"]),...r,children:t})});function wp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var du={exports:{}},pu,lh;function f2(){if(lh)return pu;lh=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pu=e,pu}var fu,ch;function h2(){if(ch)return fu;ch=1;var e=f2();function t(){}function n(){}return n.resetWarningCache=t,fu=function(){function s(i,a,c,u,d,p){if(p!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}s.isRequired=s;function r(){return s}var o={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:r,element:s,elementType:s,instanceOf:r,node:s,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},fu}var uh;function g2(){return uh||(uh=1,du.exports=h2()()),du.exports}var m2=function(e){var t={};function n(s){if(t[s])return t[s].exports;var r=t[s]={i:s,l:!1,exports:{}};return e[s].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(s,r,o){n.o(s,r)||Object.defineProperty(s,r,{enumerable:!0,get:o})},n.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},n.t=function(s,r){if(1&r&&(s=n(s)),8&r||4&r&&typeof s=="object"&&s&&s.__esModule)return s;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:s}),2&r&&typeof s!="string")for(var i in s)n.d(o,i,(function(a){return s[a]}).bind(null,i));return o},n.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(r,"a",r),r},n.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},n.p="",n(n.s=2)}([function(e,t){e.exports=g2()},function(e,t){e.exports=f},function(e,t,n){n.r(t);var s=n(1),r=n(0),o=function(){return(o=Object.assign||function(m){for(var b,v=1,x=arguments.length;v<x;v++)for(var y in b=arguments[v])Object.prototype.hasOwnProperty.call(b,y)&&(m[y]=b[y]);return m}).apply(this,arguments)},i=function(m,b){var v={};for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&b.indexOf(x)<0&&(v[x]=m[x]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(x=Object.getOwnPropertySymbols(m);y<x.length;y++)b.indexOf(x[y])<0&&Object.prototype.propertyIsEnumerable.call(m,x[y])&&(v[x[y]]=m[x[y]])}return v},a=0,c=s.forwardRef(function(m,b){var v=m.title,x=v===void 0?null:v,y=m.description,w=y===void 0?null:y,S=m.size,C=S===void 0?null:S,j=m.color,E=j===void 0?"currentColor":j,T=m.horizontal,O=T===void 0?null:T,P=m.vertical,_=P===void 0?null:P,M=m.rotate,N=M===void 0?null:M,H=m.spin,L=H===void 0?null:H,F=m.style,G=F===void 0?{}:F,D=m.children,$=i(m,["title","description","size","color","horizontal","vertical","rotate","spin","style","children"]);a++;var I,R=L!==null&&L,z=s.Children.map(D,function(ee){var te=ee;R!==!0&&(R=(L===null?te.props.spin:L)===!0);var q=te.props.size;typeof C=="number"&&typeof te.props.size=="number"&&(q=te.props.size/C);var ne={size:q,color:E===null?te.props.color:E,horizontal:O===null?te.props.horizontal:O,vertical:_===null?te.props.vertical:_,rotate:N===null?te.props.rotate:N,spin:L===null?te.props.spin:L,inStack:!0};return s.cloneElement(te,ne)});C!==null&&(G.width=typeof C=="string"?C:1.5*C+"rem");var Y,Z="stack_labelledby_"+a,J="stack_describedby_"+a;if(x)I=w?Z+" "+J:Z;else if(Y="presentation",w)throw new Error("title attribute required when description is set");return s.createElement("svg",o({ref:b,viewBox:"0 0 24 24",style:G,role:Y,"aria-labelledby":I},$),x&&s.createElement("title",{id:Z},x),w&&s.createElement("desc",{id:J},w),R&&s.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }","@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"),z)});c.displayName="Stack",c.propTypes={size:r.oneOfType([r.number,r.string]),color:r.string,horizontal:r.bool,vertical:r.bool,rotate:r.number,spin:r.oneOfType([r.bool,r.number]),children:r.oneOfType([r.arrayOf(r.node),r.node]).isRequired,className:r.string,style:r.object},c.defaultProps={size:null,color:null,horizontal:null,vertical:null,rotate:null,spin:null};var u=c;n.d(t,"Icon",function(){return g}),n.d(t,"Stack",function(){return u});var d=function(){return(d=Object.assign||function(m){for(var b,v=1,x=arguments.length;v<x;v++)for(var y in b=arguments[v])Object.prototype.hasOwnProperty.call(b,y)&&(m[y]=b[y]);return m}).apply(this,arguments)},p=function(m,b){var v={};for(var x in m)Object.prototype.hasOwnProperty.call(m,x)&&b.indexOf(x)<0&&(v[x]=m[x]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var y=0;for(x=Object.getOwnPropertySymbols(m);y<x.length;y++)b.indexOf(x[y])<0&&Object.prototype.propertyIsEnumerable.call(m,x[y])&&(v[x[y]]=m[x[y]])}return v},h=0,g=s.forwardRef(function(m,b){var v=m.path,x=m.id,y=x===void 0?++h:x,w=m.title,S=w===void 0?null:w,C=m.description,j=C===void 0?null:C,E=m.size,T=E===void 0?null:E,O=m.color,P=O===void 0?"currentColor":O,_=m.horizontal,M=_!==void 0&&_,N=m.vertical,H=N!==void 0&&N,L=m.rotate,F=L===void 0?0:L,G=m.spin,D=G!==void 0&&G,$=m.style,I=$===void 0?{}:$,R=m.inStack,z=R!==void 0&&R,Y=p(m,["path","id","title","description","size","color","horizontal","vertical","rotate","spin","style","inStack"]),Z={},J=[];T!==null&&(z?J.push("scale("+T+")"):(I.width=typeof T=="string"?T:1.5*T+"rem",I.height=I.width)),M&&J.push("scaleX(-1)"),H&&J.push("scaleY(-1)"),F!==0&&J.push("rotate("+F+"deg)"),P!==null&&(Z.fill=P);var ee=s.createElement("path",d({d:v,style:Z},z?Y:{})),te=ee;J.length>0&&(I.transform=J.join(" "),I.transformOrigin="center",z&&(te=s.createElement("g",{style:I},ee,s.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var q,ne=te,ce=D===!0||typeof D!="number"?2:D,ge=!z&&(M||H);if(ce<0&&(ge=!ge),D&&(ne=s.createElement("g",{style:{animation:"spin"+(ge?"-inverse":"")+" linear "+Math.abs(ce)+"s infinite",transformOrigin:"center"}},te,!(M||H||F!==0)&&s.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),z)return ne;var Re,ve="icon_labelledby_"+y,qe="icon_describedby_"+y;if(S)q=j?ve+" "+qe:ve;else if(Re="presentation",j)throw new Error("title attribute required when description is set");return s.createElement("svg",d({ref:b,viewBox:"0 0 24 24",style:I,role:Re,"aria-labelledby":q},Y),S&&s.createElement("title",{id:ve},S),j&&s.createElement("desc",{id:qe},j),!z&&D&&(ge?s.createElement("style",null,"@keyframes spin-inverse { from { transform: rotate(0deg) } to { transform: rotate(-360deg) } }"):s.createElement("style",null,"@keyframes spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }")),ne)});g.displayName="Icon",g.propTypes={path:r.string.isRequired,size:r.oneOfType([r.number,r.string]),color:r.string,horizontal:r.bool,vertical:r.bool,rotate:r.number,spin:r.oneOfType([r.bool,r.number]),style:r.object,inStack:r.bool,className:r.string},g.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},t.default=g}]);const Li=wp(m2);var H1={exports:{}};/*!
35
16
  Copyright (c) 2018 Jed Watson.
36
17
  Licensed under the MIT License (MIT), see
37
18
  http://jedwatson.github.io/classnames
38
- */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=r(o,s(a)))}return o}function s(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)t.call(o,a)&&o[a]&&(i=r(i,a));return i}function r(o,i){return i?o?o+" "+i:o+i:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(xb);var rC=xb.exports;const N=Bf(rC);var te={},oC={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,n){return"Cannot apply '"+t+"' to '"+n.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,n){return"[mobx.array] Index out of bounds, "+t+" is larger than "+n},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,n){return"the entry '"+t+"' does not exist in the observable map '"+n+"'"},26:"please specify a property",27:function(t,n){return"no observable property '"+t.toString()+"' found on the observable object '"+n+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,n){return"Cycle detected in computation "+t+": "+n},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},iC=te.NODE_ENV!=="production"?oC:{};function me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];if(te.NODE_ENV!=="production"){var r=typeof e=="string"?e:iC[e];throw typeof r=="function"&&(r=r.apply(null,n)),new Error("[MobX] "+r)}throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var aC={};function Nc(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:aC}var wb=Object.assign,nc=Object.getOwnPropertyDescriptor,Ms=Object.defineProperty,Oa=Object.prototype,sc=[];Object.freeze(sc);var Sb={};Object.freeze(Sb);var lC=typeof Proxy<"u",cC=Object.toString();function Cb(){lC||me(te.NODE_ENV!=="production"?"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`":"Proxy not available")}function Mi(e){te.NODE_ENV!=="production"&&ce.verifyProxies&&me("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function us(){return++ce.mobxGuid}function Uf(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Zo=function(){};function Rt(e){return typeof e=="function"}function vo(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Mc(e){return e!==null&&typeof e=="object"}function jn(e){if(!Mc(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===cC}function jb(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Aa(e,t,n){Ms(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Eb(e,t,n){Ms(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Fr(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(s){return Mc(s)&&s[n]===!0}}function wi(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function uC(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),s=Object.getPrototypeOf(n);return s===null}function Ys(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Pb=typeof Object.getOwnPropertySymbols<"u";function dC(e){var t=Object.keys(e);if(!Pb)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(s){return Oa.propertyIsEnumerable.call(e,s)})):t}var ai=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Pb?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Dd(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function _b(e){return e===null?null:typeof e=="object"?""+e:e}function Wn(e,t){return Oa.hasOwnProperty.call(e,t)}var fC=Object.getOwnPropertyDescriptors||function(t){var n={};return ai(t).forEach(function(s){n[s]=nc(t,s)}),n};function wn(e,t){return!!(e&t)}function Sn(e,t,n){return n?e|=t:e&=~t,e}function Dh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function pC(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,gC(s.key),s)}}function Si(e,t,n){return t&&pC(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xo(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=mC(e))||t){n&&(e=n);var s=0;return function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
39
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},sr.apply(null,arguments)}function Tb(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Hd(e,t)}function Hd(e,t){return Hd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},Hd(e,t)}function hC(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function gC(e){var t=hC(e,"string");return typeof t=="symbol"?t:t+""}function mC(e,t){if(e){if(typeof e=="string")return Dh(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dh(e,t):void 0}}var un=Symbol("mobx-stored-annotations");function Ls(e){function t(n,s){if(Ma(s))return e.decorate_20223_(n,s);Na(n,s,e)}return Object.assign(t,e)}function Na(e,t,n){if(Wn(e,un)||Aa(e,un,sr({},e[un])),te.NODE_ENV!=="production"&&oc(n)&&!Wn(e[un],t)){var s=e.constructor.name+".prototype."+t.toString();me("'"+s+"' is decorated with 'override', but no such decorated member was found on prototype.")}bC(e,n,t),oc(n)||(e[un][t]=n)}function bC(e,t,n){if(te.NODE_ENV!=="production"&&!oc(t)&&Wn(e[un],n)){var s=e.constructor.name+".prototype."+n.toString(),r=e[un][n].annotationType_,o=t.annotationType_;me("Cannot apply '@"+o+"' to '"+s+"':"+(`
40
- The field is already decorated with '@`+r+"'.")+`
41
- Re-decorating fields is not allowed.
42
- Use '@override' decorator for methods overridden by subclass.`)}}function vC(e){return Wn(e,un)||Aa(e,un,sr({},e[un])),e[un]}function Ma(e){return typeof e=="object"&&typeof e.kind=="string"}function Lc(e,t){te.NODE_ENV!=="production"&&!t.includes(e.kind)&&me("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var Ce=Symbol("mobx administration"),Br=function(){function e(n){n===void 0&&(n=te.NODE_ENV!=="production"?"Atom@"+us():"Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=qe.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(s){return s()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(s){return s()})},t.reportObserved=function(){return Ub(this)},t.reportChanged=function(){Hn(),Wb(this),Fn()},t.toString=function(){return this.name_},Si(e,[{key:"isBeingObserved",get:function(){return wn(this.flags_,e.isBeingObservedMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isBeingObservedMask_,s)}},{key:"isPendingUnobservation",get:function(){return wn(this.flags_,e.isPendingUnobservationMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isPendingUnobservationMask_,s)}},{key:"diffValue",get:function(){return wn(this.flags_,e.diffValueMask_)?1:0},set:function(s){this.flags_=Sn(this.flags_,e.diffValueMask_,s===1)}}])}();Br.isBeingObservedMask_=1;Br.isPendingUnobservationMask_=2;Br.diffValueMask_=4;var Wf=Fr("Atom",Br);function Ob(e,t,n){t===void 0&&(t=Zo),n===void 0&&(n=Zo);var s=new Br(e);return t!==Zo&&Lj(s,t),n!==Zo&&Xb(s,n),s}function yC(e,t){return e===t}function xC(e,t){return Qf(e,t)}function wC(e,t){return Qf(e,t,1)}function SC(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var rc={identity:yC,structural:xC,default:SC,shallow:wC};function yo(e,t,n){return ci(e)?e:Array.isArray(e)?zt.array(e,{name:n}):jn(e)?zt.object(e,void 0,{name:n}):wi(e)?zt.map(e,{name:n}):Ys(e)?zt.set(e,{name:n}):typeof e=="function"&&!li(e)&&!fa(e)?jb(e)?So(e):da(n,e):e}function CC(e,t,n){if(e==null||No(e)||Va(e)||dr(e)||ns(e))return e;if(Array.isArray(e))return zt.array(e,{name:n,deep:!1});if(jn(e))return zt.object(e,void 0,{name:n,deep:!1});if(wi(e))return zt.map(e,{name:n,deep:!1});if(Ys(e))return zt.set(e,{name:n,deep:!1});te.NODE_ENV!=="production"&&me("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function Rc(e){return e}function jC(e,t){return te.NODE_ENV!=="production"&&ci(e)&&me("observable.struct should not be used with observable values"),Qf(e,t)?t:e}var EC="override";function oc(e){return e.annotationType_===EC}function La(e,t){return{annotationType_:e,options_:t,make_:PC,extend_:_C,decorate_20223_:TC}}function PC(e,t,n,s){var r;if((r=this.options_)!=null&&r.bound)return this.extend_(e,t,n,!1)===null?0:1;if(s===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(li(n.value))return 1;var o=Ab(e,this,t,n,!1);return Ms(s,t,o),2}function _C(e,t,n,s){var r=Ab(e,this,t,n);return e.defineProperty_(t,r,s)}function TC(e,t){te.NODE_ENV!=="production"&&Lc(t,["method","field"]);var n=t.kind,s=t.name,r=t.addInitializer,o=this,i=function(u){var d,f,p,g;return xo((d=(f=o.options_)==null?void 0:f.name)!=null?d:s.toString(),u,(p=(g=o.options_)==null?void 0:g.autoAction)!=null?p:!1)};if(n=="field")return function(l){var u,d=l;return li(d)||(d=i(d)),(u=o.options_)!=null&&u.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(n=="method"){var a;return li(e)||(e=i(e)),(a=this.options_)!=null&&a.bound&&r(function(){var l=this,u=l[s].bind(l);u.isMobxAction=!0,l[s]=u}),e}me("Cannot apply '"+o.annotationType_+"' to '"+String(s)+"' (kind: "+n+"):"+(`
43
- '`+o.annotationType_+"' can only be used on properties with a function value."))}function OC(e,t,n,s){var r=t.annotationType_,o=s.value;te.NODE_ENV!=="production"&&!Rt(o)&&me("Cannot apply '"+r+"' to '"+e.name_+"."+n.toString()+"':"+(`
44
- '`+r+"' can only be used on properties with a function value."))}function Ab(e,t,n,s,r){var o,i,a,l,u,d,f;r===void 0&&(r=ce.safeDescriptors),OC(e,t,n,s);var p=s.value;if((o=t.options_)!=null&&o.bound){var g;p=p.bind((g=e.proxy_)!=null?g:e.target_)}return{value:xo((i=(a=t.options_)==null?void 0:a.name)!=null?i:n.toString(),p,(l=(u=t.options_)==null?void 0:u.autoAction)!=null?l:!1,(d=t.options_)!=null&&d.bound?(f=e.proxy_)!=null?f:e.target_:void 0),configurable:r?e.isPlainObject_:!0,enumerable:!1,writable:!r}}function Nb(e,t){return{annotationType_:e,options_:t,make_:AC,extend_:NC,decorate_20223_:MC}}function AC(e,t,n,s){var r;if(s===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((r=this.options_)!=null&&r.bound&&(!Wn(e.target_,t)||!fa(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(fa(n.value))return 1;var o=Mb(e,this,t,n,!1,!1);return Ms(s,t,o),2}function NC(e,t,n,s){var r,o=Mb(e,this,t,n,(r=this.options_)==null?void 0:r.bound);return e.defineProperty_(t,o,s)}function MC(e,t){var n;te.NODE_ENV!=="production"&&Lc(t,["method"]);var s=t.name,r=t.addInitializer;return fa(e)||(e=So(e)),(n=this.options_)!=null&&n.bound&&r(function(){var o=this,i=o[s].bind(o);i.isMobXFlow=!0,o[s]=i}),e}function LC(e,t,n,s){var r=t.annotationType_,o=s.value;te.NODE_ENV!=="production"&&!Rt(o)&&me("Cannot apply '"+r+"' to '"+e.name_+"."+n.toString()+"':"+(`
45
- '`+r+"' can only be used on properties with a generator function value."))}function Mb(e,t,n,s,r,o){o===void 0&&(o=ce.safeDescriptors),LC(e,t,n,s);var i=s.value;if(fa(i)||(i=So(i)),r){var a;i=i.bind((a=e.proxy_)!=null?a:e.target_),i.isMobXFlow=!0}return{value:i,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function Gf(e,t){return{annotationType_:e,options_:t,make_:RC,extend_:$C,decorate_20223_:kC}}function RC(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function $C(e,t,n,s){return VC(e,this,t,n),e.defineComputedProperty_(t,sr({},this.options_,{get:n.get,set:n.set}),s)}function kC(e,t){te.NODE_ENV!=="production"&&Lc(t,["getter"]);var n=this,s=t.name,r=t.addInitializer;return r(function(){var o=Ao(this)[Ce],i=sr({},n.options_,{get:e,context:this});i.name||(i.name=te.NODE_ENV!=="production"?o.name_+"."+s.toString():"ObservableObject."+s.toString()),o.values_.set(s,new Kn(i))}),function(){return this[Ce].getObservablePropValue_(s)}}function VC(e,t,n,s){var r=t.annotationType_,o=s.get;te.NODE_ENV!=="production"&&!o&&me("Cannot apply '"+r+"' to '"+e.name_+"."+n.toString()+"':"+(`
46
- '`+r+"' can only be used on getter(+setter) properties."))}function $c(e,t){return{annotationType_:e,options_:t,make_:IC,extend_:DC,decorate_20223_:HC}}function IC(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function DC(e,t,n,s){var r,o;return FC(e,this,t,n),e.defineObservableProperty_(t,n.value,(r=(o=this.options_)==null?void 0:o.enhancer)!=null?r:yo,s)}function HC(e,t){if(te.NODE_ENV!=="production"){if(t.kind==="field")throw me("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");Lc(t,["accessor"])}var n=this,s=t.kind,r=t.name,o=new WeakSet;function i(a,l){var u,d,f=Ao(a)[Ce],p=new Mr(l,(u=(d=n.options_)==null?void 0:d.enhancer)!=null?u:yo,te.NODE_ENV!=="production"?f.name_+"."+r.toString():"ObservableObject."+r.toString(),!1);f.values_.set(r,p),o.add(a)}if(s=="accessor")return{get:function(){return o.has(this)||i(this,e.get.call(this)),this[Ce].getObservablePropValue_(r)},set:function(l){return o.has(this)||i(this,l),this[Ce].setObservablePropValue_(r,l)},init:function(l){return o.has(this)||i(this,l),l}}}function FC(e,t,n,s){var r=t.annotationType_;te.NODE_ENV!=="production"&&!("value"in s)&&me("Cannot apply '"+r+"' to '"+e.name_+"."+n.toString()+"':"+(`
47
- '`+r+"' cannot be used on getter/setter properties"))}var BC="true",zC=Lb();function Lb(e){return{annotationType_:BC,options_:e,make_:UC,extend_:WC,decorate_20223_:GC}}function UC(e,t,n,s){var r,o;if(n.get)return kc.make_(e,t,n,s);if(n.set){var i=xo(t.toString(),n.set);return s===e.target_?e.defineProperty_(t,{configurable:ce.safeDescriptors?e.isPlainObject_:!0,set:i})===null?0:2:(Ms(s,t,{configurable:!0,set:i}),2)}if(s!==e.target_&&typeof n.value=="function"){var a;if(jb(n.value)){var l,u=(l=this.options_)!=null&&l.autoBind?So.bound:So;return u.make_(e,t,n,s)}var d=(a=this.options_)!=null&&a.autoBind?da.bound:da;return d.make_(e,t,n,s)}var f=((r=this.options_)==null?void 0:r.deep)===!1?zt.ref:zt;if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var p;n.value=n.value.bind((p=e.proxy_)!=null?p:e.target_)}return f.make_(e,t,n,s)}function WC(e,t,n,s){var r,o;if(n.get)return kc.extend_(e,t,n,s);if(n.set)return e.defineProperty_(t,{configurable:ce.safeDescriptors?e.isPlainObject_:!0,set:xo(t.toString(),n.set)},s);if(typeof n.value=="function"&&(r=this.options_)!=null&&r.autoBind){var i;n.value=n.value.bind((i=e.proxy_)!=null?i:e.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?zt.ref:zt;return a.extend_(e,t,n,s)}function GC(e,t){me("'"+this.annotationType_+"' cannot be used as a decorator")}var qC="observable",KC="observable.ref",YC="observable.shallow",ZC="observable.struct",Rb={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Rb);function ul(e){return e||Rb}var Fd=$c(qC),XC=$c(KC,{enhancer:Rc}),JC=$c(YC,{enhancer:CC}),QC=$c(ZC,{enhancer:jC}),$b=Ls(Fd);function dl(e){return e.deep===!0?yo:e.deep===!1?Rc:tj(e.defaultDecorator)}function ej(e){var t;return e?(t=e.defaultDecorator)!=null?t:Lb(e):void 0}function tj(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:yo}function kb(e,t,n){if(Ma(t))return Fd.decorate_20223_(e,t);if(vo(t)){Na(e,t,Fd);return}return ci(e)?e:jn(e)?zt.object(e,t,n):Array.isArray(e)?zt.array(e,t):wi(e)?zt.map(e,t):Ys(e)?zt.set(e,t):typeof e=="object"&&e!==null?e:zt.box(e,t)}wb(kb,$b);var nj={box:function(t,n){var s=ul(n);return new Mr(t,dl(s),s.name,!0,s.equals)},array:function(t,n){var s=ul(n);return(ce.useProxies===!1||s.proxy===!1?oE:Yj)(t,dl(s),s.name)},map:function(t,n){var s=ul(n);return new rv(t,dl(s),s.name)},set:function(t,n){var s=ul(n);return new ov(t,dl(s),s.name)},object:function(t,n,s){return zr(function(){return Qb(ce.useProxies===!1||(s==null?void 0:s.proxy)===!1?Ao({},s):Wj({},s),t,n)})},ref:Ls(XC),shallow:Ls(JC),deep:$b,struct:Ls(QC)},zt=wb(kb,nj),Vb="computed",sj="computed.struct",Bd=Gf(Vb),rj=Gf(sj,{equals:rc.structural}),kc=function(t,n){if(Ma(n))return Bd.decorate_20223_(t,n);if(vo(n))return Na(t,n,Bd);if(jn(t))return Ls(Gf(Vb,t));te.NODE_ENV!=="production"&&(Rt(t)||me("First argument to `computed` should be an expression."),Rt(n)&&me("A setter as second argument is no longer supported, use `{ set: fn }` option instead"));var s=jn(n)?n:{};return s.get=t,s.name||(s.name=t.name||""),new Kn(s)};Object.assign(kc,Bd);kc.struct=Ls(rj);var Hh,Fh,ic=0,oj=1,ij=(Hh=(Fh=nc(function(){},"name"))==null?void 0:Fh.configurable)!=null?Hh:!1,Bh={value:"action",configurable:!0,writable:!1,enumerable:!1};function xo(e,t,n,s){n===void 0&&(n=!1),te.NODE_ENV!=="production"&&(Rt(t)||me("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&me("actions should have valid names, got: '"+e+"'"));function r(){return aj(e,n,t,s||this,arguments)}return r.isMobxAction=!0,r.toString=function(){return t.toString()},ij&&(Bh.value=e,Ms(r,"name",Bh)),r}function aj(e,t,n,s,r){var o=lj(e,t,s,r);try{return n.apply(s,r)}catch(i){throw o.error_=i,i}finally{cj(o)}}function lj(e,t,n,s){var r=te.NODE_ENV!=="production"&&Ut()&&!!e,o=0;if(te.NODE_ENV!=="production"&&r){o=Date.now();var i=s?Array.from(s):sc;En({type:Zf,name:e,object:n,arguments:i})}var a=ce.trackingDerivation,l=!t||!a;Hn();var u=ce.allowStateChanges;l&&(Oo(),u=qf(!0));var d=Yf(!0),f={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:u,prevAllowStateReads_:d,notifySpy_:r,startTime_:o,actionId_:oj++,parentActionId_:ic};return ic=f.actionId_,f}function cj(e){ic!==e.actionId_&&me(30),ic=e.parentActionId_,e.error_!==void 0&&(ce.suppressReactionErrors=!0),Kf(e.prevAllowStateChanges_),Zi(e.prevAllowStateReads_),Fn(),e.runAsAction_&&tr(e.prevDerivation_),te.NODE_ENV!=="production"&&e.notifySpy_&&Pn({time:Date.now()-e.startTime_}),ce.suppressReactionErrors=!1}function qf(e){var t=ce.allowStateChanges;return ce.allowStateChanges=e,t}function Kf(e){ce.allowStateChanges=e}var uj="create",Mr=function(e){function t(s,r,o,i,a){var l;return o===void 0&&(o=te.NODE_ENV!=="production"?"ObservableValue@"+us():"ObservableValue"),i===void 0&&(i=!0),a===void 0&&(a=rc.default),l=e.call(this,o)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=r,l.name_=o,l.equals=a,l.value_=r(s,void 0,o),te.NODE_ENV!=="production"&&i&&Ut()&&wo({type:uj,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}Tb(t,e);var n=t.prototype;return n.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.set=function(r){var o=this.value_;if(r=this.prepareNewValue_(r),r!==ce.UNCHANGED){var i=Ut();te.NODE_ENV!=="production"&&i&&En({type:ss,object:this,observableKind:"value",debugObjectName:this.name_,newValue:r,oldValue:o}),this.setNewValue_(r),te.NODE_ENV!=="production"&&i&&Pn()}},n.prepareNewValue_=function(r){if(Os(this),Vn(this)){var o=In(this,{object:this,type:ss,newValue:r});if(!o)return ce.UNCHANGED;r=o.newValue}return r=this.enhancer(r,this.value_,this.name_),this.equals(this.value_,r)?ce.UNCHANGED:r},n.setNewValue_=function(r){var o=this.value_;this.value_=r,this.reportChanged(),rs(this)&&os(this,{type:ss,object:this,newValue:r,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(r){return $a(this,r)},n.observe_=function(r,o){return o&&r({observableKind:"value",debugObjectName:this.name_,object:this,type:ss,newValue:this.value_,oldValue:void 0}),ka(this,r)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return _b(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Br),dj=Fr("ObservableValue",Mr),Kn=function(){function e(n){this.dependenciesState_=qe.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=qe.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ac(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Gn.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||me(31),this.derivation=n.get,this.name_=n.name||(te.NODE_ENV!=="production"?"ComputedValue@"+us():"ComputedValue"),n.set&&(this.setter_=xo(te.NODE_ENV!=="production"?this.name_+"-setter":"ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?rc.structural:rc.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){vj(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(s){return s()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(s){return s()})},t.get=function(){if(this.isComputing&&me(32,this.name_,this.derivation),ce.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)zd(this)&&(this.warnAboutUntrackedRead_(),Hn(),this.value_=this.computeValue_(!1),Fn());else if(Ub(this),zd(this)){var s=ce.trackingContext;this.keepAlive_&&!s&&(ce.trackingContext=this),this.trackAndCompute()&&bj(this),ce.trackingContext=s}var r=this.value_;if(ql(r))throw r.cause;return r},t.set=function(s){if(this.setter_){this.isRunningSetter&&me(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,s)}finally{this.isRunningSetter=!1}}else me(34,this.name_)},t.trackAndCompute=function(){var s=this.value_,r=this.dependenciesState_===qe.NOT_TRACKING_,o=this.computeValue_(!0),i=r||ql(s)||ql(o)||!this.equals_(s,o);return i&&(this.value_=o,te.NODE_ENV!=="production"&&Ut()&&wo({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:s,newValue:o})),i},t.computeValue_=function(s){this.isComputing=!0;var r=qf(!1),o;if(s)o=Ib(this,this.derivation,this.scope_);else if(ce.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(i){o=new ac(i)}return Kf(r),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(Ud(this),this.value_=void 0,te.NODE_ENV!=="production"&&this.isTracing_!==Gn.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(s,r){var o=this,i=!0,a=void 0;return Tj(function(){var l=o.get();if(!i||r){var u=Oo();s({observableKind:"computed",debugObjectName:o.name_,type:ss,object:o,newValue:l,oldValue:a}),tr(u)}i=!1,a=l})},t.warnAboutUntrackedRead_=function(){te.NODE_ENV!=="production"&&(this.isTracing_!==Gn.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:ce.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."))},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return _b(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Si(e,[{key:"isComputing",get:function(){return wn(this.flags_,e.isComputingMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isComputingMask_,s)}},{key:"isRunningSetter",get:function(){return wn(this.flags_,e.isRunningSetterMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isRunningSetterMask_,s)}},{key:"isBeingObserved",get:function(){return wn(this.flags_,e.isBeingObservedMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isBeingObservedMask_,s)}},{key:"isPendingUnobservation",get:function(){return wn(this.flags_,e.isPendingUnobservationMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isPendingUnobservationMask_,s)}},{key:"diffValue",get:function(){return wn(this.flags_,e.diffValueMask_)?1:0},set:function(s){this.flags_=Sn(this.flags_,e.diffValueMask_,s===1)}}])}();Kn.isComputingMask_=1;Kn.isRunningSetterMask_=2;Kn.isBeingObservedMask_=4;Kn.isPendingUnobservationMask_=8;Kn.diffValueMask_=16;var Ra=Fr("ComputedValue",Kn),qe;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(qe||(qe={}));var Gn;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Gn||(Gn={}));var ac=function(t){this.cause=void 0,this.cause=t};function ql(e){return e instanceof ac}function zd(e){switch(e.dependenciesState_){case qe.UP_TO_DATE_:return!1;case qe.NOT_TRACKING_:case qe.STALE_:return!0;case qe.POSSIBLY_STALE_:{for(var t=Yf(!0),n=Oo(),s=e.observing_,r=s.length,o=0;o<r;o++){var i=s[o];if(Ra(i)){if(ce.disableErrorBoundaries)i.get();else try{i.get()}catch{return tr(n),Zi(t),!0}if(e.dependenciesState_===qe.STALE_)return tr(n),Zi(t),!0}}return Hb(e),tr(n),Zi(t),!1}}}function Os(e){if(te.NODE_ENV!=="production"){var t=e.observers_.size>0;!ce.allowStateChanges&&(t||ce.enforceActions==="always")&&console.warn("[MobX] "+(ce.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}}function fj(e){te.NODE_ENV!=="production"&&!ce.allowStateReads&&ce.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Ib(e,t,n){var s=Yf(!0);Hb(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++ce.runId;var r=ce.trackingDerivation;ce.trackingDerivation=e,ce.inBatch++;var o;if(ce.disableErrorBoundaries===!0)o=t.call(n);else try{o=t.call(n)}catch(i){o=new ac(i)}return ce.inBatch--,ce.trackingDerivation=r,hj(e),pj(e),Zi(s),o}function pj(e){te.NODE_ENV!=="production"&&e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:ce.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function hj(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,s=qe.UP_TO_DATE_,r=0,o=e.unboundDepsCount_,i=0;i<o;i++){var a=n[i];a.diffValue===0&&(a.diffValue=1,r!==i&&(n[r]=a),r++),a.dependenciesState_>s&&(s=a.dependenciesState_)}for(n.length=r,e.newObserving_=null,o=t.length;o--;){var l=t[o];l.diffValue===0&&Bb(l,e),l.diffValue=0}for(;r--;){var u=n[r];u.diffValue===1&&(u.diffValue=0,mj(u,e))}s!==qe.UP_TO_DATE_&&(e.dependenciesState_=s,e.onBecomeStale_())}function Ud(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Bb(t[n],e);e.dependenciesState_=qe.NOT_TRACKING_}function Db(e){var t=Oo();try{return e()}finally{tr(t)}}function Oo(){var e=ce.trackingDerivation;return ce.trackingDerivation=null,e}function tr(e){ce.trackingDerivation=e}function Yf(e){var t=ce.allowStateReads;return ce.allowStateReads=e,t}function Zi(e){ce.allowStateReads=e}function Hb(e){if(e.dependenciesState_!==qe.UP_TO_DATE_){e.dependenciesState_=qe.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=qe.UP_TO_DATE_}}var Kl=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Yl=!0,Fb=!1,ce=function(){var e=Nc();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Yl=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new Kl().version&&(Yl=!1),Yl?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new Kl):(setTimeout(function(){Fb||me(35)},1),new Kl)}();function gj(){if((ce.pendingReactions.length||ce.inBatch||ce.isRunningReactions)&&me(36),Fb=!0,Yl){var e=Nc();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),ce=new Kl}}function mj(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Bb(e,t){e.observers_.delete(t),e.observers_.size===0&&zb(e)}function zb(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,ce.pendingUnobservations.push(e))}function Hn(){ce.inBatch++}function Fn(){if(--ce.inBatch===0){Kb();for(var e=ce.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Kn&&n.suspend_())}ce.pendingUnobservations=[]}}function Ub(e){fj(e);var t=ce.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&ce.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&ce.inBatch>0&&zb(e),!1)}function Wb(e){e.lowestObserverState_!==qe.STALE_&&(e.lowestObserverState_=qe.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===qe.UP_TO_DATE_&&(te.NODE_ENV!=="production"&&t.isTracing_!==Gn.NONE&&Gb(t,e),t.onBecomeStale_()),t.dependenciesState_=qe.STALE_}))}function bj(e){e.lowestObserverState_!==qe.STALE_&&(e.lowestObserverState_=qe.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===qe.POSSIBLY_STALE_?(t.dependenciesState_=qe.STALE_,te.NODE_ENV!=="production"&&t.isTracing_!==Gn.NONE&&Gb(t,e)):t.dependenciesState_===qe.UP_TO_DATE_&&(e.lowestObserverState_=qe.UP_TO_DATE_)}))}function vj(e){e.lowestObserverState_===qe.UP_TO_DATE_&&(e.lowestObserverState_=qe.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===qe.UP_TO_DATE_&&(t.dependenciesState_=qe.POSSIBLY_STALE_,t.onBecomeStale_())}))}function Gb(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===Gn.BREAK){var n=[];qb(ev(e),n,1),new Function(`debugger;
48
- /*
49
- Tracing '`+e.name_+`'
50
-
51
- You are entering this break point because derivation '`+e.name_+"' is being traced and '"+t.name_+`' is now forcing it to update.
52
- Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
53
- The stackframe you are looking for is at least ~6-8 stack-frames up.
54
-
55
- `+(e instanceof Kn?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
56
-
57
- The dependencies for this derivation are:
58
-
59
- `+n.join(`
60
- `)+`
61
- */
62
- `)()}}function qb(e,t,n){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(n-1)+e.name),e.dependencies&&e.dependencies.forEach(function(s){return qb(s,t,n+1)})}var rr=function(){function e(n,s,r,o){n===void 0&&(n=te.NODE_ENV!=="production"?"Reaction@"+us():"Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=qe.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Gn.NONE,this.name_=n,this.onInvalidate_=s,this.errorHandler_=r,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,ce.pendingReactions.push(this),Kb())},t.runReaction_=function(){if(!this.isDisposed){Hn(),this.isScheduled=!1;var s=ce.trackingContext;if(ce.trackingContext=this,zd(this)){this.isTrackPending=!0;try{this.onInvalidate_(),te.NODE_ENV!=="production"&&this.isTrackPending&&Ut()&&wo({name:this.name_,type:"scheduled-reaction"})}catch(r){this.reportExceptionInDerivation_(r)}}ce.trackingContext=s,Fn()}},t.track=function(s){if(!this.isDisposed){Hn();var r=Ut(),o;te.NODE_ENV!=="production"&&r&&(o=Date.now(),En({name:this.name_,type:"reaction"})),this.isRunning=!0;var i=ce.trackingContext;ce.trackingContext=this;var a=Ib(this,s,void 0);ce.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Ud(this),ql(a)&&this.reportExceptionInDerivation_(a.cause),te.NODE_ENV!=="production"&&r&&Pn({time:Date.now()-o}),Fn()}},t.reportExceptionInDerivation_=function(s){var r=this;if(this.errorHandler_){this.errorHandler_(s,this);return}if(ce.disableErrorBoundaries)throw s;var o=te.NODE_ENV!=="production"?"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'":"[mobx] uncaught error in '"+this+"'";ce.suppressReactionErrors?te.NODE_ENV!=="production"&&console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(o,s),te.NODE_ENV!=="production"&&Ut()&&wo({type:"error",name:this.name_,message:o,error:""+s}),ce.globalReactionErrorHandlers.forEach(function(i){return i(s,r)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Hn(),Ud(this),Fn()))},t.getDisposer_=function(s){var r=this,o=function i(){r.dispose(),s==null||s.removeEventListener==null||s.removeEventListener("abort",i)};return s==null||s.addEventListener==null||s.addEventListener("abort",o),o[Ce]=this,o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(s){s===void 0&&(s=!1),Bj(this,s)},Si(e,[{key:"isDisposed",get:function(){return wn(this.flags_,e.isDisposedMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isDisposedMask_,s)}},{key:"isScheduled",get:function(){return wn(this.flags_,e.isScheduledMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isScheduledMask_,s)}},{key:"isTrackPending",get:function(){return wn(this.flags_,e.isTrackPendingMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isTrackPendingMask_,s)}},{key:"isRunning",get:function(){return wn(this.flags_,e.isRunningMask_)},set:function(s){this.flags_=Sn(this.flags_,e.isRunningMask_,s)}},{key:"diffValue",get:function(){return wn(this.flags_,e.diffValueMask_)?1:0},set:function(s){this.flags_=Sn(this.flags_,e.diffValueMask_,s===1)}}])}();rr.isDisposedMask_=1;rr.isScheduledMask_=2;rr.isTrackPendingMask_=4;rr.isRunningMask_=8;rr.diffValueMask_=16;var zh=100,Wd=function(t){return t()};function Kb(){ce.inBatch>0||ce.isRunningReactions||Wd(yj)}function yj(){ce.isRunningReactions=!0;for(var e=ce.pendingReactions,t=0;e.length>0;){++t===zh&&(console.error(te.NODE_ENV!=="production"?"Reaction doesn't converge to a stable state after "+zh+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0]):"[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),s=0,r=n.length;s<r;s++)n[s].runReaction_()}ce.isRunningReactions=!1}var lc=Fr("Reaction",rr);function xj(e){var t=Wd;Wd=function(s){return e(function(){return t(s)})}}function Ut(){return te.NODE_ENV!=="production"&&!!ce.spyListeners.length}function wo(e){if(te.NODE_ENV!=="production"&&ce.spyListeners.length)for(var t=ce.spyListeners,n=0,s=t.length;n<s;n++)t[n](e)}function En(e){if(te.NODE_ENV!=="production"){var t=sr({},e,{spyReportStart:!0});wo(t)}}var wj={type:"report-end",spyReportEnd:!0};function Pn(e){te.NODE_ENV!=="production"&&wo(e?sr({},e,{type:"report-end",spyReportEnd:!0}):wj)}function Sj(e){return te.NODE_ENV==="production"?(console.warn("[mobx.spy] Is a no-op in production builds"),function(){}):(ce.spyListeners.push(e),Uf(function(){ce.spyListeners=ce.spyListeners.filter(function(t){return t!==e})}))}var Zf="action",Cj="action.bound",Yb="autoAction",jj="autoAction.bound",Ej="<unnamed action>",Gd=La(Zf),Pj=La(Cj,{bound:!0}),qd=La(Yb,{autoAction:!0}),_j=La(jj,{autoAction:!0,bound:!0});function Zb(e){var t=function(s,r){if(Rt(s))return xo(s.name||Ej,s,e);if(Rt(r))return xo(s,r,e);if(Ma(r))return(e?qd:Gd).decorate_20223_(s,r);if(vo(r))return Na(s,r,e?qd:Gd);if(vo(s))return Ls(La(e?Yb:Zf,{name:s,autoAction:e}));te.NODE_ENV!=="production"&&me("Invalid arguments for `action`")};return t}var Jo=Zb(!1);Object.assign(Jo,Gd);var da=Zb(!0);Object.assign(da,qd);Jo.bound=Ls(Pj);da.bound=Ls(_j);function li(e){return Rt(e)&&e.isMobxAction===!0}function Tj(e,t){var n,s,r,o;t===void 0&&(t=Sb),te.NODE_ENV!=="production"&&(Rt(e)||me("Autorun expects a function as first argument"),li(e)&&me("Autorun does not accept actions since actions are untrackable"));var i=(n=(s=t)==null?void 0:s.name)!=null?n:te.NODE_ENV!=="production"?e.name||"Autorun@"+us():"Autorun",a=!t.scheduler&&!t.delay,l;if(a)l=new rr(i,function(){this.track(f)},t.onError,t.requiresObservable);else{var u=Aj(t),d=!1;l=new rr(i,function(){d||(d=!0,u(function(){d=!1,l.isDisposed||l.track(f)}))},t.onError,t.requiresObservable)}function f(){e(l)}return(r=t)!=null&&(r=r.signal)!=null&&r.aborted||l.schedule_(),l.getDisposer_((o=t)==null?void 0:o.signal)}var Oj=function(t){return t()};function Aj(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Oj}var Nj="onBO",Mj="onBUO";function Lj(e,t,n){return Jb(Nj,e,t,n)}function Xb(e,t,n){return Jb(Mj,e,t,n)}function Jb(e,t,n,s){var r=ui(t),o=Rt(s)?s:n,i=e+"L";return r[i]?r[i].add(o):r[i]=new Set([o]),function(){var a=r[i];a&&(a.delete(o),a.size===0&&delete r[i])}}var Rj="never",fl="always",$j="observed";function kj(e){e.isolateGlobalState===!0&&gj();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(ce.useProxies=t===fl?!0:t===Rj?!1:typeof Proxy<"u"),t==="ifavailable"&&(ce.verifyProxies=!0),n!==void 0){var s=n===fl?fl:n===$j;ce.enforceActions=s,ce.allowStateChanges=!(s===!0||s===fl)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(r){r in e&&(ce[r]=!!e[r])}),ce.allowStateReads=!ce.observableRequiresReaction,te.NODE_ENV!=="production"&&ce.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&xj(e.reactionScheduler)}function Qb(e,t,n,s){te.NODE_ENV!=="production"&&(arguments.length>4&&me("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&me("'extendObservable' expects an object as first argument"),dr(e)&&me("'extendObservable' should not be used on maps, use map.merge instead"),jn(t)||me("'extendObservable' only accepts plain objects as second argument"),(ci(t)||ci(n))&&me("Extending an object with another observable (object) is not supported"));var r=fC(t);return zr(function(){var o=Ao(e,s)[Ce];ai(r).forEach(function(i){o.extend_(i,r[i],n&&i in n?n[i]:!0)})}),e}function ev(e,t){return tv(ui(e,t))}function tv(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Vj(e.observing_).map(tv)),t}function Vj(e){return Array.from(new Set(e))}var Ij=0;function nv(){this.message="FLOW_CANCELLED"}nv.prototype=Object.create(Error.prototype);var Mu=Nb("flow"),Dj=Nb("flow.bound",{bound:!0}),So=Object.assign(function(t,n){if(Ma(n))return Mu.decorate_20223_(t,n);if(vo(n))return Na(t,n,Mu);te.NODE_ENV!=="production"&&arguments.length!==1&&me("Flow expects single argument with generator function");var s=t,r=s.name||"<unnamed flow>",o=function(){var a=this,l=arguments,u=++Ij,d=Jo(r+" - runid: "+u+" - init",s).apply(a,l),f,p=void 0,g=new Promise(function(m,b){var v=0;f=b;function x(S){p=void 0;var C;try{C=Jo(r+" - runid: "+u+" - yield "+v++,d.next).call(d,S)}catch(j){return b(j)}w(C)}function y(S){p=void 0;var C;try{C=Jo(r+" - runid: "+u+" - yield "+v++,d.throw).call(d,S)}catch(j){return b(j)}w(C)}function w(S){if(Rt(S==null?void 0:S.then)){S.then(w,b);return}return S.done?m(S.value):(p=Promise.resolve(S.value),p.then(x,y))}x(void 0)});return g.cancel=Jo(r+" - runid: "+u+" - cancel",function(){try{p&&Uh(p);var m=d.return(void 0),b=Promise.resolve(m.value);b.then(Zo,Zo),Uh(b),f(new nv)}catch(v){f(v)}}),g};return o.isMobXFlow=!0,o},Mu);So.bound=Ls(Dj);function Uh(e){Rt(e.cancel)&&e.cancel()}function fa(e){return(e==null?void 0:e.isMobXFlow)===!0}function Hj(e,t){return e?No(e)||!!e[Ce]||Wf(e)||lc(e)||Ra(e):!1}function ci(e){return te.NODE_ENV!=="production"&&arguments.length!==1&&me("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Hj(e)}function Fj(e){if(No(e))return e[Ce].ownKeys_();me(38)}function pl(e,t,n){return e.set(t,n),n}function qo(e,t){if(e==null||typeof e!="object"||e instanceof Date||!ci(e))return e;if(dj(e)||Ra(e))return qo(e.get(),t);if(t.has(e))return t.get(e);if(Va(e)){var n=pl(t,e,new Array(e.length));return e.forEach(function(i,a){n[a]=qo(i,t)}),n}if(ns(e)){var s=pl(t,e,new Set);return e.forEach(function(i){s.add(qo(i,t))}),s}if(dr(e)){var r=pl(t,e,new Map);return e.forEach(function(i,a){r.set(a,qo(i,t))}),r}else{var o=pl(t,e,{});return Fj(e).forEach(function(i){Oa.propertyIsEnumerable.call(e,i)&&(o[i]=qo(e[i],t))}),o}}function Er(e,t){return te.NODE_ENV!=="production"&&t&&me("toJS no longer supports options"),qo(e,new Map)}function Bj(){if(te.NODE_ENV!=="production"){for(var e=!1,t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];typeof n[n.length-1]=="boolean"&&(e=n.pop());var r=zj(n);if(!r)return me("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");r.isTracing_===Gn.NONE&&console.log("[mobx.trace] '"+r.name_+"' tracing enabled"),r.isTracing_=e?Gn.BREAK:Gn.LOG}}function zj(e){switch(e.length){case 0:return ce.trackingDerivation;case 1:return ui(e[0]);case 2:return ui(e[0],e[1])}}function Zs(e,t){t===void 0&&(t=void 0),Hn();try{return e.apply(t)}finally{Fn()}}function to(e){return e[Ce]}var Uj={has:function(t,n){return te.NODE_ENV!=="production"&&ce.trackingDerivation&&Mi("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),to(t).has_(n)},get:function(t,n){return to(t).get_(n)},set:function(t,n,s){var r;return vo(n)?(te.NODE_ENV!=="production"&&!to(t).values_.has(n)&&Mi("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(r=to(t).set_(n,s,!0))!=null?r:!0):!1},deleteProperty:function(t,n){var s;return te.NODE_ENV!=="production"&&Mi("delete properties from an observable object. Use 'remove' from 'mobx' instead."),vo(n)?(s=to(t).delete_(n,!0))!=null?s:!0:!1},defineProperty:function(t,n,s){var r;return te.NODE_ENV!=="production"&&Mi("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(r=to(t).defineProperty_(n,s))!=null?r:!0},ownKeys:function(t){return te.NODE_ENV!=="production"&&ce.trackingDerivation&&Mi("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),to(t).ownKeys_()},preventExtensions:function(t){me(13)}};function Wj(e,t){var n,s;return Cb(),e=Ao(e,t),(s=(n=e[Ce]).proxy_)!=null?s:n.proxy_=new Proxy(e,Uj)}function Vn(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function $a(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),Uf(function(){var s=n.indexOf(t);s!==-1&&n.splice(s,1)})}function In(e,t){var n=Oo();try{for(var s=[].concat(e.interceptors_||[]),r=0,o=s.length;r<o&&(t=s[r](t),t&&!t.type&&me(14),!!t);r++);return t}finally{tr(n)}}function rs(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function ka(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),Uf(function(){var s=n.indexOf(t);s!==-1&&n.splice(s,1)})}function os(e,t){var n=Oo(),s=e.changeListeners_;if(s){s=s.slice();for(var r=0,o=s.length;r<o;r++)s[r](t);tr(n)}}function Gj(e,t,n){return zr(function(){var s,r=Ao(e,n)[Ce];te.NODE_ENV!=="production"&&t&&e[un]&&me("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(s=t)!=null||(t=vC(e)),ai(t).forEach(function(o){return r.make_(o,t[o])})}),e}var Lu=Symbol("mobx-keys");function on(e,t,n){return te.NODE_ENV!=="production"&&(!jn(e)&&!jn(Object.getPrototypeOf(e))&&me("'makeAutoObservable' can only be used for classes that don't have a superclass"),No(e)&&me("makeAutoObservable can only be used on objects not already made observable")),jn(e)?Qb(e,e,t,n):(zr(function(){var s=Ao(e,n)[Ce];if(!e[Lu]){var r=Object.getPrototypeOf(e),o=new Set([].concat(ai(e),ai(r)));o.delete("constructor"),o.delete(Ce),Aa(r,Lu,o)}e[Lu].forEach(function(i){return s.make_(i,t&&i in t?t[i]:!0)})}),e)}var Wh="splice",ss="update",qj=1e4,Kj={get:function(t,n){var s=t[Ce];return n===Ce?s:n==="length"?s.getArrayLength_():typeof n=="string"&&!isNaN(n)?s.get_(parseInt(n)):Wn(cc,n)?cc[n]:t[n]},set:function(t,n,s){var r=t[Ce];return n==="length"&&r.setArrayLength_(s),typeof n=="symbol"||isNaN(n)?t[n]=s:r.set_(parseInt(n),s),!0},preventExtensions:function(){me(15)}},Xf=function(){function e(n,s,r,o){n===void 0&&(n=te.NODE_ENV!=="production"?"ObservableArray@"+us():"ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=r,this.legacyMode_=o,this.atom_=new Br(n),this.enhancer_=function(i,a){return s(i,a,te.NODE_ENV!=="production"?n+"[..]":"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(s){return this.dehancer!==void 0?this.dehancer(s):s},t.dehanceValues_=function(s){return this.dehancer!==void 0&&s.length>0?s.map(this.dehancer):s},t.intercept_=function(s){return $a(this,s)},t.observe_=function(s,r){return r===void 0&&(r=!1),r&&s({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),ka(this,s)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(s){(typeof s!="number"||isNaN(s)||s<0)&&me("Out of range: "+s);var r=this.values_.length;if(s!==r)if(s>r){for(var o=new Array(s-r),i=0;i<s-r;i++)o[i]=void 0;this.spliceWithArray_(r,0,o)}else this.spliceWithArray_(s,r-s)},t.updateArrayLength_=function(s,r){s!==this.lastKnownLength_&&me(16),this.lastKnownLength_+=r,this.legacyMode_&&r>0&&lv(s+r+1)},t.spliceWithArray_=function(s,r,o){var i=this;Os(this.atom_);var a=this.values_.length;if(s===void 0?s=0:s>a?s=a:s<0&&(s=Math.max(0,a+s)),arguments.length===1?r=a-s:r==null?r=0:r=Math.max(0,Math.min(r,a-s)),o===void 0&&(o=sc),Vn(this)){var l=In(this,{object:this.proxy_,type:Wh,index:s,removedCount:r,added:o});if(!l)return sc;r=l.removedCount,o=l.added}if(o=o.length===0?o:o.map(function(f){return i.enhancer_(f,void 0)}),this.legacyMode_||te.NODE_ENV!=="production"){var u=o.length-r;this.updateArrayLength_(a,u)}var d=this.spliceItemsIntoValues_(s,r,o);return(r!==0||o.length!==0)&&this.notifyArraySplice_(s,o,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(s,r,o){if(o.length<qj){var i;return(i=this.values_).splice.apply(i,[s,r].concat(o))}else{var a=this.values_.slice(s,s+r),l=this.values_.slice(s+r);this.values_.length+=o.length-r;for(var u=0;u<o.length;u++)this.values_[s+u]=o[u];for(var d=0;d<l.length;d++)this.values_[s+o.length+d]=l[d];return a}},t.notifyArrayChildUpdate_=function(s,r,o){var i=!this.owned_&&Ut(),a=rs(this),l=a||i?{observableKind:"array",object:this.proxy_,type:ss,debugObjectName:this.atom_.name_,index:s,newValue:r,oldValue:o}:null;te.NODE_ENV!=="production"&&i&&En(l),this.atom_.reportChanged(),a&&os(this,l),te.NODE_ENV!=="production"&&i&&Pn()},t.notifyArraySplice_=function(s,r,o){var i=!this.owned_&&Ut(),a=rs(this),l=a||i?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Wh,index:s,removed:o,added:r,removedCount:o.length,addedCount:r.length}:null;te.NODE_ENV!=="production"&&i&&En(l),this.atom_.reportChanged(),a&&os(this,l),te.NODE_ENV!=="production"&&i&&Pn()},t.get_=function(s){if(this.legacyMode_&&s>=this.values_.length){console.warn(te.NODE_ENV!=="production"?"[mobx.array] Attempt to read an array index ("+s+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX":"[mobx] Out of bounds read: "+s);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[s])},t.set_=function(s,r){var o=this.values_;if(this.legacyMode_&&s>o.length&&me(17,s,o.length),s<o.length){Os(this.atom_);var i=o[s];if(Vn(this)){var a=In(this,{type:ss,object:this.proxy_,index:s,newValue:r});if(!a)return;r=a.newValue}r=this.enhancer_(r,i);var l=r!==i;l&&(o[s]=r,this.notifyArrayChildUpdate_(s,r,i))}else{for(var u=new Array(s+1-o.length),d=0;d<u.length-1;d++)u[d]=void 0;u[u.length-1]=r,this.spliceWithArray_(o.length,0,u)}},e}();function Yj(e,t,n,s){return n===void 0&&(n=te.NODE_ENV!=="production"?"ObservableArray@"+us():"ObservableArray"),s===void 0&&(s=!1),Cb(),zr(function(){var r=new Xf(n,t,s,!1);Eb(r.values_,Ce,r);var o=new Proxy(r.values_,Kj);return r.proxy_=o,e&&e.length&&r.spliceWithArray_(0,0,e),o})}var cc={clear:function(){return this.splice(0)},replace:function(t){var n=this[Ce];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var s=arguments.length,r=new Array(s>2?s-2:0),o=2;o<s;o++)r[o-2]=arguments[o];var i=this[Ce];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray_(t);case 2:return i.spliceWithArray_(t,n)}return i.spliceWithArray_(t,n,r)},spliceWithArray:function(t,n,s){return this[Ce].spliceWithArray_(t,n,s)},push:function(){for(var t=this[Ce],n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.spliceWithArray_(t.values_.length,0,s),t.values_.length},pop:function(){return this.splice(Math.max(this[Ce].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Ce],n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.spliceWithArray_(0,0,s),t.values_.length},reverse:function(){return ce.trackingDerivation&&me(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){ce.trackingDerivation&&me(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[Ce],s=n.dehanceValues_(n.values_).indexOf(t);return s>-1?(this.splice(s,1),!0):!1}};mt("at",An);mt("concat",An);mt("flat",An);mt("includes",An);mt("indexOf",An);mt("join",An);mt("lastIndexOf",An);mt("slice",An);mt("toString",An);mt("toLocaleString",An);mt("toSorted",An);mt("toSpliced",An);mt("with",An);mt("every",ds);mt("filter",ds);mt("find",ds);mt("findIndex",ds);mt("findLast",ds);mt("findLastIndex",ds);mt("flatMap",ds);mt("forEach",ds);mt("map",ds);mt("some",ds);mt("toReversed",ds);mt("reduce",sv);mt("reduceRight",sv);function mt(e,t){typeof Array.prototype[e]=="function"&&(cc[e]=t(e))}function An(e){return function(){var t=this[Ce];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function ds(e){return function(t,n){var s=this,r=this[Ce];r.atom_.reportObserved();var o=r.dehanceValues_(r.values_);return o[e](function(i,a){return t.call(n,i,a,s)})}}function sv(e){return function(){var t=this,n=this[Ce];n.atom_.reportObserved();var s=n.dehanceValues_(n.values_),r=arguments[0];return arguments[0]=function(o,i,a){return r(o,i,a,t)},s[e].apply(s,arguments)}}var Zj=Fr("ObservableArrayAdministration",Xf);function Va(e){return Mc(e)&&Zj(e[Ce])}var Xj={},Pr="add",uc="delete",rv=function(){function e(n,s,r){var o=this;s===void 0&&(s=yo),r===void 0&&(r=te.NODE_ENV!=="production"?"ObservableMap@"+us():"ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Ce]=Xj,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=s,this.name_=r,Rt(Map)||me(18),zr(function(){o.keysAtom_=Ob(te.NODE_ENV!=="production"?o.name_+".keys()":"ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,n&&o.merge(n)})}var t=e.prototype;return t.has_=function(s){return this.data_.has(s)},t.has=function(s){var r=this;if(!ce.trackingDerivation)return this.has_(s);var o=this.hasMap_.get(s);if(!o){var i=o=new Mr(this.has_(s),Rc,te.NODE_ENV!=="production"?this.name_+"."+Dd(s)+"?":"ObservableMap.key?",!1);this.hasMap_.set(s,i),Xb(i,function(){return r.hasMap_.delete(s)})}return o.get()},t.set=function(s,r){var o=this.has_(s);if(Vn(this)){var i=In(this,{type:o?ss:Pr,object:this,newValue:r,name:s});if(!i)return this;r=i.newValue}return o?this.updateValue_(s,r):this.addValue_(s,r),this},t.delete=function(s){var r=this;if(Os(this.keysAtom_),Vn(this)){var o=In(this,{type:uc,object:this,name:s});if(!o)return!1}if(this.has_(s)){var i=Ut(),a=rs(this),l=a||i?{observableKind:"map",debugObjectName:this.name_,type:uc,object:this,oldValue:this.data_.get(s).value_,name:s}:null;return te.NODE_ENV!=="production"&&i&&En(l),Zs(function(){var u;r.keysAtom_.reportChanged(),(u=r.hasMap_.get(s))==null||u.setNewValue_(!1);var d=r.data_.get(s);d.setNewValue_(void 0),r.data_.delete(s)}),a&&os(this,l),te.NODE_ENV!=="production"&&i&&Pn(),!0}return!1},t.updateValue_=function(s,r){var o=this.data_.get(s);if(r=o.prepareNewValue_(r),r!==ce.UNCHANGED){var i=Ut(),a=rs(this),l=a||i?{observableKind:"map",debugObjectName:this.name_,type:ss,object:this,oldValue:o.value_,name:s,newValue:r}:null;te.NODE_ENV!=="production"&&i&&En(l),o.setNewValue_(r),a&&os(this,l),te.NODE_ENV!=="production"&&i&&Pn()}},t.addValue_=function(s,r){var o=this;Os(this.keysAtom_),Zs(function(){var u,d=new Mr(r,o.enhancer_,te.NODE_ENV!=="production"?o.name_+"."+Dd(s):"ObservableMap.key",!1);o.data_.set(s,d),r=d.value_,(u=o.hasMap_.get(s))==null||u.setNewValue_(!0),o.keysAtom_.reportChanged()});var i=Ut(),a=rs(this),l=a||i?{observableKind:"map",debugObjectName:this.name_,type:Pr,object:this,name:s,newValue:r}:null;te.NODE_ENV!=="production"&&i&&En(l),a&&os(this,l),te.NODE_ENV!=="production"&&i&&Pn()},t.get=function(s){return this.has(s)?this.dehanceValue_(this.data_.get(s).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(s){return this.dehancer!==void 0?this.dehancer(s):s},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var s=this,r=this.keys();return Gh({next:function(){var i=r.next(),a=i.done,l=i.value;return{done:a,value:a?void 0:s.get(l)}}})},t.entries=function(){var s=this,r=this.keys();return Gh({next:function(){var i=r.next(),a=i.done,l=i.value;return{done:a,value:a?void 0:[l,s.get(l)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(s,r){for(var o=Xo(this),i;!(i=o()).done;){var a=i.value,l=a[0],u=a[1];s.call(r,u,l,this)}},t.merge=function(s){var r=this;return dr(s)&&(s=new Map(s)),Zs(function(){jn(s)?dC(s).forEach(function(o){return r.set(o,s[o])}):Array.isArray(s)?s.forEach(function(o){var i=o[0],a=o[1];return r.set(i,a)}):wi(s)?(uC(s)||me(19,s),s.forEach(function(o,i){return r.set(i,o)})):s!=null&&me(20,s)}),this},t.clear=function(){var s=this;Zs(function(){Db(function(){for(var r=Xo(s.keys()),o;!(o=r()).done;){var i=o.value;s.delete(i)}})})},t.replace=function(s){var r=this;return Zs(function(){for(var o=Jj(s),i=new Map,a=!1,l=Xo(r.data_.keys()),u;!(u=l()).done;){var d=u.value;if(!o.has(d)){var f=r.delete(d);if(f)a=!0;else{var p=r.data_.get(d);i.set(d,p)}}}for(var g=Xo(o.entries()),m;!(m=g()).done;){var b=m.value,v=b[0],x=b[1],y=r.data_.has(v);if(r.set(v,x),r.data_.has(v)){var w=r.data_.get(v);i.set(v,w),y||(a=!0)}}if(!a)if(r.data_.size!==i.size)r.keysAtom_.reportChanged();else for(var S=r.data_.keys(),C=i.keys(),j=S.next(),E=C.next();!j.done;){if(j.value!==E.value){r.keysAtom_.reportChanged();break}j=S.next(),E=C.next()}r.data_=i}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(s,r){return te.NODE_ENV!=="production"&&r===!0&&me("`observe` doesn't support fireImmediately=true in combination with maps."),ka(this,s)},t.intercept_=function(s){return $a(this,s)},Si(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),dr=Fr("ObservableMap",rv);function Gh(e){return e[Symbol.toStringTag]="MapIterator",ep(e)}function Jj(e){if(wi(e)||dr(e))return e;if(Array.isArray(e))return new Map(e);if(jn(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return me(21,e)}var Qj={},ov=function(){function e(n,s,r){var o=this;s===void 0&&(s=yo),r===void 0&&(r=te.NODE_ENV!=="production"?"ObservableSet@"+us():"ObservableSet"),this.name_=void 0,this[Ce]=Qj,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,Rt(Set)||me(22),this.enhancer_=function(i,a){return s(i,a,r)},zr(function(){o.atom_=Ob(o.name_),n&&o.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(s){return this.dehancer!==void 0?this.dehancer(s):s},t.clear=function(){var s=this;Zs(function(){Db(function(){for(var r=Xo(s.data_.values()),o;!(o=r()).done;){var i=o.value;s.delete(i)}})})},t.forEach=function(s,r){for(var o=Xo(this),i;!(i=o()).done;){var a=i.value;s.call(r,a,a,this)}},t.add=function(s){var r=this;if(Os(this.atom_),Vn(this)){var o=In(this,{type:Pr,object:this,newValue:s});if(!o)return this}if(!this.has(s)){Zs(function(){r.data_.add(r.enhancer_(s,void 0)),r.atom_.reportChanged()});var i=te.NODE_ENV!=="production"&&Ut(),a=rs(this),l=a||i?{observableKind:"set",debugObjectName:this.name_,type:Pr,object:this,newValue:s}:null;i&&te.NODE_ENV!=="production"&&En(l),a&&os(this,l),i&&te.NODE_ENV!=="production"&&Pn()}return this},t.delete=function(s){var r=this;if(Vn(this)){var o=In(this,{type:uc,object:this,oldValue:s});if(!o)return!1}if(this.has(s)){var i=te.NODE_ENV!=="production"&&Ut(),a=rs(this),l=a||i?{observableKind:"set",debugObjectName:this.name_,type:uc,object:this,oldValue:s}:null;return i&&te.NODE_ENV!=="production"&&En(l),Zs(function(){r.atom_.reportChanged(),r.data_.delete(s)}),a&&os(this,l),i&&te.NODE_ENV!=="production"&&Pn(),!0}return!1},t.has=function(s){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(s))},t.entries=function(){var s=0,r=Array.from(this.keys()),o=Array.from(this.values());return qh({next:function(){var a=s;return s+=1,a<o.length?{value:[r[a],o[a]],done:!1}:{value:void 0,done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var s=this,r=0,o=Array.from(this.data_.values());return qh({next:function(){return r<o.length?{value:s.dehanceValue_(o[r++]),done:!1}:{value:void 0,done:!0}}})},t.intersection=function(s){if(Ys(s)&&!ns(s))return s.intersection(this);var r=new Set(this);return r.intersection(s)},t.union=function(s){if(Ys(s)&&!ns(s))return s.union(this);var r=new Set(this);return r.union(s)},t.difference=function(s){return new Set(this).difference(s)},t.symmetricDifference=function(s){if(Ys(s)&&!ns(s))return s.symmetricDifference(this);var r=new Set(this);return r.symmetricDifference(s)},t.isSubsetOf=function(s){return new Set(this).isSubsetOf(s)},t.isSupersetOf=function(s){return new Set(this).isSupersetOf(s)},t.isDisjointFrom=function(s){if(Ys(s)&&!ns(s))return s.isDisjointFrom(this);var r=new Set(this);return r.isDisjointFrom(s)},t.replace=function(s){var r=this;return ns(s)&&(s=new Set(s)),Zs(function(){Array.isArray(s)?(r.clear(),s.forEach(function(o){return r.add(o)})):Ys(s)?(r.clear(),s.forEach(function(o){return r.add(o)})):s!=null&&me("Cannot initialize set from "+s)}),this},t.observe_=function(s,r){return te.NODE_ENV!=="production"&&r===!0&&me("`observe` doesn't support fireImmediately=true in combination with sets."),ka(this,s)},t.intercept_=function(s){return $a(this,s)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Si(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),ns=Fr("ObservableSet",ov);function qh(e){return e[Symbol.toStringTag]="SetIterator",ep(e)}var Kh=Object.create(null),Yh="remove",Kd=function(){function e(n,s,r,o){s===void 0&&(s=new Map),o===void 0&&(o=zC),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=s,this.name_=r,this.defaultAnnotation_=o,this.keysAtom_=new Br(te.NODE_ENV!=="production"?this.name_+".keys":"ObservableObject.keys"),this.isPlainObject_=jn(this.target_),te.NODE_ENV!=="production"&&!uv(this.defaultAnnotation_)&&me("defaultAnnotation must be valid annotation"),te.NODE_ENV!=="production"&&(this.appliedAnnotations_={})}var t=e.prototype;return t.getObservablePropValue_=function(s){return this.values_.get(s).get()},t.setObservablePropValue_=function(s,r){var o=this.values_.get(s);if(o instanceof Kn)return o.set(r),!0;if(Vn(this)){var i=In(this,{type:ss,object:this.proxy_||this.target_,name:s,newValue:r});if(!i)return null;r=i.newValue}if(r=o.prepareNewValue_(r),r!==ce.UNCHANGED){var a=rs(this),l=te.NODE_ENV!=="production"&&Ut(),u=a||l?{type:ss,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:s,newValue:r}:null;te.NODE_ENV!=="production"&&l&&En(u),o.setNewValue_(r),a&&os(this,u),te.NODE_ENV!=="production"&&l&&Pn()}return!0},t.get_=function(s){return ce.trackingDerivation&&!Wn(this.target_,s)&&this.has_(s),this.target_[s]},t.set_=function(s,r,o){return o===void 0&&(o=!1),Wn(this.target_,s)?this.values_.has(s)?this.setObservablePropValue_(s,r):o?Reflect.set(this.target_,s,r):(this.target_[s]=r,!0):this.extend_(s,{value:r,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},t.has_=function(s){if(!ce.trackingDerivation)return s in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var r=this.pendingKeys_.get(s);return r||(r=new Mr(s in this.target_,Rc,te.NODE_ENV!=="production"?this.name_+"."+Dd(s)+"?":"ObservableObject.key?",!1),this.pendingKeys_.set(s,r)),r.get()},t.make_=function(s,r){if(r===!0&&(r=this.defaultAnnotation_),r!==!1){if(Jh(this,r,s),!(s in this.target_)){var o;if((o=this.target_[un])!=null&&o[s])return;me(1,r.annotationType_,this.name_+"."+s.toString())}for(var i=this.target_;i&&i!==Oa;){var a=nc(i,s);if(a){var l=r.make_(this,s,a,i);if(l===0)return;if(l===1)break}i=Object.getPrototypeOf(i)}Xh(this,r,s)}},t.extend_=function(s,r,o,i){if(i===void 0&&(i=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(s,r,i);Jh(this,o,s);var a=o.extend_(this,s,r,i);return a&&Xh(this,o,s),a},t.defineProperty_=function(s,r,o){o===void 0&&(o=!1),Os(this.keysAtom_);try{Hn();var i=this.delete_(s);if(!i)return i;if(Vn(this)){var a=In(this,{object:this.proxy_||this.target_,name:s,type:Pr,newValue:r.value});if(!a)return null;var l=a.newValue;r.value!==l&&(r=sr({},r,{value:l}))}if(o){if(!Reflect.defineProperty(this.target_,s,r))return!1}else Ms(this.target_,s,r);this.notifyPropertyAddition_(s,r.value)}finally{Fn()}return!0},t.defineObservableProperty_=function(s,r,o,i){i===void 0&&(i=!1),Os(this.keysAtom_);try{Hn();var a=this.delete_(s);if(!a)return a;if(Vn(this)){var l=In(this,{object:this.proxy_||this.target_,name:s,type:Pr,newValue:r});if(!l)return null;r=l.newValue}var u=Zh(s),d={configurable:ce.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(i){if(!Reflect.defineProperty(this.target_,s,d))return!1}else Ms(this.target_,s,d);var f=new Mr(r,o,te.NODE_ENV!=="production"?this.name_+"."+s.toString():"ObservableObject.key",!1);this.values_.set(s,f),this.notifyPropertyAddition_(s,f.value_)}finally{Fn()}return!0},t.defineComputedProperty_=function(s,r,o){o===void 0&&(o=!1),Os(this.keysAtom_);try{Hn();var i=this.delete_(s);if(!i)return i;if(Vn(this)){var a=In(this,{object:this.proxy_||this.target_,name:s,type:Pr,newValue:void 0});if(!a)return null}r.name||(r.name=te.NODE_ENV!=="production"?this.name_+"."+s.toString():"ObservableObject.key"),r.context=this.proxy_||this.target_;var l=Zh(s),u={configurable:ce.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(o){if(!Reflect.defineProperty(this.target_,s,u))return!1}else Ms(this.target_,s,u);this.values_.set(s,new Kn(r)),this.notifyPropertyAddition_(s,void 0)}finally{Fn()}return!0},t.delete_=function(s,r){if(r===void 0&&(r=!1),Os(this.keysAtom_),!Wn(this.target_,s))return!0;if(Vn(this)){var o=In(this,{object:this.proxy_||this.target_,name:s,type:Yh});if(!o)return null}try{var i;Hn();var a=rs(this),l=te.NODE_ENV!=="production"&&Ut(),u=this.values_.get(s),d=void 0;if(!u&&(a||l)){var f;d=(f=nc(this.target_,s))==null?void 0:f.value}if(r){if(!Reflect.deleteProperty(this.target_,s))return!1}else delete this.target_[s];if(te.NODE_ENV!=="production"&&delete this.appliedAnnotations_[s],u&&(this.values_.delete(s),u instanceof Mr&&(d=u.value_),Wb(u)),this.keysAtom_.reportChanged(),(i=this.pendingKeys_)==null||(i=i.get(s))==null||i.set(s in this.target_),a||l){var p={type:Yh,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:s};te.NODE_ENV!=="production"&&l&&En(p),a&&os(this,p),te.NODE_ENV!=="production"&&l&&Pn()}}finally{Fn()}return!0},t.observe_=function(s,r){return te.NODE_ENV!=="production"&&r===!0&&me("`observe` doesn't support the fire immediately property for observable objects."),ka(this,s)},t.intercept_=function(s){return $a(this,s)},t.notifyPropertyAddition_=function(s,r){var o,i=rs(this),a=te.NODE_ENV!=="production"&&Ut();if(i||a){var l=i||a?{type:Pr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:s,newValue:r}:null;te.NODE_ENV!=="production"&&a&&En(l),i&&os(this,l),te.NODE_ENV!=="production"&&a&&Pn()}(o=this.pendingKeys_)==null||(o=o.get(s))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),ai(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function Ao(e,t){var n;if(te.NODE_ENV!=="production"&&t&&No(e)&&me("Options can't be provided for already observable objects."),Wn(e,Ce))return te.NODE_ENV!=="production"&&!(cv(e)instanceof Kd)&&me("Cannot convert '"+dc(e)+`' into observable object:
63
- The target is already observable of different type.
64
- Extending builtins is not supported.`),e;te.NODE_ENV!=="production"&&!Object.isExtensible(e)&&me("Cannot make the designated object observable; it is not extensible");var s=(n=t==null?void 0:t.name)!=null?n:te.NODE_ENV!=="production"?(jn(e)?"ObservableObject":e.constructor.name)+"@"+us():"ObservableObject",r=new Kd(e,new Map,String(s),ej(t));return Aa(e,Ce,r),e}var eE=Fr("ObservableObjectAdministration",Kd);function Zh(e){return Kh[e]||(Kh[e]={get:function(){return this[Ce].getObservablePropValue_(e)},set:function(n){return this[Ce].setObservablePropValue_(e,n)}})}function No(e){return Mc(e)?eE(e[Ce]):!1}function Xh(e,t,n){var s;te.NODE_ENV!=="production"&&(e.appliedAnnotations_[n]=t),(s=e.target_[un])==null||delete s[n]}function Jh(e,t,n){if(te.NODE_ENV!=="production"&&!uv(t)&&me("Cannot annotate '"+e.name_+"."+n.toString()+"': Invalid annotation."),te.NODE_ENV!=="production"&&!oc(t)&&Wn(e.appliedAnnotations_,n)){var s=e.name_+"."+n.toString(),r=e.appliedAnnotations_[n].annotationType_,o=t.annotationType_;me("Cannot apply '"+o+"' to '"+s+"':"+(`
65
- The field is already annotated with '`+r+"'.")+`
66
- Re-annotating fields is not allowed.
67
- Use 'override' annotation for methods overridden by subclass.`)}}var tE=av(0),nE=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),Ru=0,iv=function(){};function sE(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}sE(iv,Array.prototype);var Jf=function(e){function t(s,r,o,i){var a;return o===void 0&&(o=te.NODE_ENV!=="production"?"ObservableArray@"+us():"ObservableArray"),i===void 0&&(i=!1),a=e.call(this)||this,zr(function(){var l=new Xf(o,r,i,!0);l.proxy_=a,Eb(a,Ce,l),s&&s.length&&a.spliceWithArray(0,0,s),nE&&Object.defineProperty(a,"0",tE)}),a}Tb(t,e);var n=t.prototype;return n.concat=function(){this[Ce].atom_.reportObserved();for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return Array.prototype.concat.apply(this.slice(),o.map(function(a){return Va(a)?a.slice():a}))},n[Symbol.iterator]=function(){var s=this,r=0;return ep({next:function(){return r<s.length?{value:s[r++],done:!1}:{done:!0,value:void 0}}})},Si(t,[{key:"length",get:function(){return this[Ce].getArrayLength_()},set:function(r){this[Ce].setArrayLength_(r)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(iv);Object.entries(cc).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&Aa(Jf.prototype,t,n)});function av(e){return{enumerable:!1,configurable:!0,get:function(){return this[Ce].get_(e)},set:function(n){this[Ce].set_(e,n)}}}function rE(e){Ms(Jf.prototype,""+e,av(e))}function lv(e){if(e>Ru){for(var t=Ru;t<e+100;t++)rE(t);Ru=e}}lv(1e3);function oE(e,t,n){return new Jf(e,t,n)}function ui(e,t){if(typeof e=="object"&&e!==null){if(Va(e))return t!==void 0&&me(23),e[Ce].atom_;if(ns(e))return e.atom_;if(dr(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||me(25,t,dc(e)),n}if(No(e)){if(!t)return me(26);var s=e[Ce].values_.get(t);return s||me(27,t,dc(e)),s}if(Wf(e)||Ra(e)||lc(e))return e}else if(Rt(e)&&lc(e[Ce]))return e[Ce];me(28)}function cv(e,t){if(e||me(29),Wf(e)||Ra(e)||lc(e)||dr(e)||ns(e))return e;if(e[Ce])return e[Ce];me(24,e)}function dc(e,t){var n;if(t!==void 0)n=ui(e,t);else{if(li(e))return e.name;No(e)||dr(e)||ns(e)?n=cv(e):n=ui(e)}return n.name_}function zr(e){var t=Oo(),n=qf(!0);Hn();try{return e()}finally{Fn(),Kf(n),tr(t)}}var Qh=Oa.toString;function Qf(e,t,n){return n===void 0&&(n=-1),Yd(e,t,n)}function Yd(e,t,n,s,r){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof t!="object")return!1;var i=Qh.call(e);if(i!==Qh.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=eg(e),t=eg(t);var a=i==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,u=t.constructor;if(l!==u&&!(Rt(l)&&l instanceof l&&Rt(u)&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),s=s||[],r=r||[];for(var d=s.length;d--;)if(s[d]===e)return r[d]===t;if(s.push(e),r.push(t),a){if(d=e.length,d!==t.length)return!1;for(;d--;)if(!Yd(e[d],t[d],n-1,s,r))return!1}else{var f=Object.keys(e),p;if(d=f.length,Object.keys(t).length!==d)return!1;for(;d--;)if(p=f[d],!(Wn(t,p)&&Yd(e[p],t[p],n-1,s,r)))return!1}return s.pop(),r.pop(),!0}function eg(e){return Va(e)?e.slice():wi(e)||dr(e)||Ys(e)||ns(e)?Array.from(e.entries()):e}var tg,iE=((tg=Nc().Iterator)==null?void 0:tg.prototype)||{};function ep(e){return e[Symbol.iterator]=aE,Object.assign(Object.create(iE),e)}function aE(){return this}function uv(e){return e instanceof Object&&typeof e.annotationType_=="string"&&Rt(e.make_)&&Rt(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=Nc();typeof t[e]>"u"&&me("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:Sj,extras:{getDebugName:dc},$mobx:Ce});if(!h.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!Gj)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");var lE={};function cE(e){e()}function uE(e){e||(e=cE,lE.NODE_ENV!=="production"&&console.warn("[MobX] Failed to get unstable_batched updates from react-dom / react-native")),kj({reactionScheduler:e})}function dE(e){return ev(e)}var fE=1e4,pE=1e4,hE=function(){function e(t){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(s){s===void 0&&(s=fE),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var r=Date.now();n.registrations.forEach(function(o,i){r-o.registeredAt>=s&&(n.finalize(o.value),n.registrations.delete(i))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,s){this.registrations.set(s,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,pE))}}),e}(),gE=typeof FinalizationRegistry<"u"?FinalizationRegistry:hE,Zd=new gE(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),Xd={exports:{}},$u={};/**
19
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=r(o,s(a)))}return o}function s(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)t.call(o,a)&&o[a]&&(i=r(i,a));return i}function r(o,i){return i?o?o+" "+i:o+i:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(H1);var b2=H1.exports;const A=wp(b2);var zt={NODE_ENV:"production"};function He(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var v2={};function bc(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:v2}var D1=Object.assign,zl=Object.getOwnPropertyDescriptor,ws=Object.defineProperty,ba=Object.prototype,xd=[];Object.freeze(xd);var F1={};Object.freeze(F1);var y2=typeof Proxy<"u",x2=Object.toString();function B1(){y2||He("Proxy not available")}function z1(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Do=function(){};function Yn(e){return typeof e=="function"}function lo(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function vc(e){return e!==null&&typeof e=="object"}function Ks(e){if(!vc(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===x2}function U1(e){var t=e==null?void 0:e.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function va(e,t,n){ws(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function W1(e,t,n){ws(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Mr(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(s){return vc(s)&&s[n]===!0}}function li(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function w2(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),s=Object.getPrototypeOf(n);return s===null}function Hs(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var G1=typeof Object.getOwnPropertySymbols<"u";function S2(e){var t=Object.keys(e);if(!G1)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(s){return ba.propertyIsEnumerable.call(e,s)})):t}var Xo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:G1?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function q1(e){return e===null?null:typeof e=="object"?""+e:e}function Ws(e,t){return ba.hasOwnProperty.call(e,t)}var C2=Object.getOwnPropertyDescriptors||function(t){var n={};return Xo(t).forEach(function(s){n[s]=zl(t,s)}),n};function mn(e,t){return!!(e&t)}function bn(e,t,n){return n?e|=t:e&=~t,e}function dh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function j2(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,P2(s.key),s)}}function ci(e,t,n){return t&&j2(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fo(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=T2(e))||t){n&&(e=n);var s=0;return function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
20
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function co(){return co=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},co.apply(null,arguments)}function K1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wd(e,t)}function wd(e,t){return wd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},wd(e,t)}function E2(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function P2(e){var t=E2(e,"string");return typeof t=="symbol"?t:t+""}function T2(e,t){if(e){if(typeof e=="string")return dh(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dh(e,t):void 0}}var Gn=Symbol("mobx-stored-annotations");function Ss(e){function t(n,s){if(xa(s))return e.decorate_20223_(n,s);ya(n,s,e)}return Object.assign(t,e)}function ya(e,t,n){Ws(e,Gn)||va(e,Gn,co({},e[Gn])),R2(n)||(e[Gn][t]=n)}function O2(e){return Ws(e,Gn)||va(e,Gn,co({},e[Gn])),e[Gn]}function xa(e){return typeof e=="object"&&typeof e.kind=="string"}var xe=Symbol("mobx administration"),Lr=function(){function e(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=We.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(s){return s()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(s){return s()})},t.reportObserved=function(){return ub(this)},t.reportChanged=function(){Ln(),db(this),Nn()},t.toString=function(){return this.name_},ci(e,[{key:"isBeingObserved",get:function(){return mn(this.flags_,e.isBeingObservedMask_)},set:function(s){this.flags_=bn(this.flags_,e.isBeingObservedMask_,s)}},{key:"isPendingUnobservation",get:function(){return mn(this.flags_,e.isPendingUnobservationMask_)},set:function(s){this.flags_=bn(this.flags_,e.isPendingUnobservationMask_,s)}},{key:"diffValue",get:function(){return mn(this.flags_,e.diffValueMask_)?1:0},set:function(s){this.flags_=bn(this.flags_,e.diffValueMask_,s===1)}}])}();Lr.isBeingObservedMask_=1;Lr.isPendingUnobservationMask_=2;Lr.diffValueMask_=4;var Sp=Mr("Atom",Lr);function Z1(e,t,n){t===void 0&&(t=Do),n===void 0&&(n=Do);var s=new Lr(e);return t!==Do&&FC(s,t),n!==Do&&mb(s,n),s}function _2(e,t){return e===t}function A2(e,t){return Ap(e,t)}function M2(e,t){return Ap(e,t,1)}function L2(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ul={identity:_2,structural:A2,default:L2,shallow:M2};function uo(e,t,n){return Tp(e)?e:Array.isArray(e)?Ht.array(e,{name:n}):Ks(e)?Ht.object(e,void 0,{name:n}):li(e)?Ht.map(e,{name:n}):Hs(e)?Ht.set(e,{name:n}):typeof e=="function"&&!Qi(e)&&!ea(e)?U1(e)?fo(e):Ji(n,e):e}function N2(e,t,n){if(e==null||Pa(e)||Ea(e)||Nr(e)||Wn(e))return e;if(Array.isArray(e))return Ht.array(e,{name:n,deep:!1});if(Ks(e))return Ht.object(e,void 0,{name:n,deep:!1});if(li(e))return Ht.map(e,{name:n,deep:!1});if(Hs(e))return Ht.set(e,{name:n,deep:!1})}function yc(e){return e}function $2(e,t){return Ap(e,t)?t:e}var k2="override";function R2(e){return e.annotationType_===k2}function wa(e,t){return{annotationType_:e,options_:t,make_:I2,extend_:V2,decorate_20223_:H2}}function I2(e,t,n,s){var r;if((r=this.options_)!=null&&r.bound)return this.extend_(e,t,n,!1)===null?0:1;if(s===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(Qi(n.value))return 1;var o=Y1(e,this,t,n,!1);return ws(s,t,o),2}function V2(e,t,n,s){var r=Y1(e,this,t,n);return e.defineProperty_(t,r,s)}function H2(e,t){var n=t.kind,s=t.name,r=t.addInitializer,o=this,i=function(u){var d,p,h,g;return po((d=(p=o.options_)==null?void 0:p.name)!=null?d:s.toString(),u,(h=(g=o.options_)==null?void 0:g.autoAction)!=null?h:!1)};if(n=="field")return function(c){var u,d=c;return Qi(d)||(d=i(d)),(u=o.options_)!=null&&u.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(n=="method"){var a;return Qi(e)||(e=i(e)),(a=this.options_)!=null&&a.bound&&r(function(){var c=this,u=c[s].bind(c);u.isMobxAction=!0,c[s]=u}),e}He("Cannot apply '"+o.annotationType_+"' to '"+String(s)+"' (kind: "+n+"):"+(`
21
+ '`+o.annotationType_+"' can only be used on properties with a function value."))}function D2(e,t,n,s){t.annotationType_,s.value}function Y1(e,t,n,s,r){var o,i,a,c,u,d,p;r===void 0&&(r=de.safeDescriptors),D2(e,t,n,s);var h=s.value;if((o=t.options_)!=null&&o.bound){var g;h=h.bind((g=e.proxy_)!=null?g:e.target_)}return{value:po((i=(a=t.options_)==null?void 0:a.name)!=null?i:n.toString(),h,(c=(u=t.options_)==null?void 0:u.autoAction)!=null?c:!1,(d=t.options_)!=null&&d.bound?(p=e.proxy_)!=null?p:e.target_:void 0),configurable:r?e.isPlainObject_:!0,enumerable:!1,writable:!r}}function X1(e,t){return{annotationType_:e,options_:t,make_:F2,extend_:B2,decorate_20223_:z2}}function F2(e,t,n,s){var r;if(s===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((r=this.options_)!=null&&r.bound&&(!Ws(e.target_,t)||!ea(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(ea(n.value))return 1;var o=J1(e,this,t,n,!1,!1);return ws(s,t,o),2}function B2(e,t,n,s){var r,o=J1(e,this,t,n,(r=this.options_)==null?void 0:r.bound);return e.defineProperty_(t,o,s)}function z2(e,t){var n,s=t.name,r=t.addInitializer;return ea(e)||(e=fo(e)),(n=this.options_)!=null&&n.bound&&r(function(){var o=this,i=o[s].bind(o);i.isMobXFlow=!0,o[s]=i}),e}function U2(e,t,n,s){t.annotationType_,s.value}function J1(e,t,n,s,r,o){o===void 0&&(o=de.safeDescriptors),U2(e,t,n,s);var i=s.value;if(ea(i)||(i=fo(i)),r){var a;i=i.bind((a=e.proxy_)!=null?a:e.target_),i.isMobXFlow=!0}return{value:i,configurable:o?e.isPlainObject_:!0,enumerable:!1,writable:!o}}function Cp(e,t){return{annotationType_:e,options_:t,make_:W2,extend_:G2,decorate_20223_:q2}}function W2(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function G2(e,t,n,s){return K2(e,this,t,n),e.defineComputedProperty_(t,co({},this.options_,{get:n.get,set:n.set}),s)}function q2(e,t){var n=this,s=t.name,r=t.addInitializer;return r(function(){var o=wo(this)[xe],i=co({},n.options_,{get:e,context:this});i.name||(i.name="ObservableObject."+s.toString()),o.values_.set(s,new Xn(i))}),function(){return this[xe].getObservablePropValue_(s)}}function K2(e,t,n,s){t.annotationType_,s.get}function xc(e,t){return{annotationType_:e,options_:t,make_:Z2,extend_:Y2,decorate_20223_:X2}}function Z2(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function Y2(e,t,n,s){var r,o;return J2(e,this),e.defineObservableProperty_(t,n.value,(r=(o=this.options_)==null?void 0:o.enhancer)!=null?r:uo,s)}function X2(e,t){var n=this,s=t.kind,r=t.name,o=new WeakSet;function i(a,c){var u,d,p=wo(a)[xe],h=new Sr(c,(u=(d=n.options_)==null?void 0:d.enhancer)!=null?u:uo,"ObservableObject."+r.toString(),!1);p.values_.set(r,h),o.add(a)}if(s=="accessor")return{get:function(){return o.has(this)||i(this,e.get.call(this)),this[xe].getObservablePropValue_(r)},set:function(c){return o.has(this)||i(this,c),this[xe].setObservablePropValue_(r,c)},init:function(c){return o.has(this)||i(this,c),c}}}function J2(e,t,n,s){t.annotationType_}var Q2="true",eC=Q1();function Q1(e){return{annotationType_:Q2,options_:e,make_:tC,extend_:nC,decorate_20223_:sC}}function tC(e,t,n,s){var r,o;if(n.get)return wc.make_(e,t,n,s);if(n.set){var i=po(t.toString(),n.set);return s===e.target_?e.defineProperty_(t,{configurable:de.safeDescriptors?e.isPlainObject_:!0,set:i})===null?0:2:(ws(s,t,{configurable:!0,set:i}),2)}if(s!==e.target_&&typeof n.value=="function"){var a;if(U1(n.value)){var c,u=(c=this.options_)!=null&&c.autoBind?fo.bound:fo;return u.make_(e,t,n,s)}var d=(a=this.options_)!=null&&a.autoBind?Ji.bound:Ji;return d.make_(e,t,n,s)}var p=((r=this.options_)==null?void 0:r.deep)===!1?Ht.ref:Ht;if(typeof n.value=="function"&&(o=this.options_)!=null&&o.autoBind){var h;n.value=n.value.bind((h=e.proxy_)!=null?h:e.target_)}return p.make_(e,t,n,s)}function nC(e,t,n,s){var r,o;if(n.get)return wc.extend_(e,t,n,s);if(n.set)return e.defineProperty_(t,{configurable:de.safeDescriptors?e.isPlainObject_:!0,set:po(t.toString(),n.set)},s);if(typeof n.value=="function"&&(r=this.options_)!=null&&r.autoBind){var i;n.value=n.value.bind((i=e.proxy_)!=null?i:e.target_)}var a=((o=this.options_)==null?void 0:o.deep)===!1?Ht.ref:Ht;return a.extend_(e,t,n,s)}function sC(e,t){He("'"+this.annotationType_+"' cannot be used as a decorator")}var rC="observable",oC="observable.ref",iC="observable.shallow",aC="observable.struct",eb={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(eb);function Xa(e){return e||eb}var Sd=xc(rC),lC=xc(oC,{enhancer:yc}),cC=xc(iC,{enhancer:N2}),uC=xc(aC,{enhancer:$2}),tb=Ss(Sd);function Ja(e){return e.deep===!0?uo:e.deep===!1?yc:pC(e.defaultDecorator)}function dC(e){var t;return e?(t=e.defaultDecorator)!=null?t:Q1(e):void 0}function pC(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:uo}function nb(e,t,n){if(xa(t))return Sd.decorate_20223_(e,t);if(lo(t)){ya(e,t,Sd);return}return Tp(e)?e:Ks(e)?Ht.object(e,t,n):Array.isArray(e)?Ht.array(e,t):li(e)?Ht.map(e,t):Hs(e)?Ht.set(e,t):typeof e=="object"&&e!==null?e:Ht.box(e,t)}D1(nb,tb);var fC={box:function(t,n){var s=Xa(n);return new Sr(t,Ja(s),s.name,!0,s.equals)},array:function(t,n){var s=Xa(n);return(de.useProxies===!1||s.proxy===!1?pj:nj)(t,Ja(s),s.name)},map:function(t,n){var s=Xa(n);return new Sb(t,Ja(s),s.name)},set:function(t,n){var s=Xa(n);return new Cb(t,Ja(s),s.name)},object:function(t,n,s){return $r(function(){return vb(de.useProxies===!1||(s==null?void 0:s.proxy)===!1?wo({},s):JC({},s),t,n)})},ref:Ss(lC),shallow:Ss(cC),deep:tb,struct:Ss(uC)},Ht=D1(nb,fC),sb="computed",hC="computed.struct",Cd=Cp(sb),gC=Cp(hC,{equals:Ul.structural}),wc=function(t,n){if(xa(n))return Cd.decorate_20223_(t,n);if(lo(n))return ya(t,n,Cd);if(Ks(t))return Ss(Cp(sb,t));var s=Ks(n)?n:{};return s.get=t,s.name||(s.name=t.name||""),new Xn(s)};Object.assign(wc,Cd);wc.struct=Ss(gC);var ph,fh,Wl=0,mC=1,bC=(ph=(fh=zl(function(){},"name"))==null?void 0:fh.configurable)!=null?ph:!1,hh={value:"action",configurable:!0,writable:!1,enumerable:!1};function po(e,t,n,s){n===void 0&&(n=!1);function r(){return vC(e,n,t,s||this,arguments)}return r.isMobxAction=!0,r.toString=function(){return t.toString()},bC&&(hh.value=e,ws(r,"name",hh)),r}function vC(e,t,n,s,r){var o=yC(e,t);try{return n.apply(s,r)}catch(i){throw o.error_=i,i}finally{xC(o)}}function yC(e,t,n,s){var r=zt.NODE_ENV!=="production",o=0,i=de.trackingDerivation,a=!t||!i;Ln();var c=de.allowStateChanges;a&&(xo(),c=jp(!0));var u=Pp(!0),d={runAsAction_:a,prevDerivation_:i,prevAllowStateChanges_:c,prevAllowStateReads_:u,notifySpy_:r,startTime_:o,actionId_:mC++,parentActionId_:Wl};return Wl=d.actionId_,d}function xC(e){Wl!==e.actionId_&&He(30),Wl=e.parentActionId_,e.error_!==void 0&&(de.suppressReactionErrors=!0),Ep(e.prevAllowStateChanges_),Ii(e.prevAllowStateReads_),Nn(),e.runAsAction_&&Gs(e.prevDerivation_),de.suppressReactionErrors=!1}function jp(e){var t=de.allowStateChanges;return de.allowStateChanges=e,t}function Ep(e){de.allowStateChanges=e}var Sr=function(e){function t(s,r,o,i,a){var c;return o===void 0&&(o="ObservableValue"),a===void 0&&(a=Ul.default),c=e.call(this,o)||this,c.enhancer=void 0,c.name_=void 0,c.equals=void 0,c.hasUnreportedChange_=!1,c.interceptors_=void 0,c.changeListeners_=void 0,c.value_=void 0,c.dehancer=void 0,c.enhancer=r,c.name_=o,c.equals=a,c.value_=r(s,void 0,o),c}K1(t,e);var n=t.prototype;return n.dehanceValue=function(r){return this.dehancer!==void 0?this.dehancer(r):r},n.set=function(r){this.value_,r=this.prepareNewValue_(r),r!==de.UNCHANGED&&this.setNewValue_(r)},n.prepareNewValue_=function(r){if(_n(this)){var o=An(this,{object:this,type:Cs,newValue:r});if(!o)return de.UNCHANGED;r=o.newValue}return r=this.enhancer(r,this.value_,this.name_),this.equals(this.value_,r)?de.UNCHANGED:r},n.setNewValue_=function(r){var o=this.value_;this.value_=r,this.reportChanged(),qn(this)&&Kn(this,{type:Cs,object:this,newValue:r,oldValue:o})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(r){return Ca(this,r)},n.observe_=function(r,o){return o&&r({observableKind:"value",debugObjectName:this.name_,object:this,type:Cs,newValue:this.value_,oldValue:void 0}),ja(this,r)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return q1(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t}(Lr),wC=Mr("ObservableValue",Sr),Xn=function(){function e(n){this.dependenciesState_=We.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=We.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new ql(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=Gl.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||He(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=po("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?Ul.structural:Ul.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){PC(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(s){return s()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(s){return s()})},t.get=function(){if(this.isComputing&&He(32,this.name_,this.derivation),de.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)jd(this)&&(this.warnAboutUntrackedRead_(),Ln(),this.value_=this.computeValue_(!1),Nn());else if(ub(this),jd(this)){var s=de.trackingContext;this.keepAlive_&&!s&&(de.trackingContext=this),this.trackAndCompute()&&EC(this),de.trackingContext=s}var r=this.value_;if($l(r))throw r.cause;return r},t.set=function(s){if(this.setter_){this.isRunningSetter&&He(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,s)}finally{this.isRunningSetter=!1}}else He(34,this.name_)},t.trackAndCompute=function(){var s=this.value_,r=this.dependenciesState_===We.NOT_TRACKING_,o=this.computeValue_(!0),i=r||$l(s)||$l(o)||!this.equals_(s,o);return i&&(this.value_=o),i},t.computeValue_=function(s){this.isComputing=!0;var r=jp(!1),o;if(s)o=rb(this,this.derivation,this.scope_);else if(de.disableErrorBoundaries===!0)o=this.derivation.call(this.scope_);else try{o=this.derivation.call(this.scope_)}catch(i){o=new ql(i)}return Ep(r),this.isComputing=!1,o},t.suspend_=function(){this.keepAlive_||(Ed(this),this.value_=void 0)},t.observe_=function(s,r){var o=this,i=!0,a=void 0;return RC(function(){var c=o.get();if(!i||r){var u=xo();s({observableKind:"computed",debugObjectName:o.name_,type:Cs,object:o,newValue:c,oldValue:a}),Gs(u)}i=!1,a=c})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return q1(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},ci(e,[{key:"isComputing",get:function(){return mn(this.flags_,e.isComputingMask_)},set:function(s){this.flags_=bn(this.flags_,e.isComputingMask_,s)}},{key:"isRunningSetter",get:function(){return mn(this.flags_,e.isRunningSetterMask_)},set:function(s){this.flags_=bn(this.flags_,e.isRunningSetterMask_,s)}},{key:"isBeingObserved",get:function(){return mn(this.flags_,e.isBeingObservedMask_)},set:function(s){this.flags_=bn(this.flags_,e.isBeingObservedMask_,s)}},{key:"isPendingUnobservation",get:function(){return mn(this.flags_,e.isPendingUnobservationMask_)},set:function(s){this.flags_=bn(this.flags_,e.isPendingUnobservationMask_,s)}},{key:"diffValue",get:function(){return mn(this.flags_,e.diffValueMask_)?1:0},set:function(s){this.flags_=bn(this.flags_,e.diffValueMask_,s===1)}}])}();Xn.isComputingMask_=1;Xn.isRunningSetterMask_=2;Xn.isBeingObservedMask_=4;Xn.isPendingUnobservationMask_=8;Xn.diffValueMask_=16;var Sa=Mr("ComputedValue",Xn),We;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(We||(We={}));var Gl;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(Gl||(Gl={}));var ql=function(t){this.cause=void 0,this.cause=t};function $l(e){return e instanceof ql}function jd(e){switch(e.dependenciesState_){case We.UP_TO_DATE_:return!1;case We.NOT_TRACKING_:case We.STALE_:return!0;case We.POSSIBLY_STALE_:{for(var t=Pp(!0),n=xo(),s=e.observing_,r=s.length,o=0;o<r;o++){var i=s[o];if(Sa(i)){if(de.disableErrorBoundaries)i.get();else try{i.get()}catch{return Gs(n),Ii(t),!0}if(e.dependenciesState_===We.STALE_)return Gs(n),Ii(t),!0}}return ib(e),Gs(n),Ii(t),!1}}}function rb(e,t,n){var s=Pp(!0);ib(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++de.runId;var r=de.trackingDerivation;de.trackingDerivation=e,de.inBatch++;var o;if(de.disableErrorBoundaries===!0)o=t.call(n);else try{o=t.call(n)}catch(i){o=new ql(i)}return de.inBatch--,de.trackingDerivation=r,SC(e),Ii(s),o}function SC(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,s=We.UP_TO_DATE_,r=0,o=e.unboundDepsCount_,i=0;i<o;i++){var a=n[i];a.diffValue===0&&(a.diffValue=1,r!==i&&(n[r]=a),r++),a.dependenciesState_>s&&(s=a.dependenciesState_)}for(n.length=r,e.newObserving_=null,o=t.length;o--;){var c=t[o];c.diffValue===0&&lb(c,e),c.diffValue=0}for(;r--;){var u=n[r];u.diffValue===1&&(u.diffValue=0,jC(u,e))}s!==We.UP_TO_DATE_&&(e.dependenciesState_=s,e.onBecomeStale_())}function Ed(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)lb(t[n],e);e.dependenciesState_=We.NOT_TRACKING_}function ob(e){var t=xo();try{return e()}finally{Gs(t)}}function xo(){var e=de.trackingDerivation;return de.trackingDerivation=null,e}function Gs(e){de.trackingDerivation=e}function Pp(e){var t=de.allowStateReads;return de.allowStateReads=e,t}function Ii(e){de.allowStateReads=e}function ib(e){if(e.dependenciesState_!==We.UP_TO_DATE_){e.dependenciesState_=We.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=We.UP_TO_DATE_}}var kl=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Rl=!0,ab=!1,de=function(){var e=bc();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Rl=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new kl().version&&(Rl=!1),Rl?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new kl):(setTimeout(function(){ab||He(35)},1),new kl)}();function CC(){if((de.pendingReactions.length||de.inBatch||de.isRunningReactions)&&He(36),ab=!0,Rl){var e=bc();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),de=new kl}}function jC(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function lb(e,t){e.observers_.delete(t),e.observers_.size===0&&cb(e)}function cb(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,de.pendingUnobservations.push(e))}function Ln(){de.inBatch++}function Nn(){if(--de.inBatch===0){pb();for(var e=de.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof Xn&&n.suspend_())}de.pendingUnobservations=[]}}function ub(e){var t=de.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&de.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&de.inBatch>0&&cb(e),!1)}function db(e){e.lowestObserverState_!==We.STALE_&&(e.lowestObserverState_=We.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===We.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=We.STALE_}))}function EC(e){e.lowestObserverState_!==We.STALE_&&(e.lowestObserverState_=We.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===We.POSSIBLY_STALE_?t.dependenciesState_=We.STALE_:t.dependenciesState_===We.UP_TO_DATE_&&(e.lowestObserverState_=We.UP_TO_DATE_)}))}function PC(e){e.lowestObserverState_===We.UP_TO_DATE_&&(e.lowestObserverState_=We.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===We.UP_TO_DATE_&&(t.dependenciesState_=We.POSSIBLY_STALE_,t.onBecomeStale_())}))}var Zs=function(){function e(n,s,r,o){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=We.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=Gl.NONE,this.name_=n,this.onInvalidate_=s,this.errorHandler_=r,this.requiresObservable_=o}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,de.pendingReactions.push(this),pb())},t.runReaction_=function(){if(!this.isDisposed){Ln(),this.isScheduled=!1;var s=de.trackingContext;if(de.trackingContext=this,jd(this)){this.isTrackPending=!0;try{this.onInvalidate_(),zt.NODE_ENV!=="production"&&this.isTrackPending&&so()}catch(r){this.reportExceptionInDerivation_(r)}}de.trackingContext=s,Nn()}},t.track=function(s){if(!this.isDisposed){Ln(),this.isRunning=!0;var r=de.trackingContext;de.trackingContext=this;var o=rb(this,s,void 0);de.trackingContext=r,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&Ed(this),$l(o)&&this.reportExceptionInDerivation_(o.cause),Nn()}},t.reportExceptionInDerivation_=function(s){var r=this;if(this.errorHandler_){this.errorHandler_(s,this);return}if(de.disableErrorBoundaries)throw s;var o="[mobx] uncaught error in '"+this+"'";de.suppressReactionErrors||console.error(o,s),de.globalReactionErrorHandlers.forEach(function(i){return i(s,r)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Ln(),Ed(this),Nn()))},t.getDisposer_=function(s){var r=this,o=function i(){r.dispose(),s==null||s.removeEventListener==null||s.removeEventListener("abort",i)};return s==null||s.addEventListener==null||s.addEventListener("abort",o),o[xe]=this,o},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(s){},ci(e,[{key:"isDisposed",get:function(){return mn(this.flags_,e.isDisposedMask_)},set:function(s){this.flags_=bn(this.flags_,e.isDisposedMask_,s)}},{key:"isScheduled",get:function(){return mn(this.flags_,e.isScheduledMask_)},set:function(s){this.flags_=bn(this.flags_,e.isScheduledMask_,s)}},{key:"isTrackPending",get:function(){return mn(this.flags_,e.isTrackPendingMask_)},set:function(s){this.flags_=bn(this.flags_,e.isTrackPendingMask_,s)}},{key:"isRunning",get:function(){return mn(this.flags_,e.isRunningMask_)},set:function(s){this.flags_=bn(this.flags_,e.isRunningMask_,s)}},{key:"diffValue",get:function(){return mn(this.flags_,e.diffValueMask_)?1:0},set:function(s){this.flags_=bn(this.flags_,e.diffValueMask_,s===1)}}])}();Zs.isDisposedMask_=1;Zs.isScheduledMask_=2;Zs.isTrackPendingMask_=4;Zs.isRunningMask_=8;Zs.diffValueMask_=16;var TC=100,Pd=function(t){return t()};function pb(){de.inBatch>0||de.isRunningReactions||Pd(OC)}function OC(){de.isRunningReactions=!0;for(var e=de.pendingReactions,t=0;e.length>0;){++t===TC&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),s=0,r=n.length;s<r;s++)n[s].runReaction_()}de.isRunningReactions=!1}var Kl=Mr("Reaction",Zs);function _C(e){var t=Pd;Pd=function(s){return e(function(){return t(s)})}}function so(){return zt.NODE_ENV!=="production"}function AC(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var fb="action",MC="action.bound",hb="autoAction",LC="autoAction.bound",NC="<unnamed action>",Td=wa(fb),$C=wa(MC,{bound:!0}),Od=wa(hb,{autoAction:!0}),kC=wa(LC,{autoAction:!0,bound:!0});function gb(e){var t=function(s,r){if(Yn(s))return po(s.name||NC,s,e);if(Yn(r))return po(s,r,e);if(xa(r))return(e?Od:Td).decorate_20223_(s,r);if(lo(r))return ya(s,r,e?Od:Td);if(lo(s))return Ss(wa(e?hb:fb,{name:s,autoAction:e}))};return t}var Bo=gb(!1);Object.assign(Bo,Td);var Ji=gb(!0);Object.assign(Ji,Od);Bo.bound=Ss($C);Ji.bound=Ss(kC);function Qi(e){return Yn(e)&&e.isMobxAction===!0}function RC(e,t){var n,s,r,o;t===void 0&&(t=F1);var i=(n=(s=t)==null?void 0:s.name)!=null?n:"Autorun",a=!t.scheduler&&!t.delay,c;if(a)c=new Zs(i,function(){this.track(p)},t.onError,t.requiresObservable);else{var u=VC(t),d=!1;c=new Zs(i,function(){d||(d=!0,u(function(){d=!1,c.isDisposed||c.track(p)}))},t.onError,t.requiresObservable)}function p(){e(c)}return(r=t)!=null&&(r=r.signal)!=null&&r.aborted||c.schedule_(),c.getDisposer_((o=t)==null?void 0:o.signal)}var IC=function(t){return t()};function VC(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:IC}var HC="onBO",DC="onBUO";function FC(e,t,n){return bb(HC,e,t,n)}function mb(e,t,n){return bb(DC,e,t,n)}function bb(e,t,n,s){var r=Xl(t),o=Yn(s)?s:n,i=e+"L";return r[i]?r[i].add(o):r[i]=new Set([o]),function(){var a=r[i];a&&(a.delete(o),a.size===0&&delete r[i])}}var BC="never",Qa="always",zC="observed";function UC(e){e.isolateGlobalState===!0&&CC();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(de.useProxies=t===Qa?!0:t===BC?!1:typeof Proxy<"u"),t==="ifavailable"&&(de.verifyProxies=!0),n!==void 0){var s=n===Qa?Qa:n===zC;de.enforceActions=s,de.allowStateChanges=!(s===!0||s===Qa)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(r){r in e&&(de[r]=!!e[r])}),de.allowStateReads=!de.observableRequiresReaction,e.reactionScheduler&&_C(e.reactionScheduler)}function vb(e,t,n,s){var r=C2(t);return $r(function(){var o=wo(e,s)[xe];Xo(r).forEach(function(i){o.extend_(i,r[i],n&&i in n?n[i]:!0)})}),e}function WC(e,t){return yb(Xl(e,t))}function yb(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=GC(e.observing_).map(yb)),t}function GC(e){return Array.from(new Set(e))}var qC=0;function xb(){this.message="FLOW_CANCELLED"}xb.prototype=Object.create(Error.prototype);var hu=X1("flow"),KC=X1("flow.bound",{bound:!0}),fo=Object.assign(function(t,n){if(xa(n))return hu.decorate_20223_(t,n);if(lo(n))return ya(t,n,hu);var s=t,r=s.name||"<unnamed flow>",o=function(){var a=this,c=arguments,u=++qC,d=Bo(r+" - runid: "+u+" - init",s).apply(a,c),p,h=void 0,g=new Promise(function(m,b){var v=0;p=b;function x(S){h=void 0;var C;try{C=Bo(r+" - runid: "+u+" - yield "+v++,d.next).call(d,S)}catch(j){return b(j)}w(C)}function y(S){h=void 0;var C;try{C=Bo(r+" - runid: "+u+" - yield "+v++,d.throw).call(d,S)}catch(j){return b(j)}w(C)}function w(S){if(Yn(S==null?void 0:S.then)){S.then(w,b);return}return S.done?m(S.value):(h=Promise.resolve(S.value),h.then(x,y))}x(void 0)});return g.cancel=Bo(r+" - runid: "+u+" - cancel",function(){try{h&&gh(h);var m=d.return(void 0),b=Promise.resolve(m.value);b.then(Do,Do),gh(b),p(new xb)}catch(v){p(v)}}),g};return o.isMobXFlow=!0,o},hu);fo.bound=Ss(KC);function gh(e){Yn(e.cancel)&&e.cancel()}function ea(e){return(e==null?void 0:e.isMobXFlow)===!0}function ZC(e,t){return e?Pa(e)||!!e[xe]||Sp(e)||Kl(e)||Sa(e):!1}function Tp(e){return ZC(e)}function YC(e){if(Pa(e))return e[xe].ownKeys_();He(38)}function el(e,t,n){return e.set(t,n),n}function Io(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Tp(e))return e;if(wC(e)||Sa(e))return Io(e.get(),t);if(t.has(e))return t.get(e);if(Ea(e)){var n=el(t,e,new Array(e.length));return e.forEach(function(i,a){n[a]=Io(i,t)}),n}if(Wn(e)){var s=el(t,e,new Set);return e.forEach(function(i){s.add(Io(i,t))}),s}if(Nr(e)){var r=el(t,e,new Map);return e.forEach(function(i,a){r.set(a,Io(i,t))}),r}else{var o=el(t,e,{});return YC(e).forEach(function(i){ba.propertyIsEnumerable.call(e,i)&&(o[i]=Io(e[i],t))}),o}}function gr(e,t){return Io(e,new Map)}function Ds(e,t){t===void 0&&(t=void 0),Ln();try{return e.apply(t)}finally{Nn()}}function _o(e){return e[xe]}var XC={has:function(t,n){return _o(t).has_(n)},get:function(t,n){return _o(t).get_(n)},set:function(t,n,s){var r;return lo(n)?(r=_o(t).set_(n,s,!0))!=null?r:!0:!1},deleteProperty:function(t,n){var s;return lo(n)?(s=_o(t).delete_(n,!0))!=null?s:!0:!1},defineProperty:function(t,n,s){var r;return(r=_o(t).defineProperty_(n,s))!=null?r:!0},ownKeys:function(t){return _o(t).ownKeys_()},preventExtensions:function(t){He(13)}};function JC(e,t){var n,s;return B1(),e=wo(e,t),(s=(n=e[xe]).proxy_)!=null?s:n.proxy_=new Proxy(e,XC)}function _n(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Ca(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),z1(function(){var s=n.indexOf(t);s!==-1&&n.splice(s,1)})}function An(e,t){var n=xo();try{for(var s=[].concat(e.interceptors_||[]),r=0,o=s.length;r<o&&(t=s[r](t),t&&!t.type&&He(14),!!t);r++);return t}finally{Gs(n)}}function qn(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function ja(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),z1(function(){var s=n.indexOf(t);s!==-1&&n.splice(s,1)})}function Kn(e,t){var n=xo(),s=e.changeListeners_;if(s){s=s.slice();for(var r=0,o=s.length;r<o;r++)s[r](t);Gs(n)}}function QC(e,t,n){return $r(function(){var s,r=wo(e,n)[xe];zt.NODE_ENV!=="production"&&t&&e[Gn],(s=t)!=null||(t=O2(e)),Xo(t).forEach(function(o){return r.make_(o,t[o])})}),e}var gu=Symbol("mobx-keys");function tn(e,t,n){return Ks(e)?vb(e,e,t,n):($r(function(){var s=wo(e,n)[xe];if(!e[gu]){var r=Object.getPrototypeOf(e),o=new Set([].concat(Xo(e),Xo(r)));o.delete("constructor"),o.delete(xe),va(r,gu,o)}e[gu].forEach(function(i){return s.make_(i,t&&i in t?t[i]:!0)})}),e)}var mh="splice",Cs="update",ej=1e4,tj={get:function(t,n){var s=t[xe];return n===xe?s:n==="length"?s.getArrayLength_():typeof n=="string"&&!isNaN(n)?s.get_(parseInt(n)):Ws(Zl,n)?Zl[n]:t[n]},set:function(t,n,s){var r=t[xe];return n==="length"&&r.setArrayLength_(s),typeof n=="symbol"||isNaN(n)?t[n]=s:r.set_(parseInt(n),s),!0},preventExtensions:function(){He(15)}},Op=function(){function e(n,s,r,o){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=r,this.legacyMode_=o,this.atom_=new Lr(n),this.enhancer_=function(i,a){return s(i,a,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(s){return this.dehancer!==void 0?this.dehancer(s):s},t.dehanceValues_=function(s){return this.dehancer!==void 0&&s.length>0?s.map(this.dehancer):s},t.intercept_=function(s){return Ca(this,s)},t.observe_=function(s,r){return r===void 0&&(r=!1),r&&s({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),ja(this,s)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(s){(typeof s!="number"||isNaN(s)||s<0)&&He("Out of range: "+s);var r=this.values_.length;if(s!==r)if(s>r){for(var o=new Array(s-r),i=0;i<s-r;i++)o[i]=void 0;this.spliceWithArray_(r,0,o)}else this.spliceWithArray_(s,r-s)},t.updateArrayLength_=function(s,r){s!==this.lastKnownLength_&&He(16),this.lastKnownLength_+=r,this.legacyMode_&&r>0&&Tb(s+r+1)},t.spliceWithArray_=function(s,r,o){var i=this;this.atom_;var a=this.values_.length;if(s===void 0?s=0:s>a?s=a:s<0&&(s=Math.max(0,a+s)),arguments.length===1?r=a-s:r==null?r=0:r=Math.max(0,Math.min(r,a-s)),o===void 0&&(o=xd),_n(this)){var c=An(this,{object:this.proxy_,type:mh,index:s,removedCount:r,added:o});if(!c)return xd;r=c.removedCount,o=c.added}if(o=o.length===0?o:o.map(function(p){return i.enhancer_(p,void 0)}),this.legacyMode_||zt.NODE_ENV!=="production"){var u=o.length-r;this.updateArrayLength_(a,u)}var d=this.spliceItemsIntoValues_(s,r,o);return(r!==0||o.length!==0)&&this.notifyArraySplice_(s,o,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(s,r,o){if(o.length<ej){var i;return(i=this.values_).splice.apply(i,[s,r].concat(o))}else{var a=this.values_.slice(s,s+r),c=this.values_.slice(s+r);this.values_.length+=o.length-r;for(var u=0;u<o.length;u++)this.values_[s+u]=o[u];for(var d=0;d<c.length;d++)this.values_[s+o.length+d]=c[d];return a}},t.notifyArrayChildUpdate_=function(s,r,o){var i=!this.owned_&&so(),a=qn(this),c=a||i?{observableKind:"array",object:this.proxy_,type:Cs,debugObjectName:this.atom_.name_,index:s,newValue:r,oldValue:o}:null;this.atom_.reportChanged(),a&&Kn(this,c)},t.notifyArraySplice_=function(s,r,o){var i=!this.owned_&&so(),a=qn(this),c=a||i?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:mh,index:s,removed:o,added:r,removedCount:o.length,addedCount:r.length}:null;this.atom_.reportChanged(),a&&Kn(this,c)},t.get_=function(s){if(this.legacyMode_&&s>=this.values_.length){console.warn("[mobx] Out of bounds read: "+s);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[s])},t.set_=function(s,r){var o=this.values_;if(this.legacyMode_&&s>o.length&&He(17,s,o.length),s<o.length){this.atom_;var i=o[s];if(_n(this)){var a=An(this,{type:Cs,object:this.proxy_,index:s,newValue:r});if(!a)return;r=a.newValue}r=this.enhancer_(r,i);var c=r!==i;c&&(o[s]=r,this.notifyArrayChildUpdate_(s,r,i))}else{for(var u=new Array(s+1-o.length),d=0;d<u.length-1;d++)u[d]=void 0;u[u.length-1]=r,this.spliceWithArray_(o.length,0,u)}},e}();function nj(e,t,n,s){return n===void 0&&(n="ObservableArray"),s===void 0&&(s=!1),B1(),$r(function(){var r=new Op(n,t,s,!1);W1(r.values_,xe,r);var o=new Proxy(r.values_,tj);return r.proxy_=o,e&&e.length&&r.spliceWithArray_(0,0,e),o})}var Zl={clear:function(){return this.splice(0)},replace:function(t){var n=this[xe];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var s=arguments.length,r=new Array(s>2?s-2:0),o=2;o<s;o++)r[o-2]=arguments[o];var i=this[xe];switch(arguments.length){case 0:return[];case 1:return i.spliceWithArray_(t);case 2:return i.spliceWithArray_(t,n)}return i.spliceWithArray_(t,n,r)},spliceWithArray:function(t,n,s){return this[xe].spliceWithArray_(t,n,s)},push:function(){for(var t=this[xe],n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.spliceWithArray_(t.values_.length,0,s),t.values_.length},pop:function(){return this.splice(Math.max(this[xe].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[xe],n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.spliceWithArray_(0,0,s),t.values_.length},reverse:function(){return de.trackingDerivation&&He(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){de.trackingDerivation&&He(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[xe],s=n.dehanceValues_(n.values_).indexOf(t);return s>-1?(this.splice(s,1),!0):!1}};pt("at",Sn);pt("concat",Sn);pt("flat",Sn);pt("includes",Sn);pt("indexOf",Sn);pt("join",Sn);pt("lastIndexOf",Sn);pt("slice",Sn);pt("toString",Sn);pt("toLocaleString",Sn);pt("toSorted",Sn);pt("toSpliced",Sn);pt("with",Sn);pt("every",ts);pt("filter",ts);pt("find",ts);pt("findIndex",ts);pt("findLast",ts);pt("findLastIndex",ts);pt("flatMap",ts);pt("forEach",ts);pt("map",ts);pt("some",ts);pt("toReversed",ts);pt("reduce",wb);pt("reduceRight",wb);function pt(e,t){typeof Array.prototype[e]=="function"&&(Zl[e]=t(e))}function Sn(e){return function(){var t=this[xe];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function ts(e){return function(t,n){var s=this,r=this[xe];r.atom_.reportObserved();var o=r.dehanceValues_(r.values_);return o[e](function(i,a){return t.call(n,i,a,s)})}}function wb(e){return function(){var t=this,n=this[xe];n.atom_.reportObserved();var s=n.dehanceValues_(n.values_),r=arguments[0];return arguments[0]=function(o,i,a){return r(o,i,a,t)},s[e].apply(s,arguments)}}var sj=Mr("ObservableArrayAdministration",Op);function Ea(e){return vc(e)&&sj(e[xe])}var rj={},mr="add",Yl="delete",Sb=function(){function e(n,s,r){var o=this;s===void 0&&(s=uo),r===void 0&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[xe]=rj,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=s,this.name_=r,Yn(Map)||He(18),$r(function(){o.keysAtom_=Z1(zt.NODE_ENV!=="production"?o.name_+".keys()":"ObservableMap.keys()"),o.data_=new Map,o.hasMap_=new Map,n&&o.merge(n)})}var t=e.prototype;return t.has_=function(s){return this.data_.has(s)},t.has=function(s){var r=this;if(!de.trackingDerivation)return this.has_(s);var o=this.hasMap_.get(s);if(!o){var i=o=new Sr(this.has_(s),yc,"ObservableMap.key?",!1);this.hasMap_.set(s,i),mb(i,function(){return r.hasMap_.delete(s)})}return o.get()},t.set=function(s,r){var o=this.has_(s);if(_n(this)){var i=An(this,{type:o?Cs:mr,object:this,newValue:r,name:s});if(!i)return this;r=i.newValue}return o?this.updateValue_(s,r):this.addValue_(s,r),this},t.delete=function(s){var r=this;if(this.keysAtom_,_n(this)){var o=An(this,{type:Yl,object:this,name:s});if(!o)return!1}if(this.has_(s)){var i=so(),a=qn(this),c=a||i?{observableKind:"map",debugObjectName:this.name_,type:Yl,object:this,oldValue:this.data_.get(s).value_,name:s}:null;return Ds(function(){var u;r.keysAtom_.reportChanged(),(u=r.hasMap_.get(s))==null||u.setNewValue_(!1);var d=r.data_.get(s);d.setNewValue_(void 0),r.data_.delete(s)}),a&&Kn(this,c),!0}return!1},t.updateValue_=function(s,r){var o=this.data_.get(s);if(r=o.prepareNewValue_(r),r!==de.UNCHANGED){var i=so(),a=qn(this),c=a||i?{observableKind:"map",debugObjectName:this.name_,type:Cs,object:this,oldValue:o.value_,name:s,newValue:r}:null;o.setNewValue_(r),a&&Kn(this,c)}},t.addValue_=function(s,r){var o=this;this.keysAtom_,Ds(function(){var u,d=new Sr(r,o.enhancer_,"ObservableMap.key",!1);o.data_.set(s,d),r=d.value_,(u=o.hasMap_.get(s))==null||u.setNewValue_(!0),o.keysAtom_.reportChanged()});var i=so(),a=qn(this),c=a||i?{observableKind:"map",debugObjectName:this.name_,type:mr,object:this,name:s,newValue:r}:null;a&&Kn(this,c)},t.get=function(s){return this.has(s)?this.dehanceValue_(this.data_.get(s).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(s){return this.dehancer!==void 0?this.dehancer(s):s},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var s=this,r=this.keys();return bh({next:function(){var i=r.next(),a=i.done,c=i.value;return{done:a,value:a?void 0:s.get(c)}}})},t.entries=function(){var s=this,r=this.keys();return bh({next:function(){var i=r.next(),a=i.done,c=i.value;return{done:a,value:a?void 0:[c,s.get(c)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(s,r){for(var o=Fo(this),i;!(i=o()).done;){var a=i.value,c=a[0],u=a[1];s.call(r,u,c,this)}},t.merge=function(s){var r=this;return Nr(s)&&(s=new Map(s)),Ds(function(){Ks(s)?S2(s).forEach(function(o){return r.set(o,s[o])}):Array.isArray(s)?s.forEach(function(o){var i=o[0],a=o[1];return r.set(i,a)}):li(s)?(w2(s)||He(19,s),s.forEach(function(o,i){return r.set(i,o)})):s!=null&&He(20,s)}),this},t.clear=function(){var s=this;Ds(function(){ob(function(){for(var r=Fo(s.keys()),o;!(o=r()).done;){var i=o.value;s.delete(i)}})})},t.replace=function(s){var r=this;return Ds(function(){for(var o=oj(s),i=new Map,a=!1,c=Fo(r.data_.keys()),u;!(u=c()).done;){var d=u.value;if(!o.has(d)){var p=r.delete(d);if(p)a=!0;else{var h=r.data_.get(d);i.set(d,h)}}}for(var g=Fo(o.entries()),m;!(m=g()).done;){var b=m.value,v=b[0],x=b[1],y=r.data_.has(v);if(r.set(v,x),r.data_.has(v)){var w=r.data_.get(v);i.set(v,w),y||(a=!0)}}if(!a)if(r.data_.size!==i.size)r.keysAtom_.reportChanged();else for(var S=r.data_.keys(),C=i.keys(),j=S.next(),E=C.next();!j.done;){if(j.value!==E.value){r.keysAtom_.reportChanged();break}j=S.next(),E=C.next()}r.data_=i}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(s,r){return ja(this,s)},t.intercept_=function(s){return Ca(this,s)},ci(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Nr=Mr("ObservableMap",Sb);function bh(e){return e[Symbol.toStringTag]="MapIterator",Mp(e)}function oj(e){if(li(e)||Nr(e))return e;if(Array.isArray(e))return new Map(e);if(Ks(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return He(21,e)}var ij={},Cb=function(){function e(n,s,r){var o=this;s===void 0&&(s=uo),r===void 0&&(r="ObservableSet"),this.name_=void 0,this[xe]=ij,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,Yn(Set)||He(22),this.enhancer_=function(i,a){return s(i,a,r)},$r(function(){o.atom_=Z1(o.name_),n&&o.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(s){return this.dehancer!==void 0?this.dehancer(s):s},t.clear=function(){var s=this;Ds(function(){ob(function(){for(var r=Fo(s.data_.values()),o;!(o=r()).done;){var i=o.value;s.delete(i)}})})},t.forEach=function(s,r){for(var o=Fo(this),i;!(i=o()).done;){var a=i.value;s.call(r,a,a,this)}},t.add=function(s){var r=this;if(this.atom_,_n(this)){var o=An(this,{type:mr,object:this,newValue:s});if(!o)return this}if(!this.has(s)){Ds(function(){r.data_.add(r.enhancer_(s,void 0)),r.atom_.reportChanged()});var i=zt.NODE_ENV!=="production",a=qn(this),c=a||i?{observableKind:"set",debugObjectName:this.name_,type:mr,object:this,newValue:s}:null;a&&Kn(this,c)}return this},t.delete=function(s){var r=this;if(_n(this)){var o=An(this,{type:Yl,object:this,oldValue:s});if(!o)return!1}if(this.has(s)){var i=zt.NODE_ENV!=="production",a=qn(this),c=a||i?{observableKind:"set",debugObjectName:this.name_,type:Yl,object:this,oldValue:s}:null;return Ds(function(){r.atom_.reportChanged(),r.data_.delete(s)}),a&&Kn(this,c),!0}return!1},t.has=function(s){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(s))},t.entries=function(){var s=0,r=Array.from(this.keys()),o=Array.from(this.values());return vh({next:function(){var a=s;return s+=1,a<o.length?{value:[r[a],o[a]],done:!1}:{value:void 0,done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var s=this,r=0,o=Array.from(this.data_.values());return vh({next:function(){return r<o.length?{value:s.dehanceValue_(o[r++]),done:!1}:{value:void 0,done:!0}}})},t.intersection=function(s){if(Hs(s)&&!Wn(s))return s.intersection(this);var r=new Set(this);return r.intersection(s)},t.union=function(s){if(Hs(s)&&!Wn(s))return s.union(this);var r=new Set(this);return r.union(s)},t.difference=function(s){return new Set(this).difference(s)},t.symmetricDifference=function(s){if(Hs(s)&&!Wn(s))return s.symmetricDifference(this);var r=new Set(this);return r.symmetricDifference(s)},t.isSubsetOf=function(s){return new Set(this).isSubsetOf(s)},t.isSupersetOf=function(s){return new Set(this).isSupersetOf(s)},t.isDisjointFrom=function(s){if(Hs(s)&&!Wn(s))return s.isDisjointFrom(this);var r=new Set(this);return r.isDisjointFrom(s)},t.replace=function(s){var r=this;return Wn(s)&&(s=new Set(s)),Ds(function(){Array.isArray(s)?(r.clear(),s.forEach(function(o){return r.add(o)})):Hs(s)?(r.clear(),s.forEach(function(o){return r.add(o)})):s!=null&&He("Cannot initialize set from "+s)}),this},t.observe_=function(s,r){return ja(this,s)},t.intercept_=function(s){return Ca(this,s)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},ci(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Wn=Mr("ObservableSet",Cb);function vh(e){return e[Symbol.toStringTag]="SetIterator",Mp(e)}var yh=Object.create(null),xh="remove",jb=function(){function e(n,s,r,o){s===void 0&&(s=new Map),o===void 0&&(o=eC),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=s,this.name_=r,this.defaultAnnotation_=o,this.keysAtom_=new Lr("ObservableObject.keys"),this.isPlainObject_=Ks(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(s){return this.values_.get(s).get()},t.setObservablePropValue_=function(s,r){var o=this.values_.get(s);if(o instanceof Xn)return o.set(r),!0;if(_n(this)){var i=An(this,{type:Cs,object:this.proxy_||this.target_,name:s,newValue:r});if(!i)return null;r=i.newValue}if(r=o.prepareNewValue_(r),r!==de.UNCHANGED){var a=qn(this),c=zt.NODE_ENV!=="production",u=a||c?{type:Cs,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:o.value_,name:s,newValue:r}:null;o.setNewValue_(r),a&&Kn(this,u)}return!0},t.get_=function(s){return de.trackingDerivation&&!Ws(this.target_,s)&&this.has_(s),this.target_[s]},t.set_=function(s,r,o){return o===void 0&&(o=!1),Ws(this.target_,s)?this.values_.has(s)?this.setObservablePropValue_(s,r):o?Reflect.set(this.target_,s,r):(this.target_[s]=r,!0):this.extend_(s,{value:r,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,o)},t.has_=function(s){if(!de.trackingDerivation)return s in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var r=this.pendingKeys_.get(s);return r||(r=new Sr(s in this.target_,yc,"ObservableObject.key?",!1),this.pendingKeys_.set(s,r)),r.get()},t.make_=function(s,r){if(r===!0&&(r=this.defaultAnnotation_),r!==!1){if(!(s in this.target_)){var o;if((o=this.target_[Gn])!=null&&o[s])return;He(1,r.annotationType_,this.name_+"."+s.toString())}for(var i=this.target_;i&&i!==ba;){var a=zl(i,s);if(a){var c=r.make_(this,s,a,i);if(c===0)return;if(c===1)break}i=Object.getPrototypeOf(i)}Sh(this,r,s)}},t.extend_=function(s,r,o,i){if(i===void 0&&(i=!1),o===!0&&(o=this.defaultAnnotation_),o===!1)return this.defineProperty_(s,r,i);var a=o.extend_(this,s,r,i);return a&&Sh(this,o,s),a},t.defineProperty_=function(s,r,o){o===void 0&&(o=!1),this.keysAtom_;try{Ln();var i=this.delete_(s);if(!i)return i;if(_n(this)){var a=An(this,{object:this.proxy_||this.target_,name:s,type:mr,newValue:r.value});if(!a)return null;var c=a.newValue;r.value!==c&&(r=co({},r,{value:c}))}if(o){if(!Reflect.defineProperty(this.target_,s,r))return!1}else ws(this.target_,s,r);this.notifyPropertyAddition_(s,r.value)}finally{Nn()}return!0},t.defineObservableProperty_=function(s,r,o,i){i===void 0&&(i=!1),this.keysAtom_;try{Ln();var a=this.delete_(s);if(!a)return a;if(_n(this)){var c=An(this,{object:this.proxy_||this.target_,name:s,type:mr,newValue:r});if(!c)return null;r=c.newValue}var u=wh(s),d={configurable:de.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(i){if(!Reflect.defineProperty(this.target_,s,d))return!1}else ws(this.target_,s,d);var p=new Sr(r,o,zt.NODE_ENV!=="production"?this.name_+"."+s.toString():"ObservableObject.key",!1);this.values_.set(s,p),this.notifyPropertyAddition_(s,p.value_)}finally{Nn()}return!0},t.defineComputedProperty_=function(s,r,o){o===void 0&&(o=!1),this.keysAtom_;try{Ln();var i=this.delete_(s);if(!i)return i;if(_n(this)){var a=An(this,{object:this.proxy_||this.target_,name:s,type:mr,newValue:void 0});if(!a)return null}r.name||(r.name=zt.NODE_ENV!=="production"?this.name_+"."+s.toString():"ObservableObject.key"),r.context=this.proxy_||this.target_;var c=wh(s),u={configurable:de.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,s,u))return!1}else ws(this.target_,s,u);this.values_.set(s,new Xn(r)),this.notifyPropertyAddition_(s,void 0)}finally{Nn()}return!0},t.delete_=function(s,r){if(r===void 0&&(r=!1),this.keysAtom_,!Ws(this.target_,s))return!0;if(_n(this)){var o=An(this,{object:this.proxy_||this.target_,name:s,type:xh});if(!o)return null}try{var i;Ln();var a=qn(this),c=zt.NODE_ENV!=="production"&&so(),u=this.values_.get(s),d=void 0;if(!u&&(a||c)){var p;d=(p=zl(this.target_,s))==null?void 0:p.value}if(r){if(!Reflect.deleteProperty(this.target_,s))return!1}else delete this.target_[s];if(zt.NODE_ENV,u&&(this.values_.delete(s),u instanceof Sr&&(d=u.value_),db(u)),this.keysAtom_.reportChanged(),(i=this.pendingKeys_)==null||(i=i.get(s))==null||i.set(s in this.target_),a||c){var h={type:xh,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:s};zt.NODE_ENV,a&&Kn(this,h),zt.NODE_ENV}}finally{Nn()}return!0},t.observe_=function(s,r){return ja(this,s)},t.intercept_=function(s){return Ca(this,s)},t.notifyPropertyAddition_=function(s,r){var o,i=qn(this),a=zt.NODE_ENV!=="production";if(i||a){var c=i||a?{type:mr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:s,newValue:r}:null;i&&Kn(this,c)}(o=this.pendingKeys_)==null||(o=o.get(s))==null||o.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Xo(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function wo(e,t){var n;if(Ws(e,xe))return e;var s=(n=t==null?void 0:t.name)!=null?n:"ObservableObject",r=new jb(e,new Map,String(s),dC(t));return va(e,xe,r),e}var aj=Mr("ObservableObjectAdministration",jb);function wh(e){return yh[e]||(yh[e]={get:function(){return this[xe].getObservablePropValue_(e)},set:function(n){return this[xe].setObservablePropValue_(e,n)}})}function Pa(e){return vc(e)?aj(e[xe]):!1}function Sh(e,t,n){var s;(s=e.target_[Gn])==null||delete s[n]}var lj=Pb(0),cj=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),mu=0,Eb=function(){};function uj(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}uj(Eb,Array.prototype);var _p=function(e){function t(s,r,o,i){var a;return o===void 0&&(o="ObservableArray"),i===void 0&&(i=!1),a=e.call(this)||this,$r(function(){var c=new Op(o,r,i,!0);c.proxy_=a,W1(a,xe,c),s&&s.length&&a.spliceWithArray(0,0,s),cj&&Object.defineProperty(a,"0",lj)}),a}K1(t,e);var n=t.prototype;return n.concat=function(){this[xe].atom_.reportObserved();for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return Array.prototype.concat.apply(this.slice(),o.map(function(a){return Ea(a)?a.slice():a}))},n[Symbol.iterator]=function(){var s=this,r=0;return Mp({next:function(){return r<s.length?{value:s[r++],done:!1}:{done:!0,value:void 0}}})},ci(t,[{key:"length",get:function(){return this[xe].getArrayLength_()},set:function(r){this[xe].setArrayLength_(r)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(Eb);Object.entries(Zl).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&va(_p.prototype,t,n)});function Pb(e){return{enumerable:!1,configurable:!0,get:function(){return this[xe].get_(e)},set:function(n){this[xe].set_(e,n)}}}function dj(e){ws(_p.prototype,""+e,Pb(e))}function Tb(e){if(e>mu){for(var t=mu;t<e+100;t++)dj(t);mu=e}}Tb(1e3);function pj(e,t,n){return new _p(e,t,n)}function Xl(e,t){if(typeof e=="object"&&e!==null){if(Ea(e))return t!==void 0&&He(23),e[xe].atom_;if(Wn(e))return e.atom_;if(Nr(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||He(25,t,_d(e)),n}if(Pa(e)){if(!t)return He(26);var s=e[xe].values_.get(t);return s||He(27,t,_d(e)),s}if(Sp(e)||Sa(e)||Kl(e))return e}else if(Yn(e)&&Kl(e[xe]))return e[xe];He(28)}function fj(e,t){if(e||He(29),Sp(e)||Sa(e)||Kl(e)||Nr(e)||Wn(e))return e;if(e[xe])return e[xe];He(24,e)}function _d(e,t){var n;if(t!==void 0)n=Xl(e,t);else{if(Qi(e))return e.name;Pa(e)||Nr(e)||Wn(e)?n=fj(e):n=Xl(e)}return n.name_}function $r(e){var t=xo(),n=jp(!0);Ln();try{return e()}finally{Nn(),Ep(n),Gs(t)}}var Ch=ba.toString;function Ap(e,t,n){return n===void 0&&(n=-1),Ad(e,t,n)}function Ad(e,t,n,s,r){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var o=typeof e;if(o!=="function"&&o!=="object"&&typeof t!="object")return!1;var i=Ch.call(e);if(i!==Ch.call(t))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=jh(e),t=jh(t);var a=i==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var c=e.constructor,u=t.constructor;if(c!==u&&!(Yn(c)&&c instanceof c&&Yn(u)&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),s=s||[],r=r||[];for(var d=s.length;d--;)if(s[d]===e)return r[d]===t;if(s.push(e),r.push(t),a){if(d=e.length,d!==t.length)return!1;for(;d--;)if(!Ad(e[d],t[d],n-1,s,r))return!1}else{var p=Object.keys(e),h;if(d=p.length,Object.keys(t).length!==d)return!1;for(;d--;)if(h=p[d],!(Ws(t,h)&&Ad(e[h],t[h],n-1,s,r)))return!1}return s.pop(),r.pop(),!0}function jh(e){return Ea(e)?e.slice():li(e)||Nr(e)||Hs(e)||Wn(e)?Array.from(e.entries()):e}var Eh,hj=((Eh=bc().Iterator)==null?void 0:Eh.prototype)||{};function Mp(e){return e[Symbol.iterator]=gj,Object.assign(Object.create(hj),e)}function gj(){return this}["Symbol","Map","Set"].forEach(function(e){var t=bc();typeof t[e]>"u"&&He("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:AC,extras:{getDebugName:_d},$mobx:xe});if(!f.useState)throw new Error("mobx-react-lite requires React with Hooks support");if(!QC)throw new Error("mobx-react-lite@3 requires mobx at least version 6 to be available");function mj(e){e()}function bj(e){e||(e=mj),UC({reactionScheduler:e})}function vj(e){return WC(e)}var yj=1e4,xj=1e4,wj=function(){function e(t){var n=this;Object.defineProperty(this,"finalize",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"registrations",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sweepTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sweep",{enumerable:!0,configurable:!0,writable:!0,value:function(s){s===void 0&&(s=yj),clearTimeout(n.sweepTimeout),n.sweepTimeout=void 0;var r=Date.now();n.registrations.forEach(function(o,i){r-o.registeredAt>=s&&(n.finalize(o.value),n.registrations.delete(i))}),n.registrations.size>0&&n.scheduleSweep()}}),Object.defineProperty(this,"finalizeAllImmediately",{enumerable:!0,configurable:!0,writable:!0,value:function(){n.sweep(0)}})}return Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n,s){this.registrations.set(s,{value:n,registeredAt:Date.now()}),this.scheduleSweep()}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this.registrations.delete(t)}}),Object.defineProperty(e.prototype,"scheduleSweep",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.sweepTimeout===void 0&&(this.sweepTimeout=setTimeout(this.sweep,xj))}}),e}(),Sj=typeof FinalizationRegistry<"u"?FinalizationRegistry:wj,Md=new Sj(function(e){var t;(t=e.reaction)===null||t===void 0||t.dispose(),e.reaction=null}),Ob={exports:{}},bu={};/**
68
22
  * @license React
69
23
  * use-sync-external-store-shim.production.min.js
70
24
  *
@@ -72,39 +26,31 @@ Use 'override' annotation for methods overridden by subclass.`)}}var tE=av(0),nE
72
26
  *
73
27
  * This source code is licensed under the MIT license found in the
74
28
  * LICENSE file in the root directory of this source tree.
75
- */var ng;function mE(){if(ng)return $u;ng=1;var e=h;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(f,p){var g=p(),m=s({inst:{value:g,getSnapshot:p}}),b=m[0].inst,v=m[1];return o(function(){b.value=g,b.getSnapshot=p,l(b)&&v({inst:b})},[f,g,p]),r(function(){return l(b)&&v({inst:b}),f(function(){l(b)&&v({inst:b})})},[f]),i(g),g}function l(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function u(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return $u.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,$u}var ku={},sg;function bE(){if(sg)return ku;sg=1;var e={};/**
76
- * @license React
77
- * use-sync-external-store-shim.development.js
78
- *
79
- * Copyright (c) Facebook, Inc. and its affiliates.
80
- *
81
- * This source code is licensed under the MIT license found in the
82
- * LICENSE file in the root directory of this source tree.
83
- */return e.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=h,n=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function s(S){{for(var C=arguments.length,j=new Array(C>1?C-1:0),E=1;E<C;E++)j[E-1]=arguments[E];r("error",S,j)}}function r(S,C,j){{var E=n.ReactDebugCurrentFrame,_=E.getStackAddendum();_!==""&&(C+="%s",j=j.concat([_]));var T=j.map(function(P){return String(P)});T.unshift("Warning: "+C),Function.prototype.apply.call(console[S],console,T)}}function o(S,C){return S===C&&(S!==0||1/S===1/C)||S!==S&&C!==C}var i=typeof Object.is=="function"?Object.is:o,a=t.useState,l=t.useEffect,u=t.useLayoutEffect,d=t.useDebugValue,f=!1,p=!1;function g(S,C,j){f||t.startTransition!==void 0&&(f=!0,s("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=C();if(!p){var _=C();i(E,_)||(s("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}var T=a({inst:{value:E,getSnapshot:C}}),P=T[0].inst,A=T[1];return u(function(){P.value=E,P.getSnapshot=C,m(P)&&A({inst:P})},[S,E,C]),l(function(){m(P)&&A({inst:P});var M=function(){m(P)&&A({inst:P})};return S(M)},[S]),d(E),E}function m(S){var C=S.getSnapshot,j=S.value;try{var E=C();return!i(j,E)}catch{return!0}}function b(S,C,j){return C()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!v,y=x?b:g,w=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y;ku.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}(),ku}var vE={};vE.NODE_ENV==="production"?Xd.exports=mE():Xd.exports=bE();var yE=Xd.exports;function rg(e){e.reaction=new rr("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function xE(e,t){t===void 0&&(t="observed");var n=h.useRef(null);if(!n.current){var s={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(a){return Zd.unregister(s),s.onStoreChange=a,s.reaction||(rg(s),s.stateVersion=Symbol()),function(){var l;s.onStoreChange=null,(l=s.reaction)===null||l===void 0||l.dispose(),s.reaction=null}},getSnapshot:function(){return s.stateVersion}};n.current=s}var r=n.current;r.reaction||(rg(r),Zd.register(n,r,r)),h.useDebugValue(r.reaction,dE),yE.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);var o,i;if(r.reaction.track(function(){try{o=e()}catch(a){i=a}}),i)throw i;return o}var og={},Vu,Iu,ig=!0,dv=typeof Symbol=="function"&&Symbol.for,wE=(Iu=(Vu=Object.getOwnPropertyDescriptor(function(){},"name"))===null||Vu===void 0?void 0:Vu.configurable)!==null&&Iu!==void 0?Iu:!1,ag=dv?Symbol.for("react.forward_ref"):typeof h.forwardRef=="function"&&h.forwardRef(function(e){return null}).$$typeof,lg=dv?Symbol.for("react.memo"):typeof h.memo=="function"&&h.memo(function(e){return null}).$$typeof;function fe(e,t){var n;if(og.NODE_ENV!=="production"&&ig&&t&&(ig=!1,console.warn("[mobx-react-lite] `observer(fn, { forwardRef: true })` is deprecated, use `observer(React.forwardRef(fn))`")),lg&&e.$$typeof===lg)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var s=(n=void 0)!==null&&n!==void 0?n:!1,r=e,o=e.displayName||e.name;if(ag&&e.$$typeof===ag&&(s=!0,r=e.render,typeof r!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var i=function(a,l){return xE(function(){return r(a,l)},o)};return i.displayName=e.displayName,wE&&Object.defineProperty(i,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(i.contextTypes=e.contextTypes),s&&(i=h.forwardRef(i)),i=h.memo(i),CE(e,i),og.NODE_ENV!=="production"&&Object.defineProperty(i,"contextTypes",{set:function(){var a,l;throw new Error("[mobx-react-lite] `".concat(this.displayName||((a=this.type)===null||a===void 0?void 0:a.displayName)||((l=this.type)===null||l===void 0?void 0:l.name)||"Component",".contextTypes` must be set before applying `observer`."))}}),i}var SE={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function CE(e,t){Object.keys(e).forEach(function(n){SE[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}var Du;uE(Dn.unstable_batchedUpdates);Du=Zd.finalizeAllImmediately;const cg=new Map,jE=(e,t)=>`${t}-${e}`,fv=h.forwardRef(function({svg:t,iconSize:n,...s},r){const o=jE(t,n);let i=cg.get(o);return i||(i=vw(t,n),cg.set(o,i)),c.jsx("div",{...s,ref:r,dangerouslySetInnerHTML:{__html:i}})});let pv;const EE=e=>{pv=e},PE=()=>pv;var Z=(e=>(e.alertRhombus="alertRhombus",e.alignHorizontalCenter="alignHorizontalCenter",e.alignHorizontalLeft="alignHorizontalLeft",e.alignHorizontalRight="alignHorizontalRight",e.applicationBracketsOutline="applicationBracketsOutline",e.arrowDown="arrowDown",e.arrowExpandAll="arrowExpandAll",e.arrowRight="arrowRight",e.arrowULeftTop="arrowULeftTop",e.arrowURightTop="arrowURightTop",e.borderAllVariant="borderAllVariant",e.borderRadius="borderRadius",e.borderStyle="borderStyle",e.calendar="calendar",e.cellphoneLink="cellphoneLink",e.check="check",e.checkBold="checkBold",e.checkboxBlank="checkboxBlank",e.chevronUp="chevronUp",e.chevronDown="chevronDown",e.chevronLeft="chevronLeft",e.chevronRight="chevronRight",e.close="close",e.codeBraces="codeBraces",e.cog="cog",e.contentCopy="contentCopy",e.contentSave="contentSave",e.delete="delete",e.dotsVertical="dotsVertical",e.email="email",e.emailOutline="emailOutline",e.eye="eye",e.eyedropperVariant="eyedropperVariant",e.eyeOff="eyeOff",e.eyeOffOutline="eyeOffOutline",e.eyeOutline="eyeOutline",e.fire="fire",e.flare="flare",e.floppy="floppy",e.folder="folder",e.fullscreen="fullscreen",e.gradientVertical="gradientVertical",e.helpCircle="helpCircle",e.home="home",e.image="image",e.information="information",e.informationVariant="informationVariant",e.layers="layers",e.link="link",e.lock="lock",e.lockOpenVariant="lockOpenVariant",e.menuDown="menuDown",e.newspaperVariantOutline="newspaperVariantOutline",e.openInNew="openInNew",e.paletteSwatch="paletteSwatch",e.panVertical="panVertical",e.pencil="pencil",e.phone="phone",e.plus="plus",e.plusBox="plusBox",e.powerPlug="powerPlug",e.refresh="refresh",e.rhombusOutline="rhombusOutline",e.rhombusSplit="rhombusSplit",e.rhombusSplitOutline="rhombusSplitOutline",e.tag="tag",e.target="target",e.targetVariant="targetVariant",e.textBoxMultiple="textBoxMultiple",e.trayArrowDown="trayArrowDown",e.unfoldLessHorizontal="unfoldLessHorizontal",e.unfoldMoreHorizontal="unfoldMoreHorizontal",e.viewDayOutline="viewDayOutline",e.viewGridPlus="viewGridPlus",e.web="web",e.xml="xml",e.database="database",e.databaseOutline="databaseOutline",e.databaseOutlineOn="databaseOutlineOn",e.databaseOutlineOff="databaseOutlineOff",e.databaseOutlineRemove="databaseOutlineRemove",e.toggleSwitchOutline="toggleSwitchOutline",e.toggleSwitchOffOutline="toggleSwitchOffOutline",e.codeBrackets="codeBrackets",e.null="null",e.codeString="string",e.number="number",e.cloudUpload="cloudUpload",e.chat="chat",e.creation="creation",e.viewDashboard="viewDashboard",e.rocketLaunch="rocketLaunch",e.lightningBolt="lightningBolt",e.stop="stop",e.arrowUp="arrowUp",e))(Z||{});const Zl={alertRhombus:iS,alignHorizontalCenter:aS,alignHorizontalLeft:lS,alignHorizontalRight:cS,applicationBracketsOutline:uS,arrowDown:dS,arrowExpandAll:fS,arrowRight:pS,arrowULeftTop:hS,arrowURightTop:gS,borderAllVariant:bS,borderRadius:vS,borderStyle:yS,calendar:xS,cellphoneLink:wS,check:gb,checkBold:CS,checkboxBlank:jS,chevronUp:TS,chevronDown:ES,chevronLeft:PS,chevronRight:_S,close:mb,codeBraces:AS,cog:LS,contentCopy:RS,contentSave:$S,delete:BS,dotsVertical:zS,email:US,emailOutline:WS,eye:GS,eyedropperVariant:ZS,eyeOff:qS,eyeOffOutline:KS,eyeOutline:YS,fire:JS,flare:QS,floppy:e2,folder:t2,fullscreen:n2,gradientVertical:s2,helpCircle:r2,home:o2,image:i2,information:l2,informationVariant:c2,layers:u2,link:p2,lock:g2,lockOpenVariant:m2,menuDown:b2,newspaperVariantOutline:x2,openInNew:bb,paletteSwatch:C2,panVertical:j2,pencil:E2,phone:P2,plus:_2,plusBox:T2,powerPlug:O2,refresh:A2,rhombusOutline:N2,rhombusSplit:M2,rhombusSplitOutline:L2,tag:k2,target:V2,targetVariant:I2,textBoxMultiple:D2,trayArrowDown:B2,unfoldLessHorizontal:z2,unfoldMoreHorizontal:U2,viewDayOutline:G2,viewGridPlus:q2,web:K2,xml:Y2,database:VS,databaseOutline:HS,databaseOutlineOn:DS,databaseOutlineOff:IS,databaseOutlineRemove:FS,codeBrackets:NS,toggleSwitchOutline:F2,toggleSwitchOffOutline:H2,null:w2,string:MS,number:S2,cloudUpload:OS,chat:SS,creation:kS,viewDashboard:W2,rocketLaunch:R2,lightningBolt:f2,stop:$2,arrowUp:mS},_E="gs-cmp-icon",oe=fe(function({className:t,icon:n,size:s,rotate:r,horizontal:o,vertical:i}){const a=PE(),l=(a==null?void 0:a[n])||(Zl==null?void 0:Zl[n])||n,u=[o&&"scaleX(-1)",i&&"scaleY(-1)",r&&`rotate(${r}deg)`].filter(f=>!!f).join(" ");if(!l)return null;const d=N(_E,t);return l.startsWith("<svg")||l.startsWith("<?xml")?c.jsx(fv,{className:d,style:{transform:u||void 0},svg:l,iconSize:s}):c.jsx(Wi,{className:d,path:l,size:s,rotate:r,horizontal:o,vertical:i})}),tp=150,z={bgTr:"gs-utl-bg-transparent",txt:"gs-theme-cl-txt gs-utl-text-gray-900 dark:gs-utl-text-gray-400",txtLowEmphasis:"gs-utl-text-neutral-500 dark:gs-utl-text-neutral-500",txtHighEmphasis:"gs-utl-text-black dark:gs-utl-text-gray-200",txtHighEmphasisH:"hover:gs-utl-text-black hover:dark:gs-utl-text-gray-200",tA:"gs-theme-cl-tA gs-utl-text-violet-400",tAo:"gs-theme-cl-tAo gs-utl-text-violet-800 dark:gs-utl-text-violet-400",hTAo:"gs-theme-cl-hTAo hover:gs-utl-text-violet-800 hover:dark:gs-utl-text-violet-400",grouphTAo:"gs-theme-cl-grouphTAo group-hover:gs-utl-text-violet-800 group-hover:dark:gs-utl-text-violet-400",bA:"gs-theme-cl-bA gs-utl-border-violet-400",bgA:"gs-theme-cl-bgA gs-utl-bg-violet-400 gs-utl-text-white dark:gs-utl-bg-violet-500",bgA2:"gs-theme-cl-bgA2 gs-utl-bg-violet-500 gs-utl-text-white",bgO:"gs-theme-cl-bg0 gs-utl-bg-violet-50 gs-utl-text-violet-900 dark:gs-utl-bg-zinc-800 dark:gs-utl-text-violet-400",bg:"gs-theme-cl-bg gs-utl-bg-white dark:gs-utl-bg-zinc-900",bgBlur:"gs-utl-bg-white/50 dark:gs-utl-bg-zinc-900/50 gs-utl-backdrop-blur-sm",bgH:"gs-theme-cl-bgH gs-utl-bg-gray-100 dark:gs-utl-bg-zinc-700",bgH75:"gs-utl-bg-gray-100/75 dark:gs-utl-bg-zinc-700/75",bgH50:"gs-utl-bg-gray-100/50 dark:gs-utl-bg-zinc-700/50",bgH25:"gs-utl-bg-gray-100/25 dark:gs-utl-bg-zinc-700/25",hBgH:"gs-theme-cl-hBgH hover:gs-utl-bg-gray-50 hover:dark:gs-utl-bg-zinc-800",bgH2:"gs-theme-cl-bgH2 gs-utl-bg-gray-25 dark:gs-utl-bg-zinc-800",hBgH2:"gs-theme-cl-hBgH2 hover:gs-utl-bg-gray-25 hover:dark:gs-utl-bg-zinc-800",hBgAct:"gs-theme-cl-hBgAct hover:gs-utl-bg-violet-800 hover:dark:gs-utl-bg-violet-400",hBgA2:"gs-theme-cl-hBgA2 hover:gs-utl-bg-violet-500 hover:dark:gs-utl-bg-violet-600",hBgDark:"hover:gs-utl-bg-black/10",sel:"gs-theme-cl-sel gs-utl-bg-pink-200 gs-utl-text-pink-900",selBr:"gs-theme-cl-selBr gs-utl-border-pink-900",cmp:"gs-theme-cl-cmp gs-utl-bg-blue-450 gs-utl-text-white",cmpSymbol:"gs-theme-cl-cmpSymbol gs-utl-bg-[#7b61ff] gs-utl-text-white",cmpBgSoft:"gs-theme-cl-cmpBgSoft gs-utl-bg-blue-100 dark:gs-utl-bg-sky-800",cmpBgSymbolSoft:"gs-theme-cl-cmpBgSymbolSoft gs-utl-bg-violet-200 dark:gs-utl-bg-violet-800",cmpBgSoftX:"gs-theme-cl-cmpBgSoftX gs-utl-bg-blue-50 dark:gs-utl-bg-gray-800",cmpBgSymbolSoftX:"gs-theme-cl-cmpBgSymbolSoftX gs-utl-bg-[#edebff] dark:gs-utl-bg-[#2d1b4b]",cmpTxtActive:"gs-theme-cl-cmpTxtActive dark:gs-utl-text-gray-300",cmpBr:"gs-theme-cl-cmpBr gs-utl-border-blue-450",cmpSymbolBr:"gs-theme-cl-cmpSymbolBr gs-utl-border-[#7b61ff]",cmpTargetBg:"gs-utl-bg-amber-500 gs-utl-text-white",cmpTargetBgOpac:"gs-utl-bg-amber-500/5",cmpTargetBr:"gs-utl-border-amber-500",tW:"gs-utl-text-amber-500",tE:"gs-utl-text-red-500",tS:"gs-utl-text-green-500",boxWarn:"gs-utl-bg-amber-50 gs-utl-border-amber-200 gs-utl-text-amber-700 dark:gs-utl-bg-amber-200/10 dark:gs-utl-border-amber-200/20 dark:gs-utl-text-amber-100/80",boxSuccess:"gs-utl-bg-green-50 gs-utl-border-green-200 gs-utl-text-green-700 dark:gs-utl-bg-green-500/20 dark:gs-utl-border-green-500/20 dark:gs-utl-text-green-100/80",boxDanger:"gs-utl-bg-red-50 gs-utl-border-red-200 gs-utl-text-red-700 dark:gs-utl-bg-red-500/20 dark:gs-utl-border-red-500/20 dark:gs-utl-text-red-100/80",bgW:"gs-utl-bg-amber-500",bgRed:"gs-utl-bg-red-500",hBgRed:"hover:gs-utl-bg-red-600",hBgW:"hover:gs-utl-bg-amber-600",br:"gs-theme-cl-br gs-utl-border-gray-300 dark:gs-utl-border-zinc-700",brRed:"gs-utl-border-red-500",brLight:"gs-utl-border-white/25"},hv={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-scale-95 gs-utl-opacity-0",enterTo:"gs-utl-opacity-100",leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-scale-100 gs-utl-opacity-100",leaveTo:"gs-utl-scale-95 gs-utl-opacity-0"},TE={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-opacity-0",enterTo:"gs-utl-opacity-100"},OE={leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-opacity-100",leaveTo:"gs-utl-opacity-0"},AE={...TE,...OE},je={xy:"gs-utl-px-4 gs-utl-py-2",xyS:"gs-utl-px-2 gs-utl-py-1",xyS2:"gs-utl-px-2 gs-utl-py-0.5",x:"gs-utl-px-4",xS:"gs-utl-px-2",y:"gs-utl-py-2",s:"gs-utl-p-2",m:"gs-utl-p-4"},np={bg:z.bg,bgH:z.bgH},ug={bg:"gs-utl-bg-zinc-700",txt:"gs-utl-text-white",block:"gs-utl-text-xs gs-utl-mt-1 gs-utl-bg-white/10 gs-utl-rounded gs-utl-px-2 gs-utl-py-1"},re={rnd:"gs-utl-rounded",rndMd:"gs-utl-rounded-md",rndLg:"gs-utl-rounded-lg",pill:"gs-utl-rounded-full",b:"gs-utl-border",bT:"gs-utl-border-transparent",bS:"gs-utl-border-2",bt:"gs-utl-border-t",bb:"gs-utl-border-b",br:"gs-utl-border-r",bl:"gs-utl-border-l",none:"gs-utl-border-0",bA:"gs-theme-cl-bA gs-utl-border-violet-400 dark:gs-utl-border-violet-500"},pa={focus:"gs-theme-ring-focus focus:gs-utl-outline-none focus-visible:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80",deepFocus:"focus:gs-utl-outline-none [&:has(:focus-visible)]:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80"},le={s3x:"13px",s2x:"14px",sx:"16px",s:"18px",m:"20px",l:"22px"},Ee={click:"gs-utl-cursor-pointer gs-utl-transition-opacity gs-utl-opacity-75 hover:gs-utl-opacity-100",hover:"gs-utl-transition-opacity gs-utl-opacity-50 hover:gs-utl-opacity-100",hoverM:"gs-utl-transition-opacity gs-utl-opacity-80 hover:gs-utl-opacity-100",hoverGroup:"group-hover:gs-utl-opacity-100 gs-utl-opacity-0 gs-utl-transition-opacity",dot:"gs-utl-w-[6px] gs-utl-h-[6px] gs-utl-rounded-full",scrollX:"gs-utl-overflow-x-auto gs-utl-overflow-y-hidden",scrollY:"gs-utl-overflow-y-auto gs-utl-overflow-x-hidden",txtEllips:"gs-utl-text-ellipsis gs-utl-overflow-hidden gs-utl-whitespace-nowrap",coverAbs:"gs-utl-absolute gs-utl-top-0 gs-utl-left-0 gs-utl-w-full gs-utl-h-full",hiddenVisually:"gs-utl-w-[1px] gs-utl-h-[1px] gs-utl-opacity-[0.001]",disabled:"gs-utl-opacity-50 gs-utl-pointer-events-none",disabledM:"gs-utl-opacity-50 gs-utl-cursor-not-allowed",noFocusOut:"focus:gs-utl-outline-none",noResize:"gs-utl-resize-none",spin:"gs-utl-animate-spin-fast",bounce:"gs-utl-animate-bounce"},$r={link:z.tAo,inputText:"gs-theme-elStyles-inputText focus:gs-utl-outline-none gs-utl-placeholder:text-neutral-400 placeholder:dark:gs-utl-text-neutral-500"},cn={bold:"gs-utl-font-bold",semibold:"gs-utl-font-semibold",italic:"gs-utl-italic",mono:"gs-utl-font-mono"},kn={xs:"gs-utl-text-xs",sm:"gs-utl-text-sm",base:"gs-utl-text-base",lg:"gs-utl-text-lg",xl:"gs-utl-text-xl",xl2:"gs-utl-text-2xl"},Ks="gs-utl-my-2",NE="gs-utl-my-3",dg=` gs-utl-rounded ${kn.xs} ${cn.mono} ${z.bgH25}`,fg=`gs-utl-list-inside gs-utl-flex gs-utl-flex-col gs-utl-gap-1 ${Ks} gs-utl-ml-1`,Nt={h1:`${kn.xl2} ${cn.bold} ${NE}`,h2:`${kn.xl} ${cn.bold} ${Ks}`,h3:`${kn.lg} ${cn.semibold} ${Ks}`,h4:`${kn.base} ${cn.semibold} ${Ks}`,h5:`${kn.sm} ${cn.semibold} ${Ks}`,h6:`${kn.xs} ${cn.semibold} ${Ks}`,strong:cn.bold,em:cn.italic,ul:`gs-utl-list-disc ${fg}`,ol:`gs-utl-list-decimal ${fg}`,codeInline:`${dg} gs-utl-px-1 gs-utl-py-0.5`,pre:`${dg} gs-utl-p-3 gs-utl-overflow-x-auto ${Ks}`,blockquote:`gs-utl-border-l-4 gs-utl-pl-2 ${Ks} ${cn.italic}`,hr:"gs-utl-my-4 gs-utl-border-t",table:`gs-utl-w-full gs-utl-border-collapse ${Ks}`,thead:`${z.bgH2}`,tr:`gs-utl-border-b ${z.br}`,th:`gs-utl-px-3 gs-utl-py-2 gs-utl-text-left ${cn.semibold}`,td:"gs-utl-px-3 gs-utl-py-2"},hl={s:"gs-utl-size-5",m:"gs-utl-size-10"},sp={itemList:({index:e=0,open:t=!1,length:n=0}={})=>ee(z.bgH2,je.xyS,z.br,e&&re.bt,(t||e===n-1)&&re.bb)},gv=e=>({bg:e?"#18181b":"#f9f9f9",text:e?"#9ca3af":"#111827",link:e?"#a78bfa":"#5b21b6"}),mv=e=>{let t={isSymbol:!1,bg:z.cmp,bgSoft:`${z.cmpBgSoft} ${z.cmpTxtActive}`,bgSoftX:z.cmpBgSoftX,border:z.cmpBr,txt:""};if(!(e!=null&&e.em))return t;const{isSymbol:n}=e.em.Components.getSymbolInfo(e);return n&&(t={isSymbol:n,bg:z.cmpSymbol,bgSoft:`${z.cmpBgSymbolSoft} ${z.cmpTxtActive}`,bgSoftX:z.cmpBgSymbolSoftX,border:z.cmpSymbolBr,txt:""}),t},bv=({variant:e,size:t="m",className:n,disabledClassName:s,active:r,border:o=!0,rounded:i=!0,disabled:a=!1,withBg:l,block:u,full:d})=>{const f=e==="pr",p=e==="out",g=e==="out-clear",m=e==="warn",b=e==="danger",v=o&&(p||g||!e);return["gs-utl-transition-colors gs-utl-cursor-pointer",u&&"gs-utl-block",t==="x2s"&&"gs-utl-text-xs",t==="s"&&"gs-utl-p-1 gs-utl-text-sm",t==="m"&&"gs-utl-p-1 gs-utl-px-2",t==="m2"&&"gs-utl-p-1 gs-utl-px-3",t==="lg"&&"gs-utl-p-2 gs-utl-px-4 gs-utl-text-lg",n,i&&re.rnd,l&&z.bg,v?ee(re.b,z.br,p&&z.bA,p&&z.tAo,!a&&z.hBgH):ee(re.b,re.bT),m&&ee(z.bgW,!a&&z.hBgW,"gs-utl-text-white"),b&&ee(z.bgRed,!a&&z.hBgRed,"gs-utl-text-white"),f&&ee(z.bgA2,!a&&z.hBgAct),r&&z.bgA,a&&(s??"disabled:gs-utl-opacity-80 gs-utl-cursor-not-allowed"),d&&"gs-utl-w-full",pa.focus]};function Ke({children:e,...t}){const{variant:n,size:s,active:r,border:o,rounded:i,block:a,full:l,className:u,icon:d,loading:f,withBg:p,disabled:g,type:m="button",disabledClassName:b,...v}=t,x=f?{icon:h2,size:"18px",className:ee("animate-spin-fast")}:ot(d)?{icon:d,size:"18px"}:d;return c.jsx("button",{className:ee(bv(t)),disabled:g||f,type:m,...v,children:x?c.jsxs(k,{className:ee("gap-2"),items:"center",justify:"center",nowrap:!0,children:[c.jsx(D,{children:c.jsx(oe,{...x})}),e&&c.jsx(D,{children:e})]}):e})}const ME=[{id:"webHero"},{id:"webFeatures"},{id:"webContact"},{id:"webTestimonials"}],LE=[{id:"emailHeader"},{id:"emailCta"},{id:"emailFooter"},{id:"emailProduct"}],Do="gs-cmp-ai-chat-empty",RE=({className:e,style:t,chatContext:n,editor:s,suggestions:r})=>{const{sendMessage:o}=n,i="aiChat.emptyState",a=N(Do,e,"gs-utl-flex gs-utl-flex-col gs-utl-items-center gs-utl-justify-center gs-utl-h-full gs-utl-text-center gs-utl-p-6"),l=s.t(`${i}.title`),u=s.t(`${i}.subtitle`),d=kw(s)?LE:ME,f=r??d;return c.jsxs(k,{className:a,style:t,gap:"m",col:!0,nowrap:!0,children:[c.jsxs(k,{className:`${Do}__header`,gap:"xs",col:!0,children:[c.jsx("h3",{className:N(`${Do}__title`,"gs-utl-font-semibold"),children:l}),c.jsx("p",{className:N(`${Do}__subtitle`,z.txtLowEmphasis),children:u})]}),c.jsx(k,{col:!0,className:`${Do}__suggestions gs-utl-w-full gs-utl-max-w-xs`,gap:"s",children:f.map(p=>{const g=s.t(`${i}.suggestions.${p.id}`)||p.label,m=p.prompt??g;return c.jsx(Ke,{className:`${Do}__suggestion`,onClick:()=>o({text:m,metadata:{createdAt:Date.now()}}),variant:"out-clear",full:!0,children:g},p.id)})})]})},Li="gs-cmp-ai-chat-error",$E=({className:e,style:t,chatContext:n,editor:s})=>{var a;const r=N(Li,e,z.boxDanger,"gs-utl-p-2 gs-utl-border-t gs-utl-border-b"),o=`${Li}__message gs-utl-text-sm gs-utl-opacity-75 gs-utl-max-h-24 gs-utl-overflow-auto gs-utl-break-words gs-utl-max-w-full`;return c.jsxs(k,{className:r,style:t,gap:"xs",col:!0,children:[c.jsxs(k,{className:`${Li}__header`,items:"center",gap:"xs",children:[c.jsx(D,{className:`${Li}__header-title`,grow:!0,children:s.t("aiChat.error.title")}),c.jsx(Ke,{className:`${Li}__close`,onClick:()=>n.clearError(),size:"xs",border:!1,icon:"close"})]}),c.jsx(D,{className:o,grow:!0,children:(a=n.error)==null?void 0:a.message})]})},Hu="gs-cmp-ai-chat-header",kE=({className:e,chatContext:t,editor:n,...s})=>{const{messages:r,setMessages:o}=t,i=N(Hu,e,re.bb,z.br,je.s),a="aiChat.header";return c.jsxs(k,{className:i,items:"center",gap:"xs",...s,children:[c.jsx(D,{className:`${Hu}__title`,grow:!0,children:n.t(`${a}.title`)}),r.length>0&&c.jsx(Ke,{className:N(`${Hu}__btn-clear`,Ee.hover,re.none,je.xS),onClick:()=>o([]),size:"xs",border:!1,icon:"delete",children:n.t(`${a}.clear`)})]})};function Co({full:e,abs:t,small:n,size:s,className:r,bg:o,currentColor:i}){const a=N(e&&"gs-utl-w-full gs-utl-h-full",t?Ee.coverAbs:"gs-utl-relative",r),l=N(!s&&(n?"gs-utl-w-5 gs-utl-h-5":"gs-utl-w-10 gs-utl-h-10"),s==="x2s"&&"gs-utl-size-3",s==="xs"&&"gs-utl-size-4",s==="s"&&"gs-utl-size-6","gs-utl-animate-spin-fast","!gs-utl-border-y-transparent !gs-utl-border-r-transparent",re.pill,re.bS,i?"gs-utl-border-current":re.bA);return c.jsxs(k,{className:a,items:"center",justify:"center",children:[!!o&&c.jsx("div",{className:N(Ee.coverAbs,z.bg,Ee.disabled)}),c.jsx("div",{className:l})]})}function Ho(e,t,n){let s=n.initialDeps??[],r;return()=>{var o,i,a,l;let u;n.key&&((o=n.debug)!=null&&o.call(n))&&(u=Date.now());const d=e();if(!(d.length!==s.length||d.some((g,m)=>s[m]!==g)))return r;s=d;let p;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(p=Date.now()),r=t(...d),n.key&&((a=n.debug)!=null&&a.call(n))){const g=Math.round((Date.now()-u)*100)/100,m=Math.round((Date.now()-p)*100)/100,b=m/16,v=(x,y)=>{for(x=String(x);x.length<y;)x=" "+x;return x};console.info(`%c⏱ ${v(m,5)} /${v(g,5)} ms`,`
29
+ */var Ph;function Cj(){if(Ph)return bu;Ph=1;var e=f;function t(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(p,h){var g=h(),m=s({inst:{value:g,getSnapshot:h}}),b=m[0].inst,v=m[1];return o(function(){b.value=g,b.getSnapshot=h,c(b)&&v({inst:b})},[p,g,h]),r(function(){return c(b)&&v({inst:b}),p(function(){c(b)&&v({inst:b})})},[p]),i(g),g}function c(p){var h=p.getSnapshot;p=p.value;try{var g=h();return!n(p,g)}catch{return!0}}function u(p,h){return h()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return bu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,bu}Ob.exports=Cj();var jj=Ob.exports;function Th(e){e.reaction=new Zs("observer".concat(e.name),function(){var t;e.stateVersion=Symbol(),(t=e.onStoreChange)===null||t===void 0||t.call(e)})}function Ej(e,t){t===void 0&&(t="observed");var n=f.useRef(null);if(!n.current){var s={reaction:null,onStoreChange:null,stateVersion:Symbol(),name:t,subscribe:function(a){return Md.unregister(s),s.onStoreChange=a,s.reaction||(Th(s),s.stateVersion=Symbol()),function(){var c;s.onStoreChange=null,(c=s.reaction)===null||c===void 0||c.dispose(),s.reaction=null}},getSnapshot:function(){return s.stateVersion}};n.current=s}var r=n.current;r.reaction||(Th(r),Md.register(n,r,r)),f.useDebugValue(r.reaction,vj),jj.useSyncExternalStore(r.subscribe,r.getSnapshot,r.getSnapshot);var o,i;if(r.reaction.track(function(){try{o=e()}catch(a){i=a}}),i)throw i;return o}var vu,yu,_b=typeof Symbol=="function"&&Symbol.for,Pj=(yu=(vu=Object.getOwnPropertyDescriptor(function(){},"name"))===null||vu===void 0?void 0:vu.configurable)!==null&&yu!==void 0?yu:!1,Oh=_b?Symbol.for("react.forward_ref"):typeof f.forwardRef=="function"&&f.forwardRef(function(e){return null}).$$typeof,_h=_b?Symbol.for("react.memo"):typeof f.memo=="function"&&f.memo(function(e){return null}).$$typeof;function ae(e,t){var n;if(_h&&e.$$typeof===_h)throw new Error("[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.");var s=(n=void 0)!==null&&n!==void 0?n:!1,r=e,o=e.displayName||e.name;if(Oh&&e.$$typeof===Oh&&(s=!0,r=e.render,typeof r!="function"))throw new Error("[mobx-react-lite] `render` property of ForwardRef was not a function");var i=function(a,c){return Ej(function(){return r(a,c)},o)};return i.displayName=e.displayName,Pj&&Object.defineProperty(i,"name",{value:e.name,writable:!0,configurable:!0}),e.contextTypes&&(i.contextTypes=e.contextTypes),s&&(i=f.forwardRef(i)),i=f.memo(i),Oj(e,i),i}var Tj={$$typeof:!0,render:!0,compare:!0,type:!0,displayName:!0};function Oj(e,t){Object.keys(e).forEach(function(n){Tj[n]||Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}var xu;bj(Mn.unstable_batchedUpdates);xu=Md.finalizeAllImmediately;const Ah=new Map,_j=(e,t)=>`${t}-${e}`,Ab=f.forwardRef(function({svg:t,iconSize:n,...s},r){const o=_j(t,n);let i=Ah.get(o);return i||(i=kx(t,n),Ah.set(o,i)),l.jsx("div",{...s,ref:r,dangerouslySetInnerHTML:{__html:i}})});let Mb;const Aj=e=>{Mb=e},Mj=()=>Mb;var U=(e=>(e.alertRhombus="alertRhombus",e.alignHorizontalCenter="alignHorizontalCenter",e.alignHorizontalLeft="alignHorizontalLeft",e.alignHorizontalRight="alignHorizontalRight",e.applicationBracketsOutline="applicationBracketsOutline",e.arrowDown="arrowDown",e.arrowExpandAll="arrowExpandAll",e.arrowRight="arrowRight",e.arrowULeftTop="arrowULeftTop",e.arrowURightTop="arrowURightTop",e.borderAllVariant="borderAllVariant",e.borderRadius="borderRadius",e.borderStyle="borderStyle",e.calendar="calendar",e.cellphoneLink="cellphoneLink",e.check="check",e.checkBold="checkBold",e.checkboxBlank="checkboxBlank",e.chevronUp="chevronUp",e.chevronDown="chevronDown",e.chevronLeft="chevronLeft",e.chevronRight="chevronRight",e.close="close",e.codeBraces="codeBraces",e.cog="cog",e.contentCopy="contentCopy",e.contentSave="contentSave",e.delete="delete",e.dotsVertical="dotsVertical",e.email="email",e.emailOutline="emailOutline",e.eye="eye",e.eyedropperVariant="eyedropperVariant",e.eyeOff="eyeOff",e.eyeOffOutline="eyeOffOutline",e.eyeOutline="eyeOutline",e.fire="fire",e.flare="flare",e.floppy="floppy",e.folder="folder",e.fullscreen="fullscreen",e.gradientVertical="gradientVertical",e.helpCircle="helpCircle",e.home="home",e.image="image",e.information="information",e.informationVariant="informationVariant",e.layers="layers",e.link="link",e.lock="lock",e.lockOpenVariant="lockOpenVariant",e.menuDown="menuDown",e.newspaperVariantOutline="newspaperVariantOutline",e.openInNew="openInNew",e.paletteSwatch="paletteSwatch",e.panVertical="panVertical",e.pencil="pencil",e.phone="phone",e.plus="plus",e.plusBox="plusBox",e.powerPlug="powerPlug",e.refresh="refresh",e.rhombusOutline="rhombusOutline",e.rhombusSplit="rhombusSplit",e.rhombusSplitOutline="rhombusSplitOutline",e.tag="tag",e.target="target",e.targetVariant="targetVariant",e.textBoxMultiple="textBoxMultiple",e.trayArrowDown="trayArrowDown",e.unfoldLessHorizontal="unfoldLessHorizontal",e.unfoldMoreHorizontal="unfoldMoreHorizontal",e.viewDayOutline="viewDayOutline",e.viewGridPlus="viewGridPlus",e.web="web",e.xml="xml",e.database="database",e.databaseOutline="databaseOutline",e.databaseOutlineOn="databaseOutlineOn",e.databaseOutlineOff="databaseOutlineOff",e.databaseOutlineRemove="databaseOutlineRemove",e.toggleSwitchOutline="toggleSwitchOutline",e.toggleSwitchOffOutline="toggleSwitchOffOutline",e.codeBrackets="codeBrackets",e.null="null",e.codeString="string",e.number="number",e.cloudUpload="cloudUpload",e.chat="chat",e.creation="creation",e.viewDashboard="viewDashboard",e.rocketLaunch="rocketLaunch",e.lightningBolt="lightningBolt",e.stop="stop",e.arrowUp="arrowUp",e))(U||{});const Il={alertRhombus:Cw,alignHorizontalCenter:jw,alignHorizontalLeft:Ew,alignHorizontalRight:Pw,applicationBracketsOutline:Tw,arrowDown:Ow,arrowExpandAll:_w,arrowRight:Aw,arrowULeftTop:Mw,arrowURightTop:Lw,borderAllVariant:$w,borderRadius:kw,borderStyle:Rw,calendar:Iw,cellphoneLink:Vw,check:R1,checkBold:Dw,checkboxBlank:Fw,chevronUp:Ww,chevronDown:Bw,chevronLeft:zw,chevronRight:Uw,close:I1,codeBraces:qw,cog:Yw,contentCopy:Xw,contentSave:Jw,delete:oS,dotsVertical:iS,email:aS,emailOutline:lS,eye:cS,eyedropperVariant:fS,eyeOff:uS,eyeOffOutline:dS,eyeOutline:pS,fire:gS,flare:mS,floppy:bS,folder:vS,fullscreen:yS,gradientVertical:xS,helpCircle:wS,home:SS,image:CS,information:ES,informationVariant:PS,layers:TS,link:AS,lock:LS,lockOpenVariant:NS,menuDown:$S,newspaperVariantOutline:IS,openInNew:V1,paletteSwatch:DS,panVertical:FS,pencil:BS,phone:zS,plus:US,plusBox:WS,powerPlug:GS,refresh:qS,rhombusOutline:KS,rhombusSplit:ZS,rhombusSplitOutline:YS,tag:QS,target:e2,targetVariant:t2,textBoxMultiple:n2,trayArrowDown:o2,unfoldLessHorizontal:i2,unfoldMoreHorizontal:a2,viewDayOutline:c2,viewGridPlus:u2,web:d2,xml:p2,database:eS,databaseOutline:sS,databaseOutlineOn:nS,databaseOutlineOff:tS,databaseOutlineRemove:rS,codeBrackets:Kw,toggleSwitchOutline:r2,toggleSwitchOffOutline:s2,null:VS,string:Zw,number:HS,cloudUpload:Gw,chat:Hw,creation:Qw,viewDashboard:l2,rocketLaunch:XS,lightningBolt:_S,stop:JS,arrowUp:Nw},Lj="gs-cmp-icon",Q=ae(function({className:t,icon:n,size:s,rotate:r,horizontal:o,vertical:i}){const a=Mj(),c=(a==null?void 0:a[n])||(Il==null?void 0:Il[n])||n,u=[o&&"scaleX(-1)",i&&"scaleY(-1)",r&&`rotate(${r}deg)`].filter(p=>!!p).join(" ");if(!c)return null;const d=A(Lj,t);return c.startsWith("<svg")||c.startsWith("<?xml")?l.jsx(Ab,{className:d,style:{transform:u||void 0},svg:c,iconSize:s}):l.jsx(Li,{className:d,path:c,size:s,rotate:r,horizontal:o,vertical:i})}),Lp=150,B={bgTr:"gs-utl-bg-transparent",txt:"gs-theme-cl-txt gs-utl-text-gray-900 dark:gs-utl-text-gray-400",txtLowEmphasis:"gs-utl-text-neutral-500 dark:gs-utl-text-neutral-500",txtHighEmphasis:"gs-utl-text-black dark:gs-utl-text-gray-200",txtHighEmphasisH:"hover:gs-utl-text-black hover:dark:gs-utl-text-gray-200",tA:"gs-theme-cl-tA gs-utl-text-violet-400",tAo:"gs-theme-cl-tAo gs-utl-text-violet-800 dark:gs-utl-text-violet-400",hTAo:"gs-theme-cl-hTAo hover:gs-utl-text-violet-800 hover:dark:gs-utl-text-violet-400",grouphTAo:"gs-theme-cl-grouphTAo group-hover:gs-utl-text-violet-800 group-hover:dark:gs-utl-text-violet-400",bA:"gs-theme-cl-bA gs-utl-border-violet-400",bgA:"gs-theme-cl-bgA gs-utl-bg-violet-400 gs-utl-text-white dark:gs-utl-bg-violet-500",bgA2:"gs-theme-cl-bgA2 gs-utl-bg-violet-500 gs-utl-text-white",bgO:"gs-theme-cl-bg0 gs-utl-bg-violet-50 gs-utl-text-violet-900 dark:gs-utl-bg-zinc-800 dark:gs-utl-text-violet-400",bg:"gs-theme-cl-bg gs-utl-bg-white dark:gs-utl-bg-zinc-900",bgBlur:"gs-utl-bg-white/50 dark:gs-utl-bg-zinc-900/50 gs-utl-backdrop-blur-sm",bgH:"gs-theme-cl-bgH gs-utl-bg-gray-100 dark:gs-utl-bg-zinc-700",bgH75:"gs-utl-bg-gray-100/75 dark:gs-utl-bg-zinc-700/75",bgH50:"gs-utl-bg-gray-100/50 dark:gs-utl-bg-zinc-700/50",bgH25:"gs-utl-bg-gray-100/25 dark:gs-utl-bg-zinc-700/25",hBgH:"gs-theme-cl-hBgH hover:gs-utl-bg-gray-50 hover:dark:gs-utl-bg-zinc-800",bgH2:"gs-theme-cl-bgH2 gs-utl-bg-gray-25 dark:gs-utl-bg-zinc-800",hBgH2:"gs-theme-cl-hBgH2 hover:gs-utl-bg-gray-25 hover:dark:gs-utl-bg-zinc-800",hBgAct:"gs-theme-cl-hBgAct hover:gs-utl-bg-violet-800 hover:dark:gs-utl-bg-violet-400",hBgA2:"gs-theme-cl-hBgA2 hover:gs-utl-bg-violet-500 hover:dark:gs-utl-bg-violet-600",hBgDark:"hover:gs-utl-bg-black/10",sel:"gs-theme-cl-sel gs-utl-bg-pink-200 gs-utl-text-pink-900",selBr:"gs-theme-cl-selBr gs-utl-border-pink-900",cmp:"gs-theme-cl-cmp gs-utl-bg-blue-450 gs-utl-text-white",cmpSymbol:"gs-theme-cl-cmpSymbol gs-utl-bg-[#7b61ff] gs-utl-text-white",cmpBgSoft:"gs-theme-cl-cmpBgSoft gs-utl-bg-blue-100 dark:gs-utl-bg-sky-800",cmpBgSymbolSoft:"gs-theme-cl-cmpBgSymbolSoft gs-utl-bg-violet-200 dark:gs-utl-bg-violet-800",cmpBgSoftX:"gs-theme-cl-cmpBgSoftX gs-utl-bg-blue-50 dark:gs-utl-bg-gray-800",cmpBgSymbolSoftX:"gs-theme-cl-cmpBgSymbolSoftX gs-utl-bg-[#edebff] dark:gs-utl-bg-[#2d1b4b]",cmpTxtActive:"gs-theme-cl-cmpTxtActive dark:gs-utl-text-gray-300",cmpBr:"gs-theme-cl-cmpBr gs-utl-border-blue-450",cmpSymbolBr:"gs-theme-cl-cmpSymbolBr gs-utl-border-[#7b61ff]",cmpTargetBg:"gs-utl-bg-amber-500 gs-utl-text-white",cmpTargetBgOpac:"gs-utl-bg-amber-500/5",cmpTargetBr:"gs-utl-border-amber-500",tW:"gs-utl-text-amber-500",tE:"gs-utl-text-red-500",tS:"gs-utl-text-green-500",boxWarn:"gs-utl-bg-amber-50 gs-utl-border-amber-200 gs-utl-text-amber-700 dark:gs-utl-bg-amber-200/10 dark:gs-utl-border-amber-200/20 dark:gs-utl-text-amber-100/80",boxSuccess:"gs-utl-bg-green-50 gs-utl-border-green-200 gs-utl-text-green-700 dark:gs-utl-bg-green-500/20 dark:gs-utl-border-green-500/20 dark:gs-utl-text-green-100/80",boxDanger:"gs-utl-bg-red-50 gs-utl-border-red-200 gs-utl-text-red-700 dark:gs-utl-bg-red-500/20 dark:gs-utl-border-red-500/20 dark:gs-utl-text-red-100/80",bgW:"gs-utl-bg-amber-500",bgRed:"gs-utl-bg-red-500",hBgRed:"hover:gs-utl-bg-red-600",hBgW:"hover:gs-utl-bg-amber-600",br:"gs-theme-cl-br gs-utl-border-gray-300 dark:gs-utl-border-zinc-700",brRed:"gs-utl-border-red-500",brLight:"gs-utl-border-white/25"},Lb={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-scale-95 gs-utl-opacity-0",enterTo:"gs-utl-opacity-100",leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-scale-100 gs-utl-opacity-100",leaveTo:"gs-utl-scale-95 gs-utl-opacity-0"},Nj={enter:"gs-utl-transition gs-utl-duration-100 gs-utl-ease-out",enterFrom:"gs-utl-opacity-0",enterTo:"gs-utl-opacity-100"},$j={leave:"gs-utl-transition gs-utl-ease-in gs-utl-duration-100",leaveFrom:"gs-utl-opacity-100",leaveTo:"gs-utl-opacity-0"},kj={...Nj,...$j},we={xy:"gs-utl-px-4 gs-utl-py-2",xyS:"gs-utl-px-2 gs-utl-py-1",xyS2:"gs-utl-px-2 gs-utl-py-0.5",x:"gs-utl-px-4",xS:"gs-utl-px-2",y:"gs-utl-py-2",s:"gs-utl-p-2",m:"gs-utl-p-4"},Np={bg:B.bg,bgH:B.bgH},Mh={bg:"gs-utl-bg-zinc-700",txt:"gs-utl-text-white",block:"gs-utl-text-xs gs-utl-mt-1 gs-utl-bg-white/10 gs-utl-rounded gs-utl-px-2 gs-utl-py-1"},X={rnd:"gs-utl-rounded",rndMd:"gs-utl-rounded-md",rndLg:"gs-utl-rounded-lg",pill:"gs-utl-rounded-full",b:"gs-utl-border",bT:"gs-utl-border-transparent",bS:"gs-utl-border-2",bt:"gs-utl-border-t",bb:"gs-utl-border-b",br:"gs-utl-border-r",bl:"gs-utl-border-l",none:"gs-utl-border-0",bA:"gs-theme-cl-bA gs-utl-border-violet-400 dark:gs-utl-border-violet-500"},ta={focus:"gs-theme-ring-focus focus:gs-utl-outline-none focus-visible:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80",deepFocus:"focus:gs-utl-outline-none [&:has(:focus-visible)]:gs-utl-ring-2 gs-utl-ring-violet-300 gs-utl-ring-opacity-80"},oe={s3x:"13px",s2x:"14px",sx:"16px",s:"18px",m:"20px",l:"22px"},Se={click:"gs-utl-cursor-pointer gs-utl-transition-opacity gs-utl-opacity-75 hover:gs-utl-opacity-100",hover:"gs-utl-transition-opacity gs-utl-opacity-50 hover:gs-utl-opacity-100",hoverM:"gs-utl-transition-opacity gs-utl-opacity-80 hover:gs-utl-opacity-100",hoverGroup:"group-hover:gs-utl-opacity-100 gs-utl-opacity-0 gs-utl-transition-opacity",dot:"gs-utl-w-[6px] gs-utl-h-[6px] gs-utl-rounded-full",scrollX:"gs-utl-overflow-x-auto gs-utl-overflow-y-hidden",scrollY:"gs-utl-overflow-y-auto gs-utl-overflow-x-hidden",txtEllips:"gs-utl-text-ellipsis gs-utl-overflow-hidden gs-utl-whitespace-nowrap",coverAbs:"gs-utl-absolute gs-utl-top-0 gs-utl-left-0 gs-utl-w-full gs-utl-h-full",hiddenVisually:"gs-utl-w-[1px] gs-utl-h-[1px] gs-utl-opacity-[0.001]",disabled:"gs-utl-opacity-50 gs-utl-pointer-events-none",disabledM:"gs-utl-opacity-50 gs-utl-cursor-not-allowed",noFocusOut:"focus:gs-utl-outline-none",noResize:"gs-utl-resize-none",spin:"gs-utl-animate-spin-fast",bounce:"gs-utl-animate-bounce"},Er={link:B.tAo,inputText:"gs-theme-elStyles-inputText focus:gs-utl-outline-none gs-utl-placeholder:text-neutral-400 placeholder:dark:gs-utl-text-neutral-500"},rn={bold:"gs-utl-font-bold",semibold:"gs-utl-font-semibold",italic:"gs-utl-italic",mono:"gs-utl-font-mono"},On={xs:"gs-utl-text-xs",sm:"gs-utl-text-sm",base:"gs-utl-text-base",lg:"gs-utl-text-lg",xl:"gs-utl-text-xl",xl2:"gs-utl-text-2xl"},Vs="gs-utl-my-2",Rj="gs-utl-my-3",Lh=` gs-utl-rounded ${On.xs} ${rn.mono} ${B.bgH25}`,Nh=`gs-utl-list-inside gs-utl-flex gs-utl-flex-col gs-utl-gap-1 ${Vs} gs-utl-ml-1`,Ot={h1:`${On.xl2} ${rn.bold} ${Rj}`,h2:`${On.xl} ${rn.bold} ${Vs}`,h3:`${On.lg} ${rn.semibold} ${Vs}`,h4:`${On.base} ${rn.semibold} ${Vs}`,h5:`${On.sm} ${rn.semibold} ${Vs}`,h6:`${On.xs} ${rn.semibold} ${Vs}`,strong:rn.bold,em:rn.italic,ul:`gs-utl-list-disc ${Nh}`,ol:`gs-utl-list-decimal ${Nh}`,codeInline:`${Lh} gs-utl-px-1 gs-utl-py-0.5`,pre:`${Lh} gs-utl-p-3 gs-utl-overflow-x-auto ${Vs}`,blockquote:`gs-utl-border-l-4 gs-utl-pl-2 ${Vs} ${rn.italic}`,hr:"gs-utl-my-4 gs-utl-border-t",table:`gs-utl-w-full gs-utl-border-collapse ${Vs}`,thead:`${B.bgH2}`,tr:`gs-utl-border-b ${B.br}`,th:`gs-utl-px-3 gs-utl-py-2 gs-utl-text-left ${rn.semibold}`,td:"gs-utl-px-3 gs-utl-py-2"},tl={s:"gs-utl-size-5",m:"gs-utl-size-10"},$p={itemList:({index:e=0,open:t=!1,length:n=0}={})=>K(B.bgH2,we.xyS,B.br,e&&X.bt,(t||e===n-1)&&X.bb)},Nb=e=>({bg:e?"#18181b":"#f9f9f9",text:e?"#9ca3af":"#111827",link:e?"#a78bfa":"#5b21b6"}),$b=e=>{let t={isSymbol:!1,bg:B.cmp,bgSoft:`${B.cmpBgSoft} ${B.cmpTxtActive}`,bgSoftX:B.cmpBgSoftX,border:B.cmpBr,txt:""};if(!(e!=null&&e.em))return t;const{isSymbol:n}=e.em.Components.getSymbolInfo(e);return n&&(t={isSymbol:n,bg:B.cmpSymbol,bgSoft:`${B.cmpBgSymbolSoft} ${B.cmpTxtActive}`,bgSoftX:B.cmpBgSymbolSoftX,border:B.cmpSymbolBr,txt:""}),t},kb=({variant:e,size:t="m",className:n,disabledClassName:s,active:r,border:o=!0,rounded:i=!0,disabled:a=!1,withBg:c,block:u,full:d})=>{const p=e==="pr",h=e==="out",g=e==="out-clear",m=e==="warn",b=e==="danger",v=o&&(h||g||!e);return["gs-utl-transition-colors gs-utl-cursor-pointer",u&&"gs-utl-block",t==="x2s"&&"gs-utl-text-xs",t==="s"&&"gs-utl-p-1 gs-utl-text-sm",t==="m"&&"gs-utl-p-1 gs-utl-px-2",t==="m2"&&"gs-utl-p-1 gs-utl-px-3",t==="lg"&&"gs-utl-p-2 gs-utl-px-4 gs-utl-text-lg",n,i&&X.rnd,c&&B.bg,v?K(X.b,B.br,h&&B.bA,h&&B.tAo,!a&&B.hBgH):K(X.b,X.bT),m&&K(B.bgW,!a&&B.hBgW,"gs-utl-text-white"),b&&K(B.bgRed,!a&&B.hBgRed,"gs-utl-text-white"),p&&K(B.bgA2,!a&&B.hBgAct),r&&B.bgA,a&&(s??"disabled:gs-utl-opacity-80 gs-utl-cursor-not-allowed"),d&&"gs-utl-w-full",ta.focus]};function Ge({children:e,...t}){const{variant:n,size:s,active:r,border:o,rounded:i,block:a,full:c,className:u,icon:d,loading:p,withBg:h,disabled:g,type:m="button",disabledClassName:b,...v}=t,x=p?{icon:MS,size:"18px",className:K("animate-spin-fast")}:nt(d)?{icon:d,size:"18px"}:d;return l.jsx("button",{className:K(kb(t)),disabled:g||p,type:m,...v,children:x?l.jsxs(k,{className:K("gap-2"),items:"center",justify:"center",nowrap:!0,children:[l.jsx(V,{children:l.jsx(Q,{...x})}),e&&l.jsx(V,{children:e})]}):e})}const Ij=[{id:"webHero"},{id:"webFeatures"},{id:"webContact"},{id:"webTestimonials"}],Vj=[{id:"emailHeader"},{id:"emailCta"},{id:"emailFooter"},{id:"emailProduct"}],Ao="gs-cmp-ai-chat-empty",Hj=({className:e,style:t,chatContext:n,editor:s,suggestions:r})=>{const{sendMessage:o}=n,i="aiChat.emptyState",a=A(Ao,e,"gs-utl-flex gs-utl-flex-col gs-utl-items-center gs-utl-justify-center gs-utl-h-full gs-utl-text-center gs-utl-p-6"),c=s.t(`${i}.title`),u=s.t(`${i}.subtitle`),d=Qx(s)?Vj:Ij,p=r??d;return l.jsxs(k,{className:a,style:t,gap:"m",col:!0,nowrap:!0,children:[l.jsxs(k,{className:`${Ao}__header`,gap:"xs",col:!0,children:[l.jsx("h3",{className:A(`${Ao}__title`,"gs-utl-font-semibold"),children:c}),l.jsx("p",{className:A(`${Ao}__subtitle`,B.txtLowEmphasis),children:u})]}),l.jsx(k,{col:!0,className:`${Ao}__suggestions gs-utl-w-full gs-utl-max-w-xs`,gap:"s",children:p.map(h=>{const g=s.t(`${i}.suggestions.${h.id}`)||h.label,m=h.prompt??g;return l.jsx(Ge,{className:`${Ao}__suggestion`,onClick:()=>o({text:m,metadata:{createdAt:Date.now()}}),variant:"out-clear",full:!0,children:g},h.id)})})]})},yi="gs-cmp-ai-chat-error",Dj=({className:e,style:t,chatContext:n,editor:s})=>{var a;const r=A(yi,e,B.boxDanger,"gs-utl-p-2 gs-utl-border-t gs-utl-border-b"),o=`${yi}__message gs-utl-text-sm gs-utl-opacity-75 gs-utl-max-h-24 gs-utl-overflow-auto gs-utl-break-words gs-utl-max-w-full`;return l.jsxs(k,{className:r,style:t,gap:"xs",col:!0,children:[l.jsxs(k,{className:`${yi}__header`,items:"center",gap:"xs",children:[l.jsx(V,{className:`${yi}__header-title`,grow:!0,children:s.t("aiChat.error.title")}),l.jsx(Ge,{className:`${yi}__close`,onClick:()=>n.clearError(),size:"xs",border:!1,icon:"close"})]}),l.jsx(V,{className:o,grow:!0,children:(a=n.error)==null?void 0:a.message})]})},wu="gs-cmp-ai-chat-header",Fj=({className:e,chatContext:t,editor:n,...s})=>{const{messages:r,setMessages:o}=t,i=A(wu,e,X.bb,B.br,we.s),a="aiChat.header";return l.jsxs(k,{className:i,items:"center",gap:"xs",...s,children:[l.jsx(V,{className:`${wu}__title`,grow:!0,children:n.t(`${a}.title`)}),r.length>0&&l.jsx(Ge,{className:A(`${wu}__btn-clear`,Se.hover,X.none,we.xS),onClick:()=>o([]),size:"xs",border:!1,icon:"delete",children:n.t(`${a}.clear`)})]})};function ho({full:e,abs:t,small:n,size:s,className:r,bg:o,currentColor:i}){const a=A(e&&"gs-utl-w-full gs-utl-h-full",t?Se.coverAbs:"gs-utl-relative",r),c=A(!s&&(n?"gs-utl-w-5 gs-utl-h-5":"gs-utl-w-10 gs-utl-h-10"),s==="x2s"&&"gs-utl-size-3",s==="xs"&&"gs-utl-size-4",s==="s"&&"gs-utl-size-6","gs-utl-animate-spin-fast","!gs-utl-border-y-transparent !gs-utl-border-r-transparent",X.pill,X.bS,i?"gs-utl-border-current":X.bA);return l.jsxs(k,{className:a,items:"center",justify:"center",children:[!!o&&l.jsx("div",{className:A(Se.coverAbs,B.bg,Se.disabled)}),l.jsx("div",{className:c})]})}function Mo(e,t,n){let s=n.initialDeps??[],r;return()=>{var o,i,a,c;let u;n.key&&((o=n.debug)!=null&&o.call(n))&&(u=Date.now());const d=e();if(!(d.length!==s.length||d.some((g,m)=>s[m]!==g)))return r;s=d;let h;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(h=Date.now()),r=t(...d),n.key&&((a=n.debug)!=null&&a.call(n))){const g=Math.round((Date.now()-u)*100)/100,m=Math.round((Date.now()-h)*100)/100,b=m/16,v=(x,y)=>{for(x=String(x);x.length<y;)x=" "+x;return x};console.info(`%c⏱ ${v(m,5)} /${v(g,5)} ms`,`
84
30
  font-size: .6rem;
85
31
  font-weight: bold;
86
- color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,r),r}}function Fu(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const VE=(e,t)=>Math.abs(e-t)<1,IE=(e,t,n)=>{let s;return function(...r){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,r),n)}};var Fo={};const DE=e=>e,HE=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),s=[];for(let r=t;r<=n;r++)s.push(r);return s},FE=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const r=i=>{const{width:a,height:l}=i;t({width:Math.round(a),height:Math.round(l)})};if(r(n.getBoundingClientRect()),!s.ResizeObserver)return()=>{};const o=new s.ResizeObserver(i=>{const a=i[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){r({width:l.inlineSize,height:l.blockSize});return}}r(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},pg={passive:!0},BE=typeof window>"u"?!0:"onscrollend"in window,zE=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;let r=0;const o=BE?()=>{}:IE(s,()=>{t(r,!1)},e.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:d,isRtl:f}=e.options;r=d?n.scrollLeft*(f&&-1||1):n.scrollTop,o(),t(r,u)},a=i(!0),l=i(!1);return l(),n.addEventListener("scroll",a,pg),n.addEventListener("scrollend",l,pg),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},UE=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const s=t.borderBoxSize[0];if(s)return Math.round(s[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},WE=(e,{adjustments:t=0,behavior:n},s)=>{var r,o;const i=e+t;(o=(r=s.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[s.options.horizontal?"left":"top"]:i,behavior:n})};class GE{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const s=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var r;(r=s())==null||r.disconnect(),n=null},observe:r=>{var o;return(o=s())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=s())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([s,r])=>{typeof r>"u"&&delete n[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:DE,rangeExtractor:HE,onChange:()=>{},measureElement:UE,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,...n}},this.notify=n=>{var s,r;(r=(s=this.options).onChange)==null||r.call(s,this,n)},this.maybeNotify=Ho(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:Fo.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,s)=>{const r=new Map,o=new Map;for(let i=s-1;i>=0;i--){const a=n[i];if(r.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Ho(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,s,r,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:s,scrollMargin:r,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=Ho(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:s,scrollMargin:r,getItemKey:o,enabled:i},a)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let d=l;d<n;d++){const f=o(d),p=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d),g=p?p.end+this.options.gap:s+r,m=a.get(f),b=typeof m=="number"?m:this.options.estimateSize(d),v=g+b,x=p?p.lane:d%this.options.lanes;u[d]={index:d,start:g,size:b,end:v,key:f,lane:x}}return this.measurementsCache=u,u},{key:Fo.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ho(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,s,r)=>this.range=n.length>0&&s>0?qE({measurements:n,outerSize:s,scrollOffset:r}):null,{key:Fo.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=Ho(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,s,r,o)=>s===null?[]:n({startIndex:s.startIndex,endIndex:s.endIndex,overscan:r,count:o}),{key:Fo.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const s=this.options.indexAttribute,r=n.getAttribute(s);return r?parseInt(r,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(n,s)=>{const r=this.indexFromElement(n),o=this.measurementsCache[r];if(!o)return;const i=o.key,a=this.elementsCache.get(i);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,s,this))},this.resizeItem=(n,s)=>{const r=this.measurementsCache[n];if(!r)return;const o=this.itemSizeCache.get(r.key)??r.size,i=s-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&(Fo.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,s)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,r)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=Ho(()=>[this.getIndexes(),this.getMeasurements()],(n,s)=>{const r=[];for(let o=0,i=n.length;o<i;o++){const a=n[o],l=s[a];r.push(l)}return r},{key:Fo.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const s=this.getMeasurements();if(s.length!==0)return Fu(s[vv(0,s.length-1,r=>Fu(s[r]).start,n)])},this.getOffsetForAlignment=(n,s)=>{const r=this.getSize(),o=this.getScrollOffset();s==="auto"&&(n<=o?s="start":n>=o+r?s="end":s="start"),s==="start"?n=n:s==="end"?n=n-r:s==="center"&&(n=n-r/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-r;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,s="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const o=this.getSize(),i=this.getScrollOffset();if(s==="auto")if(r.end>=i+o-this.options.scrollPaddingEnd)s="end";else if(r.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];const a=s==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:s="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,s),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:s="auto",behavior:r}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(n,s);if(!o)return;const[i,a]=o;this._scrollToOffset(i,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[u]=Fu(this.getOffsetForIndex(n,a));VE(u,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:r})}else this.scrollToIndex(n,{align:a,behavior:r})}))},this.scrollBy=(n,{behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var n;const s=this.getMeasurements();let r;return s.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((n=s[s.length-1])==null?void 0:n.end)??0:Math.max(...s.slice(-this.options.lanes).map(o=>o.end)),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:s,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const vv=(e,t,n,s)=>{for(;e<=t;){const r=(e+t)/2|0,o=n(r);if(o<s)e=r+1;else if(o>s)t=r-1;else return r}return e>0?e-1:0};function qE({measurements:e,outerSize:t,scrollOffset:n}){const s=e.length-1,o=vv(0,s,a=>e[a].start,n);let i=o;for(;i<s&&e[i].end<n+t;)i++;return{startIndex:o,endIndex:i}}const KE=typeof document<"u"?et.useLayoutEffect:et.useEffect;function YE(e){const t=et.useReducer(()=>({}),{})[1],n={...e,onChange:(r,o)=>{var i;o?Dn.flushSync(t):t(),(i=e.onChange)==null||i.call(e,r,o)}},[s]=et.useState(()=>new GE(n));return s.setOptions(n),et.useEffect(()=>s._didMount(),[]),KE(()=>s._willUpdate()),s}function ZE(e){return YE({observeElementRect:FE,observeElementOffset:zE,scrollToFn:WE,...e})}var XE=Object.defineProperty,JE=(e,t,n)=>t in e?XE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Bu=(e,t,n)=>(JE(e,typeof t!="symbol"?t+"":t,n),n);let QE=class{constructor(){Bu(this,"current",this.detect()),Bu(this,"handoffState","pending"),Bu(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},nr=new QE,ze=(e,t)=>{nr.isServer?h.useEffect(e,t):h.useLayoutEffect(e,t)};function Mt(e){let t=h.useRef(e);return ze(()=>{t.current=e},[e]),t}function Ia(e,t){let[n,s]=h.useState(e),r=Mt(e);return ze(()=>s(r.current),[r,s,...t]),n}let ae=function(e){let t=Mt(e);return h.useCallback((...n)=>t.current(...n),[t])};function Vc(e,t,n){let[s,r]=h.useState(n),o=e!==void 0,i=h.useRef(o),a=h.useRef(!1),l=h.useRef(!1);return o&&!i.current&&!a.current?(a.current=!0,i.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&i.current&&!l.current&&(l.current=!0,i.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:s,ae(u=>(o||r(u),t==null?void 0:t(u)))]}function rp(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function $s(){let e=[],t={addEventListener(n,s,r,o){return n.addEventListener(s,r,o),t.add(()=>n.removeEventListener(s,r,o))},requestAnimationFrame(...n){let s=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(s))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let s=setTimeout(...n);return t.add(()=>clearTimeout(s))},microTask(...n){let s={current:!0};return rp(()=>{s.current&&n[0]()}),t.add(()=>{s.current=!1})},style(n,s,r){let o=n.style.getPropertyValue(s);return Object.assign(n.style,{[s]:r}),this.add(()=>{Object.assign(n.style,{[s]:o})})},group(n){let s=$s();return n(s),this.add(()=>s.dispose())},add(n){return e.push(n),()=>{let s=e.indexOf(n);if(s>=0)for(let r of e.splice(s,1))r()}},dispose(){for(let n of e.splice(0))n()}};return t}function as(){let[e]=h.useState($s);return h.useEffect(()=>()=>e.dispose(),[e]),e}function eP(){let e=typeof document>"u";return"useSyncExternalStore"in et?(t=>t.useSyncExternalStore)(et)(()=>()=>{},()=>!1,()=>!e):!1}function Ic(){let e=eP(),[t,n]=et.useState(nr.isHandoffComplete);return t&&nr.isHandoffComplete===!1&&n(!1),et.useEffect(()=>{t!==!0&&n(!0)},[t]),et.useEffect(()=>nr.handoff(),[]),e?!1:t}var hg;let xt=(hg=h.useId)!=null?hg:function(){let e=Ic(),[t,n]=h.useState(e?()=>nr.nextId():null);return ze(()=>{t===null&&n(nr.nextId())},[t]),t!=null?""+t:void 0};function Le(e,t,...n){if(e in t){let r=t[e];return typeof r=="function"?r(...n):r}let s=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,Le),s}function Ur(e){return nr.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Jd=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ct=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ct||{}),As=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(As||{}),tP=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(tP||{});function Dc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Jd)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Hc=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Hc||{});function op(e,t=0){var n;return e===((n=Ur(e))==null?void 0:n.body)?!1:Le(t,{0(){return e.matches(Jd)},1(){let s=e;for(;s!==null;){if(s.matches(Jd))return!0;s=s.parentElement}return!1}})}var nP=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(nP||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let sP=["textarea","input"].join(",");function rP(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,sP))!=null?n:!1}function Js(e,t=n=>n){return e.slice().sort((n,s)=>{let r=t(n),o=t(s);if(r===null||o===null)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function tn(e,t,{sorted:n=!0,relativeTo:s=null,skipElements:r=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?Js(e):e:Dc(e);r.length>0&&i.length>1&&(i=i.filter(g=>!r.includes(g))),s=s??o.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(s))-1;if(t&4)return Math.max(0,i.indexOf(s))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,f=i.length,p;do{if(d>=f||d+f<=0)return 0;let g=l+d;if(t&16)g=(g+f)%f;else{if(g<0)return 3;if(g>=f)return 1}p=i[g],p==null||p.focus(u),d+=a}while(p!==o.activeElement);return t&6&&rP(p)&&p.select(),2}function oP(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function iP(){return/Android/gi.test(window.navigator.userAgent)}function yv(){return oP()||iP()}function gl(e,t,n){let s=Mt(t);h.useEffect(()=>{function r(o){s.current(o)}return document.addEventListener(e,r,n),()=>document.removeEventListener(e,r,n)},[e,n])}function xv(e,t,n){let s=Mt(t);h.useEffect(()=>{function r(o){s.current(o)}return window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)},[e,n])}function ip(e,t,n=!0){let s=h.useRef(!1);h.useEffect(()=>{requestAnimationFrame(()=>{s.current=n})},[n]);function r(i,a){if(!s.current||i.defaultPrevented)return;let l=a(i);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let u=function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let d of u){if(d===null)continue;let f=d instanceof HTMLElement?d:d.current;if(f!=null&&f.contains(l)||i.composed&&i.composedPath().includes(f))return}return!op(l,Hc.Loose)&&l.tabIndex!==-1&&i.preventDefault(),t(i,l)}let o=h.useRef(null);gl("pointerdown",i=>{var a,l;s.current&&(o.current=((l=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:l[0])||i.target)},!0),gl("mousedown",i=>{var a,l;s.current&&(o.current=((l=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:l[0])||i.target)},!0),gl("click",i=>{yv()||o.current&&(r(i,()=>o.current),o.current=null)},!0),gl("touchend",i=>r(i,()=>i.target instanceof HTMLElement?i.target:null),!0),xv("blur",i=>r(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Mo(...e){return h.useMemo(()=>Ur(...e),[...e])}function gg(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Ci(e,t){let[n,s]=h.useState(()=>gg(e));return ze(()=>{s(gg(e))},[e.type,e.as]),ze(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&s("button")},[n,t]),n}let wv=Symbol();function ap(e,t=!0){return Object.assign(e,{[wv]:t})}function Ue(...e){let t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]);let n=ae(s=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(s):r.current=s)});return e.every(s=>s==null||(s==null?void 0:s[wv]))?void 0:n}function mg(e){return[e.screenX,e.screenY]}function Sv(){let e=h.useRef([-1,-1]);return{wasMoved(t){let n=mg(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=mg(t)}}}function Cv({container:e,accept:t,walk:n,enabled:s=!0}){let r=h.useRef(t),o=h.useRef(n);h.useEffect(()=>{r.current=t,o.current=n},[t,n]),ze(()=>{if(!e||!s)return;let i=Ur(e);if(!i)return;let a=r.current,l=o.current,u=Object.assign(f=>a(f),{acceptNode:a}),d=i.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)l(d.currentNode)},[e,s,r,o])}function bg(e,t){let n=h.useRef([]),s=ae(e);h.useEffect(()=>{let r=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let a=s(t,r);return n.current=t,a}},[s,...t])}function fc(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var gn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(gn||{}),_r=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(_r||{});function De({ourProps:e,theirProps:t,slot:n,defaultTag:s,features:r,visible:o=!0,name:i,mergeRefs:a}){a=a??aP;let l=jv(t,e);if(o)return ml(l,n,s,i,a);let u=r??0;if(u&2){let{static:d=!1,...f}=l;if(d)return ml(f,n,s,i,a)}if(u&1){let{unmount:d=!0,...f}=l;return Le(d?0:1,{0(){return null},1(){return ml({...f,hidden:!0,style:{display:"none"}},n,s,i,a)}})}return ml(l,n,s,i,a)}function ml(e,t={},n,s,r){let{as:o=n,children:i,refName:a="ref",...l}=zu(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let p=!1,g=[];for(let[m,b]of Object.entries(t))typeof b=="boolean"&&(p=!0),b===!0&&g.push(m);p&&(f["data-headlessui-state"]=g.join(" "))}if(o===h.Fragment&&Object.keys(di(l)).length>0){if(!h.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${s} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(b=>` - ${b}`).join(`
32
+ color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,r),r}}function Su(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Bj=(e,t)=>Math.abs(e-t)<1,zj=(e,t,n)=>{let s;return function(...r){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,r),n)}};var xi={NODE_ENV:"production"};const Uj=e=>e,Wj=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),s=[];for(let r=t;r<=n;r++)s.push(r);return s},Gj=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const r=i=>{const{width:a,height:c}=i;t({width:Math.round(a),height:Math.round(c)})};if(r(n.getBoundingClientRect()),!s.ResizeObserver)return()=>{};const o=new s.ResizeObserver(i=>{const a=i[0];if(a!=null&&a.borderBoxSize){const c=a.borderBoxSize[0];if(c){r({width:c.inlineSize,height:c.blockSize});return}}r(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},$h={passive:!0},qj=typeof window>"u"?!0:"onscrollend"in window,Kj=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;let r=0;const o=qj?()=>{}:zj(s,()=>{t(r,!1)},e.options.isScrollingResetDelay),i=u=>()=>{const{horizontal:d,isRtl:p}=e.options;r=d?n.scrollLeft*(p&&-1||1):n.scrollTop,o(),t(r,u)},a=i(!0),c=i(!1);return c(),n.addEventListener("scroll",a,$h),n.addEventListener("scrollend",c,$h),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",c)}},Zj=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const s=t.borderBoxSize[0];if(s)return Math.round(s[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Yj=(e,{adjustments:t=0,behavior:n},s)=>{var r,o;const i=e+t;(o=(r=s.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[s.options.horizontal?"left":"top"]:i,behavior:n})};class Xj{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const s=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{this._measureElement(o.target,o)})}));return{disconnect:()=>{var r;(r=s())==null||r.disconnect(),n=null},observe:r=>{var o;return(o=s())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=s())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([s,r])=>{typeof r>"u"&&delete n[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Uj,rangeExtractor:Wj,onChange:()=>{},measureElement:Zj,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,...n}},this.notify=n=>{var s,r;(r=(s=this.options).onChange)==null||r.call(s,this,n)},this.maybeNotify=Mo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:xi.NODE_ENV!=="production",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,s)=>{const r=new Map,o=new Map;for(let i=s-1;i>=0;i--){const a=n[i];if(r.has(a.lane))continue;const c=o.get(a.lane);if(c==null||a.end>c.end?o.set(a.lane,a):a.end<c.end&&r.set(a.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Mo(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,s,r,o,i)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:s,scrollMargin:r,getItemKey:o,enabled:i}),{key:!1}),this.getMeasurements=Mo(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:s,scrollMargin:r,getItemKey:o,enabled:i},a)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,c);for(let d=c;d<n;d++){const p=o(d),h=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d),g=h?h.end+this.options.gap:s+r,m=a.get(p),b=typeof m=="number"?m:this.options.estimateSize(d),v=g+b,x=h?h.lane:d%this.options.lanes;u[d]={index:d,start:g,size:b,end:v,key:p,lane:x}}return this.measurementsCache=u,u},{key:xi.NODE_ENV!=="production",debug:()=>this.options.debug}),this.calculateRange=Mo(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,s,r)=>this.range=n.length>0&&s>0?Jj({measurements:n,outerSize:s,scrollOffset:r}):null,{key:xi.NODE_ENV!=="production",debug:()=>this.options.debug}),this.getIndexes=Mo(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,s,r,o)=>s===null?[]:n({startIndex:s.startIndex,endIndex:s.endIndex,overscan:r,count:o}),{key:xi.NODE_ENV!=="production",debug:()=>this.options.debug}),this.indexFromElement=n=>{const s=this.options.indexAttribute,r=n.getAttribute(s);return r?parseInt(r,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(n,s)=>{const r=this.indexFromElement(n),o=this.measurementsCache[r];if(!o)return;const i=o.key,a=this.elementsCache.get(i);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(i,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,s,this))},this.resizeItem=(n,s)=>{const r=this.measurementsCache[n];if(!r)return;const o=this.itemSizeCache.get(r.key)??r.size,i=s-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,i,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,s)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,r)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=Mo(()=>[this.getIndexes(),this.getMeasurements()],(n,s)=>{const r=[];for(let o=0,i=n.length;o<i;o++){const a=n[o],c=s[a];r.push(c)}return r},{key:xi.NODE_ENV!=="production",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const s=this.getMeasurements();if(s.length!==0)return Su(s[Rb(0,s.length-1,r=>Su(s[r]).start,n)])},this.getOffsetForAlignment=(n,s)=>{const r=this.getSize(),o=this.getScrollOffset();s==="auto"&&(n<=o?s="start":n>=o+r?s="end":s="start"),s==="start"?n=n:s==="end"?n=n-r:s==="center"&&(n=n-r/2);const i=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[i]:this.scrollElement[i]:0)-r;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,s="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const o=this.getSize(),i=this.getScrollOffset();if(s==="auto")if(r.end>=i+o-this.options.scrollPaddingEnd)s="end";else if(r.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];const a=s==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:s="start",behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,s),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:s="auto",behavior:r}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const o=this.getOffsetForIndex(n,s);if(!o)return;const[i,a]=o;this._scrollToOffset(i,{adjustments:void 0,behavior:r}),r!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[u]=Su(this.getOffsetForIndex(n,a));Bj(u,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:r})}else this.scrollToIndex(n,{align:a,behavior:r})}))},this.scrollBy=(n,{behavior:s}={})=>{this.cancelScrollToIndex(),s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var n;const s=this.getMeasurements();let r;return s.length===0?r=this.options.paddingStart:r=this.options.lanes===1?((n=s[s.length-1])==null?void 0:n.end)??0:Math.max(...s.slice(-this.options.lanes).map(o=>o.end)),Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:s,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const Rb=(e,t,n,s)=>{for(;e<=t;){const r=(e+t)/2|0,o=n(r);if(o<s)e=r+1;else if(o>s)t=r-1;else return r}return e>0?e-1:0};function Jj({measurements:e,outerSize:t,scrollOffset:n}){const s=e.length-1,o=Rb(0,s,a=>e[a].start,n);let i=o;for(;i<s&&e[i].end<n+t;)i++;return{startIndex:o,endIndex:i}}const Qj=typeof document<"u"?Xe.useLayoutEffect:Xe.useEffect;function e5(e){const t=Xe.useReducer(()=>({}),{})[1],n={...e,onChange:(r,o)=>{var i;o?Mn.flushSync(t):t(),(i=e.onChange)==null||i.call(e,r,o)}},[s]=Xe.useState(()=>new Xj(n));return s.setOptions(n),Xe.useEffect(()=>s._didMount(),[]),Qj(()=>s._willUpdate()),s}function t5(e){return e5({observeElementRect:Gj,observeElementOffset:Kj,scrollToFn:Yj,...e})}var n5=Object.defineProperty,s5=(e,t,n)=>t in e?n5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cu=(e,t,n)=>(s5(e,typeof t!="symbol"?t+"":t,n),n);let r5=class{constructor(){Cu(this,"current",this.detect()),Cu(this,"handoffState","pending"),Cu(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},qs=new r5,De=(e,t)=>{qs.isServer?f.useEffect(e,t):f.useLayoutEffect(e,t)};function _t(e){let t=f.useRef(e);return De(()=>{t.current=e},[e]),t}function Ta(e,t){let[n,s]=f.useState(e),r=_t(e);return De(()=>s(r.current),[r,s,...t]),n}let re=function(e){let t=_t(e);return f.useCallback((...n)=>t.current(...n),[t])};function Sc(e,t,n){let[s,r]=f.useState(n),o=e!==void 0,i=f.useRef(o),a=f.useRef(!1),c=f.useRef(!1);return o&&!i.current&&!a.current?(a.current=!0,i.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&i.current&&!c.current&&(c.current=!0,i.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:s,re(u=>(o||r(u),t==null?void 0:t(u)))]}function kp(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Es(){let e=[],t={addEventListener(n,s,r,o){return n.addEventListener(s,r,o),t.add(()=>n.removeEventListener(s,r,o))},requestAnimationFrame(...n){let s=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(s))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let s=setTimeout(...n);return t.add(()=>clearTimeout(s))},microTask(...n){let s={current:!0};return kp(()=>{s.current&&n[0]()}),t.add(()=>{s.current=!1})},style(n,s,r){let o=n.style.getPropertyValue(s);return Object.assign(n.style,{[s]:r}),this.add(()=>{Object.assign(n.style,{[s]:o})})},group(n){let s=Es();return n(s),this.add(()=>s.dispose())},add(n){return e.push(n),()=>{let s=e.indexOf(n);if(s>=0)for(let r of e.splice(s,1))r()}},dispose(){for(let n of e.splice(0))n()}};return t}function Jn(){let[e]=f.useState(Es);return f.useEffect(()=>()=>e.dispose(),[e]),e}function o5(){let e=typeof document>"u";return"useSyncExternalStore"in Xe?(t=>t.useSyncExternalStore)(Xe)(()=>()=>{},()=>!1,()=>!e):!1}function Cc(){let e=o5(),[t,n]=Xe.useState(qs.isHandoffComplete);return t&&qs.isHandoffComplete===!1&&n(!1),Xe.useEffect(()=>{t!==!0&&n(!0)},[t]),Xe.useEffect(()=>qs.handoff(),[]),e?!1:t}var kh;let bt=(kh=f.useId)!=null?kh:function(){let e=Cc(),[t,n]=f.useState(e?()=>qs.nextId():null);return De(()=>{t===null&&n(qs.nextId())},[t]),t!=null?""+t:void 0};function _e(e,t,...n){if(e in t){let r=t[e];return typeof r=="function"?r(...n):r}let s=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(r=>`"${r}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(s,_e),s}function kr(e){return qs.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Ld=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var xt=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(xt||{}),ys=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ys||{}),i5=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(i5||{});function jc(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ld)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ec=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ec||{});function Rp(e,t=0){var n;return e===((n=kr(e))==null?void 0:n.body)?!1:_e(t,{0(){return e.matches(Ld)},1(){let s=e;for(;s!==null;){if(s.matches(Ld))return!0;s=s.parentElement}return!1}})}var a5=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(a5||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let l5=["textarea","input"].join(",");function c5(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,l5))!=null?n:!1}function Bs(e,t=n=>n){return e.slice().sort((n,s)=>{let r=t(n),o=t(s);if(r===null||o===null)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Xt(e,t,{sorted:n=!0,relativeTo:s=null,skipElements:r=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?Bs(e):e:jc(e);r.length>0&&i.length>1&&(i=i.filter(g=>!r.includes(g))),s=s??o.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(s))-1;if(t&4)return Math.max(0,i.indexOf(s))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=t&32?{preventScroll:!0}:{},d=0,p=i.length,h;do{if(d>=p||d+p<=0)return 0;let g=c+d;if(t&16)g=(g+p)%p;else{if(g<0)return 3;if(g>=p)return 1}h=i[g],h==null||h.focus(u),d+=a}while(h!==o.activeElement);return t&6&&c5(h)&&h.select(),2}function u5(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function d5(){return/Android/gi.test(window.navigator.userAgent)}function Ib(){return u5()||d5()}function nl(e,t,n){let s=_t(t);f.useEffect(()=>{function r(o){s.current(o)}return document.addEventListener(e,r,n),()=>document.removeEventListener(e,r,n)},[e,n])}function Vb(e,t,n){let s=_t(t);f.useEffect(()=>{function r(o){s.current(o)}return window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)},[e,n])}function Ip(e,t,n=!0){let s=f.useRef(!1);f.useEffect(()=>{requestAnimationFrame(()=>{s.current=n})},[n]);function r(i,a){if(!s.current||i.defaultPrevented)return;let c=a(i);if(c===null||!c.getRootNode().contains(c)||!c.isConnected)return;let u=function d(p){return typeof p=="function"?d(p()):Array.isArray(p)||p instanceof Set?p:[p]}(e);for(let d of u){if(d===null)continue;let p=d instanceof HTMLElement?d:d.current;if(p!=null&&p.contains(c)||i.composed&&i.composedPath().includes(p))return}return!Rp(c,Ec.Loose)&&c.tabIndex!==-1&&i.preventDefault(),t(i,c)}let o=f.useRef(null);nl("pointerdown",i=>{var a,c;s.current&&(o.current=((c=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:c[0])||i.target)},!0),nl("mousedown",i=>{var a,c;s.current&&(o.current=((c=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:c[0])||i.target)},!0),nl("click",i=>{Ib()||o.current&&(r(i,()=>o.current),o.current=null)},!0),nl("touchend",i=>r(i,()=>i.target instanceof HTMLElement?i.target:null),!0),Vb("blur",i=>r(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function So(...e){return f.useMemo(()=>kr(...e),[...e])}function Rh(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function ui(e,t){let[n,s]=f.useState(()=>Rh(e));return De(()=>{s(Rh(e))},[e.type,e.as]),De(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&s("button")},[n,t]),n}let Hb=Symbol();function Vp(e,t=!0){return Object.assign(e,{[Hb]:t})}function Fe(...e){let t=f.useRef(e);f.useEffect(()=>{t.current=e},[e]);let n=re(s=>{for(let r of t.current)r!=null&&(typeof r=="function"?r(s):r.current=s)});return e.every(s=>s==null||(s==null?void 0:s[Hb]))?void 0:n}function Ih(e){return[e.screenX,e.screenY]}function Db(){let e=f.useRef([-1,-1]);return{wasMoved(t){let n=Ih(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Ih(t)}}}function Fb({container:e,accept:t,walk:n,enabled:s=!0}){let r=f.useRef(t),o=f.useRef(n);f.useEffect(()=>{r.current=t,o.current=n},[t,n]),De(()=>{if(!e||!s)return;let i=kr(e);if(!i)return;let a=r.current,c=o.current,u=Object.assign(p=>a(p),{acceptNode:a}),d=i.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)c(d.currentNode)},[e,s,r,o])}function Vh(e,t){let n=f.useRef([]),s=re(e);f.useEffect(()=>{let r=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let a=s(t,r);return n.current=t,a}},[s,...t])}function Jl(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var un=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(un||{}),br=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(br||{});function $e({ourProps:e,theirProps:t,slot:n,defaultTag:s,features:r,visible:o=!0,name:i,mergeRefs:a}){a=a??p5;let c=Bb(t,e);if(o)return sl(c,n,s,i,a);let u=r??0;if(u&2){let{static:d=!1,...p}=c;if(d)return sl(p,n,s,i,a)}if(u&1){let{unmount:d=!0,...p}=c;return _e(d?0:1,{0(){return null},1(){return sl({...p,hidden:!0,style:{display:"none"}},n,s,i,a)}})}return sl(c,n,s,i,a)}function sl(e,t={},n,s,r){let{as:o=n,children:i,refName:a="ref",...c}=ju(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=typeof i=="function"?i(t):i;"className"in c&&c.className&&typeof c.className=="function"&&(c.className=c.className(t));let p={};if(t){let h=!1,g=[];for(let[m,b]of Object.entries(t))typeof b=="boolean"&&(h=!0),b===!0&&g.push(m);h&&(p["data-headlessui-state"]=g.join(" "))}if(o===f.Fragment&&Object.keys(Jo(c)).length>0){if(!f.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${s} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(c).map(b=>` - ${b}`).join(`
87
33
  `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(`
88
34
  `)].join(`
89
- `));let p=d.props,g=typeof(p==null?void 0:p.className)=="function"?(...b)=>fc(p==null?void 0:p.className(...b),l.className):fc(p==null?void 0:p.className,l.className),m=g?{className:g}:{};return h.cloneElement(d,Object.assign({},jv(d.props,di(zu(l,["ref"]))),f,u,{ref:r(d.ref,u.ref)},m))}return h.createElement(o,Object.assign({},zu(l,["ref"]),o!==h.Fragment&&u,o!==h.Fragment&&f),d)}function lp(){let e=h.useRef([]),t=h.useCallback(n=>{for(let s of e.current)s!=null&&(typeof s=="function"?s(n):s.current=n)},[]);return(...n)=>{if(!n.every(s=>s==null))return e.current=n,t}}function aP(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function jv(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let s of e)for(let r in s)r.startsWith("on")&&typeof s[r]=="function"?(n[r]!=null||(n[r]=[]),n[r].push(s[r])):t[r]=s[r];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(s=>[s,void 0])));for(let s in n)Object.assign(t,{[s](r,...o){let i=n[s];for(let a of i){if((r instanceof Event||(r==null?void 0:r.nativeEvent)instanceof Event)&&r.defaultPrevented)return;a(r,...o)}}});return t}function He(e){var t;return Object.assign(h.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function di(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function zu(e,t=[]){let n=Object.assign({},e);for(let s of t)s in n&&delete n[s];return n}let lP="div";var ls=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(ls||{});function cP(e,t){var n;let{features:s=1,...r}=e,o={ref:t,"aria-hidden":(s&2)===2?!0:(n=r["aria-hidden"])!=null?n:void 0,hidden:(s&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(s&4)===4&&(s&2)!==2&&{display:"none"}}};return De({ourProps:o,theirProps:r,slot:{},defaultTag:lP,name:"Hidden"})}let cs=He(cP),cp=h.createContext(null);cp.displayName="OpenClosedContext";var dt=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(dt||{});function Lo(){return h.useContext(cp)}function Da({value:e,children:t}){return h.createElement(cp.Provider,{value:e},t)}function uP(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let oo=[];uP(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&oo[0]!==t.target&&(oo.unshift(t.target),oo=oo.filter(n=>n!=null&&n.isConnected),oo.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function kr(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let s=(t==null?void 0:t.getAttribute("disabled"))==="";return s&&dP(n)?!1:s}function dP(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function fP(e){throw new Error("Unexpected object: "+e)}var Ge=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ge||{});function Qd(e,t){let n=t.resolveItems();if(n.length<=0)return null;let s=t.resolveActiveIndex(),r=s??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 1:{for(let o=r-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 2:{for(let o=r+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return s}case 5:return null;default:fP(e)}}function Fc(e={},t=null,n=[]){for(let[s,r]of Object.entries(e))Pv(n,Ev(t,s),r);return n}function Ev(e,t){return e?e+"["+t+"]":t}function Pv(e,t,n){if(Array.isArray(n))for(let[s,r]of n.entries())Pv(e,Ev(t,s.toString()),r);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Fc(n,t,e)}function _v(e){var t,n;let s=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(s){for(let r of s.elements)if(r!==e&&(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image")){r.click();return}(n=s.requestSubmit)==null||n.call(s)}}var ve=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ve||{}),pP={},hP=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(hP||{}),gP=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(gP||{}),mP=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(mP||{}),bP=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(bP||{});function Uu(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,s=t(e.options.slice()),r=s.length>0&&s[0].dataRef.current.order!==null?s.sort((i,a)=>i.dataRef.current.order-a.dataRef.current.order):Js(s,i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let vP={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let s=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(s!==-1)return{...e,activeOptionIndex:s,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,s,r,o,i;if((n=e.dataRef.current)!=null&&n.disabled||(s=e.dataRef.current)!=null&&s.optionsRef.current&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===Ge.Specific?t.idx:Qd(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var p,g;return(g=(p=e.activeOptionIndex)!=null?p:e.virtual.options.findIndex(m=>!e.virtual.disabled(m)))!=null?g:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f}}let a=Uu(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===Ge.Specific?t.idx:Qd(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),u=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===l&&e.activationTrigger===u?e:{...e,...a,activeOptionIndex:l,activationTrigger:u}},3:(e,t)=>{var n,s,r;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,i=Uu(e,l=>(l.push(o),l));e.activeOptionIndex===null&&(s=e.dataRef.current)!=null&&s.isSelected(t.payload.dataRef.current.value)&&(i.activeOptionIndex=i.options.indexOf(o));let a={...e,...i,activationTrigger:2};return(r=e.dataRef.current)!=null&&r.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(r=>r.id!==t.id)};let s=Uu(e,r=>{let o=r.findIndex(i=>i.id===t.id);return o!==-1&&r.splice(o,1),r});return{...e,...s,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let s=e.activeOptionIndex;if(e.activeOptionIndex!==null){let r=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);r!==-1?s=r:s=null}return{...e,activeOptionIndex:s,virtual:Object.assign({},e.virtual,{options:t.options})}}},up=h.createContext(null);up.displayName="ComboboxActionsContext";function Ha(e){let t=h.useContext(up);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ha),n}return t}let Tv=h.createContext(null);function yP(e){var t;let n=Ro("VirtualProvider"),[s,r]=h.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let u=window.getComputedStyle(l);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[n.optionsRef.current]),o=ZE({scrollPaddingStart:s,scrollPaddingEnd:r,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[i,a]=h.useState(0);return ze(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),h.createElement(Tv.Provider,{value:o},h.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&pP.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&o.scrollToIndex(n.activeOptionIndex)}}},o.getVirtualItems().map(l=>{var u;return h.createElement(h.Fragment,{key:l.key},h.cloneElement((u=e.children)==null?void 0:u.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${i}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let dp=h.createContext(null);dp.displayName="ComboboxDataContext";function Ro(e){let t=h.useContext(dp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ro),n}return t}function xP(e,t){return Le(t.type,vP,e,t)}let wP=h.Fragment;function SP(e,t){let{value:n,defaultValue:s,onChange:r,form:o,name:i,by:a=null,disabled:l=!1,__demoMode:u=!1,nullable:d=!1,multiple:f=!1,immediate:p=!1,virtual:g=null,...m}=e,b=!1,v=null,[x=f?[]:void 0,y]=Vc(n,r,s),[w,S]=h.useReducer(xP,{dataRef:h.createRef(),comboboxState:u?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),C=h.useRef(!1),j=h.useRef({static:!1,hold:!1}),E=h.useRef(null),_=h.useRef(null),T=h.useRef(null),P=h.useRef(null),A=ae(typeof a=="string"?(Q,se)=>{let de=a;return(Q==null?void 0:Q[de])===(se==null?void 0:se[de])}:a??((Q,se)=>Q===se)),M=ae(Q=>w.options.findIndex(se=>A(se.dataRef.current.value,Q))),R=h.useCallback(Q=>Le(L.mode,{1:()=>x.some(se=>A(se,Q)),0:()=>A(x,Q)}),[x]),F=ae(Q=>w.activeOptionIndex===M(Q)),L=h.useMemo(()=>({...w,immediate:b,optionsPropsRef:j,labelRef:E,inputRef:_,buttonRef:T,optionsRef:P,value:x,defaultValue:s,disabled:l,mode:f?1:0,virtual:w.virtual,get activeOptionIndex(){if(C.current&&w.activeOptionIndex===null&&w.options.length>0){let Q=w.options.findIndex(se=>!se.dataRef.current.disabled);if(Q!==-1)return Q}return w.activeOptionIndex},calculateIndex:M,compare:A,isSelected:R,isActive:F,nullable:d,__demoMode:u}),[x,s,l,f,d,u,w,v]);ze(()=>{},[v,void 0]),ze(()=>{w.dataRef.current=L},[L]),ip([L.buttonRef,L.inputRef,L.optionsRef],()=>K.closeCombobox(),L.comboboxState===0);let B=h.useMemo(()=>{var Q,se,de;return{open:L.comboboxState===0,disabled:l,activeIndex:L.activeOptionIndex,activeOption:L.activeOptionIndex===null?null:L.virtual?L.virtual.options[(Q=L.activeOptionIndex)!=null?Q:0]:(de=(se=L.options[L.activeOptionIndex])==null?void 0:se.dataRef.current.value)!=null?de:null,value:x}},[L,l,x]),q=ae(()=>{if(L.activeOptionIndex!==null){if(L.virtual)G(L.virtual.options[L.activeOptionIndex]);else{let{dataRef:Q}=L.options[L.activeOptionIndex];G(Q.current.value)}K.goToOption(Ge.Specific,L.activeOptionIndex)}}),H=ae(()=>{S({type:0}),C.current=!0}),$=ae(()=>{S({type:1}),C.current=!1}),I=ae((Q,se,de)=>(C.current=!1,Q===Ge.Specific?S({type:2,focus:Ge.Specific,idx:se,trigger:de}):S({type:2,focus:Q,trigger:de}))),O=ae((Q,se)=>(S({type:3,payload:{id:Q,dataRef:se}}),()=>{L.isActive(se.current.value)&&(C.current=!0),S({type:4,id:Q})})),V=ae(Q=>(S({type:5,id:Q}),()=>S({type:5,id:null}))),G=ae(Q=>Le(L.mode,{0(){return y==null?void 0:y(Q)},1(){let se=L.value.slice(),de=se.findIndex(Se=>A(Se,Q));return de===-1?se.push(Q):se.splice(de,1),y==null?void 0:y(se)}})),W=ae(Q=>{S({type:6,trigger:Q})}),K=h.useMemo(()=>({onChange:G,registerOption:O,registerLabel:V,goToOption:I,closeCombobox:$,openCombobox:H,setActivationTrigger:W,selectActiveOption:q}),[]),J=t===null?{}:{ref:t},Y=h.useRef(null),U=as();return h.useEffect(()=>{Y.current&&s!==void 0&&U.addEventListener(Y.current,"reset",()=>{y==null||y(s)})},[Y,y]),h.createElement(up.Provider,{value:K},h.createElement(dp.Provider,{value:L},h.createElement(Da,{value:Le(L.comboboxState,{0:dt.Open,1:dt.Closed})},i!=null&&x!=null&&Fc({[i]:x}).map(([Q,se],de)=>h.createElement(cs,{features:ls.Hidden,ref:de===0?Se=>{var ne;Y.current=(ne=Se==null?void 0:Se.closest("form"))!=null?ne:null}:void 0,...di({key:Q,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,disabled:l,name:Q,value:se})})),De({ourProps:J,theirProps:m,slot:B,defaultTag:wP,name:"Combobox"}))))}let CP="input";function jP(e,t){var n,s,r,o,i;let a=xt(),{id:l=`headlessui-combobox-input-${a}`,onChange:u,displayValue:d,type:f="text",...p}=e,g=Ro("Combobox.Input"),m=Ha("Combobox.Input"),b=Ue(g.inputRef,t),v=Mo(g.inputRef),x=h.useRef(!1),y=as(),w=ae(()=>{m.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),m.goToOption(Ge.Nothing)}),S=function(){var L;return typeof d=="function"&&g.value!==void 0?(L=d(g.value))!=null?L:"":typeof g.value=="string"?g.value:""}();bg(([L,B],[q,H])=>{if(x.current)return;let $=g.inputRef.current;$&&((H===0&&B===1||L!==q)&&($.value=L),requestAnimationFrame(()=>{if(x.current||!$||(v==null?void 0:v.activeElement)!==$)return;let{selectionStart:I,selectionEnd:O}=$;Math.abs((O??0)-(I??0))===0&&I===0&&$.setSelectionRange($.value.length,$.value.length)}))},[S,g.comboboxState,v]),bg(([L],[B])=>{if(L===0&&B===1){if(x.current)return;let q=g.inputRef.current;if(!q)return;let H=q.value,{selectionStart:$,selectionEnd:I,selectionDirection:O}=q;q.value="",q.value=H,O!==null?q.setSelectionRange($,I,O):q.setSelectionRange($,I)}},[g.comboboxState]);let C=h.useRef(!1),j=ae(()=>{C.current=!0}),E=ae(()=>{y.nextFrame(()=>{C.current=!1})}),_=ae(L=>{switch(x.current=!0,L.key){case ve.Enter:if(x.current=!1,g.comboboxState!==0||C.current)return;if(L.preventDefault(),L.stopPropagation(),g.activeOptionIndex===null){m.closeCombobox();return}m.selectActiveOption(),g.mode===0&&m.closeCombobox();break;case ve.ArrowDown:return x.current=!1,L.preventDefault(),L.stopPropagation(),Le(g.comboboxState,{0:()=>m.goToOption(Ge.Next),1:()=>m.openCombobox()});case ve.ArrowUp:return x.current=!1,L.preventDefault(),L.stopPropagation(),Le(g.comboboxState,{0:()=>m.goToOption(Ge.Previous),1:()=>{m.openCombobox(),y.nextFrame(()=>{g.value||m.goToOption(Ge.Last)})}});case ve.Home:if(L.shiftKey)break;return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ge.First);case ve.PageUp:return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ge.First);case ve.End:if(L.shiftKey)break;return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ge.Last);case ve.PageDown:return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ge.Last);case ve.Escape:return x.current=!1,g.comboboxState!==0?void 0:(L.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&L.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&w(),m.closeCombobox());case ve.Tab:if(x.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&m.selectActiveOption(),m.closeCombobox();break}}),T=ae(L=>{u==null||u(L),g.nullable&&g.mode===0&&L.target.value===""&&w(),m.openCombobox()}),P=ae(L=>{var B,q,H;let $=(B=L.relatedTarget)!=null?B:oo.find(I=>I!==L.currentTarget);if(x.current=!1,!((q=g.optionsRef.current)!=null&&q.contains($))&&!((H=g.buttonRef.current)!=null&&H.contains($))&&g.comboboxState===0)return L.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?w():g.activationTrigger!==1&&m.selectActiveOption()),m.closeCombobox()}),A=ae(L=>{var B,q,H;let $=(B=L.relatedTarget)!=null?B:oo.find(I=>I!==L.currentTarget);(q=g.buttonRef.current)!=null&&q.contains($)||(H=g.optionsRef.current)!=null&&H.contains($)||g.disabled||g.immediate&&g.comboboxState!==0&&(m.openCombobox(),y.nextFrame(()=>{m.setActivationTrigger(1)}))}),M=Ia(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),R=h.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),F={ref:b,id:l,role:"combobox",type:f,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(s=g.options.find(L=>{var B;return!((B=g.virtual)!=null&&B.disabled(L.dataRef.current.value))&&g.compare(L.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:s.id:(r=g.options[g.activeOptionIndex])==null?void 0:r.id,"aria-labelledby":M,"aria-autocomplete":"list",defaultValue:(i=(o=e.defaultValue)!=null?o:g.defaultValue!==void 0?d==null?void 0:d(g.defaultValue):null)!=null?i:g.defaultValue,disabled:g.disabled,onCompositionStart:j,onCompositionEnd:E,onKeyDown:_,onChange:T,onFocus:A,onBlur:P};return De({ourProps:F,theirProps:p,slot:R,defaultTag:CP,name:"Combobox.Input"})}let EP="button";function PP(e,t){var n;let s=Ro("Combobox.Button"),r=Ha("Combobox.Button"),o=Ue(s.buttonRef,t),i=xt(),{id:a=`headlessui-combobox-button-${i}`,...l}=e,u=as(),d=ae(b=>{switch(b.key){case ve.ArrowDown:return b.preventDefault(),b.stopPropagation(),s.comboboxState===1&&r.openCombobox(),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case ve.ArrowUp:return b.preventDefault(),b.stopPropagation(),s.comboboxState===1&&(r.openCombobox(),u.nextFrame(()=>{s.value||r.goToOption(Ge.Last)})),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case ve.Escape:return s.comboboxState!==0?void 0:(b.preventDefault(),s.optionsRef.current&&!s.optionsPropsRef.current.static&&b.stopPropagation(),r.closeCombobox(),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})}));default:return}}),f=ae(b=>{if(kr(b.currentTarget))return b.preventDefault();s.comboboxState===0?r.closeCombobox():(b.preventDefault(),r.openCombobox()),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})})}),p=Ia(()=>{if(s.labelId)return[s.labelId,a].join(" ")},[s.labelId,a]),g=h.useMemo(()=>({open:s.comboboxState===0,disabled:s.disabled,value:s.value}),[s]),m={ref:o,id:a,type:Ci(e,s.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=s.optionsRef.current)==null?void 0:n.id,"aria-expanded":s.comboboxState===0,"aria-labelledby":p,disabled:s.disabled,onClick:f,onKeyDown:d};return De({ourProps:m,theirProps:l,slot:g,defaultTag:EP,name:"Combobox.Button"})}let _P="label";function TP(e,t){let n=xt(),{id:s=`headlessui-combobox-label-${n}`,...r}=e,o=Ro("Combobox.Label"),i=Ha("Combobox.Label"),a=Ue(o.labelRef,t);ze(()=>i.registerLabel(s),[s]);let l=ae(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),u=h.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return De({ourProps:{ref:a,id:s,onClick:l},theirProps:r,slot:u,defaultTag:_P,name:"Combobox.Label"})}let OP="ul",AP=gn.RenderStrategy|gn.Static;function NP(e,t){let n=xt(),{id:s=`headlessui-combobox-options-${n}`,hold:r=!1,...o}=e,i=Ro("Combobox.Options"),a=Ue(i.optionsRef,t),l=Lo(),u=l!==null?(l&dt.Open)===dt.Open:i.comboboxState===0;ze(()=>{var g;i.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[i.optionsPropsRef,e.static]),ze(()=>{i.optionsPropsRef.current.hold=r},[i.optionsPropsRef,r]),Cv({container:i.optionsRef.current,enabled:i.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let d=Ia(()=>{var g,m;return(m=i.labelId)!=null?m:(g=i.buttonRef.current)==null?void 0:g.id},[i.labelId,i.buttonRef.current]),f=h.useMemo(()=>({open:i.comboboxState===0,option:void 0}),[i]),p={"aria-labelledby":d,role:"listbox","aria-multiselectable":i.mode===1?!0:void 0,id:s,ref:a};return i.virtual&&i.comboboxState===0&&Object.assign(o,{children:h.createElement(yP,null,o.children)}),De({ourProps:p,theirProps:o,slot:f,defaultTag:OP,features:AP,visible:u,name:"Combobox.Options"})}let MP="li";function LP(e,t){var n;let s=xt(),{id:r=`headlessui-combobox-option-${s}`,disabled:o=!1,value:i,order:a=null,...l}=e,u=Ro("Combobox.Option"),d=Ha("Combobox.Option"),f=u.virtual?u.activeOptionIndex===u.calculateIndex(i):u.activeOptionIndex===null?!1:((n=u.options[u.activeOptionIndex])==null?void 0:n.id)===r,p=u.isSelected(i),g=h.useRef(null),m=Mt({disabled:o,value:i,domRef:g,order:a}),b=h.useContext(Tv),v=Ue(t,g,b?b.measureElement:null),x=ae(()=>d.onChange(i));ze(()=>d.registerOption(r,m),[m,r]);let y=h.useRef(!(u.virtual||u.__demoMode));ze(()=>{if(!u.virtual||!u.__demoMode)return;let P=$s();return P.requestAnimationFrame(()=>{y.current=!0}),P.dispose},[u.virtual,u.__demoMode]),ze(()=>{if(!y.current||u.comboboxState!==0||!f||u.activationTrigger===0)return;let P=$s();return P.requestAnimationFrame(()=>{var A,M;(M=(A=g.current)==null?void 0:A.scrollIntoView)==null||M.call(A,{block:"nearest"})}),P.dispose},[g,f,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let w=ae(P=>{var A;if(o||(A=u.virtual)!=null&&A.disabled(i))return P.preventDefault();x(),yv()||requestAnimationFrame(()=>{var M;return(M=u.inputRef.current)==null?void 0:M.focus({preventScroll:!0})}),u.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),S=ae(()=>{var P;if(o||(P=u.virtual)!=null&&P.disabled(i))return d.goToOption(Ge.Nothing);let A=u.calculateIndex(i);d.goToOption(Ge.Specific,A)}),C=Sv(),j=ae(P=>C.update(P)),E=ae(P=>{var A;if(!C.wasMoved(P)||o||(A=u.virtual)!=null&&A.disabled(i)||f)return;let M=u.calculateIndex(i);d.goToOption(Ge.Specific,M,0)}),_=ae(P=>{var A;C.wasMoved(P)&&(o||(A=u.virtual)!=null&&A.disabled(i)||f&&(u.optionsPropsRef.current.hold||d.goToOption(Ge.Nothing)))}),T=h.useMemo(()=>({active:f,selected:p,disabled:o}),[f,p,o]);return De({ourProps:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:w,onFocus:S,onPointerEnter:j,onMouseEnter:j,onPointerMove:E,onMouseMove:E,onPointerLeave:_,onMouseLeave:_},theirProps:l,slot:T,defaultTag:MP,name:"Combobox.Option"})}let RP=He(SP),$P=He(PP),kP=He(jP),VP=He(TP),IP=He(NP),DP=He(LP),Bo=Object.assign(RP,{Input:kP,Button:$P,Label:VP,Options:IP,Option:DP});function HP(e,t,n,s){let r=Mt(n);h.useEffect(()=>{e=e??window;function o(i){r.current(i)}return e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s)},[e,t,s])}function Bc(){let e=h.useRef(!1);return ze(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function FP(e){let t=ae(e),n=h.useRef(!1);h.useEffect(()=>(n.current=!1,()=>{n.current=!0,rp(()=>{n.current&&t()})}),[t])}var Qs=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Qs||{});function Ov(){let e=h.useRef(0);return xv("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}let BP=h.createContext(!1);function zP(){return h.useContext(BP)}function UP(e){let t=zP(),n=h.useContext(Av),s=Mo(e),[r,o]=h.useState(()=>{if(!t&&n!==null||nr.isServer)return null;let i=s==null?void 0:s.getElementById("headlessui-portal-root");if(i)return i;if(s===null)return null;let a=s.createElement("div");return a.setAttribute("id","headlessui-portal-root"),s.body.appendChild(a)});return h.useEffect(()=>{r!==null&&(s!=null&&s.body.contains(r)||s==null||s.body.appendChild(r))},[r,s]),h.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let WP=h.Fragment;function GP(e,t){let n=e,s=h.useRef(null),r=Ue(ap(d=>{s.current=d}),t),o=Mo(s),i=UP(s),[a]=h.useState(()=>{var d;return nr.isServer?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),l=h.useContext(ef),u=Ic();return ze(()=>{!i||!a||i.contains(a)||(a.setAttribute("data-headlessui-portal",""),i.appendChild(a))},[i,a]),ze(()=>{if(a&&l)return l.register(a)},[l,a]),FP(()=>{var d;!i||!a||(a instanceof Node&&i.contains(a)&&i.removeChild(a),i.childNodes.length<=0&&((d=i.parentElement)==null||d.removeChild(i)))}),u?!i||!a?null:Dn.createPortal(De({ourProps:{ref:r},theirProps:n,defaultTag:WP,name:"Portal"}),a):null}let qP=h.Fragment,Av=h.createContext(null);function KP(e,t){let{target:n,...s}=e,r={ref:Ue(t)};return h.createElement(Av.Provider,{value:n},De({ourProps:r,theirProps:s,defaultTag:qP,name:"Popover.Group"}))}let ef=h.createContext(null);function YP(){let e=h.useContext(ef),t=h.useRef([]),n=ae(o=>(t.current.push(o),e&&e.register(o),()=>s(o))),s=ae(o=>{let i=t.current.indexOf(o);i!==-1&&t.current.splice(i,1),e&&e.unregister(o)}),r=h.useMemo(()=>({register:n,unregister:s,portals:t}),[n,s,t]);return[t,h.useMemo(()=>function({children:o}){return h.createElement(ef.Provider,{value:r},o)},[r])]}let ZP=He(GP),XP=He(KP);Object.assign(ZP,{Group:XP});function JP({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var s;let r=h.useRef((s=n==null?void 0:n.current)!=null?s:null),o=Mo(r),i=ae(()=>{var a,l,u;let d=[];for(let f of e)f!==null&&(f instanceof HTMLElement?d.push(f):"current"in f&&f.current instanceof HTMLElement&&d.push(f.current));if(t!=null&&t.current)for(let f of t.current)d.push(f);for(let f of(a=o==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])f!==document.body&&f!==document.head&&f instanceof HTMLElement&&f.id!=="headlessui-portal-root"&&(f.contains(r.current)||f.contains((u=(l=r.current)==null?void 0:l.getRootNode())==null?void 0:u.host)||d.some(p=>f.contains(p))||d.push(f));return d});return{resolveContainers:i,contains:ae(a=>i().some(l=>l.contains(a))),mainTreeNodeRef:r,MainTreeNode:h.useMemo(()=>function(){return n!=null?null:h.createElement(cs,{features:ls.Hidden,ref:r})},[r,n])}}function QP(){let e=h.useRef(null);return{mainTreeNodeRef:e,MainTreeNode:h.useMemo(()=>function(){return h.createElement(cs,{features:ls.Hidden,ref:e})},[e])}}let Nv=h.createContext(null);function Mv(){let e=h.useContext(Nv);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Mv),t}return e}function fp(){let[e,t]=h.useState([]);return[e.length>0?e.join(" "):void 0,h.useMemo(()=>function(n){let s=ae(o=>(t(i=>[...i,o]),()=>t(i=>{let a=i.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),r=h.useMemo(()=>({register:s,slot:n.slot,name:n.name,props:n.props}),[s,n.slot,n.name,n.props]);return h.createElement(Nv.Provider,{value:r},n.children)},[t])]}let e_="p";function t_(e,t){let n=xt(),{id:s=`headlessui-description-${n}`,...r}=e,o=Mv(),i=Ue(t);ze(()=>o.register(s),[s,o.register]);let a={ref:i,...o.props,id:s};return De({ourProps:a,theirProps:r,slot:o.slot||{},defaultTag:e_,name:o.name||"Description"})}let n_=He(t_),Lv=Object.assign(n_,{});var vg;let s_=(vg=h.startTransition)!=null?vg:function(e){e()};var r_=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(r_||{}),o_=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel",e))(o_||{});let i_={0:e=>({...e,disclosureState:Le(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},4(e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},5(e){return e.linkedPanel===!1?e:{...e,linkedPanel:!1}},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},pp=h.createContext(null);pp.displayName="DisclosureContext";function hp(e){let t=h.useContext(pp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,hp),n}return t}let gp=h.createContext(null);gp.displayName="DisclosureAPIContext";function Rv(e){let t=h.useContext(gp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Rv),n}return t}let mp=h.createContext(null);mp.displayName="DisclosurePanelContext";function a_(){return h.useContext(mp)}function l_(e,t){return Le(t.type,i_,e,t)}let c_=h.Fragment;function u_(e,t){let{defaultOpen:n=!1,...s}=e,r=h.useRef(null),o=Ue(t,ap(v=>{r.current=v},e.as===void 0||e.as===h.Fragment)),i=h.useRef(null),a=h.useRef(null),l=h.useReducer(l_,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:a,panelRef:i,buttonId:null,panelId:null}),[{disclosureState:u,buttonId:d},f]=l,p=ae(v=>{f({type:1});let x=Ur(r);if(!x||!d)return;let y=v?v instanceof HTMLElement?v:v.current instanceof HTMLElement?v.current:x.getElementById(d):x.getElementById(d);y==null||y.focus()}),g=h.useMemo(()=>({close:p}),[p]),m=h.useMemo(()=>({open:u===0,close:p}),[u,p]),b={ref:o};return h.createElement(pp.Provider,{value:l},h.createElement(gp.Provider,{value:g},h.createElement(Da,{value:Le(u,{0:dt.Open,1:dt.Closed})},De({ourProps:b,theirProps:s,slot:m,defaultTag:c_,name:"Disclosure"}))))}let d_="button";function f_(e,t){let n=xt(),{id:s=`headlessui-disclosure-button-${n}`,...r}=e,[o,i]=hp("Disclosure.Button"),a=a_(),l=a===null?!1:a===o.panelId,u=h.useRef(null),d=Ue(u,t,l?null:o.buttonRef),f=lp();h.useEffect(()=>{if(!l)return i({type:2,buttonId:s}),()=>{i({type:2,buttonId:null})}},[s,i,l]);let p=ae(y=>{var w;if(l){if(o.disclosureState===1)return;switch(y.key){case ve.Space:case ve.Enter:y.preventDefault(),y.stopPropagation(),i({type:0}),(w=o.buttonRef.current)==null||w.focus();break}}else switch(y.key){case ve.Space:case ve.Enter:y.preventDefault(),y.stopPropagation(),i({type:0});break}}),g=ae(y=>{switch(y.key){case ve.Space:y.preventDefault();break}}),m=ae(y=>{var w;kr(y.currentTarget)||e.disabled||(l?(i({type:0}),(w=o.buttonRef.current)==null||w.focus()):i({type:0}))}),b=h.useMemo(()=>({open:o.disclosureState===0}),[o]),v=Ci(e,u),x=l?{ref:d,type:v,onKeyDown:p,onClick:m}:{ref:d,id:s,type:v,"aria-expanded":o.disclosureState===0,"aria-controls":o.linkedPanel?o.panelId:void 0,onKeyDown:p,onKeyUp:g,onClick:m};return De({mergeRefs:f,ourProps:x,theirProps:r,slot:b,defaultTag:d_,name:"Disclosure.Button"})}let p_="div",h_=gn.RenderStrategy|gn.Static;function g_(e,t){let n=xt(),{id:s=`headlessui-disclosure-panel-${n}`,...r}=e,[o,i]=hp("Disclosure.Panel"),{close:a}=Rv("Disclosure.Panel"),l=lp(),u=Ue(t,o.panelRef,m=>{s_(()=>i({type:m?4:5}))});h.useEffect(()=>(i({type:3,panelId:s}),()=>{i({type:3,panelId:null})}),[s,i]);let d=Lo(),f=d!==null?(d&dt.Open)===dt.Open:o.disclosureState===0,p=h.useMemo(()=>({open:o.disclosureState===0,close:a}),[o,a]),g={ref:u,id:s};return h.createElement(mp.Provider,{value:o.panelId},De({mergeRefs:l,ourProps:g,theirProps:r,slot:p,defaultTag:p_,features:h_,visible:f,name:"Disclosure.Panel"}))}let m_=He(u_),b_=He(f_),v_=He(g_),Wu=Object.assign(m_,{Button:b_,Panel:v_}),yg=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function xg(e){var t,n;let s=(t=e.innerText)!=null?t:"",r=e.cloneNode(!0);if(!(r instanceof HTMLElement))return s;let o=!1;for(let a of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),o=!0;let i=o?(n=r.innerText)!=null?n:"":s;return yg.test(i)&&(i=i.replace(yg,"")),i}function y_(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let s=n.split(" ").map(r=>{let o=document.getElementById(r);if(o){let i=o.getAttribute("aria-label");return typeof i=="string"?i.trim():xg(o).trim()}return null}).filter(Boolean);if(s.length>0)return s.join(", ")}return xg(e).trim()}function x_(e){let t=h.useRef(""),n=h.useRef("");return ae(()=>{let s=e.current;if(!s)return"";let r=s.innerText;if(t.current===r)return n.current;let o=y_(s).trim().toLowerCase();return t.current=r,n.current=o,o})}var w_=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(w_||{}),S_=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(S_||{}),C_=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(C_||{}),j_=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(j_||{});function Gu(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,s=Js(t(e.options.slice()),o=>o.dataRef.current.domRef.current),r=n?s.indexOf(n):null;return r===-1&&(r=null),{options:s,activeOptionIndex:r}}let E_={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,s=e.options.findIndex(r=>n(r.dataRef.current.value));return s!==-1&&(t=s),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||e.listboxState===1)return e;let s=Gu(e),r=Qd(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...s,searchQuery:"",activeOptionIndex:r,activationTrigger:(n=t.trigger)!=null?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,s=e.searchQuery+t.value.toLowerCase(),r=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var a;return!i.dataRef.current.disabled&&((a=i.dataRef.current.textValue)==null?void 0:a.startsWith(s))}),o=r?e.options.indexOf(r):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:s}:{...e,searchQuery:s,activeOptionIndex:o,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},s=Gu(e,r=>[...r,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(n)),{...e,...s}},6:(e,t)=>{let n=Gu(e,s=>{let r=s.findIndex(o=>o.id===t.id);return r!==-1&&s.splice(r,1),s});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},bp=h.createContext(null);bp.displayName="ListboxActionsContext";function Fa(e){let t=h.useContext(bp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Fa),n}return t}let vp=h.createContext(null);vp.displayName="ListboxDataContext";function Ba(e){let t=h.useContext(vp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ba),n}return t}function P_(e,t){return Le(t.type,E_,e,t)}let __=h.Fragment;function T_(e,t){let{value:n,defaultValue:s,form:r,name:o,onChange:i,by:a=(W,K)=>W===K,disabled:l=!1,horizontal:u=!1,multiple:d=!1,...f}=e;const p=u?"horizontal":"vertical";let g=Ue(t),[m=d?[]:void 0,b]=Vc(n,i,s),[v,x]=h.useReducer(P_,{dataRef:h.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),y=h.useRef({static:!1,hold:!1}),w=h.useRef(null),S=h.useRef(null),C=h.useRef(null),j=ae(typeof a=="string"?(W,K)=>{let J=a;return(W==null?void 0:W[J])===(K==null?void 0:K[J])}:a),E=h.useCallback(W=>Le(_.mode,{1:()=>m.some(K=>j(K,W)),0:()=>j(m,W)}),[m]),_=h.useMemo(()=>({...v,value:m,disabled:l,mode:d?1:0,orientation:p,compare:j,isSelected:E,optionsPropsRef:y,labelRef:w,buttonRef:S,optionsRef:C}),[m,l,d,v]);ze(()=>{v.dataRef.current=_},[_]),ip([_.buttonRef,_.optionsRef],(W,K)=>{var J;x({type:1}),op(K,Hc.Loose)||(W.preventDefault(),(J=_.buttonRef.current)==null||J.focus())},_.listboxState===0);let T=h.useMemo(()=>({open:_.listboxState===0,disabled:l,value:m}),[_,l,m]),P=ae(W=>{let K=_.options.find(J=>J.id===W);K&&q(K.dataRef.current.value)}),A=ae(()=>{if(_.activeOptionIndex!==null){let{dataRef:W,id:K}=_.options[_.activeOptionIndex];q(W.current.value),x({type:2,focus:Ge.Specific,id:K})}}),M=ae(()=>x({type:0})),R=ae(()=>x({type:1})),F=ae((W,K,J)=>W===Ge.Specific?x({type:2,focus:Ge.Specific,id:K,trigger:J}):x({type:2,focus:W,trigger:J})),L=ae((W,K)=>(x({type:5,id:W,dataRef:K}),()=>x({type:6,id:W}))),B=ae(W=>(x({type:7,id:W}),()=>x({type:7,id:null}))),q=ae(W=>Le(_.mode,{0(){return b==null?void 0:b(W)},1(){let K=_.value.slice(),J=K.findIndex(Y=>j(Y,W));return J===-1?K.push(W):K.splice(J,1),b==null?void 0:b(K)}})),H=ae(W=>x({type:3,value:W})),$=ae(()=>x({type:4})),I=h.useMemo(()=>({onChange:q,registerOption:L,registerLabel:B,goToOption:F,closeListbox:R,openListbox:M,selectActiveOption:A,selectOption:P,search:H,clearSearch:$}),[]),O={ref:g},V=h.useRef(null),G=as();return h.useEffect(()=>{V.current&&s!==void 0&&G.addEventListener(V.current,"reset",()=>{b==null||b(s)})},[V,b]),h.createElement(bp.Provider,{value:I},h.createElement(vp.Provider,{value:_},h.createElement(Da,{value:Le(_.listboxState,{0:dt.Open,1:dt.Closed})},o!=null&&m!=null&&Fc({[o]:m}).map(([W,K],J)=>h.createElement(cs,{features:ls.Hidden,ref:J===0?Y=>{var U;V.current=(U=Y==null?void 0:Y.closest("form"))!=null?U:null}:void 0,...di({key:W,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:r,disabled:l,name:W,value:K})})),De({ourProps:O,theirProps:f,slot:T,defaultTag:__,name:"Listbox"}))))}let O_="button";function A_(e,t){var n;let s=xt(),{id:r=`headlessui-listbox-button-${s}`,...o}=e,i=Ba("Listbox.Button"),a=Fa("Listbox.Button"),l=Ue(i.buttonRef,t),u=as(),d=ae(v=>{switch(v.key){case ve.Space:case ve.Enter:case ve.ArrowDown:v.preventDefault(),a.openListbox(),u.nextFrame(()=>{i.value||a.goToOption(Ge.First)});break;case ve.ArrowUp:v.preventDefault(),a.openListbox(),u.nextFrame(()=>{i.value||a.goToOption(Ge.Last)});break}}),f=ae(v=>{switch(v.key){case ve.Space:v.preventDefault();break}}),p=ae(v=>{if(kr(v.currentTarget))return v.preventDefault();i.listboxState===0?(a.closeListbox(),u.nextFrame(()=>{var x;return(x=i.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})})):(v.preventDefault(),a.openListbox())}),g=Ia(()=>{if(i.labelId)return[i.labelId,r].join(" ")},[i.labelId,r]),m=h.useMemo(()=>({open:i.listboxState===0,disabled:i.disabled,value:i.value}),[i]),b={ref:l,id:r,type:Ci(e,i.buttonRef),"aria-haspopup":"listbox","aria-controls":(n=i.optionsRef.current)==null?void 0:n.id,"aria-expanded":i.listboxState===0,"aria-labelledby":g,disabled:i.disabled,onKeyDown:d,onKeyUp:f,onClick:p};return De({ourProps:b,theirProps:o,slot:m,defaultTag:O_,name:"Listbox.Button"})}let N_="label";function M_(e,t){let n=xt(),{id:s=`headlessui-listbox-label-${n}`,...r}=e,o=Ba("Listbox.Label"),i=Fa("Listbox.Label"),a=Ue(o.labelRef,t);ze(()=>i.registerLabel(s),[s]);let l=ae(()=>{var d;return(d=o.buttonRef.current)==null?void 0:d.focus({preventScroll:!0})}),u=h.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]);return De({ourProps:{ref:a,id:s,onClick:l},theirProps:r,slot:u,defaultTag:N_,name:"Listbox.Label"})}let L_="ul",R_=gn.RenderStrategy|gn.Static;function $_(e,t){var n;let s=xt(),{id:r=`headlessui-listbox-options-${s}`,...o}=e,i=Ba("Listbox.Options"),a=Fa("Listbox.Options"),l=Ue(i.optionsRef,t),u=as(),d=as(),f=Lo(),p=f!==null?(f&dt.Open)===dt.Open:i.listboxState===0;h.useEffect(()=>{var x;let y=i.optionsRef.current;y&&i.listboxState===0&&y!==((x=Ur(y))==null?void 0:x.activeElement)&&y.focus({preventScroll:!0})},[i.listboxState,i.optionsRef]);let g=ae(x=>{switch(d.dispose(),x.key){case ve.Space:if(i.searchQuery!=="")return x.preventDefault(),x.stopPropagation(),a.search(x.key);case ve.Enter:if(x.preventDefault(),x.stopPropagation(),i.activeOptionIndex!==null){let{dataRef:y}=i.options[i.activeOptionIndex];a.onChange(y.current.value)}i.mode===0&&(a.closeListbox(),$s().nextFrame(()=>{var y;return(y=i.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})}));break;case Le(i.orientation,{vertical:ve.ArrowDown,horizontal:ve.ArrowRight}):return x.preventDefault(),x.stopPropagation(),a.goToOption(Ge.Next);case Le(i.orientation,{vertical:ve.ArrowUp,horizontal:ve.ArrowLeft}):return x.preventDefault(),x.stopPropagation(),a.goToOption(Ge.Previous);case ve.Home:case ve.PageUp:return x.preventDefault(),x.stopPropagation(),a.goToOption(Ge.First);case ve.End:case ve.PageDown:return x.preventDefault(),x.stopPropagation(),a.goToOption(Ge.Last);case ve.Escape:return x.preventDefault(),x.stopPropagation(),a.closeListbox(),u.nextFrame(()=>{var y;return(y=i.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})});case ve.Tab:x.preventDefault(),x.stopPropagation();break;default:x.key.length===1&&(a.search(x.key),d.setTimeout(()=>a.clearSearch(),350));break}}),m=Ia(()=>{var x;return(x=i.buttonRef.current)==null?void 0:x.id},[i.buttonRef.current]),b=h.useMemo(()=>({open:i.listboxState===0}),[i]),v={"aria-activedescendant":i.activeOptionIndex===null||(n=i.options[i.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":i.mode===1?!0:void 0,"aria-labelledby":m,"aria-orientation":i.orientation,id:r,onKeyDown:g,role:"listbox",tabIndex:0,ref:l};return De({ourProps:v,theirProps:o,slot:b,defaultTag:L_,features:R_,visible:p,name:"Listbox.Options"})}let k_="li";function V_(e,t){let n=xt(),{id:s=`headlessui-listbox-option-${n}`,disabled:r=!1,value:o,...i}=e,a=Ba("Listbox.Option"),l=Fa("Listbox.Option"),u=a.activeOptionIndex!==null?a.options[a.activeOptionIndex].id===s:!1,d=a.isSelected(o),f=h.useRef(null),p=x_(f),g=Mt({disabled:r,value:o,domRef:f,get textValue(){return p()}}),m=Ue(t,f);ze(()=>{if(a.listboxState!==0||!u||a.activationTrigger===0)return;let j=$s();return j.requestAnimationFrame(()=>{var E,_;(_=(E=f.current)==null?void 0:E.scrollIntoView)==null||_.call(E,{block:"nearest"})}),j.dispose},[f,u,a.listboxState,a.activationTrigger,a.activeOptionIndex]),ze(()=>l.registerOption(s,g),[g,s]);let b=ae(j=>{if(r)return j.preventDefault();l.onChange(o),a.mode===0&&(l.closeListbox(),$s().nextFrame(()=>{var E;return(E=a.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})}))}),v=ae(()=>{if(r)return l.goToOption(Ge.Nothing);l.goToOption(Ge.Specific,s)}),x=Sv(),y=ae(j=>x.update(j)),w=ae(j=>{x.wasMoved(j)&&(r||u||l.goToOption(Ge.Specific,s,0))}),S=ae(j=>{x.wasMoved(j)&&(r||u&&l.goToOption(Ge.Nothing))}),C=h.useMemo(()=>({active:u,selected:d,disabled:r}),[u,d,r]);return De({ourProps:{id:s,ref:m,role:"option",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:b,onFocus:v,onPointerEnter:y,onMouseEnter:y,onPointerMove:w,onMouseMove:w,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:C,defaultTag:k_,name:"Listbox.Option"})}let I_=He(T_),D_=He(A_),H_=He(M_),F_=He($_),B_=He(V_),Ri=Object.assign(I_,{Button:D_,Label:H_,Options:F_,Option:B_});var z_=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(z_||{}),U_=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(U_||{});let W_={0:e=>{let t={...e,popoverState:Le(e.popoverState,{0:1,1:0})};return t.popoverState===0&&(t.__demoMode=!1),t},1(e){return e.popoverState===1?e:{...e,popoverState:1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},yp=h.createContext(null);yp.displayName="PopoverContext";function zc(e){let t=h.useContext(yp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,zc),n}return t}let xp=h.createContext(null);xp.displayName="PopoverAPIContext";function wp(e){let t=h.useContext(xp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,wp),n}return t}let Sp=h.createContext(null);Sp.displayName="PopoverGroupContext";function $v(){return h.useContext(Sp)}let Uc=h.createContext(null);Uc.displayName="PopoverPanelContext";function G_(){return h.useContext(Uc)}function q_(e,t){return Le(t.type,W_,e,t)}let K_="div";function Y_(e,t){var n;let{__demoMode:s=!1,...r}=e,o=h.useRef(null),i=Ue(t,ap(B=>{o.current=B})),a=h.useRef([]),l=h.useReducer(q_,{__demoMode:s,popoverState:s?0:1,buttons:a,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:h.createRef(),afterPanelSentinel:h.createRef()}),[{popoverState:u,button:d,buttonId:f,panel:p,panelId:g,beforePanelSentinel:m,afterPanelSentinel:b},v]=l,x=Mo((n=o.current)!=null?n:d),y=h.useMemo(()=>{if(!d||!p)return!1;for(let V of document.querySelectorAll("body > *"))if(Number(V==null?void 0:V.contains(d))^Number(V==null?void 0:V.contains(p)))return!0;let B=Dc(),q=B.indexOf(d),H=(q+B.length-1)%B.length,$=(q+1)%B.length,I=B[H],O=B[$];return!p.contains(I)&&!p.contains(O)},[d,p]),w=Mt(f),S=Mt(g),C=h.useMemo(()=>({buttonId:w,panelId:S,close:()=>v({type:1})}),[w,S,v]),j=$v(),E=j==null?void 0:j.registerPopover,_=ae(()=>{var B;return(B=j==null?void 0:j.isFocusWithinPopoverGroup())!=null?B:(x==null?void 0:x.activeElement)&&((d==null?void 0:d.contains(x.activeElement))||(p==null?void 0:p.contains(x.activeElement)))});h.useEffect(()=>E==null?void 0:E(C),[E,C]);let[T,P]=YP(),A=JP({mainTreeNodeRef:j==null?void 0:j.mainTreeNodeRef,portals:T,defaultContainers:[d,p]});HP(x==null?void 0:x.defaultView,"focus",B=>{var q,H,$,I;B.target!==window&&B.target instanceof HTMLElement&&u===0&&(_()||d&&p&&(A.contains(B.target)||(H=(q=m.current)==null?void 0:q.contains)!=null&&H.call(q,B.target)||(I=($=b.current)==null?void 0:$.contains)!=null&&I.call($,B.target)||v({type:1})))},!0),ip(A.resolveContainers,(B,q)=>{v({type:1}),op(q,Hc.Loose)||(B.preventDefault(),d==null||d.focus())},u===0);let M=ae(B=>{v({type:1});let q=B?B instanceof HTMLElement?B:"current"in B&&B.current instanceof HTMLElement?B.current:d:d;q==null||q.focus()}),R=h.useMemo(()=>({close:M,isPortalled:y}),[M,y]),F=h.useMemo(()=>({open:u===0,close:M}),[u,M]),L={ref:i};return h.createElement(Uc.Provider,{value:null},h.createElement(yp.Provider,{value:l},h.createElement(xp.Provider,{value:R},h.createElement(Da,{value:Le(u,{0:dt.Open,1:dt.Closed})},h.createElement(P,null,De({ourProps:L,theirProps:r,slot:F,defaultTag:K_,name:"Popover"}),h.createElement(A.MainTreeNode,null))))))}let Z_="button";function X_(e,t){let n=xt(),{id:s=`headlessui-popover-button-${n}`,...r}=e,[o,i]=zc("Popover.Button"),{isPortalled:a}=wp("Popover.Button"),l=h.useRef(null),u=`headlessui-focus-sentinel-${xt()}`,d=$v(),f=d==null?void 0:d.closeOthers,p=G_()!==null;h.useEffect(()=>{if(!p)return i({type:3,buttonId:s}),()=>{i({type:3,buttonId:null})}},[p,s,i]);let[g]=h.useState(()=>Symbol()),m=Ue(l,t,p?null:A=>{if(A)o.buttons.current.push(g);else{let M=o.buttons.current.indexOf(g);M!==-1&&o.buttons.current.splice(M,1)}o.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),A&&i({type:2,button:A})}),b=Ue(l,t),v=Mo(l),x=ae(A=>{var M,R,F;if(p){if(o.popoverState===1)return;switch(A.key){case ve.Space:case ve.Enter:A.preventDefault(),(R=(M=A.target).click)==null||R.call(M),i({type:1}),(F=o.button)==null||F.focus();break}}else switch(A.key){case ve.Space:case ve.Enter:A.preventDefault(),A.stopPropagation(),o.popoverState===1&&(f==null||f(o.buttonId)),i({type:0});break;case ve.Escape:if(o.popoverState!==0)return f==null?void 0:f(o.buttonId);if(!l.current||v!=null&&v.activeElement&&!l.current.contains(v.activeElement))return;A.preventDefault(),A.stopPropagation(),i({type:1});break}}),y=ae(A=>{p||A.key===ve.Space&&A.preventDefault()}),w=ae(A=>{var M,R;kr(A.currentTarget)||e.disabled||(p?(i({type:1}),(M=o.button)==null||M.focus()):(A.preventDefault(),A.stopPropagation(),o.popoverState===1&&(f==null||f(o.buttonId)),i({type:0}),(R=o.button)==null||R.focus()))}),S=ae(A=>{A.preventDefault(),A.stopPropagation()}),C=o.popoverState===0,j=h.useMemo(()=>({open:C}),[C]),E=Ci(e,l),_=p?{ref:b,type:E,onKeyDown:x,onClick:w}:{ref:m,id:o.buttonId,type:E,"aria-expanded":o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:x,onKeyUp:y,onClick:w,onMouseDown:S},T=Ov(),P=ae(()=>{let A=o.panel;if(!A)return;function M(){Le(T.current,{[Qs.Forwards]:()=>tn(A,Ct.First),[Qs.Backwards]:()=>tn(A,Ct.Last)})===As.Error&&tn(Dc().filter(R=>R.dataset.headlessuiFocusGuard!=="true"),Le(T.current,{[Qs.Forwards]:Ct.Next,[Qs.Backwards]:Ct.Previous}),{relativeTo:o.button})}M()});return h.createElement(h.Fragment,null,De({ourProps:_,theirProps:r,slot:j,defaultTag:Z_,name:"Popover.Button"}),C&&!p&&a&&h.createElement(cs,{id:u,features:ls.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}))}let J_="div",Q_=gn.RenderStrategy|gn.Static;function eT(e,t){let n=xt(),{id:s=`headlessui-popover-overlay-${n}`,...r}=e,[{popoverState:o},i]=zc("Popover.Overlay"),a=Ue(t),l=Lo(),u=l!==null?(l&dt.Open)===dt.Open:o===0,d=ae(p=>{if(kr(p.currentTarget))return p.preventDefault();i({type:1})}),f=h.useMemo(()=>({open:o===0}),[o]);return De({ourProps:{ref:a,id:s,"aria-hidden":!0,onClick:d},theirProps:r,slot:f,defaultTag:J_,features:Q_,visible:u,name:"Popover.Overlay"})}let tT="div",nT=gn.RenderStrategy|gn.Static;function sT(e,t){let n=xt(),{id:s=`headlessui-popover-panel-${n}`,focus:r=!1,...o}=e,[i,a]=zc("Popover.Panel"),{close:l,isPortalled:u}=wp("Popover.Panel"),d=`headlessui-focus-sentinel-before-${xt()}`,f=`headlessui-focus-sentinel-after-${xt()}`,p=h.useRef(null),g=Ue(p,t,_=>{a({type:4,panel:_})}),m=Mo(p),b=lp();ze(()=>(a({type:5,panelId:s}),()=>{a({type:5,panelId:null})}),[s,a]);let v=Lo(),x=v!==null?(v&dt.Open)===dt.Open:i.popoverState===0,y=ae(_=>{var T;switch(_.key){case ve.Escape:if(i.popoverState!==0||!p.current||m!=null&&m.activeElement&&!p.current.contains(m.activeElement))return;_.preventDefault(),_.stopPropagation(),a({type:1}),(T=i.button)==null||T.focus();break}});h.useEffect(()=>{var _;e.static||i.popoverState===1&&((_=e.unmount)==null||_)&&a({type:4,panel:null})},[i.popoverState,e.unmount,e.static,a]),h.useEffect(()=>{if(i.__demoMode||!r||i.popoverState!==0||!p.current)return;let _=m==null?void 0:m.activeElement;p.current.contains(_)||tn(p.current,Ct.First)},[i.__demoMode,r,p,i.popoverState]);let w=h.useMemo(()=>({open:i.popoverState===0,close:l}),[i,l]),S={ref:g,id:s,onKeyDown:y,onBlur:r&&i.popoverState===0?_=>{var T,P,A,M,R;let F=_.relatedTarget;F&&p.current&&((T=p.current)!=null&&T.contains(F)||(a({type:1}),((A=(P=i.beforePanelSentinel.current)==null?void 0:P.contains)!=null&&A.call(P,F)||(R=(M=i.afterPanelSentinel.current)==null?void 0:M.contains)!=null&&R.call(M,F))&&F.focus({preventScroll:!0})))}:void 0,tabIndex:-1},C=Ov(),j=ae(()=>{let _=p.current;if(!_)return;function T(){Le(C.current,{[Qs.Forwards]:()=>{var P;tn(_,Ct.First)===As.Error&&((P=i.afterPanelSentinel.current)==null||P.focus())},[Qs.Backwards]:()=>{var P;(P=i.button)==null||P.focus({preventScroll:!0})}})}T()}),E=ae(()=>{let _=p.current;if(!_)return;function T(){Le(C.current,{[Qs.Forwards]:()=>{var P;if(!i.button)return;let A=Dc(),M=A.indexOf(i.button),R=A.slice(0,M+1),F=[...A.slice(M+1),...R];for(let L of F.slice())if(L.dataset.headlessuiFocusGuard==="true"||(P=i.panel)!=null&&P.contains(L)){let B=F.indexOf(L);B!==-1&&F.splice(B,1)}tn(F,Ct.First,{sorted:!1})},[Qs.Backwards]:()=>{var P;tn(_,Ct.Previous)===As.Error&&((P=i.button)==null||P.focus())}})}T()});return h.createElement(Uc.Provider,{value:s},x&&u&&h.createElement(cs,{id:d,ref:i.beforePanelSentinel,features:ls.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:j}),De({mergeRefs:b,ourProps:S,theirProps:o,slot:w,defaultTag:tT,features:nT,visible:x,name:"Popover.Panel"}),x&&u&&h.createElement(cs,{id:f,ref:i.afterPanelSentinel,features:ls.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:E}))}let rT="div";function oT(e,t){let n=h.useRef(null),s=Ue(n,t),[r,o]=h.useState([]),i=QP(),a=ae(b=>{o(v=>{let x=v.indexOf(b);if(x!==-1){let y=v.slice();return y.splice(x,1),y}return v})}),l=ae(b=>(o(v=>[...v,b]),()=>a(b))),u=ae(()=>{var b;let v=Ur(n);if(!v)return!1;let x=v.activeElement;return(b=n.current)!=null&&b.contains(x)?!0:r.some(y=>{var w,S;return((w=v.getElementById(y.buttonId.current))==null?void 0:w.contains(x))||((S=v.getElementById(y.panelId.current))==null?void 0:S.contains(x))})}),d=ae(b=>{for(let v of r)v.buttonId.current!==b&&v.close()}),f=h.useMemo(()=>({registerPopover:l,unregisterPopover:a,isFocusWithinPopoverGroup:u,closeOthers:d,mainTreeNodeRef:i.mainTreeNodeRef}),[l,a,u,d,i.mainTreeNodeRef]),p=h.useMemo(()=>({}),[]),g=e,m={ref:s};return h.createElement(Sp.Provider,{value:f},De({ourProps:m,theirProps:g,slot:p,defaultTag:rT,name:"Popover.Group"}),h.createElement(i.MainTreeNode,null))}let iT=He(Y_),aT=He(X_),lT=He(eT),cT=He(sT),uT=He(oT),qu=Object.assign(iT,{Button:aT,Overlay:lT,Panel:cT,Group:uT}),kv=h.createContext(null);function Vv(){let e=h.useContext(kv);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Vv),t}return e}function Cp(){let[e,t]=h.useState([]);return[e.length>0?e.join(" "):void 0,h.useMemo(()=>function(n){let s=ae(o=>(t(i=>[...i,o]),()=>t(i=>{let a=i.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),r=h.useMemo(()=>({register:s,slot:n.slot,name:n.name,props:n.props}),[s,n.slot,n.name,n.props]);return h.createElement(kv.Provider,{value:r},n.children)},[t])]}let dT="label";function fT(e,t){let n=xt(),{id:s=`headlessui-label-${n}`,passive:r=!1,...o}=e,i=Vv(),a=Ue(t);ze(()=>i.register(s),[s,i.register]);let l={ref:a,...i.props,id:s};return r&&("onClick"in l&&(delete l.htmlFor,delete l.onClick),"onClick"in o&&delete o.onClick),De({ourProps:l,theirProps:o,slot:i.slot||{},defaultTag:dT,name:i.name||"Label"})}let pT=He(fT),Iv=Object.assign(pT,{});function Dv(e=0){let[t,n]=h.useState(e),s=Bc(),r=h.useCallback(l=>{s.current&&n(u=>u|l)},[t,s]),o=h.useCallback(l=>!!(t&l),[t]),i=h.useCallback(l=>{s.current&&n(u=>u&~l)},[n,s]),a=h.useCallback(l=>{s.current&&n(u=>u^l)},[n]);return{flags:t,addFlag:r,hasFlag:o,removeFlag:i,toggleFlag:a}}var hT=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(hT||{});let gT={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Js(n,s=>s.element.current)}},1(e,t){let n=e.options.slice(),s=e.options.findIndex(r=>r.id===t.id);return s===-1?e:(n.splice(s,1),{...e,options:n})}},jp=h.createContext(null);jp.displayName="RadioGroupDataContext";function Hv(e){let t=h.useContext(jp);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Hv),n}return t}let Ep=h.createContext(null);Ep.displayName="RadioGroupActionsContext";function Fv(e){let t=h.useContext(Ep);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Fv),n}return t}function mT(e,t){return Le(t.type,gT,e,t)}let bT="div";function vT(e,t){let n=xt(),{id:s=`headlessui-radiogroup-${n}`,value:r,defaultValue:o,form:i,name:a,onChange:l,by:u=($,I)=>$===I,disabled:d=!1,...f}=e,p=ae(typeof u=="string"?($,I)=>{let O=u;return($==null?void 0:$[O])===(I==null?void 0:I[O])}:u),[g,m]=h.useReducer(mT,{options:[]}),b=g.options,[v,x]=Cp(),[y,w]=fp(),S=h.useRef(null),C=Ue(S,t),[j,E]=Vc(r,l,o),_=h.useMemo(()=>b.find($=>!$.propsRef.current.disabled),[b]),T=h.useMemo(()=>b.some($=>p($.propsRef.current.value,j)),[b,j]),P=ae($=>{var I;if(d||p($,j))return!1;let O=(I=b.find(V=>p(V.propsRef.current.value,$)))==null?void 0:I.propsRef.current;return O!=null&&O.disabled?!1:(E==null||E($),!0)});Cv({container:S.current,accept($){return $.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:$.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk($){$.setAttribute("role","none")}});let A=ae($=>{let I=S.current;if(!I)return;let O=Ur(I),V=b.filter(G=>G.propsRef.current.disabled===!1).map(G=>G.element.current);switch($.key){case ve.Enter:_v($.currentTarget);break;case ve.ArrowLeft:case ve.ArrowUp:if($.preventDefault(),$.stopPropagation(),tn(V,Ct.Previous|Ct.WrapAround)===As.Success){let G=b.find(W=>W.element.current===(O==null?void 0:O.activeElement));G&&P(G.propsRef.current.value)}break;case ve.ArrowRight:case ve.ArrowDown:if($.preventDefault(),$.stopPropagation(),tn(V,Ct.Next|Ct.WrapAround)===As.Success){let G=b.find(W=>W.element.current===(O==null?void 0:O.activeElement));G&&P(G.propsRef.current.value)}break;case ve.Space:{$.preventDefault(),$.stopPropagation();let G=b.find(W=>W.element.current===(O==null?void 0:O.activeElement));G&&P(G.propsRef.current.value)}break}}),M=ae($=>(m({type:0,...$}),()=>m({type:1,id:$.id}))),R=h.useMemo(()=>({value:j,firstOption:_,containsCheckedOption:T,disabled:d,compare:p,...g}),[j,_,T,d,p,g]),F=h.useMemo(()=>({registerOption:M,change:P}),[M,P]),L={ref:C,id:s,role:"radiogroup","aria-labelledby":v,"aria-describedby":y,onKeyDown:A},B=h.useMemo(()=>({value:j}),[j]),q=h.useRef(null),H=as();return h.useEffect(()=>{q.current&&o!==void 0&&H.addEventListener(q.current,"reset",()=>{P(o)})},[q,P]),h.createElement(w,{name:"RadioGroup.Description"},h.createElement(x,{name:"RadioGroup.Label"},h.createElement(Ep.Provider,{value:F},h.createElement(jp.Provider,{value:R},a!=null&&j!=null&&Fc({[a]:j}).map(([$,I],O)=>h.createElement(cs,{features:ls.Hidden,ref:O===0?V=>{var G;q.current=(G=V==null?void 0:V.closest("form"))!=null?G:null}:void 0,...di({key:$,as:"input",type:"radio",checked:I!=null,hidden:!0,readOnly:!0,form:i,disabled:d,name:$,value:I})})),De({ourProps:L,theirProps:f,slot:B,defaultTag:bT,name:"RadioGroup"})))))}var yT=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(yT||{});let xT="div";function wT(e,t){var n;let s=xt(),{id:r=`headlessui-radiogroup-option-${s}`,value:o,disabled:i=!1,...a}=e,l=h.useRef(null),u=Ue(l,t),[d,f]=Cp(),[p,g]=fp(),{addFlag:m,removeFlag:b,hasFlag:v}=Dv(1),x=Mt({value:o,disabled:i}),y=Hv("RadioGroup.Option"),w=Fv("RadioGroup.Option");ze(()=>w.registerOption({id:r,element:l,propsRef:x}),[r,w,l,x]);let S=ae(M=>{var R;if(kr(M.currentTarget))return M.preventDefault();w.change(o)&&(m(2),(R=l.current)==null||R.focus())}),C=ae(M=>{if(kr(M.currentTarget))return M.preventDefault();m(2)}),j=ae(()=>b(2)),E=((n=y.firstOption)==null?void 0:n.id)===r,_=y.disabled||i,T=y.compare(y.value,o),P={ref:u,id:r,role:"radio","aria-checked":T?"true":"false","aria-labelledby":d,"aria-describedby":p,"aria-disabled":_?!0:void 0,tabIndex:_?-1:T||!y.containsCheckedOption&&E?0:-1,onClick:_?void 0:S,onFocus:_?void 0:C,onBlur:_?void 0:j},A=h.useMemo(()=>({checked:T,disabled:_,active:v(2)}),[T,_,v]);return h.createElement(g,{name:"RadioGroup.Description"},h.createElement(f,{name:"RadioGroup.Label"},De({ourProps:P,theirProps:a,slot:A,defaultTag:xT,name:"RadioGroup.Option"})))}let ST=He(vT),CT=He(wT),wg=Object.assign(ST,{Option:CT,Label:Iv,Description:Lv}),Pp=h.createContext(null);Pp.displayName="GroupContext";let jT=h.Fragment;function ET(e){var t;let[n,s]=h.useState(null),[r,o]=Cp(),[i,a]=fp(),l=h.useMemo(()=>({switch:n,setSwitch:s,labelledby:r,describedby:i}),[n,s,r,i]),u={},d=e;return h.createElement(a,{name:"Switch.Description"},h.createElement(o,{name:"Switch.Label",props:{htmlFor:(t=l.switch)==null?void 0:t.id,onClick(f){n&&(f.currentTarget.tagName==="LABEL"&&f.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},h.createElement(Pp.Provider,{value:l},De({ourProps:u,theirProps:d,defaultTag:jT,name:"Switch.Group"}))))}let PT="button";function _T(e,t){var n;let s=xt(),{id:r=`headlessui-switch-${s}`,checked:o,defaultChecked:i=!1,onChange:a,disabled:l=!1,name:u,value:d,form:f,...p}=e,g=h.useContext(Pp),m=h.useRef(null),b=Ue(m,t,g===null?null:g.setSwitch),[v,x]=Vc(o,a,i),y=ae(()=>x==null?void 0:x(!v)),w=ae(T=>{if(kr(T.currentTarget))return T.preventDefault();T.preventDefault(),y()}),S=ae(T=>{T.key===ve.Space?(T.preventDefault(),y()):T.key===ve.Enter&&_v(T.currentTarget)}),C=ae(T=>T.preventDefault()),j=h.useMemo(()=>({checked:v}),[v]),E={id:r,ref:b,role:"switch",type:Ci(e,m),tabIndex:e.tabIndex===-1?0:(n=e.tabIndex)!=null?n:0,"aria-checked":v,"aria-labelledby":g==null?void 0:g.labelledby,"aria-describedby":g==null?void 0:g.describedby,disabled:l,onClick:w,onKeyUp:S,onKeyPress:C},_=as();return h.useEffect(()=>{var T;let P=(T=m.current)==null?void 0:T.closest("form");P&&i!==void 0&&_.addEventListener(P,"reset",()=>{x(i)})},[m,x]),h.createElement(h.Fragment,null,u!=null&&v&&h.createElement(cs,{features:ls.Hidden,...di({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:l,form:f,checked:v,name:u,value:d})}),De({ourProps:E,theirProps:p,slot:j,defaultTag:PT,name:"Switch"}))}let TT=He(_T),OT=ET,Ku=Object.assign(TT,{Group:OT,Label:Iv,Description:Lv});function AT({onFocus:e}){let[t,n]=h.useState(!0),s=Bc();return t?h.createElement(cs,{as:"button",type:"button",features:ls.Focusable,onFocus:r=>{r.preventDefault();let o,i=50;function a(){if(i--<=0){o&&cancelAnimationFrame(o);return}if(e()){if(cancelAnimationFrame(o),!s.current)return;n(!1);return}o=requestAnimationFrame(a)}o=requestAnimationFrame(a)}}):null}const Bv=et.createContext(null);function NT(){return{groups:new Map,get(e,t){var n;let s=this.groups.get(e);s||(s=new Map,this.groups.set(e,s));let r=(n=s.get(t))!=null?n:0;s.set(t,r+1);let o=Array.from(s.keys()).indexOf(t);function i(){let a=s.get(t);a>1?s.set(t,a-1):s.delete(t)}return[o,i]}}}function MT({children:e}){let t=et.useRef(NT());return et.createElement(Bv.Provider,{value:t},e)}function zv(e){let t=et.useContext(Bv);if(!t)throw new Error("You must wrap your component in a <StableCollection>");let n=LT(),[s,r]=t.current.get(e,n);return et.useEffect(()=>r,[]),s}function LT(){var e,t,n;let s=(n=(t=(e=et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:e.ReactCurrentOwner)==null?void 0:t.current)!=null?n:null;if(!s)return Symbol();let r=[],o=s;for(;o;)r.push(o.index),o=o.return;return"$."+r.join(".")}var RT=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(RT||{}),$T=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))($T||{}),kT=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(kT||{});let VT={0(e,t){var n;let s=Js(e.tabs,d=>d.current),r=Js(e.panels,d=>d.current),o=s.filter(d=>{var f;return!((f=d.current)!=null&&f.hasAttribute("disabled"))}),i={...e,tabs:s,panels:r};if(t.index<0||t.index>s.length-1){let d=Le(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>Le(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(o.length===0)return i;let f=Le(d,{0:()=>s.indexOf(o[0]),1:()=>s.indexOf(o[o.length-1])});return{...i,selectedIndex:f===-1?e.selectedIndex:f}}let a=s.slice(0,t.index),l=[...s.slice(t.index),...a].find(d=>o.includes(d));if(!l)return i;let u=(n=s.indexOf(l))!=null?n:e.selectedIndex;return u===-1&&(u=e.selectedIndex),{...i,selectedIndex:u}},1(e,t){if(e.tabs.includes(t.tab))return e;let n=e.tabs[e.selectedIndex],s=Js([...e.tabs,t.tab],o=>o.current),r=e.selectedIndex;return e.info.current.isControlled||(r=s.indexOf(n),r===-1&&(r=e.selectedIndex)),{...e,tabs:s,selectedIndex:r}},2(e,t){return{...e,tabs:e.tabs.filter(n=>n!==t.tab)}},3(e,t){return e.panels.includes(t.panel)?e:{...e,panels:Js([...e.panels,t.panel],n=>n.current)}},4(e,t){return{...e,panels:e.panels.filter(n=>n!==t.panel)}}},_p=h.createContext(null);_p.displayName="TabsDataContext";function fi(e){let t=h.useContext(_p);if(t===null){let n=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,fi),n}return t}let Tp=h.createContext(null);Tp.displayName="TabsActionsContext";function Op(e){let t=h.useContext(Tp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Op),n}return t}function IT(e,t){return Le(t.type,VT,e,t)}let DT=h.Fragment;function HT(e,t){let{defaultIndex:n=0,vertical:s=!1,manual:r=!1,onChange:o,selectedIndex:i=null,...a}=e;const l=s?"vertical":"horizontal",u=r?"manual":"auto";let d=i!==null,f=Mt({isControlled:d}),p=Ue(t),[g,m]=h.useReducer(IT,{info:f,selectedIndex:i??n,tabs:[],panels:[]}),b=h.useMemo(()=>({selectedIndex:g.selectedIndex}),[g.selectedIndex]),v=Mt(o||(()=>{})),x=Mt(g.tabs),y=h.useMemo(()=>({orientation:l,activation:u,...g}),[l,u,g]),w=ae(T=>(m({type:1,tab:T}),()=>m({type:2,tab:T}))),S=ae(T=>(m({type:3,panel:T}),()=>m({type:4,panel:T}))),C=ae(T=>{j.current!==T&&v.current(T),d||m({type:0,index:T})}),j=Mt(d?e.selectedIndex:g.selectedIndex),E=h.useMemo(()=>({registerTab:w,registerPanel:S,change:C}),[]);ze(()=>{m({type:0,index:i??n})},[i]),ze(()=>{if(j.current===void 0||g.tabs.length<=0)return;let T=Js(g.tabs,P=>P.current);T.some((P,A)=>g.tabs[A]!==P)&&C(T.indexOf(g.tabs[j.current]))});let _={ref:p};return h.createElement(MT,null,h.createElement(Tp.Provider,{value:E},h.createElement(_p.Provider,{value:y},y.tabs.length<=0&&h.createElement(AT,{onFocus:()=>{var T,P;for(let A of x.current)if(((T=A.current)==null?void 0:T.tabIndex)===0)return(P=A.current)==null||P.focus(),!0;return!1}}),De({ourProps:_,theirProps:a,slot:b,defaultTag:DT,name:"Tabs"}))))}let FT="div";function BT(e,t){let{orientation:n,selectedIndex:s}=fi("Tab.List"),r=Ue(t);return De({ourProps:{ref:r,role:"tablist","aria-orientation":n},theirProps:e,slot:{selectedIndex:s},defaultTag:FT,name:"Tabs.List"})}let zT="button";function UT(e,t){var n,s;let r=xt(),{id:o=`headlessui-tabs-tab-${r}`,...i}=e,{orientation:a,activation:l,selectedIndex:u,tabs:d,panels:f}=fi("Tab"),p=Op("Tab"),g=fi("Tab"),m=h.useRef(null),b=Ue(m,t);ze(()=>p.registerTab(m),[p,m]);let v=zv("tabs"),x=d.indexOf(m);x===-1&&(x=v);let y=x===u,w=ae(P=>{var A;let M=P();if(M===As.Success&&l==="auto"){let R=(A=Ur(m))==null?void 0:A.activeElement,F=g.tabs.findIndex(L=>L.current===R);F!==-1&&p.change(F)}return M}),S=ae(P=>{let A=d.map(M=>M.current).filter(Boolean);if(P.key===ve.Space||P.key===ve.Enter){P.preventDefault(),P.stopPropagation(),p.change(x);return}switch(P.key){case ve.Home:case ve.PageUp:return P.preventDefault(),P.stopPropagation(),w(()=>tn(A,Ct.First));case ve.End:case ve.PageDown:return P.preventDefault(),P.stopPropagation(),w(()=>tn(A,Ct.Last))}if(w(()=>Le(a,{vertical(){return P.key===ve.ArrowUp?tn(A,Ct.Previous|Ct.WrapAround):P.key===ve.ArrowDown?tn(A,Ct.Next|Ct.WrapAround):As.Error},horizontal(){return P.key===ve.ArrowLeft?tn(A,Ct.Previous|Ct.WrapAround):P.key===ve.ArrowRight?tn(A,Ct.Next|Ct.WrapAround):As.Error}}))===As.Success)return P.preventDefault()}),C=h.useRef(!1),j=ae(()=>{var P;C.current||(C.current=!0,(P=m.current)==null||P.focus({preventScroll:!0}),p.change(x),rp(()=>{C.current=!1}))}),E=ae(P=>{P.preventDefault()}),_=h.useMemo(()=>{var P;return{selected:y,disabled:(P=e.disabled)!=null?P:!1}},[y,e.disabled]),T={ref:b,onKeyDown:S,onMouseDown:E,onClick:j,id:o,role:"tab",type:Ci(e,m),"aria-controls":(s=(n=f[x])==null?void 0:n.current)==null?void 0:s.id,"aria-selected":y,tabIndex:y?0:-1};return De({ourProps:T,theirProps:i,slot:_,defaultTag:zT,name:"Tabs.Tab"})}let WT="div";function GT(e,t){let{selectedIndex:n}=fi("Tab.Panels"),s=Ue(t),r=h.useMemo(()=>({selectedIndex:n}),[n]);return De({ourProps:{ref:s},theirProps:e,slot:r,defaultTag:WT,name:"Tabs.Panels"})}let qT="div",KT=gn.RenderStrategy|gn.Static;function YT(e,t){var n,s,r,o;let i=xt(),{id:a=`headlessui-tabs-panel-${i}`,tabIndex:l=0,...u}=e,{selectedIndex:d,tabs:f,panels:p}=fi("Tab.Panel"),g=Op("Tab.Panel"),m=h.useRef(null),b=Ue(m,t);ze(()=>g.registerPanel(m),[g,m,a]);let v=zv("panels"),x=p.indexOf(m);x===-1&&(x=v);let y=x===d,w=h.useMemo(()=>({selected:y}),[y]),S={ref:b,id:a,role:"tabpanel","aria-labelledby":(s=(n=f[x])==null?void 0:n.current)==null?void 0:s.id,tabIndex:y?l:-1};return!y&&((r=u.unmount)==null||r)&&!((o=u.static)!=null&&o)?h.createElement(cs,{as:"span","aria-hidden":"true",...S}):De({ourProps:S,theirProps:u,slot:w,defaultTag:qT,features:KT,visible:y,name:"Tabs.Panel"})}let ZT=He(UT),XT=He(HT),JT=He(BT),QT=He(GT),e5=He(YT),$i=Object.assign(ZT,{Group:XT,List:JT,Panels:QT,Panel:e5});function t5(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Yu(e,...t){e&&t.length>0&&e.classList.add(...t)}function Zu(e,...t){e&&t.length>0&&e.classList.remove(...t)}function n5(e,t){let n=$s();if(!e)return n.dispose;let{transitionDuration:s,transitionDelay:r}=getComputedStyle(e),[o,i]=[s,r].map(l=>{let[u=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return u}),a=o+i;if(a!==0){n.group(u=>{u.setTimeout(()=>{t(),u.dispose()},a),u.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&u.dispose()})});let l=n.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function s5(e,t,n,s){let r=n?"enter":"leave",o=$s(),i=s!==void 0?t5(s):()=>{};r==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Le(r,{enter:()=>t.enter,leave:()=>t.leave}),l=Le(r,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=Le(r,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Zu(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Yu(e,...t.base,...a,...u),o.nextFrame(()=>{Zu(e,...t.base,...a,...u),Yu(e,...t.base,...a,...l),n5(e,()=>(Zu(e,...t.base,...a),Yu(e,...t.base,...t.entered),i()))}),o.dispose}function r5({immediate:e,container:t,direction:n,classes:s,onStart:r,onStop:o}){let i=Bc(),a=as(),l=Mt(n);ze(()=>{e&&(l.current="enter")},[e]),ze(()=>{let u=$s();a.add(u.dispose);let d=t.current;if(d&&l.current!=="idle"&&i.current)return u.dispose(),r.current(l.current),u.add(s5(d,s.current,l.current==="enter",()=>{u.dispose(),o.current(l.current)})),u.dispose},[n])}function mr(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Wc=h.createContext(null);Wc.displayName="TransitionContext";var o5=(e=>(e.Visible="visible",e.Hidden="hidden",e))(o5||{});function i5(){let e=h.useContext(Wc);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function a5(){let e=h.useContext(Gc);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Gc=h.createContext(null);Gc.displayName="NestingContext";function qc(e){return"children"in e?qc(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Uv(e,t){let n=Mt(e),s=h.useRef([]),r=Bc(),o=as(),i=ae((g,m=_r.Hidden)=>{let b=s.current.findIndex(({el:v})=>v===g);b!==-1&&(Le(m,{[_r.Unmount](){s.current.splice(b,1)},[_r.Hidden](){s.current[b].state="hidden"}}),o.microTask(()=>{var v;!qc(s)&&r.current&&((v=n.current)==null||v.call(n))}))}),a=ae(g=>{let m=s.current.find(({el:b})=>b===g);return m?m.state!=="visible"&&(m.state="visible"):s.current.push({el:g,state:"visible"}),()=>i(g,_r.Unmount)}),l=h.useRef([]),u=h.useRef(Promise.resolve()),d=h.useRef({enter:[],leave:[],idle:[]}),f=ae((g,m,b)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([v])=>v!==g)),t==null||t.chains.current[m].push([g,new Promise(v=>{l.current.push(v)})]),t==null||t.chains.current[m].push([g,new Promise(v=>{Promise.all(d.current[m].map(([x,y])=>y)).then(()=>v())})]),m==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),p=ae((g,m,b)=>{Promise.all(d.current[m].splice(0).map(([v,x])=>x)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>b(m))});return h.useMemo(()=>({children:s,register:a,unregister:i,onStart:f,onStop:p,wait:u,chains:d}),[a,i,s,f,p,d,u])}function l5(){}let c5=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Sg(e){var t;let n={};for(let s of c5)n[s]=(t=e[s])!=null?t:l5;return n}function u5(e){let t=h.useRef(Sg(e));return h.useEffect(()=>{t.current=Sg(e)},[e]),t}let d5="div",Wv=gn.RenderStrategy;function f5(e,t){var n,s;let{beforeEnter:r,afterEnter:o,beforeLeave:i,afterLeave:a,enter:l,enterFrom:u,enterTo:d,entered:f,leave:p,leaveFrom:g,leaveTo:m,...b}=e,v=h.useRef(null),x=Ue(v,t),y=(n=b.unmount)==null||n?_r.Unmount:_r.Hidden,{show:w,appear:S,initial:C}=i5(),[j,E]=h.useState(w?"visible":"hidden"),_=a5(),{register:T,unregister:P}=_;h.useEffect(()=>T(v),[T,v]),h.useEffect(()=>{if(y===_r.Hidden&&v.current){if(w&&j!=="visible"){E("visible");return}return Le(j,{hidden:()=>P(v),visible:()=>T(v)})}},[j,v,T,P,w,y]);let A=Mt({base:mr(b.className),enter:mr(l),enterFrom:mr(u),enterTo:mr(d),entered:mr(f),leave:mr(p),leaveFrom:mr(g),leaveTo:mr(m)}),M=u5({beforeEnter:r,afterEnter:o,beforeLeave:i,afterLeave:a}),R=Ic();h.useEffect(()=>{if(R&&j==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,j,R]);let F=C&&!S,L=S&&w&&C,B=!R||F?"idle":w?"enter":"leave",q=Dv(0),H=ae(W=>Le(W,{enter:()=>{q.addFlag(dt.Opening),M.current.beforeEnter()},leave:()=>{q.addFlag(dt.Closing),M.current.beforeLeave()},idle:()=>{}})),$=ae(W=>Le(W,{enter:()=>{q.removeFlag(dt.Opening),M.current.afterEnter()},leave:()=>{q.removeFlag(dt.Closing),M.current.afterLeave()},idle:()=>{}})),I=Uv(()=>{E("hidden"),P(v)},_),O=h.useRef(!1);r5({immediate:L,container:v,classes:A,direction:B,onStart:Mt(W=>{O.current=!0,I.onStart(v,W,H)}),onStop:Mt(W=>{O.current=!1,I.onStop(v,W,$),W==="leave"&&!qc(I)&&(E("hidden"),P(v))})});let V=b,G={ref:x};return L?V={...V,className:fc(b.className,...A.current.enter,...A.current.enterFrom)}:O.current&&(V.className=fc(b.className,(s=v.current)==null?void 0:s.className),V.className===""&&delete V.className),h.createElement(Gc.Provider,{value:I},h.createElement(Da,{value:Le(j,{visible:dt.Open,hidden:dt.Closed})|q.flags},De({ourProps:G,theirProps:V,defaultTag:d5,features:Wv,visible:j==="visible",name:"Transition.Child"})))}function p5(e,t){let{show:n,appear:s=!1,unmount:r=!0,...o}=e,i=h.useRef(null),a=Ue(i,t);Ic();let l=Lo();if(n===void 0&&l!==null&&(n=(l&dt.Open)===dt.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=h.useState(n?"visible":"hidden"),f=Uv(()=>{d("hidden")}),[p,g]=h.useState(!0),m=h.useRef([n]);ze(()=>{p!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),g(!1))},[m,n]);let b=h.useMemo(()=>({show:n,appear:s,initial:p}),[n,s,p]);h.useEffect(()=>{if(n)d("visible");else if(!qc(f))d("hidden");else{let w=i.current;if(!w)return;let S=w.getBoundingClientRect();S.x===0&&S.y===0&&S.width===0&&S.height===0&&d("hidden")}},[n,f]);let v={unmount:r},x=ae(()=>{var w;p&&g(!1),(w=e.beforeEnter)==null||w.call(e)}),y=ae(()=>{var w;p&&g(!1),(w=e.beforeLeave)==null||w.call(e)});return h.createElement(Gc.Provider,{value:f},h.createElement(Wc.Provider,{value:b},De({ourProps:{...v,as:h.Fragment,children:h.createElement(Gv,{ref:a,...v,...o,beforeEnter:x,beforeLeave:y})},theirProps:{},defaultTag:h.Fragment,features:Wv,visible:u==="visible",name:"Transition"})))}function h5(e,t){let n=h.useContext(Wc)!==null,s=Lo()!==null;return h.createElement(h.Fragment,null,!n&&s?h.createElement(tf,{ref:t,...e}):h.createElement(Gv,{ref:t,...e}))}let tf=He(p5),Gv=He(f5),g5=He(h5),Ap=Object.assign(tf,{Child:g5,Root:tf});var Cg=function(t){return t.reduce(function(n,s){var r=s[0],o=s[1];return n[r]=o,n},{})},jg=typeof window<"u"&&window.document&&window.document.createElement?et.useLayoutEffect:et.useEffect,pn="top",Yn="bottom",Zn="right",hn="left",Np="auto",za=[pn,Yn,Zn,hn],pi="start",ha="end",m5="clippingParents",qv="viewport",ki="popper",b5="reference",Eg=za.reduce(function(e,t){return e.concat([t+"-"+pi,t+"-"+ha])},[]),Kv=[].concat(za,[Np]).reduce(function(e,t){return e.concat([t,t+"-"+pi,t+"-"+ha])},[]),v5="beforeRead",y5="read",x5="afterRead",w5="beforeMain",S5="main",C5="afterMain",j5="beforeWrite",E5="write",P5="afterWrite",_5=[v5,y5,x5,w5,S5,C5,j5,E5,P5];function ks(e){return e?(e.nodeName||"").toLowerCase():null}function On(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function jo(e){var t=On(e).Element;return e instanceof t||e instanceof Element}function qn(e){var t=On(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Mp(e){if(typeof ShadowRoot>"u")return!1;var t=On(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function T5(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var s=t.styles[n]||{},r=t.attributes[n]||{},o=t.elements[n];!qn(o)||!ks(o)||(Object.assign(o.style,s),Object.keys(r).forEach(function(i){var a=r[i];a===!1?o.removeAttribute(i):o.setAttribute(i,a===!0?"":a)}))})}function O5(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(s){var r=t.elements[s],o=t.attributes[s]||{},i=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:n[s]),a=i.reduce(function(l,u){return l[u]="",l},{});!qn(r)||!ks(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(l){r.removeAttribute(l)}))})}}const A5={name:"applyStyles",enabled:!0,phase:"write",fn:T5,effect:O5,requires:["computeStyles"]};function Rs(e){return e.split("-")[0]}var ho=Math.max,pc=Math.min,hi=Math.round;function nf(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Yv(){return!/^((?!chrome|android).)*safari/i.test(nf())}function gi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var s=e.getBoundingClientRect(),r=1,o=1;t&&qn(e)&&(r=e.offsetWidth>0&&hi(s.width)/e.offsetWidth||1,o=e.offsetHeight>0&&hi(s.height)/e.offsetHeight||1);var i=jo(e)?On(e):window,a=i.visualViewport,l=!Yv()&&n,u=(s.left+(l&&a?a.offsetLeft:0))/r,d=(s.top+(l&&a?a.offsetTop:0))/o,f=s.width/r,p=s.height/o;return{width:f,height:p,top:d,right:u+f,bottom:d+p,left:u,x:u,y:d}}function Lp(e){var t=gi(e),n=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:s}}function Zv(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Mp(n)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function or(e){return On(e).getComputedStyle(e)}function N5(e){return["table","td","th"].indexOf(ks(e))>=0}function Wr(e){return((jo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Kc(e){return ks(e)==="html"?e:e.assignedSlot||e.parentNode||(Mp(e)?e.host:null)||Wr(e)}function Pg(e){return!qn(e)||or(e).position==="fixed"?null:e.offsetParent}function M5(e){var t=/firefox/i.test(nf()),n=/Trident/i.test(nf());if(n&&qn(e)){var s=or(e);if(s.position==="fixed")return null}var r=Kc(e);for(Mp(r)&&(r=r.host);qn(r)&&["html","body"].indexOf(ks(r))<0;){var o=or(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function Ua(e){for(var t=On(e),n=Pg(e);n&&N5(n)&&or(n).position==="static";)n=Pg(n);return n&&(ks(n)==="html"||ks(n)==="body"&&or(n).position==="static")?t:n||M5(e)||t}function Rp(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Xi(e,t,n){return ho(e,pc(t,n))}function L5(e,t,n){var s=Xi(e,t,n);return s>n?n:s}function Xv(){return{top:0,right:0,bottom:0,left:0}}function Jv(e){return Object.assign({},Xv(),e)}function Qv(e,t){return t.reduce(function(n,s){return n[s]=e,n},{})}var R5=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Jv(typeof t!="number"?t:Qv(t,za))};function $5(e){var t,n=e.state,s=e.name,r=e.options,o=n.elements.arrow,i=n.modifiersData.popperOffsets,a=Rs(n.placement),l=Rp(a),u=[hn,Zn].indexOf(a)>=0,d=u?"height":"width";if(!(!o||!i)){var f=R5(r.padding,n),p=Lp(o),g=l==="y"?pn:hn,m=l==="y"?Yn:Zn,b=n.rects.reference[d]+n.rects.reference[l]-i[l]-n.rects.popper[d],v=i[l]-n.rects.reference[l],x=Ua(o),y=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,w=b/2-v/2,S=f[g],C=y-p[d]-f[m],j=y/2-p[d]/2+w,E=Xi(S,j,C),_=l;n.modifiersData[s]=(t={},t[_]=E,t.centerOffset=E-j,t)}}function k5(e){var t=e.state,n=e.options,s=n.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||Zv(t.elements.popper,r)&&(t.elements.arrow=r))}const V5={name:"arrow",enabled:!0,phase:"main",fn:$5,effect:k5,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mi(e){return e.split("-")[1]}var I5={top:"auto",right:"auto",bottom:"auto",left:"auto"};function D5(e,t){var n=e.x,s=e.y,r=t.devicePixelRatio||1;return{x:hi(n*r)/r||0,y:hi(s*r)/r||0}}function _g(e){var t,n=e.popper,s=e.popperRect,r=e.placement,o=e.variation,i=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,p=i.x,g=p===void 0?0:p,m=i.y,b=m===void 0?0:m,v=typeof d=="function"?d({x:g,y:b}):{x:g,y:b};g=v.x,b=v.y;var x=i.hasOwnProperty("x"),y=i.hasOwnProperty("y"),w=hn,S=pn,C=window;if(u){var j=Ua(n),E="clientHeight",_="clientWidth";if(j===On(n)&&(j=Wr(n),or(j).position!=="static"&&a==="absolute"&&(E="scrollHeight",_="scrollWidth")),j=j,r===pn||(r===hn||r===Zn)&&o===ha){S=Yn;var T=f&&j===C&&C.visualViewport?C.visualViewport.height:j[E];b-=T-s.height,b*=l?1:-1}if(r===hn||(r===pn||r===Yn)&&o===ha){w=Zn;var P=f&&j===C&&C.visualViewport?C.visualViewport.width:j[_];g-=P-s.width,g*=l?1:-1}}var A=Object.assign({position:a},u&&I5),M=d===!0?D5({x:g,y:b},On(n)):{x:g,y:b};if(g=M.x,b=M.y,l){var R;return Object.assign({},A,(R={},R[S]=y?"0":"",R[w]=x?"0":"",R.transform=(C.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",R))}return Object.assign({},A,(t={},t[S]=y?b+"px":"",t[w]=x?g+"px":"",t.transform="",t))}function H5(e){var t=e.state,n=e.options,s=n.gpuAcceleration,r=s===void 0?!0:s,o=n.adaptive,i=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,u={placement:Rs(t.placement),variation:mi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,_g(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,_g(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const F5={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:H5,data:{}};var bl={passive:!0};function B5(e){var t=e.state,n=e.instance,s=e.options,r=s.scroll,o=r===void 0?!0:r,i=s.resize,a=i===void 0?!0:i,l=On(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,bl)}),a&&l.addEventListener("resize",n.update,bl),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,bl)}),a&&l.removeEventListener("resize",n.update,bl)}}const z5={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:B5,data:{}};var U5={left:"right",right:"left",bottom:"top",top:"bottom"};function Xl(e){return e.replace(/left|right|bottom|top/g,function(t){return U5[t]})}var W5={start:"end",end:"start"};function Tg(e){return e.replace(/start|end/g,function(t){return W5[t]})}function $p(e){var t=On(e),n=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:n,scrollTop:s}}function kp(e){return gi(Wr(e)).left+$p(e).scrollLeft}function G5(e,t){var n=On(e),s=Wr(e),r=n.visualViewport,o=s.clientWidth,i=s.clientHeight,a=0,l=0;if(r){o=r.width,i=r.height;var u=Yv();(u||!u&&t==="fixed")&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:i,x:a+kp(e),y:l}}function q5(e){var t,n=Wr(e),s=$p(e),r=(t=e.ownerDocument)==null?void 0:t.body,o=ho(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),i=ho(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+kp(e),l=-s.scrollTop;return or(r||n).direction==="rtl"&&(a+=ho(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:i,x:a,y:l}}function Vp(e){var t=or(e),n=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+s)}function e0(e){return["html","body","#document"].indexOf(ks(e))>=0?e.ownerDocument.body:qn(e)&&Vp(e)?e:e0(Kc(e))}function Ji(e,t){var n;t===void 0&&(t=[]);var s=e0(e),r=s===((n=e.ownerDocument)==null?void 0:n.body),o=On(s),i=r?[o].concat(o.visualViewport||[],Vp(s)?s:[]):s,a=t.concat(i);return r?a:a.concat(Ji(Kc(i)))}function sf(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function K5(e,t){var n=gi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Og(e,t,n){return t===qv?sf(G5(e,n)):jo(t)?K5(t,n):sf(q5(Wr(e)))}function Y5(e){var t=Ji(Kc(e)),n=["absolute","fixed"].indexOf(or(e).position)>=0,s=n&&qn(e)?Ua(e):e;return jo(s)?t.filter(function(r){return jo(r)&&Zv(r,s)&&ks(r)!=="body"}):[]}function Z5(e,t,n,s){var r=t==="clippingParents"?Y5(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce(function(l,u){var d=Og(e,u,s);return l.top=ho(d.top,l.top),l.right=pc(d.right,l.right),l.bottom=pc(d.bottom,l.bottom),l.left=ho(d.left,l.left),l},Og(e,i,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function t0(e){var t=e.reference,n=e.element,s=e.placement,r=s?Rs(s):null,o=s?mi(s):null,i=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(r){case pn:l={x:i,y:t.y-n.height};break;case Yn:l={x:i,y:t.y+t.height};break;case Zn:l={x:t.x+t.width,y:a};break;case hn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=r?Rp(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case pi:l[u]=l[u]-(t[d]/2-n[d]/2);break;case ha:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function ga(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=s===void 0?e.placement:s,o=n.strategy,i=o===void 0?e.strategy:o,a=n.boundary,l=a===void 0?m5:a,u=n.rootBoundary,d=u===void 0?qv:u,f=n.elementContext,p=f===void 0?ki:f,g=n.altBoundary,m=g===void 0?!1:g,b=n.padding,v=b===void 0?0:b,x=Jv(typeof v!="number"?v:Qv(v,za)),y=p===ki?b5:ki,w=e.rects.popper,S=e.elements[m?y:p],C=Z5(jo(S)?S:S.contextElement||Wr(e.elements.popper),l,d,i),j=gi(e.elements.reference),E=t0({reference:j,element:w,strategy:"absolute",placement:r}),_=sf(Object.assign({},w,E)),T=p===ki?_:j,P={top:C.top-T.top+x.top,bottom:T.bottom-C.bottom+x.bottom,left:C.left-T.left+x.left,right:T.right-C.right+x.right},A=e.modifiersData.offset;if(p===ki&&A){var M=A[r];Object.keys(P).forEach(function(R){var F=[Zn,Yn].indexOf(R)>=0?1:-1,L=[pn,Yn].indexOf(R)>=0?"y":"x";P[R]+=M[L]*F})}return P}function X5(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=n.boundary,o=n.rootBoundary,i=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Kv:l,d=mi(s),f=d?a?Eg:Eg.filter(function(m){return mi(m)===d}):za,p=f.filter(function(m){return u.indexOf(m)>=0});p.length===0&&(p=f);var g=p.reduce(function(m,b){return m[b]=ga(e,{placement:b,boundary:r,rootBoundary:o,padding:i})[Rs(b)],m},{});return Object.keys(g).sort(function(m,b){return g[m]-g[b]})}function J5(e){if(Rs(e)===Np)return[];var t=Xl(e);return[Tg(e),t,Tg(t)]}function Q5(e){var t=e.state,n=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,i=n.altAxis,a=i===void 0?!0:i,l=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,g=n.flipVariations,m=g===void 0?!0:g,b=n.allowedAutoPlacements,v=t.options.placement,x=Rs(v),y=x===v,w=l||(y||!m?[Xl(v)]:J5(v)),S=[v].concat(w).reduce(function(W,K){return W.concat(Rs(K)===Np?X5(t,{placement:K,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:b}):K)},[]),C=t.rects.reference,j=t.rects.popper,E=new Map,_=!0,T=S[0],P=0;P<S.length;P++){var A=S[P],M=Rs(A),R=mi(A)===pi,F=[pn,Yn].indexOf(M)>=0,L=F?"width":"height",B=ga(t,{placement:A,boundary:d,rootBoundary:f,altBoundary:p,padding:u}),q=F?R?Zn:hn:R?Yn:pn;C[L]>j[L]&&(q=Xl(q));var H=Xl(q),$=[];if(o&&$.push(B[M]<=0),a&&$.push(B[q]<=0,B[H]<=0),$.every(function(W){return W})){T=A,_=!1;break}E.set(A,$)}if(_)for(var I=m?3:1,O=function(K){var J=S.find(function(Y){var U=E.get(Y);if(U)return U.slice(0,K).every(function(Q){return Q})});if(J)return T=J,"break"},V=I;V>0;V--){var G=O(V);if(G==="break")break}t.placement!==T&&(t.modifiersData[s]._skip=!0,t.placement=T,t.reset=!0)}}const eO={name:"flip",enabled:!0,phase:"main",fn:Q5,requiresIfExists:["offset"],data:{_skip:!1}};function Ag(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ng(e){return[pn,Zn,Yn,hn].some(function(t){return e[t]>=0})}function tO(e){var t=e.state,n=e.name,s=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,i=ga(t,{elementContext:"reference"}),a=ga(t,{altBoundary:!0}),l=Ag(i,s),u=Ag(a,r,o),d=Ng(l),f=Ng(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const nO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:tO};function sO(e,t,n){var s=Rs(e),r=[hn,pn].indexOf(s)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=o[0],a=o[1];return i=i||0,a=(a||0)*r,[hn,Zn].indexOf(s)>=0?{x:a,y:i}:{x:i,y:a}}function rO(e){var t=e.state,n=e.options,s=e.name,r=n.offset,o=r===void 0?[0,0]:r,i=Kv.reduce(function(d,f){return d[f]=sO(f,t.rects,o),d},{}),a=i[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[s]=i}const oO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:rO};function iO(e){var t=e.state,n=e.name;t.modifiersData[n]=t0({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const aO={name:"popperOffsets",enabled:!0,phase:"read",fn:iO,data:{}};function lO(e){return e==="x"?"y":"x"}function cO(e){var t=e.state,n=e.options,s=e.name,r=n.mainAxis,o=r===void 0?!0:r,i=n.altAxis,a=i===void 0?!1:i,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,g=p===void 0?!0:p,m=n.tetherOffset,b=m===void 0?0:m,v=ga(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:d}),x=Rs(t.placement),y=mi(t.placement),w=!y,S=Rp(x),C=lO(S),j=t.modifiersData.popperOffsets,E=t.rects.reference,_=t.rects.popper,T=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,P=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(j){if(o){var R,F=S==="y"?pn:hn,L=S==="y"?Yn:Zn,B=S==="y"?"height":"width",q=j[S],H=q+v[F],$=q-v[L],I=g?-_[B]/2:0,O=y===pi?E[B]:_[B],V=y===pi?-_[B]:-E[B],G=t.elements.arrow,W=g&&G?Lp(G):{width:0,height:0},K=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Xv(),J=K[F],Y=K[L],U=Xi(0,E[B],W[B]),Q=w?E[B]/2-I-U-J-P.mainAxis:O-U-J-P.mainAxis,se=w?-E[B]/2+I+U+Y+P.mainAxis:V+U+Y+P.mainAxis,de=t.elements.arrow&&Ua(t.elements.arrow),Se=de?S==="y"?de.clientTop||0:de.clientLeft||0:0,ne=(R=A==null?void 0:A[S])!=null?R:0,Te=q+Q-ne-Se,ke=q+se-ne,it=Xi(g?pc(H,Te):H,q,g?ho($,ke):$);j[S]=it,M[S]=it-q}if(a){var st,xe=S==="x"?pn:hn,Ze=S==="x"?Yn:Zn,Xe=j[C],ft=C==="y"?"height":"width",Ae=Xe+v[xe],at=Xe-v[Ze],rt=[pn,hn].indexOf(x)!==-1,Ie=(st=A==null?void 0:A[C])!=null?st:0,Wt=rt?Ae:Xe-E[ft]-_[ft]-Ie+P.altAxis,ge=rt?Xe+E[ft]+_[ft]-Ie-P.altAxis:at,$e=g&&rt?L5(Wt,Xe,ge):Xi(g?Wt:Ae,Xe,g?ge:at);j[C]=$e,M[C]=$e-Xe}t.modifiersData[s]=M}}const uO={name:"preventOverflow",enabled:!0,phase:"main",fn:cO,requiresIfExists:["offset"]};function dO(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function fO(e){return e===On(e)||!qn(e)?$p(e):dO(e)}function pO(e){var t=e.getBoundingClientRect(),n=hi(t.width)/e.offsetWidth||1,s=hi(t.height)/e.offsetHeight||1;return n!==1||s!==1}function hO(e,t,n){n===void 0&&(n=!1);var s=qn(t),r=qn(t)&&pO(t),o=Wr(t),i=gi(e,r,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&((ks(t)!=="body"||Vp(o))&&(a=fO(t)),qn(t)?(l=gi(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=kp(o))),{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function gO(e){var t=new Map,n=new Set,s=[];e.forEach(function(o){t.set(o.name,o)});function r(o){n.add(o.name);var i=[].concat(o.requires||[],o.requiresIfExists||[]);i.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&r(l)}}),s.push(o)}return e.forEach(function(o){n.has(o.name)||r(o)}),s}function mO(e){var t=gO(e);return _5.reduce(function(n,s){return n.concat(t.filter(function(r){return r.phase===s}))},[])}function bO(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function vO(e){var t=e.reduce(function(n,s){var r=n[s.name];return n[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,n},{});return Object.keys(t).map(function(n){return t[n]})}var Mg={placement:"bottom",modifiers:[],strategy:"absolute"};function Lg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function yO(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,s=n===void 0?[]:n,r=t.defaultOptions,o=r===void 0?Mg:r;return function(a,l,u){u===void 0&&(u=o);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Mg,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],p=!1,g={state:d,setOptions:function(x){var y=typeof x=="function"?x(d.options):x;b(),d.options=Object.assign({},o,d.options,y),d.scrollParents={reference:jo(a)?Ji(a):a.contextElement?Ji(a.contextElement):[],popper:Ji(l)};var w=mO(vO([].concat(s,d.options.modifiers)));return d.orderedModifiers=w.filter(function(S){return S.enabled}),m(),g.update()},forceUpdate:function(){if(!p){var x=d.elements,y=x.reference,w=x.popper;if(Lg(y,w)){d.rects={reference:hO(y,Ua(w),d.options.strategy==="fixed"),popper:Lp(w)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(P){return d.modifiersData[P.name]=Object.assign({},P.data)});for(var S=0;S<d.orderedModifiers.length;S++){if(d.reset===!0){d.reset=!1,S=-1;continue}var C=d.orderedModifiers[S],j=C.fn,E=C.options,_=E===void 0?{}:E,T=C.name;typeof j=="function"&&(d=j({state:d,options:_,name:T,instance:g})||d)}}}},update:bO(function(){return new Promise(function(v){g.forceUpdate(),v(d)})}),destroy:function(){b(),p=!0}};if(!Lg(a,l))return g;g.setOptions(u).then(function(v){!p&&u.onFirstUpdate&&u.onFirstUpdate(v)});function m(){d.orderedModifiers.forEach(function(v){var x=v.name,y=v.options,w=y===void 0?{}:y,S=v.effect;if(typeof S=="function"){var C=S({state:d,name:x,instance:g,options:w}),j=function(){};f.push(C||j)}})}function b(){f.forEach(function(v){return v()}),f=[]}return g}}var xO=[z5,aO,F5,A5,oO,eO,uO,V5,nO],wO=yO({defaultModifiers:xO}),SO=typeof Element<"u",CO=typeof Map=="function",jO=typeof Set=="function",EO=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Jl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,s,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!Jl(e[s],t[s]))return!1;return!0}var o;if(CO&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(s=o.next()).done;)if(!t.has(s.value[0]))return!1;for(o=e.entries();!(s=o.next()).done;)if(!Jl(s.value[1],t.get(s.value[0])))return!1;return!0}if(jO&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(s=o.next()).done;)if(!t.has(s.value[0]))return!1;return!0}if(EO&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(e[s]!==t[s])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[s]))return!1;if(SO&&e instanceof Element)return!1;for(s=n;s--!==0;)if(!((r[s]==="_owner"||r[s]==="__v"||r[s]==="__o")&&e.$$typeof)&&!Jl(e[r[s]],t[r[s]]))return!1;return!0}return e!==e&&t!==t}var PO=function(t,n){try{return Jl(t,n)}catch(s){if((s.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw s}};const _O=Bf(PO);var TO=[],Wa=function(t,n,s){s===void 0&&(s={});var r=et.useRef(null),o={onFirstUpdate:s.onFirstUpdate,placement:s.placement||"bottom",strategy:s.strategy||"absolute",modifiers:s.modifiers||TO},i=et.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=i[0],l=i[1],u=et.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(g){var m=g.state,b=Object.keys(m.elements);iw.flushSync(function(){l({styles:Cg(b.map(function(v){return[v,m.styles[v]||{}]})),attributes:Cg(b.map(function(v){return[v,m.attributes[v]]}))})})},requires:["computeStyles"]}},[]),d=et.useMemo(function(){var p={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[u,{name:"applyStyles",enabled:!1}])};return _O(r.current,p)?r.current||p:(r.current=p,p)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,u]),f=et.useRef();return jg(function(){f.current&&f.current.setOptions(d)},[d]),jg(function(){if(!(t==null||n==null)){var p=s.createPopper||wO,g=p(t,n,d);return f.current=g,function(){g.destroy(),f.current=null}}},[t,n,s.createPopper]),{state:f.current?f.current.state:null,styles:a.styles,attributes:a.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}};const Xn=h.forwardRef(function({children:t,title:n,onClose:s,icon:r,skipOverflow:o,shadow:i=!0,padding:a=!0,border:l=!0,round:u=!0,className:d,classNameBody:f,size:p="m",titleClass:g=ee("gs-utl-mb-2 gs-utl-mt-0.5"),style:m,bg:b,...v},x){const y=ur(r)?r:{};return c.jsxs("div",{...v,ref:x,style:m,className:ee(["gs-utl-card",d,b||np.bg,re.b,u&&re.rnd,l?z.br:re.bT,!o&&"gs-utl-overflow-auto",i&&"gs-utl-shadow-md",a&&p==="l"&&"gs-utl-p-5",a&&p==="m"&&"gs-utl-px-4 gs-utl-py-2",a&&p==="s"&&"gs-utl-px-2 gs-utl-py-1",a&&p==="xs"&&"gs-utl-px-2 gs-utl-py-0.5",a&&p==="x2s"&&"gs-utl-px-0.5"]),children:[(n||s)&&n!==!1&&c.jsxs(k,{className:ee("gs-utl-card-title",g),items:"center",children:[c.jsx(D,{className:ee("truncate"),grow:!0,children:n}),(s||r)&&c.jsx(D,{onClick:s,className:ee("cursor-pointer transition-opacity opacity-50 hover:gs-utl-opacity-100"),children:c.jsx(oe,{icon:(ot(r)?r:"")||Z.close,size:"18px",...y})})]}),c.jsx("div",{className:ee("gs-utl-card-body",f),children:t})]})});var vl,OO=new Uint8Array(16);function AO(){if(!vl&&(vl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!vl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vl(OO)}const NO=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function MO(e){return typeof e=="string"&&NO.test(e)}var Ft=[];for(var Xu=0;Xu<256;++Xu)Ft.push((Xu+256).toString(16).substr(1));function LO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Ft[e[t+0]]+Ft[e[t+1]]+Ft[e[t+2]]+Ft[e[t+3]]+"-"+Ft[e[t+4]]+Ft[e[t+5]]+"-"+Ft[e[t+6]]+Ft[e[t+7]]+"-"+Ft[e[t+8]]+Ft[e[t+9]]+"-"+Ft[e[t+10]]+Ft[e[t+11]]+Ft[e[t+12]]+Ft[e[t+13]]+Ft[e[t+14]]+Ft[e[t+15]]).toLowerCase();if(!MO(n))throw TypeError("Stringified UUID is invalid");return n}function n0(e,t,n){e=e||{};var s=e.random||(e.rng||AO)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,LO(s)}class RO extends Error{constructor(t,n){super(t),this.error=t,this.errorData=n}}const Vi=async(e,{onError:t,onLoading:n,onResult:s,params:r,rawText:o,...i})=>{try{n==null||n(!0);const a=r?new URLSearchParams(r).toString():"",l=a?`?${a}`:"",u=await fetch(`${e}${l}`,i);if(!u.ok){const f=await u.json();throw new RO(f.error||"Request failed!",f.errorData)}let d;if(o)d=await u.text();else try{d=await u.json()}catch{d=void 0}return s==null||s(d),d}catch(a){const l=a instanceof Error?a:new Error(a);if(t==null||t(l),i.throwError)throw l;return l}finally{n==null||n(!1)}};class Is{static async get(t,n){return Vi(t,{...n,method:"GET"})}static async post(t,n){return Vi(t,{...n,method:"POST"})}static async put(t,n){return Vi(t,{...n,method:"PUT"})}static async patch(t,n){return Vi(t,{...n,method:"PATCH"})}static async delete(t,n){return Vi(t,{...n,method:"DELETE"})}}var Yc=(e=>(e.Projects="projects",e.Settings="settings",e))(Yc||{}),s0=(e=>(e.gjs="gjs",e.gjsStudio="gjs-studio",e))(s0||{});const Rg={},$O=1,kO=(e={})=>new Promise((t,n)=>{const s=(e==null?void 0:e.db)||"gjs",r=s==="gjs-studio"?$O:1,o=Rg[s];if(o)t(o);else{if(!Vs())return n(new Error("window context not found"));const i=window.indexedDB.open(s,r);i.onerror=n,i.onsuccess=()=>{const a=i.result;a.onerror=n,Rg[s]=a,t(a)},i.onupgradeneeded=()=>{const a=i.result;a.objectStoreNames.contains("projects")||a.createObjectStore("projects"),a.objectStoreNames.contains("settings")||a.createObjectStore("settings")}}}),Ip=async(e,t)=>(await kO(t)).transaction([e],"readwrite").objectStore(e),VO=async(e,t)=>{const n=await Ip(e,t);return new Promise((s,r)=>{const o=[],i=n.openCursor();i.onerror=r,i.onsuccess=function(a){const u=a.target.result;if(u){const d=u.primaryKey,f=u.value;o.push({key:d,data:f}),u.continue()}else s(o)}})},IO=async(e,t,n)=>{const s=await Ip(e,n);return new Promise((r,o)=>{const i=s.get(t);i.onerror=o,i.onsuccess=()=>r(i.result)})},DO=async(e,t,n)=>{const s=await Ip(e,n);return new Promise((r,o)=>{const i=s.delete(t);i.onerror=o,i.onsuccess=()=>r()})};var ma=(e=>(e.Existing="existing",e.Templates="templates",e))(ma||{});const HO=e=>{const t=PA();return`${(t==null?void 0:t.baseApiUrl)||"/api"}/templates/${e}`},FO=(e,t)=>Is.get(HO(e),{...t}),BO=async e=>{try{const t=await FO(e);return(t==null?void 0:t.result)??[]}catch(t){return console.error(`Failed to load templates for type ${e}:`,t),[]}},r0=async(e=yt.web)=>typeof window>"u"?[]:(await VO(Yc.Projects)).map(({key:s,data:r})=>{var o;return{id:`${s}`,name:`${((o=r.custom)==null?void 0:o.projectName)||s}`,data:r}}).filter(s=>{var r;return((r=s.data.custom)==null?void 0:r.projectType)===e}),o0=new Set,_n=new WeakMap,si=new WeakMap,Eo=new WeakMap,rf=new WeakMap,zO=new WeakMap,bi=new WeakMap,hc=new WeakMap;let Vr;const ao="__aa_tgt",of="__aa_del",UO=e=>{const t=YO(e);t&&t.forEach(n=>ZO(n))},WO=e=>{e.forEach(t=>{t.target===Vr&&qO(),_n.has(t.target)&&$o(t.target)})};function GO(e){const t=rf.get(e);t==null||t.disconnect();let n=_n.get(e),s=0;const r=5;n||(n=vi(e),_n.set(e,n));const{offsetWidth:o,offsetHeight:i}=Vr,l=[n.top-r,o-(n.left+r+n.width),i-(n.top+r+n.height),n.left-r].map(d=>`${-1*Math.floor(d)}px`).join(" "),u=new IntersectionObserver(()=>{++s>1&&$o(e)},{root:Vr,threshold:1,rootMargin:l});u.observe(e),rf.set(e,u)}function $o(e){clearTimeout(hc.get(e));const t=Zc(e),n=typeof t=="function"?500:t.duration;hc.set(e,setTimeout(()=>{const s=Eo.get(e);(!s||s.finished)&&(_n.set(e,vi(e)),GO(e))},n))}function qO(){clearTimeout(hc.get(Vr)),hc.set(Vr,setTimeout(()=>{o0.forEach(e=>l0(e,t=>i0(()=>$o(t))))},100))}function KO(e){setTimeout(()=>{zO.set(e,setInterval(()=>i0($o.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function i0(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let af,Qo;typeof window<"u"&&(Vr=document.documentElement,af=new MutationObserver(UO),Qo=new ResizeObserver(WO),Qo.observe(Vr));function YO(e){return e.reduce((t,n)=>{if(t===!1)return!1;if(n.target instanceof Element){if(Ju(n.target),!t.has(n.target)){t.add(n.target);for(let s=0;s<n.target.children.length;s++){const r=n.target.children.item(s);if(r){if(of in r)return!1;Ju(n.target,r),t.add(r)}}}if(n.removedNodes.length)for(let s=0;s<n.removedNodes.length;s++){const r=n.removedNodes[s];if(of in r)return!1;r instanceof Element&&(t.add(r),Ju(n.target,r),si.set(r,[n.previousSibling,n.nextSibling]))}}return t},new Set)}function Ju(e,t){!t&&!(ao in e)?Object.defineProperty(e,ao,{value:e}):t&&!(ao in t)&&Object.defineProperty(t,ao,{value:e})}function ZO(e){var t;const n=Vr.contains(e),s=_n.has(e);n&&si.has(e)&&si.delete(e),Eo.has(e)&&((t=Eo.get(e))===null||t===void 0||t.cancel()),s&&n?XO(e):s&&!n?QO(e):JO(e)}function ys(e){return Number(e.replace(/[^0-9.\-]/g,""))}function vi(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX,width:t.width,height:t.height}}function a0(e,t,n){let s=t.width,r=t.height,o=n.width,i=n.height;const a=getComputedStyle(e);if(a.getPropertyValue("box-sizing")==="content-box"){const u=ys(a.paddingTop)+ys(a.paddingBottom)+ys(a.borderTopWidth)+ys(a.borderBottomWidth),d=ys(a.paddingLeft)+ys(a.paddingRight)+ys(a.borderRightWidth)+ys(a.borderLeftWidth);s-=d,o-=d,r-=u,i-=u}return[s,o,r,i].map(Math.round)}function Zc(e){return ao in e&&bi.has(e[ao])?bi.get(e[ao]):{duration:250,easing:"ease-in-out"}}function l0(e,...t){t.forEach(n=>n(e,bi.has(e)));for(let n=0;n<e.children.length;n++){const s=e.children.item(n);s&&t.forEach(r=>r(s,bi.has(s)))}}function XO(e){const t=_n.get(e),n=vi(e);let s;if(!t)return;const r=Zc(e);if(typeof r!="function"){const o=t.left-n.left,i=t.top-n.top,[a,l,u,d]=a0(e,t,n),f={transform:`translate(${o}px, ${i}px)`},p={transform:"translate(0, 0)"};a!==l&&(f.width=`${a}px`,p.width=`${l}px`),u!==d&&(f.height=`${u}px`,p.height=`${d}px`),s=e.animate([f,p],r)}else s=new Animation(r(e,"remain",t,n)),s.play();Eo.set(e,s),_n.set(e,n),s.addEventListener("finish",$o.bind(null,e))}function JO(e){const t=vi(e);_n.set(e,t);const n=Zc(e);let s;typeof n!="function"?s=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"}):(s=new Animation(n(e,"add",t)),s.play()),Eo.set(e,s),s.addEventListener("finish",$o.bind(null,e))}function QO(e){if(!si.has(e)||!_n.has(e))return;const[t,n]=si.get(e);Object.defineProperty(e,of,{value:!0}),n&&n.parentNode&&n.parentNode instanceof Element?n.parentNode.insertBefore(e,n):t&&t.parentNode&&t.parentNode.appendChild(e);const[s,r,o,i]=eA(e),a=Zc(e),l=_n.get(e);let u;Object.assign(e.style,{position:"absolute",top:`${s}px`,left:`${r}px`,width:`${o}px`,height:`${i}px`,margin:0,pointerEvents:"none",transformOrigin:"center",zIndex:100}),typeof a!="function"?u=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:a.duration,easing:"ease-out"}):(u=new Animation(a(e,"remove",l)),u.play()),Eo.set(e,u),u.addEventListener("finish",()=>{var d;e.remove(),_n.delete(e),si.delete(e),Eo.delete(e),(d=rf.get(e))===null||d===void 0||d.disconnect()})}function eA(e){const t=_n.get(e),[n,,s]=a0(e,t,vi(e));let r=e.parentElement;for(;r&&(getComputedStyle(r).position==="static"||r instanceof HTMLBodyElement);)r=r.parentElement;r||(r=document.body);const o=getComputedStyle(r),i=_n.get(r)||vi(r),a=Math.round(t.top-i.top)-ys(o.borderTopWidth),l=Math.round(t.left-i.left)-ys(o.borderLeftWidth);return[a,l,n,s]}function tA(e,t={}){af&&Qo&&(getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),l0(e,$o,KO,n=>Qo==null?void 0:Qo.observe(n)),typeof t=="function"?bi.set(e,t):bi.set(e,{duration:250,easing:"ease-in-out",...t}),af.observe(e,{childList:!0}),o0.add(e))}function nA(e){const t=h.useRef(null);return h.useEffect(()=>{t.current instanceof HTMLElement&&tA(t.current,e)},[t]),t}const sA={[nn.Info]:z.bgA,[nn.Error]:"bg-red-500",[nn.Success]:"bg-green-500",[nn.Warning]:"bg-orange-400"},rA=h.forwardRef(function(t,n){const s={[nn.Info]:Z.informationVariant,[nn.Error]:Z.fire,[nn.Success]:Z.checkBold,[nn.Warning]:Z.alertRhombus},{children:r,className:o,content:i,id:a,buttons:l=[],variant:u=nn.Info,autoHideTimeout:d=3e3}=t,f=h.useRef(null),p=h.useRef(),g=s[u],m=sA[u];h.useImperativeHandle(n,()=>f.current,[]);const b=()=>{var w;return(w=t.onDismiss)==null?void 0:w.call(t,a)},v=()=>{d&&(p.current=setTimeout(b,d))},x=()=>p.current&&clearTimeout(p.current);h.useEffect(()=>(v(),x),[]);const y=i||r;return c.jsx(Xn,{className:ue(o,"overflow-hidden relative"),ref:f,onPointerEnter:x,onPointerLeave:v,children:c.jsxs(k,{space:"m",items:"center",className:ue(je.y),children:[c.jsx(D,{className:ue(m,re.pill,"text-white gjs-p-1"),children:c.jsx(oe,{icon:g,size:le.s})}),c.jsx(D,{grow:!0,className:ue("gjs-pr-3"),children:c.jsxs(k,{col:!0,space:"xs",children:[c.jsx(D,{className:ue("text-lg font-medium leading-6"),children:t.header}),y&&c.jsx(D,{className:ue(z.txtLowEmphasis),children:y}),!!l.length&&c.jsx(k,{space:"m",justify:"end",children:l.map(({id:w,...S})=>c.jsx(Ke,{...S},w))})]})}),c.jsx(D,{className:ue("absolute top-1 right-1"),children:c.jsx(bt,{onClick:b,border:!1,children:c.jsx(oe,{icon:Z.close,size:le.s})})})]})})});fe(h.forwardRef(function({className:t,toasts:n,onDismiss:s,...r},o){const i=nA({});return c.jsx("div",{className:ue(t,"w-80 gs-utl-z-30"),...r,ref:i,children:n.map(a=>c.jsx(rA,{...a,className:ue("gjs-mb-2"),onDismiss:s},a.uuid||a.id))})}));var lf=(e=>(e.self="self",e.cloud="cloud",e))(lf||{}),go=(e=>(e.image="image",e.video="video",e))(go||{}),ts=(e=>(e.componentOutline="componentOutline",e.preview="preview",e.fullscreen="fullscreen",e.showCode="showCode",e.showImportCode="showImportCode",e.clearCanvas="clearCanvas",e.store="store",e.undo="undo",e.redo="redo",e))(ts||{}),Dp=(e=>(e.canvas="canvas",e.layers="layers",e))(Dp||{}),xr=(e=>(e.selectParent="selectParent",e.duplicate="duplicate",e.delete="delete",e.symbolCreate="symbolCreate",e.symbolDetach="symbolDetach",e.symbolOverride="symbolOverride",e.symbolOverrideClear="symbolOverrideClear",e))(xr||{}),Dt=(e=>(e.variable="data-variable",e.condition="data-condition",e.conditionTrue="data-condition-true-content",e.conditionFalse="data-condition-false-content",e.collection="data-collection",e.collectionItem="data-collection-item",e))(Dt||{}),cf=(e=>(e.browser="browser",e.self="self",e.cloud="cloud",e))(cf||{});const ba=e=>e.replaceAll('"',"").replaceAll("'",""),Po=e=>e.includes(",")?e:/\s/.test(e)?`'${ba(e)}'`:ba(e),$g=(e,t,n)=>({family:e,variant:t,...n}),Qi=(e,t)=>{e=Po(e);const{menuVariant:n,variants:s}=t;return{family:e,familyLabel:ba(e),menuVariant:n&&$g(Po(`menuFont-${ba(e)}`),"regular",n),variants:Object.assign({},...Object.entries(s).map(([r,o])=>({[r]:$g(e,r,o)})))}},Hp=(e,t)=>{var a;const n=Qi(e.family,e),s=n.menuVariant??((a=Object.values(n.variants))==null?void 0:a[0]);if(!s)return"Arial, Helvetica, sans-serif";const{source:r,descriptors:o}=s,i=ba(s.family);if(!t){const l=new FontFace(i,`url("${r}")`,o),u=Array.from(document.fonts.values()).filter(d=>d.family===i);for(const d of u)document.fonts.delete(d);document.fonts.add(l),l.load().catch(()=>{})}return Po(i)},ms=", sans-serif",kg=["Arial, Helvetica"+ms,"Arial Black, Gadget"+ms,"Brush Script MT"+ms,"Comic Sans MS, cursive"+ms,"Courier New, Courier, monospace","Georgia, serif","Helvetica"+ms,"Impact, Charcoal"+ms,"Lucida Sans Unicode, Lucida Grande"+ms,"Tahoma, Geneva"+ms,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+ms,"Verdana, Geneva"+ms].map(e=>({id:e,label:e.split(",")[0]})),oA=String.raw,Ws=(e,t)=>{if(!t)return"";const n=e[0],s=e[1];return`${n}${t}${s}`},iA=({family:e,source:t,descriptors:n})=>{const{display:s,ascentOverride:r,descentOverride:o,featureSettings:i,lineGapOverride:a,stretch:l,style:u,unicodeRange:d,weight:f}=n??{},p=[Ws`font-ascent-override: ${r};`,Ws`font-display: ${s};`,Ws`font-descent-override: ${o};`,Ws`font-feature-settings: ${i};`,Ws`font-line-gap-override: ${a};`,Ws`font-stretch: ${l};`,Ws`font-style: ${u};`,Ws`font-unicode-range: ${d};`,Ws`font-weight: ${f};`].filter(Boolean);return oA`
35
+ `));let h=d.props,g=typeof(h==null?void 0:h.className)=="function"?(...b)=>Jl(h==null?void 0:h.className(...b),c.className):Jl(h==null?void 0:h.className,c.className),m=g?{className:g}:{};return f.cloneElement(d,Object.assign({},Bb(d.props,Jo(ju(c,["ref"]))),p,u,{ref:r(d.ref,u.ref)},m))}return f.createElement(o,Object.assign({},ju(c,["ref"]),o!==f.Fragment&&u,o!==f.Fragment&&p),d)}function Hp(){let e=f.useRef([]),t=f.useCallback(n=>{for(let s of e.current)s!=null&&(typeof s=="function"?s(n):s.current=n)},[]);return(...n)=>{if(!n.every(s=>s==null))return e.current=n,t}}function p5(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Bb(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let s of e)for(let r in s)r.startsWith("on")&&typeof s[r]=="function"?(n[r]!=null||(n[r]=[]),n[r].push(s[r])):t[r]=s[r];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(s=>[s,void 0])));for(let s in n)Object.assign(t,{[s](r,...o){let i=n[s];for(let a of i){if((r instanceof Event||(r==null?void 0:r.nativeEvent)instanceof Event)&&r.defaultPrevented)return;a(r,...o)}}});return t}function ke(e){var t;return Object.assign(f.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Jo(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function ju(e,t=[]){let n=Object.assign({},e);for(let s of t)s in n&&delete n[s];return n}let f5="div";var Qn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Qn||{});function h5(e,t){var n;let{features:s=1,...r}=e,o={ref:t,"aria-hidden":(s&2)===2?!0:(n=r["aria-hidden"])!=null?n:void 0,hidden:(s&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(s&4)===4&&(s&2)!==2&&{display:"none"}}};return $e({ourProps:o,theirProps:r,slot:{},defaultTag:f5,name:"Hidden"})}let es=ke(h5),Dp=f.createContext(null);Dp.displayName="OpenClosedContext";var at=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(at||{});function Co(){return f.useContext(Dp)}function Oa({value:e,children:t}){return f.createElement(Dp.Provider,{value:e},t)}function g5(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Zr=[];g5(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Zr[0]!==t.target&&(Zr.unshift(t.target),Zr=Zr.filter(n=>n!=null&&n.isConnected),Zr.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function Pr(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let s=(t==null?void 0:t.getAttribute("disabled"))==="";return s&&m5(n)?!1:s}function m5(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function b5(e){throw new Error("Unexpected object: "+e)}var Ue=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Ue||{});function Nd(e,t){let n=t.resolveItems();if(n.length<=0)return null;let s=t.resolveActiveIndex(),r=s??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 1:{for(let o=r-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 2:{for(let o=r+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return s}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return s}case 5:return null;default:b5(e)}}function Pc(e={},t=null,n=[]){for(let[s,r]of Object.entries(e))Ub(n,zb(t,s),r);return n}function zb(e,t){return e?e+"["+t+"]":t}function Ub(e,t,n){if(Array.isArray(n))for(let[s,r]of n.entries())Ub(e,zb(t,s.toString()),r);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Pc(n,t,e)}function Wb(e){var t,n;let s=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(s){for(let r of s.elements)if(r!==e&&(r.tagName==="INPUT"&&r.type==="submit"||r.tagName==="BUTTON"&&r.type==="submit"||r.nodeName==="INPUT"&&r.type==="image")){r.click();return}(n=s.requestSubmit)==null||n.call(s)}}var he=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(he||{}),v5={NODE_ENV:"production"},y5=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(y5||{}),x5=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(x5||{}),w5=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(w5||{}),S5=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(S5||{});function Eu(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,s=t(e.options.slice()),r=s.length>0&&s[0].dataRef.current.order!==null?s.sort((i,a)=>i.dataRef.current.order-a.dataRef.current.order):Bs(s,i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let C5={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let s=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(s!==-1)return{...e,activeOptionIndex:s,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,s,r,o,i;if((n=e.dataRef.current)!=null&&n.disabled||(s=e.dataRef.current)!=null&&s.optionsRef.current&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=t.focus===Ue.Specific?t.idx:Nd(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var h,g;return(g=(h=e.activeOptionIndex)!=null?h:e.virtual.options.findIndex(m=>!e.virtual.disabled(m)))!=null?g:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),p=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===p?e:{...e,activeOptionIndex:d,activationTrigger:p}}let a=Eu(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(p=>!p.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let c=t.focus===Ue.Specific?t.idx:Nd(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),u=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===c&&e.activationTrigger===u?e:{...e,...a,activeOptionIndex:c,activationTrigger:u}},3:(e,t)=>{var n,s,r;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let o=t.payload,i=Eu(e,c=>(c.push(o),c));e.activeOptionIndex===null&&(s=e.dataRef.current)!=null&&s.isSelected(t.payload.dataRef.current.value)&&(i.activeOptionIndex=i.options.indexOf(o));let a={...e,...i,activationTrigger:2};return(r=e.dataRef.current)!=null&&r.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(r=>r.id!==t.id)};let s=Eu(e,r=>{let o=r.findIndex(i=>i.id===t.id);return o!==-1&&r.splice(o,1),r});return{...e,...s,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let s=e.activeOptionIndex;if(e.activeOptionIndex!==null){let r=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);r!==-1?s=r:s=null}return{...e,activeOptionIndex:s,virtual:Object.assign({},e.virtual,{options:t.options})}}},Fp=f.createContext(null);Fp.displayName="ComboboxActionsContext";function _a(e){let t=f.useContext(Fp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,_a),n}return t}let Gb=f.createContext(null);function j5(e){var t;let n=jo("VirtualProvider"),[s,r]=f.useMemo(()=>{let c=n.optionsRef.current;if(!c)return[0,0];let u=window.getComputedStyle(c);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[n.optionsRef.current]),o=t5({scrollPaddingStart:s,scrollPaddingEnd:r,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var c;return(c=n.optionsRef.current)!=null?c:null},overscan:12}),[i,a]=f.useState(0);return De(()=>{a(c=>c+1)},[(t=n.virtual)==null?void 0:t.options]),f.createElement(Gb.Provider,{value:o},f.createElement("div",{style:{position:"relative",width:"100%",height:`${o.getTotalSize()}px`},ref:c=>{if(c){if(typeof process<"u"&&v5.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&o.scrollToIndex(n.activeOptionIndex)}}},o.getVirtualItems().map(c=>{var u;return f.createElement(f.Fragment,{key:c.key},f.cloneElement((u=e.children)==null?void 0:u.call(e,{option:n.virtual.options[c.index],open:n.comboboxState===0}),{key:`${i}-${c.key}`,"data-index":c.index,"aria-setsize":n.virtual.options.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let Bp=f.createContext(null);Bp.displayName="ComboboxDataContext";function jo(e){let t=f.useContext(Bp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,jo),n}return t}function E5(e,t){return _e(t.type,C5,e,t)}let P5=f.Fragment;function T5(e,t){let{value:n,defaultValue:s,onChange:r,form:o,name:i,by:a=null,disabled:c=!1,__demoMode:u=!1,nullable:d=!1,multiple:p=!1,immediate:h=!1,virtual:g=null,...m}=e,b=!1,v=null,[x=p?[]:void 0,y]=Sc(n,r,s),[w,S]=f.useReducer(E5,{dataRef:f.createRef(),comboboxState:u?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),C=f.useRef(!1),j=f.useRef({static:!1,hold:!1}),E=f.useRef(null),T=f.useRef(null),O=f.useRef(null),P=f.useRef(null),_=re(typeof a=="string"?(ne,ce)=>{let ge=a;return(ne==null?void 0:ne[ge])===(ce==null?void 0:ce[ge])}:a??((ne,ce)=>ne===ce)),M=re(ne=>w.options.findIndex(ce=>_(ce.dataRef.current.value,ne))),N=f.useCallback(ne=>_e(L.mode,{1:()=>x.some(ce=>_(ce,ne)),0:()=>_(x,ne)}),[x]),H=re(ne=>w.activeOptionIndex===M(ne)),L=f.useMemo(()=>({...w,immediate:b,optionsPropsRef:j,labelRef:E,inputRef:T,buttonRef:O,optionsRef:P,value:x,defaultValue:s,disabled:c,mode:p?1:0,virtual:w.virtual,get activeOptionIndex(){if(C.current&&w.activeOptionIndex===null&&w.options.length>0){let ne=w.options.findIndex(ce=>!ce.dataRef.current.disabled);if(ne!==-1)return ne}return w.activeOptionIndex},calculateIndex:M,compare:_,isSelected:N,isActive:H,nullable:d,__demoMode:u}),[x,s,c,p,d,u,w,v]);De(()=>{},[v,void 0]),De(()=>{w.dataRef.current=L},[L]),Ip([L.buttonRef,L.inputRef,L.optionsRef],()=>J.closeCombobox(),L.comboboxState===0);let F=f.useMemo(()=>{var ne,ce,ge;return{open:L.comboboxState===0,disabled:c,activeIndex:L.activeOptionIndex,activeOption:L.activeOptionIndex===null?null:L.virtual?L.virtual.options[(ne=L.activeOptionIndex)!=null?ne:0]:(ge=(ce=L.options[L.activeOptionIndex])==null?void 0:ce.dataRef.current.value)!=null?ge:null,value:x}},[L,c,x]),G=re(()=>{if(L.activeOptionIndex!==null){if(L.virtual)Y(L.virtual.options[L.activeOptionIndex]);else{let{dataRef:ne}=L.options[L.activeOptionIndex];Y(ne.current.value)}J.goToOption(Ue.Specific,L.activeOptionIndex)}}),D=re(()=>{S({type:0}),C.current=!0}),$=re(()=>{S({type:1}),C.current=!1}),I=re((ne,ce,ge)=>(C.current=!1,ne===Ue.Specific?S({type:2,focus:Ue.Specific,idx:ce,trigger:ge}):S({type:2,focus:ne,trigger:ge}))),R=re((ne,ce)=>(S({type:3,payload:{id:ne,dataRef:ce}}),()=>{L.isActive(ce.current.value)&&(C.current=!0),S({type:4,id:ne})})),z=re(ne=>(S({type:5,id:ne}),()=>S({type:5,id:null}))),Y=re(ne=>_e(L.mode,{0(){return y==null?void 0:y(ne)},1(){let ce=L.value.slice(),ge=ce.findIndex(Re=>_(Re,ne));return ge===-1?ce.push(ne):ce.splice(ge,1),y==null?void 0:y(ce)}})),Z=re(ne=>{S({type:6,trigger:ne})}),J=f.useMemo(()=>({onChange:Y,registerOption:R,registerLabel:z,goToOption:I,closeCombobox:$,openCombobox:D,setActivationTrigger:Z,selectActiveOption:G}),[]),ee=t===null?{}:{ref:t},te=f.useRef(null),q=Jn();return f.useEffect(()=>{te.current&&s!==void 0&&q.addEventListener(te.current,"reset",()=>{y==null||y(s)})},[te,y]),f.createElement(Fp.Provider,{value:J},f.createElement(Bp.Provider,{value:L},f.createElement(Oa,{value:_e(L.comboboxState,{0:at.Open,1:at.Closed})},i!=null&&x!=null&&Pc({[i]:x}).map(([ne,ce],ge)=>f.createElement(es,{features:Qn.Hidden,ref:ge===0?Re=>{var ve;te.current=(ve=Re==null?void 0:Re.closest("form"))!=null?ve:null}:void 0,...Jo({key:ne,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:o,disabled:c,name:ne,value:ce})})),$e({ourProps:ee,theirProps:m,slot:F,defaultTag:P5,name:"Combobox"}))))}let O5="input";function _5(e,t){var n,s,r,o,i;let a=bt(),{id:c=`headlessui-combobox-input-${a}`,onChange:u,displayValue:d,type:p="text",...h}=e,g=jo("Combobox.Input"),m=_a("Combobox.Input"),b=Fe(g.inputRef,t),v=So(g.inputRef),x=f.useRef(!1),y=Jn(),w=re(()=>{m.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),m.goToOption(Ue.Nothing)}),S=function(){var L;return typeof d=="function"&&g.value!==void 0?(L=d(g.value))!=null?L:"":typeof g.value=="string"?g.value:""}();Vh(([L,F],[G,D])=>{if(x.current)return;let $=g.inputRef.current;$&&((D===0&&F===1||L!==G)&&($.value=L),requestAnimationFrame(()=>{if(x.current||!$||(v==null?void 0:v.activeElement)!==$)return;let{selectionStart:I,selectionEnd:R}=$;Math.abs((R??0)-(I??0))===0&&I===0&&$.setSelectionRange($.value.length,$.value.length)}))},[S,g.comboboxState,v]),Vh(([L],[F])=>{if(L===0&&F===1){if(x.current)return;let G=g.inputRef.current;if(!G)return;let D=G.value,{selectionStart:$,selectionEnd:I,selectionDirection:R}=G;G.value="",G.value=D,R!==null?G.setSelectionRange($,I,R):G.setSelectionRange($,I)}},[g.comboboxState]);let C=f.useRef(!1),j=re(()=>{C.current=!0}),E=re(()=>{y.nextFrame(()=>{C.current=!1})}),T=re(L=>{switch(x.current=!0,L.key){case he.Enter:if(x.current=!1,g.comboboxState!==0||C.current)return;if(L.preventDefault(),L.stopPropagation(),g.activeOptionIndex===null){m.closeCombobox();return}m.selectActiveOption(),g.mode===0&&m.closeCombobox();break;case he.ArrowDown:return x.current=!1,L.preventDefault(),L.stopPropagation(),_e(g.comboboxState,{0:()=>m.goToOption(Ue.Next),1:()=>m.openCombobox()});case he.ArrowUp:return x.current=!1,L.preventDefault(),L.stopPropagation(),_e(g.comboboxState,{0:()=>m.goToOption(Ue.Previous),1:()=>{m.openCombobox(),y.nextFrame(()=>{g.value||m.goToOption(Ue.Last)})}});case he.Home:if(L.shiftKey)break;return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ue.First);case he.PageUp:return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ue.First);case he.End:if(L.shiftKey)break;return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ue.Last);case he.PageDown:return x.current=!1,L.preventDefault(),L.stopPropagation(),m.goToOption(Ue.Last);case he.Escape:return x.current=!1,g.comboboxState!==0?void 0:(L.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&L.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&w(),m.closeCombobox());case he.Tab:if(x.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&m.selectActiveOption(),m.closeCombobox();break}}),O=re(L=>{u==null||u(L),g.nullable&&g.mode===0&&L.target.value===""&&w(),m.openCombobox()}),P=re(L=>{var F,G,D;let $=(F=L.relatedTarget)!=null?F:Zr.find(I=>I!==L.currentTarget);if(x.current=!1,!((G=g.optionsRef.current)!=null&&G.contains($))&&!((D=g.buttonRef.current)!=null&&D.contains($))&&g.comboboxState===0)return L.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?w():g.activationTrigger!==1&&m.selectActiveOption()),m.closeCombobox()}),_=re(L=>{var F,G,D;let $=(F=L.relatedTarget)!=null?F:Zr.find(I=>I!==L.currentTarget);(G=g.buttonRef.current)!=null&&G.contains($)||(D=g.optionsRef.current)!=null&&D.contains($)||g.disabled||g.immediate&&g.comboboxState!==0&&(m.openCombobox(),y.nextFrame(()=>{m.setActivationTrigger(1)}))}),M=Ta(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),N=f.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),H={ref:b,id:c,role:"combobox",type:p,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(s=g.options.find(L=>{var F;return!((F=g.virtual)!=null&&F.disabled(L.dataRef.current.value))&&g.compare(L.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:s.id:(r=g.options[g.activeOptionIndex])==null?void 0:r.id,"aria-labelledby":M,"aria-autocomplete":"list",defaultValue:(i=(o=e.defaultValue)!=null?o:g.defaultValue!==void 0?d==null?void 0:d(g.defaultValue):null)!=null?i:g.defaultValue,disabled:g.disabled,onCompositionStart:j,onCompositionEnd:E,onKeyDown:T,onChange:O,onFocus:_,onBlur:P};return $e({ourProps:H,theirProps:h,slot:N,defaultTag:O5,name:"Combobox.Input"})}let A5="button";function M5(e,t){var n;let s=jo("Combobox.Button"),r=_a("Combobox.Button"),o=Fe(s.buttonRef,t),i=bt(),{id:a=`headlessui-combobox-button-${i}`,...c}=e,u=Jn(),d=re(b=>{switch(b.key){case he.ArrowDown:return b.preventDefault(),b.stopPropagation(),s.comboboxState===1&&r.openCombobox(),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case he.ArrowUp:return b.preventDefault(),b.stopPropagation(),s.comboboxState===1&&(r.openCombobox(),u.nextFrame(()=>{s.value||r.goToOption(Ue.Last)})),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})});case he.Escape:return s.comboboxState!==0?void 0:(b.preventDefault(),s.optionsRef.current&&!s.optionsPropsRef.current.static&&b.stopPropagation(),r.closeCombobox(),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})}));default:return}}),p=re(b=>{if(Pr(b.currentTarget))return b.preventDefault();s.comboboxState===0?r.closeCombobox():(b.preventDefault(),r.openCombobox()),u.nextFrame(()=>{var v;return(v=s.inputRef.current)==null?void 0:v.focus({preventScroll:!0})})}),h=Ta(()=>{if(s.labelId)return[s.labelId,a].join(" ")},[s.labelId,a]),g=f.useMemo(()=>({open:s.comboboxState===0,disabled:s.disabled,value:s.value}),[s]),m={ref:o,id:a,type:ui(e,s.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=s.optionsRef.current)==null?void 0:n.id,"aria-expanded":s.comboboxState===0,"aria-labelledby":h,disabled:s.disabled,onClick:p,onKeyDown:d};return $e({ourProps:m,theirProps:c,slot:g,defaultTag:A5,name:"Combobox.Button"})}let L5="label";function N5(e,t){let n=bt(),{id:s=`headlessui-combobox-label-${n}`,...r}=e,o=jo("Combobox.Label"),i=_a("Combobox.Label"),a=Fe(o.labelRef,t);De(()=>i.registerLabel(s),[s]);let c=re(()=>{var d;return(d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),u=f.useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]);return $e({ourProps:{ref:a,id:s,onClick:c},theirProps:r,slot:u,defaultTag:L5,name:"Combobox.Label"})}let $5="ul",k5=un.RenderStrategy|un.Static;function R5(e,t){let n=bt(),{id:s=`headlessui-combobox-options-${n}`,hold:r=!1,...o}=e,i=jo("Combobox.Options"),a=Fe(i.optionsRef,t),c=Co(),u=c!==null?(c&at.Open)===at.Open:i.comboboxState===0;De(()=>{var g;i.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[i.optionsPropsRef,e.static]),De(()=>{i.optionsPropsRef.current.hold=r},[i.optionsPropsRef,r]),Fb({container:i.optionsRef.current,enabled:i.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let d=Ta(()=>{var g,m;return(m=i.labelId)!=null?m:(g=i.buttonRef.current)==null?void 0:g.id},[i.labelId,i.buttonRef.current]),p=f.useMemo(()=>({open:i.comboboxState===0,option:void 0}),[i]),h={"aria-labelledby":d,role:"listbox","aria-multiselectable":i.mode===1?!0:void 0,id:s,ref:a};return i.virtual&&i.comboboxState===0&&Object.assign(o,{children:f.createElement(j5,null,o.children)}),$e({ourProps:h,theirProps:o,slot:p,defaultTag:$5,features:k5,visible:u,name:"Combobox.Options"})}let I5="li";function V5(e,t){var n;let s=bt(),{id:r=`headlessui-combobox-option-${s}`,disabled:o=!1,value:i,order:a=null,...c}=e,u=jo("Combobox.Option"),d=_a("Combobox.Option"),p=u.virtual?u.activeOptionIndex===u.calculateIndex(i):u.activeOptionIndex===null?!1:((n=u.options[u.activeOptionIndex])==null?void 0:n.id)===r,h=u.isSelected(i),g=f.useRef(null),m=_t({disabled:o,value:i,domRef:g,order:a}),b=f.useContext(Gb),v=Fe(t,g,b?b.measureElement:null),x=re(()=>d.onChange(i));De(()=>d.registerOption(r,m),[m,r]);let y=f.useRef(!(u.virtual||u.__demoMode));De(()=>{if(!u.virtual||!u.__demoMode)return;let P=Es();return P.requestAnimationFrame(()=>{y.current=!0}),P.dispose},[u.virtual,u.__demoMode]),De(()=>{if(!y.current||u.comboboxState!==0||!p||u.activationTrigger===0)return;let P=Es();return P.requestAnimationFrame(()=>{var _,M;(M=(_=g.current)==null?void 0:_.scrollIntoView)==null||M.call(_,{block:"nearest"})}),P.dispose},[g,p,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let w=re(P=>{var _;if(o||(_=u.virtual)!=null&&_.disabled(i))return P.preventDefault();x(),Ib()||requestAnimationFrame(()=>{var M;return(M=u.inputRef.current)==null?void 0:M.focus({preventScroll:!0})}),u.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),S=re(()=>{var P;if(o||(P=u.virtual)!=null&&P.disabled(i))return d.goToOption(Ue.Nothing);let _=u.calculateIndex(i);d.goToOption(Ue.Specific,_)}),C=Db(),j=re(P=>C.update(P)),E=re(P=>{var _;if(!C.wasMoved(P)||o||(_=u.virtual)!=null&&_.disabled(i)||p)return;let M=u.calculateIndex(i);d.goToOption(Ue.Specific,M,0)}),T=re(P=>{var _;C.wasMoved(P)&&(o||(_=u.virtual)!=null&&_.disabled(i)||p&&(u.optionsPropsRef.current.hold||d.goToOption(Ue.Nothing)))}),O=f.useMemo(()=>({active:p,selected:h,disabled:o}),[p,h,o]);return $e({ourProps:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:w,onFocus:S,onPointerEnter:j,onMouseEnter:j,onPointerMove:E,onMouseMove:E,onPointerLeave:T,onMouseLeave:T},theirProps:c,slot:O,defaultTag:I5,name:"Combobox.Option"})}let H5=ke(T5),D5=ke(M5),F5=ke(_5),B5=ke(N5),z5=ke(R5),U5=ke(V5),Lo=Object.assign(H5,{Input:F5,Button:D5,Label:B5,Options:z5,Option:U5});function W5(e,t,n,s){let r=_t(n);f.useEffect(()=>{e=e??window;function o(i){r.current(i)}return e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s)},[e,t,s])}function Tc(){let e=f.useRef(!1);return De(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function G5(e){let t=re(e),n=f.useRef(!1);f.useEffect(()=>(n.current=!1,()=>{n.current=!0,kp(()=>{n.current&&t()})}),[t])}var zs=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(zs||{});function qb(){let e=f.useRef(0);return Vb("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}let q5=f.createContext(!1);function K5(){return f.useContext(q5)}function Z5(e){let t=K5(),n=f.useContext(Kb),s=So(e),[r,o]=f.useState(()=>{if(!t&&n!==null||qs.isServer)return null;let i=s==null?void 0:s.getElementById("headlessui-portal-root");if(i)return i;if(s===null)return null;let a=s.createElement("div");return a.setAttribute("id","headlessui-portal-root"),s.body.appendChild(a)});return f.useEffect(()=>{r!==null&&(s!=null&&s.body.contains(r)||s==null||s.body.appendChild(r))},[r,s]),f.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Y5=f.Fragment;function X5(e,t){let n=e,s=f.useRef(null),r=Fe(Vp(d=>{s.current=d}),t),o=So(s),i=Z5(s),[a]=f.useState(()=>{var d;return qs.isServer?null:(d=o==null?void 0:o.createElement("div"))!=null?d:null}),c=f.useContext($d),u=Cc();return De(()=>{!i||!a||i.contains(a)||(a.setAttribute("data-headlessui-portal",""),i.appendChild(a))},[i,a]),De(()=>{if(a&&c)return c.register(a)},[c,a]),G5(()=>{var d;!i||!a||(a instanceof Node&&i.contains(a)&&i.removeChild(a),i.childNodes.length<=0&&((d=i.parentElement)==null||d.removeChild(i)))}),u?!i||!a?null:Mn.createPortal($e({ourProps:{ref:r},theirProps:n,defaultTag:Y5,name:"Portal"}),a):null}let J5=f.Fragment,Kb=f.createContext(null);function Q5(e,t){let{target:n,...s}=e,r={ref:Fe(t)};return f.createElement(Kb.Provider,{value:n},$e({ourProps:r,theirProps:s,defaultTag:J5,name:"Popover.Group"}))}let $d=f.createContext(null);function eE(){let e=f.useContext($d),t=f.useRef([]),n=re(o=>(t.current.push(o),e&&e.register(o),()=>s(o))),s=re(o=>{let i=t.current.indexOf(o);i!==-1&&t.current.splice(i,1),e&&e.unregister(o)}),r=f.useMemo(()=>({register:n,unregister:s,portals:t}),[n,s,t]);return[t,f.useMemo(()=>function({children:o}){return f.createElement($d.Provider,{value:r},o)},[r])]}let tE=ke(X5),nE=ke(Q5);Object.assign(tE,{Group:nE});function sE({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var s;let r=f.useRef((s=n==null?void 0:n.current)!=null?s:null),o=So(r),i=re(()=>{var a,c,u;let d=[];for(let p of e)p!==null&&(p instanceof HTMLElement?d.push(p):"current"in p&&p.current instanceof HTMLElement&&d.push(p.current));if(t!=null&&t.current)for(let p of t.current)d.push(p);for(let p of(a=o==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])p!==document.body&&p!==document.head&&p instanceof HTMLElement&&p.id!=="headlessui-portal-root"&&(p.contains(r.current)||p.contains((u=(c=r.current)==null?void 0:c.getRootNode())==null?void 0:u.host)||d.some(h=>p.contains(h))||d.push(p));return d});return{resolveContainers:i,contains:re(a=>i().some(c=>c.contains(a))),mainTreeNodeRef:r,MainTreeNode:f.useMemo(()=>function(){return n!=null?null:f.createElement(es,{features:Qn.Hidden,ref:r})},[r,n])}}function rE(){let e=f.useRef(null);return{mainTreeNodeRef:e,MainTreeNode:f.useMemo(()=>function(){return f.createElement(es,{features:Qn.Hidden,ref:e})},[e])}}let Zb=f.createContext(null);function Yb(){let e=f.useContext(Zb);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Yb),t}return e}function zp(){let[e,t]=f.useState([]);return[e.length>0?e.join(" "):void 0,f.useMemo(()=>function(n){let s=re(o=>(t(i=>[...i,o]),()=>t(i=>{let a=i.slice(),c=a.indexOf(o);return c!==-1&&a.splice(c,1),a}))),r=f.useMemo(()=>({register:s,slot:n.slot,name:n.name,props:n.props}),[s,n.slot,n.name,n.props]);return f.createElement(Zb.Provider,{value:r},n.children)},[t])]}let oE="p";function iE(e,t){let n=bt(),{id:s=`headlessui-description-${n}`,...r}=e,o=Yb(),i=Fe(t);De(()=>o.register(s),[s,o.register]);let a={ref:i,...o.props,id:s};return $e({ourProps:a,theirProps:r,slot:o.slot||{},defaultTag:oE,name:o.name||"Description"})}let aE=ke(iE),Xb=Object.assign(aE,{});var Hh;let lE=(Hh=f.startTransition)!=null?Hh:function(e){e()};var cE=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(cE||{}),uE=(e=>(e[e.ToggleDisclosure=0]="ToggleDisclosure",e[e.CloseDisclosure=1]="CloseDisclosure",e[e.SetButtonId=2]="SetButtonId",e[e.SetPanelId=3]="SetPanelId",e[e.LinkPanel=4]="LinkPanel",e[e.UnlinkPanel=5]="UnlinkPanel",e))(uE||{});let dE={0:e=>({...e,disclosureState:_e(e.disclosureState,{0:1,1:0})}),1:e=>e.disclosureState===1?e:{...e,disclosureState:1},4(e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},5(e){return e.linkedPanel===!1?e:{...e,linkedPanel:!1}},2(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},3(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Up=f.createContext(null);Up.displayName="DisclosureContext";function Wp(e){let t=f.useContext(Up);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Wp),n}return t}let Gp=f.createContext(null);Gp.displayName="DisclosureAPIContext";function Jb(e){let t=f.useContext(Gp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Disclosure /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Jb),n}return t}let qp=f.createContext(null);qp.displayName="DisclosurePanelContext";function pE(){return f.useContext(qp)}function fE(e,t){return _e(t.type,dE,e,t)}let hE=f.Fragment;function gE(e,t){let{defaultOpen:n=!1,...s}=e,r=f.useRef(null),o=Fe(t,Vp(v=>{r.current=v},e.as===void 0||e.as===f.Fragment)),i=f.useRef(null),a=f.useRef(null),c=f.useReducer(fE,{disclosureState:n?0:1,linkedPanel:!1,buttonRef:a,panelRef:i,buttonId:null,panelId:null}),[{disclosureState:u,buttonId:d},p]=c,h=re(v=>{p({type:1});let x=kr(r);if(!x||!d)return;let y=v?v instanceof HTMLElement?v:v.current instanceof HTMLElement?v.current:x.getElementById(d):x.getElementById(d);y==null||y.focus()}),g=f.useMemo(()=>({close:h}),[h]),m=f.useMemo(()=>({open:u===0,close:h}),[u,h]),b={ref:o};return f.createElement(Up.Provider,{value:c},f.createElement(Gp.Provider,{value:g},f.createElement(Oa,{value:_e(u,{0:at.Open,1:at.Closed})},$e({ourProps:b,theirProps:s,slot:m,defaultTag:hE,name:"Disclosure"}))))}let mE="button";function bE(e,t){let n=bt(),{id:s=`headlessui-disclosure-button-${n}`,...r}=e,[o,i]=Wp("Disclosure.Button"),a=pE(),c=a===null?!1:a===o.panelId,u=f.useRef(null),d=Fe(u,t,c?null:o.buttonRef),p=Hp();f.useEffect(()=>{if(!c)return i({type:2,buttonId:s}),()=>{i({type:2,buttonId:null})}},[s,i,c]);let h=re(y=>{var w;if(c){if(o.disclosureState===1)return;switch(y.key){case he.Space:case he.Enter:y.preventDefault(),y.stopPropagation(),i({type:0}),(w=o.buttonRef.current)==null||w.focus();break}}else switch(y.key){case he.Space:case he.Enter:y.preventDefault(),y.stopPropagation(),i({type:0});break}}),g=re(y=>{switch(y.key){case he.Space:y.preventDefault();break}}),m=re(y=>{var w;Pr(y.currentTarget)||e.disabled||(c?(i({type:0}),(w=o.buttonRef.current)==null||w.focus()):i({type:0}))}),b=f.useMemo(()=>({open:o.disclosureState===0}),[o]),v=ui(e,u),x=c?{ref:d,type:v,onKeyDown:h,onClick:m}:{ref:d,id:s,type:v,"aria-expanded":o.disclosureState===0,"aria-controls":o.linkedPanel?o.panelId:void 0,onKeyDown:h,onKeyUp:g,onClick:m};return $e({mergeRefs:p,ourProps:x,theirProps:r,slot:b,defaultTag:mE,name:"Disclosure.Button"})}let vE="div",yE=un.RenderStrategy|un.Static;function xE(e,t){let n=bt(),{id:s=`headlessui-disclosure-panel-${n}`,...r}=e,[o,i]=Wp("Disclosure.Panel"),{close:a}=Jb("Disclosure.Panel"),c=Hp(),u=Fe(t,o.panelRef,m=>{lE(()=>i({type:m?4:5}))});f.useEffect(()=>(i({type:3,panelId:s}),()=>{i({type:3,panelId:null})}),[s,i]);let d=Co(),p=d!==null?(d&at.Open)===at.Open:o.disclosureState===0,h=f.useMemo(()=>({open:o.disclosureState===0,close:a}),[o,a]),g={ref:u,id:s};return f.createElement(qp.Provider,{value:o.panelId},$e({mergeRefs:c,ourProps:g,theirProps:r,slot:h,defaultTag:vE,features:yE,visible:p,name:"Disclosure.Panel"}))}let wE=ke(gE),SE=ke(bE),CE=ke(xE),Pu=Object.assign(wE,{Button:SE,Panel:CE}),Dh=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Fh(e){var t,n;let s=(t=e.innerText)!=null?t:"",r=e.cloneNode(!0);if(!(r instanceof HTMLElement))return s;let o=!1;for(let a of r.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),o=!0;let i=o?(n=r.innerText)!=null?n:"":s;return Dh.test(i)&&(i=i.replace(Dh,"")),i}function jE(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let s=n.split(" ").map(r=>{let o=document.getElementById(r);if(o){let i=o.getAttribute("aria-label");return typeof i=="string"?i.trim():Fh(o).trim()}return null}).filter(Boolean);if(s.length>0)return s.join(", ")}return Fh(e).trim()}function EE(e){let t=f.useRef(""),n=f.useRef("");return re(()=>{let s=e.current;if(!s)return"";let r=s.innerText;if(t.current===r)return n.current;let o=jE(s).trim().toLowerCase();return t.current=r,n.current=o,o})}var PE=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(PE||{}),TE=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(TE||{}),OE=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(OE||{}),_E=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(_E||{});function Tu(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,s=Bs(t(e.options.slice()),o=>o.dataRef.current.domRef.current),r=n?s.indexOf(n):null;return r===-1&&(r=null),{options:s,activeOptionIndex:r}}let AE={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,s=e.options.findIndex(r=>n(r.dataRef.current.value));return s!==-1&&(t=s),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||e.listboxState===1)return e;let s=Tu(e),r=Nd(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...s,searchQuery:"",activeOptionIndex:r,activationTrigger:(n=t.trigger)!=null?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,s=e.searchQuery+t.value.toLowerCase(),r=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var a;return!i.dataRef.current.disabled&&((a=i.dataRef.current.textValue)==null?void 0:a.startsWith(s))}),o=r?e.options.indexOf(r):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:s}:{...e,searchQuery:s,activeOptionIndex:o,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},s=Tu(e,r=>[...r,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(n)),{...e,...s}},6:(e,t)=>{let n=Tu(e,s=>{let r=s.findIndex(o=>o.id===t.id);return r!==-1&&s.splice(r,1),s});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},Kp=f.createContext(null);Kp.displayName="ListboxActionsContext";function Aa(e){let t=f.useContext(Kp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Aa),n}return t}let Zp=f.createContext(null);Zp.displayName="ListboxDataContext";function Ma(e){let t=f.useContext(Zp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ma),n}return t}function ME(e,t){return _e(t.type,AE,e,t)}let LE=f.Fragment;function NE(e,t){let{value:n,defaultValue:s,form:r,name:o,onChange:i,by:a=(Z,J)=>Z===J,disabled:c=!1,horizontal:u=!1,multiple:d=!1,...p}=e;const h=u?"horizontal":"vertical";let g=Fe(t),[m=d?[]:void 0,b]=Sc(n,i,s),[v,x]=f.useReducer(ME,{dataRef:f.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),y=f.useRef({static:!1,hold:!1}),w=f.useRef(null),S=f.useRef(null),C=f.useRef(null),j=re(typeof a=="string"?(Z,J)=>{let ee=a;return(Z==null?void 0:Z[ee])===(J==null?void 0:J[ee])}:a),E=f.useCallback(Z=>_e(T.mode,{1:()=>m.some(J=>j(J,Z)),0:()=>j(m,Z)}),[m]),T=f.useMemo(()=>({...v,value:m,disabled:c,mode:d?1:0,orientation:h,compare:j,isSelected:E,optionsPropsRef:y,labelRef:w,buttonRef:S,optionsRef:C}),[m,c,d,v]);De(()=>{v.dataRef.current=T},[T]),Ip([T.buttonRef,T.optionsRef],(Z,J)=>{var ee;x({type:1}),Rp(J,Ec.Loose)||(Z.preventDefault(),(ee=T.buttonRef.current)==null||ee.focus())},T.listboxState===0);let O=f.useMemo(()=>({open:T.listboxState===0,disabled:c,value:m}),[T,c,m]),P=re(Z=>{let J=T.options.find(ee=>ee.id===Z);J&&G(J.dataRef.current.value)}),_=re(()=>{if(T.activeOptionIndex!==null){let{dataRef:Z,id:J}=T.options[T.activeOptionIndex];G(Z.current.value),x({type:2,focus:Ue.Specific,id:J})}}),M=re(()=>x({type:0})),N=re(()=>x({type:1})),H=re((Z,J,ee)=>Z===Ue.Specific?x({type:2,focus:Ue.Specific,id:J,trigger:ee}):x({type:2,focus:Z,trigger:ee})),L=re((Z,J)=>(x({type:5,id:Z,dataRef:J}),()=>x({type:6,id:Z}))),F=re(Z=>(x({type:7,id:Z}),()=>x({type:7,id:null}))),G=re(Z=>_e(T.mode,{0(){return b==null?void 0:b(Z)},1(){let J=T.value.slice(),ee=J.findIndex(te=>j(te,Z));return ee===-1?J.push(Z):J.splice(ee,1),b==null?void 0:b(J)}})),D=re(Z=>x({type:3,value:Z})),$=re(()=>x({type:4})),I=f.useMemo(()=>({onChange:G,registerOption:L,registerLabel:F,goToOption:H,closeListbox:N,openListbox:M,selectActiveOption:_,selectOption:P,search:D,clearSearch:$}),[]),R={ref:g},z=f.useRef(null),Y=Jn();return f.useEffect(()=>{z.current&&s!==void 0&&Y.addEventListener(z.current,"reset",()=>{b==null||b(s)})},[z,b]),f.createElement(Kp.Provider,{value:I},f.createElement(Zp.Provider,{value:T},f.createElement(Oa,{value:_e(T.listboxState,{0:at.Open,1:at.Closed})},o!=null&&m!=null&&Pc({[o]:m}).map(([Z,J],ee)=>f.createElement(es,{features:Qn.Hidden,ref:ee===0?te=>{var q;z.current=(q=te==null?void 0:te.closest("form"))!=null?q:null}:void 0,...Jo({key:Z,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:r,disabled:c,name:Z,value:J})})),$e({ourProps:R,theirProps:p,slot:O,defaultTag:LE,name:"Listbox"}))))}let $E="button";function kE(e,t){var n;let s=bt(),{id:r=`headlessui-listbox-button-${s}`,...o}=e,i=Ma("Listbox.Button"),a=Aa("Listbox.Button"),c=Fe(i.buttonRef,t),u=Jn(),d=re(v=>{switch(v.key){case he.Space:case he.Enter:case he.ArrowDown:v.preventDefault(),a.openListbox(),u.nextFrame(()=>{i.value||a.goToOption(Ue.First)});break;case he.ArrowUp:v.preventDefault(),a.openListbox(),u.nextFrame(()=>{i.value||a.goToOption(Ue.Last)});break}}),p=re(v=>{switch(v.key){case he.Space:v.preventDefault();break}}),h=re(v=>{if(Pr(v.currentTarget))return v.preventDefault();i.listboxState===0?(a.closeListbox(),u.nextFrame(()=>{var x;return(x=i.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})})):(v.preventDefault(),a.openListbox())}),g=Ta(()=>{if(i.labelId)return[i.labelId,r].join(" ")},[i.labelId,r]),m=f.useMemo(()=>({open:i.listboxState===0,disabled:i.disabled,value:i.value}),[i]),b={ref:c,id:r,type:ui(e,i.buttonRef),"aria-haspopup":"listbox","aria-controls":(n=i.optionsRef.current)==null?void 0:n.id,"aria-expanded":i.listboxState===0,"aria-labelledby":g,disabled:i.disabled,onKeyDown:d,onKeyUp:p,onClick:h};return $e({ourProps:b,theirProps:o,slot:m,defaultTag:$E,name:"Listbox.Button"})}let RE="label";function IE(e,t){let n=bt(),{id:s=`headlessui-listbox-label-${n}`,...r}=e,o=Ma("Listbox.Label"),i=Aa("Listbox.Label"),a=Fe(o.labelRef,t);De(()=>i.registerLabel(s),[s]);let c=re(()=>{var d;return(d=o.buttonRef.current)==null?void 0:d.focus({preventScroll:!0})}),u=f.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]);return $e({ourProps:{ref:a,id:s,onClick:c},theirProps:r,slot:u,defaultTag:RE,name:"Listbox.Label"})}let VE="ul",HE=un.RenderStrategy|un.Static;function DE(e,t){var n;let s=bt(),{id:r=`headlessui-listbox-options-${s}`,...o}=e,i=Ma("Listbox.Options"),a=Aa("Listbox.Options"),c=Fe(i.optionsRef,t),u=Jn(),d=Jn(),p=Co(),h=p!==null?(p&at.Open)===at.Open:i.listboxState===0;f.useEffect(()=>{var x;let y=i.optionsRef.current;y&&i.listboxState===0&&y!==((x=kr(y))==null?void 0:x.activeElement)&&y.focus({preventScroll:!0})},[i.listboxState,i.optionsRef]);let g=re(x=>{switch(d.dispose(),x.key){case he.Space:if(i.searchQuery!=="")return x.preventDefault(),x.stopPropagation(),a.search(x.key);case he.Enter:if(x.preventDefault(),x.stopPropagation(),i.activeOptionIndex!==null){let{dataRef:y}=i.options[i.activeOptionIndex];a.onChange(y.current.value)}i.mode===0&&(a.closeListbox(),Es().nextFrame(()=>{var y;return(y=i.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})}));break;case _e(i.orientation,{vertical:he.ArrowDown,horizontal:he.ArrowRight}):return x.preventDefault(),x.stopPropagation(),a.goToOption(Ue.Next);case _e(i.orientation,{vertical:he.ArrowUp,horizontal:he.ArrowLeft}):return x.preventDefault(),x.stopPropagation(),a.goToOption(Ue.Previous);case he.Home:case he.PageUp:return x.preventDefault(),x.stopPropagation(),a.goToOption(Ue.First);case he.End:case he.PageDown:return x.preventDefault(),x.stopPropagation(),a.goToOption(Ue.Last);case he.Escape:return x.preventDefault(),x.stopPropagation(),a.closeListbox(),u.nextFrame(()=>{var y;return(y=i.buttonRef.current)==null?void 0:y.focus({preventScroll:!0})});case he.Tab:x.preventDefault(),x.stopPropagation();break;default:x.key.length===1&&(a.search(x.key),d.setTimeout(()=>a.clearSearch(),350));break}}),m=Ta(()=>{var x;return(x=i.buttonRef.current)==null?void 0:x.id},[i.buttonRef.current]),b=f.useMemo(()=>({open:i.listboxState===0}),[i]),v={"aria-activedescendant":i.activeOptionIndex===null||(n=i.options[i.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":i.mode===1?!0:void 0,"aria-labelledby":m,"aria-orientation":i.orientation,id:r,onKeyDown:g,role:"listbox",tabIndex:0,ref:c};return $e({ourProps:v,theirProps:o,slot:b,defaultTag:VE,features:HE,visible:h,name:"Listbox.Options"})}let FE="li";function BE(e,t){let n=bt(),{id:s=`headlessui-listbox-option-${n}`,disabled:r=!1,value:o,...i}=e,a=Ma("Listbox.Option"),c=Aa("Listbox.Option"),u=a.activeOptionIndex!==null?a.options[a.activeOptionIndex].id===s:!1,d=a.isSelected(o),p=f.useRef(null),h=EE(p),g=_t({disabled:r,value:o,domRef:p,get textValue(){return h()}}),m=Fe(t,p);De(()=>{if(a.listboxState!==0||!u||a.activationTrigger===0)return;let j=Es();return j.requestAnimationFrame(()=>{var E,T;(T=(E=p.current)==null?void 0:E.scrollIntoView)==null||T.call(E,{block:"nearest"})}),j.dispose},[p,u,a.listboxState,a.activationTrigger,a.activeOptionIndex]),De(()=>c.registerOption(s,g),[g,s]);let b=re(j=>{if(r)return j.preventDefault();c.onChange(o),a.mode===0&&(c.closeListbox(),Es().nextFrame(()=>{var E;return(E=a.buttonRef.current)==null?void 0:E.focus({preventScroll:!0})}))}),v=re(()=>{if(r)return c.goToOption(Ue.Nothing);c.goToOption(Ue.Specific,s)}),x=Db(),y=re(j=>x.update(j)),w=re(j=>{x.wasMoved(j)&&(r||u||c.goToOption(Ue.Specific,s,0))}),S=re(j=>{x.wasMoved(j)&&(r||u&&c.goToOption(Ue.Nothing))}),C=f.useMemo(()=>({active:u,selected:d,disabled:r}),[u,d,r]);return $e({ourProps:{id:s,ref:m,role:"option",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:b,onFocus:v,onPointerEnter:y,onMouseEnter:y,onPointerMove:w,onMouseMove:w,onPointerLeave:S,onMouseLeave:S},theirProps:i,slot:C,defaultTag:FE,name:"Listbox.Option"})}let zE=ke(NE),UE=ke(kE),WE=ke(IE),GE=ke(DE),qE=ke(BE),wi=Object.assign(zE,{Button:UE,Label:WE,Options:GE,Option:qE});var KE=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(KE||{}),ZE=(e=>(e[e.TogglePopover=0]="TogglePopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(ZE||{});let YE={0:e=>{let t={...e,popoverState:_e(e.popoverState,{0:1,1:0})};return t.popoverState===0&&(t.__demoMode=!1),t},1(e){return e.popoverState===1?e:{...e,popoverState:1}},2(e,t){return e.button===t.button?e:{...e,button:t.button}},3(e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},4(e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},5(e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Yp=f.createContext(null);Yp.displayName="PopoverContext";function Oc(e){let t=f.useContext(Yp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Oc),n}return t}let Xp=f.createContext(null);Xp.displayName="PopoverAPIContext";function Jp(e){let t=f.useContext(Xp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Popover /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Jp),n}return t}let Qp=f.createContext(null);Qp.displayName="PopoverGroupContext";function Qb(){return f.useContext(Qp)}let _c=f.createContext(null);_c.displayName="PopoverPanelContext";function XE(){return f.useContext(_c)}function JE(e,t){return _e(t.type,YE,e,t)}let QE="div";function eP(e,t){var n;let{__demoMode:s=!1,...r}=e,o=f.useRef(null),i=Fe(t,Vp(F=>{o.current=F})),a=f.useRef([]),c=f.useReducer(JE,{__demoMode:s,popoverState:s?0:1,buttons:a,button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:f.createRef(),afterPanelSentinel:f.createRef()}),[{popoverState:u,button:d,buttonId:p,panel:h,panelId:g,beforePanelSentinel:m,afterPanelSentinel:b},v]=c,x=So((n=o.current)!=null?n:d),y=f.useMemo(()=>{if(!d||!h)return!1;for(let z of document.querySelectorAll("body > *"))if(Number(z==null?void 0:z.contains(d))^Number(z==null?void 0:z.contains(h)))return!0;let F=jc(),G=F.indexOf(d),D=(G+F.length-1)%F.length,$=(G+1)%F.length,I=F[D],R=F[$];return!h.contains(I)&&!h.contains(R)},[d,h]),w=_t(p),S=_t(g),C=f.useMemo(()=>({buttonId:w,panelId:S,close:()=>v({type:1})}),[w,S,v]),j=Qb(),E=j==null?void 0:j.registerPopover,T=re(()=>{var F;return(F=j==null?void 0:j.isFocusWithinPopoverGroup())!=null?F:(x==null?void 0:x.activeElement)&&((d==null?void 0:d.contains(x.activeElement))||(h==null?void 0:h.contains(x.activeElement)))});f.useEffect(()=>E==null?void 0:E(C),[E,C]);let[O,P]=eE(),_=sE({mainTreeNodeRef:j==null?void 0:j.mainTreeNodeRef,portals:O,defaultContainers:[d,h]});W5(x==null?void 0:x.defaultView,"focus",F=>{var G,D,$,I;F.target!==window&&F.target instanceof HTMLElement&&u===0&&(T()||d&&h&&(_.contains(F.target)||(D=(G=m.current)==null?void 0:G.contains)!=null&&D.call(G,F.target)||(I=($=b.current)==null?void 0:$.contains)!=null&&I.call($,F.target)||v({type:1})))},!0),Ip(_.resolveContainers,(F,G)=>{v({type:1}),Rp(G,Ec.Loose)||(F.preventDefault(),d==null||d.focus())},u===0);let M=re(F=>{v({type:1});let G=F?F instanceof HTMLElement?F:"current"in F&&F.current instanceof HTMLElement?F.current:d:d;G==null||G.focus()}),N=f.useMemo(()=>({close:M,isPortalled:y}),[M,y]),H=f.useMemo(()=>({open:u===0,close:M}),[u,M]),L={ref:i};return f.createElement(_c.Provider,{value:null},f.createElement(Yp.Provider,{value:c},f.createElement(Xp.Provider,{value:N},f.createElement(Oa,{value:_e(u,{0:at.Open,1:at.Closed})},f.createElement(P,null,$e({ourProps:L,theirProps:r,slot:H,defaultTag:QE,name:"Popover"}),f.createElement(_.MainTreeNode,null))))))}let tP="button";function nP(e,t){let n=bt(),{id:s=`headlessui-popover-button-${n}`,...r}=e,[o,i]=Oc("Popover.Button"),{isPortalled:a}=Jp("Popover.Button"),c=f.useRef(null),u=`headlessui-focus-sentinel-${bt()}`,d=Qb(),p=d==null?void 0:d.closeOthers,h=XE()!==null;f.useEffect(()=>{if(!h)return i({type:3,buttonId:s}),()=>{i({type:3,buttonId:null})}},[h,s,i]);let[g]=f.useState(()=>Symbol()),m=Fe(c,t,h?null:_=>{if(_)o.buttons.current.push(g);else{let M=o.buttons.current.indexOf(g);M!==-1&&o.buttons.current.splice(M,1)}o.buttons.current.length>1&&console.warn("You are already using a <Popover.Button /> but only 1 <Popover.Button /> is supported."),_&&i({type:2,button:_})}),b=Fe(c,t),v=So(c),x=re(_=>{var M,N,H;if(h){if(o.popoverState===1)return;switch(_.key){case he.Space:case he.Enter:_.preventDefault(),(N=(M=_.target).click)==null||N.call(M),i({type:1}),(H=o.button)==null||H.focus();break}}else switch(_.key){case he.Space:case he.Enter:_.preventDefault(),_.stopPropagation(),o.popoverState===1&&(p==null||p(o.buttonId)),i({type:0});break;case he.Escape:if(o.popoverState!==0)return p==null?void 0:p(o.buttonId);if(!c.current||v!=null&&v.activeElement&&!c.current.contains(v.activeElement))return;_.preventDefault(),_.stopPropagation(),i({type:1});break}}),y=re(_=>{h||_.key===he.Space&&_.preventDefault()}),w=re(_=>{var M,N;Pr(_.currentTarget)||e.disabled||(h?(i({type:1}),(M=o.button)==null||M.focus()):(_.preventDefault(),_.stopPropagation(),o.popoverState===1&&(p==null||p(o.buttonId)),i({type:0}),(N=o.button)==null||N.focus()))}),S=re(_=>{_.preventDefault(),_.stopPropagation()}),C=o.popoverState===0,j=f.useMemo(()=>({open:C}),[C]),E=ui(e,c),T=h?{ref:b,type:E,onKeyDown:x,onClick:w}:{ref:m,id:o.buttonId,type:E,"aria-expanded":o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:x,onKeyUp:y,onClick:w,onMouseDown:S},O=qb(),P=re(()=>{let _=o.panel;if(!_)return;function M(){_e(O.current,{[zs.Forwards]:()=>Xt(_,xt.First),[zs.Backwards]:()=>Xt(_,xt.Last)})===ys.Error&&Xt(jc().filter(N=>N.dataset.headlessuiFocusGuard!=="true"),_e(O.current,{[zs.Forwards]:xt.Next,[zs.Backwards]:xt.Previous}),{relativeTo:o.button})}M()});return f.createElement(f.Fragment,null,$e({ourProps:T,theirProps:r,slot:j,defaultTag:tP,name:"Popover.Button"}),C&&!h&&a&&f.createElement(es,{id:u,features:Qn.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:P}))}let sP="div",rP=un.RenderStrategy|un.Static;function oP(e,t){let n=bt(),{id:s=`headlessui-popover-overlay-${n}`,...r}=e,[{popoverState:o},i]=Oc("Popover.Overlay"),a=Fe(t),c=Co(),u=c!==null?(c&at.Open)===at.Open:o===0,d=re(h=>{if(Pr(h.currentTarget))return h.preventDefault();i({type:1})}),p=f.useMemo(()=>({open:o===0}),[o]);return $e({ourProps:{ref:a,id:s,"aria-hidden":!0,onClick:d},theirProps:r,slot:p,defaultTag:sP,features:rP,visible:u,name:"Popover.Overlay"})}let iP="div",aP=un.RenderStrategy|un.Static;function lP(e,t){let n=bt(),{id:s=`headlessui-popover-panel-${n}`,focus:r=!1,...o}=e,[i,a]=Oc("Popover.Panel"),{close:c,isPortalled:u}=Jp("Popover.Panel"),d=`headlessui-focus-sentinel-before-${bt()}`,p=`headlessui-focus-sentinel-after-${bt()}`,h=f.useRef(null),g=Fe(h,t,T=>{a({type:4,panel:T})}),m=So(h),b=Hp();De(()=>(a({type:5,panelId:s}),()=>{a({type:5,panelId:null})}),[s,a]);let v=Co(),x=v!==null?(v&at.Open)===at.Open:i.popoverState===0,y=re(T=>{var O;switch(T.key){case he.Escape:if(i.popoverState!==0||!h.current||m!=null&&m.activeElement&&!h.current.contains(m.activeElement))return;T.preventDefault(),T.stopPropagation(),a({type:1}),(O=i.button)==null||O.focus();break}});f.useEffect(()=>{var T;e.static||i.popoverState===1&&((T=e.unmount)==null||T)&&a({type:4,panel:null})},[i.popoverState,e.unmount,e.static,a]),f.useEffect(()=>{if(i.__demoMode||!r||i.popoverState!==0||!h.current)return;let T=m==null?void 0:m.activeElement;h.current.contains(T)||Xt(h.current,xt.First)},[i.__demoMode,r,h,i.popoverState]);let w=f.useMemo(()=>({open:i.popoverState===0,close:c}),[i,c]),S={ref:g,id:s,onKeyDown:y,onBlur:r&&i.popoverState===0?T=>{var O,P,_,M,N;let H=T.relatedTarget;H&&h.current&&((O=h.current)!=null&&O.contains(H)||(a({type:1}),((_=(P=i.beforePanelSentinel.current)==null?void 0:P.contains)!=null&&_.call(P,H)||(N=(M=i.afterPanelSentinel.current)==null?void 0:M.contains)!=null&&N.call(M,H))&&H.focus({preventScroll:!0})))}:void 0,tabIndex:-1},C=qb(),j=re(()=>{let T=h.current;if(!T)return;function O(){_e(C.current,{[zs.Forwards]:()=>{var P;Xt(T,xt.First)===ys.Error&&((P=i.afterPanelSentinel.current)==null||P.focus())},[zs.Backwards]:()=>{var P;(P=i.button)==null||P.focus({preventScroll:!0})}})}O()}),E=re(()=>{let T=h.current;if(!T)return;function O(){_e(C.current,{[zs.Forwards]:()=>{var P;if(!i.button)return;let _=jc(),M=_.indexOf(i.button),N=_.slice(0,M+1),H=[..._.slice(M+1),...N];for(let L of H.slice())if(L.dataset.headlessuiFocusGuard==="true"||(P=i.panel)!=null&&P.contains(L)){let F=H.indexOf(L);F!==-1&&H.splice(F,1)}Xt(H,xt.First,{sorted:!1})},[zs.Backwards]:()=>{var P;Xt(T,xt.Previous)===ys.Error&&((P=i.button)==null||P.focus())}})}O()});return f.createElement(_c.Provider,{value:s},x&&u&&f.createElement(es,{id:d,ref:i.beforePanelSentinel,features:Qn.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:j}),$e({mergeRefs:b,ourProps:S,theirProps:o,slot:w,defaultTag:iP,features:aP,visible:x,name:"Popover.Panel"}),x&&u&&f.createElement(es,{id:p,ref:i.afterPanelSentinel,features:Qn.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:E}))}let cP="div";function uP(e,t){let n=f.useRef(null),s=Fe(n,t),[r,o]=f.useState([]),i=rE(),a=re(b=>{o(v=>{let x=v.indexOf(b);if(x!==-1){let y=v.slice();return y.splice(x,1),y}return v})}),c=re(b=>(o(v=>[...v,b]),()=>a(b))),u=re(()=>{var b;let v=kr(n);if(!v)return!1;let x=v.activeElement;return(b=n.current)!=null&&b.contains(x)?!0:r.some(y=>{var w,S;return((w=v.getElementById(y.buttonId.current))==null?void 0:w.contains(x))||((S=v.getElementById(y.panelId.current))==null?void 0:S.contains(x))})}),d=re(b=>{for(let v of r)v.buttonId.current!==b&&v.close()}),p=f.useMemo(()=>({registerPopover:c,unregisterPopover:a,isFocusWithinPopoverGroup:u,closeOthers:d,mainTreeNodeRef:i.mainTreeNodeRef}),[c,a,u,d,i.mainTreeNodeRef]),h=f.useMemo(()=>({}),[]),g=e,m={ref:s};return f.createElement(Qp.Provider,{value:p},$e({ourProps:m,theirProps:g,slot:h,defaultTag:cP,name:"Popover.Group"}),f.createElement(i.MainTreeNode,null))}let dP=ke(eP),pP=ke(nP),fP=ke(oP),hP=ke(lP),gP=ke(uP),Ou=Object.assign(dP,{Button:pP,Overlay:fP,Panel:hP,Group:gP}),ev=f.createContext(null);function tv(){let e=f.useContext(ev);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,tv),t}return e}function ef(){let[e,t]=f.useState([]);return[e.length>0?e.join(" "):void 0,f.useMemo(()=>function(n){let s=re(o=>(t(i=>[...i,o]),()=>t(i=>{let a=i.slice(),c=a.indexOf(o);return c!==-1&&a.splice(c,1),a}))),r=f.useMemo(()=>({register:s,slot:n.slot,name:n.name,props:n.props}),[s,n.slot,n.name,n.props]);return f.createElement(ev.Provider,{value:r},n.children)},[t])]}let mP="label";function bP(e,t){let n=bt(),{id:s=`headlessui-label-${n}`,passive:r=!1,...o}=e,i=tv(),a=Fe(t);De(()=>i.register(s),[s,i.register]);let c={ref:a,...i.props,id:s};return r&&("onClick"in c&&(delete c.htmlFor,delete c.onClick),"onClick"in o&&delete o.onClick),$e({ourProps:c,theirProps:o,slot:i.slot||{},defaultTag:mP,name:i.name||"Label"})}let vP=ke(bP),nv=Object.assign(vP,{});function sv(e=0){let[t,n]=f.useState(e),s=Tc(),r=f.useCallback(c=>{s.current&&n(u=>u|c)},[t,s]),o=f.useCallback(c=>!!(t&c),[t]),i=f.useCallback(c=>{s.current&&n(u=>u&~c)},[n,s]),a=f.useCallback(c=>{s.current&&n(u=>u^c)},[n]);return{flags:t,addFlag:r,hasFlag:o,removeFlag:i,toggleFlag:a}}var yP=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(yP||{});let xP={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Bs(n,s=>s.element.current)}},1(e,t){let n=e.options.slice(),s=e.options.findIndex(r=>r.id===t.id);return s===-1?e:(n.splice(s,1),{...e,options:n})}},tf=f.createContext(null);tf.displayName="RadioGroupDataContext";function rv(e){let t=f.useContext(tf);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,rv),n}return t}let nf=f.createContext(null);nf.displayName="RadioGroupActionsContext";function ov(e){let t=f.useContext(nf);if(t===null){let n=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ov),n}return t}function wP(e,t){return _e(t.type,xP,e,t)}let SP="div";function CP(e,t){let n=bt(),{id:s=`headlessui-radiogroup-${n}`,value:r,defaultValue:o,form:i,name:a,onChange:c,by:u=($,I)=>$===I,disabled:d=!1,...p}=e,h=re(typeof u=="string"?($,I)=>{let R=u;return($==null?void 0:$[R])===(I==null?void 0:I[R])}:u),[g,m]=f.useReducer(wP,{options:[]}),b=g.options,[v,x]=ef(),[y,w]=zp(),S=f.useRef(null),C=Fe(S,t),[j,E]=Sc(r,c,o),T=f.useMemo(()=>b.find($=>!$.propsRef.current.disabled),[b]),O=f.useMemo(()=>b.some($=>h($.propsRef.current.value,j)),[b,j]),P=re($=>{var I;if(d||h($,j))return!1;let R=(I=b.find(z=>h(z.propsRef.current.value,$)))==null?void 0:I.propsRef.current;return R!=null&&R.disabled?!1:(E==null||E($),!0)});Fb({container:S.current,accept($){return $.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:$.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk($){$.setAttribute("role","none")}});let _=re($=>{let I=S.current;if(!I)return;let R=kr(I),z=b.filter(Y=>Y.propsRef.current.disabled===!1).map(Y=>Y.element.current);switch($.key){case he.Enter:Wb($.currentTarget);break;case he.ArrowLeft:case he.ArrowUp:if($.preventDefault(),$.stopPropagation(),Xt(z,xt.Previous|xt.WrapAround)===ys.Success){let Y=b.find(Z=>Z.element.current===(R==null?void 0:R.activeElement));Y&&P(Y.propsRef.current.value)}break;case he.ArrowRight:case he.ArrowDown:if($.preventDefault(),$.stopPropagation(),Xt(z,xt.Next|xt.WrapAround)===ys.Success){let Y=b.find(Z=>Z.element.current===(R==null?void 0:R.activeElement));Y&&P(Y.propsRef.current.value)}break;case he.Space:{$.preventDefault(),$.stopPropagation();let Y=b.find(Z=>Z.element.current===(R==null?void 0:R.activeElement));Y&&P(Y.propsRef.current.value)}break}}),M=re($=>(m({type:0,...$}),()=>m({type:1,id:$.id}))),N=f.useMemo(()=>({value:j,firstOption:T,containsCheckedOption:O,disabled:d,compare:h,...g}),[j,T,O,d,h,g]),H=f.useMemo(()=>({registerOption:M,change:P}),[M,P]),L={ref:C,id:s,role:"radiogroup","aria-labelledby":v,"aria-describedby":y,onKeyDown:_},F=f.useMemo(()=>({value:j}),[j]),G=f.useRef(null),D=Jn();return f.useEffect(()=>{G.current&&o!==void 0&&D.addEventListener(G.current,"reset",()=>{P(o)})},[G,P]),f.createElement(w,{name:"RadioGroup.Description"},f.createElement(x,{name:"RadioGroup.Label"},f.createElement(nf.Provider,{value:H},f.createElement(tf.Provider,{value:N},a!=null&&j!=null&&Pc({[a]:j}).map(([$,I],R)=>f.createElement(es,{features:Qn.Hidden,ref:R===0?z=>{var Y;G.current=(Y=z==null?void 0:z.closest("form"))!=null?Y:null}:void 0,...Jo({key:$,as:"input",type:"radio",checked:I!=null,hidden:!0,readOnly:!0,form:i,disabled:d,name:$,value:I})})),$e({ourProps:L,theirProps:p,slot:F,defaultTag:SP,name:"RadioGroup"})))))}var jP=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(jP||{});let EP="div";function PP(e,t){var n;let s=bt(),{id:r=`headlessui-radiogroup-option-${s}`,value:o,disabled:i=!1,...a}=e,c=f.useRef(null),u=Fe(c,t),[d,p]=ef(),[h,g]=zp(),{addFlag:m,removeFlag:b,hasFlag:v}=sv(1),x=_t({value:o,disabled:i}),y=rv("RadioGroup.Option"),w=ov("RadioGroup.Option");De(()=>w.registerOption({id:r,element:c,propsRef:x}),[r,w,c,x]);let S=re(M=>{var N;if(Pr(M.currentTarget))return M.preventDefault();w.change(o)&&(m(2),(N=c.current)==null||N.focus())}),C=re(M=>{if(Pr(M.currentTarget))return M.preventDefault();m(2)}),j=re(()=>b(2)),E=((n=y.firstOption)==null?void 0:n.id)===r,T=y.disabled||i,O=y.compare(y.value,o),P={ref:u,id:r,role:"radio","aria-checked":O?"true":"false","aria-labelledby":d,"aria-describedby":h,"aria-disabled":T?!0:void 0,tabIndex:T?-1:O||!y.containsCheckedOption&&E?0:-1,onClick:T?void 0:S,onFocus:T?void 0:C,onBlur:T?void 0:j},_=f.useMemo(()=>({checked:O,disabled:T,active:v(2)}),[O,T,v]);return f.createElement(g,{name:"RadioGroup.Description"},f.createElement(p,{name:"RadioGroup.Label"},$e({ourProps:P,theirProps:a,slot:_,defaultTag:EP,name:"RadioGroup.Option"})))}let TP=ke(CP),OP=ke(PP),Bh=Object.assign(TP,{Option:OP,Label:nv,Description:Xb}),sf=f.createContext(null);sf.displayName="GroupContext";let _P=f.Fragment;function AP(e){var t;let[n,s]=f.useState(null),[r,o]=ef(),[i,a]=zp(),c=f.useMemo(()=>({switch:n,setSwitch:s,labelledby:r,describedby:i}),[n,s,r,i]),u={},d=e;return f.createElement(a,{name:"Switch.Description"},f.createElement(o,{name:"Switch.Label",props:{htmlFor:(t=c.switch)==null?void 0:t.id,onClick(p){n&&(p.currentTarget.tagName==="LABEL"&&p.preventDefault(),n.click(),n.focus({preventScroll:!0}))}}},f.createElement(sf.Provider,{value:c},$e({ourProps:u,theirProps:d,defaultTag:_P,name:"Switch.Group"}))))}let MP="button";function LP(e,t){var n;let s=bt(),{id:r=`headlessui-switch-${s}`,checked:o,defaultChecked:i=!1,onChange:a,disabled:c=!1,name:u,value:d,form:p,...h}=e,g=f.useContext(sf),m=f.useRef(null),b=Fe(m,t,g===null?null:g.setSwitch),[v,x]=Sc(o,a,i),y=re(()=>x==null?void 0:x(!v)),w=re(O=>{if(Pr(O.currentTarget))return O.preventDefault();O.preventDefault(),y()}),S=re(O=>{O.key===he.Space?(O.preventDefault(),y()):O.key===he.Enter&&Wb(O.currentTarget)}),C=re(O=>O.preventDefault()),j=f.useMemo(()=>({checked:v}),[v]),E={id:r,ref:b,role:"switch",type:ui(e,m),tabIndex:e.tabIndex===-1?0:(n=e.tabIndex)!=null?n:0,"aria-checked":v,"aria-labelledby":g==null?void 0:g.labelledby,"aria-describedby":g==null?void 0:g.describedby,disabled:c,onClick:w,onKeyUp:S,onKeyPress:C},T=Jn();return f.useEffect(()=>{var O;let P=(O=m.current)==null?void 0:O.closest("form");P&&i!==void 0&&T.addEventListener(P,"reset",()=>{x(i)})},[m,x]),f.createElement(f.Fragment,null,u!=null&&v&&f.createElement(es,{features:Qn.Hidden,...Jo({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:c,form:p,checked:v,name:u,value:d})}),$e({ourProps:E,theirProps:h,slot:j,defaultTag:MP,name:"Switch"}))}let NP=ke(LP),$P=AP,_u=Object.assign(NP,{Group:$P,Label:nv,Description:Xb});function kP({onFocus:e}){let[t,n]=f.useState(!0),s=Tc();return t?f.createElement(es,{as:"button",type:"button",features:Qn.Focusable,onFocus:r=>{r.preventDefault();let o,i=50;function a(){if(i--<=0){o&&cancelAnimationFrame(o);return}if(e()){if(cancelAnimationFrame(o),!s.current)return;n(!1);return}o=requestAnimationFrame(a)}o=requestAnimationFrame(a)}}):null}const iv=Xe.createContext(null);function RP(){return{groups:new Map,get(e,t){var n;let s=this.groups.get(e);s||(s=new Map,this.groups.set(e,s));let r=(n=s.get(t))!=null?n:0;s.set(t,r+1);let o=Array.from(s.keys()).indexOf(t);function i(){let a=s.get(t);a>1?s.set(t,a-1):s.delete(t)}return[o,i]}}}function IP({children:e}){let t=Xe.useRef(RP());return Xe.createElement(iv.Provider,{value:t},e)}function av(e){let t=Xe.useContext(iv);if(!t)throw new Error("You must wrap your component in a <StableCollection>");let n=VP(),[s,r]=t.current.get(e,n);return Xe.useEffect(()=>r,[]),s}function VP(){var e,t,n;let s=(n=(t=(e=Xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:e.ReactCurrentOwner)==null?void 0:t.current)!=null?n:null;if(!s)return Symbol();let r=[],o=s;for(;o;)r.push(o.index),o=o.return;return"$."+r.join(".")}var HP=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(HP||{}),DP=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))(DP||{}),FP=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(FP||{});let BP={0(e,t){var n;let s=Bs(e.tabs,d=>d.current),r=Bs(e.panels,d=>d.current),o=s.filter(d=>{var p;return!((p=d.current)!=null&&p.hasAttribute("disabled"))}),i={...e,tabs:s,panels:r};if(t.index<0||t.index>s.length-1){let d=_e(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>_e(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(o.length===0)return i;let p=_e(d,{0:()=>s.indexOf(o[0]),1:()=>s.indexOf(o[o.length-1])});return{...i,selectedIndex:p===-1?e.selectedIndex:p}}let a=s.slice(0,t.index),c=[...s.slice(t.index),...a].find(d=>o.includes(d));if(!c)return i;let u=(n=s.indexOf(c))!=null?n:e.selectedIndex;return u===-1&&(u=e.selectedIndex),{...i,selectedIndex:u}},1(e,t){if(e.tabs.includes(t.tab))return e;let n=e.tabs[e.selectedIndex],s=Bs([...e.tabs,t.tab],o=>o.current),r=e.selectedIndex;return e.info.current.isControlled||(r=s.indexOf(n),r===-1&&(r=e.selectedIndex)),{...e,tabs:s,selectedIndex:r}},2(e,t){return{...e,tabs:e.tabs.filter(n=>n!==t.tab)}},3(e,t){return e.panels.includes(t.panel)?e:{...e,panels:Bs([...e.panels,t.panel],n=>n.current)}},4(e,t){return{...e,panels:e.panels.filter(n=>n!==t.panel)}}},rf=f.createContext(null);rf.displayName="TabsDataContext";function Qo(e){let t=f.useContext(rf);if(t===null){let n=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Qo),n}return t}let of=f.createContext(null);of.displayName="TabsActionsContext";function af(e){let t=f.useContext(of);if(t===null){let n=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,af),n}return t}function zP(e,t){return _e(t.type,BP,e,t)}let UP=f.Fragment;function WP(e,t){let{defaultIndex:n=0,vertical:s=!1,manual:r=!1,onChange:o,selectedIndex:i=null,...a}=e;const c=s?"vertical":"horizontal",u=r?"manual":"auto";let d=i!==null,p=_t({isControlled:d}),h=Fe(t),[g,m]=f.useReducer(zP,{info:p,selectedIndex:i??n,tabs:[],panels:[]}),b=f.useMemo(()=>({selectedIndex:g.selectedIndex}),[g.selectedIndex]),v=_t(o||(()=>{})),x=_t(g.tabs),y=f.useMemo(()=>({orientation:c,activation:u,...g}),[c,u,g]),w=re(O=>(m({type:1,tab:O}),()=>m({type:2,tab:O}))),S=re(O=>(m({type:3,panel:O}),()=>m({type:4,panel:O}))),C=re(O=>{j.current!==O&&v.current(O),d||m({type:0,index:O})}),j=_t(d?e.selectedIndex:g.selectedIndex),E=f.useMemo(()=>({registerTab:w,registerPanel:S,change:C}),[]);De(()=>{m({type:0,index:i??n})},[i]),De(()=>{if(j.current===void 0||g.tabs.length<=0)return;let O=Bs(g.tabs,P=>P.current);O.some((P,_)=>g.tabs[_]!==P)&&C(O.indexOf(g.tabs[j.current]))});let T={ref:h};return f.createElement(IP,null,f.createElement(of.Provider,{value:E},f.createElement(rf.Provider,{value:y},y.tabs.length<=0&&f.createElement(kP,{onFocus:()=>{var O,P;for(let _ of x.current)if(((O=_.current)==null?void 0:O.tabIndex)===0)return(P=_.current)==null||P.focus(),!0;return!1}}),$e({ourProps:T,theirProps:a,slot:b,defaultTag:UP,name:"Tabs"}))))}let GP="div";function qP(e,t){let{orientation:n,selectedIndex:s}=Qo("Tab.List"),r=Fe(t);return $e({ourProps:{ref:r,role:"tablist","aria-orientation":n},theirProps:e,slot:{selectedIndex:s},defaultTag:GP,name:"Tabs.List"})}let KP="button";function ZP(e,t){var n,s;let r=bt(),{id:o=`headlessui-tabs-tab-${r}`,...i}=e,{orientation:a,activation:c,selectedIndex:u,tabs:d,panels:p}=Qo("Tab"),h=af("Tab"),g=Qo("Tab"),m=f.useRef(null),b=Fe(m,t);De(()=>h.registerTab(m),[h,m]);let v=av("tabs"),x=d.indexOf(m);x===-1&&(x=v);let y=x===u,w=re(P=>{var _;let M=P();if(M===ys.Success&&c==="auto"){let N=(_=kr(m))==null?void 0:_.activeElement,H=g.tabs.findIndex(L=>L.current===N);H!==-1&&h.change(H)}return M}),S=re(P=>{let _=d.map(M=>M.current).filter(Boolean);if(P.key===he.Space||P.key===he.Enter){P.preventDefault(),P.stopPropagation(),h.change(x);return}switch(P.key){case he.Home:case he.PageUp:return P.preventDefault(),P.stopPropagation(),w(()=>Xt(_,xt.First));case he.End:case he.PageDown:return P.preventDefault(),P.stopPropagation(),w(()=>Xt(_,xt.Last))}if(w(()=>_e(a,{vertical(){return P.key===he.ArrowUp?Xt(_,xt.Previous|xt.WrapAround):P.key===he.ArrowDown?Xt(_,xt.Next|xt.WrapAround):ys.Error},horizontal(){return P.key===he.ArrowLeft?Xt(_,xt.Previous|xt.WrapAround):P.key===he.ArrowRight?Xt(_,xt.Next|xt.WrapAround):ys.Error}}))===ys.Success)return P.preventDefault()}),C=f.useRef(!1),j=re(()=>{var P;C.current||(C.current=!0,(P=m.current)==null||P.focus({preventScroll:!0}),h.change(x),kp(()=>{C.current=!1}))}),E=re(P=>{P.preventDefault()}),T=f.useMemo(()=>{var P;return{selected:y,disabled:(P=e.disabled)!=null?P:!1}},[y,e.disabled]),O={ref:b,onKeyDown:S,onMouseDown:E,onClick:j,id:o,role:"tab",type:ui(e,m),"aria-controls":(s=(n=p[x])==null?void 0:n.current)==null?void 0:s.id,"aria-selected":y,tabIndex:y?0:-1};return $e({ourProps:O,theirProps:i,slot:T,defaultTag:KP,name:"Tabs.Tab"})}let YP="div";function XP(e,t){let{selectedIndex:n}=Qo("Tab.Panels"),s=Fe(t),r=f.useMemo(()=>({selectedIndex:n}),[n]);return $e({ourProps:{ref:s},theirProps:e,slot:r,defaultTag:YP,name:"Tabs.Panels"})}let JP="div",QP=un.RenderStrategy|un.Static;function eT(e,t){var n,s,r,o;let i=bt(),{id:a=`headlessui-tabs-panel-${i}`,tabIndex:c=0,...u}=e,{selectedIndex:d,tabs:p,panels:h}=Qo("Tab.Panel"),g=af("Tab.Panel"),m=f.useRef(null),b=Fe(m,t);De(()=>g.registerPanel(m),[g,m,a]);let v=av("panels"),x=h.indexOf(m);x===-1&&(x=v);let y=x===d,w=f.useMemo(()=>({selected:y}),[y]),S={ref:b,id:a,role:"tabpanel","aria-labelledby":(s=(n=p[x])==null?void 0:n.current)==null?void 0:s.id,tabIndex:y?c:-1};return!y&&((r=u.unmount)==null||r)&&!((o=u.static)!=null&&o)?f.createElement(es,{as:"span","aria-hidden":"true",...S}):$e({ourProps:S,theirProps:u,slot:w,defaultTag:JP,features:QP,visible:y,name:"Tabs.Panel"})}let tT=ke(ZP),nT=ke(WP),sT=ke(qP),rT=ke(XP),oT=ke(eT),Si=Object.assign(tT,{Group:nT,List:sT,Panels:rT,Panel:oT});function iT(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Au(e,...t){e&&t.length>0&&e.classList.add(...t)}function Mu(e,...t){e&&t.length>0&&e.classList.remove(...t)}function aT(e,t){let n=Es();if(!e)return n.dispose;let{transitionDuration:s,transitionDelay:r}=getComputedStyle(e),[o,i]=[s,r].map(c=>{let[u=0]=c.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,p)=>p-d);return u}),a=o+i;if(a!==0){n.group(u=>{u.setTimeout(()=>{t(),u.dispose()},a),u.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&u.dispose()})});let c=n.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),c())})}else t();return n.add(()=>t()),n.dispose}function lT(e,t,n,s){let r=n?"enter":"leave",o=Es(),i=s!==void 0?iT(s):()=>{};r==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=_e(r,{enter:()=>t.enter,leave:()=>t.leave}),c=_e(r,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=_e(r,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Mu(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Au(e,...t.base,...a,...u),o.nextFrame(()=>{Mu(e,...t.base,...a,...u),Au(e,...t.base,...a,...c),aT(e,()=>(Mu(e,...t.base,...a),Au(e,...t.base,...t.entered),i()))}),o.dispose}function cT({immediate:e,container:t,direction:n,classes:s,onStart:r,onStop:o}){let i=Tc(),a=Jn(),c=_t(n);De(()=>{e&&(c.current="enter")},[e]),De(()=>{let u=Es();a.add(u.dispose);let d=t.current;if(d&&c.current!=="idle"&&i.current)return u.dispose(),r.current(c.current),u.add(lT(d,s.current,c.current==="enter",()=>{u.dispose(),o.current(c.current)})),u.dispose},[n])}function ir(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Ac=f.createContext(null);Ac.displayName="TransitionContext";var uT=(e=>(e.Visible="visible",e.Hidden="hidden",e))(uT||{});function dT(){let e=f.useContext(Ac);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function pT(){let e=f.useContext(Mc);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Mc=f.createContext(null);Mc.displayName="NestingContext";function Lc(e){return"children"in e?Lc(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function lv(e,t){let n=_t(e),s=f.useRef([]),r=Tc(),o=Jn(),i=re((g,m=br.Hidden)=>{let b=s.current.findIndex(({el:v})=>v===g);b!==-1&&(_e(m,{[br.Unmount](){s.current.splice(b,1)},[br.Hidden](){s.current[b].state="hidden"}}),o.microTask(()=>{var v;!Lc(s)&&r.current&&((v=n.current)==null||v.call(n))}))}),a=re(g=>{let m=s.current.find(({el:b})=>b===g);return m?m.state!=="visible"&&(m.state="visible"):s.current.push({el:g,state:"visible"}),()=>i(g,br.Unmount)}),c=f.useRef([]),u=f.useRef(Promise.resolve()),d=f.useRef({enter:[],leave:[],idle:[]}),p=re((g,m,b)=>{c.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([v])=>v!==g)),t==null||t.chains.current[m].push([g,new Promise(v=>{c.current.push(v)})]),t==null||t.chains.current[m].push([g,new Promise(v=>{Promise.all(d.current[m].map(([x,y])=>y)).then(()=>v())})]),m==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),h=re((g,m,b)=>{Promise.all(d.current[m].splice(0).map(([v,x])=>x)).then(()=>{var v;(v=c.current.shift())==null||v()}).then(()=>b(m))});return f.useMemo(()=>({children:s,register:a,unregister:i,onStart:p,onStop:h,wait:u,chains:d}),[a,i,s,p,h,d,u])}function fT(){}let hT=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function zh(e){var t;let n={};for(let s of hT)n[s]=(t=e[s])!=null?t:fT;return n}function gT(e){let t=f.useRef(zh(e));return f.useEffect(()=>{t.current=zh(e)},[e]),t}let mT="div",cv=un.RenderStrategy;function bT(e,t){var n,s;let{beforeEnter:r,afterEnter:o,beforeLeave:i,afterLeave:a,enter:c,enterFrom:u,enterTo:d,entered:p,leave:h,leaveFrom:g,leaveTo:m,...b}=e,v=f.useRef(null),x=Fe(v,t),y=(n=b.unmount)==null||n?br.Unmount:br.Hidden,{show:w,appear:S,initial:C}=dT(),[j,E]=f.useState(w?"visible":"hidden"),T=pT(),{register:O,unregister:P}=T;f.useEffect(()=>O(v),[O,v]),f.useEffect(()=>{if(y===br.Hidden&&v.current){if(w&&j!=="visible"){E("visible");return}return _e(j,{hidden:()=>P(v),visible:()=>O(v)})}},[j,v,O,P,w,y]);let _=_t({base:ir(b.className),enter:ir(c),enterFrom:ir(u),enterTo:ir(d),entered:ir(p),leave:ir(h),leaveFrom:ir(g),leaveTo:ir(m)}),M=gT({beforeEnter:r,afterEnter:o,beforeLeave:i,afterLeave:a}),N=Cc();f.useEffect(()=>{if(N&&j==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,j,N]);let H=C&&!S,L=S&&w&&C,F=!N||H?"idle":w?"enter":"leave",G=sv(0),D=re(Z=>_e(Z,{enter:()=>{G.addFlag(at.Opening),M.current.beforeEnter()},leave:()=>{G.addFlag(at.Closing),M.current.beforeLeave()},idle:()=>{}})),$=re(Z=>_e(Z,{enter:()=>{G.removeFlag(at.Opening),M.current.afterEnter()},leave:()=>{G.removeFlag(at.Closing),M.current.afterLeave()},idle:()=>{}})),I=lv(()=>{E("hidden"),P(v)},T),R=f.useRef(!1);cT({immediate:L,container:v,classes:_,direction:F,onStart:_t(Z=>{R.current=!0,I.onStart(v,Z,D)}),onStop:_t(Z=>{R.current=!1,I.onStop(v,Z,$),Z==="leave"&&!Lc(I)&&(E("hidden"),P(v))})});let z=b,Y={ref:x};return L?z={...z,className:Jl(b.className,..._.current.enter,..._.current.enterFrom)}:R.current&&(z.className=Jl(b.className,(s=v.current)==null?void 0:s.className),z.className===""&&delete z.className),f.createElement(Mc.Provider,{value:I},f.createElement(Oa,{value:_e(j,{visible:at.Open,hidden:at.Closed})|G.flags},$e({ourProps:Y,theirProps:z,defaultTag:mT,features:cv,visible:j==="visible",name:"Transition.Child"})))}function vT(e,t){let{show:n,appear:s=!1,unmount:r=!0,...o}=e,i=f.useRef(null),a=Fe(i,t);Cc();let c=Co();if(n===void 0&&c!==null&&(n=(c&at.Open)===at.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=f.useState(n?"visible":"hidden"),p=lv(()=>{d("hidden")}),[h,g]=f.useState(!0),m=f.useRef([n]);De(()=>{h!==!1&&m.current[m.current.length-1]!==n&&(m.current.push(n),g(!1))},[m,n]);let b=f.useMemo(()=>({show:n,appear:s,initial:h}),[n,s,h]);f.useEffect(()=>{if(n)d("visible");else if(!Lc(p))d("hidden");else{let w=i.current;if(!w)return;let S=w.getBoundingClientRect();S.x===0&&S.y===0&&S.width===0&&S.height===0&&d("hidden")}},[n,p]);let v={unmount:r},x=re(()=>{var w;h&&g(!1),(w=e.beforeEnter)==null||w.call(e)}),y=re(()=>{var w;h&&g(!1),(w=e.beforeLeave)==null||w.call(e)});return f.createElement(Mc.Provider,{value:p},f.createElement(Ac.Provider,{value:b},$e({ourProps:{...v,as:f.Fragment,children:f.createElement(uv,{ref:a,...v,...o,beforeEnter:x,beforeLeave:y})},theirProps:{},defaultTag:f.Fragment,features:cv,visible:u==="visible",name:"Transition"})))}function yT(e,t){let n=f.useContext(Ac)!==null,s=Co()!==null;return f.createElement(f.Fragment,null,!n&&s?f.createElement(kd,{ref:t,...e}):f.createElement(uv,{ref:t,...e}))}let kd=ke(vT),uv=ke(bT),xT=ke(yT),lf=Object.assign(kd,{Child:xT,Root:kd});var Uh=function(t){return t.reduce(function(n,s){var r=s[0],o=s[1];return n[r]=o,n},{})},Wh=typeof window<"u"&&window.document&&window.document.createElement?Xe.useLayoutEffect:Xe.useEffect,ln="top",Vn="bottom",Hn="right",cn="left",cf="auto",La=[ln,Vn,Hn,cn],ei="start",na="end",wT="clippingParents",dv="viewport",Ci="popper",ST="reference",Gh=La.reduce(function(e,t){return e.concat([t+"-"+ei,t+"-"+na])},[]),pv=[].concat(La,[cf]).reduce(function(e,t){return e.concat([t,t+"-"+ei,t+"-"+na])},[]),CT="beforeRead",jT="read",ET="afterRead",PT="beforeMain",TT="main",OT="afterMain",_T="beforeWrite",AT="write",MT="afterWrite",LT=[CT,jT,ET,PT,TT,OT,_T,AT,MT];function Ps(e){return e?(e.nodeName||"").toLowerCase():null}function wn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function go(e){var t=wn(e).Element;return e instanceof t||e instanceof Element}function In(e){var t=wn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function uf(e){if(typeof ShadowRoot>"u")return!1;var t=wn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function NT(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var s=t.styles[n]||{},r=t.attributes[n]||{},o=t.elements[n];!In(o)||!Ps(o)||(Object.assign(o.style,s),Object.keys(r).forEach(function(i){var a=r[i];a===!1?o.removeAttribute(i):o.setAttribute(i,a===!0?"":a)}))})}function $T(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(s){var r=t.elements[s],o=t.attributes[s]||{},i=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:n[s]),a=i.reduce(function(c,u){return c[u]="",c},{});!In(r)||!Ps(r)||(Object.assign(r.style,a),Object.keys(o).forEach(function(c){r.removeAttribute(c)}))})}}const kT={name:"applyStyles",enabled:!0,phase:"write",fn:NT,effect:$T,requires:["computeStyles"]};function js(e){return e.split("-")[0]}var ro=Math.max,Ql=Math.min,ti=Math.round;function Rd(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function fv(){return!/^((?!chrome|android).)*safari/i.test(Rd())}function ni(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var s=e.getBoundingClientRect(),r=1,o=1;t&&In(e)&&(r=e.offsetWidth>0&&ti(s.width)/e.offsetWidth||1,o=e.offsetHeight>0&&ti(s.height)/e.offsetHeight||1);var i=go(e)?wn(e):window,a=i.visualViewport,c=!fv()&&n,u=(s.left+(c&&a?a.offsetLeft:0))/r,d=(s.top+(c&&a?a.offsetTop:0))/o,p=s.width/r,h=s.height/o;return{width:p,height:h,top:d,right:u+p,bottom:d+h,left:u,x:u,y:d}}function df(e){var t=ni(e),n=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:s}}function hv(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&uf(n)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Ys(e){return wn(e).getComputedStyle(e)}function RT(e){return["table","td","th"].indexOf(Ps(e))>=0}function Rr(e){return((go(e)?e.ownerDocument:e.document)||window.document).documentElement}function Nc(e){return Ps(e)==="html"?e:e.assignedSlot||e.parentNode||(uf(e)?e.host:null)||Rr(e)}function qh(e){return!In(e)||Ys(e).position==="fixed"?null:e.offsetParent}function IT(e){var t=/firefox/i.test(Rd()),n=/Trident/i.test(Rd());if(n&&In(e)){var s=Ys(e);if(s.position==="fixed")return null}var r=Nc(e);for(uf(r)&&(r=r.host);In(r)&&["html","body"].indexOf(Ps(r))<0;){var o=Ys(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function Na(e){for(var t=wn(e),n=qh(e);n&&RT(n)&&Ys(n).position==="static";)n=qh(n);return n&&(Ps(n)==="html"||Ps(n)==="body"&&Ys(n).position==="static")?t:n||IT(e)||t}function pf(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Vi(e,t,n){return ro(e,Ql(t,n))}function VT(e,t,n){var s=Vi(e,t,n);return s>n?n:s}function gv(){return{top:0,right:0,bottom:0,left:0}}function mv(e){return Object.assign({},gv(),e)}function bv(e,t){return t.reduce(function(n,s){return n[s]=e,n},{})}var HT=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,mv(typeof t!="number"?t:bv(t,La))};function DT(e){var t,n=e.state,s=e.name,r=e.options,o=n.elements.arrow,i=n.modifiersData.popperOffsets,a=js(n.placement),c=pf(a),u=[cn,Hn].indexOf(a)>=0,d=u?"height":"width";if(!(!o||!i)){var p=HT(r.padding,n),h=df(o),g=c==="y"?ln:cn,m=c==="y"?Vn:Hn,b=n.rects.reference[d]+n.rects.reference[c]-i[c]-n.rects.popper[d],v=i[c]-n.rects.reference[c],x=Na(o),y=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,w=b/2-v/2,S=p[g],C=y-h[d]-p[m],j=y/2-h[d]/2+w,E=Vi(S,j,C),T=c;n.modifiersData[s]=(t={},t[T]=E,t.centerOffset=E-j,t)}}function FT(e){var t=e.state,n=e.options,s=n.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||hv(t.elements.popper,r)&&(t.elements.arrow=r))}const BT={name:"arrow",enabled:!0,phase:"main",fn:DT,effect:FT,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function si(e){return e.split("-")[1]}var zT={top:"auto",right:"auto",bottom:"auto",left:"auto"};function UT(e,t){var n=e.x,s=e.y,r=t.devicePixelRatio||1;return{x:ti(n*r)/r||0,y:ti(s*r)/r||0}}function Kh(e){var t,n=e.popper,s=e.popperRect,r=e.placement,o=e.variation,i=e.offsets,a=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,p=e.isFixed,h=i.x,g=h===void 0?0:h,m=i.y,b=m===void 0?0:m,v=typeof d=="function"?d({x:g,y:b}):{x:g,y:b};g=v.x,b=v.y;var x=i.hasOwnProperty("x"),y=i.hasOwnProperty("y"),w=cn,S=ln,C=window;if(u){var j=Na(n),E="clientHeight",T="clientWidth";if(j===wn(n)&&(j=Rr(n),Ys(j).position!=="static"&&a==="absolute"&&(E="scrollHeight",T="scrollWidth")),j=j,r===ln||(r===cn||r===Hn)&&o===na){S=Vn;var O=p&&j===C&&C.visualViewport?C.visualViewport.height:j[E];b-=O-s.height,b*=c?1:-1}if(r===cn||(r===ln||r===Vn)&&o===na){w=Hn;var P=p&&j===C&&C.visualViewport?C.visualViewport.width:j[T];g-=P-s.width,g*=c?1:-1}}var _=Object.assign({position:a},u&&zT),M=d===!0?UT({x:g,y:b},wn(n)):{x:g,y:b};if(g=M.x,b=M.y,c){var N;return Object.assign({},_,(N={},N[S]=y?"0":"",N[w]=x?"0":"",N.transform=(C.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",N))}return Object.assign({},_,(t={},t[S]=y?b+"px":"",t[w]=x?g+"px":"",t.transform="",t))}function WT(e){var t=e.state,n=e.options,s=n.gpuAcceleration,r=s===void 0?!0:s,o=n.adaptive,i=o===void 0?!0:o,a=n.roundOffsets,c=a===void 0?!0:a,u={placement:js(t.placement),variation:si(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Kh(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Kh(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const GT={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:WT,data:{}};var rl={passive:!0};function qT(e){var t=e.state,n=e.instance,s=e.options,r=s.scroll,o=r===void 0?!0:r,i=s.resize,a=i===void 0?!0:i,c=wn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(d){d.addEventListener("scroll",n.update,rl)}),a&&c.addEventListener("resize",n.update,rl),function(){o&&u.forEach(function(d){d.removeEventListener("scroll",n.update,rl)}),a&&c.removeEventListener("resize",n.update,rl)}}const KT={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:qT,data:{}};var ZT={left:"right",right:"left",bottom:"top",top:"bottom"};function Vl(e){return e.replace(/left|right|bottom|top/g,function(t){return ZT[t]})}var YT={start:"end",end:"start"};function Zh(e){return e.replace(/start|end/g,function(t){return YT[t]})}function ff(e){var t=wn(e),n=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:n,scrollTop:s}}function hf(e){return ni(Rr(e)).left+ff(e).scrollLeft}function XT(e,t){var n=wn(e),s=Rr(e),r=n.visualViewport,o=s.clientWidth,i=s.clientHeight,a=0,c=0;if(r){o=r.width,i=r.height;var u=fv();(u||!u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}return{width:o,height:i,x:a+hf(e),y:c}}function JT(e){var t,n=Rr(e),s=ff(e),r=(t=e.ownerDocument)==null?void 0:t.body,o=ro(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),i=ro(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-s.scrollLeft+hf(e),c=-s.scrollTop;return Ys(r||n).direction==="rtl"&&(a+=ro(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:i,x:a,y:c}}function gf(e){var t=Ys(e),n=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+s)}function vv(e){return["html","body","#document"].indexOf(Ps(e))>=0?e.ownerDocument.body:In(e)&&gf(e)?e:vv(Nc(e))}function Hi(e,t){var n;t===void 0&&(t=[]);var s=vv(e),r=s===((n=e.ownerDocument)==null?void 0:n.body),o=wn(s),i=r?[o].concat(o.visualViewport||[],gf(s)?s:[]):s,a=t.concat(i);return r?a:a.concat(Hi(Nc(i)))}function Id(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function QT(e,t){var n=ni(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Yh(e,t,n){return t===dv?Id(XT(e,n)):go(t)?QT(t,n):Id(JT(Rr(e)))}function eO(e){var t=Hi(Nc(e)),n=["absolute","fixed"].indexOf(Ys(e).position)>=0,s=n&&In(e)?Na(e):e;return go(s)?t.filter(function(r){return go(r)&&hv(r,s)&&Ps(r)!=="body"}):[]}function tO(e,t,n,s){var r=t==="clippingParents"?eO(e):[].concat(t),o=[].concat(r,[n]),i=o[0],a=o.reduce(function(c,u){var d=Yh(e,u,s);return c.top=ro(d.top,c.top),c.right=Ql(d.right,c.right),c.bottom=Ql(d.bottom,c.bottom),c.left=ro(d.left,c.left),c},Yh(e,i,s));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function yv(e){var t=e.reference,n=e.element,s=e.placement,r=s?js(s):null,o=s?si(s):null,i=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,c;switch(r){case ln:c={x:i,y:t.y-n.height};break;case Vn:c={x:i,y:t.y+t.height};break;case Hn:c={x:t.x+t.width,y:a};break;case cn:c={x:t.x-n.width,y:a};break;default:c={x:t.x,y:t.y}}var u=r?pf(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(o){case ei:c[u]=c[u]-(t[d]/2-n[d]/2);break;case na:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function sa(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=s===void 0?e.placement:s,o=n.strategy,i=o===void 0?e.strategy:o,a=n.boundary,c=a===void 0?wT:a,u=n.rootBoundary,d=u===void 0?dv:u,p=n.elementContext,h=p===void 0?Ci:p,g=n.altBoundary,m=g===void 0?!1:g,b=n.padding,v=b===void 0?0:b,x=mv(typeof v!="number"?v:bv(v,La)),y=h===Ci?ST:Ci,w=e.rects.popper,S=e.elements[m?y:h],C=tO(go(S)?S:S.contextElement||Rr(e.elements.popper),c,d,i),j=ni(e.elements.reference),E=yv({reference:j,element:w,strategy:"absolute",placement:r}),T=Id(Object.assign({},w,E)),O=h===Ci?T:j,P={top:C.top-O.top+x.top,bottom:O.bottom-C.bottom+x.bottom,left:C.left-O.left+x.left,right:O.right-C.right+x.right},_=e.modifiersData.offset;if(h===Ci&&_){var M=_[r];Object.keys(P).forEach(function(N){var H=[Hn,Vn].indexOf(N)>=0?1:-1,L=[ln,Vn].indexOf(N)>=0?"y":"x";P[N]+=M[L]*H})}return P}function nO(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=n.boundary,o=n.rootBoundary,i=n.padding,a=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?pv:c,d=si(s),p=d?a?Gh:Gh.filter(function(m){return si(m)===d}):La,h=p.filter(function(m){return u.indexOf(m)>=0});h.length===0&&(h=p);var g=h.reduce(function(m,b){return m[b]=sa(e,{placement:b,boundary:r,rootBoundary:o,padding:i})[js(b)],m},{});return Object.keys(g).sort(function(m,b){return g[m]-g[b]})}function sO(e){if(js(e)===cf)return[];var t=Vl(e);return[Zh(e),t,Zh(t)]}function rO(e){var t=e.state,n=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,i=n.altAxis,a=i===void 0?!0:i,c=n.fallbackPlacements,u=n.padding,d=n.boundary,p=n.rootBoundary,h=n.altBoundary,g=n.flipVariations,m=g===void 0?!0:g,b=n.allowedAutoPlacements,v=t.options.placement,x=js(v),y=x===v,w=c||(y||!m?[Vl(v)]:sO(v)),S=[v].concat(w).reduce(function(Z,J){return Z.concat(js(J)===cf?nO(t,{placement:J,boundary:d,rootBoundary:p,padding:u,flipVariations:m,allowedAutoPlacements:b}):J)},[]),C=t.rects.reference,j=t.rects.popper,E=new Map,T=!0,O=S[0],P=0;P<S.length;P++){var _=S[P],M=js(_),N=si(_)===ei,H=[ln,Vn].indexOf(M)>=0,L=H?"width":"height",F=sa(t,{placement:_,boundary:d,rootBoundary:p,altBoundary:h,padding:u}),G=H?N?Hn:cn:N?Vn:ln;C[L]>j[L]&&(G=Vl(G));var D=Vl(G),$=[];if(o&&$.push(F[M]<=0),a&&$.push(F[G]<=0,F[D]<=0),$.every(function(Z){return Z})){O=_,T=!1;break}E.set(_,$)}if(T)for(var I=m?3:1,R=function(J){var ee=S.find(function(te){var q=E.get(te);if(q)return q.slice(0,J).every(function(ne){return ne})});if(ee)return O=ee,"break"},z=I;z>0;z--){var Y=R(z);if(Y==="break")break}t.placement!==O&&(t.modifiersData[s]._skip=!0,t.placement=O,t.reset=!0)}}const oO={name:"flip",enabled:!0,phase:"main",fn:rO,requiresIfExists:["offset"],data:{_skip:!1}};function Xh(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Jh(e){return[ln,Hn,Vn,cn].some(function(t){return e[t]>=0})}function iO(e){var t=e.state,n=e.name,s=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,i=sa(t,{elementContext:"reference"}),a=sa(t,{altBoundary:!0}),c=Xh(i,s),u=Xh(a,r,o),d=Jh(c),p=Jh(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const aO={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iO};function lO(e,t,n){var s=js(e),r=[cn,ln].indexOf(s)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,i=o[0],a=o[1];return i=i||0,a=(a||0)*r,[cn,Hn].indexOf(s)>=0?{x:a,y:i}:{x:i,y:a}}function cO(e){var t=e.state,n=e.options,s=e.name,r=n.offset,o=r===void 0?[0,0]:r,i=pv.reduce(function(d,p){return d[p]=lO(p,t.rects,o),d},{}),a=i[t.placement],c=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[s]=i}const uO={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:cO};function dO(e){var t=e.state,n=e.name;t.modifiersData[n]=yv({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const pO={name:"popperOffsets",enabled:!0,phase:"read",fn:dO,data:{}};function fO(e){return e==="x"?"y":"x"}function hO(e){var t=e.state,n=e.options,s=e.name,r=n.mainAxis,o=r===void 0?!0:r,i=n.altAxis,a=i===void 0?!1:i,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,p=n.padding,h=n.tether,g=h===void 0?!0:h,m=n.tetherOffset,b=m===void 0?0:m,v=sa(t,{boundary:c,rootBoundary:u,padding:p,altBoundary:d}),x=js(t.placement),y=si(t.placement),w=!y,S=pf(x),C=fO(S),j=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,O=typeof b=="function"?b(Object.assign({},t.rects,{placement:t.placement})):b,P=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(j){if(o){var N,H=S==="y"?ln:cn,L=S==="y"?Vn:Hn,F=S==="y"?"height":"width",G=j[S],D=G+v[H],$=G-v[L],I=g?-T[F]/2:0,R=y===ei?E[F]:T[F],z=y===ei?-T[F]:-E[F],Y=t.elements.arrow,Z=g&&Y?df(Y):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:gv(),ee=J[H],te=J[L],q=Vi(0,E[F],Z[F]),ne=w?E[F]/2-I-q-ee-P.mainAxis:R-q-ee-P.mainAxis,ce=w?-E[F]/2+I+q+te+P.mainAxis:z+q+te+P.mainAxis,ge=t.elements.arrow&&Na(t.elements.arrow),Re=ge?S==="y"?ge.clientTop||0:ge.clientLeft||0:0,ve=(N=_==null?void 0:_[S])!=null?N:0,qe=G+ne-ve-Re,Be=G+ce-ve,ht=Vi(g?Ql(D,qe):D,G,g?ro($,Be):$);j[S]=ht,M[S]=ht-G}if(a){var et,be=S==="x"?ln:cn,Ze=S==="x"?Vn:Hn,Ye=j[C],lt=C==="y"?"height":"width",Pe=Ye+v[be],st=Ye-v[Ze],tt=[ln,cn].indexOf(x)!==-1,Ne=(et=_==null?void 0:_[C])!=null?et:0,Dt=tt?Pe:Ye-E[lt]-T[lt]-Ne+P.altAxis,pe=tt?Ye+E[lt]+T[lt]-Ne-P.altAxis:st,Me=g&&tt?VT(Dt,Ye,pe):Vi(g?Dt:Pe,Ye,g?pe:st);j[C]=Me,M[C]=Me-Ye}t.modifiersData[s]=M}}const gO={name:"preventOverflow",enabled:!0,phase:"main",fn:hO,requiresIfExists:["offset"]};function mO(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function bO(e){return e===wn(e)||!In(e)?ff(e):mO(e)}function vO(e){var t=e.getBoundingClientRect(),n=ti(t.width)/e.offsetWidth||1,s=ti(t.height)/e.offsetHeight||1;return n!==1||s!==1}function yO(e,t,n){n===void 0&&(n=!1);var s=In(t),r=In(t)&&vO(t),o=Rr(t),i=ni(e,r,n),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!n)&&((Ps(t)!=="body"||gf(o))&&(a=bO(t)),In(t)?(c=ni(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=hf(o))),{x:i.left+a.scrollLeft-c.x,y:i.top+a.scrollTop-c.y,width:i.width,height:i.height}}function xO(e){var t=new Map,n=new Set,s=[];e.forEach(function(o){t.set(o.name,o)});function r(o){n.add(o.name);var i=[].concat(o.requires||[],o.requiresIfExists||[]);i.forEach(function(a){if(!n.has(a)){var c=t.get(a);c&&r(c)}}),s.push(o)}return e.forEach(function(o){n.has(o.name)||r(o)}),s}function wO(e){var t=xO(e);return LT.reduce(function(n,s){return n.concat(t.filter(function(r){return r.phase===s}))},[])}function SO(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function CO(e){var t=e.reduce(function(n,s){var r=n[s.name];return n[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,n},{});return Object.keys(t).map(function(n){return t[n]})}var Qh={placement:"bottom",modifiers:[],strategy:"absolute"};function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function jO(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,s=n===void 0?[]:n,r=t.defaultOptions,o=r===void 0?Qh:r;return function(a,c,u){u===void 0&&(u=o);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Qh,o),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},p=[],h=!1,g={state:d,setOptions:function(x){var y=typeof x=="function"?x(d.options):x;b(),d.options=Object.assign({},o,d.options,y),d.scrollParents={reference:go(a)?Hi(a):a.contextElement?Hi(a.contextElement):[],popper:Hi(c)};var w=wO(CO([].concat(s,d.options.modifiers)));return d.orderedModifiers=w.filter(function(S){return S.enabled}),m(),g.update()},forceUpdate:function(){if(!h){var x=d.elements,y=x.reference,w=x.popper;if(eg(y,w)){d.rects={reference:yO(y,Na(w),d.options.strategy==="fixed"),popper:df(w)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(P){return d.modifiersData[P.name]=Object.assign({},P.data)});for(var S=0;S<d.orderedModifiers.length;S++){if(d.reset===!0){d.reset=!1,S=-1;continue}var C=d.orderedModifiers[S],j=C.fn,E=C.options,T=E===void 0?{}:E,O=C.name;typeof j=="function"&&(d=j({state:d,options:T,name:O,instance:g})||d)}}}},update:SO(function(){return new Promise(function(v){g.forceUpdate(),v(d)})}),destroy:function(){b(),h=!0}};if(!eg(a,c))return g;g.setOptions(u).then(function(v){!h&&u.onFirstUpdate&&u.onFirstUpdate(v)});function m(){d.orderedModifiers.forEach(function(v){var x=v.name,y=v.options,w=y===void 0?{}:y,S=v.effect;if(typeof S=="function"){var C=S({state:d,name:x,instance:g,options:w}),j=function(){};p.push(C||j)}})}function b(){p.forEach(function(v){return v()}),p=[]}return g}}var EO=[KT,pO,GT,kT,uO,oO,gO,BT,aO],PO=jO({defaultModifiers:EO}),TO=typeof Element<"u",OO=typeof Map=="function",_O=typeof Set=="function",AO=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Hl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,s,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(!Hl(e[s],t[s]))return!1;return!0}var o;if(OO&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(s=o.next()).done;)if(!t.has(s.value[0]))return!1;for(o=e.entries();!(s=o.next()).done;)if(!Hl(s.value[1],t.get(s.value[0])))return!1;return!0}if(_O&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(s=o.next()).done;)if(!t.has(s.value[0]))return!1;return!0}if(AO&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(s=n;s--!==0;)if(e[s]!==t[s])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[s]))return!1;if(TO&&e instanceof Element)return!1;for(s=n;s--!==0;)if(!((r[s]==="_owner"||r[s]==="__v"||r[s]==="__o")&&e.$$typeof)&&!Hl(e[r[s]],t[r[s]]))return!1;return!0}return e!==e&&t!==t}var MO=function(t,n){try{return Hl(t,n)}catch(s){if((s.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw s}};const LO=wp(MO);var NO=[],$a=function(t,n,s){s===void 0&&(s={});var r=Xe.useRef(null),o={onFirstUpdate:s.onFirstUpdate,placement:s.placement||"bottom",strategy:s.strategy||"absolute",modifiers:s.modifiers||NO},i=Xe.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),a=i[0],c=i[1],u=Xe.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(g){var m=g.state,b=Object.keys(m.elements);Cx.flushSync(function(){c({styles:Uh(b.map(function(v){return[v,m.styles[v]||{}]})),attributes:Uh(b.map(function(v){return[v,m.attributes[v]]}))})})},requires:["computeStyles"]}},[]),d=Xe.useMemo(function(){var h={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[u,{name:"applyStyles",enabled:!1}])};return LO(r.current,h)?r.current||h:(r.current=h,h)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,u]),p=Xe.useRef();return Wh(function(){p.current&&p.current.setOptions(d)},[d]),Wh(function(){if(!(t==null||n==null)){var h=s.createPopper||PO,g=h(t,n,d);return p.current=g,function(){g.destroy(),p.current=null}}},[t,n,s.createPopper]),{state:p.current?p.current.state:null,styles:a.styles,attributes:a.attributes,update:p.current?p.current.update:null,forceUpdate:p.current?p.current.forceUpdate:null}};const Dn=f.forwardRef(function({children:t,title:n,onClose:s,icon:r,skipOverflow:o,shadow:i=!0,padding:a=!0,border:c=!0,round:u=!0,className:d,classNameBody:p,size:h="m",titleClass:g=K("gs-utl-mb-2 gs-utl-mt-0.5"),style:m,bg:b,...v},x){const y=tr(r)?r:{};return l.jsxs("div",{...v,ref:x,style:m,className:K(["gs-utl-card",d,b||Np.bg,X.b,u&&X.rnd,c?B.br:X.bT,!o&&"gs-utl-overflow-auto",i&&"gs-utl-shadow-md",a&&h==="l"&&"gs-utl-p-5",a&&h==="m"&&"gs-utl-px-4 gs-utl-py-2",a&&h==="s"&&"gs-utl-px-2 gs-utl-py-1",a&&h==="xs"&&"gs-utl-px-2 gs-utl-py-0.5",a&&h==="x2s"&&"gs-utl-px-0.5"]),children:[(n||s)&&n!==!1&&l.jsxs(k,{className:K("gs-utl-card-title",g),items:"center",children:[l.jsx(V,{className:K("truncate"),grow:!0,children:n}),(s||r)&&l.jsx(V,{onClick:s,className:K("cursor-pointer transition-opacity opacity-50 hover:gs-utl-opacity-100"),children:l.jsx(Q,{icon:(nt(r)?r:"")||U.close,size:"18px",...y})})]}),l.jsx("div",{className:K("gs-utl-card-body",p),children:t})]})});var ol,$O=new Uint8Array(16);function kO(){if(!ol&&(ol=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!ol))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ol($O)}const RO=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function IO(e){return typeof e=="string"&&RO.test(e)}var It=[];for(var Lu=0;Lu<256;++Lu)It.push((Lu+256).toString(16).substr(1));function VO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(It[e[t+0]]+It[e[t+1]]+It[e[t+2]]+It[e[t+3]]+"-"+It[e[t+4]]+It[e[t+5]]+"-"+It[e[t+6]]+It[e[t+7]]+"-"+It[e[t+8]]+It[e[t+9]]+"-"+It[e[t+10]]+It[e[t+11]]+It[e[t+12]]+It[e[t+13]]+It[e[t+14]]+It[e[t+15]]).toLowerCase();if(!IO(n))throw TypeError("Stringified UUID is invalid");return n}function xv(e,t,n){e=e||{};var s=e.random||(e.rng||kO)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,VO(s)}class HO extends Error{constructor(t,n){super(t),this.error=t,this.errorData=n}}const ji=async(e,{onError:t,onLoading:n,onResult:s,params:r,rawText:o,...i})=>{try{n==null||n(!0);const a=r?new URLSearchParams(r).toString():"",c=a?`?${a}`:"",u=await fetch(`${e}${c}`,i);if(!u.ok){const p=await u.json();throw new HO(p.error||"Request failed!",p.errorData)}let d;if(o)d=await u.text();else try{d=await u.json()}catch{d=void 0}return s==null||s(d),d}catch(a){const c=a instanceof Error?a:new Error(a);if(t==null||t(c),i.throwError)throw c;return c}finally{n==null||n(!1)}};class Os{static async get(t,n){return ji(t,{...n,method:"GET"})}static async post(t,n){return ji(t,{...n,method:"POST"})}static async put(t,n){return ji(t,{...n,method:"PUT"})}static async patch(t,n){return ji(t,{...n,method:"PATCH"})}static async delete(t,n){return ji(t,{...n,method:"DELETE"})}}var $c=(e=>(e.Projects="projects",e.Settings="settings",e))($c||{}),wv=(e=>(e.gjs="gjs",e.gjsStudio="gjs-studio",e))(wv||{});const tg={},DO=1,FO=(e={})=>new Promise((t,n)=>{const s=(e==null?void 0:e.db)||"gjs",r=s==="gjs-studio"?DO:1,o=tg[s];if(o)t(o);else{if(!Ts())return n(new Error("window context not found"));const i=window.indexedDB.open(s,r);i.onerror=n,i.onsuccess=()=>{const a=i.result;a.onerror=n,tg[s]=a,t(a)},i.onupgradeneeded=()=>{const a=i.result;a.objectStoreNames.contains("projects")||a.createObjectStore("projects"),a.objectStoreNames.contains("settings")||a.createObjectStore("settings")}}}),mf=async(e,t)=>(await FO(t)).transaction([e],"readwrite").objectStore(e),BO=async(e,t)=>{const n=await mf(e,t);return new Promise((s,r)=>{const o=[],i=n.openCursor();i.onerror=r,i.onsuccess=function(a){const u=a.target.result;if(u){const d=u.primaryKey,p=u.value;o.push({key:d,data:p}),u.continue()}else s(o)}})},zO=async(e,t,n)=>{const s=await mf(e,n);return new Promise((r,o)=>{const i=s.get(t);i.onerror=o,i.onsuccess=()=>r(i.result)})},UO=async(e,t,n)=>{const s=await mf(e,n);return new Promise((r,o)=>{const i=s.delete(t);i.onerror=o,i.onsuccess=()=>r()})};var ra=(e=>(e.Existing="existing",e.Templates="templates",e))(ra||{});const WO=e=>{const t=M3();return`${(t==null?void 0:t.baseApiUrl)||"/api"}/templates/${e}`},GO=(e,t)=>Os.get(WO(e),{...t}),qO=async e=>{try{const t=await GO(e);return(t==null?void 0:t.result)??[]}catch(t){return console.error(`Failed to load templates for type ${e}:`,t),[]}},Sv=async(e=mt.web)=>typeof window>"u"?[]:(await BO($c.Projects)).map(({key:s,data:r})=>{var o;return{id:`${s}`,name:`${((o=r.custom)==null?void 0:o.projectName)||s}`,data:r}}).filter(s=>{var r;return((r=s.data.custom)==null?void 0:r.projectType)===e}),Cv=new Set,yn=new WeakMap,qo=new WeakMap,mo=new WeakMap,Vd=new WeakMap,KO=new WeakMap,ri=new WeakMap,ec=new WeakMap;let Tr;const Xr="__aa_tgt",Hd="__aa_del",ZO=e=>{const t=e3(e);t&&t.forEach(n=>t3(n))},YO=e=>{e.forEach(t=>{t.target===Tr&&JO(),yn.has(t.target)&&Eo(t.target)})};function XO(e){const t=Vd.get(e);t==null||t.disconnect();let n=yn.get(e),s=0;const r=5;n||(n=oi(e),yn.set(e,n));const{offsetWidth:o,offsetHeight:i}=Tr,c=[n.top-r,o-(n.left+r+n.width),i-(n.top+r+n.height),n.left-r].map(d=>`${-1*Math.floor(d)}px`).join(" "),u=new IntersectionObserver(()=>{++s>1&&Eo(e)},{root:Tr,threshold:1,rootMargin:c});u.observe(e),Vd.set(e,u)}function Eo(e){clearTimeout(ec.get(e));const t=kc(e),n=typeof t=="function"?500:t.duration;ec.set(e,setTimeout(()=>{const s=mo.get(e);(!s||s.finished)&&(yn.set(e,oi(e)),XO(e))},n))}function JO(){clearTimeout(ec.get(Tr)),ec.set(Tr,setTimeout(()=>{Cv.forEach(e=>Pv(e,t=>jv(()=>Eo(t))))},100))}function QO(e){setTimeout(()=>{KO.set(e,setInterval(()=>jv(Eo.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function jv(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let Dd,zo;typeof window<"u"&&(Tr=document.documentElement,Dd=new MutationObserver(ZO),zo=new ResizeObserver(YO),zo.observe(Tr));function e3(e){return e.reduce((t,n)=>{if(t===!1)return!1;if(n.target instanceof Element){if(Nu(n.target),!t.has(n.target)){t.add(n.target);for(let s=0;s<n.target.children.length;s++){const r=n.target.children.item(s);if(r){if(Hd in r)return!1;Nu(n.target,r),t.add(r)}}}if(n.removedNodes.length)for(let s=0;s<n.removedNodes.length;s++){const r=n.removedNodes[s];if(Hd in r)return!1;r instanceof Element&&(t.add(r),Nu(n.target,r),qo.set(r,[n.previousSibling,n.nextSibling]))}}return t},new Set)}function Nu(e,t){!t&&!(Xr in e)?Object.defineProperty(e,Xr,{value:e}):t&&!(Xr in t)&&Object.defineProperty(t,Xr,{value:e})}function t3(e){var t;const n=Tr.contains(e),s=yn.has(e);n&&qo.has(e)&&qo.delete(e),mo.has(e)&&((t=mo.get(e))===null||t===void 0||t.cancel()),s&&n?n3(e):s&&!n?r3(e):s3(e)}function cs(e){return Number(e.replace(/[^0-9.\-]/g,""))}function oi(e){const t=e.getBoundingClientRect();return{top:t.top+window.scrollY,left:t.left+window.scrollX,width:t.width,height:t.height}}function Ev(e,t,n){let s=t.width,r=t.height,o=n.width,i=n.height;const a=getComputedStyle(e);if(a.getPropertyValue("box-sizing")==="content-box"){const u=cs(a.paddingTop)+cs(a.paddingBottom)+cs(a.borderTopWidth)+cs(a.borderBottomWidth),d=cs(a.paddingLeft)+cs(a.paddingRight)+cs(a.borderRightWidth)+cs(a.borderLeftWidth);s-=d,o-=d,r-=u,i-=u}return[s,o,r,i].map(Math.round)}function kc(e){return Xr in e&&ri.has(e[Xr])?ri.get(e[Xr]):{duration:250,easing:"ease-in-out"}}function Pv(e,...t){t.forEach(n=>n(e,ri.has(e)));for(let n=0;n<e.children.length;n++){const s=e.children.item(n);s&&t.forEach(r=>r(s,ri.has(s)))}}function n3(e){const t=yn.get(e),n=oi(e);let s;if(!t)return;const r=kc(e);if(typeof r!="function"){const o=t.left-n.left,i=t.top-n.top,[a,c,u,d]=Ev(e,t,n),p={transform:`translate(${o}px, ${i}px)`},h={transform:"translate(0, 0)"};a!==c&&(p.width=`${a}px`,h.width=`${c}px`),u!==d&&(p.height=`${u}px`,h.height=`${d}px`),s=e.animate([p,h],r)}else s=new Animation(r(e,"remain",t,n)),s.play();mo.set(e,s),yn.set(e,n),s.addEventListener("finish",Eo.bind(null,e))}function s3(e){const t=oi(e);yn.set(e,t);const n=kc(e);let s;typeof n!="function"?s=e.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"}):(s=new Animation(n(e,"add",t)),s.play()),mo.set(e,s),s.addEventListener("finish",Eo.bind(null,e))}function r3(e){if(!qo.has(e)||!yn.has(e))return;const[t,n]=qo.get(e);Object.defineProperty(e,Hd,{value:!0}),n&&n.parentNode&&n.parentNode instanceof Element?n.parentNode.insertBefore(e,n):t&&t.parentNode&&t.parentNode.appendChild(e);const[s,r,o,i]=o3(e),a=kc(e),c=yn.get(e);let u;Object.assign(e.style,{position:"absolute",top:`${s}px`,left:`${r}px`,width:`${o}px`,height:`${i}px`,margin:0,pointerEvents:"none",transformOrigin:"center",zIndex:100}),typeof a!="function"?u=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:a.duration,easing:"ease-out"}):(u=new Animation(a(e,"remove",c)),u.play()),mo.set(e,u),u.addEventListener("finish",()=>{var d;e.remove(),yn.delete(e),qo.delete(e),mo.delete(e),(d=Vd.get(e))===null||d===void 0||d.disconnect()})}function o3(e){const t=yn.get(e),[n,,s]=Ev(e,t,oi(e));let r=e.parentElement;for(;r&&(getComputedStyle(r).position==="static"||r instanceof HTMLBodyElement);)r=r.parentElement;r||(r=document.body);const o=getComputedStyle(r),i=yn.get(r)||oi(r),a=Math.round(t.top-i.top)-cs(o.borderTopWidth),c=Math.round(t.left-i.left)-cs(o.borderLeftWidth);return[a,c,n,s]}function i3(e,t={}){Dd&&zo&&(getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),Pv(e,Eo,QO,n=>zo==null?void 0:zo.observe(n)),typeof t=="function"?ri.set(e,t):ri.set(e,{duration:250,easing:"ease-in-out",...t}),Dd.observe(e,{childList:!0}),Cv.add(e))}function a3(e){const t=f.useRef(null);return f.useEffect(()=>{t.current instanceof HTMLElement&&i3(t.current,e)},[t]),t}const l3={[Jt.Info]:B.bgA,[Jt.Error]:"bg-red-500",[Jt.Success]:"bg-green-500",[Jt.Warning]:"bg-orange-400"},c3=f.forwardRef(function(t,n){const s={[Jt.Info]:U.informationVariant,[Jt.Error]:U.fire,[Jt.Success]:U.checkBold,[Jt.Warning]:U.alertRhombus},{children:r,className:o,content:i,id:a,buttons:c=[],variant:u=Jt.Info,autoHideTimeout:d=3e3}=t,p=f.useRef(null),h=f.useRef(),g=s[u],m=l3[u];f.useImperativeHandle(n,()=>p.current,[]);const b=()=>{var w;return(w=t.onDismiss)==null?void 0:w.call(t,a)},v=()=>{d&&(h.current=setTimeout(b,d))},x=()=>h.current&&clearTimeout(h.current);f.useEffect(()=>(v(),x),[]);const y=i||r;return l.jsx(Dn,{className:ie(o,"overflow-hidden relative"),ref:p,onPointerEnter:x,onPointerLeave:v,children:l.jsxs(k,{space:"m",items:"center",className:ie(we.y),children:[l.jsx(V,{className:ie(m,X.pill,"text-white gjs-p-1"),children:l.jsx(Q,{icon:g,size:oe.s})}),l.jsx(V,{grow:!0,className:ie("gjs-pr-3"),children:l.jsxs(k,{col:!0,space:"xs",children:[l.jsx(V,{className:ie("text-lg font-medium leading-6"),children:t.header}),y&&l.jsx(V,{className:ie(B.txtLowEmphasis),children:y}),!!c.length&&l.jsx(k,{space:"m",justify:"end",children:c.map(({id:w,...S})=>l.jsx(Ge,{...S},w))})]})}),l.jsx(V,{className:ie("absolute top-1 right-1"),children:l.jsx(ft,{onClick:b,border:!1,children:l.jsx(Q,{icon:U.close,size:oe.s})})})]})})});ae(f.forwardRef(function({className:t,toasts:n,onDismiss:s,...r},o){const i=a3({});return l.jsx("div",{className:ie(t,"w-80 gs-utl-z-30"),...r,ref:i,children:n.map(a=>l.jsx(c3,{...a,className:ie("gjs-mb-2"),onDismiss:s},a.uuid||a.id))})}));var Fd=(e=>(e.self="self",e.cloud="cloud",e))(Fd||{}),oo=(e=>(e.image="image",e.video="video",e))(oo||{}),Un=(e=>(e.componentOutline="componentOutline",e.preview="preview",e.fullscreen="fullscreen",e.showCode="showCode",e.showImportCode="showImportCode",e.clearCanvas="clearCanvas",e.store="store",e.undo="undo",e.redo="redo",e))(Un||{}),bf=(e=>(e.canvas="canvas",e.layers="layers",e))(bf||{}),ur=(e=>(e.selectParent="selectParent",e.duplicate="duplicate",e.delete="delete",e.symbolCreate="symbolCreate",e.symbolDetach="symbolDetach",e.symbolOverride="symbolOverride",e.symbolOverrideClear="symbolOverrideClear",e))(ur||{}),kt=(e=>(e.variable="data-variable",e.condition="data-condition",e.conditionTrue="data-condition-true-content",e.conditionFalse="data-condition-false-content",e.collection="data-collection",e.collectionItem="data-collection-item",e))(kt||{}),Bd=(e=>(e.browser="browser",e.self="self",e.cloud="cloud",e))(Bd||{});const oa=e=>e.replaceAll('"',"").replaceAll("'",""),bo=e=>e.includes(",")?e:/\s/.test(e)?`'${oa(e)}'`:oa(e),ng=(e,t,n)=>({family:e,variant:t,...n}),Di=(e,t)=>{e=bo(e);const{menuVariant:n,variants:s}=t;return{family:e,familyLabel:oa(e),menuVariant:n&&ng(bo(`menuFont-${oa(e)}`),"regular",n),variants:Object.assign({},...Object.entries(s).map(([r,o])=>({[r]:ng(e,r,o)})))}},vf=(e,t)=>{var a;const n=Di(e.family,e),s=n.menuVariant??((a=Object.values(n.variants))==null?void 0:a[0]);if(!s)return"Arial, Helvetica, sans-serif";const{source:r,descriptors:o}=s,i=oa(s.family);if(!t){const c=new FontFace(i,`url("${r}")`,o),u=Array.from(document.fonts.values()).filter(d=>d.family===i);for(const d of u)document.fonts.delete(d);document.fonts.add(c),c.load().catch(()=>{})}return bo(i)},is=", sans-serif",sg=["Arial, Helvetica"+is,"Arial Black, Gadget"+is,"Brush Script MT"+is,"Comic Sans MS, cursive"+is,"Courier New, Courier, monospace","Georgia, serif","Helvetica"+is,"Impact, Charcoal"+is,"Lucida Sans Unicode, Lucida Grande"+is,"Tahoma, Geneva"+is,"Times New Roman, Times, serif","Trebuchet MS, Helvetica"+is,"Verdana, Geneva"+is].map(e=>({id:e,label:e.split(",")[0]})),u3=String.raw,ks=(e,t)=>{if(!t)return"";const n=e[0],s=e[1];return`${n}${t}${s}`},d3=({family:e,source:t,descriptors:n})=>{const{display:s,ascentOverride:r,descentOverride:o,featureSettings:i,lineGapOverride:a,stretch:c,style:u,unicodeRange:d,weight:p}=n??{},h=[ks`font-ascent-override: ${r};`,ks`font-display: ${s};`,ks`font-descent-override: ${o};`,ks`font-feature-settings: ${i};`,ks`font-line-gap-override: ${a};`,ks`font-stretch: ${c};`,ks`font-style: ${u};`,ks`font-unicode-range: ${d};`,ks`font-weight: ${p};`].filter(Boolean);return u3`
90
36
  @font-face {
91
37
  font-family: ${e};
92
38
  src: url('${t}');
93
- ${p.join(`
39
+ ${h.join(`
94
40
  `)}
95
41
  }
96
- `},c0=(e={})=>{const t=Object.entries(e).map(([s,r])=>Qi(s,r));let n="";for(const s of t)for(const r of Object.values(s.variants))n+=iA(r)+`
97
- `;return n.trim()},u0="data-project-fonts",d0="true",aA=`${u0}="${d0}"`,f0=(e={})=>{const t=c0(e);return t?`<style ${aA}>
42
+ `},Tv=(e={})=>{const t=Object.entries(e).map(([s,r])=>Di(s,r));let n="";for(const s of t)for(const r of Object.values(s.variants))n+=d3(r)+`
43
+ `;return n.trim()},Ov="data-project-fonts",_v="true",p3=`${Ov}="${_v}"`,Av=(e={})=>{const t=Tv(e);return t?`<style ${p3}>
98
44
  ${t}
99
- </style>`:""},lA=e=>e.sort((t,n)=>t.familyLabel<n.familyLabel?-1:t.familyLabel>n.familyLabel?1:0),cA=e=>e.sort((t,n)=>t.id<n.id?-1:t.id>n.id?1:0),Vg=e=>!!e.id,zo=e=>t=>(t.tagName||"").toLowerCase()===e,Cs=(...e)=>e.map(t=>`[data-gjs-type="${t}"]`).join(","),uA=(e,...t)=>{var n;return t.indexOf((n=e==null?void 0:e.tagName)==null?void 0:n.toUpperCase())>=0},ri=(e,...t)=>{var n;return!!e&&t.indexOf((n=e.tagName)==null?void 0:n.toLowerCase())>=0},Ir=(e,t)=>{var n;return(n=e==null?void 0:e.classList)==null?void 0:n.contains(t)},Ga=(e,t)=>{var n;return!!((n=e==null?void 0:e.hasAttribute)!=null&&n.call(e,t))},qa=(e,t)=>{const n=e.Blocks.get(t);return n?n.collection.indexOf(n):-1},dA=e=>e.replace(/[^a-z0-9.]/gi,"_").toLowerCase(),uf=(e,t,n="html")=>{const{Pages:s}=e,r=Qt({page:t,key:"slug"})??"";return`${s.getMain()===t?"index":Ac(r||t.getName())}.${n}`},fA=(e,t)=>{const{toolbar:n}=e;n.some(r=>r.id===t.id)||(n.unshift(t),e.set("toolbar",[...n]))},gc="custom-html-body",mc="data-custom-html-body",Ig="data-global-custom-html-head",Dg="data-global-custom-html-body",Hg="global",pA=function(e,t){const n=r=>{if(!r)return e.em.logError("loadGlobalHead: document not found");const o=df(t.appStore);let i=r.querySelector(`[${Ig}]`);i||(i=r.createElement("div"),i.setAttribute(Ig,"true"),r.head.insertBefore(i,r.head.firstChild));const a=f0(o.fonts),l=o.customCodeHead,u=[a,l].filter(d=>!!d).join(`
100
- `);i.innerHTML=u,_h(i)},s=r=>{if(!r)return e.em.logError("loadGlobalBody: document not found");const o=df(t.appStore);let i=r.querySelector(`[${Dg}]`);if(!i){i=r.createElement("div"),i.setAttribute(Dg,"true");const a=r.querySelector('[data-gjs-type="wrapper"]');a==null||a.appendChild(i)}i.innerHTML=o.customCodeBody||"",_h(i)};e.on(e.Canvas.events.frameLoad,r=>{var o;return n((o=r.el.contentWindow)==null?void 0:o.document)}),e.on(e.Canvas.events.frameLoadBody,r=>{var o;return s((o=r.el.contentWindow)==null?void 0:o.document)}),e.on(Tn.pageSettingsUpdate,r=>{var i,a;if(r.page)return;const o=(a=(i=e.Canvas.getFrames()[0])==null?void 0:i.view)==null?void 0:a.getDoc();n(o),s(o)}),e.Components.addType(gc,{isComponent:r=>Ga(r,mc),model:{defaults:{attributes:{[mc]:!0},locked:!0,layerable:!1},toHTML:()=>""}}),e.on(e.events.projectLoad,()=>{const{appStore:r}=t,{globalPageSettings:o}=r.projectDataCustom;let i=(o==null?void 0:o.customCodeHead)||"",a=(o==null?void 0:o.customCodeBody)||"";e.Pages.getAll().forEach(l=>{const u=l.getMainComponent(),d=u.head.components(),f=[];d.forEach(m=>{m.has(Hg)&&f.push(m)}),f.forEach(m=>{const b=m.toHTML();i.includes(b)||(i+=b),m.remove()});const p=[];u.findType(gc).forEach(m=>{m.has(Hg)&&p.push(m)}),p.forEach(m=>{const b=m.getInnerHTML();a.includes(b)||(a+=b),m.remove()})}),(i||a)&&r.setProjectDataCustom({globalPageSettings:{...o,customCodeHead:i,customCodeBody:a}})})},va="page://",Xc="href-params__",hA=`data-gjs-${Xc}`,Jc=e=>{var t,n;return(n=(t=e==null?void 0:e.getMainComponent())==null?void 0:t.dataResolverProps)==null?void 0:n.path},Qc=e=>!!Jc(e),Fg=e=>{const t=e.getDirtyCount()||0;e.em.set({changesCount:t+1},{})},gA=e=>!!(e!=null&&e.Components.getType("mjml")),p0=e=>Qc(e)?Z.database:Fp(e)?Z.home:"",h0=e=>!!e.getSymbolOverride()?c.jsx(oe,{icon:Z.rhombusOutline,size:le.s3x}):c.jsx(fv,{className:N("gs-cmp-svg-icon gs-utl-w-[16px] gs-utl-fill-current"),svg:e.getIcon()}),g0=e=>{e.getModel().set({changesCount:e.getDirtyCount()+1})},Fp=e=>{var t;return e&&e===((t=e.em.Pages)==null?void 0:t.getMain())},lt={title:({cmp:e})=>e.tagName==="title",favicon:({cmp:e})=>{var t;return e.tagName==="link"&&((t=e.attributes.attributes)==null?void 0:t.rel)==="icon"},description:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="description"},keywords:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="keywords"},socialTitle:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.property)==="og:title"},socialImage:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.property)==="og:image"},socialDescription:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.property)==="og:description"},charset:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.charset)},viewport:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="viewport"},robots:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="robots"},generator:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="generator"}},m0=e=>{for(const t in lt){const n=t;if(lt[n]({cmp:e}))return n}},b0=(e,t,n)=>{const s=[];let r=n;return e.getMainComponent().findType(gc).forEach(o=>{s.push(o),r=(r||"")+o.getInnerHTML()}),{components:s,html:r,changed:r!==t}},mA=(e,t)=>{const n={...t},s=e.getMainComponent(),{head:r}=s;if(r){const i=[],a=r.components();a.forEach(u=>{lt.title({cmp:u})?(u.components(t.title),delete n.title):lt.favicon({cmp:u})?(u.addAttributes({href:t.favicon}),delete n.favicon):lt.description({cmp:u})?(u.addAttributes({content:t.description}),delete n.description):lt.keywords({cmp:u})?(u.addAttributes({content:t.keywords}),delete n.keywords):lt.socialTitle({cmp:u})?(u.addAttributes({content:t.socialTitle}),delete n.socialTitle):lt.socialDescription({cmp:u})?(u.addAttributes({content:t.socialDescription}),delete n.socialDescription):lt.socialImage({cmp:u})?(u.addAttributes({content:t.socialImage}),delete n.socialImage):m0(u)||i.push(u)});const l=e.em.Parser.parseHtml(`<!DOCTYPE html><html><head>${t.customCodeHead}</head></html>`);l.head&&(a.remove(i),l.head.components&&a.add(l.head.components),delete n.customCodeHead)}const o=b0(e,n.customCodeBody);if(o.changed){const[i,...a]=o.components;(i||s.append({type:gc})[0]).components(n.customCodeBody),a.forEach(u=>u.remove()),delete n.customCodeBody}return e.set("settings",n)},bA=(e,t={})=>{var o;const n={...e.get("settings")??{}},s=e.getMainComponent(),{head:r}=s;if(r){const i=[];r.components().forEach(a=>{const{content:l,href:u}=a.getAttributes({noClass:!0,noStyle:!0});lt.title({cmp:a})?n.title=a.getInnerHTML():lt.favicon({cmp:a})?n.favicon=u:lt.description({cmp:a})?n.description=l:lt.keywords({cmp:a})?n.keywords=l:lt.socialTitle({cmp:a})?n.socialTitle=l:lt.socialDescription({cmp:a})?n.socialDescription=l:lt.socialImage({cmp:a})?n.socialImage=l:m0(a)||i.push(a.toHTML())}),i.length&&(n.customCodeHead=i.join(`
101
- `))}if(n.customCodeBody=b0(e,n.customCodeBody).html,t.replaceDataSources&&Jc(e)){const{currentItem:i}=((o=s.getCollectionsState)==null?void 0:o.call(s))||{};i&&Object.keys(n).forEach(a=>{const l=a,u=n[l];ot(u)&&(n[l]=v0(u,i))})}return n},v0=(e,t)=>e.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g,(n,s)=>{const r=t[s.trim()];return r!==void 0?String(r):""}),y0=(e,t={})=>{const{currentItem:n}=t,s=t.ext??"html",r=Qt({page:e,key:"slug"})??"",o=n?v0(r,n):r,i=o.lastIndexOf("/"),a=i>=0,l=a?o.substring(i+1):o,u=a?o.substring(0,i):void 0,d=`${Ac(l)}${s?`.${s}`:""}`;return{path:u,filename:d,fullPath:u?`${u}/${d}`:d}},vA=(e,t)=>e.get(`${Xc}${t}`)||"",yA=(e,t,n)=>{e.set({[`${Xc}${t}`]:n})},xA=(e,t)=>{Object.entries(t).forEach(([n,s])=>{e[`${hA}${n}`]=s})},wA=(e,t)=>{e.getModel().set("customData",{...yi(e),...t})},yi=e=>e.getModel().get("customData")??{},df=e=>(e==null?void 0:e.projectDataCustom.globalPageSettings)??{},Qt=e=>{const{page:t,key:n,appEditorStore:s,def:r,defPage:o,opts:i}=e;return t?bA(t,i)[n]??o:df(s)[n]??r},br=(e,t,n)=>{const s=e.em.getEditor(),o=yi(s).globalPageSettings||{};return Qt({page:e,key:t,opts:n})||o[t]},Bg=(e,t)=>{const n=(e==null?void 0:e.getName())??"",s={page:e,appEditorStore:t,def:"",pageDef:""};return{name:n,slug:Qt({...s,key:"slug",defPage:Ac(n)}),title:Qt({...s,key:"title",defPage:n}),description:Qt({...s,key:"description"}),favicon:Qt({...s,key:"favicon"}),keywords:Qt({...s,key:"keywords"}),socialTitle:Qt({...s,key:"socialTitle",defPage:n}),socialImage:Qt({...s,key:"socialImage"}),socialDescription:Qt({...s,key:"socialDescription"}),customCodeHead:Qt({...s,key:"customCodeHead"}),customCodeBody:Qt({...s,key:"customCodeBody"})}},yl=({icon:e,layout:t,tooltip:n,className:s,forceRemove:r,removeLayouts:o})=>({type:"button",icon:e,tooltip:n,className:s,size:"s",editorEvents:{[`${Tn.layoutToggleId}${t.id}`]:({fromEvent:i,setState:a})=>{a({active:i.isOpen})}},onClick:({editor:i})=>{o==null||o.forEach(a=>i.runCommand(ie.layoutRemove,{id:a,force:r})),i.runCommand(ie.layoutToggle,{...t})}}),zg={type:"static",layoutId:"leftPanelsContainer"},Ug={width:240,overflow:"hidden"};yl({tooltip:"Blocks",removeLayouts:["pagesLayers","ps"],layout:{id:"blocks",layout:"panelBlocks",header:{label:"Blocks"},style:Ug,placer:zg}}),yl({tooltip:"Pages & Layers",removeLayouts:["blocks","ps"],layout:{id:"pagesLayers",layout:"panelPagesLayers",header:!1,style:Ug,placer:zg}}),yl({tooltip:"Page Settings",removeLayouts:["pagesLayers","blocks"],layout:{id:"ps",layout:"panelPageSettings",header:{label:"Page Settings"},style:{marginLeft:40}}}),yl({icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,10.11C13.03,10.11 13.87,10.95 13.87,12C13.87,13 13.03,13.85 12,13.85C10.97,13.85 10.13,13 10.13,12C10.13,10.95 10.97,10.11 12,10.11M7.37,20C8,20.38 9.38,19.8 10.97,18.3C10.45,17.71 9.94,17.07 9.46,16.4C8.64,16.32 7.83,16.2 7.06,16.04C6.55,18.18 6.74,19.65 7.37,20M8.08,14.26L7.79,13.75C7.68,14.04 7.57,14.33 7.5,14.61C7.77,14.67 8.07,14.72 8.38,14.77C8.28,14.6 8.18,14.43 8.08,14.26M14.62,13.5L15.43,12L14.62,10.5C14.32,9.97 14,9.5 13.71,9.03C13.17,9 12.6,9 12,9C11.4,9 10.83,9 10.29,9.03C10,9.5 9.68,9.97 9.38,10.5L8.57,12L9.38,13.5C9.68,14.03 10,14.5 10.29,14.97C10.83,15 11.4,15 12,15C12.6,15 13.17,15 13.71,14.97C14,14.5 14.32,14.03 14.62,13.5M12,6.78C11.81,7 11.61,7.23 11.41,7.5C11.61,7.5 11.8,7.5 12,7.5C12.2,7.5 12.39,7.5 12.59,7.5C12.39,7.23 12.19,7 12,6.78M12,17.22C12.19,17 12.39,16.77 12.59,16.5C12.39,16.5 12.2,16.5 12,16.5C11.8,16.5 11.61,16.5 11.41,16.5C11.61,16.77 11.81,17 12,17.22M16.62,4C16,3.62 14.62,4.2 13.03,5.7C13.55,6.29 14.06,6.93 14.54,7.6C15.36,7.68 16.17,7.8 16.94,7.96C17.45,5.82 17.26,4.35 16.62,4M15.92,9.74L16.21,10.25C16.32,9.96 16.43,9.67 16.5,9.39C16.23,9.33 15.93,9.28 15.62,9.23C15.72,9.4 15.82,9.57 15.92,9.74M17.37,2.69C18.84,3.53 19,5.74 18.38,8.32C20.92,9.07 22.75,10.31 22.75,12C22.75,13.69 20.92,14.93 18.38,15.68C19,18.26 18.84,20.47 17.37,21.31C15.91,22.15 13.92,21.19 12,19.36C10.08,21.19 8.09,22.15 6.62,21.31C5.16,20.47 5,18.26 5.62,15.68C3.08,14.93 1.25,13.69 1.25,12C1.25,10.31 3.08,9.07 5.62,8.32C5,5.74 5.16,3.53 6.62,2.69C8.09,1.85 10.08,2.81 12,4.64C13.92,2.81 15.91,1.85 17.37,2.69M17.08,12C17.42,12.75 17.72,13.5 17.97,14.26C20.07,13.63 21.25,12.73 21.25,12C21.25,11.27 20.07,10.37 17.97,9.74C17.72,10.5 17.42,11.25 17.08,12M6.92,12C6.58,11.25 6.28,10.5 6.03,9.74C3.93,10.37 2.75,11.27 2.75,12C2.75,12.73 3.93,13.63 6.03,14.26C6.28,13.5 6.58,12.75 6.92,12M15.92,14.26C15.82,14.43 15.72,14.6 15.62,14.77C15.93,14.72 16.23,14.67 16.5,14.61C16.43,14.33 16.32,14.04 16.21,13.75L15.92,14.26M13.03,18.3C14.62,19.8 16,20.38 16.62,20C17.26,19.65 17.45,18.18 16.94,16.04C16.17,16.2 15.36,16.32 14.54,16.4C14.06,17.07 13.55,17.71 13.03,18.3M8.08,9.74C8.18,9.57 8.28,9.4 8.38,9.23C8.07,9.28 7.77,9.33 7.5,9.39C7.57,9.67 7.68,9.96 7.79,10.25L8.08,9.74M10.97,5.7C9.38,4.2 8,3.62 7.37,4C6.74,4.35 6.55,5.82 7.06,7.96C7.83,7.8 8.64,7.68 9.46,7.6C9.94,6.93 10.45,6.29 10.97,5.7Z" /></svg>',tooltip:"Custom Component",className:"gs-utl-mt-auto",layout:{id:"customLayout",layout:{type:"custom",component:()=>c.jsx("div",{children:"Custom Reat component"})},header:{label:"Custom"},style:{marginLeft:40}}});const SA={type:"row",style:{height:"100%"},children:[{type:"sidebarLeft"},{type:"canvasSidebarTop"},{type:"sidebarRight"}]};var CA={};class jA{constructor(t,n){var o,i;this.projectType=yt.web,this.editor=void 0,this.sdkProps={},this.sdkLicenseError="",this.licenseCheckRetry=0,this.showPoweredBy=!1,this.isInPreview=!1,this.isCssPanelActive=!1,this.isLeftSidebarOpen=!0,this.isRightSidebarOpen=!0,this.isTopSidebarOpen=!0,this.isBottomSidebarOpen=!0,this.isSelectingTarget=!1,this.leftSidebarSize=240,this.rightSidebarSize=240,this.transitionTime=152,this.topBarSize=36,this.isDev=!1,this.isStage=!1,this.editorKey=0,this.appInstalled=!1,this.licenseKey="",this.licenseCheckStarted=!1,this.studioSdkVersion=CA.STUDIO_NPM_PACKAGE_VERSION,this.projectDataCustom={},this.displayMode="browser",this.projectPlugins=[],this.queryParams={},this.isCanvasPanning=!1,this.selectedDesignerTab="style",this.customAssets=void 0,this.nextProjectData=void 0,this.isDraggingAbsolute=!1,this.isSaving=!1,this.isReady=!1,this.sdkPagesConfigUpdates=0,this.panelPageSettings={isOpen:!1,width:300,page:void 0},this.rootElWidth=0,this._projectId="",this.store=t,n&&Object.keys(n).forEach(a=>{const l=a,u=n[l];u!==void 0&&(this[l]=u)});const s=Vs()?window.location.search:"";this.queryParams=Pw(s),on(this,{sdkProps:!1},{autoBind:!0});const r=(i=(o=this.sdkProps.options)==null?void 0:o.customTheme)==null?void 0:i.icons;r&&EE(r)}get baseApiUrl(){const{isDev:t,isStage:n}=this;return Hf({isDev:t,isStage:n})}get projectId(){var s,r;const{project:t,storage:n}=this.sdkOptions;return this._projectId||((r=(s=(n==null?void 0:n.project)||(t==null?void 0:t.default))==null?void 0:s.custom)==null?void 0:r.id)||""}get projectIdToLoad(){return this.store.localSettingsStore.lastProjectId||this.projectId}get currentProjectId(){return this.projectDataCustom.id||this.projectId}get isBrowserMode(){return this.displayMode==="browser"}get sdkOptions(){return this.sdkProps.options}get sdkProjectId(){var t,n;return(n=(t=this.sdkOptions.project)==null?void 0:t.id)==null?void 0:n.toString()}get sdkIdentityId(){var t,n;return(n=(t=this.sdkOptions.identity)==null?void 0:t.id)==null?void 0:n.toString()}get sdkPagesConfig(){return this.sdkPagesConfigUpdates,this.sdkOptions.pages}get sdkLayoutConfig(){return this.sdkOptions.layout}get sdkComponentsConfig(){return this.sdkOptions.components}get sdkCanvasConfig(){return this.sdkOptions.canvas}get sdkGlobalStylesConfig(){return this.sdkOptions.globalStyles}get currentLayout(){const{sdkLayoutConfig:t,rootElWidth:n,store:s}=this,{customConfig:r}=s.layoutStore,o=(r==null?void 0:r.responsive)||(t==null?void 0:t.responsive);let i=(r==null?void 0:r.default)||(t==null?void 0:t.default)||SA;if(n&&o){const l=Object.keys(o).map(Number).sort((u,d)=>u-d).find(u=>n<=u);i=l?o[l]:i}return i}get sdkCustomIcons(){var t;return(t=this.sdkOptions.customTheme)==null?void 0:t.icons}get isProjectTypeEmail(){return this.projectType===yt.email}get showPages(){return this.isReady&&this.sdkPagesConfig!==!1&&!this.isProjectTypeEmail}get showSelectors(){return!this.isProjectTypeEmail}get sdkMisconfigurationError(){if(this.store.assetsStore.isUsingAssetCloud||this.isUsingProjectCloud){const n=this.sdkProjectId,s=this.sdkIdentityId;if(!n||!s)return'SDK Misconfiguration Error: When using assets.storageType == "cloud" or storage.type === "cloud", project.id and identity.id are required.'}return""}get isUsingProjectSelfHosted(){var t;return((t=this.sdkOptions.storage)==null?void 0:t.type)===cf.self}get isUsingProjectCloud(){var t;return((t=this.sdkOptions.storage)==null?void 0:t.type)===cf.cloud}get publicStateTheme(){const{theme:t,resolvedTheme:n}=this.store.localSettingsStore;return{theme:t,resolvedTheme:n}}setPublicStateTheme(t){t.theme!==void 0&&(this.store.localSettingsStore.theme=t.theme)}*init(){var f,p;const{store:t,sdkOptions:n}=this,{lastProjectId:s,lastProjectType:r}=t.localSettingsStore,o=(f=n.project)==null?void 0:f.default,{project:i}=n.storage||{};let a,l;r&&(this.store.templatesStore._projectTypeFilter=r),s&&(a=(p=(yield r0(r)).find(m=>m.id===s))==null?void 0:p.data),a?l=a:i?l=i:o&&(l=o);const u=(l==null?void 0:l.custom)||{},d=u.projectType;d&&(this.projectType=d),u.projectType=this.projectType,this.setProjectDataCustom({...u,id:this.projectIdToLoad}),yield t.pluginStore.initProjectPlugins(this.projectType),this.editorKey++}setInstallEvent(t){this.installEvent=t}setAppInstalled(t){this.appInstalled=t}setDisplayMode(t){this.displayMode=t}setProject(t){const n=this.editor,{id:s,data:r,isTemplate:o}=t,i=n.Storage.getConfig().options.local,a=o?`${s}__${_w()}`:s;this._projectId=a,i.key=a,Ew(r)||this.loadProjectData({...r,custom:{...r.custom,id:a,projectType:this.store.templatesStore.projectTypeFilter}})}setProjectDataCustom(t){const n={...this.projectDataCustom,...t};this.projectDataCustom=n,this.projectType=n.projectType||yt.web,this.editor&&wA(this.editor,n),n.id&&this.store.localSettingsStore.setLocalState({lastProjectId:n.id,lastProjectType:this.projectType})}loadProjectData(t){const n=t.custom||{};if(EA(t)!==this.projectType)this.setNextProjectData(t),this.setProjectDataCustom(n),this.updateStudio();else{const s=this.editor;s.loadProjectData(t),s.UndoManager.clear(),this.setProjectDataCustom(n)}}setNextProjectData(t){this.nextProjectData=t}setLeftSidebarSize(t){this.leftSidebarSize=t}setRightSidebarSize(t){this.rightSidebarSize=t}setEditor(t){this.editor=t}setPreview(t){this.isInPreview=t}toggleCssPanel(){this.isCssPanelActive=!this.isCssPanelActive}toggleLeftSidebar(){this.isLeftSidebarOpen=!this.isLeftSidebarOpen,this.refreshEditorPostTransition()}setLeftSidebarOpen(t){this.isLeftSidebarOpen=t,this.refreshEditorPostTransition()}toggleRightSidebar(){this.isRightSidebarOpen=!this.isRightSidebarOpen,this.refreshEditorPostTransition()}setRightSidebarOpen(t){this.isRightSidebarOpen=t,this.refreshEditorPostTransition()}setTopSidebarOpen(t){this.isTopSidebarOpen=t,this.refreshEditorPostTransition()}setBottomSidebarOpen(t){this.isBottomSidebarOpen=t,this.refreshEditorPostTransition()}refreshEditorPostTransition(){setTimeout(()=>{var t;return(t=this.editor)==null?void 0:t.refresh()},this.transitionTime)}setCanvasPanning(t){this.isCanvasPanning=t}setSelectingTarget(t){this.isSelectingTarget=t}setSelectedDesignerTab(t){this.selectedDesignerTab=t}setCustomAssets(t){this.customAssets=t}setIsDraggingAbsolute(t){this.isDraggingAbsolute=t}setIsSaving(t){this.isSaving=t}setIsReady(t){this.isReady=t}setPanelPageSettings(t){this.panelPageSettings={...this.panelPageSettings,...t}}setSdkPagesConfig(t){this.sdkProps.options.pages=t&&{...this.sdkPagesConfig,...t},++this.sdkPagesConfigUpdates}setRootElWidth(t){this.rootElWidth=t,this.refreshEditorCanvas()}*loadLicense(){const{editor:t}=this;try{this.licenseCheckStarted=!0;const{licenseKey:n,baseApiUrl:s,studioSdkVersion:r}=this;t==null||t.trigger(sb,{baseApiUrl:s});const o=yield Is.post(`${s}/sdk/${n||"na"}`,{params:{d:window.location.hostname,v:r}});if(o instanceof Error)throw o;const i=o.result||{},{license:a,error:l,plan:u}=i;l?this.sdkLicenseError=l:(this.sdkLicense=a,u!=null&&u.poweredBy&&(this.showPoweredBy=!0)),t==null||t.trigger(Id,i)}catch(n){this.licenseCheckRetry<3?(this.licenseCheckRetry++,setTimeout(()=>this.loadLicense(),3e3)):(console.error(n),this.showPoweredBy=!0,t==null||t.trigger(Id,{}))}}*updateStudio(){const{pluginStore:t}=this.store,{projectType:n}=this.projectDataCustom;yield t.initProjectPlugins(n),this.setEditor(),this.editorKey++}refreshStudio(){var t;this.editorKey&&(this.setNextProjectData((t=this.editor)==null?void 0:t.getProjectData()),this.store.layoutStore.clear(),this.setEditor(),this.editorKey++)}refreshEditorCanvas(){var t;(t=this.editor)==null||t.refresh({tools:!0})}}const EA=e=>{var t;return((t=e.custom)==null?void 0:t.projectType)||yt.web},ye=()=>bn().appEditorStore,x0=()=>wh().appEditorStore,PA=()=>{try{return wh().appEditorStore}catch{}},Bp=()=>{const[e,t]=h.useState(0),n=bn().appEditorStore,{transitionTime:s}=n;return h.useEffect(()=>{setTimeout(()=>t(r=>++r),s)},[s]),[e]},zp=()=>{const{baseApiUrl:e}=x0();return`${e}/assets/sdk`},_A=e=>`${zp()}/${e}`,TA=async(e,t,n)=>{const s=await Is.get(zp(),{params:{projectId:t,identityId:n,d:window.location.hostname,licenseKey:e}});return((s==null?void 0:s.result)??[]).map(({asset:r,cdnUrl:o})=>({...r,size:parseInt(r.size),src:o}))},OA=async(e,t,n,s)=>{const r=await Is.post(zp(),{body:JSON.stringify({fileMetadata:e,projectId:n,identityId:s}),params:{d:window.location.hostname,licenseKey:t}});return r==null?void 0:r.result},AA=async(e,t)=>await Is.put(t,{body:e,rawText:!0}),NA=async(e,t,n,s)=>Promise.all(e.map(r=>OA({name:r.name,size:r.size,type:r.type},t,n,s).then(async o=>{if(!o)throw new Error("No asset");const{asset:i,cdnUrl:a,uploadUrl:l}=o,u=await AA(r,l);if(u instanceof Error)throw console.error(u),new Error("Upload failed");return{...i,size:parseInt(i.size),src:a,type:go.image}}))),MA=async(e,t,n,s)=>{const r=await Is.delete(_A(e),{body:JSON.stringify({projectId:n,identityId:s}),params:{d:window.location.hostname,licenseKey:t}});return r==null?void 0:r.result},Wg=async(e,t,n,s)=>Promise.all(e.map(r=>MA(r.id||r.src,t,n,s)));function Tr(e,t,n){let s,r,o,i,a;const l=t===void 0?100:t;function u(){const f=Date.now()-i;f<l&&f>=0?s=setTimeout(u,l-f):(s=null,a=e.apply(o,r),o=r=null)}const d=function(){return o=this,r=arguments,i=Date.now(),s||(s=setTimeout(u,l)),a};return d.clear=function(){s&&(clearTimeout(s),s=null)},d.flush=function(){s&&(a=e.apply(o,r),o=r=null,clearTimeout(s),s=null)},d}class Gg{constructor(t,n){this.assetsStore=t,this.layoutPanelId=n,this.itemLayout=void 0,this.isLoadingAssets=!1,this.typeFilter=void 0,this.searchValue="",this.customTypes=void 0,this.customProviders=void 0,this.providerFilter=void 0,this.customAssetProps=void 0,this.customPages=void 0,this.totalItems=void 0,this.optionalType=!1,this.optionalProvider=!0,on(this,{},{autoBind:!0}),this.initTypeFilter(),this.initProviderFilter(),this.initOptionalType(),this.loadAssetsDebounced=Tr(this.loadAssets,this.searchDebounceMs)}get typeFilterOptions(){return this.customTypes??[]}get providers(){return this.assetsStore.allProviders.map(t=>({...t,types:Array.isArray(t.types)?t.types:[t.types]}))}get providerFilterOptions(){return this.providers.filter(t=>(!this.typeFilter||t.types.includes(this.typeFilter))&&(!this.customProviders||this.customProviders.includes(t.id)))}get provider(){return this.providers.find(t=>t.id===this.providerFilter)}get assetPropsFromPages(){if(!this.customPages)return;const t=[];for(const n of this.customPages)t.push(...n.items);return t}get assetProps(){if(!!!this.assetPropsFromPages&&this.isLoadingAssets)return[];const n=this.customAssetProps??this.assetPropsFromPages??this.assetsStore.projectAssetProps??[];return this.typeFilter?n.filter(s=>s.type===this.typeFilter):n}get onProviderOrProjectDelete(){const{provider:t,assetsStore:n}=this;return t?t.onDelete:n.onProjectDelete}get t(){return this.assetsStore.t}get isLoading(){return this.assetsStore.isLoadingAssets||this.isLoadingAssets}get handleDelete(){return this.onProviderOrProjectDelete&&this.handleDeleteCallback}get shouldLoadNextPage(){var n;const t=(n=this.customPages)==null?void 0:n.at(-1);return t?!t.isLastPage:!1}get reloadOnInput(){var t,n;return((n=(t=this.provider)==null?void 0:t.search)==null?void 0:n.reloadOnInput)??!1}get searchDebounceMs(){var t,n;return((n=(t=this.provider)==null?void 0:t.search)==null?void 0:n.debounceMs)??1e3}initOptionalType(){this.setOptionalType(!1)}initOptionalProvider(){var t;this.setOptionalProvider(!!(((t=this.assetsStore.sdkAssetConfig)==null?void 0:t.projectAssetsOption)??!0))}initTypeFilter(){this.setTypeFilter(go.image)}initProviderFilter(){var t;this.setProviderFilter((t=this.assetsStore.sdkAssetConfig)==null?void 0:t.providerId)}setOptionalType(t){this.optionalType=t}setOptionalProvider(t){this.optionalProvider=t}setTypeFilter(t){this.typeFilter=t}setProviderFilter(t){this.providerFilter=t}setSearchValue(t){this.searchValue=t,this.reloadOnInput&&this.loadAssetsDebounced()}setCustomTypes(t){this.customTypes=t}setCustomProviders(t){this.customProviders=t}setCustomAssetProps(t){this.customAssetProps=t}setCustomPages(t){this.customPages=t}setItemLayout(t){this.itemLayout=t}setIsLoadingAssets(t){this.isLoadingAssets=t}selectProjectAssets(){this.setCustomAssetProps(void 0),this.setCustomPages(void 0),this.setItemLayout(void 0)}async loadProviderAssets(t){var a,l,u,d;const{assetsStore:n}=this,{editor:s}=n;if(!s||!this.provider)return;t&&(this.setCustomAssetProps(void 0),this.setCustomPages(void 0));const r=((a=this.customPages)==null?void 0:a.length)??0,o=(u=(l=this.customPages)==null?void 0:l.at(-1))==null?void 0:u.nextPageCustomData,i=await this.provider.onLoad({editor:s,assetTypeFilter:this.typeFilter,pageIndex:r,searchValue:this.searchValue,pageCustomData:o})??[];if(Array.isArray(i)){const f=i.map(n.toAssetProps);this.setCustomAssetProps(f)}else{const f={...i,items:i.items.map(n.toAssetProps)};this.setCustomPages([...this.customPages??[],f])}this.setItemLayout((d=this.provider)==null?void 0:d.itemLayout)}async loadAssets(t=!0){const{assetsStore:n}=this,{toastStore:s}=n.store;try{this.provider?(this.setIsLoadingAssets(!0),await this.loadProviderAssets(t)):this.selectProjectAssets()}catch(r){console.error(r),s.addError("assets-error-get",this.t("errorLoad"))}finally{this.setIsLoadingAssets(!1)}}async reloadAssets(t){const{assetsStore:n}=this,{cachedOnLoadAssetProps:s}=n;await this.loadAssets(t==null?void 0:t.clearExisting),!this.provider&&s&&(n.cachedOnLoadAssetProps=void 0,await n.loadProjectAssets())}async handleDeleteCallback(t){const{assetsStore:n,onProviderOrProjectDelete:s}=this,{appEditorStore:r}=n.store,{editor:o}=r;if(!(!o||!s))try{n.setIsLoadingAssets(!0),await s({assets:[n.toAsset(t)],assetProps:[t],editor:o,loadAssets:i=>this.reloadAssets(i)})}catch(i){console.error(i),n.store.toastStore.addError("assets-error-delete",{header:this.t("errorDelete"),content:i==null?void 0:i.message})}finally{n.setIsLoadingAssets(!1)}}}const w0=e=>bn().assetsStore.assetPanelStores[e];class LA{constructor(t){this.store=t,this.isLoadingAssets=!1,this.mainPanelId=`main-${n0()}`,this.assetPanelStores={},this.cachedOnLoadAssetProps=void 0,this.projectAssetProps=void 0,this.allProviders=[],this.assetPanelStores[this.mainPanelId]=new Gg(this,this.mainPanelId),this.setAllProviders(this.isUsingAssetCloud?[this.userProvider]:[]),on(this,{},{autoBind:!0})}get sdkAssetConfig(){return this.store.appEditorStore.sdkOptions.assets}get isUsingAssetCloud(){var t;return((t=this.sdkAssetConfig)==null?void 0:t.storageType)===lf.cloud}get storageType(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.storageType}get isSelfStorage(){return this.storageType===lf.self}get editor(){return this.store.appEditorStore.editor}get customOnLoad(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.onLoad}get customOnDelete(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.onDelete}get customOnUpload(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.onUpload}get onCloudOrCustomUpload(){const{appEditorStore:t}=this.store,{sdkProps:n}=t,r=n.options.licenseKey,o=t.sdkProjectId,i=t.sdkIdentityId,a=({files:l})=>NA(l,r,o,i);return this.isUsingAssetCloud?a:this.customOnUpload}get onProjectDelete(){const{customOnDelete:t,isSelfStorage:n,isUsingAssetCloud:s}=this;return n?t?async r=>{await t(r),this.deleteFromProjectAssets(r)}:void 0:s?async r=>{var l,u;const{sdkOptions:o}=this.store.appEditorStore,i=(l=o.project)==null?void 0:l.id,a=(u=o.identity)==null?void 0:u.id;await Wg(r.assetProps,o.licenseKey,i,a),this.deleteFromProjectAssets(r)}:this.deleteFromProjectAssets}get t(){return this.store.i18nStore.tScoped("assetManager")}get userProvider(){var a,l;const{appEditorStore:t}=this.store,{sdkOptions:n}=t,s=(a=n.project)==null?void 0:a.id,r=(l=n.identity)==null?void 0:l.id,o=n.licenseKey;return{id:"grapesjs-user-provider",label:()=>this.t("userAssets"),types:go.image,onLoad:()=>TA(o,s,r),onDelete:async u=>{const{assetProps:d,loadAssets:f}=u;await Wg(d,o,s,r),this.deleteFromProjectAssets(u),await f({clearExisting:!1})}}}onEditor(){const t=Tr(()=>!this.loadProjectAssets()),n=this.store.appEditorStore.editor;this.addSdkProviders();const s=n.Assets.events.all;n.on(s,t),this.loadProjectAssets()}addSdkProviders(){var s;const t=((s=this.sdkAssetConfig)==null?void 0:s.providers)??[],n=Ye(t)?t({providers:Er(this.allProviders)}):[...this.allProviders,...t];this.setAllProviders(n)}addProvider(t,n=this.allProviders.length){const s=[...this.allProviders];let r=this.allProviders.findIndex(i=>i.id===t.id);const o=r!==-1;s.splice(n,0,t),o&&(r>=n&&(r+=1),s.splice(r,1)),this.setAllProviders(s)}hasType(t){return!!this.allProviders.find(n=>ot(n.types)?n.types===t:n.types.includes(t))}createAssetManager(t){const n=new Gg(this,t);this.assetPanelStores[t]=n}removeAssetManager(t){delete this.assetPanelStores[t]}async loadProjectAssets(){const{editor:t,isSelfStorage:n,cachedOnLoadAssetProps:s,customOnLoad:r}=this,{toastStore:o}=this.store;let i;if(t){try{if(this.setIsLoadingAssets(!0),n&&r)if(s)i=s;else{const a=await r({editor:t});this.cachedOnLoadAssetProps=a.map(this.toAssetProps),i=this.cachedOnLoadAssetProps}else i=t.Assets.getAll().map(this.toAssetProps)}catch(a){console.error(a),o.addError("assets-error-load",{header:this.t("errorLoad"),content:a==null?void 0:a.message})}finally{this.setIsLoadingAssets(!1)}i&&this.setProjectAssetProps(i)}}deleteFromProjectAssets({assets:t,editor:n,assetProps:s}){const{cachedOnLoadAssetProps:r,customOnLoad:o}=this;if(o){if(r){const i=s.map(a=>a.id);this.cachedOnLoadAssetProps=r.filter(({id:a})=>!i.includes(a)),this.setProjectAssetProps(this.cachedOnLoadAssetProps)}}else t.forEach(i=>n.Assets.remove(i)),Fg(n)}addToProjectAssets(t){const n=this.store.appEditorStore.editor,{cachedOnLoadAssetProps:s,customOnLoad:r}=this;r?s&&(this.cachedOnLoadAssetProps=[...t,...s],this.setProjectAssetProps(this.cachedOnLoadAssetProps)):(n.Assets.add(t),Fg(n))}async handleUpload(t){var o,i;const{editor:n,onCloudOrCustomUpload:s}=this,{toastStore:r}=this.store;if(!(!n||!s))try{this.setIsLoadingAssets(!0);const a=((o=t.dataTransfer)==null?void 0:o.files)||((i=t.target)==null?void 0:i.files)||[],l=Array.from(a),u=await s({files:l,editor:n});if(u!=null&&u.length){const d=u.map(this.toAssetProps);return this.addToProjectAssets(d),d}else console.warn("No assets returned from the upload handler. Ensure to return an array of assets.")}catch(a){console.error(a),r.addError("assets-error-upload",{header:this.t("errorUpload"),content:a==null?void 0:a.message})}finally{this.setIsLoadingAssets(!1)}}uploadFile(t){var n;return(n=this.editor)==null?void 0:n.Assets.FileUploader().uploadFile(t)}isAsset(t){return!!t.getSrc}toAssetProps(t){if(this.isAsset(t)){const s=t;return{...s.attributes,id:s.attributes.id||s.getSrc(),src:s.getSrc(),name:s.attributes.name??s.getFilename(),type:s.attributes.type??s.getType()??go.image,asset:s}}return{...t,type:t.type||go.image,id:t.id||t.src}}toAsset(t){const{editor:n}=this.store.appEditorStore;if(n)return t.asset??new n.AssetManager.Asset(t)}setProjectAssetProps(t){this.projectAssetProps=t}setIsLoadingAssets(t){this.isLoadingAssets=t}setAllProviders(t){this.allProviders=t}}const Ka=()=>bn().assetsStore;class RA{constructor(t){var s;this.store=t,this.fonts={},on(this,{},{autoBind:!0});const n=(s=this.sdkFontOptions)==null?void 0:s.default;this.sdkDefaultFonts=Ye(n)?n({baseDefault:kg}):n}get staticFonts(){return this.sdkDefaultFonts?this.sdkDefaultFonts.map(t=>ot(t)?{id:t,label:t}:Vg(t)?t:null).filter(t=>!!t):kg}get defaultWebFonts(){return this.sdkDefaultFonts?this.sdkDefaultFonts.filter(n=>!ot(n)&&!Vg(n)).map(n=>Qi(n.family,n)):[]}get sortedFonts(){return lA(Object.values(this.fonts))}get fontFamilyOptions(){const t=n=>({id:n.family,label:n.familyLabel});return cA([...this.staticFonts,...Object.values(this.fonts).map(t)])}get sdkFontOptions(){return this.store.appEditorStore.sdkOptions.fonts}get enableFontManager(){var t;return(t=this.sdkFontOptions)==null?void 0:t.enableFontManager}get sdkShowProjectFonts(){const{showProjectFonts:t,enableFontManager:n}=this.sdkFontOptions||{};return Lt(t)?t:n}get sdkAddFonts(){const{addFonts:t,enableFontManager:n}=this.sdkFontOptions||{};return Lt(t)?t:n}loadFonts(){this.loadProjectFonts(),this.loadDefaultFonts()}loadProjectFonts(){const{editor:t}=this.store.appEditorStore;if(!t)return;const{globalPageSettings:n}=yi(t)??{},{fonts:s}=n??{};if(s)for(const[r,o]of Object.entries(s)){const i=Qi(r,o);this.addFont(i,{skipUpdate:!0})}}loadDefaultFonts(){const{editor:t}=this.store.appEditorStore;if(t)for(const n of this.defaultWebFonts)this.addFont(n,{overwrite:!1,skipUpdate:!0})}getFont(t){return t=Po(t),this.fonts[t]}addFont(t,{skipUpdate:n,overwrite:s=!0}={}){const r=Qi(t.family,t),{editor:o}=this.store.appEditorStore;if(!o)return;const{family:i}=r;!s&&this.fonts[i]||(this.fonts[i]=r,n||this.updateProjectFonts(o))}removeFont(t){t=Po(t);const{editor:n}=this.store.appEditorStore;n&&(delete this.fonts[t],this.updateProjectFonts(n))}updateProjectFonts(t){const s={...yi(t).globalPageSettings,fonts:Er(this.fonts)};this.store.appEditorStore.setProjectDataCustom({globalPageSettings:s}),g0(t),t.trigger(Tn.pageSettingsUpdate,{data:s})}}const Ya=()=>bn().fontsStore;class $A{constructor(t){this.store=t,on(this,{},{autoBind:!0})}t(t,n={}){var r;const{editor:s}=this.store.appEditorStore;return((r=s==null?void 0:s.I18n)==null?void 0:r.t(t,n))||""}tScoped(t){return(n,s)=>this.t(`${t}.${n}`,s)}}const Re=()=>bn().i18nStore,Bn=(e,t)=>h.Children.map(e,n=>n&&n.type===t?n:null),qg="gs-custom-layout",kA=h.forwardRef(function({className:t,component:n,noWrapper:s,id:r,render:o,componentProps:i,...a},l){const{editor:u}=ye(),d=h.useRef(null),f=n,p=f&&u?c.jsx(f,{...i,editor:u}):null,g=N(qg,r&&`${qg}__${r}`,t),m=s&&!o;return h.useImperativeHandle(l,()=>d.current,[]),h.useEffect(()=>{const b=d.current;if(!o||!b)return;const v=w=>b.appendChild(w),x=w=>b.removeChild(w),y=o({editor:u,addEl:v,removeEl:x});if(ot(y))b.innerHTML=y;else{if(y instanceof HTMLElement)return v(y),()=>{x(y)};if(Ye(y))return()=>{y()}}},[o,u,d.current]),m?p:c.jsx("div",{className:g,ref:d,...a,children:p})}),ff=fe(kA);class VA{constructor(t){this.customConfig=void 0,this.layouts=[],this.layoutsById=new Map,this.customLayoutComponents=new Map,this.store=t,on(this,{},{autoBind:!0,deep:!1})}get editor(){return this.store.appEditorStore.editor}setCustomConfig(t){this.customConfig=t}add(t,n){var s;this.get(t)||(this.layouts=[...this.layouts,{id:t,...n}],(s=this.editor)==null||s.trigger(`${Tn.layoutToggleId}${t}`,{isOpen:!0}))}remove(t,n){var r;const s=n==null?void 0:n.layout;s&&this.layouts.forEach(o=>{o.id===t&&Object.assign(o,s)}),this.layouts=n!=null&&n.force?this.layouts.filter(o=>o.id!==t):this.layouts.map(o=>o.id===t?{...o,toRemove:!0}:o),(r=this.editor)==null||r.trigger(`${Tn.layoutToggleId}${t}`,{isOpen:!1})}get(t){return this.layouts.find(n=>n.id===t)}clear(){this.layouts=[]}addCustomLayoutComponent(t,n){this.customLayoutComponents.set(t,n)}getCustomLayoutComponent(t){return this.customLayoutComponents.get(t)}removeCustomLayoutComponent(t){this.customLayoutComponents.delete(t)}get layoutChildren(){var s;const{children:t}=this.store.appEditorStore.sdkProps,n=((s=Bn(t,ff))==null?void 0:s.filter(Boolean))||[];return new Map(n.map(({props:r})=>[r.id,r]))}}const S0=()=>bn().layoutStore,IA=()=>wh().layoutStore;class DA{constructor(t){this.isActive=!1,this.content="",this.store=t,on(this,{},{autoBind:!0})}show(t){this.isActive=!0,this.content=t}hide(){this.isActive=!1,setTimeout(this.clear,101)}clear(){this.content=""}}class HA{constructor(t){this.store=t,this._projectSourceFilter=ma.Existing,this._loadedProjects=void 0,this._loadedTemplates=void 0,this._projectTypeFilter=t.appEditorStore.projectType,on(this,{},{autoBind:!0})}get projectTypeFilter(){return this._projectTypeFilter}get projectSourceFilter(){return this._projectSourceFilter}get templates(){return this._loadedTemplates}get projects(){return this._loadedProjects}get filteredTemplates(){return this.projectSourceFilter===ma.Existing?this.projects:this.templates}async loadProjects(){const t=await r0(this.projectTypeFilter);this.setProjects(t)}async loadTemplates(){var r;const t=(r=this.store.appEditorStore.sdkOptions.templates)==null?void 0:r.onLoad,n=async()=>await BO(this.projectTypeFilter);let s;if(t){const o=this.store.appEditorStore.editor;s=await t({editor:o,fetchCommunityTemplates:n})}else s=await n();this.setTemplates(s)}async loadAllTemplates(){await Promise.all([this.loadProjects(),this.loadTemplates()])}async removeProject(t){DO(Yc.Projects,t)}async setProjectTypeFilter(t){this._projectTypeFilter=t,this.setProjects(void 0),this.setTemplates(void 0)}setProjectSourceFilter(t){this._projectSourceFilter=t}setTemplates(t){this._loadedTemplates=t}setProjects(t){this._loadedProjects=t}}const C0=()=>bn().templatesStore;class FA{constructor(t){this.toasts=[],this.store=t,on(this,{},{autoBind:!0})}add(t,n){this.toasts.find(s=>s.id===t)||this.toasts.push({id:t,...n})}addError(t,n){this.add(t,{...ot(n)?{header:n}:n,variant:nn.Error})}addWarning(t,n){this.add(t,{...ot(n)?{header:n}:n,variant:nn.Warning})}addSuccess(t,n){this.add(t,{...ot(n)?{header:n}:n,variant:nn.Success})}addInfo(t,n){this.add(t,{...ot(n)?{header:n}:n,variant:nn.Info})}remove(t){this.toasts=this.toasts.filter(n=>n.id!==t)}}class BA{constructor(t){this.isOpen=!1,this.store=t,on(this,{},{autoBind:!0})}setOpen(t){this.isOpen=t,this.triggerEvent()}toggleOpen(){this.isOpen=!this.isOpen,this.triggerEvent()}triggerEvent(){var t;(t=this.store.appEditorStore.editor)==null||t.trigger(Tn.toggleBlocksPanel,{isOpen:this.isOpen})}}const zA=()=>bn().blockManagerStore,j0=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",UA=j0+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",WA="["+j0+"]["+UA+"]*",GA=new RegExp("^"+WA+"$");function E0(e,t){const n=[];let s=t.exec(e);for(;s;){const r=[];r.startIndex=t.lastIndex-s[0].length;const o=s.length;for(let i=0;i<o;i++)r.push(s[i]);n.push(r),s=t.exec(e)}return n}const eu=function(e){const t=GA.exec(e);return!(t===null||typeof t>"u")};function qA(e){return typeof e<"u"}const KA={allowBooleanAttributes:!1,unpairedTags:[]};function YA(e,t){t=Object.assign({},KA,t);const n=[];let s=!1,r=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let o=0;o<e.length;o++)if(e[o]==="<"&&e[o+1]==="?"){if(o+=2,o=Yg(e,o),o.err)return o}else if(e[o]==="<"){let i=o;if(o++,e[o]==="!"){o=Zg(e,o);continue}else{let a=!1;e[o]==="/"&&(a=!0,o++);let l="";for(;o<e.length&&e[o]!==">"&&e[o]!==" "&&e[o]!==" "&&e[o]!==`
102
- `&&e[o]!=="\r";o++)l+=e[o];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),o--),!sN(l)){let f;return l.trim().length===0?f="Invalid space after '<'.":f="Tag '"+l+"' is an invalid name.",Pt("InvalidTag",f,Jt(e,o))}const u=JA(e,o);if(u===!1)return Pt("InvalidAttr","Attributes for '"+l+"' have open quote.",Jt(e,o));let d=u.value;if(o=u.index,d[d.length-1]==="/"){const f=o-d.length;d=d.substring(0,d.length-1);const p=Xg(d,t);if(p===!0)s=!0;else return Pt(p.err.code,p.err.msg,Jt(e,f+p.err.line))}else if(a)if(u.tagClosed){if(d.trim().length>0)return Pt("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",Jt(e,i));if(n.length===0)return Pt("InvalidTag","Closing tag '"+l+"' has not been opened.",Jt(e,i));{const f=n.pop();if(l!==f.tagName){let p=Jt(e,f.tagStartPos);return Pt("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+l+"'.",Jt(e,i))}n.length==0&&(r=!0)}}else return Pt("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",Jt(e,o));else{const f=Xg(d,t);if(f!==!0)return Pt(f.err.code,f.err.msg,Jt(e,o-d.length+f.err.line));if(r===!0)return Pt("InvalidXml","Multiple possible root nodes found.",Jt(e,o));t.unpairedTags.indexOf(l)!==-1||n.push({tagName:l,tagStartPos:i}),s=!0}for(o++;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="!"){o++,o=Zg(e,o);continue}else if(e[o+1]==="?"){if(o=Yg(e,++o),o.err)return o}else break;else if(e[o]==="&"){const f=tN(e,o);if(f==-1)return Pt("InvalidChar","char '&' is not expected.",Jt(e,o));o=f}else if(r===!0&&!Kg(e[o]))return Pt("InvalidXml","Extra text at the end",Jt(e,o));e[o]==="<"&&o--}}else{if(Kg(e[o]))continue;return Pt("InvalidChar","char '"+e[o]+"' is not expected.",Jt(e,o))}if(s){if(n.length==1)return Pt("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Jt(e,n[0].tagStartPos));if(n.length>0)return Pt("InvalidXml","Invalid '"+JSON.stringify(n.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Pt("InvalidXml","Start tag expected.",1);return!0}function Kg(e){return e===" "||e===" "||e===`
103
- `||e==="\r"}function Yg(e,t){const n=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const s=e.substr(n,t-n);if(t>5&&s==="xml")return Pt("InvalidXml","XML declaration allowed only at the start of the document.",Jt(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function Zg(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let n=1;for(t+=8;t<e.length;t++)if(e[t]==="<")n++;else if(e[t]===">"&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}const ZA='"',XA="'";function JA(e,t){let n="",s="",r=!1;for(;t<e.length;t++){if(e[t]===ZA||e[t]===XA)s===""?s=e[t]:s!==e[t]||(s="");else if(e[t]===">"&&s===""){r=!0;break}n+=e[t]}return s!==""?!1:{value:n,index:t,tagClosed:r}}const QA=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Xg(e,t){const n=E0(e,QA),s={};for(let r=0;r<n.length;r++){if(n[r][1].length===0)return Pt("InvalidAttr","Attribute '"+n[r][2]+"' has no space in starting.",Ii(n[r]));if(n[r][3]!==void 0&&n[r][4]===void 0)return Pt("InvalidAttr","Attribute '"+n[r][2]+"' is without value.",Ii(n[r]));if(n[r][3]===void 0&&!t.allowBooleanAttributes)return Pt("InvalidAttr","boolean attribute '"+n[r][2]+"' is not allowed.",Ii(n[r]));const o=n[r][2];if(!nN(o))return Pt("InvalidAttr","Attribute '"+o+"' is an invalid name.",Ii(n[r]));if(!s.hasOwnProperty(o))s[o]=1;else return Pt("InvalidAttr","Attribute '"+o+"' is repeated.",Ii(n[r]))}return!0}function eN(e,t){let n=/\d/;for(e[t]==="x"&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(n))break}return-1}function tN(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,eN(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===";")break;return-1}return t}function Pt(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function nN(e){return eu(e)}function sN(e){return eu(e)}function Jt(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ii(e){return e.startIndex+e[1].length}const rN={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},oN=function(e){return Object.assign({},rN,e)};let bc;typeof Symbol!="function"?bc="@@xmlMetadata":bc=Symbol("XML Node Metadata");class io{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t,n){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),n!==void 0&&(this.child[this.child.length-1][bc]={startIndex:n})}static getMetaDataSymbol(){return bc}}class iN{constructor(t){this.suppressValidationErr=!t}readDocType(t,n){const s={};if(t[n+3]==="O"&&t[n+4]==="C"&&t[n+5]==="T"&&t[n+6]==="Y"&&t[n+7]==="P"&&t[n+8]==="E"){n=n+9;let r=1,o=!1,i=!1,a="";for(;n<t.length;n++)if(t[n]==="<"&&!i){if(o&&no(t,"!ENTITY",n)){n+=7;let l,u;[l,u,n]=this.readEntityExp(t,n+1,this.suppressValidationErr),u.indexOf("&")===-1&&(s[l]={regx:RegExp(`&${l};`,"g"),val:u})}else if(o&&no(t,"!ELEMENT",n)){n+=8;const{index:l}=this.readElementExp(t,n+1);n=l}else if(o&&no(t,"!ATTLIST",n))n+=8;else if(o&&no(t,"!NOTATION",n)){n+=9;const{index:l}=this.readNotationExp(t,n+1,this.suppressValidationErr);n=l}else if(no(t,"!--",n))i=!0;else throw new Error("Invalid DOCTYPE");r++,a=""}else if(t[n]===">"){if(i?t[n-1]==="-"&&t[n-2]==="-"&&(i=!1,r--):r--,r===0)break}else t[n]==="["?o=!0:a+=t[n];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:n}}readEntityExp(t,n){n=ln(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n])&&t[n]!=='"'&&t[n]!=="'";)s+=t[n],n++;if(Di(s),n=ln(t,n),!this.suppressValidationErr){if(t.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[n]==="%")throw new Error("Parameter entities are not supported")}let r="";return[n,r]=this.readIdentifierVal(t,n,"entity"),n--,[s,r,n]}readNotationExp(t,n){n=ln(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;!this.suppressValidationErr&&Di(s),n=ln(t,n);const r=t.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&r!=="SYSTEM"&&r!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);n+=r.length,n=ln(t,n);let o=null,i=null;if(r==="PUBLIC")[n,o]=this.readIdentifierVal(t,n,"publicIdentifier"),n=ln(t,n),(t[n]==='"'||t[n]==="'")&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"));else if(r==="SYSTEM"&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:o,systemIdentifier:i,index:--n}}readIdentifierVal(t,n,s){let r="";const o=t[n];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);for(n++;n<t.length&&t[n]!==o;)r+=t[n],n++;if(t[n]!==o)throw new Error(`Unterminated ${s} value`);return n++,[n,r]}readElementExp(t,n){n=ln(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;if(!this.suppressValidationErr&&!eu(s))throw new Error(`Invalid element name: "${s}"`);n=ln(t,n);let r="";if(t[n]==="E"&&no(t,"MPTY",n))n+=4;else if(t[n]==="A"&&no(t,"NY",n))n+=2;else if(t[n]==="("){for(n++;n<t.length&&t[n]!==")";)r+=t[n],n++;if(t[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[n]}"`);return{elementName:s,contentModel:r.trim(),index:n}}readAttlistExp(t,n){n=ln(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;Di(s),n=ln(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;if(!Di(r))throw new Error(`Invalid attribute name: "${r}"`);n=ln(t,n);let o="";if(t.substring(n,n+8).toUpperCase()==="NOTATION"){if(o="NOTATION",n+=8,n=ln(t,n),t[n]!=="(")throw new Error(`Expected '(', found "${t[n]}"`);n++;let a=[];for(;n<t.length&&t[n]!==")";){let l="";for(;n<t.length&&t[n]!=="|"&&t[n]!==")";)l+=t[n],n++;if(l=l.trim(),!Di(l))throw new Error(`Invalid notation name: "${l}"`);a.push(l),t[n]==="|"&&(n++,n=ln(t,n))}if(t[n]!==")")throw new Error("Unterminated list of notations");n++,o+=" ("+a.join("|")+")"}else{for(;n<t.length&&!/\s/.test(t[n]);)o+=t[n],n++;const a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(o.toUpperCase()))throw new Error(`Invalid attribute type: "${o}"`)}n=ln(t,n);let i="";return t.substring(n,n+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",n+=8):t.substring(n,n+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",n+=7):[n,i]=this.readIdentifierVal(t,n,"ATTLIST"),{elementName:s,attributeName:r,attributeType:o,defaultValue:i,index:n}}}const ln=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function no(e,t,n){for(let s=0;s<t.length;s++)if(t[s]!==e[n+s+1])return!1;return!0}function Di(e){if(eu(e))return e;throw new Error(`Invalid entity name ${e}`)}const aN=/^[-+]?0x[a-fA-F0-9]+$/,lN=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,cN={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function uN(e,t={}){if(t=Object.assign({},cN,t),!e||typeof e!="string")return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e==="0")return 0;if(t.hex&&aN.test(n))return hN(n,16);if(n.search(/.+[eE].+/)!==-1)return fN(e,n,t);{const s=lN.exec(n);if(s){const r=s[1]||"",o=s[2];let i=pN(s[3]);const a=r?e[o.length+1]===".":e[o.length]===".";if(!t.leadingZeros&&(o.length>1||o.length===1&&!a))return e;{const l=Number(n),u=String(l);if(l===0)return l;if(u.search(/[eE]/)!==-1)return t.eNotation?l:e;if(n.indexOf(".")!==-1)return u==="0"||u===i||u===`${r}${i}`?l:e;let d=o?i:n;return o?d===u||r+d===u?l:e:d===u||d===r+u?l:e}}else return e}}const dN=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function fN(e,t,n){if(!n.eNotation)return e;const s=t.match(dN);if(s){let r=s[1]||"";const o=s[3].indexOf("e")===-1?"E":"e",i=s[2],a=r?e[i.length+1]===o:e[i.length]===o;return i.length>1&&a?e:i.length===1&&(s[3].startsWith(`.${o}`)||s[3][0]===o)?Number(t):n.leadingZeros&&!a?(t=(s[1]||"")+s[3],Number(t)):e}else return e}function pN(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function hN(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function P0(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}class gN{constructor(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=mN,this.parseXml=wN,this.parseTextData=bN,this.resolveNameSpace=vN,this.buildAttributesMap=xN,this.isItStopNode=EN,this.replaceEntitiesValue=CN,this.readStopNodeData=_N,this.saveTextToParentTag=jN,this.addChild=SN,this.ignoreAttributesFn=P0(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let n=0;n<this.options.stopNodes.length;n++){const s=this.options.stopNodes[n];typeof s=="string"&&(s.startsWith("*.")?this.stopNodesWildcard.add(s.substring(2)):this.stopNodesExact.add(s))}}}}function mN(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:e[s]}}}function bN(e,t,n,s,r,o,i){if(e!==void 0&&(this.options.trimValues&&!s&&(e=e.trim()),e.length>0)){i||(e=this.replaceEntitiesValue(e));const a=this.options.tagValueProcessor(t,e,n,r,o);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?hf(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?hf(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function vN(e){if(this.options.removeNSPrefix){const t=e.split(":"),n=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=n+t[1])}return e}const yN=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function xN(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const s=E0(e,yN),r=s.length,o={};for(let i=0;i<r;i++){const a=this.resolveNameSpace(s[i][1]);if(this.ignoreAttributesFn(a,t))continue;let l=s[i][4],u=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),u==="__proto__"&&(u="#__proto__"),l!==void 0){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l);const d=this.options.attributeValueProcessor(a,l,t);d==null?o[u]=l:typeof d!=typeof l||d!==l?o[u]=d:o[u]=hf(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[u]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const i={};return i[this.options.attributesGroupName]=o,i}return o}}const wN=function(e){e=e.replace(/\r\n?/g,`
104
- `);const t=new io("!xml");let n=t,s="",r="";const o=new iN(this.options.processEntities);for(let i=0;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const l=lo(e,">",i,"Closing Tag is not closed.");let u=e.substring(i+2,l).trim();if(this.options.removeNSPrefix){const p=u.indexOf(":");p!==-1&&(u=u.substr(p+1))}this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&(s=this.saveTextToParentTag(s,n,r));const d=r.substring(r.lastIndexOf(".")+1);if(u&&this.options.unpairedTags.indexOf(u)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${u}>`);let f=0;d&&this.options.unpairedTags.indexOf(d)!==-1?(f=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):f=r.lastIndexOf("."),r=r.substring(0,f),n=this.tagsNodeStack.pop(),s="",i=l}else if(e[i+1]==="?"){let l=pf(e,i,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,n,r),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const u=new io(l.tagName);u.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(u[":@"]=this.buildAttributesMap(l.tagExp,r,l.tagName)),this.addChild(n,u,r,i)}i=l.closeIndex+1}else if(e.substr(i+1,3)==="!--"){const l=lo(e,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const u=e.substring(i+4,l-2);s=this.saveTextToParentTag(s,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:u}])}i=l}else if(e.substr(i+1,2)==="!D"){const l=o.readDocType(e,i);this.docTypeEntities=l.entities,i=l.i}else if(e.substr(i+1,2)==="!["){const l=lo(e,"]]>",i,"CDATA is not closed.")-2,u=e.substring(i+9,l);s=this.saveTextToParentTag(s,n,r);let d=this.parseTextData(u,n.tagname,r,!0,!1,!0,!0);d==null&&(d=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:u}]):n.add(this.options.textNodeName,d),i=l+2}else{let l=pf(e,i,this.options.removeNSPrefix),u=l.tagName;const d=l.rawTagName;let f=l.tagExp,p=l.attrExpPresent,g=l.closeIndex;this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&s&&n.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,n,r,!1));const m=n;m&&this.options.unpairedTags.indexOf(m.tagname)!==-1&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),u!==t.tagname&&(r+=r?"."+u:u);const b=i;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,r,u)){let v="";if(f.length>0&&f.lastIndexOf("/")===f.length-1)u[u.length-1]==="/"?(u=u.substr(0,u.length-1),r=r.substr(0,r.length-1),f=u):f=f.substr(0,f.length-1),i=l.closeIndex;else if(this.options.unpairedTags.indexOf(u)!==-1)i=l.closeIndex;else{const y=this.readStopNodeData(e,d,g+1);if(!y)throw new Error(`Unexpected end of ${d}`);i=y.i,v=y.tagContent}const x=new io(u);u!==f&&p&&(x[":@"]=this.buildAttributesMap(f,r,u)),v&&(v=this.parseTextData(v,u,r,!0,p,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),x.add(this.options.textNodeName,v),this.addChild(n,x,r,b)}else{if(f.length>0&&f.lastIndexOf("/")===f.length-1){u[u.length-1]==="/"?(u=u.substr(0,u.length-1),r=r.substr(0,r.length-1),f=u):f=f.substr(0,f.length-1),this.options.transformTagName&&(u=this.options.transformTagName(u));const v=new io(u);u!==f&&p&&(v[":@"]=this.buildAttributesMap(f,r,u)),this.addChild(n,v,r,b),r=r.substr(0,r.lastIndexOf("."))}else{const v=new io(u);this.tagsNodeStack.push(n),u!==f&&p&&(v[":@"]=this.buildAttributesMap(f,r,u)),this.addChild(n,v,r,b),n=v}s="",i=g}}else s+=e[i];return t.child};function SN(e,t,n,s){this.options.captureMetaData||(s=void 0);const r=this.options.updateTag(t.tagname,n,t[":@"]);r===!1||(typeof r=="string"&&(t.tagname=r),e.addChild(t,s))}const CN=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function jN(e,t,n,s){return e&&(s===void 0&&(s=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function EN(e,t,n,s){return!!(t&&t.has(s)||e&&e.has(n))}function PN(e,t,n=">"){let s,r="";for(let o=t;o<e.length;o++){let i=e[o];if(s)i===s&&(s="");else if(i==='"'||i==="'")s=i;else if(i===n[0])if(n[1]){if(e[o+1]===n[1])return{data:r,index:o}}else return{data:r,index:o};else i===" "&&(i=" ");r+=i}}function lo(e,t,n,s){const r=e.indexOf(t,n);if(r===-1)throw new Error(s);return r+t.length-1}function pf(e,t,n,s=">"){const r=PN(e,t+1,s);if(!r)return;let o=r.data;const i=r.index,a=o.search(/\s/);let l=o,u=!0;a!==-1&&(l=o.substring(0,a),o=o.substring(a+1).trimStart());const d=l;if(n){const f=l.indexOf(":");f!==-1&&(l=l.substr(f+1),u=l!==r.data.substr(f+1))}return{tagName:l,tagExp:o,closeIndex:i,attrExpPresent:u,rawTagName:d}}function _N(e,t,n){const s=n;let r=1;for(;n<e.length;n++)if(e[n]==="<")if(e[n+1]==="/"){const o=lo(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(r--,r===0))return{tagContent:e.substring(s,n),i:o};n=o}else if(e[n+1]==="?")n=lo(e,"?>",n+1,"StopNode is not closed.");else if(e.substr(n+1,3)==="!--")n=lo(e,"-->",n+3,"StopNode is not closed.");else if(e.substr(n+1,2)==="![")n=lo(e,"]]>",n,"StopNode is not closed.")-2;else{const o=pf(e,n,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&r++,n=o.closeIndex)}}function hf(e,t,n){if(t&&typeof e=="string"){const s=e.trim();return s==="true"?!0:s==="false"?!1:uN(e,n)}else return qA(e)?e:""}const Qu=io.getMetaDataSymbol();function TN(e,t){return _0(e,t)}function _0(e,t,n){let s;const r={};for(let o=0;o<e.length;o++){const i=e[o],a=ON(i);let l="";if(n===void 0?l=a:l=n+"."+a,a===t.textNodeName)s===void 0?s=i[a]:s+=""+i[a];else{if(a===void 0)continue;if(i[a]){let u=_0(i[a],t,l);const d=NN(u,t);i[Qu]!==void 0&&(u[Qu]=i[Qu]),i[":@"]?AN(u,i[":@"],l,t):Object.keys(u).length===1&&u[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?u=u[t.textNodeName]:Object.keys(u).length===0&&(t.alwaysCreateTextNode?u[t.textNodeName]="":u=""),r[a]!==void 0&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(u)):t.isArray(a,l,d)?r[a]=[u]:r[a]=u}}}return typeof s=="string"?s.length>0&&(r[t.textNodeName]=s):s!==void 0&&(r[t.textNodeName]=s),r}function ON(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];if(s!==":@")return s}}function AN(e,t,n,s){if(t){const r=Object.keys(t),o=r.length;for(let i=0;i<o;i++){const a=r[i];s.isArray(a,n+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function NN(e,t){const{textNodeName:n}=t,s=Object.keys(e).length;return!!(s===0||s===1&&(e[n]||typeof e[n]=="boolean"||e[n]===0))}class MN{constructor(t){this.externalEntities={},this.options=oN(t)}parse(t,n){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const o=YA(t,n);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}const s=new gN(this.options);s.addExternalEntities(this.externalEntities);const r=s.parseXml(t);return this.options.preserveOrder||r===void 0?r:TN(r,this.options)}addEntity(t,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}static getMetaDataSymbol(){return io.getMetaDataSymbol()}}const LN=`
105
- `;function RN(e,t){let n="";return t.format&&t.indentBy.length>0&&(n=LN),T0(e,t,"",n)}function T0(e,t,n,s){let r="",o=!1;for(let i=0;i<e.length;i++){const a=e[i],l=$N(a);if(l===void 0)continue;let u="";if(n.length===0?u=l:u=`${n}.${l}`,l===t.textNodeName){let m=a[l];kN(u,t)||(m=t.tagValueProcessor(l,m),m=O0(m,t)),o&&(r+=s),r+=m,o=!1;continue}else if(l===t.cdataPropName){o&&(r+=s),r+=`<![CDATA[${a[l][0][t.textNodeName]}]]>`,o=!1;continue}else if(l===t.commentPropName){r+=s+`<!--${a[l][0][t.textNodeName]}-->`,o=!0;continue}else if(l[0]==="?"){const m=Jg(a[":@"],t),b=l==="?xml"?"":s;let v=a[l][0][t.textNodeName];v=v.length!==0?" "+v:"",r+=b+`<${l}${v}${m}?>`,o=!0;continue}let d=s;d!==""&&(d+=t.indentBy);const f=Jg(a[":@"],t),p=s+`<${l}${f}`,g=T0(a[l],t,u,d);t.unpairedTags.indexOf(l)!==-1?t.suppressUnpairedNode?r+=p+">":r+=p+"/>":(!g||g.length===0)&&t.suppressEmptyNode?r+=p+"/>":g&&g.endsWith(">")?r+=p+`>${g}${s}</${l}>`:(r+=p+">",g&&s!==""&&(g.includes("/>")||g.includes("</"))?r+=s+t.indentBy+g+s:r+=g,r+=`</${l}>`),o=!0}return r}function $N(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];if(e.hasOwnProperty(s)&&s!==":@")return s}}function Jg(e,t){let n="";if(e&&!t.ignoreAttributes)for(let s in e){if(!e.hasOwnProperty(s))continue;let r=t.attributeValueProcessor(s,e[s]);r=O0(r,t),r===!0&&t.suppressBooleanAttributes?n+=` ${s.substr(t.attributeNamePrefix.length)}`:n+=` ${s.substr(t.attributeNamePrefix.length)}="${r}"`}return n}function kN(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let n=e.substr(e.lastIndexOf(".")+1);for(let s in t.stopNodes)if(t.stopNodes[s]===e||t.stopNodes[s]==="*."+n)return!0;return!1}function O0(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const s=t.entities[n];e=e.replace(s.regex,s.val)}return e}const VN={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Gr(e){this.options=Object.assign({},VN,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=P0(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=HN),this.processTextOrObjNode=IN,this.options.format?(this.indentate=DN,this.tagEndChar=`>
45
+ </style>`:""},f3=e=>e.sort((t,n)=>t.familyLabel<n.familyLabel?-1:t.familyLabel>n.familyLabel?1:0),h3=e=>e.sort((t,n)=>t.id<n.id?-1:t.id>n.id?1:0),rg=e=>!!e.id,No=e=>t=>(t.tagName||"").toLowerCase()===e,fs=(...e)=>e.map(t=>`[data-gjs-type="${t}"]`).join(","),g3=(e,...t)=>{var n;return t.indexOf((n=e==null?void 0:e.tagName)==null?void 0:n.toUpperCase())>=0},Ko=(e,...t)=>{var n;return!!e&&t.indexOf((n=e.tagName)==null?void 0:n.toLowerCase())>=0},Or=(e,t)=>{var n;return(n=e==null?void 0:e.classList)==null?void 0:n.contains(t)},ka=(e,t)=>{var n;return!!((n=e==null?void 0:e.hasAttribute)!=null&&n.call(e,t))},Ra=(e,t)=>{const n=e.Blocks.get(t);return n?n.collection.indexOf(n):-1},m3=e=>e.replace(/[^a-z0-9.]/gi,"_").toLowerCase(),zd=(e,t,n="html")=>{const{Pages:s}=e,r=Zt({page:t,key:"slug"})??"";return`${s.getMain()===t?"index":mc(r||t.getName())}.${n}`},b3=(e,t)=>{const{toolbar:n}=e;n.some(r=>r.id===t.id)||(n.unshift(t),e.set("toolbar",[...n]))},tc="custom-html-body",nc="data-custom-html-body",og="data-global-custom-html-head",ig="data-global-custom-html-body",ag="global",v3=function(e,t){const n=r=>{if(!r)return e.em.logError("loadGlobalHead: document not found");const o=Ud(t.appStore);let i=r.querySelector(`[${og}]`);i||(i=r.createElement("div"),i.setAttribute(og,"true"),r.head.insertBefore(i,r.head.firstChild));const a=Av(o.fonts),c=o.customCodeHead,u=[a,c].filter(d=>!!d).join(`
46
+ `);i.innerHTML=u,ih(i)},s=r=>{if(!r)return e.em.logError("loadGlobalBody: document not found");const o=Ud(t.appStore);let i=r.querySelector(`[${ig}]`);if(!i){i=r.createElement("div"),i.setAttribute(ig,"true");const a=r.querySelector('[data-gjs-type="wrapper"]');a==null||a.appendChild(i)}i.innerHTML=o.customCodeBody||"",ih(i)};e.on(e.Canvas.events.frameLoad,r=>{var o;return n((o=r.el.contentWindow)==null?void 0:o.document)}),e.on(e.Canvas.events.frameLoadBody,r=>{var o;return s((o=r.el.contentWindow)==null?void 0:o.document)}),e.on(xn.pageSettingsUpdate,r=>{var i,a;if(r.page)return;const o=(a=(i=e.Canvas.getFrames()[0])==null?void 0:i.view)==null?void 0:a.getDoc();n(o),s(o)}),e.Components.addType(tc,{isComponent:r=>ka(r,nc),model:{defaults:{attributes:{[nc]:!0},locked:!0,layerable:!1},toHTML:()=>""}}),e.on(e.events.projectLoad,()=>{const{appStore:r}=t,{globalPageSettings:o}=r.projectDataCustom;let i=(o==null?void 0:o.customCodeHead)||"",a=(o==null?void 0:o.customCodeBody)||"";e.Pages.getAll().forEach(c=>{const u=c.getMainComponent(),d=u.head.components(),p=[];d.forEach(m=>{m.has(ag)&&p.push(m)}),p.forEach(m=>{const b=m.toHTML();i.includes(b)||(i+=b),m.remove()});const h=[];u.findType(tc).forEach(m=>{m.has(ag)&&h.push(m)}),h.forEach(m=>{const b=m.getInnerHTML();a.includes(b)||(a+=b),m.remove()})}),(i||a)&&r.setProjectDataCustom({globalPageSettings:{...o,customCodeHead:i,customCodeBody:a}})})},ia="page://",Rc="href-params__",y3=`data-gjs-${Rc}`,Ic=e=>{var t,n;return(n=(t=e==null?void 0:e.getMainComponent())==null?void 0:t.dataResolverProps)==null?void 0:n.path},Vc=e=>!!Ic(e),lg=e=>{const t=e.getDirtyCount()||0;e.em.set({changesCount:t+1},{})},x3=e=>!!(e!=null&&e.Components.getType("mjml")),Mv=e=>Vc(e)?U.database:yf(e)?U.home:"",Lv=e=>!!e.getSymbolOverride()?l.jsx(Q,{icon:U.rhombusOutline,size:oe.s3x}):l.jsx(Ab,{className:A("gs-cmp-svg-icon gs-utl-w-[16px] gs-utl-fill-current"),svg:e.getIcon()}),Nv=e=>{e.getModel().set({changesCount:e.getDirtyCount()+1})},yf=e=>{var t;return e&&e===((t=e.em.Pages)==null?void 0:t.getMain())},rt={title:({cmp:e})=>e.tagName==="title",favicon:({cmp:e})=>{var t;return e.tagName==="link"&&((t=e.attributes.attributes)==null?void 0:t.rel)==="icon"},description:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="description"},keywords:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="keywords"},socialTitle:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.property)==="og:title"},socialImage:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.property)==="og:image"},socialDescription:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.property)==="og:description"},charset:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.charset)},viewport:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="viewport"},robots:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="robots"},generator:({cmp:e})=>{var t;return e.tagName==="meta"&&((t=e.attributes.attributes)==null?void 0:t.name)==="generator"}},$v=e=>{for(const t in rt){const n=t;if(rt[n]({cmp:e}))return n}},kv=(e,t,n)=>{const s=[];let r=n;return e.getMainComponent().findType(tc).forEach(o=>{s.push(o),r=(r||"")+o.getInnerHTML()}),{components:s,html:r,changed:r!==t}},w3=(e,t)=>{const n={...t},s=e.getMainComponent(),{head:r}=s;if(r){const i=[],a=r.components();a.forEach(u=>{rt.title({cmp:u})?(u.components(t.title),delete n.title):rt.favicon({cmp:u})?(u.addAttributes({href:t.favicon}),delete n.favicon):rt.description({cmp:u})?(u.addAttributes({content:t.description}),delete n.description):rt.keywords({cmp:u})?(u.addAttributes({content:t.keywords}),delete n.keywords):rt.socialTitle({cmp:u})?(u.addAttributes({content:t.socialTitle}),delete n.socialTitle):rt.socialDescription({cmp:u})?(u.addAttributes({content:t.socialDescription}),delete n.socialDescription):rt.socialImage({cmp:u})?(u.addAttributes({content:t.socialImage}),delete n.socialImage):$v(u)||i.push(u)});const c=e.em.Parser.parseHtml(`<!DOCTYPE html><html><head>${t.customCodeHead}</head></html>`);c.head&&(a.remove(i),c.head.components&&a.add(c.head.components),delete n.customCodeHead)}const o=kv(e,n.customCodeBody);if(o.changed){const[i,...a]=o.components;(i||s.append({type:tc})[0]).components(n.customCodeBody),a.forEach(u=>u.remove()),delete n.customCodeBody}return e.set("settings",n)},S3=(e,t={})=>{var o;const n={...e.get("settings")??{}},s=e.getMainComponent(),{head:r}=s;if(r){const i=[];r.components().forEach(a=>{const{content:c,href:u}=a.getAttributes({noClass:!0,noStyle:!0});rt.title({cmp:a})?n.title=a.getInnerHTML():rt.favicon({cmp:a})?n.favicon=u:rt.description({cmp:a})?n.description=c:rt.keywords({cmp:a})?n.keywords=c:rt.socialTitle({cmp:a})?n.socialTitle=c:rt.socialDescription({cmp:a})?n.socialDescription=c:rt.socialImage({cmp:a})?n.socialImage=c:$v(a)||i.push(a.toHTML())}),i.length&&(n.customCodeHead=i.join(`
47
+ `))}if(n.customCodeBody=kv(e,n.customCodeBody).html,t.replaceDataSources&&Ic(e)){const{currentItem:i}=((o=s.getCollectionsState)==null?void 0:o.call(s))||{};i&&Object.keys(n).forEach(a=>{const c=a,u=n[c];nt(u)&&(n[c]=Rv(u,i))})}return n},Rv=(e,t)=>e.replace(/\{\{\s*([a-zA-Z0-9_]+)\s*\}\}/g,(n,s)=>{const r=t[s.trim()];return r!==void 0?String(r):""}),Iv=(e,t={})=>{const{currentItem:n}=t,s=t.ext??"html",r=Zt({page:e,key:"slug"})??"",o=n?Rv(r,n):r,i=o.lastIndexOf("/"),a=i>=0,c=a?o.substring(i+1):o,u=a?o.substring(0,i):void 0,d=`${mc(c)}${s?`.${s}`:""}`;return{path:u,filename:d,fullPath:u?`${u}/${d}`:d}},C3=(e,t)=>e.get(`${Rc}${t}`)||"",j3=(e,t,n)=>{e.set({[`${Rc}${t}`]:n})},E3=(e,t)=>{Object.entries(t).forEach(([n,s])=>{e[`${y3}${n}`]=s})},P3=(e,t)=>{e.getModel().set("customData",{...ii(e),...t})},ii=e=>e.getModel().get("customData")??{},Ud=e=>(e==null?void 0:e.projectDataCustom.globalPageSettings)??{},Zt=e=>{const{page:t,key:n,appEditorStore:s,def:r,defPage:o,opts:i}=e;return t?S3(t,i)[n]??o:Ud(s)[n]??r},ar=(e,t,n)=>{const s=e.em.getEditor(),o=ii(s).globalPageSettings||{};return Zt({page:e,key:t,opts:n})||o[t]},cg=(e,t)=>{const n=(e==null?void 0:e.getName())??"",s={page:e,appEditorStore:t,def:"",pageDef:""};return{name:n,slug:Zt({...s,key:"slug",defPage:mc(n)}),title:Zt({...s,key:"title",defPage:n}),description:Zt({...s,key:"description"}),favicon:Zt({...s,key:"favicon"}),keywords:Zt({...s,key:"keywords"}),socialTitle:Zt({...s,key:"socialTitle",defPage:n}),socialImage:Zt({...s,key:"socialImage"}),socialDescription:Zt({...s,key:"socialDescription"}),customCodeHead:Zt({...s,key:"customCodeHead"}),customCodeBody:Zt({...s,key:"customCodeBody"})}},il=({icon:e,layout:t,tooltip:n,className:s,forceRemove:r,removeLayouts:o})=>({type:"button",icon:e,tooltip:n,className:s,size:"s",editorEvents:{[`${xn.layoutToggleId}${t.id}`]:({fromEvent:i,setState:a})=>{a({active:i.isOpen})}},onClick:({editor:i})=>{o==null||o.forEach(a=>i.runCommand(se.layoutRemove,{id:a,force:r})),i.runCommand(se.layoutToggle,{...t})}}),ug={type:"static",layoutId:"leftPanelsContainer"},dg={width:240,overflow:"hidden"};il({tooltip:"Blocks",removeLayouts:["pagesLayers","ps"],layout:{id:"blocks",layout:"panelBlocks",header:{label:"Blocks"},style:dg,placer:ug}}),il({tooltip:"Pages & Layers",removeLayouts:["blocks","ps"],layout:{id:"pagesLayers",layout:"panelPagesLayers",header:!1,style:dg,placer:ug}}),il({tooltip:"Page Settings",removeLayouts:["pagesLayers","blocks"],layout:{id:"ps",layout:"panelPageSettings",header:{label:"Page Settings"},style:{marginLeft:40}}}),il({icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,10.11C13.03,10.11 13.87,10.95 13.87,12C13.87,13 13.03,13.85 12,13.85C10.97,13.85 10.13,13 10.13,12C10.13,10.95 10.97,10.11 12,10.11M7.37,20C8,20.38 9.38,19.8 10.97,18.3C10.45,17.71 9.94,17.07 9.46,16.4C8.64,16.32 7.83,16.2 7.06,16.04C6.55,18.18 6.74,19.65 7.37,20M8.08,14.26L7.79,13.75C7.68,14.04 7.57,14.33 7.5,14.61C7.77,14.67 8.07,14.72 8.38,14.77C8.28,14.6 8.18,14.43 8.08,14.26M14.62,13.5L15.43,12L14.62,10.5C14.32,9.97 14,9.5 13.71,9.03C13.17,9 12.6,9 12,9C11.4,9 10.83,9 10.29,9.03C10,9.5 9.68,9.97 9.38,10.5L8.57,12L9.38,13.5C9.68,14.03 10,14.5 10.29,14.97C10.83,15 11.4,15 12,15C12.6,15 13.17,15 13.71,14.97C14,14.5 14.32,14.03 14.62,13.5M12,6.78C11.81,7 11.61,7.23 11.41,7.5C11.61,7.5 11.8,7.5 12,7.5C12.2,7.5 12.39,7.5 12.59,7.5C12.39,7.23 12.19,7 12,6.78M12,17.22C12.19,17 12.39,16.77 12.59,16.5C12.39,16.5 12.2,16.5 12,16.5C11.8,16.5 11.61,16.5 11.41,16.5C11.61,16.77 11.81,17 12,17.22M16.62,4C16,3.62 14.62,4.2 13.03,5.7C13.55,6.29 14.06,6.93 14.54,7.6C15.36,7.68 16.17,7.8 16.94,7.96C17.45,5.82 17.26,4.35 16.62,4M15.92,9.74L16.21,10.25C16.32,9.96 16.43,9.67 16.5,9.39C16.23,9.33 15.93,9.28 15.62,9.23C15.72,9.4 15.82,9.57 15.92,9.74M17.37,2.69C18.84,3.53 19,5.74 18.38,8.32C20.92,9.07 22.75,10.31 22.75,12C22.75,13.69 20.92,14.93 18.38,15.68C19,18.26 18.84,20.47 17.37,21.31C15.91,22.15 13.92,21.19 12,19.36C10.08,21.19 8.09,22.15 6.62,21.31C5.16,20.47 5,18.26 5.62,15.68C3.08,14.93 1.25,13.69 1.25,12C1.25,10.31 3.08,9.07 5.62,8.32C5,5.74 5.16,3.53 6.62,2.69C8.09,1.85 10.08,2.81 12,4.64C13.92,2.81 15.91,1.85 17.37,2.69M17.08,12C17.42,12.75 17.72,13.5 17.97,14.26C20.07,13.63 21.25,12.73 21.25,12C21.25,11.27 20.07,10.37 17.97,9.74C17.72,10.5 17.42,11.25 17.08,12M6.92,12C6.58,11.25 6.28,10.5 6.03,9.74C3.93,10.37 2.75,11.27 2.75,12C2.75,12.73 3.93,13.63 6.03,14.26C6.28,13.5 6.58,12.75 6.92,12M15.92,14.26C15.82,14.43 15.72,14.6 15.62,14.77C15.93,14.72 16.23,14.67 16.5,14.61C16.43,14.33 16.32,14.04 16.21,13.75L15.92,14.26M13.03,18.3C14.62,19.8 16,20.38 16.62,20C17.26,19.65 17.45,18.18 16.94,16.04C16.17,16.2 15.36,16.32 14.54,16.4C14.06,17.07 13.55,17.71 13.03,18.3M8.08,9.74C8.18,9.57 8.28,9.4 8.38,9.23C8.07,9.28 7.77,9.33 7.5,9.39C7.57,9.67 7.68,9.96 7.79,10.25L8.08,9.74M10.97,5.7C9.38,4.2 8,3.62 7.37,4C6.74,4.35 6.55,5.82 7.06,7.96C7.83,7.8 8.64,7.68 9.46,7.6C9.94,6.93 10.45,6.29 10.97,5.7Z" /></svg>',tooltip:"Custom Component",className:"gs-utl-mt-auto",layout:{id:"customLayout",layout:{type:"custom",component:()=>l.jsx("div",{children:"Custom Reat component"})},header:{label:"Custom"},style:{marginLeft:40}}});const T3={type:"row",style:{height:"100%"},children:[{type:"sidebarLeft"},{type:"canvasSidebarTop"},{type:"sidebarRight"}]};var O3={NODE_ENV:"production"};class _3{constructor(t,n){var o,i;this.projectType=mt.web,this.editor=void 0,this.sdkProps={},this.sdkLicenseError="",this.licenseCheckRetry=0,this.showPoweredBy=!1,this.isInPreview=!1,this.isCssPanelActive=!1,this.isLeftSidebarOpen=!0,this.isRightSidebarOpen=!0,this.isTopSidebarOpen=!0,this.isBottomSidebarOpen=!0,this.isSelectingTarget=!1,this.leftSidebarSize=240,this.rightSidebarSize=240,this.transitionTime=152,this.topBarSize=36,this.isDev=!1,this.isStage=!1,this.editorKey=0,this.appInstalled=!1,this.licenseKey="",this.licenseCheckStarted=!1,this.studioSdkVersion=O3.STUDIO_NPM_PACKAGE_VERSION,this.projectDataCustom={},this.displayMode="browser",this.projectPlugins=[],this.queryParams={},this.isCanvasPanning=!1,this.selectedDesignerTab="style",this.customAssets=void 0,this.nextProjectData=void 0,this.isDraggingAbsolute=!1,this.isSaving=!1,this.isReady=!1,this.sdkPagesConfigUpdates=0,this.panelPageSettings={isOpen:!1,width:300,page:void 0},this.rootElWidth=0,this._projectId="",this.store=t,n&&Object.keys(n).forEach(a=>{const c=a,u=n[c];u!==void 0&&(this[c]=u)});const s=Ts()?window.location.search:"";this.queryParams=zx(s),tn(this,{sdkProps:!1},{autoBind:!0});const r=(i=(o=this.sdkProps.options)==null?void 0:o.customTheme)==null?void 0:i.icons;r&&Aj(r)}get baseApiUrl(){const{isDev:t,isStage:n}=this;return yp({isDev:t,isStage:n})}get projectId(){var s,r;const{project:t,storage:n}=this.sdkOptions;return this._projectId||((r=(s=(n==null?void 0:n.project)||(t==null?void 0:t.default))==null?void 0:s.custom)==null?void 0:r.id)||""}get projectIdToLoad(){return this.store.localSettingsStore.lastProjectId||this.projectId}get currentProjectId(){return this.projectDataCustom.id||this.projectId}get isBrowserMode(){return this.displayMode==="browser"}get sdkOptions(){return this.sdkProps.options}get sdkProjectId(){var t,n;return(n=(t=this.sdkOptions.project)==null?void 0:t.id)==null?void 0:n.toString()}get sdkIdentityId(){var t,n;return(n=(t=this.sdkOptions.identity)==null?void 0:t.id)==null?void 0:n.toString()}get sdkPagesConfig(){return this.sdkPagesConfigUpdates,this.sdkOptions.pages}get sdkLayoutConfig(){return this.sdkOptions.layout}get sdkComponentsConfig(){return this.sdkOptions.components}get sdkCanvasConfig(){return this.sdkOptions.canvas}get sdkGlobalStylesConfig(){return this.sdkOptions.globalStyles}get currentLayout(){const{sdkLayoutConfig:t,rootElWidth:n,store:s}=this,{customConfig:r}=s.layoutStore,o=(r==null?void 0:r.responsive)||(t==null?void 0:t.responsive);let i=(r==null?void 0:r.default)||(t==null?void 0:t.default)||T3;if(n&&o){const c=Object.keys(o).map(Number).sort((u,d)=>u-d).find(u=>n<=u);i=c?o[c]:i}return i}get sdkCustomIcons(){var t;return(t=this.sdkOptions.customTheme)==null?void 0:t.icons}get isProjectTypeEmail(){return this.projectType===mt.email}get showPages(){return this.isReady&&this.sdkPagesConfig!==!1&&!this.isProjectTypeEmail}get showSelectors(){return!this.isProjectTypeEmail}get sdkMisconfigurationError(){if(this.store.assetsStore.isUsingAssetCloud||this.isUsingProjectCloud){const n=this.sdkProjectId,s=this.sdkIdentityId;if(!n||!s)return'SDK Misconfiguration Error: When using assets.storageType == "cloud" or storage.type === "cloud", project.id and identity.id are required.'}return""}get isUsingProjectSelfHosted(){var t;return((t=this.sdkOptions.storage)==null?void 0:t.type)===Bd.self}get isUsingProjectCloud(){var t;return((t=this.sdkOptions.storage)==null?void 0:t.type)===Bd.cloud}get publicStateTheme(){const{theme:t,resolvedTheme:n}=this.store.localSettingsStore;return{theme:t,resolvedTheme:n}}setPublicStateTheme(t){t.theme!==void 0&&(this.store.localSettingsStore.theme=t.theme)}*init(){var p,h;const{store:t,sdkOptions:n}=this,{lastProjectId:s,lastProjectType:r}=t.localSettingsStore,o=(p=n.project)==null?void 0:p.default,{project:i}=n.storage||{};let a,c;r&&(this.store.templatesStore._projectTypeFilter=r),s&&(a=(h=(yield Sv(r)).find(m=>m.id===s))==null?void 0:h.data),a?c=a:i?c=i:o&&(c=o);const u=(c==null?void 0:c.custom)||{},d=u.projectType;d&&(this.projectType=d),u.projectType=this.projectType,this.setProjectDataCustom({...u,id:this.projectIdToLoad}),yield t.pluginStore.initProjectPlugins(this.projectType),this.editorKey++}setInstallEvent(t){this.installEvent=t}setAppInstalled(t){this.appInstalled=t}setDisplayMode(t){this.displayMode=t}setProject(t){const n=this.editor,{id:s,data:r,isTemplate:o}=t,i=n.Storage.getConfig().options.local,a=o?`${s}__${Ux()}`:s;this._projectId=a,i.key=a,Bx(r)||this.loadProjectData({...r,custom:{...r.custom,id:a,projectType:this.store.templatesStore.projectTypeFilter}})}setProjectDataCustom(t){const n={...this.projectDataCustom,...t};this.projectDataCustom=n,this.projectType=n.projectType||mt.web,this.editor&&P3(this.editor,n),n.id&&this.store.localSettingsStore.setLocalState({lastProjectId:n.id,lastProjectType:this.projectType})}loadProjectData(t){const n=t.custom||{};if(A3(t)!==this.projectType)this.setNextProjectData(t),this.setProjectDataCustom(n),this.updateStudio();else{const s=this.editor;s.loadProjectData(t),s.UndoManager.clear(),this.setProjectDataCustom(n)}}setNextProjectData(t){this.nextProjectData=t}setLeftSidebarSize(t){this.leftSidebarSize=t}setRightSidebarSize(t){this.rightSidebarSize=t}setEditor(t){this.editor=t}setPreview(t){this.isInPreview=t}toggleCssPanel(){this.isCssPanelActive=!this.isCssPanelActive}toggleLeftSidebar(){this.isLeftSidebarOpen=!this.isLeftSidebarOpen,this.refreshEditorPostTransition()}setLeftSidebarOpen(t){this.isLeftSidebarOpen=t,this.refreshEditorPostTransition()}toggleRightSidebar(){this.isRightSidebarOpen=!this.isRightSidebarOpen,this.refreshEditorPostTransition()}setRightSidebarOpen(t){this.isRightSidebarOpen=t,this.refreshEditorPostTransition()}setTopSidebarOpen(t){this.isTopSidebarOpen=t,this.refreshEditorPostTransition()}setBottomSidebarOpen(t){this.isBottomSidebarOpen=t,this.refreshEditorPostTransition()}refreshEditorPostTransition(){setTimeout(()=>{var t;return(t=this.editor)==null?void 0:t.refresh()},this.transitionTime)}setCanvasPanning(t){this.isCanvasPanning=t}setSelectingTarget(t){this.isSelectingTarget=t}setSelectedDesignerTab(t){this.selectedDesignerTab=t}setCustomAssets(t){this.customAssets=t}setIsDraggingAbsolute(t){this.isDraggingAbsolute=t}setIsSaving(t){this.isSaving=t}setIsReady(t){this.isReady=t}setPanelPageSettings(t){this.panelPageSettings={...this.panelPageSettings,...t}}setSdkPagesConfig(t){this.sdkProps.options.pages=t&&{...this.sdkPagesConfig,...t},++this.sdkPagesConfigUpdates}setRootElWidth(t){this.rootElWidth=t,this.refreshEditorCanvas()}*loadLicense(){const{editor:t}=this;try{this.licenseCheckStarted=!0;const{licenseKey:n,baseApiUrl:s,studioSdkVersion:r}=this;t==null||t.trigger(j1,{baseApiUrl:s});const o=yield Os.post(`${s}/sdk/${n||"na"}`,{params:{d:window.location.hostname,v:r}});if(o instanceof Error)throw o;const i=o.result||{},{license:a,error:c,plan:u}=i;c?this.sdkLicenseError=c:(this.sdkLicense=a,u!=null&&u.poweredBy&&(this.showPoweredBy=!0)),t==null||t.trigger(yd,i)}catch(n){this.licenseCheckRetry<3?(this.licenseCheckRetry++,setTimeout(()=>this.loadLicense(),3e3)):(console.error(n),this.showPoweredBy=!0,t==null||t.trigger(yd,{}))}}*updateStudio(){const{pluginStore:t}=this.store,{projectType:n}=this.projectDataCustom;yield t.initProjectPlugins(n),this.setEditor(),this.editorKey++}refreshStudio(){var t;this.editorKey&&(this.setNextProjectData((t=this.editor)==null?void 0:t.getProjectData()),this.store.layoutStore.clear(),this.setEditor(),this.editorKey++)}refreshEditorCanvas(){var t;(t=this.editor)==null||t.refresh({tools:!0})}}const A3=e=>{var t;return((t=e.custom)==null?void 0:t.projectType)||mt.web},me=()=>pn().appEditorStore,Vv=()=>Qf().appEditorStore,M3=()=>{try{return Qf().appEditorStore}catch{}},xf=()=>{const[e,t]=f.useState(0),n=pn().appEditorStore,{transitionTime:s}=n;return f.useEffect(()=>{setTimeout(()=>t(r=>++r),s)},[s]),[e]},wf=()=>{const{baseApiUrl:e}=Vv();return`${e}/assets/sdk`},L3=e=>`${wf()}/${e}`,N3=async(e,t,n)=>{const s=await Os.get(wf(),{params:{projectId:t,identityId:n,d:window.location.hostname,licenseKey:e}});return((s==null?void 0:s.result)??[]).map(({asset:r,cdnUrl:o})=>({...r,size:parseInt(r.size),src:o}))},$3=async(e,t,n,s)=>{const r=await Os.post(wf(),{body:JSON.stringify({fileMetadata:e,projectId:n,identityId:s}),params:{d:window.location.hostname,licenseKey:t}});return r==null?void 0:r.result},k3=async(e,t)=>await Os.put(t,{body:e,rawText:!0}),R3=async(e,t,n,s)=>Promise.all(e.map(r=>$3({name:r.name,size:r.size,type:r.type},t,n,s).then(async o=>{if(!o)throw new Error("No asset");const{asset:i,cdnUrl:a,uploadUrl:c}=o,u=await k3(r,c);if(u instanceof Error)throw console.error(u),new Error("Upload failed");return{...i,size:parseInt(i.size),src:a,type:oo.image}}))),I3=async(e,t,n,s)=>{const r=await Os.delete(L3(e),{body:JSON.stringify({projectId:n,identityId:s}),params:{d:window.location.hostname,licenseKey:t}});return r==null?void 0:r.result},pg=async(e,t,n,s)=>Promise.all(e.map(r=>I3(r.id||r.src,t,n,s)));function vr(e,t,n){let s,r,o,i,a;const c=t===void 0?100:t;function u(){const p=Date.now()-i;p<c&&p>=0?s=setTimeout(u,c-p):(s=null,a=e.apply(o,r),o=r=null)}const d=function(){return o=this,r=arguments,i=Date.now(),s||(s=setTimeout(u,c)),a};return d.clear=function(){s&&(clearTimeout(s),s=null)},d.flush=function(){s&&(a=e.apply(o,r),o=r=null,clearTimeout(s),s=null)},d}class fg{constructor(t,n){this.assetsStore=t,this.layoutPanelId=n,this.itemLayout=void 0,this.isLoadingAssets=!1,this.typeFilter=void 0,this.searchValue="",this.customTypes=void 0,this.customProviders=void 0,this.providerFilter=void 0,this.customAssetProps=void 0,this.customPages=void 0,this.totalItems=void 0,this.optionalType=!1,this.optionalProvider=!0,tn(this,{},{autoBind:!0}),this.initTypeFilter(),this.initProviderFilter(),this.initOptionalType(),this.loadAssetsDebounced=vr(this.loadAssets,this.searchDebounceMs)}get typeFilterOptions(){return this.customTypes??[]}get providers(){return this.assetsStore.allProviders.map(t=>({...t,types:Array.isArray(t.types)?t.types:[t.types]}))}get providerFilterOptions(){return this.providers.filter(t=>(!this.typeFilter||t.types.includes(this.typeFilter))&&(!this.customProviders||this.customProviders.includes(t.id)))}get provider(){return this.providers.find(t=>t.id===this.providerFilter)}get assetPropsFromPages(){if(!this.customPages)return;const t=[];for(const n of this.customPages)t.push(...n.items);return t}get assetProps(){if(!!!this.assetPropsFromPages&&this.isLoadingAssets)return[];const n=this.customAssetProps??this.assetPropsFromPages??this.assetsStore.projectAssetProps??[];return this.typeFilter?n.filter(s=>s.type===this.typeFilter):n}get onProviderOrProjectDelete(){const{provider:t,assetsStore:n}=this;return t?t.onDelete:n.onProjectDelete}get t(){return this.assetsStore.t}get isLoading(){return this.assetsStore.isLoadingAssets||this.isLoadingAssets}get handleDelete(){return this.onProviderOrProjectDelete&&this.handleDeleteCallback}get shouldLoadNextPage(){var n;const t=(n=this.customPages)==null?void 0:n.at(-1);return t?!t.isLastPage:!1}get reloadOnInput(){var t,n;return((n=(t=this.provider)==null?void 0:t.search)==null?void 0:n.reloadOnInput)??!1}get searchDebounceMs(){var t,n;return((n=(t=this.provider)==null?void 0:t.search)==null?void 0:n.debounceMs)??1e3}initOptionalType(){this.setOptionalType(!1)}initOptionalProvider(){var t;this.setOptionalProvider(!!(((t=this.assetsStore.sdkAssetConfig)==null?void 0:t.projectAssetsOption)??!0))}initTypeFilter(){this.setTypeFilter(oo.image)}initProviderFilter(){var t;this.setProviderFilter((t=this.assetsStore.sdkAssetConfig)==null?void 0:t.providerId)}setOptionalType(t){this.optionalType=t}setOptionalProvider(t){this.optionalProvider=t}setTypeFilter(t){this.typeFilter=t}setProviderFilter(t){this.providerFilter=t}setSearchValue(t){this.searchValue=t,this.reloadOnInput&&this.loadAssetsDebounced()}setCustomTypes(t){this.customTypes=t}setCustomProviders(t){this.customProviders=t}setCustomAssetProps(t){this.customAssetProps=t}setCustomPages(t){this.customPages=t}setItemLayout(t){this.itemLayout=t}setIsLoadingAssets(t){this.isLoadingAssets=t}selectProjectAssets(){this.setCustomAssetProps(void 0),this.setCustomPages(void 0),this.setItemLayout(void 0)}async loadProviderAssets(t){var a,c,u,d;const{assetsStore:n}=this,{editor:s}=n;if(!s||!this.provider)return;t&&(this.setCustomAssetProps(void 0),this.setCustomPages(void 0));const r=((a=this.customPages)==null?void 0:a.length)??0,o=(u=(c=this.customPages)==null?void 0:c.at(-1))==null?void 0:u.nextPageCustomData,i=await this.provider.onLoad({editor:s,assetTypeFilter:this.typeFilter,pageIndex:r,searchValue:this.searchValue,pageCustomData:o})??[];if(Array.isArray(i)){const p=i.map(n.toAssetProps);this.setCustomAssetProps(p)}else{const p={...i,items:i.items.map(n.toAssetProps)};this.setCustomPages([...this.customPages??[],p])}this.setItemLayout((d=this.provider)==null?void 0:d.itemLayout)}async loadAssets(t=!0){const{assetsStore:n}=this,{toastStore:s}=n.store;try{this.provider?(this.setIsLoadingAssets(!0),await this.loadProviderAssets(t)):this.selectProjectAssets()}catch(r){console.error(r),s.addError("assets-error-get",this.t("errorLoad"))}finally{this.setIsLoadingAssets(!1)}}async reloadAssets(t){const{assetsStore:n}=this,{cachedOnLoadAssetProps:s}=n;await this.loadAssets(t==null?void 0:t.clearExisting),!this.provider&&s&&(n.cachedOnLoadAssetProps=void 0,await n.loadProjectAssets())}async handleDeleteCallback(t){const{assetsStore:n,onProviderOrProjectDelete:s}=this,{appEditorStore:r}=n.store,{editor:o}=r;if(!(!o||!s))try{n.setIsLoadingAssets(!0),await s({assets:[n.toAsset(t)],assetProps:[t],editor:o,loadAssets:i=>this.reloadAssets(i)})}catch(i){console.error(i),n.store.toastStore.addError("assets-error-delete",{header:this.t("errorDelete"),content:i==null?void 0:i.message})}finally{n.setIsLoadingAssets(!1)}}}const Hv=e=>pn().assetsStore.assetPanelStores[e];class V3{constructor(t){this.store=t,this.isLoadingAssets=!1,this.mainPanelId=`main-${xv()}`,this.assetPanelStores={},this.cachedOnLoadAssetProps=void 0,this.projectAssetProps=void 0,this.allProviders=[],this.assetPanelStores[this.mainPanelId]=new fg(this,this.mainPanelId),this.setAllProviders(this.isUsingAssetCloud?[this.userProvider]:[]),tn(this,{},{autoBind:!0})}get sdkAssetConfig(){return this.store.appEditorStore.sdkOptions.assets}get isUsingAssetCloud(){var t;return((t=this.sdkAssetConfig)==null?void 0:t.storageType)===Fd.cloud}get storageType(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.storageType}get isSelfStorage(){return this.storageType===Fd.self}get editor(){return this.store.appEditorStore.editor}get customOnLoad(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.onLoad}get customOnDelete(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.onDelete}get customOnUpload(){var t;return(t=this.sdkAssetConfig)==null?void 0:t.onUpload}get onCloudOrCustomUpload(){const{appEditorStore:t}=this.store,{sdkProps:n}=t,r=n.options.licenseKey,o=t.sdkProjectId,i=t.sdkIdentityId,a=({files:c})=>R3(c,r,o,i);return this.isUsingAssetCloud?a:this.customOnUpload}get onProjectDelete(){const{customOnDelete:t,isSelfStorage:n,isUsingAssetCloud:s}=this;return n?t?async r=>{await t(r),this.deleteFromProjectAssets(r)}:void 0:s?async r=>{var c,u;const{sdkOptions:o}=this.store.appEditorStore,i=(c=o.project)==null?void 0:c.id,a=(u=o.identity)==null?void 0:u.id;await pg(r.assetProps,o.licenseKey,i,a),this.deleteFromProjectAssets(r)}:this.deleteFromProjectAssets}get t(){return this.store.i18nStore.tScoped("assetManager")}get userProvider(){var a,c;const{appEditorStore:t}=this.store,{sdkOptions:n}=t,s=(a=n.project)==null?void 0:a.id,r=(c=n.identity)==null?void 0:c.id,o=n.licenseKey;return{id:"grapesjs-user-provider",label:()=>this.t("userAssets"),types:oo.image,onLoad:()=>N3(o,s,r),onDelete:async u=>{const{assetProps:d,loadAssets:p}=u;await pg(d,o,s,r),this.deleteFromProjectAssets(u),await p({clearExisting:!1})}}}onEditor(){const t=vr(()=>!this.loadProjectAssets()),n=this.store.appEditorStore.editor;this.addSdkProviders();const s=n.Assets.events.all;n.on(s,t),this.loadProjectAssets()}addSdkProviders(){var s;const t=((s=this.sdkAssetConfig)==null?void 0:s.providers)??[],n=Ke(t)?t({providers:gr(this.allProviders)}):[...this.allProviders,...t];this.setAllProviders(n)}addProvider(t,n=this.allProviders.length){const s=[...this.allProviders];let r=this.allProviders.findIndex(i=>i.id===t.id);const o=r!==-1;s.splice(n,0,t),o&&(r>=n&&(r+=1),s.splice(r,1)),this.setAllProviders(s)}hasType(t){return!!this.allProviders.find(n=>nt(n.types)?n.types===t:n.types.includes(t))}createAssetManager(t){const n=new fg(this,t);this.assetPanelStores[t]=n}removeAssetManager(t){delete this.assetPanelStores[t]}async loadProjectAssets(){const{editor:t,isSelfStorage:n,cachedOnLoadAssetProps:s,customOnLoad:r}=this,{toastStore:o}=this.store;let i;if(t){try{if(this.setIsLoadingAssets(!0),n&&r)if(s)i=s;else{const a=await r({editor:t});this.cachedOnLoadAssetProps=a.map(this.toAssetProps),i=this.cachedOnLoadAssetProps}else i=t.Assets.getAll().map(this.toAssetProps)}catch(a){console.error(a),o.addError("assets-error-load",{header:this.t("errorLoad"),content:a==null?void 0:a.message})}finally{this.setIsLoadingAssets(!1)}i&&this.setProjectAssetProps(i)}}deleteFromProjectAssets({assets:t,editor:n,assetProps:s}){const{cachedOnLoadAssetProps:r,customOnLoad:o}=this;if(o){if(r){const i=s.map(a=>a.id);this.cachedOnLoadAssetProps=r.filter(({id:a})=>!i.includes(a)),this.setProjectAssetProps(this.cachedOnLoadAssetProps)}}else t.forEach(i=>n.Assets.remove(i)),lg(n)}addToProjectAssets(t){const n=this.store.appEditorStore.editor,{cachedOnLoadAssetProps:s,customOnLoad:r}=this;r?s&&(this.cachedOnLoadAssetProps=[...t,...s],this.setProjectAssetProps(this.cachedOnLoadAssetProps)):(n.Assets.add(t),lg(n))}async handleUpload(t){var o,i;const{editor:n,onCloudOrCustomUpload:s}=this,{toastStore:r}=this.store;if(!(!n||!s))try{this.setIsLoadingAssets(!0);const a=((o=t.dataTransfer)==null?void 0:o.files)||((i=t.target)==null?void 0:i.files)||[],c=Array.from(a),u=await s({files:c,editor:n});if(u!=null&&u.length){const d=u.map(this.toAssetProps);return this.addToProjectAssets(d),d}else console.warn("No assets returned from the upload handler. Ensure to return an array of assets.")}catch(a){console.error(a),r.addError("assets-error-upload",{header:this.t("errorUpload"),content:a==null?void 0:a.message})}finally{this.setIsLoadingAssets(!1)}}uploadFile(t){var n;return(n=this.editor)==null?void 0:n.Assets.FileUploader().uploadFile(t)}isAsset(t){return!!t.getSrc}toAssetProps(t){if(this.isAsset(t)){const s=t;return{...s.attributes,id:s.attributes.id||s.getSrc(),src:s.getSrc(),name:s.attributes.name??s.getFilename(),type:s.attributes.type??s.getType()??oo.image,asset:s}}return{...t,type:t.type||oo.image,id:t.id||t.src}}toAsset(t){const{editor:n}=this.store.appEditorStore;if(n)return t.asset??new n.AssetManager.Asset(t)}setProjectAssetProps(t){this.projectAssetProps=t}setIsLoadingAssets(t){this.isLoadingAssets=t}setAllProviders(t){this.allProviders=t}}const Ia=()=>pn().assetsStore;class H3{constructor(t){var s;this.store=t,this.fonts={},tn(this,{},{autoBind:!0});const n=(s=this.sdkFontOptions)==null?void 0:s.default;this.sdkDefaultFonts=Ke(n)?n({baseDefault:sg}):n}get staticFonts(){return this.sdkDefaultFonts?this.sdkDefaultFonts.map(t=>nt(t)?{id:t,label:t}:rg(t)?t:null).filter(t=>!!t):sg}get defaultWebFonts(){return this.sdkDefaultFonts?this.sdkDefaultFonts.filter(n=>!nt(n)&&!rg(n)).map(n=>Di(n.family,n)):[]}get sortedFonts(){return f3(Object.values(this.fonts))}get fontFamilyOptions(){const t=n=>({id:n.family,label:n.familyLabel});return h3([...this.staticFonts,...Object.values(this.fonts).map(t)])}get sdkFontOptions(){return this.store.appEditorStore.sdkOptions.fonts}get enableFontManager(){var t;return(t=this.sdkFontOptions)==null?void 0:t.enableFontManager}get sdkShowProjectFonts(){const{showProjectFonts:t,enableFontManager:n}=this.sdkFontOptions||{};return At(t)?t:n}get sdkAddFonts(){const{addFonts:t,enableFontManager:n}=this.sdkFontOptions||{};return At(t)?t:n}loadFonts(){this.loadProjectFonts(),this.loadDefaultFonts()}loadProjectFonts(){const{editor:t}=this.store.appEditorStore;if(!t)return;const{globalPageSettings:n}=ii(t)??{},{fonts:s}=n??{};if(s)for(const[r,o]of Object.entries(s)){const i=Di(r,o);this.addFont(i,{skipUpdate:!0})}}loadDefaultFonts(){const{editor:t}=this.store.appEditorStore;if(t)for(const n of this.defaultWebFonts)this.addFont(n,{overwrite:!1,skipUpdate:!0})}getFont(t){return t=bo(t),this.fonts[t]}addFont(t,{skipUpdate:n,overwrite:s=!0}={}){const r=Di(t.family,t),{editor:o}=this.store.appEditorStore;if(!o)return;const{family:i}=r;!s&&this.fonts[i]||(this.fonts[i]=r,n||this.updateProjectFonts(o))}removeFont(t){t=bo(t);const{editor:n}=this.store.appEditorStore;n&&(delete this.fonts[t],this.updateProjectFonts(n))}updateProjectFonts(t){const s={...ii(t).globalPageSettings,fonts:gr(this.fonts)};this.store.appEditorStore.setProjectDataCustom({globalPageSettings:s}),Nv(t),t.trigger(xn.pageSettingsUpdate,{data:s})}}const Va=()=>pn().fontsStore;class D3{constructor(t){this.store=t,tn(this,{},{autoBind:!0})}t(t,n={}){var r;const{editor:s}=this.store.appEditorStore;return((r=s==null?void 0:s.I18n)==null?void 0:r.t(t,n))||""}tScoped(t){return(n,s)=>this.t(`${t}.${n}`,s)}}const Ae=()=>pn().i18nStore,$n=(e,t)=>f.Children.map(e,n=>n&&n.type===t?n:null),hg="gs-custom-layout",F3=f.forwardRef(function({className:t,component:n,noWrapper:s,id:r,render:o,componentProps:i,...a},c){const{editor:u}=me(),d=f.useRef(null),p=n,h=p&&u?l.jsx(p,{...i,editor:u}):null,g=A(hg,r&&`${hg}__${r}`,t),m=s&&!o;return f.useImperativeHandle(c,()=>d.current,[]),f.useEffect(()=>{const b=d.current;if(!o||!b)return;const v=w=>b.appendChild(w),x=w=>b.removeChild(w),y=o({editor:u,addEl:v,removeEl:x});if(nt(y))b.innerHTML=y;else{if(y instanceof HTMLElement)return v(y),()=>{x(y)};if(Ke(y))return()=>{y()}}},[o,u,d.current]),m?h:l.jsx("div",{className:g,ref:d,...a,children:h})}),Wd=ae(F3);class B3{constructor(t){this.customConfig=void 0,this.layouts=[],this.layoutsById=new Map,this.customLayoutComponents=new Map,this.store=t,tn(this,{},{autoBind:!0,deep:!1})}get editor(){return this.store.appEditorStore.editor}setCustomConfig(t){this.customConfig=t}add(t,n){var s;this.get(t)||(this.layouts=[...this.layouts,{id:t,...n}],(s=this.editor)==null||s.trigger(`${xn.layoutToggleId}${t}`,{isOpen:!0}))}remove(t,n){var r;const s=n==null?void 0:n.layout;s&&this.layouts.forEach(o=>{o.id===t&&Object.assign(o,s)}),this.layouts=n!=null&&n.force?this.layouts.filter(o=>o.id!==t):this.layouts.map(o=>o.id===t?{...o,toRemove:!0}:o),(r=this.editor)==null||r.trigger(`${xn.layoutToggleId}${t}`,{isOpen:!1})}get(t){return this.layouts.find(n=>n.id===t)}clear(){this.layouts=[]}addCustomLayoutComponent(t,n){this.customLayoutComponents.set(t,n)}getCustomLayoutComponent(t){return this.customLayoutComponents.get(t)}removeCustomLayoutComponent(t){this.customLayoutComponents.delete(t)}get layoutChildren(){var s;const{children:t}=this.store.appEditorStore.sdkProps,n=((s=$n(t,Wd))==null?void 0:s.filter(Boolean))||[];return new Map(n.map(({props:r})=>[r.id,r]))}}const Dv=()=>pn().layoutStore,z3=()=>Qf().layoutStore;class U3{constructor(t){this.isActive=!1,this.content="",this.store=t,tn(this,{},{autoBind:!0})}show(t){this.isActive=!0,this.content=t}hide(){this.isActive=!1,setTimeout(this.clear,101)}clear(){this.content=""}}class W3{constructor(t){this.store=t,this._projectSourceFilter=ra.Existing,this._loadedProjects=void 0,this._loadedTemplates=void 0,this._projectTypeFilter=t.appEditorStore.projectType,tn(this,{},{autoBind:!0})}get projectTypeFilter(){return this._projectTypeFilter}get projectSourceFilter(){return this._projectSourceFilter}get templates(){return this._loadedTemplates}get projects(){return this._loadedProjects}get filteredTemplates(){return this.projectSourceFilter===ra.Existing?this.projects:this.templates}async loadProjects(){const t=await Sv(this.projectTypeFilter);this.setProjects(t)}async loadTemplates(){var r;const t=(r=this.store.appEditorStore.sdkOptions.templates)==null?void 0:r.onLoad,n=async()=>await qO(this.projectTypeFilter);let s;if(t){const o=this.store.appEditorStore.editor;s=await t({editor:o,fetchCommunityTemplates:n})}else s=await n();this.setTemplates(s)}async loadAllTemplates(){await Promise.all([this.loadProjects(),this.loadTemplates()])}async removeProject(t){UO($c.Projects,t)}async setProjectTypeFilter(t){this._projectTypeFilter=t,this.setProjects(void 0),this.setTemplates(void 0)}setProjectSourceFilter(t){this._projectSourceFilter=t}setTemplates(t){this._loadedTemplates=t}setProjects(t){this._loadedProjects=t}}const Fv=()=>pn().templatesStore;class G3{constructor(t){this.toasts=[],this.store=t,tn(this,{},{autoBind:!0})}add(t,n){this.toasts.find(s=>s.id===t)||this.toasts.push({id:t,...n})}addError(t,n){this.add(t,{...nt(n)?{header:n}:n,variant:Jt.Error})}addWarning(t,n){this.add(t,{...nt(n)?{header:n}:n,variant:Jt.Warning})}addSuccess(t,n){this.add(t,{...nt(n)?{header:n}:n,variant:Jt.Success})}addInfo(t,n){this.add(t,{...nt(n)?{header:n}:n,variant:Jt.Info})}remove(t){this.toasts=this.toasts.filter(n=>n.id!==t)}}class q3{constructor(t){this.isOpen=!1,this.store=t,tn(this,{},{autoBind:!0})}setOpen(t){this.isOpen=t,this.triggerEvent()}toggleOpen(){this.isOpen=!this.isOpen,this.triggerEvent()}triggerEvent(){var t;(t=this.store.appEditorStore.editor)==null||t.trigger(xn.toggleBlocksPanel,{isOpen:this.isOpen})}}const K3=()=>pn().blockManagerStore,Bv=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Z3=Bv+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Y3="["+Bv+"]["+Z3+"]*",X3=new RegExp("^"+Y3+"$");function zv(e,t){const n=[];let s=t.exec(e);for(;s;){const r=[];r.startIndex=t.lastIndex-s[0].length;const o=s.length;for(let i=0;i<o;i++)r.push(s[i]);n.push(r),s=t.exec(e)}return n}const Hc=function(e){const t=X3.exec(e);return!(t===null||typeof t>"u")};function J3(e){return typeof e<"u"}const Q3={allowBooleanAttributes:!1,unpairedTags:[]};function e_(e,t){t=Object.assign({},Q3,t);const n=[];let s=!1,r=!1;e[0]==="\uFEFF"&&(e=e.substr(1));for(let o=0;o<e.length;o++)if(e[o]==="<"&&e[o+1]==="?"){if(o+=2,o=mg(e,o),o.err)return o}else if(e[o]==="<"){let i=o;if(o++,e[o]==="!"){o=bg(e,o);continue}else{let a=!1;e[o]==="/"&&(a=!0,o++);let c="";for(;o<e.length&&e[o]!==">"&&e[o]!==" "&&e[o]!==" "&&e[o]!==`
48
+ `&&e[o]!=="\r";o++)c+=e[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!l_(c)){let p;return c.trim().length===0?p="Invalid space after '<'.":p="Tag '"+c+"' is an invalid name.",Ct("InvalidTag",p,Kt(e,o))}const u=s_(e,o);if(u===!1)return Ct("InvalidAttr","Attributes for '"+c+"' have open quote.",Kt(e,o));let d=u.value;if(o=u.index,d[d.length-1]==="/"){const p=o-d.length;d=d.substring(0,d.length-1);const h=vg(d,t);if(h===!0)s=!0;else return Ct(h.err.code,h.err.msg,Kt(e,p+h.err.line))}else if(a)if(u.tagClosed){if(d.trim().length>0)return Ct("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",Kt(e,i));if(n.length===0)return Ct("InvalidTag","Closing tag '"+c+"' has not been opened.",Kt(e,i));{const p=n.pop();if(c!==p.tagName){let h=Kt(e,p.tagStartPos);return Ct("InvalidTag","Expected closing tag '"+p.tagName+"' (opened in line "+h.line+", col "+h.col+") instead of closing tag '"+c+"'.",Kt(e,i))}n.length==0&&(r=!0)}}else return Ct("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",Kt(e,o));else{const p=vg(d,t);if(p!==!0)return Ct(p.err.code,p.err.msg,Kt(e,o-d.length+p.err.line));if(r===!0)return Ct("InvalidXml","Multiple possible root nodes found.",Kt(e,o));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:i}),s=!0}for(o++;o<e.length;o++)if(e[o]==="<")if(e[o+1]==="!"){o++,o=bg(e,o);continue}else if(e[o+1]==="?"){if(o=mg(e,++o),o.err)return o}else break;else if(e[o]==="&"){const p=i_(e,o);if(p==-1)return Ct("InvalidChar","char '&' is not expected.",Kt(e,o));o=p}else if(r===!0&&!gg(e[o]))return Ct("InvalidXml","Extra text at the end",Kt(e,o));e[o]==="<"&&o--}}else{if(gg(e[o]))continue;return Ct("InvalidChar","char '"+e[o]+"' is not expected.",Kt(e,o))}if(s){if(n.length==1)return Ct("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",Kt(e,n[0].tagStartPos));if(n.length>0)return Ct("InvalidXml","Invalid '"+JSON.stringify(n.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ct("InvalidXml","Start tag expected.",1);return!0}function gg(e){return e===" "||e===" "||e===`
49
+ `||e==="\r"}function mg(e,t){const n=t;for(;t<e.length;t++)if(e[t]=="?"||e[t]==" "){const s=e.substr(n,t-n);if(t>5&&s==="xml")return Ct("InvalidXml","XML declaration allowed only at the start of the document.",Kt(e,t));if(e[t]=="?"&&e[t+1]==">"){t++;break}else continue}return t}function bg(e,t){if(e.length>t+5&&e[t+1]==="-"&&e[t+2]==="-"){for(t+=3;t<e.length;t++)if(e[t]==="-"&&e[t+1]==="-"&&e[t+2]===">"){t+=2;break}}else if(e.length>t+8&&e[t+1]==="D"&&e[t+2]==="O"&&e[t+3]==="C"&&e[t+4]==="T"&&e[t+5]==="Y"&&e[t+6]==="P"&&e[t+7]==="E"){let n=1;for(t+=8;t<e.length;t++)if(e[t]==="<")n++;else if(e[t]===">"&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]==="["&&e[t+2]==="C"&&e[t+3]==="D"&&e[t+4]==="A"&&e[t+5]==="T"&&e[t+6]==="A"&&e[t+7]==="["){for(t+=8;t<e.length;t++)if(e[t]==="]"&&e[t+1]==="]"&&e[t+2]===">"){t+=2;break}}return t}const t_='"',n_="'";function s_(e,t){let n="",s="",r=!1;for(;t<e.length;t++){if(e[t]===t_||e[t]===n_)s===""?s=e[t]:s!==e[t]||(s="");else if(e[t]===">"&&s===""){r=!0;break}n+=e[t]}return s!==""?!1:{value:n,index:t,tagClosed:r}}const r_=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function vg(e,t){const n=zv(e,r_),s={};for(let r=0;r<n.length;r++){if(n[r][1].length===0)return Ct("InvalidAttr","Attribute '"+n[r][2]+"' has no space in starting.",Ei(n[r]));if(n[r][3]!==void 0&&n[r][4]===void 0)return Ct("InvalidAttr","Attribute '"+n[r][2]+"' is without value.",Ei(n[r]));if(n[r][3]===void 0&&!t.allowBooleanAttributes)return Ct("InvalidAttr","boolean attribute '"+n[r][2]+"' is not allowed.",Ei(n[r]));const o=n[r][2];if(!a_(o))return Ct("InvalidAttr","Attribute '"+o+"' is an invalid name.",Ei(n[r]));if(!s.hasOwnProperty(o))s[o]=1;else return Ct("InvalidAttr","Attribute '"+o+"' is repeated.",Ei(n[r]))}return!0}function o_(e,t){let n=/\d/;for(e[t]==="x"&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===";")return t;if(!e[t].match(n))break}return-1}function i_(e,t){if(t++,e[t]===";")return-1;if(e[t]==="#")return t++,o_(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===";")break;return-1}return t}function Ct(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function a_(e){return Hc(e)}function l_(e){return Hc(e)}function Kt(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function Ei(e){return e.startIndex+e[1].length}const c_={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},u_=function(e){return Object.assign({},c_,e)};let sc;typeof Symbol!="function"?sc="@@xmlMetadata":sc=Symbol("XML Node Metadata");class Yr{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,n){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:n})}addChild(t,n){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),n!==void 0&&(this.child[this.child.length-1][sc]={startIndex:n})}static getMetaDataSymbol(){return sc}}class d_{constructor(t){this.suppressValidationErr=!t}readDocType(t,n){const s={};if(t[n+3]==="O"&&t[n+4]==="C"&&t[n+5]==="T"&&t[n+6]==="Y"&&t[n+7]==="P"&&t[n+8]==="E"){n=n+9;let r=1,o=!1,i=!1,a="";for(;n<t.length;n++)if(t[n]==="<"&&!i){if(o&&Gr(t,"!ENTITY",n)){n+=7;let c,u;[c,u,n]=this.readEntityExp(t,n+1,this.suppressValidationErr),u.indexOf("&")===-1&&(s[c]={regx:RegExp(`&${c};`,"g"),val:u})}else if(o&&Gr(t,"!ELEMENT",n)){n+=8;const{index:c}=this.readElementExp(t,n+1);n=c}else if(o&&Gr(t,"!ATTLIST",n))n+=8;else if(o&&Gr(t,"!NOTATION",n)){n+=9;const{index:c}=this.readNotationExp(t,n+1,this.suppressValidationErr);n=c}else if(Gr(t,"!--",n))i=!0;else throw new Error("Invalid DOCTYPE");r++,a=""}else if(t[n]===">"){if(i?t[n-1]==="-"&&t[n-2]==="-"&&(i=!1,r--):r--,r===0)break}else t[n]==="["?o=!0:a+=t[n];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:s,i:n}}readEntityExp(t,n){n=sn(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n])&&t[n]!=='"'&&t[n]!=="'";)s+=t[n],n++;if(Pi(s),n=sn(t,n),!this.suppressValidationErr){if(t.substring(n,n+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(t[n]==="%")throw new Error("Parameter entities are not supported")}let r="";return[n,r]=this.readIdentifierVal(t,n,"entity"),n--,[s,r,n]}readNotationExp(t,n){n=sn(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;!this.suppressValidationErr&&Pi(s),n=sn(t,n);const r=t.substring(n,n+6).toUpperCase();if(!this.suppressValidationErr&&r!=="SYSTEM"&&r!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${r}"`);n+=r.length,n=sn(t,n);let o=null,i=null;if(r==="PUBLIC")[n,o]=this.readIdentifierVal(t,n,"publicIdentifier"),n=sn(t,n),(t[n]==='"'||t[n]==="'")&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"));else if(r==="SYSTEM"&&([n,i]=this.readIdentifierVal(t,n,"systemIdentifier"),!this.suppressValidationErr&&!i))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:s,publicIdentifier:o,systemIdentifier:i,index:--n}}readIdentifierVal(t,n,s){let r="";const o=t[n];if(o!=='"'&&o!=="'")throw new Error(`Expected quoted string, found "${o}"`);for(n++;n<t.length&&t[n]!==o;)r+=t[n],n++;if(t[n]!==o)throw new Error(`Unterminated ${s} value`);return n++,[n,r]}readElementExp(t,n){n=sn(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;if(!this.suppressValidationErr&&!Hc(s))throw new Error(`Invalid element name: "${s}"`);n=sn(t,n);let r="";if(t[n]==="E"&&Gr(t,"MPTY",n))n+=4;else if(t[n]==="A"&&Gr(t,"NY",n))n+=2;else if(t[n]==="("){for(n++;n<t.length&&t[n]!==")";)r+=t[n],n++;if(t[n]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[n]}"`);return{elementName:s,contentModel:r.trim(),index:n}}readAttlistExp(t,n){n=sn(t,n);let s="";for(;n<t.length&&!/\s/.test(t[n]);)s+=t[n],n++;Pi(s),n=sn(t,n);let r="";for(;n<t.length&&!/\s/.test(t[n]);)r+=t[n],n++;if(!Pi(r))throw new Error(`Invalid attribute name: "${r}"`);n=sn(t,n);let o="";if(t.substring(n,n+8).toUpperCase()==="NOTATION"){if(o="NOTATION",n+=8,n=sn(t,n),t[n]!=="(")throw new Error(`Expected '(', found "${t[n]}"`);n++;let a=[];for(;n<t.length&&t[n]!==")";){let c="";for(;n<t.length&&t[n]!=="|"&&t[n]!==")";)c+=t[n],n++;if(c=c.trim(),!Pi(c))throw new Error(`Invalid notation name: "${c}"`);a.push(c),t[n]==="|"&&(n++,n=sn(t,n))}if(t[n]!==")")throw new Error("Unterminated list of notations");n++,o+=" ("+a.join("|")+")"}else{for(;n<t.length&&!/\s/.test(t[n]);)o+=t[n],n++;const a=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!a.includes(o.toUpperCase()))throw new Error(`Invalid attribute type: "${o}"`)}n=sn(t,n);let i="";return t.substring(n,n+8).toUpperCase()==="#REQUIRED"?(i="#REQUIRED",n+=8):t.substring(n,n+7).toUpperCase()==="#IMPLIED"?(i="#IMPLIED",n+=7):[n,i]=this.readIdentifierVal(t,n,"ATTLIST"),{elementName:s,attributeName:r,attributeType:o,defaultValue:i,index:n}}}const sn=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Gr(e,t,n){for(let s=0;s<t.length;s++)if(t[s]!==e[n+s+1])return!1;return!0}function Pi(e){if(Hc(e))return e;throw new Error(`Invalid entity name ${e}`)}const p_=/^[-+]?0x[a-fA-F0-9]+$/,f_=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,h_={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function g_(e,t={}){if(t=Object.assign({},h_,t),!e||typeof e!="string")return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e==="0")return 0;if(t.hex&&p_.test(n))return y_(n,16);if(n.search(/.+[eE].+/)!==-1)return b_(e,n,t);{const s=f_.exec(n);if(s){const r=s[1]||"",o=s[2];let i=v_(s[3]);const a=r?e[o.length+1]===".":e[o.length]===".";if(!t.leadingZeros&&(o.length>1||o.length===1&&!a))return e;{const c=Number(n),u=String(c);if(c===0)return c;if(u.search(/[eE]/)!==-1)return t.eNotation?c:e;if(n.indexOf(".")!==-1)return u==="0"||u===i||u===`${r}${i}`?c:e;let d=o?i:n;return o?d===u||r+d===u?c:e:d===u||d===r+u?c:e}}else return e}}const m_=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function b_(e,t,n){if(!n.eNotation)return e;const s=t.match(m_);if(s){let r=s[1]||"";const o=s[3].indexOf("e")===-1?"E":"e",i=s[2],a=r?e[i.length+1]===o:e[i.length]===o;return i.length>1&&a?e:i.length===1&&(s[3].startsWith(`.${o}`)||s[3][0]===o)?Number(t):n.leadingZeros&&!a?(t=(s[1]||"")+s[3],Number(t)):e}else return e}function v_(e){return e&&e.indexOf(".")!==-1&&(e=e.replace(/0+$/,""),e==="."?e="0":e[0]==="."?e="0"+e:e[e.length-1]==="."&&(e=e.substring(0,e.length-1))),e}function y_(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function Uv(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const n of e)if(typeof n=="string"&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}class x_{constructor(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(n,s)=>String.fromCodePoint(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(n,s)=>String.fromCodePoint(Number.parseInt(s,16))}},this.addExternalEntities=w_,this.parseXml=P_,this.parseTextData=S_,this.resolveNameSpace=C_,this.buildAttributesMap=E_,this.isItStopNode=A_,this.replaceEntitiesValue=O_,this.readStopNodeData=L_,this.saveTextToParentTag=__,this.addChild=T_,this.ignoreAttributesFn=Uv(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let n=0;n<this.options.stopNodes.length;n++){const s=this.options.stopNodes[n];typeof s=="string"&&(s.startsWith("*.")?this.stopNodesWildcard.add(s.substring(2)):this.stopNodesExact.add(s))}}}}function w_(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];this.lastEntities[s]={regex:new RegExp("&"+s+";","g"),val:e[s]}}}function S_(e,t,n,s,r,o,i){if(e!==void 0&&(this.options.trimValues&&!s&&(e=e.trim()),e.length>0)){i||(e=this.replaceEntitiesValue(e));const a=this.options.tagValueProcessor(t,e,n,r,o);return a==null?e:typeof a!=typeof e||a!==e?a:this.options.trimValues?qd(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?qd(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function C_(e){if(this.options.removeNSPrefix){const t=e.split(":"),n=e.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(e=n+t[1])}return e}const j_=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function E_(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e=="string"){const s=zv(e,j_),r=s.length,o={};for(let i=0;i<r;i++){const a=this.resolveNameSpace(s[i][1]);if(this.ignoreAttributesFn(a,t))continue;let c=s[i][4],u=this.options.attributeNamePrefix+a;if(a.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),u==="__proto__"&&(u="#__proto__"),c!==void 0){this.options.trimValues&&(c=c.trim()),c=this.replaceEntitiesValue(c);const d=this.options.attributeValueProcessor(a,c,t);d==null?o[u]=c:typeof d!=typeof c||d!==c?o[u]=d:o[u]=qd(c,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[u]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){const i={};return i[this.options.attributesGroupName]=o,i}return o}}const P_=function(e){e=e.replace(/\r\n?/g,`
50
+ `);const t=new Yr("!xml");let n=t,s="",r="";const o=new d_(this.options.processEntities);for(let i=0;i<e.length;i++)if(e[i]==="<")if(e[i+1]==="/"){const c=Jr(e,">",i,"Closing Tag is not closed.");let u=e.substring(i+2,c).trim();if(this.options.removeNSPrefix){const h=u.indexOf(":");h!==-1&&(u=u.substr(h+1))}this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&(s=this.saveTextToParentTag(s,n,r));const d=r.substring(r.lastIndexOf(".")+1);if(u&&this.options.unpairedTags.indexOf(u)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${u}>`);let p=0;d&&this.options.unpairedTags.indexOf(d)!==-1?(p=r.lastIndexOf(".",r.lastIndexOf(".")-1),this.tagsNodeStack.pop()):p=r.lastIndexOf("."),r=r.substring(0,p),n=this.tagsNodeStack.pop(),s="",i=c}else if(e[i+1]==="?"){let c=Gd(e,i,!1,"?>");if(!c)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,n,r),!(this.options.ignoreDeclaration&&c.tagName==="?xml"||this.options.ignorePiTags)){const u=new Yr(c.tagName);u.add(this.options.textNodeName,""),c.tagName!==c.tagExp&&c.attrExpPresent&&(u[":@"]=this.buildAttributesMap(c.tagExp,r,c.tagName)),this.addChild(n,u,r,i)}i=c.closeIndex+1}else if(e.substr(i+1,3)==="!--"){const c=Jr(e,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){const u=e.substring(i+4,c-2);s=this.saveTextToParentTag(s,n,r),n.add(this.options.commentPropName,[{[this.options.textNodeName]:u}])}i=c}else if(e.substr(i+1,2)==="!D"){const c=o.readDocType(e,i);this.docTypeEntities=c.entities,i=c.i}else if(e.substr(i+1,2)==="!["){const c=Jr(e,"]]>",i,"CDATA is not closed.")-2,u=e.substring(i+9,c);s=this.saveTextToParentTag(s,n,r);let d=this.parseTextData(u,n.tagname,r,!0,!1,!0,!0);d==null&&(d=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:u}]):n.add(this.options.textNodeName,d),i=c+2}else{let c=Gd(e,i,this.options.removeNSPrefix),u=c.tagName;const d=c.rawTagName;let p=c.tagExp,h=c.attrExpPresent,g=c.closeIndex;this.options.transformTagName&&(u=this.options.transformTagName(u)),n&&s&&n.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,n,r,!1));const m=n;m&&this.options.unpairedTags.indexOf(m.tagname)!==-1&&(n=this.tagsNodeStack.pop(),r=r.substring(0,r.lastIndexOf("."))),u!==t.tagname&&(r+=r?"."+u:u);const b=i;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,r,u)){let v="";if(p.length>0&&p.lastIndexOf("/")===p.length-1)u[u.length-1]==="/"?(u=u.substr(0,u.length-1),r=r.substr(0,r.length-1),p=u):p=p.substr(0,p.length-1),i=c.closeIndex;else if(this.options.unpairedTags.indexOf(u)!==-1)i=c.closeIndex;else{const y=this.readStopNodeData(e,d,g+1);if(!y)throw new Error(`Unexpected end of ${d}`);i=y.i,v=y.tagContent}const x=new Yr(u);u!==p&&h&&(x[":@"]=this.buildAttributesMap(p,r,u)),v&&(v=this.parseTextData(v,u,r,!0,h,!0,!0)),r=r.substr(0,r.lastIndexOf(".")),x.add(this.options.textNodeName,v),this.addChild(n,x,r,b)}else{if(p.length>0&&p.lastIndexOf("/")===p.length-1){u[u.length-1]==="/"?(u=u.substr(0,u.length-1),r=r.substr(0,r.length-1),p=u):p=p.substr(0,p.length-1),this.options.transformTagName&&(u=this.options.transformTagName(u));const v=new Yr(u);u!==p&&h&&(v[":@"]=this.buildAttributesMap(p,r,u)),this.addChild(n,v,r,b),r=r.substr(0,r.lastIndexOf("."))}else{const v=new Yr(u);this.tagsNodeStack.push(n),u!==p&&h&&(v[":@"]=this.buildAttributesMap(p,r,u)),this.addChild(n,v,r,b),n=v}s="",i=g}}else s+=e[i];return t.child};function T_(e,t,n,s){this.options.captureMetaData||(s=void 0);const r=this.options.updateTag(t.tagname,n,t[":@"]);r===!1||(typeof r=="string"&&(t.tagname=r),e.addChild(t,s))}const O_=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){const n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function __(e,t,n,s){return e&&(s===void 0&&(s=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),e!==void 0&&e!==""&&t.add(this.options.textNodeName,e),e=""),e}function A_(e,t,n,s){return!!(t&&t.has(s)||e&&e.has(n))}function M_(e,t,n=">"){let s,r="";for(let o=t;o<e.length;o++){let i=e[o];if(s)i===s&&(s="");else if(i==='"'||i==="'")s=i;else if(i===n[0])if(n[1]){if(e[o+1]===n[1])return{data:r,index:o}}else return{data:r,index:o};else i===" "&&(i=" ");r+=i}}function Jr(e,t,n,s){const r=e.indexOf(t,n);if(r===-1)throw new Error(s);return r+t.length-1}function Gd(e,t,n,s=">"){const r=M_(e,t+1,s);if(!r)return;let o=r.data;const i=r.index,a=o.search(/\s/);let c=o,u=!0;a!==-1&&(c=o.substring(0,a),o=o.substring(a+1).trimStart());const d=c;if(n){const p=c.indexOf(":");p!==-1&&(c=c.substr(p+1),u=c!==r.data.substr(p+1))}return{tagName:c,tagExp:o,closeIndex:i,attrExpPresent:u,rawTagName:d}}function L_(e,t,n){const s=n;let r=1;for(;n<e.length;n++)if(e[n]==="<")if(e[n+1]==="/"){const o=Jr(e,">",n,`${t} is not closed`);if(e.substring(n+2,o).trim()===t&&(r--,r===0))return{tagContent:e.substring(s,n),i:o};n=o}else if(e[n+1]==="?")n=Jr(e,"?>",n+1,"StopNode is not closed.");else if(e.substr(n+1,3)==="!--")n=Jr(e,"-->",n+3,"StopNode is not closed.");else if(e.substr(n+1,2)==="![")n=Jr(e,"]]>",n,"StopNode is not closed.")-2;else{const o=Gd(e,n,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&r++,n=o.closeIndex)}}function qd(e,t,n){if(t&&typeof e=="string"){const s=e.trim();return s==="true"?!0:s==="false"?!1:g_(e,n)}else return J3(e)?e:""}const $u=Yr.getMetaDataSymbol();function N_(e,t){return Wv(e,t)}function Wv(e,t,n){let s;const r={};for(let o=0;o<e.length;o++){const i=e[o],a=$_(i);let c="";if(n===void 0?c=a:c=n+"."+a,a===t.textNodeName)s===void 0?s=i[a]:s+=""+i[a];else{if(a===void 0)continue;if(i[a]){let u=Wv(i[a],t,c);const d=R_(u,t);i[$u]!==void 0&&(u[$u]=i[$u]),i[":@"]?k_(u,i[":@"],c,t):Object.keys(u).length===1&&u[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?u=u[t.textNodeName]:Object.keys(u).length===0&&(t.alwaysCreateTextNode?u[t.textNodeName]="":u=""),r[a]!==void 0&&r.hasOwnProperty(a)?(Array.isArray(r[a])||(r[a]=[r[a]]),r[a].push(u)):t.isArray(a,c,d)?r[a]=[u]:r[a]=u}}}return typeof s=="string"?s.length>0&&(r[t.textNodeName]=s):s!==void 0&&(r[t.textNodeName]=s),r}function $_(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];if(s!==":@")return s}}function k_(e,t,n,s){if(t){const r=Object.keys(t),o=r.length;for(let i=0;i<o;i++){const a=r[i];s.isArray(a,n+"."+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function R_(e,t){const{textNodeName:n}=t,s=Object.keys(e).length;return!!(s===0||s===1&&(e[n]||typeof e[n]=="boolean"||e[n]===0))}class I_{constructor(t){this.externalEntities={},this.options=u_(t)}parse(t,n){if(typeof t!="string"&&t.toString)t=t.toString();else if(typeof t!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});const o=e_(t,n);if(o!==!0)throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`)}const s=new x_(this.options);s.addExternalEntities(this.externalEntities);const r=s.parseXml(t);return this.options.preserveOrder||r===void 0?r:N_(r,this.options)}addEntity(t,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=n}static getMetaDataSymbol(){return Yr.getMetaDataSymbol()}}const V_=`
51
+ `;function H_(e,t){let n="";return t.format&&t.indentBy.length>0&&(n=V_),Gv(e,t,"",n)}function Gv(e,t,n,s){let r="",o=!1;for(let i=0;i<e.length;i++){const a=e[i],c=D_(a);if(c===void 0)continue;let u="";if(n.length===0?u=c:u=`${n}.${c}`,c===t.textNodeName){let m=a[c];F_(u,t)||(m=t.tagValueProcessor(c,m),m=qv(m,t)),o&&(r+=s),r+=m,o=!1;continue}else if(c===t.cdataPropName){o&&(r+=s),r+=`<![CDATA[${a[c][0][t.textNodeName]}]]>`,o=!1;continue}else if(c===t.commentPropName){r+=s+`<!--${a[c][0][t.textNodeName]}-->`,o=!0;continue}else if(c[0]==="?"){const m=yg(a[":@"],t),b=c==="?xml"?"":s;let v=a[c][0][t.textNodeName];v=v.length!==0?" "+v:"",r+=b+`<${c}${v}${m}?>`,o=!0;continue}let d=s;d!==""&&(d+=t.indentBy);const p=yg(a[":@"],t),h=s+`<${c}${p}`,g=Gv(a[c],t,u,d);t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?r+=h+">":r+=h+"/>":(!g||g.length===0)&&t.suppressEmptyNode?r+=h+"/>":g&&g.endsWith(">")?r+=h+`>${g}${s}</${c}>`:(r+=h+">",g&&s!==""&&(g.includes("/>")||g.includes("</"))?r+=s+t.indentBy+g+s:r+=g,r+=`</${c}>`),o=!0}return r}function D_(e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const s=t[n];if(e.hasOwnProperty(s)&&s!==":@")return s}}function yg(e,t){let n="";if(e&&!t.ignoreAttributes)for(let s in e){if(!e.hasOwnProperty(s))continue;let r=t.attributeValueProcessor(s,e[s]);r=qv(r,t),r===!0&&t.suppressBooleanAttributes?n+=` ${s.substr(t.attributeNamePrefix.length)}`:n+=` ${s.substr(t.attributeNamePrefix.length)}="${r}"`}return n}function F_(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let n=e.substr(e.lastIndexOf(".")+1);for(let s in t.stopNodes)if(t.stopNodes[s]===e||t.stopNodes[s]==="*."+n)return!0;return!1}function qv(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){const s=t.entities[n];e=e.replace(s.regex,s.val)}return e}const B_={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Ir(e){this.options=Object.assign({},B_,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Uv(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=W_),this.processTextOrObjNode=z_,this.options.format?(this.indentate=U_,this.tagEndChar=`>
106
52
  `,this.newLine=`
107
- `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Gr.prototype.build=function(e){return this.options.preserveOrder?RN(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)};Gr.prototype.j2x=function(e,t,n){let s="",r="";const o=n.join(".");for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(typeof e[i]>"u")this.isAttribute(i)&&(r+="");else if(e[i]===null)this.isAttribute(i)||i===this.options.cdataPropName?r+="":i[0]==="?"?r+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)r+=this.buildTextValNode(e[i],i,"",t);else if(typeof e[i]!="object"){const a=this.isAttribute(i);if(a&&!this.ignoreAttributesFn(a,o))s+=this.buildAttrPairStr(a,""+e[i]);else if(!a)if(i===this.options.textNodeName){let l=this.options.tagValueProcessor(i,""+e[i]);r+=this.replaceEntitiesValue(l)}else r+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){const a=e[i].length;let l="",u="";for(let d=0;d<a;d++){const f=e[i][d];if(!(typeof f>"u"))if(f===null)i[0]==="?"?r+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(typeof f=="object")if(this.options.oneListGroup){const p=this.j2x(f,t+1,n.concat(i));l+=p.val,this.options.attributesGroupName&&f.hasOwnProperty(this.options.attributesGroupName)&&(u+=p.attrStr)}else l+=this.processTextOrObjNode(f,i,t,n);else if(this.options.oneListGroup){let p=this.options.tagValueProcessor(i,f);p=this.replaceEntitiesValue(p),l+=p}else l+=this.buildTextValNode(f,i,"",t)}this.options.oneListGroup&&(l=this.buildObjectNode(l,i,u,t)),r+=l}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const a=Object.keys(e[i]),l=a.length;for(let u=0;u<l;u++)s+=this.buildAttrPairStr(a[u],""+e[i][a[u]])}else r+=this.processTextOrObjNode(e[i],i,t,n);return{attrStr:s,val:r}};Gr.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function IN(e,t,n,s){const r=this.j2x(e,n+1,s.concat(t));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,r.attrStr,n):this.buildObjectNode(r.val,t,r.attrStr,n)}Gr.prototype.buildObjectNode=function(e,t,n,s){if(e==="")return t[0]==="?"?this.indentate(s)+"<"+t+n+"?"+this.tagEndChar:this.indentate(s)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let r="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",r=""),(n||n==="")&&e.indexOf("<")===-1?this.indentate(s)+"<"+t+n+o+">"+e+r:this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(s)+`<!--${e}-->`+this.newLine:this.indentate(s)+"<"+t+n+o+this.tagEndChar+e+this.indentate(s)+r}};Gr.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};Gr.prototype.buildTextValNode=function(e,t,n,s){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(s)+"<"+t+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(t,e);return r=this.replaceEntitiesValue(r),r===""?this.indentate(s)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(s)+"<"+t+n+">"+r+"</"+t+this.tagEndChar}};Gr.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};function DN(e){return this.options.indentBy.repeat(e)}function HN(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}const tu="mjml-code-to-html";function A0(e,t){const n=t==null?void 0:t.sanitizer;if(Ye(n))return n(e);if(n==="xml-sanitizer"){const f=e.replace(/(<[a-zA-Z!/])|</g,(j,E)=>E??"&lt;").replace(/&(?!#?\w+;)/g,"&amp;"),p=["br","hr"],g=new Set(p),m=j=>{const E=[];for(const _ of j){const T=Object.keys(_).find(P=>P!==":@");if(T&&g.has(T)){const P=_[T];Array.isArray(P)&&P.length>0?(E.push({..._,[T]:[]}),E.push(...m(P))):E.push(_)}else T&&Array.isArray(_[T])?E.push({..._,[T]:m(_[T])}):E.push(_)}return E},b={commentPropName:"#comment",unpairedTags:p,suppressUnpairedNode:!1,ignoreAttributes:!1,preserveOrder:!0},v=new MN({...b,htmlEntities:!0,trimValues:!1,alwaysCreateTextNode:!0,allowBooleanAttributes:!0}),x=new Gr({...b}),w=v.parse(`<root>${f}</root>`)[0].root,S=m(w);return x.build(S)}function s(f){const p=document.createElement("textarea");return p.innerHTML=f,p.value}const r=s(e||""),o=["checked","disabled","readonly","required","autofocus","multiple","selected","hidden","async","defer","formnovalidate","novalidate","ismap","allowfullscreen","autoplay","controls","loop","muted","open","reversed","scoped","seamless","typemustmatch","default","full-width","crossorigin"],i={crossorigin:"anonymous","full-width":"true"},a=new RegExp(`\\s+(${o.join("|")})(?=\\s|\\/?>)`,"gi");return r.replace(/<[^>]+>/g,f=>f.replace(a,(p,g)=>{const m=i[g]??g;return` ${g}="${m}"`})).replace(/(\s[\w:-]+=\s*)("[^"]*"|'[^']*')/g,(f,p,g)=>{const m=g.slice(1,-1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;");return`${p}"${m}"`}).replace(/&(?!#?\w+;)/g,(f,p,g)=>p>0&&g[p-1]==="&"?f:"&amp;").replace(/(<[a-zA-Z!/])|</g,(f,p)=>p??"&lt;")}var ya=(e=>(e.root="mjml",e.head="mj-head",e.body="mj-body",e.include="mj-include",e))(ya||{}),Up=(e=>(e.attributes="mj-attributes",e.breakpoint="mj-breakpoint",e.font="mj-font",e.htmlAttributes="mj-html-attributes",e.preview="mj-preview",e.style="mj-style",e.title="mj-title",e.class="mj-class",e.all="mj-all",e))(Up||{}),wr=(e=>(e.accordion="mj-accordion",e.accordionElement="mj-accordion-element",e.accordionTitle="mj-accordion-title",e.accordionText="mj-accordion-text",e.button="mj-button",e.carousel="mj-carousel",e.carouselImage="mj-carousel-image",e.column="mj-column",e.divider="mj-divider",e.group="mj-group",e.hero="mj-hero",e.image="mj-image",e.navbar="mj-navbar",e.navbarLink="mj-navbar-link",e.raw="mj-raw",e.section="mj-section",e.social="mj-social",e.socialElement="mj-social-element",e.spacer="mj-spacer",e.table="mj-table",e.text="mj-text",e.wrapper="mj-wrapper",e))(wr||{}),ko=(e=>(e.globalStyles="globalStyles",e.globalData="globalData",e))(ko||{});function FN(e){const t=new Map,n={items:[]};return e.forEach(r=>{const{category:o,item:i}=r;if(o){const a=t.get(o.id);a?(a.items.push(i),a.category={...a.category,...o}):t.set(o.id,{category:o,items:[i]})}else n.items.push(i)}),[...Array.from(t).map(([,r])=>r),n].filter(r=>r.items.length)}const N0=e=>(e==null?void 0:e.get("groups"))||[],M0=(e,t)=>N0(e).includes(t),BN=(e,t)=>{M0(e,t)||e.set("groups",[...N0(e),t])};class zN{constructor(t){this.dataSourceKeyid=ko.globalStyles,this.records=[],this.openCategories=new Map,this.store=t,on(this,{openCategories:!1},{autoBind:!0})}get sdkOptionStyles(){var t;return((t=this.store.appEditorStore.sdkOptions.globalStyles)==null?void 0:t.default)||[]}get editor(){return this.store.appEditorStore.editor}get DataSources(){var t;return(t=this.editor)==null?void 0:t.DataSources}get recordsByCategory(){const{records:t,sdkOptionStyles:n}=this,s=[],r=t.reduce((o,i)=>(o.set(i.get("id"),i),o),new Map);return n.forEach(({id:o})=>{const i=r.get(o);i&&(s.push(i),r.delete(o))}),Array.from(r).map(([,o])=>{o.get("_internal")||s.push(o)}),FN(s.map(o=>({category:o.get("category"),item:o})))}setCategoryOpen(t,n){this.openCategories.set(t,n)}getDataSource(){var t;return(t=this.DataSources)==null?void 0:t.get(this.dataSourceKeyid)}getRuleByGroup(t){var n;return(n=this.editor)==null?void 0:n.CssComposer.getAll().find(s=>M0(s,t))}addStyleRule(t,n={}){var f,p;const{editor:s}=this,r=t.get("id"),o=t.get("selector")||"",i=t.get("property"),a=t.getPath("value"),l=`${this.dataSourceKeyid}:${r}`,u={[i]:{type:"data-variable",path:a,defaultValue:t.get("defaultValue")}};if(s&&Tw(s)&&o.startsWith("mj-")){const g=s.Components.getWrapper(),{head:m}=ya,{attributes:b}=Up,v=g.findFirstType(ya.root),x=v.findFirstType(m)||v.append({type:m},{at:0})[0],y=x.findFirstType(b)||x.append({type:b})[0],w=y.findType(o).pop()||y.append({type:o})[0],S=(w.get("attributes")||{})[i];Lt(S)&&S!==""&&t.set("value",S),w.addAttributes(u,{silent:!0});return}let d=((p=(f=n.selectorToRuleMap)==null?void 0:f.get(o))==null?void 0:p.rule)||this.getRuleByGroup(l);d?d.addStyle(u):d=s==null?void 0:s.CssComposer.addCollection([{selectors:[],selectorsAdd:o,style:u}],{extend:!0,at:t.index})[0],d&&BN(d,l)}createDataSource(){return this.DataSources.add({id:this.dataSourceKeyid,records:[]})}onLoad(){var o,i;const{sdkOptionStyles:t}=this,n=new Map,s=(o=this.editor)==null?void 0:o.Css;if(!t.length){this.records=[];return}const r=this.getDataSource()||this.createDataSource();t.forEach(a=>{const{id:l,selector:u,label:d,field:f,property:p,category:g}=a,m=r.getRecord(l);if(m){const b={label:d,field:f,category:g};m.set({...b,_undo:!0})}else{const b=n.get(u),v=(b==null?void 0:b.rule)||(s==null?void 0:s.getRule(u)),x=(b==null?void 0:b.styles)||(v==null?void 0:v.getStyle())||{},y=x[p]||a.defaultValue;n.set(u,{rule:v,styles:x}),r.addRecord({value:void 0,...a,defaultValue:y,_internal:!0,_undo:!0})}}),r.getRecords().forEach(a=>{this.addStyleRule(a,{selectorToRuleMap:n})}),r.listenTo(r.records,"add",a=>{this.addStyleRule(a)}),(i=this.editor)==null||i.UndoManager.add(r.records),this.records=r.getRecords()}}const UN=()=>bn().globalStylesStore,WN=(e,t)=>{let n;try{const s=Vs()&&e&&localStorage.getItem(e);s&&(n=JSON.parse(s))}catch(s){console.error(s)}return{lastProjectId:"",...t,...n}},Qg=(e,t)=>{const s={...WN(e),...t};try{Vs()&&e&&localStorage.setItem(e,JSON.stringify(s))}catch(r){console.error(r)}return s},em="gs-utl-dark",GN=()=>Vs()&&window.matchMedia("(prefers-color-scheme: dark)").matches,L0=e=>e==="dark"||e==="auto"&&GN(),tm=(e,t)=>{if(e&&Vs()&&t.rootEl){const{classList:n}=t.rootEl;let s=!1;if(L0(e)?(n.add(em),s=!0):n.remove(em),t.updateAppShell){const r=document.head.querySelector('meta[name="theme-color"]');r&&(r.content=s?"#18181b":"#ffffff")}t.resolvedTheme=s?Nr.dark:Nr.light}};class qN{constructor(t){this.key="",this.theme=Nr.auto,this.resolvedTheme=Nr.light,this.lastProjectId="",this.updateAppShell=!1,this.rootEl=void 0,t&&Object.keys(t).forEach(n=>{const s=n,r=t[s];r!==void 0&&(this[s]=r)}),this.resolvedTheme=this.theme,on(this,{},{autoBind:!0}),this.init()}init(){tm(this.theme,this)}changeTheme(t){tm(t,this),Qg(this.key,{theme:t})}setTheme(t){this.theme=t}setRootEl(t){this.rootEl=t}setLocalState(t){Object.keys(t).forEach(n=>{const s=n,r=t[s];r!==void 0&&(this[s]=r)}),Qg(this.key,t)}get isDarkTheme(){return L0(this.theme)}}const Ds=()=>bn().localSettingsStore;class KN{constructor(t){this.isOpen=!1,this.title="",this.content="",this.size="l",this.fullH=!1,this.modalProps={},this.buttons=[],this.store=t,on(this,{},{autoBind:!0})}setModalProps(t){this.modalProps={title:"",size:"l",fullH:!1,buttons:[],...t}}open({content:t,...n}){this.isOpen=!0,this.content=t,this.setModalProps(n)}close(){this.isOpen=!1,setTimeout(this.clear,101)}clear(){this.content="",this.setModalProps({size:this.modalProps.size})}confirm({content:t,size:n="m",onConfirm:s,confirmButton:r,...o}){this.isOpen=!0,this.content=t;const i=()=>{s==null||s(),this.close()};this.setModalProps({...o,size:n,buttons:[{children:"Cancel",onClick:this.close,size:"m2"},{children:"Confirm",onClick:i,size:"m2",variant:"pr",...r}]})}}const ji=()=>bn().modalStore,nm="column1",sm="column2",rm="column3",gf="column3-7",YN=function(e,t={}){const{Components:n,Blocks:s}=e,r="gridRow",o="gridColumn",i="gjs-grid-row",a="gjs-grid-column",l={tl:0,tc:0,tr:0,cl:0,bl:0,br:0},u="flex-basis",d=1,f=1,p=1;n.addType(r,{isComponent:v=>Ir(v,i),model:{defaults:{emptyState:!0,droppable:Cs(o),highlightable:!1,attributes:{class:i},resizable:{...l,keyHeight:"min-height"},icon:`
53
+ `):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Ir.prototype.build=function(e){return this.options.preserveOrder?H_(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)};Ir.prototype.j2x=function(e,t,n){let s="",r="";const o=n.join(".");for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(typeof e[i]>"u")this.isAttribute(i)&&(r+="");else if(e[i]===null)this.isAttribute(i)||i===this.options.cdataPropName?r+="":i[0]==="?"?r+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)r+=this.buildTextValNode(e[i],i,"",t);else if(typeof e[i]!="object"){const a=this.isAttribute(i);if(a&&!this.ignoreAttributesFn(a,o))s+=this.buildAttrPairStr(a,""+e[i]);else if(!a)if(i===this.options.textNodeName){let c=this.options.tagValueProcessor(i,""+e[i]);r+=this.replaceEntitiesValue(c)}else r+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){const a=e[i].length;let c="",u="";for(let d=0;d<a;d++){const p=e[i][d];if(!(typeof p>"u"))if(p===null)i[0]==="?"?r+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:r+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(typeof p=="object")if(this.options.oneListGroup){const h=this.j2x(p,t+1,n.concat(i));c+=h.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(u+=h.attrStr)}else c+=this.processTextOrObjNode(p,i,t,n);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(i,p);h=this.replaceEntitiesValue(h),c+=h}else c+=this.buildTextValNode(p,i,"",t)}this.options.oneListGroup&&(c=this.buildObjectNode(c,i,u,t)),r+=c}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const a=Object.keys(e[i]),c=a.length;for(let u=0;u<c;u++)s+=this.buildAttrPairStr(a[u],""+e[i][a[u]])}else r+=this.processTextOrObjNode(e[i],i,t,n);return{attrStr:s,val:r}};Ir.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function z_(e,t,n,s){const r=this.j2x(e,n+1,s.concat(t));return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,r.attrStr,n):this.buildObjectNode(r.val,t,r.attrStr,n)}Ir.prototype.buildObjectNode=function(e,t,n,s){if(e==="")return t[0]==="?"?this.indentate(s)+"<"+t+n+"?"+this.tagEndChar:this.indentate(s)+"<"+t+n+this.closeTag(t)+this.tagEndChar;{let r="</"+t+this.tagEndChar,o="";return t[0]==="?"&&(o="?",r=""),(n||n==="")&&e.indexOf("<")===-1?this.indentate(s)+"<"+t+n+o+">"+e+r:this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(s)+`<!--${e}-->`+this.newLine:this.indentate(s)+"<"+t+n+o+this.tagEndChar+e+this.indentate(s)+r}};Ir.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};Ir.prototype.buildTextValNode=function(e,t,n,s){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(s)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(s)+"<"+t+n+"?"+this.tagEndChar;{let r=this.options.tagValueProcessor(t,e);return r=this.replaceEntitiesValue(r),r===""?this.indentate(s)+"<"+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(s)+"<"+t+n+">"+r+"</"+t+this.tagEndChar}};Ir.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};function U_(e){return this.options.indentBy.repeat(e)}function W_(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}const Dc="mjml-code-to-html";function Kv(e,t){const n=t==null?void 0:t.sanitizer;if(Ke(n))return n(e);if(n==="xml-sanitizer"){const p=e.replace(/(<[a-zA-Z!/])|</g,(j,E)=>E??"&lt;").replace(/&(?!#?\w+;)/g,"&amp;"),h=["br","hr"],g=new Set(h),m=j=>{const E=[];for(const T of j){const O=Object.keys(T).find(P=>P!==":@");if(O&&g.has(O)){const P=T[O];Array.isArray(P)&&P.length>0?(E.push({...T,[O]:[]}),E.push(...m(P))):E.push(T)}else O&&Array.isArray(T[O])?E.push({...T,[O]:m(T[O])}):E.push(T)}return E},b={commentPropName:"#comment",unpairedTags:h,suppressUnpairedNode:!1,ignoreAttributes:!1,preserveOrder:!0},v=new I_({...b,htmlEntities:!0,trimValues:!1,alwaysCreateTextNode:!0,allowBooleanAttributes:!0}),x=new Ir({...b}),w=v.parse(`<root>${p}</root>`)[0].root,S=m(w);return x.build(S)}function s(p){const h=document.createElement("textarea");return h.innerHTML=p,h.value}const r=s(e||""),o=["checked","disabled","readonly","required","autofocus","multiple","selected","hidden","async","defer","formnovalidate","novalidate","ismap","allowfullscreen","autoplay","controls","loop","muted","open","reversed","scoped","seamless","typemustmatch","default","full-width","crossorigin"],i={crossorigin:"anonymous","full-width":"true"},a=new RegExp(`\\s+(${o.join("|")})(?=\\s|\\/?>)`,"gi");return r.replace(/<[^>]+>/g,p=>p.replace(a,(h,g)=>{const m=i[g]??g;return` ${g}="${m}"`})).replace(/(\s[\w:-]+=\s*)("[^"]*"|'[^']*')/g,(p,h,g)=>{const m=g.slice(1,-1).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;");return`${h}"${m}"`}).replace(/&(?!#?\w+;)/g,(p,h,g)=>h>0&&g[h-1]==="&"?p:"&amp;").replace(/(<[a-zA-Z!/])|</g,(p,h)=>h??"&lt;")}var aa=(e=>(e.root="mjml",e.head="mj-head",e.body="mj-body",e.include="mj-include",e))(aa||{}),Sf=(e=>(e.attributes="mj-attributes",e.breakpoint="mj-breakpoint",e.font="mj-font",e.htmlAttributes="mj-html-attributes",e.preview="mj-preview",e.style="mj-style",e.title="mj-title",e.class="mj-class",e.all="mj-all",e))(Sf||{}),dr=(e=>(e.accordion="mj-accordion",e.accordionElement="mj-accordion-element",e.accordionTitle="mj-accordion-title",e.accordionText="mj-accordion-text",e.button="mj-button",e.carousel="mj-carousel",e.carouselImage="mj-carousel-image",e.column="mj-column",e.divider="mj-divider",e.group="mj-group",e.hero="mj-hero",e.image="mj-image",e.navbar="mj-navbar",e.navbarLink="mj-navbar-link",e.raw="mj-raw",e.section="mj-section",e.social="mj-social",e.socialElement="mj-social-element",e.spacer="mj-spacer",e.table="mj-table",e.text="mj-text",e.wrapper="mj-wrapper",e))(dr||{}),Po=(e=>(e.globalStyles="globalStyles",e.globalData="globalData",e))(Po||{});function G_(e){const t=new Map,n={items:[]};return e.forEach(r=>{const{category:o,item:i}=r;if(o){const a=t.get(o.id);a?(a.items.push(i),a.category={...a.category,...o}):t.set(o.id,{category:o,items:[i]})}else n.items.push(i)}),[...Array.from(t).map(([,r])=>r),n].filter(r=>r.items.length)}const Zv=e=>(e==null?void 0:e.get("groups"))||[],Yv=(e,t)=>Zv(e).includes(t),q_=(e,t)=>{Yv(e,t)||e.set("groups",[...Zv(e),t])};class K_{constructor(t){this.dataSourceKeyid=Po.globalStyles,this.records=[],this.openCategories=new Map,this.store=t,tn(this,{openCategories:!1},{autoBind:!0})}get sdkOptionStyles(){var t;return((t=this.store.appEditorStore.sdkOptions.globalStyles)==null?void 0:t.default)||[]}get editor(){return this.store.appEditorStore.editor}get DataSources(){var t;return(t=this.editor)==null?void 0:t.DataSources}get recordsByCategory(){const{records:t,sdkOptionStyles:n}=this,s=[],r=t.reduce((o,i)=>(o.set(i.get("id"),i),o),new Map);return n.forEach(({id:o})=>{const i=r.get(o);i&&(s.push(i),r.delete(o))}),Array.from(r).map(([,o])=>{o.get("_internal")||s.push(o)}),G_(s.map(o=>({category:o.get("category"),item:o})))}setCategoryOpen(t,n){this.openCategories.set(t,n)}getDataSource(){var t;return(t=this.DataSources)==null?void 0:t.get(this.dataSourceKeyid)}getRuleByGroup(t){var n;return(n=this.editor)==null?void 0:n.CssComposer.getAll().find(s=>Yv(s,t))}addStyleRule(t,n={}){var p,h;const{editor:s}=this,r=t.get("id"),o=t.get("selector")||"",i=t.get("property"),a=t.getPath("value"),c=`${this.dataSourceKeyid}:${r}`,u={[i]:{type:"data-variable",path:a,defaultValue:t.get("defaultValue")}};if(s&&Wx(s)&&o.startsWith("mj-")){const g=s.Components.getWrapper(),{head:m}=aa,{attributes:b}=Sf,v=g.findFirstType(aa.root),x=v.findFirstType(m)||v.append({type:m},{at:0})[0],y=x.findFirstType(b)||x.append({type:b})[0],w=y.findType(o).pop()||y.append({type:o})[0],S=(w.get("attributes")||{})[i];At(S)&&S!==""&&t.set("value",S),w.addAttributes(u,{silent:!0});return}let d=((h=(p=n.selectorToRuleMap)==null?void 0:p.get(o))==null?void 0:h.rule)||this.getRuleByGroup(c);d?d.addStyle(u):d=s==null?void 0:s.CssComposer.addCollection([{selectors:[],selectorsAdd:o,style:u}],{extend:!0,at:t.index})[0],d&&q_(d,c)}createDataSource(){return this.DataSources.add({id:this.dataSourceKeyid,records:[]})}onLoad(){var o,i;const{sdkOptionStyles:t}=this,n=new Map,s=(o=this.editor)==null?void 0:o.Css;if(!t.length){this.records=[];return}const r=this.getDataSource()||this.createDataSource();t.forEach(a=>{const{id:c,selector:u,label:d,field:p,property:h,category:g}=a,m=r.getRecord(c);if(m){const b={label:d,field:p,category:g};m.set({...b,_undo:!0})}else{const b=n.get(u),v=(b==null?void 0:b.rule)||(s==null?void 0:s.getRule(u)),x=(b==null?void 0:b.styles)||(v==null?void 0:v.getStyle())||{},y=x[h]||a.defaultValue;n.set(u,{rule:v,styles:x}),r.addRecord({value:void 0,...a,defaultValue:y,_internal:!0,_undo:!0})}}),r.getRecords().forEach(a=>{this.addStyleRule(a,{selectorToRuleMap:n})}),r.listenTo(r.records,"add",a=>{this.addStyleRule(a)}),(i=this.editor)==null||i.UndoManager.add(r.records),this.records=r.getRecords()}}const Z_=()=>pn().globalStylesStore,Y_=(e,t)=>{let n;try{const s=Ts()&&e&&localStorage.getItem(e);s&&(n=JSON.parse(s))}catch(s){console.error(s)}return{lastProjectId:"",...t,...n}},xg=(e,t)=>{const s={...Y_(e),...t};try{Ts()&&e&&localStorage.setItem(e,JSON.stringify(s))}catch(r){console.error(r)}return s},wg="gs-utl-dark",X_=()=>Ts()&&window.matchMedia("(prefers-color-scheme: dark)").matches,Xv=e=>e==="dark"||e==="auto"&&X_(),Sg=(e,t)=>{if(e&&Ts()&&t.rootEl){const{classList:n}=t.rootEl;let s=!1;if(Xv(e)?(n.add(wg),s=!0):n.remove(wg),t.updateAppShell){const r=document.head.querySelector('meta[name="theme-color"]');r&&(r.content=s?"#18181b":"#ffffff")}t.resolvedTheme=s?wr.dark:wr.light}};class J_{constructor(t){this.key="",this.theme=wr.auto,this.resolvedTheme=wr.light,this.lastProjectId="",this.updateAppShell=!1,this.rootEl=void 0,t&&Object.keys(t).forEach(n=>{const s=n,r=t[s];r!==void 0&&(this[s]=r)}),this.resolvedTheme=this.theme,tn(this,{},{autoBind:!0}),this.init()}init(){Sg(this.theme,this)}changeTheme(t){Sg(t,this),xg(this.key,{theme:t})}setTheme(t){this.theme=t}setRootEl(t){this.rootEl=t}setLocalState(t){Object.keys(t).forEach(n=>{const s=n,r=t[s];r!==void 0&&(this[s]=r)}),xg(this.key,t)}get isDarkTheme(){return Xv(this.theme)}}const _s=()=>pn().localSettingsStore;class Q_{constructor(t){this.isOpen=!1,this.title="",this.content="",this.size="l",this.fullH=!1,this.modalProps={},this.buttons=[],this.store=t,tn(this,{},{autoBind:!0})}setModalProps(t){this.modalProps={title:"",size:"l",fullH:!1,buttons:[],...t}}open({content:t,...n}){this.isOpen=!0,this.content=t,this.setModalProps(n)}close(){this.isOpen=!1,setTimeout(this.clear,101)}clear(){this.content="",this.setModalProps({size:this.modalProps.size})}confirm({content:t,size:n="m",onConfirm:s,confirmButton:r,...o}){this.isOpen=!0,this.content=t;const i=()=>{s==null||s(),this.close()};this.setModalProps({...o,size:n,buttons:[{children:"Cancel",onClick:this.close,size:"m2"},{children:"Confirm",onClick:i,size:"m2",variant:"pr",...r}]})}}const di=()=>pn().modalStore,Cg="column1",jg="column2",Eg="column3",Kd="column3-7",eA=function(e,t={}){const{Components:n,Blocks:s}=e,r="gridRow",o="gridColumn",i="gjs-grid-row",a="gjs-grid-column",c={tl:0,tc:0,tr:0,cl:0,bl:0,br:0},u="flex-basis",d=1,p=1,h=1;n.addType(r,{isComponent:v=>Or(v,i),model:{defaults:{emptyState:!0,droppable:fs(o),highlightable:!1,attributes:{class:i},resizable:{...c,keyHeight:"min-height"},icon:`
108
54
  <svg viewBox="0 0 24 24">
109
55
  <path d="M22 14c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2v-4c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2v4M4 14h4v-4H4v4m6 0h4v-4h-4v4m6 0h4v-4h-4v4z"></path>
110
56
  </svg>
@@ -122,7 +68,7 @@ ${t}
122
68
  flex-direction: column;
123
69
  }
124
70
  }
125
- `}}}),n.addType(o,{isComponent:v=>Ir(v,a),model:{defaults:{emptyState:!0,attributes:{class:a},draggable:Cs(r),resizable:{...l,bc:0,keyWidth:u,currentUnit:p,minDim:d,step:f},icon:`
71
+ `}}}),n.addType(o,{isComponent:v=>Or(v,a),model:{defaults:{emptyState:!0,attributes:{class:a},draggable:fs(r),resizable:{...c,bc:0,keyWidth:u,currentUnit:h,minDim:d,step:p},icon:`
126
72
  <svg viewBox="0 0 24 24">
127
73
  <path d="M8 2h8c1.1 0 2 .9 2 2v16c0 1.1-.9 2-2 2H8c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m0 8v4h8v-4H8m0 6v4h8v-4H8M8 4v4h8V4H8z"></path>
128
74
  </svg>
@@ -131,50 +77,50 @@ ${t}
131
77
  flex: 1 1 0%;
132
78
  padding: 5px 0;
133
79
  }
134
- `},init(){this.listenTo(this,"change:center-content",this.handleCenter)},handleCenter(){const v=this.get("center-content");this.addStyle({display:v?"flex":"block","align-items":v?"center":"","justify-content":v?"center":""})}}});const g={label:r,content:{type:r,components:[{type:o},{type:o},{type:o}]},...t.block},m={merge:!0},b=v=>{var x;return((x=s.get(v))==null?void 0:x.category)||g.category};s.add(nm,{...g,category:b(nm),content:{type:r,components:[{type:o}]}},m),s.add(sm,{...g,category:b(sm),content:{type:r,components:[{type:o},{type:o}]}},m),s.add(rm,{...g,category:b(rm),content:{type:r,components:[{type:o},{type:o},{type:o}]}},m),s.add(gf,{...g,category:b(gf),content:{type:r,components:[{type:o,style:{"flex-basis":"30%","flex-grow":0}},{type:o}]}},m)},Gi="section",ed="container",td="gjs-section",nd="gjs-container",ZN=function(e,t={}){const{Components:n,Blocks:s}=e;s.add(Gi,{label:Gi,media:`
80
+ `},init(){this.listenTo(this,"change:center-content",this.handleCenter)},handleCenter(){const v=this.get("center-content");this.addStyle({display:v?"flex":"block","align-items":v?"center":"","justify-content":v?"center":""})}}});const g={label:r,content:{type:r,components:[{type:o},{type:o},{type:o}]},...t.block},m={merge:!0},b=v=>{var x;return((x=s.get(v))==null?void 0:x.category)||g.category};s.add(Cg,{...g,category:b(Cg),content:{type:r,components:[{type:o}]}},m),s.add(jg,{...g,category:b(jg),content:{type:r,components:[{type:o},{type:o}]}},m),s.add(Eg,{...g,category:b(Eg),content:{type:r,components:[{type:o},{type:o},{type:o}]}},m),s.add(Kd,{...g,category:b(Kd),content:{type:r,components:[{type:o,style:{"flex-basis":"30%","flex-grow":0}},{type:o}]}},m)},Ni="section",ku="container",Ru="gjs-section",Iu="gjs-container",tA=function(e,t={}){const{Components:n,Blocks:s}=e;s.add(Ni,{label:Ni,media:`
135
81
  <svg viewBox="0 0 24 24">
136
82
  <path fill="currentColor" d="M21 18H2V20H21V18M19 10V14H4V10H19M20 8H3C2.45 8 2 8.45 2 9V15C2 15.55 2.45 16 3 16H20C20.55 16 21 15.55 21 15V9C21 8.45 20.55 8 20 8M21 4H2V6H21V4Z" />
137
83
  </svg>
138
- `,content:{type:Gi},...t.block},{at:qa(e,gf)+1}),n.addType(Gi,{isComponent:r=>Ir(r,td),model:{defaults:{tagName:"section",emptyState:!0,draggable:Cs("wrapper"),droppable:Cs(ed),attributes:{class:td},components:{type:ed},styles:`
139
- .${td} {
84
+ `,content:{type:Ni},...t.block},{at:Ra(e,Kd)+1}),n.addType(Ni,{isComponent:r=>Or(r,Ru),model:{defaults:{tagName:"section",emptyState:!0,draggable:fs("wrapper"),droppable:fs(ku),attributes:{class:Ru},components:{type:ku},styles:`
85
+ .${Ru} {
140
86
  display: flex;
141
87
  padding: 50px 0;
142
88
  }
143
- `}}}),n.addType(ed,{isComponent:r=>Ir(r,nd),model:{defaults:{emptyState:!0,copyable:!1,removable:!1,draggable:!1,attributes:{class:nd},styles:`
144
- .${nd} {
89
+ `}}}),n.addType(ku,{isComponent:r=>Or(r,Iu),model:{defaults:{emptyState:!0,copyable:!1,removable:!1,draggable:!1,attributes:{class:Iu},styles:`
90
+ .${Iu} {
145
91
  width: 90%;
146
92
  margin: 0 auto;
147
93
  max-width: 1200px;
148
94
  }
149
- `}}})},XN=function(e,t={}){const{Components:n,Blocks:s}=e,r="divider",o="gjs-divider";s.add(r,{label:r,media:`
95
+ `}}})},nA=function(e,t={}){const{Components:n,Blocks:s}=e,r="divider",o="gjs-divider";s.add(r,{label:r,media:`
150
96
  <svg viewBox="0 0 24 24">
151
97
  <path d="M8,18H11V15H2V13H22V15H13V18H16L12,22L8,18M12,2L8,6H11V9H2V11H22V9H13V6H16L12,2Z" />
152
98
  </svg>
153
- `,content:{type:r},...t.block},{at:qa(e,Gi)+1}),n.addType(r,{isComponent:i=>Ir(i,o),model:{defaults:{droppable:!1,highlightable:!1,attributes:{class:o},stylable:["height","width","background-color","margin","margin-top","margin-right","margin-bottom","margin-left"],styles:`
99
+ `,content:{type:r},...t.block},{at:Ra(e,Ni)+1}),n.addType(r,{isComponent:i=>Or(i,o),model:{defaults:{droppable:!1,highlightable:!1,attributes:{class:o},stylable:["height","width","background-color","margin","margin-top","margin-right","margin-bottom","margin-left"],styles:`
154
100
  .${o} {
155
101
  height: 3px;
156
102
  width: 100%;
157
103
  margin: 10px;
158
104
  background-color: rgba(0, 0, 0, 0.05);
159
105
  }
160
- `}}})},JN=function(e){const{Components:t,Blocks:n}=e,r=t.getType("wrapper").model.getDefaults(),o=t.getType("head").model;t.addType("wrapper",{model:{defaults:{emptyState:{styleIn:"height: 100vh",styleOut:"padding: 0;"},stylable:[...r.stylable,"padding","font-family","color","font-size","font-weight","line-height","letter-spacing","text-align","vertical-align","text-decoration","text-transform","direction","white-space"]}}}),t.addType("head",{model:{components(u,d){return o.prototype.components.call(this,u,{...d,skipDomReset:!0})}},view:{updateContent(){}}}),t.addType("text",{model:{defaults:{highlightable:!1,emptyState:{styleIn:"min-height: auto; font-size: inherit;"}}}}),t.addType("image",{model:{defaults:{traits:[{type:"image",name:"src",label:"Image",changeProp:!0,typeProps:{inputField:!0}},"alt",{type:"checkbox",name:"loading",valueTrue:"lazy"}]}}});const a=t.getType("link").model;a.typeExtends.add("text"),t.addType("link",{model:{defaults:{emptyState:!0,traits:["title",{type:"checkbox",name:"target",valueTrue:"_blank"},{type:"href",name:"href"}]},getAttrToHTML(){const u=a.prototype.getAttrToHTML.apply(this),{href:d}=u;if(d&&d.startsWith(va)){const f=d.replace(va,""),p=e.Pages.get(f);if(u.href=p?`./${uf(e,p)}`:"##",p&&Qc(p)){const g={id:vA(this,"id")},m=y0(p,{currentItem:g});u.href=m.fullPath,xA(u,{...g,page:f})}}return u}}}),n.add("link",{label:"Link",content:{type:"link",content:"Link",style:{color:"#d983a6",padding:"10px"}}},{merge:!0}),t.addType("select",{model:{defaults:{traits:[{name:"name"},{type:"checkbox",name:"required"},{name:"options",type:"stack",getValue({component:u}){return u.components().map(d=>({id:d.getAttributes().value||"",label:d.getInnerHTML()}))},setValue:({component:u,value:d,emitUpdate:f})=>{u.components(d.map(p=>({type:"option",content:p.label,attributes:{value:p.id}}))),f()},properties:[{name:"id"},{name:"label"}]}]}}});const l="contentEditable";t.addType(l,{extend:"text",model:{defaults:{name:"Content",tagName:"span",hoverable:!1,draggable:!1,selectable:!1},toHTML(u){return this.getInnerHTML(u)}},view:{onRender(){this.el.style.display="contents"}}}),t.addType("button",{model:{defaults:{components:[{type:l,components:{type:"textnode",content:"Button"}}],traits:[{type:"select",name:"type",options:[{id:"button",label:"Button"},{id:"submit",label:"Submit"},{id:"reset",label:"Reset"}]}]},init(){var d;const u=[...this.components().models];(u.length>1||!((d=u[0])!=null&&d.is(l)))&&this.append({type:l})[0].append(u)}}})},QN=function(e,t={}){const{Components:n,Blocks:s}=e,r="heading";s.add(r,{label:r,media:`
106
+ `}}})},sA=function(e){const{Components:t,Blocks:n}=e,r=t.getType("wrapper").model.getDefaults(),o=t.getType("head").model;t.addType("wrapper",{model:{defaults:{emptyState:{styleIn:"height: 100vh",styleOut:"padding: 0;"},stylable:[...r.stylable,"padding","font-family","color","font-size","font-weight","line-height","letter-spacing","text-align","vertical-align","text-decoration","text-transform","direction","white-space"]}}}),t.addType("head",{model:{components(u,d){return o.prototype.components.call(this,u,{...d,skipDomReset:!0})}},view:{updateContent(){}}}),t.addType("text",{model:{defaults:{highlightable:!1,emptyState:{styleIn:"min-height: auto; font-size: inherit;"}}}}),t.addType("image",{model:{defaults:{traits:[{type:"image",name:"src",label:"Image",changeProp:!0,typeProps:{inputField:!0}},"alt",{type:"checkbox",name:"loading",valueTrue:"lazy"}]}}});const a=t.getType("link").model;a.typeExtends.add("text"),t.addType("link",{model:{defaults:{emptyState:!0,traits:["title",{type:"checkbox",name:"target",valueTrue:"_blank"},{type:"href",name:"href"}]},getAttrToHTML(){const u=a.prototype.getAttrToHTML.apply(this),{href:d}=u;if(d&&d.startsWith(ia)){const p=d.replace(ia,""),h=e.Pages.get(p);if(u.href=h?`./${zd(e,h)}`:"##",h&&Vc(h)){const g={id:C3(this,"id")},m=Iv(h,{currentItem:g});u.href=m.fullPath,E3(u,{...g,page:p})}}return u}}}),n.add("link",{label:"Link",content:{type:"link",content:"Link",style:{color:"#d983a6",padding:"10px"}}},{merge:!0}),t.addType("select",{model:{defaults:{traits:[{name:"name"},{type:"checkbox",name:"required"},{name:"options",type:"stack",getValue({component:u}){return u.components().map(d=>({id:d.getAttributes().value||"",label:d.getInnerHTML()}))},setValue:({component:u,value:d,emitUpdate:p})=>{u.components(d.map(h=>({type:"option",content:h.label,attributes:{value:h.id}}))),p()},properties:[{name:"id"},{name:"label"}]}]}}});const c="contentEditable";t.addType(c,{extend:"text",model:{defaults:{name:"Content",tagName:"span",hoverable:!1,draggable:!1,selectable:!1},toHTML(u){return this.getInnerHTML(u)}},view:{onRender(){this.el.style.display="contents"}}}),t.addType("button",{model:{defaults:{components:[{type:c,components:{type:"textnode",content:"Button"}}],traits:[{type:"select",name:"type",options:[{id:"button",label:"Button"},{id:"submit",label:"Submit"},{id:"reset",label:"Reset"}]}]},init(){var d;const u=[...this.components().models];(u.length>1||!((d=u[0])!=null&&d.is(c)))&&this.append({type:c})[0].append(u)}}})},rA=function(e,t={}){const{Components:n,Blocks:s}=e,r="heading";s.add(r,{label:r,media:`
161
107
  <svg viewBox="0 0 24 24">
162
108
  <path d="M8.3 11.5h7.4V6.9l-.2-1.6a1 1 0 00-.5-.5c-.3-.2-.7-.3-1-.3h-.6v-.4h6.8v.4h-.6c-.4 0-.7.1-1 .3a1 1 0 00-.6.6L18 6.9v10.3c0 .8 0 1.3.2 1.6 0 .2.2.3.4.5.4.2.7.3 1.1.3h.6v.4h-6.8v-.4h.5c.7 0 1.2-.2 1.5-.6.2-.3.3-.9.3-1.8v-4.9H8.3v4.9l.1 1.6.5.5c.3.2.7.3 1 .3h.7v.4H3.7v-.4h.6c.7 0 1.1-.2 1.4-.6.2-.3.3-.9.3-1.8V6.9L6 5.3a1 1 0 00-.5-.5l-1-.3h-.7v-.4h6.9v.4H10c-.4 0-.8.1-1 .3a1 1 0 00-.6.6l-.1 1.5v4.6z"></path>
163
109
  </svg>
164
- `,content:{type:r,components:"Insert your text here"},...t.block},{at:qa(e,"text")}),n.addType(r,{extend:"text",isComponent:o=>uA(o,"H1","H2","H3","H4","H5","H6"),model:{defaults:{emptyState:!0,tagName:"h1",traits:[{type:"select",options:[{value:"h1",name:"One (largest)"},{value:"h2",name:"Two"},{value:"h3",name:"Three"},{value:"h4",name:"Four"},{value:"h5",name:"Five"},{value:"h6",name:"Six (smallest)"}],label:"Size",name:"tagName",changeProp:!0}]}}})},e3=function(e,t={}){const{Components:n,Blocks:s}=e,r=e.Components.getType("default").model,o="imageBox",i="gjs-image-box";s.add(o,{label:o,media:`
110
+ `,content:{type:r,components:"Insert your text here"},...t.block},{at:Ra(e,"text")}),n.addType(r,{extend:"text",isComponent:o=>g3(o,"H1","H2","H3","H4","H5","H6"),model:{defaults:{emptyState:!0,tagName:"h1",traits:[{type:"select",options:[{value:"h1",name:"One (largest)"},{value:"h2",name:"Two"},{value:"h3",name:"Three"},{value:"h4",name:"Four"},{value:"h5",name:"Five"},{value:"h6",name:"Six (smallest)"}],label:"Size",name:"tagName",changeProp:!0}]}}})},oA=function(e,t={}){const{Components:n,Blocks:s}=e,r=e.Components.getType("default").model,o="imageBox",i="gjs-image-box";s.add(o,{label:o,media:`
165
111
  <svg viewBox="0 0 24 24">
166
112
  <path d="M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z" />
167
113
  </svg>
168
- `,content:{type:o},...t.block},{at:qa(e,"image")+1}),n.addType(o,{extend:"image",isComponent:a=>Ir(a,i),model:{defaults:{tagName:"div",void:!1,droppable:!0,emptyState:!1,resizable:{tl:0,tc:0,tr:0,cl:0,cr:0,bl:0,br:0},traits:["title"],attributes:{class:i},styles:`
114
+ `,content:{type:o},...t.block},{at:Ra(e,"image")+1}),n.addType(o,{extend:"image",isComponent:a=>Or(a,i),model:{defaults:{tagName:"div",void:!1,droppable:!0,emptyState:!1,resizable:{tl:0,tc:0,tr:0,cl:0,cr:0,bl:0,br:0},traits:["title"],attributes:{class:i},styles:`
169
115
  .${i} {
170
116
  height: 200px;
171
117
  width: 100%;
172
118
  }
173
- `},getAttrToHTML(...a){return r.prototype.getAttrToHTML.apply(this,a)}},view:{tagName:"div",updateSrc(){const{model:a,em:l}=this,u=a.getSrcResult(),d=a.isDefaultSrc(),f=a.getStyle(),p=`url('${u}')`;u&&a.addStyle({"background-image":d&&f["background-image"]||p,"background-size":f["background-size"]||"contain","background-position":f["background-position"]||"center center","background-attachment":f["background-attachment"]||"scroll","background-repeat":f["background-repeat"]||"no-repeat"}),u&&l.trigger("component:toggled"),this.$el[u?"removeClass":"addClass"](this.classEmpty)},onRender(){this.renderChildren(),this.updateSrc()}}})},t3=function(e,t={}){const{Components:n,Blocks:s}=e,r="linkBox",o="gjs-link-box";s.add(r,{label:r,media:`
119
+ `},getAttrToHTML(...a){return r.prototype.getAttrToHTML.apply(this,a)}},view:{tagName:"div",updateSrc(){const{model:a,em:c}=this,u=a.getSrcResult(),d=a.isDefaultSrc(),p=a.getStyle(),h=`url('${u}')`;u&&a.addStyle({"background-image":d&&p["background-image"]||h,"background-size":p["background-size"]||"contain","background-position":p["background-position"]||"center center","background-attachment":p["background-attachment"]||"scroll","background-repeat":p["background-repeat"]||"no-repeat"}),u&&c.trigger("component:toggled"),this.$el[u?"removeClass":"addClass"](this.classEmpty)},onRender(){this.renderChildren(),this.updateSrc()}}})},iA=function(e,t={}){const{Components:n,Blocks:s}=e,r="linkBox",o="gjs-link-box";s.add(r,{label:r,media:`
174
120
  <svg viewBox="0 0 24 24">
175
121
  <path d="M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,19H5V5H19V19M11,16H10C8.39,16 6,14.94 6,12C6,9.07 8.39,8 10,8H11V10H10C9.54,10 8,10.17 8,12C8,13.9 9.67,14 10,14H11V16M14,16H13V14H14C14.46,14 16,13.83 16,12C16,10.1 14.33,10 14,10H13V8H14C15.61,8 18,9.07 18,12C18,14.94 15.61,16 14,16M15,13H9V11H15V13Z" />
176
122
  </svg>
177
- `,content:{type:r},...t.block},{at:qa(e,"link")+1}),n.addType(r,{isComponent:i=>Ir(i,o),extend:"link",model:{defaults:{editable:!1,droppable:!0,attributes:{class:o},styles:`
123
+ `,content:{type:r},...t.block},{at:Ra(e,"link")+1}),n.addType(r,{isComponent:i=>Or(i,o),extend:"link",model:{defaults:{editable:!1,droppable:!0,attributes:{class:o},styles:`
178
124
  .${o} {
179
125
  color: inherit;
180
126
  display: inline-block;
@@ -183,9 +129,9 @@ ${t}
183
129
  max-width: 100%;
184
130
  text-decoration: none;
185
131
  }
186
- `}}})};function n3(e){const t={};if(e.padding){const n=e.padding.split(" ");let s=n[0],r=n[0],o=n[0],i=n[0];n.length===4?(s=n[0],r=n[1],o=n[2],i=n[3]):n.length===3?(s=n[0],r=n[1],i=n[1],o=n[2]):n.length===2&&(s=n[0],r=n[1],i=n[1],o=n[0]),t["padding-top"]=e["padding-top"]||s,t["padding-right"]=e["padding-right"]||r,t["padding-bottom"]=e["padding-bottom"]||o,t["padding-left"]=e["padding-left"]||i,delete e.padding}return{...e,...t}}const s3={ratioDefault:!0,tc:!1,cl:!1,cr:!1,bc:!1},om=`<svg viewBox="0 0 24 24">
132
+ `}}})};function aA(e){const t={};if(e.padding){const n=e.padding.split(" ");let s=n[0],r=n[0],o=n[0],i=n[0];n.length===4?(s=n[0],r=n[1],o=n[2],i=n[3]):n.length===3?(s=n[0],r=n[1],i=n[1],o=n[2]):n.length===2&&(s=n[0],r=n[1],i=n[1],o=n[0]),t["padding-top"]=e["padding-top"]||s,t["padding-right"]=e["padding-right"]||r,t["padding-bottom"]=e["padding-bottom"]||o,t["padding-left"]=e["padding-left"]||i,delete e.padding}return{...e,...t}}const lA={ratioDefault:!0,tc:!1,cl:!1,cr:!1,bc:!1},Pg=`<svg viewBox="0 0 24 24">
187
133
  <path d="M16 9h3l-5 7m-4-7h4l-2 8M5 9h3l2 7m5-12h2l2 3h-3m-5-3h2l1 3h-4M7 4h2L8 7H5m1-5L2 8l10 14L22 8l-4-6H6z"></path>
188
- </svg>`,r3=function(e,t={}){const{Components:n,Blocks:s}=e,r="icon",o="gjs-icon",i="data-type-icon";s.add(r,{label:"Icon",media:om,content:{type:r},...t.block}),n.addType(r,{isComponent:a=>Ir(a,o)||Ga(a,i),model:{defaults:{droppable:!1,attributes:{class:o,[i]:!0},resizable:s3,components:om,traits:["id","title",{type:"code",label:"Content",typeProps:{language:"html",clean:!0,padding:5},getValue({component:a}){return a.getInnerHTML()},setValue:Tr(({editor:a,component:l,value:u})=>{const d=a.Parser.parseHtml(u).html,f=Array.isArray(d)?d[0]:d;f&&f.tagName==="svg"&&l.components(f)},500)}],styles:`
134
+ </svg>`,cA=function(e,t={}){const{Components:n,Blocks:s}=e,r="icon",o="gjs-icon",i="data-type-icon";s.add(r,{label:"Icon",media:Pg,content:{type:r},...t.block}),n.addType(r,{isComponent:a=>Or(a,o)||ka(a,i),model:{defaults:{droppable:!1,attributes:{class:o,[i]:!0},resizable:lA,components:Pg,traits:["id","title",{type:"code",label:"Content",typeProps:{language:"html",clean:!0,padding:5},getValue({component:a}){return a.getInnerHTML()},setValue:vr(({editor:a,component:c,value:u})=>{const d=a.Parser.parseHtml(u).html,p=Array.isArray(d)?d[0]:d;p&&p.tagName==="svg"&&c.components(p)},500)}],styles:`
189
135
  .${o} {
190
136
  display: inline-block;
191
137
  text-decoration: none;
@@ -195,9 +141,9 @@ ${t}
195
141
  width: 50px;
196
142
  height: 50px;
197
143
  }
198
- `},init(){this.listenTo(this.components(),"change add",this.disableLayers),this.disableLayers()},disableLayers(){this.components().forEach(a=>a.set("layerable",!1))}},view:{init(){const{model:a}=this;this.listenTo(a.components(),"change",this.disableChildren)},onRender(){this.disableChildren()},disableChildren(){this.model.components().forEach(a=>{var u;const l=(u=a.view)==null?void 0:u.el;l&&(l.style.pointerEvents="none")})}}})},sd="__nc",o3=e=>{const t=e.getAttributes({noClass:!0,noStyle:!0});return e.traits.forEach(n=>{const s=n.getName();n.get("changeProp")||delete t[s]}),delete t.id,delete t.__p,t};function i3(e){const{Components:t}=e,n=s=>{const{model:r,id:o}=s,i=r.getDefaults();t.addType(o,{model:{defaults:{traits:[...i.traits,{name:"customAttributes",type:"stack",getValue({component:a}){const l=o3(a);return Object.keys(l).map(d=>({id:d,value:l[d]}))},setValue:({component:a,value:l,options:u,emitUpdate:d})=>{const f=u.removed,p=u.previous,g=u.item;if(f)a.removeAttributes(f.id);else{p&&g&&p.id!==g.id&&a.removeAttributes(p.id);const m=l.reduce((b,v)=>(b[v.id]=v.value||"",b),{});a.addAttributes(m)}d()},addItem:()=>({id:sd,value:!1}),labelItem:a=>a.id===sd||!a.id&&!a.value?"- Empty -":`${a.id||""}="${a.value||""}"`,properties:[{name:"id",label:"Name",getValue:a=>a===sd?"":a,setValue:(a,l)=>a.trim().toLowerCase().replace(/^[^a-z]{1}/gi,"_").replace(/\s+/g,"-")||l},{name:"value",label:"Value",getValue:a=>typeof a=="boolean"?"":a}]}]}}})};t.getTypes().forEach(n)}const a3="Basic";function rd(e,t){const{appStore:n}=t;e.Css.getConfig().onBeforeStyle=n3;const s=e.Parser.getConfig().optionsHtml;s.htmlType="text/html";const r=n.sdkOptions.pages||{};(Lt(r.allowDocuments)?r.allowDocuments:!0)&&(s.detectDocument=!0,s.allowScripts=!0),e.Components.addType("trait-check",{model:{defaults:{traits:["id","title",{type:"select",name:"select-type",options:[{id:"value1",label:"Value 1"},{id:"value2",label:"Value 2"},{id:"value3",label:"Value 3"}]},{type:"number",name:"number-type",units:["px","rem","%"]},{type:"checkbox",name:"checkbox-type"},{type:"color",name:"color-type"},{type:"button",name:"button-type",label:"Delete",command:"core:component-delete"}]}}});const i={category:a3,select:!0,activate:!0};pA(e,t),JN(e),YN(e,{block:i}),QN(e,{block:i}),ZN(e,{block:i}),XN(e,{block:i}),e3(e,{block:i}),t3(e,{block:i}),r3(e,{block:i}),i3(e)}function R0(e){const{code:t,appStore:n,showToastError:s}=e,{appEditorStore:r,toastStore:o,i18nStore:i}=n.store,{isProjectTypeEmail:a,editor:l}=r,u=(t||"").trim(),d=new DOMParser,f={input:t,output:"",error:""};let p="";try{if(a){const g=(l==null?void 0:l.Parser.config.optionsHtml)||{},m=g.codeSanitizer,b=A0(u,{sanitizer:m});if(g.htmlType==="text/xml"){const x=d.parseFromString(`<div>${b}</div>`,"text/xml").querySelector("parsererror div");f.error=(x==null?void 0:x.textContent)||""}m&&(l==null||l.runCommand(tu,{mjml:b})),p=b}else{const g=d.parseFromString(u,"text/html");$0(g.documentElement);const m=g.querySelectorAll("style"),b=[];m.forEach(x=>b.push(x.innerHTML));const v=b.filter(Boolean).join(`
199
- `).trim();v&&(l==null||l.Parser.parserCss.parse(v,{throwOnError:!0}))}}catch(g){f.error=g.message}return f.error?s&&o.addError("error-parser",{header:i.t("actions.importCode.parseError"),content:f.error}):f.output=p||u,f}function $0(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return;const t=Array.from(e.attributes),n=Array.from(e.children);for(const s of t)e.setAttribute(s.name,s.value);for(const s of n)$0(s)}function l3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function im(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function am(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?im(Object(n),!0).forEach(function(s){l3(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):im(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function c3(e,t){if(e==null)return{};var n={},s=Object.keys(e),r,o;for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function u3(e,t){if(e==null)return{};var n=c3(e,t),s,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function d3(e,t){return f3(e)||p3(e,t)||h3(e,t)||g3()}function f3(e){if(Array.isArray(e))return e}function p3(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],s=!0,r=!1,o=void 0;try{for(var i=e[Symbol.iterator](),a;!(s=(a=i.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(l){r=!0,o=l}finally{try{!s&&i.return!=null&&i.return()}finally{if(r)throw o}}return n}}function h3(e,t){if(e){if(typeof e=="string")return lm(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lm(e,t)}}function lm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function g3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
200
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function um(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cm(Object(n),!0).forEach(function(s){m3(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cm(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function b3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(s){return t.reduceRight(function(r,o){return o(r)},s)}}function qi(e){return function t(){for(var n=this,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return r.length>=e.length?e.apply(this,r):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return t.apply(n,[].concat(r,a))}}}function vc(e){return{}.toString.call(e).includes("Object")}function v3(e){return!Object.keys(e).length}function xa(e){return typeof e=="function"}function y3(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function x3(e,t){return vc(t)||Lr("changeType"),Object.keys(t).some(function(n){return!y3(e,n)})&&Lr("changeField"),t}function w3(e){xa(e)||Lr("selectorType")}function S3(e){xa(e)||vc(e)||Lr("handlerType"),vc(e)&&Object.values(e).some(function(t){return!xa(t)})&&Lr("handlersType")}function C3(e){e||Lr("initialIsRequired"),vc(e)||Lr("initialType"),v3(e)&&Lr("initialContent")}function j3(e,t){throw new Error(e[t]||e.default)}var E3={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Lr=qi(j3)(E3),xl={changes:x3,selector:w3,handler:S3,initial:C3};function P3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};xl.initial(e),xl.handler(t);var n={current:e},s=qi(O3)(n,t),r=qi(T3)(n),o=qi(xl.changes)(e),i=qi(_3)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return xl.selector(u),u(n.current)}function l(u){b3(s,r,o,i)(u)}return[a,l]}function _3(e,t){return xa(t)?t(e.current):t}function T3(e,t){return e.current=um(um({},e.current),t),t}function O3(e,t,n){return xa(t)?t(e.current):Object.keys(n).forEach(function(s){var r;return(r=t[s])===null||r===void 0?void 0:r.call(t,e.current[s])}),n}var A3={create:P3},N3={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function M3(e){return function t(){for(var n=this,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return r.length>=e.length?e.apply(this,r):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return t.apply(n,[].concat(r,a))}}}function L3(e){return{}.toString.call(e).includes("Object")}function R3(e){return e||dm("configIsRequired"),L3(e)||dm("configType"),e.urls?($3(),{paths:{vs:e.urls.monacoBase}}):e}function $3(){console.warn(k0.deprecation)}function k3(e,t){throw new Error(e[t]||e.default)}var k0={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
144
+ `},init(){this.listenTo(this.components(),"change add",this.disableLayers),this.disableLayers()},disableLayers(){this.components().forEach(a=>a.set("layerable",!1))}},view:{init(){const{model:a}=this;this.listenTo(a.components(),"change",this.disableChildren)},onRender(){this.disableChildren()},disableChildren(){this.model.components().forEach(a=>{var u;const c=(u=a.view)==null?void 0:u.el;c&&(c.style.pointerEvents="none")})}}})},Vu="__nc",uA=e=>{const t=e.getAttributes({noClass:!0,noStyle:!0});return e.traits.forEach(n=>{const s=n.getName();n.get("changeProp")||delete t[s]}),delete t.id,delete t.__p,t};function dA(e){const{Components:t}=e,n=s=>{const{model:r,id:o}=s,i=r.getDefaults();t.addType(o,{model:{defaults:{traits:[...i.traits,{name:"customAttributes",type:"stack",getValue({component:a}){const c=uA(a);return Object.keys(c).map(d=>({id:d,value:c[d]}))},setValue:({component:a,value:c,options:u,emitUpdate:d})=>{const p=u.removed,h=u.previous,g=u.item;if(p)a.removeAttributes(p.id);else{h&&g&&h.id!==g.id&&a.removeAttributes(h.id);const m=c.reduce((b,v)=>(b[v.id]=v.value||"",b),{});a.addAttributes(m)}d()},addItem:()=>({id:Vu,value:!1}),labelItem:a=>a.id===Vu||!a.id&&!a.value?"- Empty -":`${a.id||""}="${a.value||""}"`,properties:[{name:"id",label:"Name",getValue:a=>a===Vu?"":a,setValue:(a,c)=>a.trim().toLowerCase().replace(/^[^a-z]{1}/gi,"_").replace(/\s+/g,"-")||c},{name:"value",label:"Value",getValue:a=>typeof a=="boolean"?"":a}]}]}}})};t.getTypes().forEach(n)}const pA="Basic";function Hu(e,t){const{appStore:n}=t;e.Css.getConfig().onBeforeStyle=aA;const s=e.Parser.getConfig().optionsHtml;s.htmlType="text/html";const r=n.sdkOptions.pages||{};(At(r.allowDocuments)?r.allowDocuments:!0)&&(s.detectDocument=!0,s.allowScripts=!0),e.Components.addType("trait-check",{model:{defaults:{traits:["id","title",{type:"select",name:"select-type",options:[{id:"value1",label:"Value 1"},{id:"value2",label:"Value 2"},{id:"value3",label:"Value 3"}]},{type:"number",name:"number-type",units:["px","rem","%"]},{type:"checkbox",name:"checkbox-type"},{type:"color",name:"color-type"},{type:"button",name:"button-type",label:"Delete",command:"core:component-delete"}]}}});const i={category:pA,select:!0,activate:!0};v3(e,t),sA(e),eA(e,{block:i}),rA(e,{block:i}),tA(e,{block:i}),nA(e,{block:i}),oA(e,{block:i}),iA(e,{block:i}),cA(e,{block:i}),dA(e)}function Jv(e){const{code:t,appStore:n,showToastError:s}=e,{appEditorStore:r,toastStore:o,i18nStore:i}=n.store,{isProjectTypeEmail:a,editor:c}=r,u=(t||"").trim(),d=new DOMParser,p={input:t,output:"",error:""};let h="";try{if(a){const g=(c==null?void 0:c.Parser.config.optionsHtml)||{},m=g.codeSanitizer,b=Kv(u,{sanitizer:m});if(g.htmlType==="text/xml"){const x=d.parseFromString(`<div>${b}</div>`,"text/xml").querySelector("parsererror div");p.error=(x==null?void 0:x.textContent)||""}m&&(c==null||c.runCommand(Dc,{mjml:b})),h=b}else{const g=d.parseFromString(u,"text/html");Qv(g.documentElement);const m=g.querySelectorAll("style"),b=[];m.forEach(x=>b.push(x.innerHTML));const v=b.filter(Boolean).join(`
145
+ `).trim();v&&(c==null||c.Parser.parserCss.parse(v,{throwOnError:!0}))}}catch(g){p.error=g.message}return p.error?s&&o.addError("error-parser",{header:i.t("actions.importCode.parseError"),content:p.error}):p.output=h||u,p}function Qv(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return;const t=Array.from(e.attributes),n=Array.from(e.children);for(const s of t)e.setAttribute(s.name,s.value);for(const s of n)Qv(s)}function fA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function Og(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tg(Object(n),!0).forEach(function(s){fA(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tg(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function hA(e,t){if(e==null)return{};var n={},s=Object.keys(e),r,o;for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function gA(e,t){if(e==null)return{};var n=hA(e,t),s,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)s=o[r],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function mA(e,t){return bA(e)||vA(e,t)||yA(e,t)||xA()}function bA(e){if(Array.isArray(e))return e}function vA(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],s=!0,r=!1,o=void 0;try{for(var i=e[Symbol.iterator](),a;!(s=(a=i.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){r=!0,o=c}finally{try{!s&&i.return!=null&&i.return()}finally{if(r)throw o}}return n}}function yA(e,t){if(e){if(typeof e=="string")return _g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _g(e,t)}}function _g(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=new Array(t);n<t;n++)s[n]=e[n];return s}function xA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
146
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wA(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ag(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function Mg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ag(Object(n),!0).forEach(function(s){wA(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ag(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function SA(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(s){return t.reduceRight(function(r,o){return o(r)},s)}}function $i(e){return function t(){for(var n=this,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return r.length>=e.length?e.apply(this,r):function(){for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return t.apply(n,[].concat(r,a))}}}function rc(e){return{}.toString.call(e).includes("Object")}function CA(e){return!Object.keys(e).length}function la(e){return typeof e=="function"}function jA(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function EA(e,t){return rc(t)||Cr("changeType"),Object.keys(t).some(function(n){return!jA(e,n)})&&Cr("changeField"),t}function PA(e){la(e)||Cr("selectorType")}function TA(e){la(e)||rc(e)||Cr("handlerType"),rc(e)&&Object.values(e).some(function(t){return!la(t)})&&Cr("handlersType")}function OA(e){e||Cr("initialIsRequired"),rc(e)||Cr("initialType"),CA(e)&&Cr("initialContent")}function _A(e,t){throw new Error(e[t]||e.default)}var AA={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Cr=$i(_A)(AA),al={changes:EA,selector:PA,handler:TA,initial:OA};function MA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};al.initial(e),al.handler(t);var n={current:e},s=$i($A)(n,t),r=$i(NA)(n),o=$i(al.changes)(e),i=$i(LA)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return al.selector(u),u(n.current)}function c(u){SA(s,r,o,i)(u)}return[a,c]}function LA(e,t){return la(t)?t(e.current):t}function NA(e,t){return e.current=Mg(Mg({},e.current),t),t}function $A(e,t,n){return la(t)?t(e.current):Object.keys(n).forEach(function(s){var r;return(r=t[s])===null||r===void 0?void 0:r.call(t,e.current[s])}),n}var kA={create:MA},RA={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function IA(e){return function t(){for(var n=this,s=arguments.length,r=new Array(s),o=0;o<s;o++)r[o]=arguments[o];return r.length>=e.length?e.apply(this,r):function(){for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];return t.apply(n,[].concat(r,a))}}}function VA(e){return{}.toString.call(e).includes("Object")}function HA(e){return e||Lg("configIsRequired"),VA(e)||Lg("configType"),e.urls?(DA(),{paths:{vs:e.urls.monacoBase}}):e}function DA(){console.warn(e0.deprecation)}function FA(e,t){throw new Error(e[t]||e.default)}var e0={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
201
147
  You are using deprecated way of configuration.
202
148
 
203
149
  Instead of using
@@ -206,7 +152,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
206
152
  monaco.config({ paths: { vs: '...' } })
207
153
 
208
154
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
209
- `},dm=M3(k3)(k0),V3={config:R3},I3=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return function(r){return n.reduceRight(function(o,i){return i(o)},r)}};function V0(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],V0(e[n],t[n]))}),am(am({},e),t)}var D3={type:"cancelation",msg:"operation is manually canceled"};function od(e){var t=!1,n=new Promise(function(s,r){e.then(function(o){return t?r(D3):s(o)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var H3=A3.create({config:N3,isInitialized:!1,resolve:null,reject:null,monaco:null}),I0=d3(H3,2),Za=I0[0],nu=I0[1];function F3(e){var t=V3.config(e),n=t.monaco,s=u3(t,["monaco"]);nu(function(r){return{config:V0(r.config,s),monaco:n}})}function B3(){var e=Za(function(t){var n=t.monaco,s=t.isInitialized,r=t.resolve;return{monaco:n,isInitialized:s,resolve:r}});if(!e.isInitialized){if(nu({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),od(id);if(window.monaco&&window.monaco.editor)return D0(window.monaco),e.resolve(window.monaco),od(id);I3(z3,W3)(G3)}return od(id)}function z3(e){return document.body.appendChild(e)}function U3(e){var t=document.createElement("script");return e&&(t.src=e),t}function W3(e){var t=Za(function(s){var r=s.config,o=s.reject;return{config:r,reject:o}}),n=U3("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function G3(){var e=Za(function(n){var s=n.config,r=n.resolve,o=n.reject;return{config:s,resolve:r,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){D0(n),e.resolve(n)},function(n){e.reject(n)})}function D0(e){Za().monaco||nu({monaco:e})}function q3(){return Za(function(e){var t=e.monaco;return t})}var id=new Promise(function(e,t){return nu({resolve:e,reject:t})}),H0={config:F3,init:B3,__getMonacoInstance:q3},K3={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ad=K3,Y3={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Z3=Y3;function X3({children:e}){return h.createElement("div",{style:Z3.container},e)}var J3=X3,Q3=J3;function e4({width:e,height:t,isEditorReady:n,loading:s,_ref:r,className:o,wrapperProps:i}){return h.createElement("section",{style:{...ad.wrapper,width:e,height:t},...i},!n&&h.createElement(Q3,null,s),h.createElement("div",{ref:r,style:{...ad.fullWidth,...!n&&ad.hide},className:o}))}var t4=e4,F0=h.memo(t4);function n4(e){h.useEffect(e,[])}var B0=n4;function s4(e,t,n=!0){let s=h.useRef(!0);h.useEffect(s.current||!n?()=>{s.current=!1}:e,t)}var xn=s4;function ea(){}function ei(e,t,n,s){return r4(e,s)||o4(e,t,n,s)}function r4(e,t){return e.editor.getModel(z0(e,t))}function o4(e,t,n,s){return e.editor.createModel(t,n,s?z0(e,s):void 0)}function z0(e,t){return e.Uri.parse(t)}function i4({original:e,modified:t,language:n,originalLanguage:s,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:i,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:d="Loading...",options:f={},height:p="100%",width:g="100%",className:m,wrapperProps:b={},beforeMount:v=ea,onMount:x=ea}){let[y,w]=h.useState(!1),[S,C]=h.useState(!0),j=h.useRef(null),E=h.useRef(null),_=h.useRef(null),T=h.useRef(x),P=h.useRef(v),A=h.useRef(!1);B0(()=>{let L=H0.init();return L.then(B=>(E.current=B)&&C(!1)).catch(B=>(B==null?void 0:B.type)!=="cancelation"&&console.error("Monaco initialization: error:",B)),()=>j.current?F():L.cancel()}),xn(()=>{if(j.current&&E.current){let L=j.current.getOriginalEditor(),B=ei(E.current,e||"",s||n||"text",o||"");B!==L.getModel()&&L.setModel(B)}},[o],y),xn(()=>{if(j.current&&E.current){let L=j.current.getModifiedEditor(),B=ei(E.current,t||"",r||n||"text",i||"");B!==L.getModel()&&L.setModel(B)}},[i],y),xn(()=>{let L=j.current.getModifiedEditor();L.getOption(E.current.editor.EditorOption.readOnly)?L.setValue(t||""):t!==L.getValue()&&(L.executeEdits("",[{range:L.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),L.pushUndoStop())},[t],y),xn(()=>{var L,B;(B=(L=j.current)==null?void 0:L.getModel())==null||B.original.setValue(e||"")},[e],y),xn(()=>{let{original:L,modified:B}=j.current.getModel();E.current.editor.setModelLanguage(L,s||n||"text"),E.current.editor.setModelLanguage(B,r||n||"text")},[n,s,r],y),xn(()=>{var L;(L=E.current)==null||L.editor.setTheme(u)},[u],y),xn(()=>{var L;(L=j.current)==null||L.updateOptions(f)},[f],y);let M=h.useCallback(()=>{var q;if(!E.current)return;P.current(E.current);let L=ei(E.current,e||"",s||n||"text",o||""),B=ei(E.current,t||"",r||n||"text",i||"");(q=j.current)==null||q.setModel({original:L,modified:B})},[n,t,r,e,s,o,i]),R=h.useCallback(()=>{var L;!A.current&&_.current&&(j.current=E.current.editor.createDiffEditor(_.current,{automaticLayout:!0,...f}),M(),(L=E.current)==null||L.editor.setTheme(u),w(!0),A.current=!0)},[f,u,M]);h.useEffect(()=>{y&&T.current(j.current,E.current)},[y]),h.useEffect(()=>{!S&&!y&&R()},[S,y,R]);function F(){var B,q,H,$;let L=(B=j.current)==null?void 0:B.getModel();a||((q=L==null?void 0:L.original)==null||q.dispose()),l||((H=L==null?void 0:L.modified)==null||H.dispose()),($=j.current)==null||$.dispose()}return h.createElement(F0,{width:g,height:p,isEditorReady:y,loading:d,_ref:_,className:m,wrapperProps:b})}var a4=i4;h.memo(a4);function l4(e){let t=h.useRef();return h.useEffect(()=>{t.current=e},[e]),t.current}var c4=l4,wl=new Map;function u4({defaultValue:e,defaultLanguage:t,defaultPath:n,value:s,language:r,path:o,theme:i="light",line:a,loading:l="Loading...",options:u={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:p=!1,width:g="100%",height:m="100%",className:b,wrapperProps:v={},beforeMount:x=ea,onMount:y=ea,onChange:w,onValidate:S=ea}){let[C,j]=h.useState(!1),[E,_]=h.useState(!0),T=h.useRef(null),P=h.useRef(null),A=h.useRef(null),M=h.useRef(y),R=h.useRef(x),F=h.useRef(),L=h.useRef(s),B=c4(o),q=h.useRef(!1),H=h.useRef(!1);B0(()=>{let O=H0.init();return O.then(V=>(T.current=V)&&_(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>P.current?I():O.cancel()}),xn(()=>{var V,G,W,K;let O=ei(T.current,e||s||"",t||r||"",o||n||"");O!==((V=P.current)==null?void 0:V.getModel())&&(f&&wl.set(B,(G=P.current)==null?void 0:G.saveViewState()),(W=P.current)==null||W.setModel(O),f&&((K=P.current)==null||K.restoreViewState(wl.get(o))))},[o],C),xn(()=>{var O;(O=P.current)==null||O.updateOptions(u)},[u],C),xn(()=>{!P.current||s===void 0||(P.current.getOption(T.current.editor.EditorOption.readOnly)?P.current.setValue(s):s!==P.current.getValue()&&(H.current=!0,P.current.executeEdits("",[{range:P.current.getModel().getFullModelRange(),text:s,forceMoveMarkers:!0}]),P.current.pushUndoStop(),H.current=!1))},[s],C),xn(()=>{var V,G;let O=(V=P.current)==null?void 0:V.getModel();O&&r&&((G=T.current)==null||G.editor.setModelLanguage(O,r))},[r],C),xn(()=>{var O;a!==void 0&&((O=P.current)==null||O.revealLine(a))},[a],C),xn(()=>{var O;(O=T.current)==null||O.editor.setTheme(i)},[i],C);let $=h.useCallback(()=>{var O;if(!(!A.current||!T.current)&&!q.current){R.current(T.current);let V=o||n,G=ei(T.current,s||e||"",t||r||"",V||"");P.current=(O=T.current)==null?void 0:O.editor.create(A.current,{model:G,automaticLayout:!0,...u},d),f&&P.current.restoreViewState(wl.get(V)),T.current.editor.setTheme(i),a!==void 0&&P.current.revealLine(a),j(!0),q.current=!0}},[e,t,n,s,r,o,u,d,f,i,a]);h.useEffect(()=>{C&&M.current(P.current,T.current)},[C]),h.useEffect(()=>{!E&&!C&&$()},[E,C,$]),L.current=s,h.useEffect(()=>{var O,V;C&&w&&((O=F.current)==null||O.dispose(),F.current=(V=P.current)==null?void 0:V.onDidChangeModelContent(G=>{H.current||w(P.current.getValue(),G)}))},[C,w]),h.useEffect(()=>{if(C){let O=T.current.editor.onDidChangeMarkers(V=>{var W;let G=(W=P.current.getModel())==null?void 0:W.uri;if(G&&V.find(K=>K.path===G.path)){let K=T.current.editor.getModelMarkers({resource:G});S==null||S(K)}});return()=>{O==null||O.dispose()}}return()=>{}},[C,S]);function I(){var O,V;(O=F.current)==null||O.dispose(),p?f&&wl.set(o,P.current.saveViewState()):(V=P.current.getModel())==null||V.dispose(),P.current.dispose()}return h.createElement(F0,{width:g,height:m,isEditorReady:C,loading:l,_ref:A,className:b,wrapperProps:v})}var d4=u4,f4=h.memo(d4),p4=f4;function Dr({className:e,as:t="label",bold:n,m:s="gjs-mb-1",size:r="m",capitalize:o=!0,children:i,tip:a,onClear:l,...u}){const d=t,f=!!l;return c.jsxs(d,{className:N(e,s,f&&z.tAo,o&&"gs-utl-capitalize",n&&"gs-utl-font-semibold",r==="s"&&"gs-utl-text-sm",a||f?"gs-utl-flex gs-utl-gap-2 gs-utl-items-center":"gs-utl-block"),...f&&{htmlFor:""},...u,children:[!!a&&c.jsx(It,{classNameWrp:"gs-utl-normal-case gs-utl-whitespace-normal",classNameContent:"gs-utl-max-w-60",title:a,children:c.jsx(oe,{icon:Z.information,size:le.s2x})}),i,f&&c.jsx(bt,{title:"Clear value",onClick:l,icon:{icon:Z.close,size:le.s2x},variant:"out-clear",border:!1,size:"",block:!0})]})}var U0=(e=>(e.primary="primary",e.secondary="secondary",e.outline="outline",e.shallow="shallow",e))(U0||{}),W0=(e=>(e.none="",e.x2s="x2s",e.xs="xs",e.s="s",e.m="m",e.lg="lg",e))(W0||{});const h4="gs-cmp-button",su=h.memo(fe(function({classNameBtn:t,className:n,children:s,tooltip:r,variant:o,onClick:i,editorEvents:a,label:l,size:u,icon:d,active:f,buttonType:p,disabled:g,...m}){const{editor:b}=ye(),[v,x]=h.useState(()=>({disabled:g,variant:o,active:f,className:n,classNameBtn:t,tooltip:r,icon:d,size:u,label:l})),y=v.variant,w=y==="outline",S=y==="secondary",C=y==="primary"?"pr":w||S?"out-clear":void 0,j=v.label,E=T=>{b&&(i==null||i({event:T,editor:b,state:v,setState:P=>x(A=>({...A,...P}))}))};h.useEffect(()=>{if(!a||!b)return;const T=Object.keys(a).reduce((A,M)=>(A[M]=(R={})=>{a[M]({fromEvent:R,editor:b,state:v,setState:F=>x(L=>({...L,...F}))})},A),{}),P=Object.keys(T);return P.forEach(A=>b.on(A,T[A])),()=>{P.forEach(A=>b.off(A,T[A]))}},[b,v]);const _=v.tooltip;return c.jsx(bt,{className:N(h4,v.classNameBtn),classNameWrp:v.className,variant:C,icon:v.icon,active:v.active,size:v.size,disabled:v.disabled,onClick:E,border:w||S,type:p,withBg:S,block:!0,...ot(_)?{title:_}:{tooltipProps:_},...m,children:j?Ye(j)?j({editor:b}):j:s})}));var Wp=(e=>(e.m="m",e.s="s",e))(Wp||{});const G0="gs-input-field",yc=e=>Lt(e)?e:"",Xa=(e={})=>N("gs-utl-w-full",z.bgTr,$r.inputText,e.disabled&&z.txtLowEmphasis),Gp=({size:e="m"}={})=>N("gs-input-container gs-utl-w-full",z.bg,re.b,re.rnd,z.br,e==="m"&&je.xy,e==="s"&&"gs-utl-px-3 gs-utl-py-1"),qr=({className:e,style:t,row:n})=>({className:N(e,"gs-utl-w-full gs-utl-flex",n?`${G0}--row gs-utl-gap-2 gs-utl-items-center`:"gs-utl-flex-col gs-utl-gap-1"),style:t}),fs=e=>{const{as:t,size:n="m",label:s,description:r,hasClear:o,onChange:i,tip:a,row:l,afterLabel:u,afterLabelButtons:d}=e,f=!!s,p=!!r,g=o!=null&&o(e)?()=>i==null?void 0:i(""):void 0;if(!f&&!(d!=null&&d.length)&&!p)return null;const m=c.jsx(c.Fragment,{children:f&&c.jsx(Dr,{as:t,className:"gs-utl-w-full",size:n,tip:p?void 0:a,onClear:g,m:"",children:s})}),b=u||d!=null&&d.length?c.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[u,d==null?void 0:d.map((v,x)=>c.jsx(su,{...v},v.id??x))]}):null;return c.jsxs(k,{className:N("gs-label-field-container",l&&"gs-utl-whitespace-nowrap"),col:!0,children:[b?c.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[m,b]}):m,p&&c.jsx(Dr,{size:n,tip:a,as:"span",className:N(z.txtLowEmphasis),capitalize:!1,children:r})]})},tt=h.forwardRef(function(t,n){const{className:s,value:r,type:o,placeholder:i,required:a,disabled:l,readOnly:u,name:d,autoFocus:f,onInput:p,onChange:g,onBlur:m,onKeyDown:b,labelAs:v}=t,[x,y]=h.useState(yc(r)),w=Xa(t),S=h.useRef(null);h.useImperativeHandle(n,()=>S.current,[]),h.useEffect(()=>{y(yc(r))},[r]),h.useEffect(()=>{const P=S.current;if(P&&f){const A=P.querySelector("input"),M=setTimeout(()=>A==null?void 0:A.focus(),tp);return()=>clearTimeout(M)}},[S.current,f]);const C=(P,A)=>{g==null||g(P,A)},j=P=>{const{key:A}=P;switch(b==null||b(P),A){case"Escape":return y(r);case"Enter":return C(x)}},E=()=>{C(x),m==null||m()},_=P=>{const A=P.target.value;y(A),p==null||p(A)},T=qr({...t,className:N(G0,s)});return c.jsxs("div",{...T,ref:S,children:[c.jsx(fs,{...t,as:v}),c.jsxs(k,{className:Gp(t),items:"center",gap:"x2s",children:[t.beforeInput,c.jsx(D,{grow:!0,children:c.jsx("input",{className:w,name:d,value:x,onChange:_,placeholder:i,required:a,onBlur:E,onKeyDown:j,readOnly:u,disabled:l,type:o,maxLength:t.maxLength})}),t.afterInput]})]})}),q0=e=>{var t;(t=e.getAction("editor.action.formatDocument"))==null||t.run()},g4="gs-field-code",m4={minimap:{enabled:!1},lineNumbers:"off",scrollBeyondLastLine:!1,contextmenu:!1,fixedOverflowWidgets:!0,showFoldingControls:"always",suggestOnTriggerCharacters:!1,lineDecorationsWidth:0,renderLineHighlight:"none",wordWrapOverride1:"off",tabSize:2,scrollbar:{verticalScrollbarSize:8,horizontal:"hidden",alwaysConsumeMouseWheel:!1}};function ir(e){const{defaultValue:t,value:n,language:s,onChange:r,clean:o,padding:i,isDarkTheme:a,className:l,containerClassName:u,minHeight:d="170px",onMount:f,readOnly:p,name:g,required:m,disabled:b,formatOnMount:v=!0,monacoOptions:x,labelAs:y}=e,w=n!==void 0,S=s,C=w?n:t,j=typeof C=="string"?C:JSON.stringify(C??"",null,2),E=qr({...e,className:N(g4,"gs-utl-flex gs-utl-h-full",u,!e.row&&"gs-utl-flex gs-utl-flex-col")}),_=N("gs-utl-relative gs-utl-flex-grow");return c.jsxs("div",{...E,children:[c.jsx(fs,{...e,as:y}),c.jsxs("div",{className:_,style:{minHeight:d},children:[g&&c.jsx("input",{className:Ee.hiddenVisually,name:g,value:j,disabled:b,required:m,onChange:()=>{}}),c.jsx("div",{className:N("gs-utl-absolute gs-utl-inset-0",b&&Ee.disabled),children:c.jsx(p4,{...w?{language:S,value:j}:{defaultLanguage:S,defaultValue:j},theme:a?"vs-dark":"light",className:N(re.b,re.rnd,z.br,l),options:{...m4,readOnly:p,...o&&{domReadOnly:!0,overviewRulerLanes:0,selectOnLineNumbers:!1,folding:!1,matchBrackets:"never",guides:{indentation:!1}},...Lt(i)&&{lineDecorationsWidth:i*2,padding:{top:i,bottom:i}},...x},onChange:r,onMount:(T,P)=>{if(v){let A=!1;const M=()=>q0(T);T.onDidChangeModelLanguageConfiguration(M),T.onDidScrollChange(()=>{A||(A=!0,M())}),setTimeout(M,10)}f==null||f(T,P)}})})]})]})}const K0=fe(function({buttonProps:t,content:n,code:s,onAction:r}){const o=ji(),i=Re(),a=ye(),{isProjectTypeEmail:l}=a,u=a.editor,{isDarkTheme:d}=Ds(),[f,p]=h.useState(),g=()=>{let b=(f||"").trim();const v=R0({code:b,appStore:a,showToastError:!0});if(!v.error)b=v.output;else return;r?r(b):l?u.loadProjectData({pages:[{component:b}]}):u.setComponents(b),o.close()};h.useEffect(()=>{s?p(s):(async()=>{var S,C;const v=await u.runCommand(ie.projectFiles,{page:u.Pages.getSelected(),skipProject:!0,styles:"inline"}),x=(S=v.find(j=>j.mimeType==="text/html"))==null?void 0:S.content,y=(C=v.find(j=>j.mimeType==="text/mjml"))==null?void 0:C.content,w=l?y:x;w&&p(w)})()},[]);const m=(t==null?void 0:t.children)||i.t("actions.importCode.button");return c.jsxs(k,{col:!0,space:"m",children:[c.jsx(D,{children:n??i.t("actions.importCode.content")}),c.jsx(D,{className:ee("h-96"),children:f!==void 0&&c.jsx(ir,{defaultValue:f,onChange:b=>p(b||""),isDarkTheme:d,language:"html"})}),c.jsx(k,{justify:"end",children:c.jsx(Ke,{size:"m2",variant:"pr",onClick:g,...t,children:m})})]})}),mf="data-type-empty",fm=(e,t)=>{e.Canvas.getFrames().forEach(n=>{const{view:s}=n,r=Array.from(s.getDoc().querySelectorAll(`style[${mf}]`));for(const o of r)o.disabled=!t})},b4=(e,t,n="Empty",s={})=>{const r=`[${mf}="${t}"]`;if(!e.frameView.getDoc())return;const o=e.frameView.getHead(),{midSelector:i="",styleOut:a="",styleIn:l=""}=s;if(!o.querySelector(`style${r}`)){const u=document.createElement("style");u.setAttribute(mf,t),u.innerHTML=`
155
+ `},Lg=IA(FA)(e0),BA={config:HA},zA=function(){for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return function(r){return n.reduceRight(function(o,i){return i(o)},r)}};function t0(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],t0(e[n],t[n]))}),Og(Og({},e),t)}var UA={type:"cancelation",msg:"operation is manually canceled"};function Du(e){var t=!1,n=new Promise(function(s,r){e.then(function(o){return t?r(UA):s(o)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var WA=kA.create({config:RA,isInitialized:!1,resolve:null,reject:null,monaco:null}),n0=mA(WA,2),Ha=n0[0],Fc=n0[1];function GA(e){var t=BA.config(e),n=t.monaco,s=gA(t,["monaco"]);Fc(function(r){return{config:t0(r.config,s),monaco:n}})}function qA(){var e=Ha(function(t){var n=t.monaco,s=t.isInitialized,r=t.resolve;return{monaco:n,isInitialized:s,resolve:r}});if(!e.isInitialized){if(Fc({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Du(Fu);if(window.monaco&&window.monaco.editor)return s0(window.monaco),e.resolve(window.monaco),Du(Fu);zA(KA,YA)(XA)}return Du(Fu)}function KA(e){return document.body.appendChild(e)}function ZA(e){var t=document.createElement("script");return e&&(t.src=e),t}function YA(e){var t=Ha(function(s){var r=s.config,o=s.reject;return{config:r,reject:o}}),n=ZA("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function XA(){var e=Ha(function(n){var s=n.config,r=n.resolve,o=n.reject;return{config:s,resolve:r,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){s0(n),e.resolve(n)},function(n){e.reject(n)})}function s0(e){Ha().monaco||Fc({monaco:e})}function JA(){return Ha(function(e){var t=e.monaco;return t})}var Fu=new Promise(function(e,t){return Fc({resolve:e,reject:t})}),r0={config:GA,init:qA,__getMonacoInstance:JA},QA={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Bu=QA,e4={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},t4=e4;function n4({children:e}){return f.createElement("div",{style:t4.container},e)}var s4=n4,r4=s4;function o4({width:e,height:t,isEditorReady:n,loading:s,_ref:r,className:o,wrapperProps:i}){return f.createElement("section",{style:{...Bu.wrapper,width:e,height:t},...i},!n&&f.createElement(r4,null,s),f.createElement("div",{ref:r,style:{...Bu.fullWidth,...!n&&Bu.hide},className:o}))}var i4=o4,o0=f.memo(i4);function a4(e){f.useEffect(e,[])}var i0=a4;function l4(e,t,n=!0){let s=f.useRef(!0);f.useEffect(s.current||!n?()=>{s.current=!1}:e,t)}var gn=l4;function Fi(){}function Uo(e,t,n,s){return c4(e,s)||u4(e,t,n,s)}function c4(e,t){return e.editor.getModel(a0(e,t))}function u4(e,t,n,s){return e.editor.createModel(t,n,s?a0(e,s):void 0)}function a0(e,t){return e.Uri.parse(t)}function d4({original:e,modified:t,language:n,originalLanguage:s,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:i,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:c=!1,theme:u="light",loading:d="Loading...",options:p={},height:h="100%",width:g="100%",className:m,wrapperProps:b={},beforeMount:v=Fi,onMount:x=Fi}){let[y,w]=f.useState(!1),[S,C]=f.useState(!0),j=f.useRef(null),E=f.useRef(null),T=f.useRef(null),O=f.useRef(x),P=f.useRef(v),_=f.useRef(!1);i0(()=>{let L=r0.init();return L.then(F=>(E.current=F)&&C(!1)).catch(F=>(F==null?void 0:F.type)!=="cancelation"&&console.error("Monaco initialization: error:",F)),()=>j.current?H():L.cancel()}),gn(()=>{if(j.current&&E.current){let L=j.current.getOriginalEditor(),F=Uo(E.current,e||"",s||n||"text",o||"");F!==L.getModel()&&L.setModel(F)}},[o],y),gn(()=>{if(j.current&&E.current){let L=j.current.getModifiedEditor(),F=Uo(E.current,t||"",r||n||"text",i||"");F!==L.getModel()&&L.setModel(F)}},[i],y),gn(()=>{let L=j.current.getModifiedEditor();L.getOption(E.current.editor.EditorOption.readOnly)?L.setValue(t||""):t!==L.getValue()&&(L.executeEdits("",[{range:L.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),L.pushUndoStop())},[t],y),gn(()=>{var L,F;(F=(L=j.current)==null?void 0:L.getModel())==null||F.original.setValue(e||"")},[e],y),gn(()=>{let{original:L,modified:F}=j.current.getModel();E.current.editor.setModelLanguage(L,s||n||"text"),E.current.editor.setModelLanguage(F,r||n||"text")},[n,s,r],y),gn(()=>{var L;(L=E.current)==null||L.editor.setTheme(u)},[u],y),gn(()=>{var L;(L=j.current)==null||L.updateOptions(p)},[p],y);let M=f.useCallback(()=>{var G;if(!E.current)return;P.current(E.current);let L=Uo(E.current,e||"",s||n||"text",o||""),F=Uo(E.current,t||"",r||n||"text",i||"");(G=j.current)==null||G.setModel({original:L,modified:F})},[n,t,r,e,s,o,i]),N=f.useCallback(()=>{var L;!_.current&&T.current&&(j.current=E.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...p}),M(),(L=E.current)==null||L.editor.setTheme(u),w(!0),_.current=!0)},[p,u,M]);f.useEffect(()=>{y&&O.current(j.current,E.current)},[y]),f.useEffect(()=>{!S&&!y&&N()},[S,y,N]);function H(){var F,G,D,$;let L=(F=j.current)==null?void 0:F.getModel();a||((G=L==null?void 0:L.original)==null||G.dispose()),c||((D=L==null?void 0:L.modified)==null||D.dispose()),($=j.current)==null||$.dispose()}return f.createElement(o0,{width:g,height:h,isEditorReady:y,loading:d,_ref:T,className:m,wrapperProps:b})}var p4=d4;f.memo(p4);function f4(e){let t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}var h4=f4,ll=new Map;function g4({defaultValue:e,defaultLanguage:t,defaultPath:n,value:s,language:r,path:o,theme:i="light",line:a,loading:c="Loading...",options:u={},overrideServices:d={},saveViewState:p=!0,keepCurrentModel:h=!1,width:g="100%",height:m="100%",className:b,wrapperProps:v={},beforeMount:x=Fi,onMount:y=Fi,onChange:w,onValidate:S=Fi}){let[C,j]=f.useState(!1),[E,T]=f.useState(!0),O=f.useRef(null),P=f.useRef(null),_=f.useRef(null),M=f.useRef(y),N=f.useRef(x),H=f.useRef(),L=f.useRef(s),F=h4(o),G=f.useRef(!1),D=f.useRef(!1);i0(()=>{let R=r0.init();return R.then(z=>(O.current=z)&&T(!1)).catch(z=>(z==null?void 0:z.type)!=="cancelation"&&console.error("Monaco initialization: error:",z)),()=>P.current?I():R.cancel()}),gn(()=>{var z,Y,Z,J;let R=Uo(O.current,e||s||"",t||r||"",o||n||"");R!==((z=P.current)==null?void 0:z.getModel())&&(p&&ll.set(F,(Y=P.current)==null?void 0:Y.saveViewState()),(Z=P.current)==null||Z.setModel(R),p&&((J=P.current)==null||J.restoreViewState(ll.get(o))))},[o],C),gn(()=>{var R;(R=P.current)==null||R.updateOptions(u)},[u],C),gn(()=>{!P.current||s===void 0||(P.current.getOption(O.current.editor.EditorOption.readOnly)?P.current.setValue(s):s!==P.current.getValue()&&(D.current=!0,P.current.executeEdits("",[{range:P.current.getModel().getFullModelRange(),text:s,forceMoveMarkers:!0}]),P.current.pushUndoStop(),D.current=!1))},[s],C),gn(()=>{var z,Y;let R=(z=P.current)==null?void 0:z.getModel();R&&r&&((Y=O.current)==null||Y.editor.setModelLanguage(R,r))},[r],C),gn(()=>{var R;a!==void 0&&((R=P.current)==null||R.revealLine(a))},[a],C),gn(()=>{var R;(R=O.current)==null||R.editor.setTheme(i)},[i],C);let $=f.useCallback(()=>{var R;if(!(!_.current||!O.current)&&!G.current){N.current(O.current);let z=o||n,Y=Uo(O.current,s||e||"",t||r||"",z||"");P.current=(R=O.current)==null?void 0:R.editor.create(_.current,{model:Y,automaticLayout:!0,...u},d),p&&P.current.restoreViewState(ll.get(z)),O.current.editor.setTheme(i),a!==void 0&&P.current.revealLine(a),j(!0),G.current=!0}},[e,t,n,s,r,o,u,d,p,i,a]);f.useEffect(()=>{C&&M.current(P.current,O.current)},[C]),f.useEffect(()=>{!E&&!C&&$()},[E,C,$]),L.current=s,f.useEffect(()=>{var R,z;C&&w&&((R=H.current)==null||R.dispose(),H.current=(z=P.current)==null?void 0:z.onDidChangeModelContent(Y=>{D.current||w(P.current.getValue(),Y)}))},[C,w]),f.useEffect(()=>{if(C){let R=O.current.editor.onDidChangeMarkers(z=>{var Z;let Y=(Z=P.current.getModel())==null?void 0:Z.uri;if(Y&&z.find(J=>J.path===Y.path)){let J=O.current.editor.getModelMarkers({resource:Y});S==null||S(J)}});return()=>{R==null||R.dispose()}}return()=>{}},[C,S]);function I(){var R,z;(R=H.current)==null||R.dispose(),h?p&&ll.set(o,P.current.saveViewState()):(z=P.current.getModel())==null||z.dispose(),P.current.dispose()}return f.createElement(o0,{width:g,height:m,isEditorReady:C,loading:c,_ref:_,className:b,wrapperProps:v})}var m4=g4,b4=f.memo(m4),v4=b4;function _r({className:e,as:t="label",bold:n,m:s="gjs-mb-1",size:r="m",capitalize:o=!0,children:i,tip:a,onClear:c,...u}){const d=t,p=!!c;return l.jsxs(d,{className:A(e,s,p&&B.tAo,o&&"gs-utl-capitalize",n&&"gs-utl-font-semibold",r==="s"&&"gs-utl-text-sm",a||p?"gs-utl-flex gs-utl-gap-2 gs-utl-items-center":"gs-utl-block"),...p&&{htmlFor:""},...u,children:[!!a&&l.jsx($t,{classNameWrp:"gs-utl-normal-case gs-utl-whitespace-normal",classNameContent:"gs-utl-max-w-60",title:a,children:l.jsx(Q,{icon:U.information,size:oe.s2x})}),i,p&&l.jsx(ft,{title:"Clear value",onClick:c,icon:{icon:U.close,size:oe.s2x},variant:"out-clear",border:!1,size:"",block:!0})]})}var l0=(e=>(e.primary="primary",e.secondary="secondary",e.outline="outline",e.shallow="shallow",e))(l0||{}),c0=(e=>(e.none="",e.x2s="x2s",e.xs="xs",e.s="s",e.m="m",e.lg="lg",e))(c0||{});const y4="gs-cmp-button",Bc=f.memo(ae(function({classNameBtn:t,className:n,children:s,tooltip:r,variant:o,onClick:i,editorEvents:a,label:c,size:u,icon:d,active:p,buttonType:h,disabled:g,...m}){const{editor:b}=me(),[v,x]=f.useState(()=>({disabled:g,variant:o,active:p,className:n,classNameBtn:t,tooltip:r,icon:d,size:u,label:c})),y=v.variant,w=y==="outline",S=y==="secondary",C=y==="primary"?"pr":w||S?"out-clear":void 0,j=v.label,E=O=>{b&&(i==null||i({event:O,editor:b,state:v,setState:P=>x(_=>({..._,...P}))}))};f.useEffect(()=>{if(!a||!b)return;const O=Object.keys(a).reduce((_,M)=>(_[M]=(N={})=>{a[M]({fromEvent:N,editor:b,state:v,setState:H=>x(L=>({...L,...H}))})},_),{}),P=Object.keys(O);return P.forEach(_=>b.on(_,O[_])),()=>{P.forEach(_=>b.off(_,O[_]))}},[b,v]);const T=v.tooltip;return l.jsx(ft,{className:A(y4,v.classNameBtn),classNameWrp:v.className,variant:C,icon:v.icon,active:v.active,size:v.size,disabled:v.disabled,onClick:E,border:w||S,type:h,withBg:S,block:!0,...nt(T)?{title:T}:{tooltipProps:T},...m,children:j?Ke(j)?j({editor:b}):j:s})}));var Cf=(e=>(e.m="m",e.s="s",e))(Cf||{});const u0="gs-input-field",oc=e=>At(e)?e:"",Da=(e={})=>A("gs-utl-w-full",B.bgTr,Er.inputText,e.disabled&&B.txtLowEmphasis),jf=({size:e="m"}={})=>A("gs-input-container gs-utl-w-full",B.bg,X.b,X.rnd,B.br,e==="m"&&we.xy,e==="s"&&"gs-utl-px-3 gs-utl-py-1"),Vr=({className:e,style:t,row:n})=>({className:A(e,"gs-utl-w-full gs-utl-flex",n?`${u0}--row gs-utl-gap-2 gs-utl-items-center`:"gs-utl-flex-col gs-utl-gap-1"),style:t}),ns=e=>{const{as:t,size:n="m",label:s,description:r,hasClear:o,onChange:i,tip:a,row:c,afterLabel:u,afterLabelButtons:d}=e,p=!!s,h=!!r,g=o!=null&&o(e)?()=>i==null?void 0:i(""):void 0;if(!p&&!(d!=null&&d.length)&&!h)return null;const m=l.jsx(l.Fragment,{children:p&&l.jsx(_r,{as:t,className:"gs-utl-w-full",size:n,tip:h?void 0:a,onClear:g,m:"",children:s})}),b=u||d!=null&&d.length?l.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[u,d==null?void 0:d.map((v,x)=>l.jsx(Bc,{...v},v.id??x))]}):null;return l.jsxs(k,{className:A("gs-label-field-container",c&&"gs-utl-whitespace-nowrap"),col:!0,children:[b?l.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[m,b]}):m,h&&l.jsx(_r,{size:n,tip:a,as:"span",className:A(B.txtLowEmphasis),capitalize:!1,children:r})]})},Je=f.forwardRef(function(t,n){const{className:s,value:r,type:o,placeholder:i,required:a,disabled:c,readOnly:u,name:d,autoFocus:p,onInput:h,onChange:g,onBlur:m,onKeyDown:b,labelAs:v}=t,[x,y]=f.useState(oc(r)),w=Da(t),S=f.useRef(null);f.useImperativeHandle(n,()=>S.current,[]),f.useEffect(()=>{y(oc(r))},[r]),f.useEffect(()=>{const P=S.current;if(P&&p){const _=P.querySelector("input"),M=setTimeout(()=>_==null?void 0:_.focus(),Lp);return()=>clearTimeout(M)}},[S.current,p]);const C=(P,_)=>{g==null||g(P,_)},j=P=>{const{key:_}=P;switch(b==null||b(P),_){case"Escape":return y(r);case"Enter":return C(x)}},E=()=>{C(x),m==null||m()},T=P=>{const _=P.target.value;y(_),h==null||h(_)},O=Vr({...t,className:A(u0,s)});return l.jsxs("div",{...O,ref:S,children:[l.jsx(ns,{...t,as:v}),l.jsxs(k,{className:jf(t),items:"center",gap:"x2s",children:[t.beforeInput,l.jsx(V,{grow:!0,children:l.jsx("input",{className:w,name:d,value:x,onChange:T,placeholder:i,required:a,onBlur:E,onKeyDown:j,readOnly:u,disabled:c,type:o,maxLength:t.maxLength})}),t.afterInput]})]})}),d0=e=>{var t;(t=e.getAction("editor.action.formatDocument"))==null||t.run()},x4="gs-field-code",w4={minimap:{enabled:!1},lineNumbers:"off",scrollBeyondLastLine:!1,contextmenu:!1,fixedOverflowWidgets:!0,showFoldingControls:"always",suggestOnTriggerCharacters:!1,lineDecorationsWidth:0,renderLineHighlight:"none",wordWrapOverride1:"off",tabSize:2,scrollbar:{verticalScrollbarSize:8,horizontal:"hidden",alwaysConsumeMouseWheel:!1}};function Xs(e){const{defaultValue:t,value:n,language:s,onChange:r,clean:o,padding:i,isDarkTheme:a,className:c,containerClassName:u,minHeight:d="170px",onMount:p,readOnly:h,name:g,required:m,disabled:b,formatOnMount:v=!0,monacoOptions:x,labelAs:y}=e,w=n!==void 0,S=s,C=w?n:t,j=typeof C=="string"?C:JSON.stringify(C??"",null,2),E=Vr({...e,className:A(x4,"gs-utl-flex gs-utl-h-full",u,!e.row&&"gs-utl-flex gs-utl-flex-col")}),T=A("gs-utl-relative gs-utl-flex-grow");return l.jsxs("div",{...E,children:[l.jsx(ns,{...e,as:y}),l.jsxs("div",{className:T,style:{minHeight:d},children:[g&&l.jsx("input",{className:Se.hiddenVisually,name:g,value:j,disabled:b,required:m,onChange:()=>{}}),l.jsx("div",{className:A("gs-utl-absolute gs-utl-inset-0",b&&Se.disabled),children:l.jsx(v4,{...w?{language:S,value:j}:{defaultLanguage:S,defaultValue:j},theme:a?"vs-dark":"light",className:A(X.b,X.rnd,B.br,c),options:{...w4,readOnly:h,...o&&{domReadOnly:!0,overviewRulerLanes:0,selectOnLineNumbers:!1,folding:!1,matchBrackets:"never",guides:{indentation:!1}},...At(i)&&{lineDecorationsWidth:i*2,padding:{top:i,bottom:i}},...x},onChange:r,onMount:(O,P)=>{if(v){let _=!1;const M=()=>d0(O);O.onDidChangeModelLanguageConfiguration(M),O.onDidScrollChange(()=>{_||(_=!0,M())}),setTimeout(M,10)}p==null||p(O,P)}})})]})]})}const p0=ae(function({buttonProps:t,content:n,code:s,onAction:r}){const o=di(),i=Ae(),a=me(),{isProjectTypeEmail:c}=a,u=a.editor,{isDarkTheme:d}=_s(),[p,h]=f.useState(),g=()=>{let b=(p||"").trim();const v=Jv({code:b,appStore:a,showToastError:!0});if(!v.error)b=v.output;else return;r?r(b):c?u.loadProjectData({pages:[{component:b}]}):u.setComponents(b),o.close()};f.useEffect(()=>{s?h(s):(async()=>{var S,C;const v=await u.runCommand(se.projectFiles,{page:u.Pages.getSelected(),skipProject:!0,styles:"inline"}),x=(S=v.find(j=>j.mimeType==="text/html"))==null?void 0:S.content,y=(C=v.find(j=>j.mimeType==="text/mjml"))==null?void 0:C.content,w=c?y:x;w&&h(w)})()},[]);const m=(t==null?void 0:t.children)||i.t("actions.importCode.button");return l.jsxs(k,{col:!0,space:"m",children:[l.jsx(V,{children:n??i.t("actions.importCode.content")}),l.jsx(V,{className:K("h-96"),children:p!==void 0&&l.jsx(Xs,{defaultValue:p,onChange:b=>h(b||""),isDarkTheme:d,language:"html"})}),l.jsx(k,{justify:"end",children:l.jsx(Ge,{size:"m2",variant:"pr",onClick:g,...t,children:m})})]})}),Zd="data-type-empty",Ng=(e,t)=>{e.Canvas.getFrames().forEach(n=>{const{view:s}=n,r=Array.from(s.getDoc().querySelectorAll(`style[${Zd}]`));for(const o of r)o.disabled=!t})},S4=(e,t,n="Empty",s={})=>{const r=`[${Zd}="${t}"]`;if(!e.frameView.getDoc())return;const o=e.frameView.getHead(),{midSelector:i="",styleOut:a="",styleIn:c=""}=s;if(!o.querySelector(`style${r}`)){const u=document.createElement("style");u.setAttribute(Zd,t),u.innerHTML=`
210
156
  [data-gjs-type="${t}"]${i}:empty {
211
157
  text-decoration: none;
212
158
  padding: 5px;
@@ -233,19 +179,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
233
179
  content: "${n}";
234
180
  ${s.limitH?"height: auto;":""}
235
181
  ${s.smallH?"min-height: 30px;":""}
236
- ${l}
237
- }`,o.appendChild(u)}},Y0=(e,t)=>{const{model:n}=t,s=n.constructor.getDefaults(),r=s.emptyState,o=n.get("type");if(!r||s.void===!0||o!==e)return;const i=r===!0?{}:r;b4(t,o,n.getName({noCustom:!0}),i)},v4=function(t){const{Components:n}=t,s=r=>{const{id:o}=r;n.addType(o,{extendFnView:["onRender"],view:{onRender(){Y0(o,this)}}})};n.getTypes().forEach(s),t.on("component:type:add",s)};function y4(e,t){const{Components:n}=e,s=n.events,{modalStore:r,i18nStore:o,fontsStore:i}=t.appStore.store,{root:a,head:l,body:u}=ya,{attributes:d,class:f,font:p,all:g,preview:m,title:b,style:v,breakpoint:x}=Up,{wrapper:y,section:w,column:S,text:C,button:j,image:E,divider:_,group:T,social:P,socialElement:A,spacer:M,navbar:R,navbarLink:F,table:L,raw:B}=wr,{model:q}=n.getType("default"),{model:H}=n.getType(a),{model:$}=n.getType(u),{model:I}=n.getType(p),{model:O,view:V}=n.getType(l),{model:G,view:W}=n.getType(R),{model:K,view:J}=n.getType(F),{model:Y,view:U}=n.getType(y),{model:Q,view:se}=n.getType(w),{model:de,view:Se}=n.getType(S),{model:ne,view:Te}=n.getType(C),{model:ke,view:it}=n.getType(j),{model:st}=n.getType(E),{model:xe,view:Ze}=n.getType(_),{model:Xe,view:ft}=n.getType(M),{view:Ae,model:at}=n.getType(P),{view:rt,model:Ie}=n.getType(A),{view:Wt,model:ge}=n.getType(T),$e=ko.globalStyles,Ve="css-class",Me={id:"link",name:"href",label:"Link",placeholder:"Link to redirect on click"},wt={name:"src",type:"image",typeProps:{inputField:!0},label:"Image"},$t={type:"checkbox",label:"Full width",name:"full-width",valueTrue:"full-width",valueFalse:""},zs={type:"select",label:"Direction",name:"direction",default:"ltr",options:[{id:"ltr",name:"Left To Right"},{id:"rtl",name:"Right To Left"}]},Qr={label:"Content",getValue:({component:X})=>X.getInnerHTML(),setValue:({component:X,value:pe})=>X.components(pe)},We=X=>{r.open({title:X.getName({noCustom:!0}),content:()=>c.jsx(K0,{content:"",code:X.getInnerHTML(),onAction:pe=>X.components(pe),buttonProps:{children:o.t("save")}})})},pt=X=>{var he;const pe=X.getChildrenContainer();((he=pe==null?void 0:pe.innerHTML)==null?void 0:he.trim())===""&&(pe.innerHTML="")},Gt=X=>X.set({void:!1},{silent:!0});function Nn(X={}){return q.prototype.toHTML.call(this,X)}function Ht(X){const pe=X.closestType(a),he=pe==null?void 0:pe.findType(l)[0];return(he==null?void 0:he.toHTML())||""}function eo(X){const pe=X.toHTML(),he=e.runCommand(tu,{mjml:pe}),At=new DOMParser().parseFromString(he.html,"text/html");return{mjml:pe,mjmlToHtml:he,document:At}}const an=function(X){const pe=X.model,he=Tr(()=>{var Oe;return(Oe=pe.closestType(a))==null?void 0:Oe.trigger("rerender")});X.listenTo(pe.components(),"add remove reset change",he)},Us=(X,pe)=>X.replace(`<${a}>`,`<${a}>${Ht(pe)}`),fr=X=>`cls-${X.tagName}-${X.getId()}`,pr=(X,pe)=>{const he={...X.get("attributes")||{}};return delete he.style,{...he,[Ve]:`${he[Ve]||""} ${fr(X)}`.trim()}},hr=(X,pe)=>{const he=X.closestType(a),Oe=(he==null?void 0:he.findFirstType(l))||(he==null?void 0:he.append({type:l})[0]);Oe==null||Oe.trigger(pe?"rerenderHeadImmediate":"rerenderHead")},gr=X=>function(){return pr(this)},Xt=(X,pe)=>function(he){const Oe=he.querySelector(`.${fr(this.model)}`);return(pe?Oe:Oe==null?void 0:Oe.outerHTML)||X.prototype.getTemplateFromEl.call(this,he)},Qn=X=>function(...pe){const he=X.prototype.toJSON.apply(this,pe),Oe=he.attributes||{};return delete he.style,delete Oe.style,delete Oe.__p,he},ol=X=>function(...pe){const he=X.prototype.getAttrToHTML.apply(this,pe);return delete he.__p,he};function Io(){return{start:`<mjml>${Ht(this.model)}<mj-body><mj-column>`,end:"</mj-column></mj-body></mjml>"}}function Xx(){var he;const X=(he=this.model.parent())==null?void 0:he.is(d),pe=Ch(this.model,{withSiblings:!X,withHead:!X,beforeRootEnd:X?`<${u}><${w}><${S}/></${w}></${u}>`:""});return{start:pe.start,end:pe.end}}function Jx(){this.stopListening(this.model,"change:style"),this.listenTo(this.model,"change:attributes change:src",this.rerender)}const Ch=(X,pe={})=>{var Ln;const he=X.parents().filter(vn=>vn.tagName.startsWith("mj-")),Oe=he.map(vn=>`<${vn.tagName}>`).reverse().join(""),At=he.map(vn=>`</${vn.tagName}>`).join(""),Et=pe.withHead?Ht(X):"",Mn=pe.withSiblings?(Ln=X.parent())==null?void 0:Ln.components().filter(vn=>vn!==X).map(({tagName:vn})=>`<${vn}></${vn}>`).join(""):"";return{start:`<${a}>${Et}${Oe}`,end:`${Mn||""}${At}${pe.beforeRootEnd||""}</${a}>`}},qt=({model:X,noVoid:pe})=>({init(){const he={...this.get("style-default"),...this.getStylesToAttributes(),...this.getAttributes({skipResolve:!0,noStyle:!0,noClass:!0})};this.set("attributes",he),this.set("style",he),this.listenTo(this,"change:style",this.handleStyleChange),this.listenTo(this,"change:attributes",this.handleAttributeChange),pe&&Gt(this)},handleStyleChange(he,Oe,At){if(At.fromAttr||At.fromSync)return;const Et=this.getStylesToAttributes();this.set("attributes",Et,{...At,fromStyle:!0,fromSync:!0})},handleAttributeChange(he,Oe,At){if(At.fromStyle||At.fromSync)return;const Et=this.getAttributes({skipResolve:!0,noStyle:!0,noClass:!0});this.setStyle(Et,{...At,fromAttr:!0,fromSync:!0})},getStylesToAttributes(){const he=this.getStyle({skipResolve:!0})||{};return delete he.__p,he},getAttrToHTML:ol(X),getMjmlAttributes:gr(),toJSON:Qn(X)});n.addType("wrapper",{extendFn:["init"],model:{defaults:{droppable:!1,stylable:!1,delegate:{layer:X=>X.findType(a)[0]}},init(){this.on(`${s.update}:components`,this.__updateLayersRoot)},__updateLayersRoot(){this.findFirstType(a)&&e.Layers.setRoot(this)}}}),n.addType(a,{model:{...qt({model:H}),defaults:{tagName:a,name:"Root",toolbar:[]},toHTML:Nn},view:{reset(){this.render()}}}),n.addType(l,{model:{defaults:{tagName:l,name:"Head",copyable:!1,stylable:!1,traits:[],icon:'<svg viewBox="0 0 24 24"><path d="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z" /></svg>'},toJSON:Qn(O)},view:{init(){this.renderHeadDebounced=Tr(this.renderHead,30);const{em:X,el:pe,model:he}=this,Oe=he.components(),At="core:preview",Et=X.Commands.events;this.listenTo(X,`${Et.runCommand}${At}`,()=>{pe.style.display="none"}),this.listenTo(X,`${Et.stopCommand}${At}`,()=>{pe.style.display=""}),this.listenTo(Oe,"change",this.onComponentsChange),this.listenTo(Oe,"add remove reset",this.renderHead),this.listenTo(he,"rerenderHead",this.renderHeadDebounced),this.listenTo(he,"rerenderHeadImmediate",this.renderHead)},onComponentsChange(X){const pe=Object.keys(X.changedAttributes());pe.length===1&&pe[0]==="status"||this.renderHead()},renderHead(){var Ln;const{model:X,el:pe}=this,he=pe.ownerDocument;if(!(he&&he!==document))return;const At=X.closestType(a),Et=At&&eo(At),Mn=(Ln=Et==null?void 0:Et.document)==null?void 0:Ln.head;if(Mn){const vn="mjml-head-result",ju=he.querySelector(vn)||he.createElement(vn);ju.innerHTML=Mn.innerHTML,!he.head.contains(ju)&&he.head.prepend(ju)}},render(...X){const pe=V.prototype.render.apply(this,X);return this.renderHeadDebounced(),pe}}}),n.addType(d,{isComponent:zo(d),model:{defaults:{tagName:d,name:"Attributes",copyable:!1,layerable:!1,stylable:!1,draggable:Cs(l),traits:[]},toJSON:Qn(q)},view:{onRender(){this.el.style.display="none"},init(){an(this)}}}),n.addType(f,{isComponent:zo(f),model:{defaults:{tagName:f,name:"Class",stylable:!1,draggable:Cs(d),traits:[]},toJSON:Qn(q)}}),n.addType(p,{model:{...qt({model:I}),defaults:{tagName:p,name:"Font",stylable:!1,draggable:Cs(l),icon:'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1-3.5 7H18V9M5 3h5a2 2 0 0 1 2 2v11H9v-5H6v5H3V5a2 2 0 0 1 2-2m1 2v4h3V5H6Z"/></svg>',traits:[{name:"name",placeholder:"Name of the font"},{name:"href",placeholder:"URL of a hosted CSS file"}]}},view:{tagName:()=>"div",render(){return this.el.style.cssText="",this}}}),n.addType(x,{extend:a,isComponent:zo(x),model:{defaults:{tagName:x,name:"Breakpoint",stylable:["width"],removable:!0,droppable:!1,draggable:Cs(l),icon:'<svg viewBox="0 0 24 24"><path d="M22,17H18V10H22M23,8H17A1,1 0 0,0 16,9V19A1,1 0 0,0 17,20H23A1,1 0 0,0 24,19V9A1,1 0 0,0 23,8M4,6H22V4H4A2,2 0 0,0 2,6V17H0V20H14V17H4V6Z" /></svg>',traits:[]}},view:{attributes:{},render(){return this.el.style.cssText="",this}}}),n.addType(g,{isComponent:zo(g),model:{defaults:{tagName:g,name:"All",stylable:!1,void:!0,draggable:Cs(d),traits:[]},toHTML(...X){return H.prototype.toHTML.apply(this,X)},toJSON:Qn(q)}}),n.addType(m,{isComponent:zo(m),model:{defaults:{tagName:m,name:"Preview",copyable:!1,droppable:!1,stylable:!1,draggable:Cs(l),traits:[Qr],icon:`<svg viewBox="0 0 24 24">
182
+ ${c}
183
+ }`,o.appendChild(u)}},f0=(e,t)=>{const{model:n}=t,s=n.constructor.getDefaults(),r=s.emptyState,o=n.get("type");if(!r||s.void===!0||o!==e)return;const i=r===!0?{}:r;S4(t,o,n.getName({noCustom:!0}),i)},C4=function(t){const{Components:n}=t,s=r=>{const{id:o}=r;n.addType(o,{extendFnView:["onRender"],view:{onRender(){f0(o,this)}}})};n.getTypes().forEach(s),t.on("component:type:add",s)};function j4(e,t){const{Components:n}=e,s=n.events,{modalStore:r,i18nStore:o,fontsStore:i}=t.appStore.store,{root:a,head:c,body:u}=aa,{attributes:d,class:p,font:h,all:g,preview:m,title:b,style:v,breakpoint:x}=Sf,{wrapper:y,section:w,column:S,text:C,button:j,image:E,divider:T,group:O,social:P,socialElement:_,spacer:M,navbar:N,navbarLink:H,table:L,raw:F}=dr,{model:G}=n.getType("default"),{model:D}=n.getType(a),{model:$}=n.getType(u),{model:I}=n.getType(h),{model:R,view:z}=n.getType(c),{model:Y,view:Z}=n.getType(N),{model:J,view:ee}=n.getType(H),{model:te,view:q}=n.getType(y),{model:ne,view:ce}=n.getType(w),{model:ge,view:Re}=n.getType(S),{model:ve,view:qe}=n.getType(C),{model:Be,view:ht}=n.getType(j),{model:et}=n.getType(E),{model:be,view:Ze}=n.getType(T),{model:Ye,view:lt}=n.getType(M),{view:Pe,model:st}=n.getType(P),{view:tt,model:Ne}=n.getType(_),{view:Dt,model:pe}=n.getType(O),Me=Po.globalStyles,Le="css-class",Oe={id:"link",name:"href",label:"Link",placeholder:"Link to redirect on click"},vt={name:"src",type:"image",typeProps:{inputField:!0},label:"Image"},Mt={type:"checkbox",label:"Full width",name:"full-width",valueTrue:"full-width",valueFalse:""},Ns={type:"select",label:"Direction",name:"direction",default:"ltr",options:[{id:"ltr",name:"Left To Right"},{id:"rtl",name:"Right To Left"}]},Ur={label:"Content",getValue:({component:W})=>W.getInnerHTML(),setValue:({component:W,value:le})=>W.components(le)},ze=W=>{r.open({title:W.getName({noCustom:!0}),content:()=>l.jsx(p0,{content:"",code:W.getInnerHTML(),onAction:le=>W.components(le),buttonProps:{children:o.t("save")}})})},ct=W=>{var ue;const le=W.getChildrenContainer();((ue=le==null?void 0:le.innerHTML)==null?void 0:ue.trim())===""&&(le.innerHTML="")},Ft=W=>W.set({void:!1},{silent:!0});function Cn(W={}){return G.prototype.toHTML.call(this,W)}function Rt(W){const le=W.closestType(a),ue=le==null?void 0:le.findType(c)[0];return(ue==null?void 0:ue.toHTML())||""}function Wr(W){const le=W.toHTML(),ue=e.runCommand(Dc,{mjml:le}),Tt=new DOMParser().parseFromString(ue.html,"text/html");return{mjml:le,mjmlToHtml:ue,document:Tt}}const nn=function(W){const le=W.model,ue=vr(()=>{var Ee;return(Ee=le.closestType(a))==null?void 0:Ee.trigger("rerender")});W.listenTo(le.components(),"add remove reset change",ue)},$s=(W,le)=>W.replace(`<${a}>`,`<${a}>${Rt(le)}`),nr=W=>`cls-${W.tagName}-${W.getId()}`,sr=(W,le)=>{const ue={...W.get("attributes")||{}};return delete ue.style,{...ue,[Le]:`${ue[Le]||""} ${nr(W)}`.trim()}},rr=(W,le)=>{const ue=W.closestType(a),Ee=(ue==null?void 0:ue.findFirstType(c))||(ue==null?void 0:ue.append({type:c})[0]);Ee==null||Ee.trigger(le?"rerenderHeadImmediate":"rerenderHead")},or=W=>function(){return sr(this)},qt=(W,le)=>function(ue){const Ee=ue.querySelector(`.${nr(this.model)}`);return(le?Ee:Ee==null?void 0:Ee.outerHTML)||W.prototype.getTemplateFromEl.call(this,ue)},Bn=W=>function(...le){const ue=W.prototype.toJSON.apply(this,le),Ee=ue.attributes||{};return delete ue.style,delete Ee.style,delete Ee.__p,ue},Ka=W=>function(...le){const ue=W.prototype.getAttrToHTML.apply(this,le);return delete ue.__p,ue};function Oo(){return{start:`<mjml>${Rt(this.model)}<mj-body><mj-column>`,end:"</mj-column></mj-body></mjml>"}}function th(){var ue;const W=(ue=this.model.parent())==null?void 0:ue.is(d),le=nh(this.model,{withSiblings:!W,withHead:!W,beforeRootEnd:W?`<${u}><${w}><${S}/></${w}></${u}>`:""});return{start:le.start,end:le.end}}function gx(){this.stopListening(this.model,"change:style"),this.listenTo(this.model,"change:attributes change:src",this.rerender)}const nh=(W,le={})=>{var En;const ue=W.parents().filter(fn=>fn.tagName.startsWith("mj-")),Ee=ue.map(fn=>`<${fn.tagName}>`).reverse().join(""),Tt=ue.map(fn=>`</${fn.tagName}>`).join(""),St=le.withHead?Rt(W):"",jn=le.withSiblings?(En=W.parent())==null?void 0:En.components().filter(fn=>fn!==W).map(({tagName:fn})=>`<${fn}></${fn}>`).join(""):"";return{start:`<${a}>${St}${Ee}`,end:`${jn||""}${Tt}${le.beforeRootEnd||""}</${a}>`}},Bt=({model:W,noVoid:le})=>({init(){const ue={...this.get("style-default"),...this.getStylesToAttributes(),...this.getAttributes({skipResolve:!0,noStyle:!0,noClass:!0})};this.set("attributes",ue),this.set("style",ue),this.listenTo(this,"change:style",this.handleStyleChange),this.listenTo(this,"change:attributes",this.handleAttributeChange),le&&Ft(this)},handleStyleChange(ue,Ee,Tt){if(Tt.fromAttr||Tt.fromSync)return;const St=this.getStylesToAttributes();this.set("attributes",St,{...Tt,fromStyle:!0,fromSync:!0})},handleAttributeChange(ue,Ee,Tt){if(Tt.fromStyle||Tt.fromSync)return;const St=this.getAttributes({skipResolve:!0,noStyle:!0,noClass:!0});this.setStyle(St,{...Tt,fromAttr:!0,fromSync:!0})},getStylesToAttributes(){const ue=this.getStyle({skipResolve:!0})||{};return delete ue.__p,ue},getAttrToHTML:Ka(W),getMjmlAttributes:or(),toJSON:Bn(W)});n.addType("wrapper",{extendFn:["init"],model:{defaults:{droppable:!1,stylable:!1,delegate:{layer:W=>W.findType(a)[0]}},init(){this.on(`${s.update}:components`,this.__updateLayersRoot)},__updateLayersRoot(){this.findFirstType(a)&&e.Layers.setRoot(this)}}}),n.addType(a,{model:{...Bt({model:D}),defaults:{tagName:a,name:"Root",toolbar:[]},toHTML:Cn},view:{reset(){this.render()}}}),n.addType(c,{model:{defaults:{tagName:c,name:"Head",copyable:!1,stylable:!1,traits:[],icon:'<svg viewBox="0 0 24 24"><path d="M14.6,16.6L19.2,12L14.6,7.4L16,6L22,12L16,18L14.6,16.6M9.4,16.6L4.8,12L9.4,7.4L8,6L2,12L8,18L9.4,16.6Z" /></svg>'},toJSON:Bn(R)},view:{init(){this.renderHeadDebounced=vr(this.renderHead,30);const{em:W,el:le,model:ue}=this,Ee=ue.components(),Tt="core:preview",St=W.Commands.events;this.listenTo(W,`${St.runCommand}${Tt}`,()=>{le.style.display="none"}),this.listenTo(W,`${St.stopCommand}${Tt}`,()=>{le.style.display=""}),this.listenTo(Ee,"change",this.onComponentsChange),this.listenTo(Ee,"add remove reset",this.renderHead),this.listenTo(ue,"rerenderHead",this.renderHeadDebounced),this.listenTo(ue,"rerenderHeadImmediate",this.renderHead)},onComponentsChange(W){const le=Object.keys(W.changedAttributes());le.length===1&&le[0]==="status"||this.renderHead()},renderHead(){var En;const{model:W,el:le}=this,ue=le.ownerDocument;if(!(ue&&ue!==document))return;const Tt=W.closestType(a),St=Tt&&Wr(Tt),jn=(En=St==null?void 0:St.document)==null?void 0:En.head;if(jn){const fn="mjml-head-result",cu=ue.querySelector(fn)||ue.createElement(fn);cu.innerHTML=jn.innerHTML,!ue.head.contains(cu)&&ue.head.prepend(cu)}},render(...W){const le=z.prototype.render.apply(this,W);return this.renderHeadDebounced(),le}}}),n.addType(d,{isComponent:No(d),model:{defaults:{tagName:d,name:"Attributes",copyable:!1,layerable:!1,stylable:!1,draggable:fs(c),traits:[]},toJSON:Bn(G)},view:{onRender(){this.el.style.display="none"},init(){nn(this)}}}),n.addType(p,{isComponent:No(p),model:{defaults:{tagName:p,name:"Class",stylable:!1,draggable:fs(d),traits:[]},toJSON:Bn(G)}}),n.addType(h,{model:{...Bt({model:I}),defaults:{tagName:h,name:"Font",stylable:!1,draggable:fs(c),icon:'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1-3.5 7H18V9M5 3h5a2 2 0 0 1 2 2v11H9v-5H6v5H3V5a2 2 0 0 1 2-2m1 2v4h3V5H6Z"/></svg>',traits:[{name:"name",placeholder:"Name of the font"},{name:"href",placeholder:"URL of a hosted CSS file"}]}},view:{tagName:()=>"div",render(){return this.el.style.cssText="",this}}}),n.addType(x,{extend:a,isComponent:No(x),model:{defaults:{tagName:x,name:"Breakpoint",stylable:["width"],removable:!0,droppable:!1,draggable:fs(c),icon:'<svg viewBox="0 0 24 24"><path d="M22,17H18V10H22M23,8H17A1,1 0 0,0 16,9V19A1,1 0 0,0 17,20H23A1,1 0 0,0 24,19V9A1,1 0 0,0 23,8M4,6H22V4H4A2,2 0 0,0 2,6V17H0V20H14V17H4V6Z" /></svg>',traits:[]}},view:{attributes:{},render(){return this.el.style.cssText="",this}}}),n.addType(g,{isComponent:No(g),model:{defaults:{tagName:g,name:"All",stylable:!1,void:!0,draggable:fs(d),traits:[]},toHTML(...W){return D.prototype.toHTML.apply(this,W)},toJSON:Bn(G)}}),n.addType(m,{isComponent:No(m),model:{defaults:{tagName:m,name:"Preview",copyable:!1,droppable:!1,stylable:!1,draggable:fs(c),traits:[Ur],icon:`<svg viewBox="0 0 24 24">
238
184
  <path d="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z" />
239
- </svg>`},toJSON:Qn(q)},view:{tagName:()=>"div",init(){const X=this.model.components();this.onRender=Tr(this.onRender,1),this.listenTo(X,"add remove reset change",this.onRender)},onRender(){const{model:X,el:pe}=this,he=X.getName({noCustom:!0}),Oe=X.getInnerHTML();pe.innerHTML=`<b>${he}</b>: ${Oe}`,pe.style.padding="5px 10px",pe.style.fontFamily="system-ui"}}}),n.addType(b,{isComponent:zo(b),extend:m,model:{defaults:{tagName:b,name:"Title",icon:'<svg viewBox="0 0 24 24"><path d="M5,4V7H10.5V19H13.5V7H19V4H5Z" /></svg>'}}}),n.addType(v,{model:{defaults:{tagName:v,name:"Style",droppable:!1,layerable:!1,stylable:!1,traits:[]},toJSON:Qn(q)},view:{render(){return this}}}),n.addType(u,{model:{...qt({model:$,noVoid:!0}),defaults:{tagName:u,icon:'<svg viewBox="0 0 24 24"><path d="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M6,8V16H18V8H6Z" /></svg>',traits:[],emptyState:{midSelector:">div",styleOut:"height: 100vh;"}}}}),n.addType(y,{model:{...qt({model:Y,noVoid:!0}),defaults:{tagName:y,icon:'<svg viewBox="0 0 24 24"><path d="M19 16H5V8h14m0-5H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2"/></svg>',stylable:["background-position","padding","padding-top","padding-left","padding-right","padding-bottom","border","border-width","border-style","border-color","background-color","background-url","background-repeat","background-size"],traits:[$t]}},view:{attributes:{},getMjmlTemplate:Xx,getTemplateFromEl:Xt(U),init:Jx}}),n.addType(w,{model:{...qt({model:Q,noVoid:!0}),defaults:{tagName:w,"style-default":{padding:"20px 0px",direction:"ltr","text-align":"center"},icon:'<svg viewBox="0 0 24 24"><path d="M4 4.8a1.8 1.8 0 0 0-1.8 1.7v3c0 1 .8 1.8 1.8 1.8h16a1.8 1.8 0 0 0 1.8-1.8v-3A1.8 1.8 0 0 0 20 4.7zm0 8a1.8 1.8 0 0 0-1.8 1.7v3c0 1 .8 1.8 1.8 1.8h16a1.8 1.8 0 0 0 1.8-1.8v-3a1.8 1.8 0 0 0-1.8-1.8z"/></svg>',traits:[zs,$t],emptyState:{midSelector:">div>table>tbody>tr>td"}}},extendFnView:["render"],view:{getTemplateFromEl:Xt(se),getMjmlTemplate(){const{start:X,end:pe}=se.prototype.getMjmlTemplate.call(this);return{start:Us(X,this.model),end:pe}},render(){return pt(this),this},attributes:{}}}),n.addType(T,{model:{...qt({model:ge,noVoid:!0}),defaults:{tagName:T,"style-default":{direction:"ltr"},icon:'<svg viewBox="0 0 24 24"><path d="M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z" /></svg>',traits:[zs]}},extendFnView:["init"],view:{init(){this.listenTo(this.model.components(),"add remove reset",this.render)},getTemplateFromEl:Xt(Wt,!0),getChildrenContainer(){return this.el},getMjmlTemplate(){return{start:"<mjml><mj-body><mj-section>",end:"</mj-section></mj-body></mjml>"}},render(){const X=this.getTemplateFromMjml(),pe=cw(X);return this.renderAttributes(),this.$el.attr(pe),this.el.innerHTML=X.innerHTML,this.renderChildren(),this.childNodes=this.getChildrenContainer().childNodes,this.updateStatus(),this.postRender(),this}}});const Qx=[C,E,j,_,M,P,A,B,L,T,R,F,wr.carousel,wr.carouselImage,wr.accordion,wr.accordionElement,wr.accordionTitle,wr.accordionText];n.addType(S,{model:{...qt({model:de,noVoid:!0}),defaults:{tagName:S,icon:'<svg viewBox="0 0 24 24"><path d="M14.5 2.3A1.8 1.8 0 0 0 12.7 4v16c0 1 .8 1.8 1.8 1.8h3a1.8 1.8 0 0 0 1.8-1.8V4a1.8 1.8 0 0 0-1.8-1.8zm-8 0A1.8 1.8 0 0 0 4.7 4v16c0 1 .8 1.8 1.8 1.8h3a1.8 1.8 0 0 0 1.8-1.8V4a1.8 1.8 0 0 0-1.8-1.8z"/></svg>',traits:[],stylable:[...de.getDefaults().stylable,"inner-background-color"],droppable:X=>Qx.includes(X.getType()),emptyState:{midSelector:">table>tbody",styleIn:"margin: 0 10px;"}}},view:{getMjmlTemplate(){var he;const X=(he=this.model.parent())==null?void 0:he.is(d),pe=Ch(this.model,{withSiblings:!X,withHead:!X,beforeRootEnd:X?`<${u}><${w}><${S}/></${w}></${u}>`:""});return{start:pe.start,end:pe.end}},getTemplateFromEl:Xt(Se,!0),getChildrenContainer(){const{el:X}=this;return X.querySelector("td > table tbody")||X.querySelector("table tbody")||X},render(){this.renderAttributes();const X=this.getTemplateFromMjml();return this.el.innerHTML=X.content,this.$el.attr(X.attributes),this.getChildrenContainer().innerHTML=this.model.get("content"),this.renderChildren(),this.updateStatus(),this.postRender(),hr(this.model,!0),this}}}),n.addType(C,{model:{...qt({model:ne}),defaults:{tagName:C,emptyState:{midSelector:' [contenteditable="false"]:not([data-type-data-variable])',styleIn:"min-height: 20px;",styleOut:"padding: 0 5px;"},traits:[],"style-default":{padding:"10px 25px"}}},view:{getMjmlTemplate:Io,getTemplateFromEl:Xt(Te),attributes:{style:"display: table; width: 100%"}}}),n.addType(j,{model:{...qt({model:ke,noVoid:!0}),defaults:{tagName:j,traits:[Me],stylable:[...ke.getDefaults().stylable,"inner-padding"],"style-default":{}}},view:{getMjmlTemplate:Io,getTemplateFromEl:Xt(it)}}),n.addType(E,{model:{...qt({model:st}),defaults:{tagName:E,"style-default":{align:"center"},traits:[wt,{id:"altText",name:"alt",placeholder:"Image description"},"title",Me,{type:"checkbox",label:"Full width on mobile",name:"fluid-on-mobile",valueTrue:"true"}]},getAttrToHTML(){const X=st.prototype.getAttrToHTML.call(this);return this.isDefaultSrc()&&delete X.src,X},getMjmlAttributes(){const X=pr(this);return this.isDefaultSrc()&&delete X.src,X}},view:{updateSrc(){const{model:X}=this,pe=X.get("src",{skipResolve:!0})||X.getSrcResult();X.addAttributes({src:pe}),this.updateClasses()},getMjmlTemplate(){return{start:`<mjml>${Ht(this.model)}<mj-body><mj-section><mj-column>`,end:"</mj-column></mj-section></mj-body></mjml>"}},getTemplateFromEl(X){var pe,he,Oe;return(Oe=(he=(pe=X.querySelector("img"))==null?void 0:pe.closest("table"))==null?void 0:he.closest("tr"))==null?void 0:Oe.innerHTML},attributes:{style:"display: table; width: 100%; user-select: none;"}}}),n.addType(_,{model:{...qt({model:xe}),defaults:{tagName:_,"style-default":{width:"100%",align:"center"},traits:[{name:"align",type:"radio",options:[{id:"left",title:"Left",labelReact:c.jsx(oe,{icon:Z.alignHorizontalLeft,size:le.sx})},{id:"center",title:"Center",labelReact:c.jsx(oe,{icon:Z.alignHorizontalCenter,size:le.sx})},{id:"right",title:"Right",labelReact:c.jsx(oe,{icon:Z.alignHorizontalRight,size:le.sx})}]}]}},view:{getMjmlTemplate:Io,getTemplateFromEl:Xt(Ze)}}),n.addType(P,{model:{...qt({model:at}),defaults:{tagName:P,name:"Social",traits:[],emptyState:{midSelector:">td"},"style-default":{align:"center"},stylable:[...at.getDefaults().stylable,"inner-padding"]}},view:{getMjmlTemplate:Io,getTemplateFromEl:Xt(Ae)}}),n.addType(A,{model:{...qt({model:Ie,noVoid:!0}),defaults:{tagName:A,"style-default":{align:"center"},traits:[{type:"select",label:"Icon",name:"name",options:[{id:"custom",name:"Custom"},{id:"facebook",name:"Facebook"},{id:"twitter",name:"Twitter/X"},{id:"google",name:"Google"},{id:"instagram",name:"Instagram"},{id:"web",name:"Web"},{id:"youtube",name:"YouTube"},{id:"pinterest",name:"Pinterest"},{id:"linkedin",name:"Linkedin"},{id:"snapchat",name:"Snapchat"},{id:"vimeo",name:"Vimeo"},{id:"tumblr",name:"Tumblr"},{id:"github",name:"Github"},{id:"soundcloud",name:"SoundCloud"},{id:"medium",name:"Medium"},{id:"dribbble",name:"Dribbble"},{id:"xing",name:"Xing"}]},wt,Me,Qr]},getMjmlAttributes(){const X=pr(this);return{...this.getDefaultIconProps()[X.name],...X}},getAttrToHTML(){const X=Ie.prototype.getAttrToHTML.call(this);return{...this.getDefaultIconProps()[X.name],...X}},getDefaultIconProps(){return{twitter:{src:"https://upload.wikimedia.org/wikipedia/commons/5/57/X_logo_2023_%28white%29.png","background-color":"black"}}}},extendFnView:["init"],view:{init(){this.listenTo(this.model,"component:update:components",this.rerender)},getMjmlTemplate(){const{start:X,end:pe}=rt.prototype.getMjmlTemplate.call(this);return{start:Us(X,this.model),end:pe}},getInnerMjmlTemplate(){var Oe;const{start:X,end:pe}=rt.prototype.getInnerMjmlTemplate.call(this),he=((Oe=this.model.getInnerHTML())==null?void 0:Oe.trim())||"";return{start:`${X}${he}`,end:pe}},getChildrenContainer(){var Oe;const{el:X}=this,pe=(Oe=X.querySelector("tbody > tr > td"))==null?void 0:Oe.nextElementSibling;return(pe==null?void 0:pe.firstElementChild)||X.querySelector("img")||X}}}),n.addType(M,{model:{...qt({model:Xe}),defaults:{tagName:M,traits:[]}},view:{getMjmlTemplate:Io,getTemplateFromEl:Xt(ft)}}),n.addType(R,{model:{...qt({model:G}),defaults:{tagName:R,emptyState:{midSelector:">td>div"}}},view:{getMjmlTemplate:Io,getTemplateFromEl:Xt(W,!0),render(){this.renderAttributes();const X=this.getTemplateFromMjml();return this.el.innerHTML=X.content,this.$el.attr(X.attributes),this.getChildrenContainer().innerHTML=this.model.get("content"),this.renderChildren(),this.renderStyle(),this.postRender(),hr(this.model),this}}}),n.addType(F,{model:{...qt({model:K}),defaults:{tagName:F,icon:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z" /></svg>',emptyState:{midSelector:">td>div"},"style-default":{}}},view:{getMjmlTemplate(){const{start:X,end:pe}=J.prototype.getMjmlTemplate.call(this);return{start:Us(X,this.model),end:pe}},getTemplateFromEl(X){return X.querySelector(".mj-inline-links").innerHTML}}}),n.addType(B,{extendFn:["initToolbar"],model:{defaults:{tagName:B,name:"HTML block",emptyState:{midSelector:">div"}},initToolbar(){fA(this,{id:"edit",command:()=>We(this),label:`<svg viewBox="0 0 24 24">
185
+ </svg>`},toJSON:Bn(G)},view:{tagName:()=>"div",init(){const W=this.model.components();this.onRender=vr(this.onRender,1),this.listenTo(W,"add remove reset change",this.onRender)},onRender(){const{model:W,el:le}=this,ue=W.getName({noCustom:!0}),Ee=W.getInnerHTML();le.innerHTML=`<b>${ue}</b>: ${Ee}`,le.style.padding="5px 10px",le.style.fontFamily="system-ui"}}}),n.addType(b,{isComponent:No(b),extend:m,model:{defaults:{tagName:b,name:"Title",icon:'<svg viewBox="0 0 24 24"><path d="M5,4V7H10.5V19H13.5V7H19V4H5Z" /></svg>'}}}),n.addType(v,{model:{defaults:{tagName:v,name:"Style",droppable:!1,layerable:!1,stylable:!1,traits:[]},toJSON:Bn(G)},view:{render(){return this}}}),n.addType(u,{model:{...Bt({model:$,noVoid:!0}),defaults:{tagName:u,icon:'<svg viewBox="0 0 24 24"><path d="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M6,8V16H18V8H6Z" /></svg>',traits:[],emptyState:{midSelector:">div",styleOut:"height: 100vh;"}}}}),n.addType(y,{model:{...Bt({model:te,noVoid:!0}),defaults:{tagName:y,icon:'<svg viewBox="0 0 24 24"><path d="M19 16H5V8h14m0-5H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2"/></svg>',stylable:["background-position","padding","padding-top","padding-left","padding-right","padding-bottom","border","border-width","border-style","border-color","background-color","background-url","background-repeat","background-size"],traits:[Mt]}},view:{attributes:{},getMjmlTemplate:th,getTemplateFromEl:qt(q),init:gx}}),n.addType(w,{model:{...Bt({model:ne,noVoid:!0}),defaults:{tagName:w,"style-default":{padding:"20px 0px",direction:"ltr","text-align":"center"},icon:'<svg viewBox="0 0 24 24"><path d="M4 4.8a1.8 1.8 0 0 0-1.8 1.7v3c0 1 .8 1.8 1.8 1.8h16a1.8 1.8 0 0 0 1.8-1.8v-3A1.8 1.8 0 0 0 20 4.7zm0 8a1.8 1.8 0 0 0-1.8 1.7v3c0 1 .8 1.8 1.8 1.8h16a1.8 1.8 0 0 0 1.8-1.8v-3a1.8 1.8 0 0 0-1.8-1.8z"/></svg>',traits:[Ns,Mt],emptyState:{midSelector:">div>table>tbody>tr>td"}}},extendFnView:["render"],view:{getTemplateFromEl:qt(ce),getMjmlTemplate(){const{start:W,end:le}=ce.prototype.getMjmlTemplate.call(this);return{start:$s(W,this.model),end:le}},render(){return ct(this),this},attributes:{}}}),n.addType(O,{model:{...Bt({model:pe,noVoid:!0}),defaults:{tagName:O,"style-default":{direction:"ltr"},icon:'<svg viewBox="0 0 24 24"><path d="M16,5V18H21V5M4,18H9V5H4M10,18H15V5H10V18Z" /></svg>',traits:[Ns]}},extendFnView:["init"],view:{init(){this.listenTo(this.model.components(),"add remove reset",this.render)},getTemplateFromEl:qt(Dt,!0),getChildrenContainer(){return this.el},getMjmlTemplate:th,render(){const W=this.getTemplateFromMjml(),le=Px(W);return this.renderAttributes(),this.$el.attr(le),this.el.innerHTML=W.innerHTML,this.renderChildren(),this.childNodes=this.getChildrenContainer().childNodes,this.updateStatus(),this.postRender(),this}}});const mx=[C,E,j,T,M,P,_,F,L,O,N,H,dr.carousel,dr.carouselImage,dr.accordion,dr.accordionElement,dr.accordionTitle,dr.accordionText];n.addType(S,{model:{...Bt({model:ge,noVoid:!0}),defaults:{tagName:S,icon:'<svg viewBox="0 0 24 24"><path d="M14.5 2.3A1.8 1.8 0 0 0 12.7 4v16c0 1 .8 1.8 1.8 1.8h3a1.8 1.8 0 0 0 1.8-1.8V4a1.8 1.8 0 0 0-1.8-1.8zm-8 0A1.8 1.8 0 0 0 4.7 4v16c0 1 .8 1.8 1.8 1.8h3a1.8 1.8 0 0 0 1.8-1.8V4a1.8 1.8 0 0 0-1.8-1.8z"/></svg>',traits:[],stylable:[...ge.getDefaults().stylable,"inner-background-color"],droppable:W=>mx.includes(W.getType()),emptyState:{midSelector:">table>tbody",styleIn:"margin: 0 10px;"}}},view:{getMjmlTemplate(){var ue;const W=(ue=this.model.parent())==null?void 0:ue.is(d),le=nh(this.model,{withSiblings:!W,withHead:!W,beforeRootEnd:W?`<${u}><${w}><${S}/></${w}></${u}>`:""});return{start:le.start,end:le.end}},getTemplateFromEl:qt(Re,!0),getChildrenContainer(){const{el:W}=this;return W.querySelector("td > table tbody")||W.querySelector("table tbody")||W},render(){this.renderAttributes();const W=this.getTemplateFromMjml();return this.el.innerHTML=W.content,this.$el.attr(W.attributes),this.getChildrenContainer().innerHTML=this.model.get("content"),this.renderChildren(),this.updateStatus(),this.postRender(),rr(this.model,!0),this}}}),n.addType(C,{model:{...Bt({model:ve}),defaults:{tagName:C,emptyState:{midSelector:' [contenteditable="false"]:not([data-type-data-variable])',styleIn:"min-height: 20px;",styleOut:"padding: 0 5px;"},traits:[],"style-default":{padding:"10px 25px"}}},view:{getMjmlTemplate:Oo,getTemplateFromEl:qt(qe),attributes:{style:"display: table; width: 100%"}}}),n.addType(j,{model:{...Bt({model:Be,noVoid:!0}),defaults:{tagName:j,traits:[Oe],stylable:[...Be.getDefaults().stylable,"inner-padding"],"style-default":{}}},view:{getMjmlTemplate:Oo,getTemplateFromEl:qt(ht)}}),n.addType(E,{model:{...Bt({model:et}),defaults:{tagName:E,"style-default":{align:"center"},traits:[vt,{id:"altText",name:"alt",placeholder:"Image description"},"title",Oe,{type:"checkbox",label:"Full width on mobile",name:"fluid-on-mobile",valueTrue:"true"}]},getAttrToHTML(){const W=et.prototype.getAttrToHTML.call(this);return this.isDefaultSrc()&&delete W.src,W},getMjmlAttributes(){const W=sr(this);return this.isDefaultSrc()&&delete W.src,W}},view:{updateSrc(){const{model:W}=this,le=W.get("src",{skipResolve:!0})||W.getSrcResult();W.addAttributes({src:le}),this.updateClasses()},getMjmlTemplate(){return{start:`<mjml>${Rt(this.model)}<mj-body><mj-section><mj-column>`,end:"</mj-column></mj-section></mj-body></mjml>"}},getTemplateFromEl(W){var le,ue,Ee;return(Ee=(ue=(le=W.querySelector("img"))==null?void 0:le.closest("table"))==null?void 0:ue.closest("tr"))==null?void 0:Ee.innerHTML},attributes:{style:"display: table; width: 100%; user-select: none;"}}}),n.addType(T,{model:{...Bt({model:be}),defaults:{tagName:T,"style-default":{width:"100%",align:"center"},traits:[{name:"align",type:"radio",options:[{id:"left",title:"Left",labelReact:l.jsx(Q,{icon:U.alignHorizontalLeft,size:oe.sx})},{id:"center",title:"Center",labelReact:l.jsx(Q,{icon:U.alignHorizontalCenter,size:oe.sx})},{id:"right",title:"Right",labelReact:l.jsx(Q,{icon:U.alignHorizontalRight,size:oe.sx})}]}]}},view:{getMjmlTemplate:Oo,getTemplateFromEl:qt(Ze)}}),n.addType(P,{model:{...Bt({model:st}),defaults:{tagName:P,name:"Social",traits:[],emptyState:{midSelector:">td"},"style-default":{align:"center"},stylable:[...st.getDefaults().stylable,"inner-padding"]}},view:{getMjmlTemplate:Oo,getTemplateFromEl:qt(Pe)}}),n.addType(_,{model:{...Bt({model:Ne,noVoid:!0}),defaults:{tagName:_,"style-default":{align:"center"},traits:[{type:"select",label:"Icon",name:"name",options:[{id:"custom",name:"Custom"},{id:"facebook",name:"Facebook"},{id:"twitter",name:"Twitter/X"},{id:"google",name:"Google"},{id:"instagram",name:"Instagram"},{id:"web",name:"Web"},{id:"youtube",name:"YouTube"},{id:"pinterest",name:"Pinterest"},{id:"linkedin",name:"Linkedin"},{id:"snapchat",name:"Snapchat"},{id:"vimeo",name:"Vimeo"},{id:"tumblr",name:"Tumblr"},{id:"github",name:"Github"},{id:"soundcloud",name:"SoundCloud"},{id:"medium",name:"Medium"},{id:"dribbble",name:"Dribbble"},{id:"xing",name:"Xing"}]},vt,Oe,Ur]},getMjmlAttributes(){const W=sr(this);return{...this.getDefaultIconProps()[W.name],...W}},getAttrToHTML(){const W=Ne.prototype.getAttrToHTML.call(this);return{...this.getDefaultIconProps()[W.name],...W}},getDefaultIconProps(){return{twitter:{src:"https://upload.wikimedia.org/wikipedia/commons/5/57/X_logo_2023_%28white%29.png","background-color":"black"}}}},extendFnView:["init"],view:{init(){this.listenTo(this.model,"component:update:components",this.rerender)},getMjmlTemplate(){const{start:W,end:le}=tt.prototype.getMjmlTemplate.call(this);return{start:$s(W,this.model),end:le}},getInnerMjmlTemplate(){var Ee;const{start:W,end:le}=tt.prototype.getInnerMjmlTemplate.call(this),ue=((Ee=this.model.getInnerHTML())==null?void 0:Ee.trim())||"";return{start:`${W}${ue}`,end:le}},getChildrenContainer(){var Ee;const{el:W}=this,le=(Ee=W.querySelector("tbody > tr > td"))==null?void 0:Ee.nextElementSibling;return(le==null?void 0:le.firstElementChild)||W.querySelector("img")||W}}}),n.addType(M,{model:{...Bt({model:Ye}),defaults:{tagName:M,traits:[]}},view:{getMjmlTemplate:Oo,getTemplateFromEl:qt(lt)}}),n.addType(N,{model:{...Bt({model:Y}),defaults:{tagName:N,emptyState:{midSelector:">td>div"}}},view:{getMjmlTemplate:Oo,getTemplateFromEl:qt(Z,!0),render(){this.renderAttributes();const W=this.getTemplateFromMjml();return this.el.innerHTML=W.content,this.$el.attr(W.attributes),this.getChildrenContainer().innerHTML=this.model.get("content"),this.renderChildren(),this.renderStyle(),this.postRender(),rr(this.model),this}}}),n.addType(H,{model:{...Bt({model:J}),defaults:{tagName:H,icon:'<svg viewBox="0 0 24 24"><path fill="currentColor" d="M21,15.61L19.59,17L14.58,12L19.59,7L21,8.39L17.44,12L21,15.61M3,6H16V8H3V6M3,13V11H13V13H3M3,18V16H16V18H3Z" /></svg>',emptyState:{midSelector:">td>div"},"style-default":{}}},view:{getMjmlTemplate(){const{start:W,end:le}=ee.prototype.getMjmlTemplate.call(this);return{start:$s(W,this.model),end:le}},getTemplateFromEl(W){return W.querySelector(".mj-inline-links").innerHTML}}}),n.addType(F,{extendFn:["initToolbar"],model:{defaults:{tagName:F,name:"HTML block",emptyState:{midSelector:">div"}},initToolbar(){b3(this,{id:"edit",command:()=>ze(this),label:`<svg viewBox="0 0 24 24">
240
186
  <path d="M14.6 16.6l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4z"></path>
241
- </svg>`})},toJSON:Qn(q)},view:{events:{dblclick:"onActive"},onActive(){We(this.model)},attributes:{}}}),n.addType("skip-global-style",{isComponent:X=>{var pe,he;if(((pe=X.tagName)==null?void 0:pe.toLowerCase())===v&&((he=X.getAttribute)==null?void 0:he.call(X,"css-class"))===$e)return{type:"textnode",components:[],content:""}}});const ew=X=>{const{id:pe,view:he}=X,Oe=he.prototype;n.addType(pe,{view:{render(){return Oe.render.apply(this,arguments),Y0(pe,this),this}}})};[u,w,S,C,R,P,B].forEach(X=>ew(n.getType(X))),n.getTypes().forEach(({id:X,view:pe})=>{pe.prototype.disableEditing&&n.addType(X,{view:{onDisable(he={}){this.disableEditing({...he,parserOptions:{htmlType:"text/html"}})}}})});const jh=()=>{const X="projectFonts",he=e.Components.getWrapper().findFirstType(a),Oe=he.findFirstType(l)||he.append({type:l})[0];Oe.findType(v).filter(Ln=>Ln.getAttributes()[Ve]===X||Ln.attributes[u0]===d0).forEach(Ln=>Ln.remove());const Et=c0(i.fonts);if(!Et)return;const Mn=Oe.append({type:v,content:Et})[0];Mn==null||Mn.addAttributes({[Ve]:X})},Eh=()=>{const X=e.Css.rules.filter(Et=>{const Mn=Et.attributes.groups;return!!(Mn!=null&&Mn.some(Ln=>Ln.startsWith(`${$e}:`)))}).map(Et=>Et.toCSS());if(!X.length)return;const he=e.Components.getWrapper().findFirstType(ya.root),Oe=he.findFirstType(l)||he.append({type:l})[0];(Oe.findType(v).find(Et=>Et.getAttributes()[Ve]===$e)||Oe.append({type:v,attributes:{[Ve]:$e}})[0]).set("content",X.join(`
242
- `))},tw=Tr(Eh,100);e.on(Tn.pageSettingsUpdate,X=>{X.page||jh()}),e.on(e.events.projectLoad,({loaded:X})=>{X&&(Eh(),jh())}),e.on(e.Parser.events.htmlBefore,X=>{var he;const pe=(he=e.Parser.config.optionsHtml)==null?void 0:he.codeSanitizer;X.input=A0(X.input,{sanitizer:pe})}),e.onReady(()=>{e.on(`${e.DataSources.events.pathSource}:${$e}`,tw)})}function x4(e){const{Blocks:t}=e,n="Content",s="Layout",r={className:"h-7",full:!0,space:"s",nowrap:!0},o={category:s,full:!0},i="gjs-border-2 gjs-border-current gjs-rounded-sm",a=(l,u)=>{t.add(l,{select:!0,category:n,...u})};a("mj-text",{label:"Text",media:`<svg viewBox="0 0 24 24">
187
+ </svg>`})},toJSON:Bn(G)},view:{events:{dblclick:"onActive"},onActive(){ze(this.model)},attributes:{}}}),n.addType("skip-global-style",{isComponent:W=>{var le,ue;if(((le=W.tagName)==null?void 0:le.toLowerCase())===v&&((ue=W.getAttribute)==null?void 0:ue.call(W,"css-class"))===Me)return{type:"textnode",components:[],content:""}}});const bx=W=>{const{id:le,view:ue}=W,Ee=ue.prototype;n.addType(le,{view:{render(){return Ee.render.apply(this,arguments),f0(le,this),this}}})};[u,w,S,C,N,P,F].forEach(W=>bx(n.getType(W))),n.getTypes().forEach(({id:W,view:le})=>{le.prototype.disableEditing&&n.addType(W,{view:{onDisable(ue={}){this.disableEditing({...ue,parserOptions:{htmlType:"text/html"}})}}})});const sh=()=>{const W="projectFonts",ue=e.Components.getWrapper().findFirstType(a),Ee=ue.findFirstType(c)||ue.append({type:c})[0];Ee.findType(v).filter(En=>En.getAttributes()[Le]===W||En.attributes[Ov]===_v).forEach(En=>En.remove());const St=Tv(i.fonts);if(!St)return;const jn=Ee.append({type:v,content:St})[0];jn==null||jn.addAttributes({[Le]:W})},rh=()=>{const W=e.Css.rules.filter(St=>{const jn=St.attributes.groups;return!!(jn!=null&&jn.some(En=>En.startsWith(`${Me}:`)))}).map(St=>St.toCSS());if(!W.length)return;const ue=e.Components.getWrapper().findFirstType(aa.root),Ee=ue.findFirstType(c)||ue.append({type:c})[0];(Ee.findType(v).find(St=>St.getAttributes()[Le]===Me)||Ee.append({type:v,attributes:{[Le]:Me}})[0]).set("content",W.join(`
188
+ `))},vx=vr(rh,100);e.on(xn.pageSettingsUpdate,W=>{W.page||sh()}),e.on(e.events.projectLoad,({loaded:W})=>{W&&(rh(),sh())}),e.on(e.Parser.events.htmlBefore,W=>{var ue;const le=(ue=e.Parser.config.optionsHtml)==null?void 0:ue.codeSanitizer;W.input=Kv(W.input,{sanitizer:le})}),e.onReady(()=>{e.on(`${e.DataSources.events.pathSource}:${Me}`,vx)})}function E4(e){const{Blocks:t}=e,n="Content",s="Layout",r={className:"h-7",full:!0,space:"s",nowrap:!0},o={category:s,full:!0},i="gjs-border-2 gjs-border-current gjs-rounded-sm",a=(c,u)=>{t.add(c,{select:!0,category:n,...u})};a("mj-text",{label:"Text",media:`<svg viewBox="0 0 24 24">
243
189
  <path fill="currentColor" d="M18.5,4L19.66,8.35L18.7,8.61C18.25,7.74 17.79,6.87 17.26,6.43C16.73,6 16.11,6 15.5,6H13V16.5C13,17 13,17.5 13.33,17.75C13.67,18 14.33,18 15,18V19H9V18C9.67,18 10.33,18 10.67,17.75C11,17.5 11,17 11,16.5V6H8.5C7.89,6 7.27,6 6.74,6.43C6.21,6.87 5.75,7.74 5.3,8.61L4.34,8.35L5.5,4H18.5Z" />
244
190
  </svg>`,content:"<mj-text>Insert text here</mj-text>",activate:!0}),a("mj-button",{label:"Button",media:`<svg viewBox="0 0 24 24">
245
191
  <path fill="currentColor" d="M20 20.5C20 21.3 19.3 22 18.5 22H13C12.6 22 12.3 21.9 12 21.6L8 17.4L8.7 16.6C8.9 16.4 9.2 16.3 9.5 16.3H9.7L12 18V9C12 8.4 12.4 8 13 8S14 8.4 14 9V13.5L15.2 13.6L19.1 15.8C19.6 16 20 16.6 20 17.1V20.5M20 2H4C2.9 2 2 2.9 2 4V12C2 13.1 2.9 14 4 14H8V12H4V4H20V12H18V14H20C21.1 14 22 13.1 22 12V4C22 2.9 21.1 2 20 2Z" />
246
192
  </svg>`,content:"<mj-button>Button</mj-button>"}),a("mj-image",{label:"Image",media:`<svg viewBox="0 0 24 24">
247
193
  <path fill="currentColor" d="M21,3H3C2,3 1,4 1,5V19A2,2 0 0,0 3,21H21C22,21 23,20 23,19V5C23,4 22,3 21,3M5,17L8.5,12.5L11,15.5L14.5,11L19,17H5Z" />
248
- </svg>`,content:`<mj-image src="${xw}"/>`,activate:!0}),a("mj-divider",{label:"Divider",media:`<svg viewBox="0 0 24 24">
194
+ </svg>`,content:`<mj-image src="${Ix}"/>`,activate:!0}),a("mj-divider",{label:"Divider",media:`<svg viewBox="0 0 24 24">
249
195
  <path fill="currentColor" d="M21 18H2V20H21V18M19 10V14H4V10H19M20 8H3C2.45 8 2 8.45 2 9V15C2 15.55 2.45 16 3 16H20C20.55 16 21 15.55 21 15V9C21 8.45 20.55 8 20 8M21 4H2V6H21V4Z" />
250
196
  </svg>`,content:"<mj-divider/>"}),a("mj-social",{label:"Social",media:`<svg viewBox="0 0 24 24">
251
197
  <path fill="currentColor" d="M18,16.08C17.24,16.08 16.56,16.38 16.04,16.85L8.91,12.7C8.96,12.47 9,12.24 9,12C9,11.76 8.96,11.53 8.91,11.3L15.96,7.19C16.5,7.69 17.21,8 18,8A3,3 0 0,0 21,5A3,3 0 0,0 18,2A3,3 0 0,0 15,5C15,5.24 15.04,5.47 15.09,5.7L8.04,9.81C7.5,9.31 6.79,9 6,9A3,3 0 0,0 3,12A3,3 0 0,0 6,15C6.79,15 7.5,14.69 8.04,14.19L15.16,18.34C15.11,18.55 15.08,18.77 15.08,19C15.08,20.61 16.39,21.91 18,21.91C19.61,21.91 20.92,20.61 20.92,19A2.92,2.92 0 0,0 18,16.08Z" />
@@ -266,7 +212,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
266
212
  <mj-navbar-link>BLOG</mj-navbar-link>
267
213
  </mj-navbar>`}),a("mj-hero",{label:"Hero",media:`<svg viewBox="0 0 24 24">
268
214
  <path fill="currentColor" d="M20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20M4,6V18H20V6H4M6,9H18V11H6V9M6,13H16V15H6V13Z" />
269
- </svg>`,content:`<mj-hero mode="fixed-height" height="469px" background-width="600px" background-height="469px" background-url="${ob({width:600,height:300,text:"Hero Image",fg:"555"})}" background-color="#2a3448" padding="100px 0px">
215
+ </svg>`,content:`<mj-hero mode="fixed-height" height="469px" background-width="600px" background-height="469px" background-url="${P1({width:600,height:300,text:"Hero Image",fg:"555"})}" background-color="#2a3448" padding="100px 0px">
270
216
  <mj-text padding="20px" color="#ffffff" font-family="Helvetica" align="center" font-size="45px" line-height="45px" font-weight="900">
271
217
  Heading title
272
218
  </mj-text>
@@ -280,49 +226,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
280
226
  <path d="M5.59 3.41L7 4.82L3.82 8L7 11.18L5.59 12.6L1 8L5.59 3.41M11.41 3.41L16 8L11.41 12.6L10 11.18L13.18 8L10 4.82L11.41 3.41M22 6V18C22 19.11 21.11 20 20 20H4C2.9 20 2 19.11 2 18V14H4V18H20V6H17.03V4H20C21.11 4 22 4.89 22 6Z" />
281
227
  </svg>`,content:`<mj-raw>
282
228
  <span>Insert here you custom HTML</span>
283
- </mj-raw>`}),a("mj-1-column",{...o,label:"1 Column",mediaReact:c.jsx(k,{...r,children:c.jsx(D,{className:i,grow:!0})}),content:`<mj-section>
229
+ </mj-raw>`}),a("mj-1-column",{...o,label:"1 Column",mediaReact:l.jsx(k,{...r,children:l.jsx(V,{className:i,grow:!0})}),content:`<mj-section>
284
230
  <mj-column></mj-column>
285
- </mj-section>`}),a("mj-2-columns-50-50",{...o,label:"2 Columns 50/50",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:i,grow:!0}),c.jsx(D,{className:i,grow:!0})]}),content:`<mj-section>
231
+ </mj-section>`}),a("mj-2-columns-50-50",{...o,label:"2 Columns 50/50",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:i,grow:!0}),l.jsx(V,{className:i,grow:!0})]}),content:`<mj-section>
286
232
  <mj-column></mj-column>
287
233
  <mj-column></mj-column>
288
- </mj-section>`}),a("mj-2-columns-25-75",{...o,label:"2 Columns 25/75",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-3/4")})]}),content:`<mj-section>
234
+ </mj-section>`}),a("mj-2-columns-25-75",{...o,label:"2 Columns 25/75",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-3/4")})]}),content:`<mj-section>
289
235
  <mj-column width="25%"></mj-column>
290
236
  <mj-column width="75%"></mj-column>
291
- </mj-section>`}),a("mj-2-columns-33-67",{...o,label:"2 Columns 33/67",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:ue(i,"gs-utl-basis-1/3")}),c.jsx(D,{className:ue(i,"gs-utl-basis-2/3")})]}),content:`<mj-section>
237
+ </mj-section>`}),a("mj-2-columns-33-67",{...o,label:"2 Columns 33/67",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:ie(i,"gs-utl-basis-1/3")}),l.jsx(V,{className:ie(i,"gs-utl-basis-2/3")})]}),content:`<mj-section>
292
238
  <mj-column width="33%"></mj-column>
293
239
  <mj-column width="67%"></mj-column>
294
- </mj-section>`}),a("mj-2-columns-67-33",{...o,label:"2 Columns 67/33",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:ue(i,"gs-utl-basis-2/3")}),c.jsx(D,{className:ue(i,"gs-utl-basis-1/3")})]}),content:`<mj-section>
240
+ </mj-section>`}),a("mj-2-columns-67-33",{...o,label:"2 Columns 67/33",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:ie(i,"gs-utl-basis-2/3")}),l.jsx(V,{className:ie(i,"gs-utl-basis-1/3")})]}),content:`<mj-section>
295
241
  <mj-column width="67%"></mj-column>
296
242
  <mj-column width="33%"></mj-column>
297
- </mj-section>`}),a("mj-2-columns-75-25",{...o,label:"2 Columns 75/25",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:ue(i,"gs-utl-basis-3/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")})]}),content:`<mj-section>
243
+ </mj-section>`}),a("mj-2-columns-75-25",{...o,label:"2 Columns 75/25",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:ie(i,"gs-utl-basis-3/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")})]}),content:`<mj-section>
298
244
  <mj-column width="75%"></mj-column>
299
245
  <mj-column width="25%"></mj-column>
300
- </mj-section>`}),a("mj-3-columns",{...o,label:"3 Columns",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:i,grow:!0}),c.jsx(D,{className:i,grow:!0}),c.jsx(D,{className:i,grow:!0})]}),content:`<mj-section>
246
+ </mj-section>`}),a("mj-3-columns",{...o,label:"3 Columns",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:i,grow:!0}),l.jsx(V,{className:i,grow:!0}),l.jsx(V,{className:i,grow:!0})]}),content:`<mj-section>
301
247
  <mj-column></mj-column>
302
248
  <mj-column></mj-column>
303
249
  <mj-column></mj-column>
304
- </mj-section>`}),a("mj-3-columns-25-25-50",{...o,label:"3 Columns 25/25/50",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-2/4")})]}),content:`<mj-section>
250
+ </mj-section>`}),a("mj-3-columns-25-25-50",{...o,label:"3 Columns 25/25/50",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-2/4")})]}),content:`<mj-section>
305
251
  <mj-column width="25%"></mj-column>
306
252
  <mj-column width="25%"></mj-column>
307
253
  <mj-column width="50%"></mj-column>
308
- </mj-section>`}),a("mj-3-columns-25-50-25",{...o,label:"3 Columns 25/50/25",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-2/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")})]}),content:`<mj-section>
254
+ </mj-section>`}),a("mj-3-columns-25-50-25",{...o,label:"3 Columns 25/50/25",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-2/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")})]}),content:`<mj-section>
309
255
  <mj-column width="25%"></mj-column>
310
256
  <mj-column width="50%"></mj-column>
311
257
  <mj-column width="25%"></mj-column>
312
- </mj-section>`}),a("mj-3-columns-50-25-25",{...o,label:"3 Columns 50/25/25",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:ue(i,"gs-utl-basis-2/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")}),c.jsx(D,{className:ue(i,"gs-utl-basis-1/4")})]}),content:`<mj-section>
258
+ </mj-section>`}),a("mj-3-columns-50-25-25",{...o,label:"3 Columns 50/25/25",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:ie(i,"gs-utl-basis-2/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")}),l.jsx(V,{className:ie(i,"gs-utl-basis-1/4")})]}),content:`<mj-section>
313
259
  <mj-column width="50%"></mj-column>
314
260
  <mj-column width="25%"></mj-column>
315
261
  <mj-column width="25%"></mj-column>
316
- </mj-section>`}),a("mj-4-columns",{...o,label:"4 Columns",mediaReact:c.jsxs(k,{...r,children:[c.jsx(D,{className:i,grow:!0}),c.jsx(D,{className:i,grow:!0}),c.jsx(D,{className:i,grow:!0}),c.jsx(D,{className:i,grow:!0})]}),content:`<mj-section>
262
+ </mj-section>`}),a("mj-4-columns",{...o,label:"4 Columns",mediaReact:l.jsxs(k,{...r,children:[l.jsx(V,{className:i,grow:!0}),l.jsx(V,{className:i,grow:!0}),l.jsx(V,{className:i,grow:!0}),l.jsx(V,{className:i,grow:!0})]}),content:`<mj-section>
317
263
  <mj-column></mj-column>
318
264
  <mj-column></mj-column>
319
265
  <mj-column></mj-column>
320
266
  <mj-column></mj-column>
321
- </mj-section>`})}const w4=(e,t)=>({[yt.web]:s=>rd(s,t),[yt.document]:s=>rd(s,t),[yt.react]:s=>rd(s,t),[yt.email]:s=>y4(s,t)})[e],Ei="https://cdn.jsdelivr.net/npm/",ld={id:"gjs-blocks-basic",src:`${Ei}grapesjs-blocks-basic@1.0.1/dist/index.js`},S4={id:"grapesjs-plugin-forms",src:`${Ei}grapesjs-plugin-forms@2.0.5/dist/index.js`},cd={id:"grapesjs-parser-postcss",src:`${Ei}grapesjs-parser-postcss@1.0.1/dist/index.js`},C4={id:"grapesjs-navbar",src:`${Ei}grapesjs-navbar@1.0.1/dist/index.js`,options:{block:{category:"Extra"}}},ud={id:"grapesjs-plugin-export",src:`${Ei}grapesjs-plugin-export@1.0.11/dist/index.js`,options:{isBinary:(e,t)=>{const n=t.split(".")[1];return/[\x00-\x08\x0E-\x1F]/.test(e)&&!(n&&["html","css"].indexOf(n)>=0)}}},j4={id:"grapesjs-mjml",src:`${Ei}grapesjs-mjml@1.0.7/dist/index.js`,options:{columnsPadding:"",useCustomTheme:!1,resetDevices:!1,resetBlocks:!1,blocks:[],useXmlParser:!0,resetStyleManager:!1}},E4={[yt.email]:[x4,j4],[yt.web]:[ld,S4,ud,cd,C4],[yt.document]:[ld,ud,cd],[yt.react]:[ld,ud,cd]};function P4(e,t){const{blocks:n}=t.appStore.sdkOptions;Array.isArray(n==null?void 0:n.default)&&e.BlockManager.blocks.add(n.default),e.on("rteToolbarPosUpdate",s=>{const r=-s.canvasOffset.left;s.left<r&&(s.left=r)})}function Z0({onCopy:e,getValue:t,value:n,title:s="Copy",...r}){const[o,i]=h.useState(!1),a=()=>{dw((t==null?void 0:t())??n),i(!0),e==null||e()};return h.useEffect(()=>{if(!o)return;const l=setTimeout(()=>i(!1),3e3);return()=>clearTimeout(l)},[o]),c.jsx(bt,{onClick:a,title:s,type:"button",size:"lg",withBg:!0,...r,children:c.jsx(oe,{className:ue(o&&z.tA),icon:o?Z.check:Z.contentCopy,size:le.s})})}const _4=(e,t)=>e.filter(n=>n.id===t)[0]||null,X0=(e,t)=>(e==null?void 0:e.id)===(t==null?void 0:t.id),T4=(e,t)=>e.label.toLowerCase().indexOf(t.toLowerCase())>=0,J0=ee("cursor-default select-none focus:gs-utl-outline-none","z-20 max-h-full"),qp={strategy:"fixed",placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"flip",options:{fallbackPlacements:["top"]}}]};function pm(e){var o;const{option:t,active:n,selected:s}=e,r=((o=e.isSelected)==null?void 0:o.call(e))||!0;return c.jsxs(k,{items:"center",className:ee([je.xy,n&&np.bgH]),children:[c.jsx(D,{className:ee("truncate"),grow:!0,children:t.label}),c.jsx(D,{className:ee("gjs-pl-2"),children:X0(t,s)&&r&&c.jsx(oe,{className:ee(z.tA),icon:Z.check,size:le.s})})]})}const O4="gs-select-field";function hm({option:e}){return c.jsxs(c.Fragment,{children:[e.icon&&c.jsx(oe,{...ot(e.icon)?{icon:e.icon,size:le.s2x}:e.icon}),c.jsx(D,{className:ee("truncate"),grow:!0,children:e.content||e.label})]})}function _e(e){const{value:t,onChange:n,onBlur:s,onFocus:r,handlerSelected:o,label:i,options:a,includeEmpty:l,className:u,search:d,open:f,caret:p=Z.chevronDown,size:g="m",border:m,emptyState:b="- Select an option -",name:v,required:x,disabled:y,classNameContainer:w,autoFocus:S,labelAs:C,hideCaret:j}=e,[E,_]=h.useState(null),[T,P]=h.useState(null),[A,M]=h.useState(""),{styles:R,attributes:F}=Wa(E,T,qp),L=typeof d=="object"?d.onChange:void 0,B=[...a].filter(Y=>d?L||T4(Y,A):Y),q=d&&(typeof d=="object"&&d.value||A),H=q&&B.length?B[0]:_4(B,t),$=Y=>n(Y.id,Y),I={id:null,label:b},O=(H==null?void 0:H.content)||(H==null?void 0:H.label),V=H?o?o(H):H.icon?c.jsx(k,{items:"center",gap:"s",children:c.jsx(hm,{option:H})}):O:o?o(I):b;l&&B.unshift(I);const G=Y=>{const{value:U}=Y.target,Q=U.trim();switch(Y.key){case"Escape":n(null);break;case"Enter":n((B.length?B[0].id:Q)||null,B[0]);break;case" ":bo(Y);break}},W=N("gs-utl-w-full gs-utl-text-left gs-utl-cursor-pointer gs-utl-block",re.rnd,pa.focus),K=()=>{s==null||s()},J=qr({...e,className:N(O4,w,"gs-utl-relative",g.includes("s")&&"gs-utl-text-xs")});return c.jsx(Ri,{value:H,onChange:$,disabled:y,children:({open:Y})=>c.jsxs("div",{...J,children:[i&&c.jsx(Ri.Label,{as:C,className:e.classNameLabel,children:c.jsx(fs,{as:"span",...e})}),v&&c.jsx("input",{type:"input",name:v,value:(H==null?void 0:H.id)??"",onChange:()=>{},className:ee("gs-utl-w-[1px] gs-utl-h-[1px] gs-utl-opacity-[0.001] gs-utl-absolute"),required:x,disabled:y}),c.jsx(Ri.Button,{ref:_,className:W,tabIndex:d?-1:void 0,children:d?c.jsx("input",{autoFocus:S,value:typeof d=="object"&&d.value||A,className:N([u,"gs-utl-w-full",re.rnd,pa.focus,je.xyS]),onChange:U=>{M(U.target.value),L==null||L(U.target.value)},onKeyDown:G,onClick:bo,onBlur:K,onFocus:r}):c.jsx(Xn,{border:m,size:g,title:V,icon:j?{className:"gs-utl-opacity-0 gs-utl-pointer-events-none"}:p,shadow:!1,className:ee(u),titleClass:"",disabled:y})}),c.jsx(Ri.Options,{static:f,className:J0,ref:P,style:R.popper,...F.popper,children:c.jsxs(Xn,{padding:!1,className:ee("h-full"),style:{minWidth:`${E==null?void 0:E.offsetWidth}px`,maxHeight:200},children:[!B.length&&d&&d!==!0&&c.jsx("div",{className:ee(je.xy),children:d.empty}),B.map((U,Q)=>c.jsx(Ri.Option,{value:U,children:({active:se})=>c.jsxs(k,{items:"center",gap:"s",className:ee([U.className,je.xy,se&&np.bgH]),nowrap:!0,children:[c.jsx(hm,{option:U}),c.jsx(D,{className:ee("gjs-pl-2"),children:X0(U,H)&&!q&&c.jsx(oe,{className:ee(z.tA),icon:Z.check,size:le.s})})]})},Q))]})})]})})}const Q0=h.createContext(null),A4=({children:e})=>{const[t,n]=h.useState({setEditor:s=>{n(r=>({...r,editor:s}))}});return c.jsx(Q0.Provider,{value:t,children:e})},Jn=()=>{const e=h.useContext(Q0);if(!e)throw new Error("useEditorInstance must be used within EditorInstanceProvider");return e},Ja=()=>{const{editor:e}=Jn();if(!e)throw new Error("useEditor used before the load of the editor instance. You can wrap your component in `<WithEditor>` or make use of `useEditorMaybe` hook and ensure the `editor` exists.");return e},N4=()=>Jn().editor,ey=h.createContext(null),M4=({children:e})=>{const[t,n]=h.useState(()=>({setRefCanvas(s){n(r=>({...r,refCanvas:s}))},setCustomModal(s){n(r=>({...r,customModal:s}))},setCustomAssets(s){n(r=>({...r,customAssets:s}))},setCustomBlocks(s){n(r=>({...r,customBlocks:s}))},setCustomRte(s){n(r=>({...r,customRte:s}))},setCustomStyles(s){n(r=>({...r,customStyles:s}))},setCustomLayers(s){n(r=>({...r,customLayers:s}))},setCustomSelectors(s){n(r=>({...r,customSelectors:s}))},setCustomTraits(s){n(r=>({...r,customTraits:s}))},setReady(s){n(r=>({...r,ready:s}))}}));return c.jsx(ey.Provider,{value:t,children:e})},Hs=()=>{const e=h.useContext(ey);if(!e)throw new Error("useEditorOptions must be used within EditorOptionsProvider");return e};function L4(...e){return(Array.isArray(e[0])?e[0]:[...e]).filter(Boolean).join(" ")}function Kr(e){return typeof e=="function"}function is(){}const ty=e=>typeof e=="string",R4=async e=>{const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)},ny=e=>{const t=ty(e)?{id:e,src:e}:e;return new Promise((n,s)=>{const r=document.createElement("script");if(document.querySelector(`script[src="${t.src}"]`))return n(t.id);r.src=t.src,r.onload=()=>n(t.id),r.onerror=()=>s(t.id),document.head.appendChild(r)})},$4=e=>{const t=e.map(n=>ny(n));return Promise.allSettled(t)},gm=e=>function(){const t=h.useRef(null);return h.useEffect(()=>{const{current:n}=t;n&&(ty(e)?n.innerHTML=e:n.appendChild(e))},[t.current]),c.jsx("div",{ref:t})},mm=new WeakMap;function Pi(e){if(!e)return()=>c.jsx(c.Fragment,{});const t=mm.get(e);if(t)return t;const n=function({children:s}){return Dn.createPortal(h.createElement("div",null,s),e)};return mm.set(e,n),n}h.memo(function({children:e}){const{editor:t}=Jn(),n=Hs(),[s,r]=h.useState(!1),[o,i]=h.useState({assets:[],types:[],close:()=>{},select:()=>{},Container:()=>c.jsx(c.Fragment,{})});return h.useEffect(()=>{if(!t)return;const a=t.Assets.events.custom,l=({open:u,assets:d,types:f,select:p,close:g,container:m})=>{u&&i({assets:d,types:f,select:p,close:g,Container:Pi(m)}),r(u)};return t.on(a,l),()=>{t.off(a,l)}},[t]),h.useEffect(()=>n.setCustomAssets(!0),[]),t?Kr(e)?e({open:s,...o}):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})});h.memo(function({children:e}){const{editor:t}=Jn(),n=Hs(),[s,r]=h.useState(()=>({blocks:[],dragStart:is,dragStop:is,mapCategoryBlocks:new Map,Container:()=>c.jsx(c.Fragment,{})}));return h.useEffect(()=>{if(!t)return;const o=t.Blocks.events.custom,i=({blocks:a,container:l,dragStart:u,dragStop:d})=>{const f=a.reduce((p,g)=>{const m=g.getCategoryLabel(),b=p.get(m);return b?b.push(g):p.set(m,[g]),p},new Map);r({blocks:a,dragStart:u,dragStop:d,mapCategoryBlocks:f,Container:Pi(l)})};return t.on(o,i),t.Blocks.__trgCustom(),()=>{t.off(o,i)}},[t]),h.useEffect(()=>n.setCustomBlocks(!0),[]),t?Kr(e)?e(s):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})});function k4({children:e,...t}){const n=Hs(),s=h.useRef(null);return h.useEffect(()=>{s.current&&n.setRefCanvas(s.current)},[s.current]),c.jsx("div",{...t,ref:s,children:e})}const V4=h.memo(function({children:e}){const{editor:t}=Jn(),[n,s]=h.useState(()=>({devices:[],selected:"",select:is}));return h.useEffect(()=>{if(!t)return;const{Devices:r}=t,o=r.events.all,i=()=>{var a;s({devices:r.getDevices(),selected:(a=r.getSelected())==null?void 0:a.id,select:l=>r.select(l)})};return t.on(o,i),i(),()=>{t.off(o,i)}},[t]),t?Kr(e)?e(n):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})}),I4=e=>!!(e&&!Array.isArray(e)&&typeof e=="object");async function D4(e){const t=e.map(({id:o,src:i})=>({id:o,src:i})),n=e.reduce((o,i)=>(o[i.id]=i,o),{}),s=[],r=[];return(await $4(t)).forEach(o=>{o.status==="fulfilled"?s.push(n[o.value]):r.push(n[o.reason])}),{loaded:s,failed:r}}const H4=async e=>{const t=[...e],n={};if(t.length){const s={},r=[];if(t.forEach((o,i)=>{I4(o)&&(s[o.id]={index:i},r.push(o))}),r.length){const{loaded:o}=await D4(r);o.forEach(({id:i,options:a})=>{s[i].loaded=!0,n[i]=a||{}})}Object.keys(s).forEach(o=>{const i=s[o];i.loaded?t[i.index]=o:t[i.index]=!1})}return{plugins:t.filter(Boolean),pluginOptions:n}},F4=h.memo(function({children:e,className:t,style:n,options:s={},plugins:r=[],grapesjs:o,grapesjsCss:i,onEditor:a=is,onReady:l,onUpdate:u,waitReady:d,...f}){const{setEditor:p}=Jn(),g=Hs(),[m,b]=h.useState(!1),v=h.useRef(null);h.useEffect(()=>{if(!g.ready||!v.current)return;const E=v.current,_=g.refCanvas;let T,P={},A=[];const M=R=>{const F={height:"100%",...s,plugins:[...A,...s.plugins||[]],pluginsOpts:{...s.pluginsOpts,...P},modal:{custom:!!g.customModal,...s.modal},assetManager:{custom:!!g.customAssets,...s.assetManager},styleManager:{custom:!!g.customStyles,...s.styleManager},blockManager:{custom:!!g.customBlocks,...s.blockManager},richTextEditor:{custom:!!g.customRte,...s.richTextEditor},layerManager:{custom:!!g.customLayers,...s.layerManager},traitManager:{custom:!!g.customTraits,...s.traitManager},selectorManager:{custom:!!g.customSelectors,...s.selectorManager},container:_||E,customUI:!!_,..._?{panels:{defaults:[]}}:{}};T=R.init(F),p(T),a(T),u&&T.on("update",()=>{u(T.getProjectData(),T)}),T.onReady(()=>{b(!0),l==null||l(T)})};return(async()=>{i&&await R4(i);const R=await H4(r);A=R.plugins,P=R.pluginOptions,typeof o=="string"?(await ny(o),M(window.grapesjs)):M(o)})(),()=>T==null?void 0:T.destroy()},[g.ready]);const x=s.height??"100%",y=s.width??"100%",w=L4("gjs-editor-wrapper",t),S=d&&!m,C=h.useMemo(()=>({...n,height:x,width:y}),[x,y,n]),j=h.useMemo(()=>({...C,...S?{opacity:0,width:0,height:0}:{}}),[C,S]);return c.jsxs(c.Fragment,{children:[d&&!m?c.jsx("div",{className:w,style:C,children:d}):null,c.jsx("div",{...f,ref:v,className:w,style:j,children:e})]})}),B4=h.memo(function(){const e=Hs();return h.useEffect(()=>e.setReady(!0),[]),c.jsx(c.Fragment,{})});h.memo(function({children:e,...t}){return c.jsx(A4,{children:c.jsx(M4,{children:c.jsxs(F4,{...t,children:[e,c.jsx(B4,{})]})})})});const sy=h.memo(function({children:e}){const{editor:t}=Jn(),n=Hs(),[s,r]=h.useState(()=>({root:void 0,Container:()=>c.jsx(c.Fragment,{})}));return h.useEffect(()=>{if(!t)return;const{Layers:o}=t,i=o.events.custom,a=({container:l})=>{r({root:o.getRoot(),Container:Pi(l)})};return t.on(i,a),o.__trgCustom({}),()=>{t.off(i,a)}},[t]),h.useEffect(()=>n.setCustomLayers(!0),[]),t?Kr(e)?e(s):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})});h.memo(function({children:e}){const{editor:t}=Jn(),n=Hs(),[s,r]=h.useState(!1),[o,i]=h.useState({title:c.jsx(c.Fragment,{}),content:c.jsx(c.Fragment,{}),attributes:{},close:is});return h.useEffect(()=>{if(!t)return;const a="modal",l=({open:u,title:d,content:f,close:p,attributes:g})=>{u&&i({title:h.createElement(gm(d)),content:h.createElement(gm(f)),attributes:g,close:p}),r(u)};return t.on(a,l),()=>{t.off(a,l)}},[t]),h.useEffect(()=>n.setCustomModal(!0),[]),t?typeof e=="function"?e({open:s,...o}):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})});const ry=h.memo(function({children:e}){const{editor:t}=Jn(),[n,s]=h.useState(()=>({pages:[],selected:void 0,select:is,add:is,remove:is}));return h.useEffect(()=>{if(!t)return;const{Pages:r}=t,o=r.events.all,i=()=>{s({pages:r.getAll(),selected:r.getSelected(),select:(...a)=>r.select(...a),add:(...a)=>r.add(...a),remove:(...a)=>r.remove(...a)})};return t.on(o,i),i(),()=>{t.off(o,i)}},[t]),t?Kr(e)?e(n):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})}),oy=h.memo(function({children:e}){const{editor:t}=Jn(),n=Hs(),[s,r]=h.useState(()=>({selectors:[],states:[],selectedState:"",targets:[],addSelector:is,removeSelector:is,setState:is,Container:()=>c.jsx(c.Fragment,{})}));return h.useEffect(()=>{if(!t)return;const{Selectors:o}=t,i=o.events.custom,a=({container:l})=>{r({selectors:o.getSelected(),states:o.getStates(),selectedState:o.getState(),targets:o.getSelectedTargets().map(u=>u.getSelectorsString()),addSelector:(...u)=>o.addSelected(...u),removeSelector:(...u)=>o.removeSelected(...u),setState:(...u)=>o.setState(...u),Container:Pi(l)})};return t.on(i,a),()=>{t.off(i,a)}},[t]),h.useEffect(()=>n.setCustomSelectors(!0),[]),t?Kr(e)?e(s):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})}),iy=h.memo(function({children:e}){const{editor:t}=Jn(),n=Hs(),[s,r]=h.useState(()=>({sectors:[],Container:()=>c.jsx(c.Fragment,{})}));return h.useEffect(()=>{if(!t)return;const{Styles:o}=t,i=o.events.custom,a=({container:l})=>{r({sectors:o.getSectors({visible:!0}),Container:Pi(l)})};return t.on(i,a),()=>{t.off(i,a)}},[t]),h.useEffect(()=>n.setCustomStyles(!0),[]),t?Kr(e)?e(s):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})}),bf=h.memo(function({children:e}){const{editor:t}=Jn(),n=Hs(),[s,r]=h.useState(()=>({traits:[],Container:()=>c.jsx(c.Fragment,{})}));return h.useEffect(()=>{if(!t)return;const{Traits:o}=t,i=o.events.custom,a=({container:l})=>{r({traits:o.getCurrent(),Container:Pi(l)})};return t.on(i,a),o.__trgCustom(),()=>{t.off(i,a)}},[t]),h.useEffect(()=>n.setCustomTraits(!0),[]),t?Kr(e)?e(s):c.jsx(c.Fragment,{}):c.jsx(c.Fragment,{})}),Qa=({children:e})=>N4()?c.jsx(c.Fragment,{children:e}):c.jsx(c.Fragment,{});function Kp(e){return e=e.trimStart(),e=e.replace(/\s*([\{\}\:\;\,])\s*/g,"$1"),e=e.replace(/;\s*;/g,";"),e=e.replace(/\,[\s\.\#\d]*{/g,"{"),e=e.replace(/([^\s])\{([^\s])/g,`$1 {
267
+ </mj-section>`})}const P4=(e,t)=>({[mt.web]:s=>Hu(s,t),[mt.document]:s=>Hu(s,t),[mt.react]:s=>Hu(s,t),[mt.email]:s=>j4(s,t)})[e],pi="https://cdn.jsdelivr.net/npm/",zu={id:"gjs-blocks-basic",src:`${pi}grapesjs-blocks-basic@1.0.1/dist/index.js`},T4={id:"grapesjs-plugin-forms",src:`${pi}grapesjs-plugin-forms@2.0.5/dist/index.js`},Uu={id:"grapesjs-parser-postcss",src:`${pi}grapesjs-parser-postcss@1.0.1/dist/index.js`},O4={id:"grapesjs-navbar",src:`${pi}grapesjs-navbar@1.0.1/dist/index.js`,options:{block:{category:"Extra"}}},Wu={id:"grapesjs-plugin-export",src:`${pi}grapesjs-plugin-export@1.0.11/dist/index.js`,options:{isBinary:(e,t)=>{const n=t.split(".")[1];return/[\x00-\x08\x0E-\x1F]/.test(e)&&!(n&&["html","css"].indexOf(n)>=0)}}},_4={id:"grapesjs-mjml",src:`${pi}grapesjs-mjml@1.0.7/dist/index.js`,options:{columnsPadding:"",useCustomTheme:!1,resetDevices:!1,resetBlocks:!1,blocks:[],useXmlParser:!0,resetStyleManager:!1}},A4={[mt.email]:[E4,_4],[mt.web]:[zu,T4,Wu,Uu,O4],[mt.document]:[zu,Wu,Uu],[mt.react]:[zu,Wu,Uu]};function M4(e,t){const{blocks:n}=t.appStore.sdkOptions;Array.isArray(n==null?void 0:n.default)&&e.BlockManager.blocks.add(n.default),e.on("rteToolbarPosUpdate",s=>{const r=-s.canvasOffset.left;s.left<r&&(s.left=r)})}function h0({onCopy:e,getValue:t,value:n,title:s="Copy",...r}){const[o,i]=f.useState(!1),a=()=>{Ox((t==null?void 0:t())??n),i(!0),e==null||e()};return f.useEffect(()=>{if(!o)return;const c=setTimeout(()=>i(!1),3e3);return()=>clearTimeout(c)},[o]),l.jsx(ft,{onClick:a,title:s,type:"button",size:"lg",withBg:!0,...r,children:l.jsx(Q,{className:ie(o&&B.tA),icon:o?U.check:U.contentCopy,size:oe.s})})}const L4=(e,t)=>e.filter(n=>n.id===t)[0]||null,g0=(e,t)=>(e==null?void 0:e.id)===(t==null?void 0:t.id),N4=(e,t)=>e.label.toLowerCase().indexOf(t.toLowerCase())>=0,m0=K("cursor-default select-none focus:gs-utl-outline-none","z-20 max-h-full"),Ef={strategy:"fixed",placement:"bottom",modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"flip",options:{fallbackPlacements:["top"]}}]};function $g(e){var o;const{option:t,active:n,selected:s}=e,r=((o=e.isSelected)==null?void 0:o.call(e))||!0;return l.jsxs(k,{items:"center",className:K([we.xy,n&&Np.bgH]),children:[l.jsx(V,{className:K("truncate"),grow:!0,children:t.label}),l.jsx(V,{className:K("gjs-pl-2"),children:g0(t,s)&&r&&l.jsx(Q,{className:K(B.tA),icon:U.check,size:oe.s})})]})}const $4="gs-select-field";function kg({option:e}){return l.jsxs(l.Fragment,{children:[e.icon&&l.jsx(Q,{...nt(e.icon)?{icon:e.icon,size:oe.s2x}:e.icon}),l.jsx(V,{className:K("truncate"),grow:!0,children:e.content||e.label})]})}function je(e){const{value:t,onChange:n,onBlur:s,onFocus:r,handlerSelected:o,label:i,options:a,includeEmpty:c,className:u,search:d,open:p,caret:h=U.chevronDown,size:g="m",border:m,emptyState:b="- Select an option -",name:v,required:x,disabled:y,classNameContainer:w,autoFocus:S,labelAs:C,hideCaret:j}=e,[E,T]=f.useState(null),[O,P]=f.useState(null),[_,M]=f.useState(""),{styles:N,attributes:H}=$a(E,O,Ef),L=typeof d=="object"?d.onChange:void 0,F=[...a].filter(te=>d?L||N4(te,_):te),G=d&&(typeof d=="object"&&d.value||_),D=G&&F.length?F[0]:L4(F,t),$=te=>n(te.id,te),I={id:null,label:b},R=(D==null?void 0:D.content)||(D==null?void 0:D.label),z=D?o?o(D):D.icon?l.jsx(k,{items:"center",gap:"s",children:l.jsx(kg,{option:D})}):R:o?o(I):b;c&&F.unshift(I);const Y=te=>{const{value:q}=te.target,ne=q.trim();switch(te.key){case"Escape":n(null);break;case"Enter":n((F.length?F[0].id:ne)||null,F[0]);break;case" ":ao(te);break}},Z=A("gs-utl-w-full gs-utl-text-left gs-utl-cursor-pointer gs-utl-block",X.rnd,ta.focus),J=()=>{s==null||s()},ee=Vr({...e,className:A($4,w,"gs-utl-relative",g.includes("s")&&"gs-utl-text-xs")});return l.jsx(wi,{value:D,onChange:$,disabled:y,children:({open:te})=>l.jsxs("div",{...ee,children:[i&&l.jsx(wi.Label,{as:C,className:e.classNameLabel,children:l.jsx(ns,{as:"span",...e})}),v&&l.jsx("input",{type:"input",name:v,value:(D==null?void 0:D.id)??"",onChange:()=>{},className:K("gs-utl-w-[1px] gs-utl-h-[1px] gs-utl-opacity-[0.001] gs-utl-absolute"),required:x,disabled:y}),l.jsx(wi.Button,{ref:T,className:Z,tabIndex:d?-1:void 0,children:d?l.jsx("input",{autoFocus:S,value:typeof d=="object"&&d.value||_,className:A([u,"gs-utl-w-full",X.rnd,ta.focus,we.xyS]),onChange:q=>{M(q.target.value),L==null||L(q.target.value)},onKeyDown:Y,onClick:ao,onBlur:J,onFocus:r}):l.jsx(Dn,{border:m,size:g,title:z,icon:j?{className:"gs-utl-opacity-0 gs-utl-pointer-events-none"}:h,shadow:!1,className:K(u),titleClass:"",disabled:y})}),l.jsx(wi.Options,{static:p,className:m0,ref:P,style:N.popper,...H.popper,children:l.jsxs(Dn,{padding:!1,className:K("h-full"),style:{minWidth:`${E==null?void 0:E.offsetWidth}px`,maxHeight:200},children:[!F.length&&d&&d!==!0&&l.jsx("div",{className:K(we.xy),children:d.empty}),F.map((q,ne)=>l.jsx(wi.Option,{value:q,children:({active:ce})=>l.jsxs(k,{items:"center",gap:"s",className:K([q.className,we.xy,ce&&Np.bgH]),nowrap:!0,children:[l.jsx(kg,{option:q}),l.jsx(V,{className:K("gjs-pl-2"),children:g0(q,D)&&!G&&l.jsx(Q,{className:K(B.tA),icon:U.check,size:oe.s})})]})},ne))]})})]})})}const b0=f.createContext(null),k4=({children:e})=>{const[t,n]=f.useState({setEditor:s=>{n(r=>({...r,editor:s}))}});return l.jsx(b0.Provider,{value:t,children:e})},Fn=()=>{const e=f.useContext(b0);if(!e)throw new Error("useEditorInstance must be used within EditorInstanceProvider");return e},Fa=()=>{const{editor:e}=Fn();if(!e)throw new Error("useEditor used before the load of the editor instance. You can wrap your component in `<WithEditor>` or make use of `useEditorMaybe` hook and ensure the `editor` exists.");return e},R4=()=>Fn().editor,v0=f.createContext(null),I4=({children:e})=>{const[t,n]=f.useState(()=>({setRefCanvas(s){n(r=>({...r,refCanvas:s}))},setCustomModal(s){n(r=>({...r,customModal:s}))},setCustomAssets(s){n(r=>({...r,customAssets:s}))},setCustomBlocks(s){n(r=>({...r,customBlocks:s}))},setCustomRte(s){n(r=>({...r,customRte:s}))},setCustomStyles(s){n(r=>({...r,customStyles:s}))},setCustomLayers(s){n(r=>({...r,customLayers:s}))},setCustomSelectors(s){n(r=>({...r,customSelectors:s}))},setCustomTraits(s){n(r=>({...r,customTraits:s}))},setReady(s){n(r=>({...r,ready:s}))}}));return l.jsx(v0.Provider,{value:t,children:e})},As=()=>{const e=f.useContext(v0);if(!e)throw new Error("useEditorOptions must be used within EditorOptionsProvider");return e};function V4(...e){return(Array.isArray(e[0])?e[0]:[...e]).filter(Boolean).join(" ")}function Hr(e){return typeof e=="function"}function Zn(){}const y0=e=>typeof e=="string",H4=async e=>{const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)},x0=e=>{const t=y0(e)?{id:e,src:e}:e;return new Promise((n,s)=>{const r=document.createElement("script");if(document.querySelector(`script[src="${t.src}"]`))return n(t.id);r.src=t.src,r.onload=()=>n(t.id),r.onerror=()=>s(t.id),document.head.appendChild(r)})},D4=e=>{const t=e.map(n=>x0(n));return Promise.allSettled(t)},Rg=e=>function(){const t=f.useRef(null);return f.useEffect(()=>{const{current:n}=t;n&&(y0(e)?n.innerHTML=e:n.appendChild(e))},[t.current]),l.jsx("div",{ref:t})},Ig=new WeakMap;function fi(e){if(!e)return()=>l.jsx(l.Fragment,{});const t=Ig.get(e);if(t)return t;const n=function({children:s}){return Mn.createPortal(f.createElement("div",null,s),e)};return Ig.set(e,n),n}f.memo(function({children:e}){const{editor:t}=Fn(),n=As(),[s,r]=f.useState(!1),[o,i]=f.useState({assets:[],types:[],close:()=>{},select:()=>{},Container:()=>l.jsx(l.Fragment,{})});return f.useEffect(()=>{if(!t)return;const a=t.Assets.events.custom,c=({open:u,assets:d,types:p,select:h,close:g,container:m})=>{u&&i({assets:d,types:p,select:h,close:g,Container:fi(m)}),r(u)};return t.on(a,c),()=>{t.off(a,c)}},[t]),f.useEffect(()=>n.setCustomAssets(!0),[]),t?Hr(e)?e({open:s,...o}):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})});f.memo(function({children:e}){const{editor:t}=Fn(),n=As(),[s,r]=f.useState(()=>({blocks:[],dragStart:Zn,dragStop:Zn,mapCategoryBlocks:new Map,Container:()=>l.jsx(l.Fragment,{})}));return f.useEffect(()=>{if(!t)return;const o=t.Blocks.events.custom,i=({blocks:a,container:c,dragStart:u,dragStop:d})=>{const p=a.reduce((h,g)=>{const m=g.getCategoryLabel(),b=h.get(m);return b?b.push(g):h.set(m,[g]),h},new Map);r({blocks:a,dragStart:u,dragStop:d,mapCategoryBlocks:p,Container:fi(c)})};return t.on(o,i),t.Blocks.__trgCustom(),()=>{t.off(o,i)}},[t]),f.useEffect(()=>n.setCustomBlocks(!0),[]),t?Hr(e)?e(s):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})});function F4({children:e,...t}){const n=As(),s=f.useRef(null);return f.useEffect(()=>{s.current&&n.setRefCanvas(s.current)},[s.current]),l.jsx("div",{...t,ref:s,children:e})}const B4=f.memo(function({children:e}){const{editor:t}=Fn(),[n,s]=f.useState(()=>({devices:[],selected:"",select:Zn}));return f.useEffect(()=>{if(!t)return;const{Devices:r}=t,o=r.events.all,i=()=>{var a;s({devices:r.getDevices(),selected:(a=r.getSelected())==null?void 0:a.id,select:c=>r.select(c)})};return t.on(o,i),i(),()=>{t.off(o,i)}},[t]),t?Hr(e)?e(n):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})}),z4=e=>!!(e&&!Array.isArray(e)&&typeof e=="object");async function U4(e){const t=e.map(({id:o,src:i})=>({id:o,src:i})),n=e.reduce((o,i)=>(o[i.id]=i,o),{}),s=[],r=[];return(await D4(t)).forEach(o=>{o.status==="fulfilled"?s.push(n[o.value]):r.push(n[o.reason])}),{loaded:s,failed:r}}const W4=async e=>{const t=[...e],n={};if(t.length){const s={},r=[];if(t.forEach((o,i)=>{z4(o)&&(s[o.id]={index:i},r.push(o))}),r.length){const{loaded:o}=await U4(r);o.forEach(({id:i,options:a})=>{s[i].loaded=!0,n[i]=a||{}})}Object.keys(s).forEach(o=>{const i=s[o];i.loaded?t[i.index]=o:t[i.index]=!1})}return{plugins:t.filter(Boolean),pluginOptions:n}},G4=f.memo(function({children:e,className:t,style:n,options:s={},plugins:r=[],grapesjs:o,grapesjsCss:i,onEditor:a=Zn,onReady:c,onUpdate:u,waitReady:d,...p}){const{setEditor:h}=Fn(),g=As(),[m,b]=f.useState(!1),v=f.useRef(null);f.useEffect(()=>{if(!g.ready||!v.current)return;const E=v.current,T=g.refCanvas;let O,P={},_=[];const M=N=>{const H={height:"100%",...s,plugins:[..._,...s.plugins||[]],pluginsOpts:{...s.pluginsOpts,...P},modal:{custom:!!g.customModal,...s.modal},assetManager:{custom:!!g.customAssets,...s.assetManager},styleManager:{custom:!!g.customStyles,...s.styleManager},blockManager:{custom:!!g.customBlocks,...s.blockManager},richTextEditor:{custom:!!g.customRte,...s.richTextEditor},layerManager:{custom:!!g.customLayers,...s.layerManager},traitManager:{custom:!!g.customTraits,...s.traitManager},selectorManager:{custom:!!g.customSelectors,...s.selectorManager},container:T||E,customUI:!!T,...T?{panels:{defaults:[]}}:{}};O=N.init(H),h(O),a(O),u&&O.on("update",()=>{u(O.getProjectData(),O)}),O.onReady(()=>{b(!0),c==null||c(O)})};return(async()=>{i&&await H4(i);const N=await W4(r);_=N.plugins,P=N.pluginOptions,typeof o=="string"?(await x0(o),M(window.grapesjs)):M(o)})(),()=>O==null?void 0:O.destroy()},[g.ready]);const x=s.height??"100%",y=s.width??"100%",w=V4("gjs-editor-wrapper",t),S=d&&!m,C=f.useMemo(()=>({...n,height:x,width:y}),[x,y,n]),j=f.useMemo(()=>({...C,...S?{opacity:0,width:0,height:0}:{}}),[C,S]);return l.jsxs(l.Fragment,{children:[d&&!m?l.jsx("div",{className:w,style:C,children:d}):null,l.jsx("div",{...p,ref:v,className:w,style:j,children:e})]})}),q4=f.memo(function(){const e=As();return f.useEffect(()=>e.setReady(!0),[]),l.jsx(l.Fragment,{})});f.memo(function({children:e,...t}){return l.jsx(k4,{children:l.jsx(I4,{children:l.jsxs(G4,{...t,children:[e,l.jsx(q4,{})]})})})});const w0=f.memo(function({children:e}){const{editor:t}=Fn(),n=As(),[s,r]=f.useState(()=>({root:void 0,Container:()=>l.jsx(l.Fragment,{})}));return f.useEffect(()=>{if(!t)return;const{Layers:o}=t,i=o.events.custom,a=({container:c})=>{r({root:o.getRoot(),Container:fi(c)})};return t.on(i,a),o.__trgCustom({}),()=>{t.off(i,a)}},[t]),f.useEffect(()=>n.setCustomLayers(!0),[]),t?Hr(e)?e(s):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})});f.memo(function({children:e}){const{editor:t}=Fn(),n=As(),[s,r]=f.useState(!1),[o,i]=f.useState({title:l.jsx(l.Fragment,{}),content:l.jsx(l.Fragment,{}),attributes:{},close:Zn});return f.useEffect(()=>{if(!t)return;const a="modal",c=({open:u,title:d,content:p,close:h,attributes:g})=>{u&&i({title:f.createElement(Rg(d)),content:f.createElement(Rg(p)),attributes:g,close:h}),r(u)};return t.on(a,c),()=>{t.off(a,c)}},[t]),f.useEffect(()=>n.setCustomModal(!0),[]),t?typeof e=="function"?e({open:s,...o}):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})});const S0=f.memo(function({children:e}){const{editor:t}=Fn(),[n,s]=f.useState(()=>({pages:[],selected:void 0,select:Zn,add:Zn,remove:Zn}));return f.useEffect(()=>{if(!t)return;const{Pages:r}=t,o=r.events.all,i=()=>{s({pages:r.getAll(),selected:r.getSelected(),select:(...a)=>r.select(...a),add:(...a)=>r.add(...a),remove:(...a)=>r.remove(...a)})};return t.on(o,i),i(),()=>{t.off(o,i)}},[t]),t?Hr(e)?e(n):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})}),C0=f.memo(function({children:e}){const{editor:t}=Fn(),n=As(),[s,r]=f.useState(()=>({selectors:[],states:[],selectedState:"",targets:[],addSelector:Zn,removeSelector:Zn,setState:Zn,Container:()=>l.jsx(l.Fragment,{})}));return f.useEffect(()=>{if(!t)return;const{Selectors:o}=t,i=o.events.custom,a=({container:c})=>{r({selectors:o.getSelected(),states:o.getStates(),selectedState:o.getState(),targets:o.getSelectedTargets().map(u=>u.getSelectorsString()),addSelector:(...u)=>o.addSelected(...u),removeSelector:(...u)=>o.removeSelected(...u),setState:(...u)=>o.setState(...u),Container:fi(c)})};return t.on(i,a),()=>{t.off(i,a)}},[t]),f.useEffect(()=>n.setCustomSelectors(!0),[]),t?Hr(e)?e(s):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})}),j0=f.memo(function({children:e}){const{editor:t}=Fn(),n=As(),[s,r]=f.useState(()=>({sectors:[],Container:()=>l.jsx(l.Fragment,{})}));return f.useEffect(()=>{if(!t)return;const{Styles:o}=t,i=o.events.custom,a=({container:c})=>{r({sectors:o.getSectors({visible:!0}),Container:fi(c)})};return t.on(i,a),()=>{t.off(i,a)}},[t]),f.useEffect(()=>n.setCustomStyles(!0),[]),t?Hr(e)?e(s):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})}),Yd=f.memo(function({children:e}){const{editor:t}=Fn(),n=As(),[s,r]=f.useState(()=>({traits:[],Container:()=>l.jsx(l.Fragment,{})}));return f.useEffect(()=>{if(!t)return;const{Traits:o}=t,i=o.events.custom,a=({container:c})=>{r({traits:o.getCurrent(),Container:fi(c)})};return t.on(i,a),o.__trgCustom(),()=>{t.off(i,a)}},[t]),f.useEffect(()=>n.setCustomTraits(!0),[]),t?Hr(e)?e(s):l.jsx(l.Fragment,{}):l.jsx(l.Fragment,{})}),Ba=({children:e})=>R4()?l.jsx(l.Fragment,{children:e}):l.jsx(l.Fragment,{});function Pf(e){return e=e.trimStart(),e=e.replace(/\s*([\{\}\:\;\,])\s*/g,"$1"),e=e.replace(/;\s*;/g,";"),e=e.replace(/\,[\s\.\#\d]*{/g,"{"),e=e.replace(/([^\s])\{([^\s])/g,`$1 {
322
268
  $2`),e=e.replace(/([^\s])\}([^\n]*)/g,`$1
323
269
  }
324
270
  $2`),e=e.replace(/([^\s]);([^\s\}])/g,`$1;
325
- $2`),e}const ay=fe(function(){const t=Ja(),n=Re(),{Styles:s}=t,{isDarkTheme:r}=Ds(),o=s.getSelected(),[i,a]=h.useState(0),l=o?Kp(o==null?void 0:o.toCSS({allowEmpty:!0})):"",[u,d]=h.useState(l);h.useEffect(()=>{const p=()=>a(m=>++m),g=s.events.custom;return t.on(g,p),()=>{t.off(g,p)}},[s,t]);const f=()=>{if(u){const p=t.Parser.parseCss(u)[0];p&&(o==null||o.setStyle(p.style))}};return c.jsxs(k,{className:ee("relative"),col:!0,full:!0,children:[c.jsx(D,{grow:!0,children:o?c.jsx(ir,{padding:5,language:"css",defaultValue:l,onChange:d,isDarkTheme:r,clean:!0},i):n.t("noCode")}),c.jsx(Ke,{className:ee("absolute right-2 bottom-2 text-sm"),variant:"pr",size:"m2",onClick:f,children:n.t("update")})]})}),bm=[{id:"html",label:"HTML"},{id:"mjml",label:"MJML"}],z4=e=>{e.runCommand("gjs-export-zip",{filenamePfx:"gjs-export",root:async t=>{const n=await t.runCommand(ie.projectFiles),s={};for(const r in n){const o=n[r],{filename:i,content:a}=o;if(o.path){const l=o.path.split("/").filter(Boolean);let u=s;for(const d of l)u[d]=u[d]||{},u=u[d];u[i]=a}else s[i]=a}return s}})},U4=fe(function(t){const n=Re(),s=ye(),{isProjectTypeEmail:r}=s,o=s.editor,[i,a]=h.useState(bm[0].id),[l,u]=h.useState(),{isDarkTheme:d}=Ds(),[f]=h.useState(()=>Kp(o.getCss())),[p,g]=h.useState(),m=y=>n.t(`actions.showCode.${y}`),b={...t.options,...r?{export:!1}:{}},v=()=>z4(o);h.useEffect(()=>{(async()=>{var E,_;const w=await o.runCommand(ie.projectFiles,{page:o.Pages.getSelected(),skipProject:!0,styles:"skip"}),S=((E=w.find(T=>T.mimeType==="text/html"))==null?void 0:E.content)??"",C=((_=w.find(T=>T.mimeType==="text/mjml"))==null?void 0:_.content)??"";u(i==="mjml"?C:S)})()},[i]),h.useEffect(()=>{var y;p&&((y=p.getModel())==null||y.setValue(l),q0(p))},[p,l]);const x={padding:5,isDarkTheme:d,clean:!0};return c.jsxs(k,{col:!0,space:"m",children:[c.jsxs(k,{className:ee("h-96"),space:"m",children:[c.jsxs(D,{className:ee("relative"),grow:!0,children:[r&&c.jsxs(k,{className:ee("absolute top-3 right-3 z-10"),space:"s",nowrap:!0,children:[c.jsx(_e,{value:i,onChange:a,options:bm,className:ee("min-w-24")}),c.jsx(Z0,{getValue:()=>p.getModel().getValue()})]}),l!==void 0&&c.jsx(ir,{defaultValue:l,language:"html",onMount:g,...x})]}),!r&&c.jsx(D,{grow:!0,children:c.jsx(ir,{defaultValue:f,language:"css",...x})})]}),b.export!==!1&&c.jsx(k,{justify:"end",children:c.jsx(Ke,{size:"m2",variant:"pr",onClick:v,children:m("exportButton")})})]})});function W4(e,t){h.useEffect(()=>{const n="pointerdown",{current:s}=e;if(!s||!t.enabled)return;function r(o){const i=o.target;s&&i&&!s.contains(i)&&t.onTrigger(i)}return document.addEventListener(n,r),()=>{document.removeEventListener(n,r)}},[e.current,t.enabled])}const ly=e=>{const{ref:t,show:n,node:s,styles:r,update:o,reload:i}=e,a={all:"initial",zIndex:"10",fontFamily:"inherit",...r};h.useEffect(()=>{const l=t.current;if(l&&n){if(!l.__sh){const f=l.attachShadow({mode:"closed"});l.__sh=nw.createRoot(f)}l.__sh.render(s),Object.keys(a).forEach(f=>{l.style.setProperty(ww(f),a[f],"important")});const u=new MutationObserver(i);u.observe(l,{attributeFilter:["style"]});const d=new MutationObserver(f=>{Array.from(f[0].removedNodes).includes(l)&&i()});return d.observe(l.parentNode,{childList:!0}),()=>{u.disconnect(),d.disconnect()}}},[t.current,n,o])},G4="gs-cmp-popover";function ps({children:e,handler:t,title:n,size:s,padding:r=!0,border:o=!0,overlay:i,clickAway:a,topIcon:l,placement:u="auto",offset:d,open:f,onClose:p,buttonAs:g,className:m,classNameBody:b,buttonProps:v={},disabled:x,hideCloseButton:y}){const[w,S]=h.useState(!!f),[C,j]=h.useState(w),[E,_]=h.useState(null),[T,P]=h.useState(null),A=Wa(E,T,{...Sh({offset:d}),placement:u}),M=()=>{j(!1),p==null||p()};W4({current:T},{onTrigger:M,enabled:a&&w}),h.useEffect(()=>{j(!!f)},[f]),h.useEffect(()=>{var L;w&&((L=A.update)==null||L.call(A))},[w,A.update]),h.useEffect(()=>{const L=setTimeout(()=>S(C),10);return()=>clearTimeout(L)},[C]);const R=ee("w-full transition-colors",x&&"pointer-events-none",...bv({border:!1,size:"",...v})),F=ee(["fixed z-20",l&&"gjs-mt-5",s==="s"&&"w-full max-w-64",s==="sm"&&"w-full max-w-sm",s==="md"&&"w-full max-w-md"]);return c.jsxs(qu,{className:ee(G4,"relative flex",m),children:[c.jsx(qu.Button,{ref:_,as:g,className:R,children:c.jsx("div",{onClick:L=>{bo(L),!(Lt(f)||x)&&j(!w)},children:t})}),w&&i&&c.jsx("div",{onClick:M,className:ee("z-10 fixed inset-0")}),C&&c.jsx(qu.Panel,{static:!0,className:F,ref:P,style:A.styles.popper,...A.attributes.popper,children:c.jsx(Ap,{as:h.Fragment,show:w,unmount:!1,...hv,children:c.jsx(Xn,{classNameBody:b,title:n,onClose:y?void 0:M,padding:r,border:o,children:typeof e=="function"?e({close:M,open:w}):e})})})]})}function _i(e){const{action:t,icon:n,label:s,className:r,items:o,onItemClick:i,selected:a,...l}=e,u=h.useRef(null),[d,f]=h.useState(),p=u.current,g=N([r,"gs-utl-last:border-b-0 gs-utl-gap-2 gs-utl-select-none",z.br,je.xy,re.bb,l.disabled&&Ee.disabled,...t?[z.hBgH,"gs-utl-cursor-pointer"]:["gs-utl-cursor-default"]]),m=v=>{Ye(t)&&(t({event:v}),i==null||i({event:v,item:e}))};h.useEffect(()=>{if(!p)return;const v=setTimeout(()=>f(p.getBoundingClientRect()),l.active?0:tp);return()=>clearTimeout(v)},[p,l.active]);const b=()=>{var v;return(v=l.onActive)==null?void 0:v.call(l)};return c.jsxs(k,{ref:u,items:"center",nowrap:!0,className:g,onClick:m,onPointerEnter:b,children:[n&&c.jsx(D,{children:c.jsx(oe,{icon:n,size:le.sx})}),!!s&&c.jsx(D,{className:N(l.classNameLabel,Ee.txtEllips),grow:!0,children:s}),!!a&&c.jsx(D,{children:c.jsx(oe,{className:z.tA,icon:Z.check,size:le.s})}),!!(o!=null&&o.length)&&c.jsxs(c.Fragment,{children:[c.jsx(D,{children:c.jsx(oe,{icon:Z.chevronRight,size:le.s,className:"-gs-utl-mr-2"})}),d&&l.active&&c.jsx(x7,{items:o,x:d.left,y:d.top,w:d.width,h:d.height,onItemClick:i,open:!0})]})]})}const ru=({className:e,grow:t,alignItems:n,justifyContent:s})=>N(e,z.br,t&&"gs-utl-flex-grow",n==="start"&&"gs-utl-items-start",n==="end"&&"gs-utl-items-end",n==="center"&&"gs-utl-items-center",n==="baseline"&&"gs-utl-items-baseline",n==="stretch"&&"gs-utl-items-stretch",s==="start"&&"gs-utl-justify-start",s==="end"&&"gs-utl-justify-end",s==="center"&&"gs-utl-justify-center",s==="between"&&"gs-utl-justify-between",s==="around"&&"gs-utl-justify-around",s==="evenly"&&"gs-utl-justify-evenly"),ou=({style:e,width:t,height:n,gap:s})=>({height:n,gap:s,width:t,...e}),mn=h.memo(fe(function({id:t,children:n,className:s,style:r,width:o,gap:i,height:a,grow:l,alignItems:u,justifyContent:d,htmlAttrs:f,...p}){const{layoutsById:g}=S0(),[m,b]=h.useState({}),{className:v,style:x,...y}=f||{},w=s??v,S=r??x,C=h.useMemo(()=>ou({height:a,gap:i,width:o,style:S}),[S,o,a,i]),j=ru({className:w,grow:l,alignItems:u,justifyContent:d});h.useEffect(()=>{if(t)return g.set(t,{state:m,setState:b}),()=>{g.delete(t)}},[g,m]);const E=p.as??"div";return c.jsx(E,{style:C,className:j,...p,...y,children:m.children??n})})),Sl="gs-cmp-button-menu",q4=h.memo(fe(function({className:t,style:n,icon:s,label:r,size:o,tooltip:i,value:a,disabled:l,options:u,children:d,editorEvents:f,classNameBtn:p,iconMenu:g="chevronDown",onClick:m,onClickMenu:b,onOptionSelect:v}){const{editor:x}=ye(),[y,w]=h.useState(!1),[S,C]=h.useState(()=>({isOpen:y,className:t,style:n,tooltip:i,label:r,icon:s,iconMenu:g,size:o,disabled:l,value:a,options:u})),E={editor:x,state:S,setState:H=>C($=>({...$,...H}))};Jr({editor:x,editorEvents:f,localState:S,setLocalState:C});const _=H=>{m==null||m({...E,event:H})},T=H=>{v==null||v({...E,option:H}),w(!1)},P=S.tooltip,A=ot(P)?{title:P}:{tooltipProps:P},R=(()=>{var V,G;if(S.label)return Ye(S.label)?S.label(E):S.label;const H=(V=S.options)==null?void 0:V.find(W=>W.id===S.value),$=(G=S.options)==null?void 0:G[0],I=H||$,O=N((H==null?void 0:H.id)===S.value&&z.tA);if(I!=null&&I.icon)return{type:"icon",className:O,icon:I.icon,size:18};if(I!=null&&I.label)return{type:"text",className:O,content:I.label}})(),F=Ot(R),L=()=>{if(d){const H=Ye(d)?d(E):d;return Ot(H)}return S.options&&S.options.length>0?c.jsx("div",{className:`${Sl}-options`,children:S.options.map(H=>c.jsx(_i,{label:H.label,icon:H.icon,selected:H.id===S.value,action:()=>T(H)},H.id))}):null},B=H=>{H.stopPropagation(),b?b({...E,event:H}):w(!y)},q=c.jsx(k,{items:"center",onClick:B,className:N(`${Sl}__icon-menu`,z.hBgH2,z.txtHighEmphasisH),children:c.jsx(oe,{icon:S.iconMenu,size:"14px"})});return c.jsx(mn,{className:N(Sl,"gs-utl-flex",S.className),style:S.style,children:c.jsx(ps,{handler:c.jsx(bt,{className:N(`${Sl}__btn`,p),icon:S.icon,size:S.size,disabled:S.disabled,onClick:_,block:!0,...A,children:R?c.jsxs(k,{items:"center",gap:"s",nowrap:!0,children:[c.jsx(k,{items:"center",children:F}),q]}):q}),buttonAs:"div",open:y,onClose:()=>w(!1),clickAway:!0,padding:!1,hideCloseButton:!0,children:L()})})}));function Yt(e){const{className:t,options:n,name:s,value:r,size:o="m",required:i,disabled:a,onChange:l,labelAs:u}=e,d=g=>{const m=n.filter(b=>b.id===g)[0];return n.indexOf(m)===n.length-1},f=(g,m)=>N("gs-utl-cursor-pointer",o==="m"&&je.xy,o==="s"&&"gs-utl-px-2 gs-utl-py-1 text-sm",o==="xs"&&"gs-utl-p-1 text-sm",z.br,g&&z.bgO,!d(m)&&re.br),p=qr({...e,className:"gs-field-buttons"});return c.jsxs(wg,{value:r,onChange:l,disabled:a,...p,children:[c.jsx(fs,{...e,as:u}),s&&c.jsx("input",{type:"hidden",name:s,value:r,required:i}),c.jsx(k,{className:N(t,re.b,re.rnd,z.br,"gs-utl-cursor-pointer"),items:"center",full:!0,nowrap:!0,children:n.map(({id:g,label:m,title:b,icon:v})=>c.jsx(It,{title:b,className:N("gs-utl-w-full"),classNameWrp:N("gs-utl-flex-1"),children:c.jsx(wg.Option,{value:g,className:({checked:x})=>f(x,g),children:c.jsxs(k,{justify:"center",gap:"s",full:!0,children:[!!v&&c.jsx(oe,{...ot(v)?{icon:v,size:le.s}:v}),m&&c.jsx(D,{children:m})]})})},g))})]})}const K4="gs-cmp-button-group-field",Y4=h.memo(fe(function({className:t,label:n,name:s,value:r,options:o,size:i,required:a,disabled:l,onChange:u,editorEvents:d}){const{editor:f}=ye(),[p,g]=h.useState(()=>({className:t,label:n,name:s,value:r,options:o,size:i,required:a,disabled:l})),m=b=>{u({value:b,editor:f,state:p,setState:v=>g(x=>({...x,...v}))})};return Jr({editor:f,editorEvents:d,localState:p,setLocalState:g}),c.jsx(Yt,{className:N(K4,p.className),label:p.label,name:p.name,value:p.value,options:p.options??[],size:p.size,required:p.required,disabled:p.disabled,onChange:m})}));function iu({colors:e,...t}){return e?c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 79 79",...t,children:[c.jsx("path",{fill:"url(#a)",d:"M39.6 77.1a37.5 37.5 0 1 0 0-75 37.5 37.5 0 0 0 0 75Z"}),c.jsx("path",{stroke:"#fff",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"5",d:"m40 19-14.58 8.79a6.36 6.36 0 0 0-2.82 5.33v14.13a6.14 6.14 0 0 0 3.12 5.13l11.21 5.8a6.12 6.12 0 0 0 6.14 0l11.41-6.3a6.09 6.09 0 0 0 3.12-5.13V33.12c0-1.28-1.4-2.07-2.52-1.48l-15.08 8"}),c.jsx("defs",{children:c.jsxs("linearGradient",{id:"a",x1:"2.1",x2:"77.2",y1:"39.6",y2:"39.6",gradientUnits:"userSpaceOnUse",children:[c.jsx("stop",{stopColor:"#D7709E"}),c.jsx("stop",{offset:"1",stopColor:"#A84A87"})]})})]}):c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 76 76",...t,children:c.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M64.117 64.117a37.5 37.5 0 1 1-53.034-53.034 37.5 37.5 0 0 1 53.034 53.034ZM39.29 19.14a2.5 2.5 0 1 0-2.582-4.282l-14.583 8.79-.05.03-.047.032a8.861 8.861 0 0 0-2.917 3.229 8.729 8.729 0 0 0-1.011 4.203V45.293l.002.047a8.64 8.64 0 0 0 1.25 4.164 8.78 8.78 0 0 0 3.115 3.043l.05.03.053.027 11.165 5.769a8.62 8.62 0 0 0 4.264 1.127c1.507 0 2.99-.394 4.295-1.145l11.394-6.276.006-.004a8.585 8.585 0 0 0 3.178-3.05 8.443 8.443 0 0 0 1.227-4.225V31.123c0-3.265-3.502-5.122-6.19-3.688l-.005.003-15.076 7.995a2.5 2.5 0 0 0 2.342 4.418l13.93-7.387v12.263a3.444 3.444 0 0 1-.502 1.703 3.584 3.584 0 0 1-1.326 1.271l-.003.002-11.409 6.284-.024.014-.023.013a3.619 3.619 0 0 1-1.814.486 3.62 3.62 0 0 1-1.814-.486l-.052-.03-.054-.028-11.155-5.764a3.78 3.78 0 0 1-1.297-1.283 3.642 3.642 0 0 1-.527-1.715V31.081a3.73 3.73 0 0 1 .432-1.806 3.858 3.858 0 0 1 1.23-1.377L39.29 19.14Z",clipRule:"evenodd"})})}const Z4=h.memo(fe(function(){const{isStage:e,updateStudio:t}=ye(),{isDarkTheme:n}=Ds(),s=h.useRef(null),{bg:r,text:o}=gv(n);return ly({ref:s,show:e,update:n,reload:t,styles:{display:"flex",justifyContent:"center",position:"absolute",bottom:"0",right:"0",left:"0"},node:c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
271
+ $2`),e}const E0=ae(function(){const t=Fa(),n=Ae(),{Styles:s}=t,{isDarkTheme:r}=_s(),o=s.getSelected(),[i,a]=f.useState(0),c=o?Pf(o==null?void 0:o.toCSS({allowEmpty:!0})):"",[u,d]=f.useState(c);f.useEffect(()=>{const h=()=>a(m=>++m),g=s.events.custom;return t.on(g,h),()=>{t.off(g,h)}},[s,t]);const p=()=>{if(u){const h=t.Parser.parseCss(u)[0];h&&(o==null||o.setStyle(h.style))}};return l.jsxs(k,{className:K("relative"),col:!0,full:!0,children:[l.jsx(V,{grow:!0,children:o?l.jsx(Xs,{padding:5,language:"css",defaultValue:c,onChange:d,isDarkTheme:r,clean:!0},i):n.t("noCode")}),l.jsx(Ge,{className:K("absolute right-2 bottom-2 text-sm"),variant:"pr",size:"m2",onClick:p,children:n.t("update")})]})}),Vg=[{id:"html",label:"HTML"},{id:"mjml",label:"MJML"}],K4=e=>{e.runCommand("gjs-export-zip",{filenamePfx:"gjs-export",root:async t=>{const n=await t.runCommand(se.projectFiles),s={};for(const r in n){const o=n[r],{filename:i,content:a}=o;if(o.path){const c=o.path.split("/").filter(Boolean);let u=s;for(const d of c)u[d]=u[d]||{},u=u[d];u[i]=a}else s[i]=a}return s}})},Z4=ae(function(t){const n=Ae(),s=me(),{isProjectTypeEmail:r}=s,o=s.editor,[i,a]=f.useState(Vg[0].id),[c,u]=f.useState(),{isDarkTheme:d}=_s(),[p]=f.useState(()=>Pf(o.getCss())),[h,g]=f.useState(),m=y=>n.t(`actions.showCode.${y}`),b={...t.options,...r?{export:!1}:{}},v=()=>K4(o);f.useEffect(()=>{(async()=>{var E,T;const w=await o.runCommand(se.projectFiles,{page:o.Pages.getSelected(),skipProject:!0,styles:"skip"}),S=((E=w.find(O=>O.mimeType==="text/html"))==null?void 0:E.content)??"",C=((T=w.find(O=>O.mimeType==="text/mjml"))==null?void 0:T.content)??"";u(i==="mjml"?C:S)})()},[i]),f.useEffect(()=>{var y;h&&((y=h.getModel())==null||y.setValue(c),d0(h))},[h,c]);const x={padding:5,isDarkTheme:d,clean:!0};return l.jsxs(k,{col:!0,space:"m",children:[l.jsxs(k,{className:K("h-96"),space:"m",children:[l.jsxs(V,{className:K("relative"),grow:!0,children:[r&&l.jsxs(k,{className:K("absolute top-3 right-3 z-10"),space:"s",nowrap:!0,children:[l.jsx(je,{value:i,onChange:a,options:Vg,className:K("min-w-24")}),l.jsx(h0,{getValue:()=>h.getModel().getValue()})]}),c!==void 0&&l.jsx(Xs,{defaultValue:c,language:"html",onMount:g,...x})]}),!r&&l.jsx(V,{grow:!0,children:l.jsx(Xs,{defaultValue:p,language:"css",...x})})]}),b.export!==!1&&l.jsx(k,{justify:"end",children:l.jsx(Ge,{size:"m2",variant:"pr",onClick:v,children:m("exportButton")})})]})});function Y4(e,t){f.useEffect(()=>{const n="pointerdown",{current:s}=e;if(!s||!t.enabled)return;function r(o){const i=o.target;s&&i&&!s.contains(i)&&t.onTrigger(i)}return document.addEventListener(n,r),()=>{document.removeEventListener(n,r)}},[e.current,t.enabled])}const P0=e=>{const{ref:t,show:n,node:s,styles:r,update:o,reload:i}=e,a={all:"initial",zIndex:"10",fontFamily:"inherit",...r};f.useEffect(()=>{const c=t.current;if(c&&n){if(!c.__sh){const p=c.attachShadow({mode:"closed"});c.__sh=yx.createRoot(p)}c.__sh.render(s),Object.keys(a).forEach(p=>{c.style.setProperty(Vx(p),a[p],"important")});const u=new MutationObserver(i);u.observe(c,{attributeFilter:["style"]});const d=new MutationObserver(p=>{Array.from(p[0].removedNodes).includes(c)&&i()});return d.observe(c.parentNode,{childList:!0}),()=>{u.disconnect(),d.disconnect()}}},[t.current,n,o])},X4="gs-cmp-popover";function ss({children:e,handler:t,title:n,size:s,padding:r=!0,border:o=!0,overlay:i,clickAway:a,topIcon:c,placement:u="auto",offset:d,open:p,onClose:h,buttonAs:g,className:m,classNameBody:b,buttonProps:v={},disabled:x,hideCloseButton:y}){const[w,S]=f.useState(!!p),[C,j]=f.useState(w),[E,T]=f.useState(null),[O,P]=f.useState(null),_=$a(E,O,{...eh({offset:d}),placement:u}),M=()=>{j(!1),h==null||h()};Y4({current:O},{onTrigger:M,enabled:a&&w}),f.useEffect(()=>{j(!!p)},[p]),f.useEffect(()=>{var L;w&&((L=_.update)==null||L.call(_))},[w,_.update]),f.useEffect(()=>{const L=setTimeout(()=>S(C),10);return()=>clearTimeout(L)},[C]);const N=K("w-full transition-colors",x&&"pointer-events-none",...kb({border:!1,size:"",...v})),H=K(["fixed z-20",c&&"gjs-mt-5",s==="s"&&"w-full max-w-64",s==="sm"&&"w-full max-w-sm",s==="md"&&"w-full max-w-md"]);return l.jsxs(Ou,{className:K(X4,"relative flex",m),children:[l.jsx(Ou.Button,{ref:T,as:g,className:N,children:l.jsx("div",{onClick:L=>{ao(L),!(At(p)||x)&&j(!w)},children:t})}),w&&i&&l.jsx("div",{onClick:M,className:K("z-10 fixed inset-0")}),C&&l.jsx(Ou.Panel,{static:!0,className:H,ref:P,style:_.styles.popper,..._.attributes.popper,children:l.jsx(lf,{as:f.Fragment,show:w,unmount:!1,...Lb,children:l.jsx(Dn,{classNameBody:b,title:n,onClose:y?void 0:M,padding:r,border:o,children:typeof e=="function"?e({close:M,open:w}):e})})})]})}function hi(e){const{action:t,icon:n,label:s,className:r,items:o,onItemClick:i,selected:a,...c}=e,u=f.useRef(null),[d,p]=f.useState(),h=u.current,g=A([r,"gs-utl-last:border-b-0 gs-utl-gap-2 gs-utl-select-none",B.br,we.xy,X.bb,c.disabled&&Se.disabled,...t?[B.hBgH,"gs-utl-cursor-pointer"]:["gs-utl-cursor-default"]]),m=v=>{Ke(t)&&(t({event:v}),i==null||i({event:v,item:e}))};f.useEffect(()=>{if(!h)return;const v=setTimeout(()=>p(h.getBoundingClientRect()),c.active?0:Lp);return()=>clearTimeout(v)},[h,c.active]);const b=()=>{var v;return(v=c.onActive)==null?void 0:v.call(c)};return l.jsxs(k,{ref:u,items:"center",nowrap:!0,className:g,onClick:m,onPointerEnter:b,children:[n&&l.jsx(V,{children:l.jsx(Q,{icon:n,size:oe.sx})}),!!s&&l.jsx(V,{className:A(c.classNameLabel,Se.txtEllips),grow:!0,children:s}),!!a&&l.jsx(V,{children:l.jsx(Q,{className:B.tA,icon:U.check,size:oe.s})}),!!(o!=null&&o.length)&&l.jsxs(l.Fragment,{children:[l.jsx(V,{children:l.jsx(Q,{icon:U.chevronRight,size:oe.s,className:"-gs-utl-mr-2"})}),d&&c.active&&l.jsx(E9,{items:o,x:d.left,y:d.top,w:d.width,h:d.height,onItemClick:i,open:!0})]})]})}const zc=({className:e,grow:t,alignItems:n,justifyContent:s})=>A(e,B.br,t&&"gs-utl-flex-grow",n==="start"&&"gs-utl-items-start",n==="end"&&"gs-utl-items-end",n==="center"&&"gs-utl-items-center",n==="baseline"&&"gs-utl-items-baseline",n==="stretch"&&"gs-utl-items-stretch",s==="start"&&"gs-utl-justify-start",s==="end"&&"gs-utl-justify-end",s==="center"&&"gs-utl-justify-center",s==="between"&&"gs-utl-justify-between",s==="around"&&"gs-utl-justify-around",s==="evenly"&&"gs-utl-justify-evenly"),Uc=({style:e,width:t,height:n,gap:s})=>({height:n,gap:s,width:t,...e}),dn=f.memo(ae(function({id:t,children:n,className:s,style:r,width:o,gap:i,height:a,grow:c,alignItems:u,justifyContent:d,htmlAttrs:p,...h}){const{layoutsById:g}=Dv(),[m,b]=f.useState({}),{className:v,style:x,...y}=p||{},w=s??v,S=r??x,C=f.useMemo(()=>Uc({height:a,gap:i,width:o,style:S}),[S,o,a,i]),j=zc({className:w,grow:c,alignItems:u,justifyContent:d});f.useEffect(()=>{if(t)return g.set(t,{state:m,setState:b}),()=>{g.delete(t)}},[g,m]);const E=h.as??"div";return l.jsx(E,{style:C,className:j,...h,...y,children:m.children??n})})),cl="gs-cmp-button-menu",J4=f.memo(ae(function({className:t,style:n,icon:s,label:r,size:o,tooltip:i,value:a,disabled:c,options:u,children:d,editorEvents:p,classNameBtn:h,iconMenu:g="chevronDown",onClick:m,onClickMenu:b,onOptionSelect:v}){const{editor:x}=me(),[y,w]=f.useState(!1),[S,C]=f.useState(()=>({isOpen:y,className:t,style:n,tooltip:i,label:r,icon:s,iconMenu:g,size:o,disabled:c,value:a,options:u})),E={editor:x,state:S,setState:D=>C($=>({...$,...D}))};zr({editor:x,editorEvents:p,localState:S,setLocalState:C});const T=D=>{m==null||m({...E,event:D})},O=D=>{v==null||v({...E,option:D}),w(!1)},P=S.tooltip,_=nt(P)?{title:P}:{tooltipProps:P},N=(()=>{var z,Y;if(S.label)return Ke(S.label)?S.label(E):S.label;const D=(z=S.options)==null?void 0:z.find(Z=>Z.id===S.value),$=(Y=S.options)==null?void 0:Y[0],I=D||$,R=A((D==null?void 0:D.id)===S.value&&B.tA);if(I!=null&&I.icon)return{type:"icon",className:R,icon:I.icon,size:18};if(I!=null&&I.label)return{type:"text",className:R,content:I.label}})(),H=Pt(N),L=()=>{if(d){const D=Ke(d)?d(E):d;return Pt(D)}return S.options&&S.options.length>0?l.jsx("div",{className:`${cl}-options`,children:S.options.map(D=>l.jsx(hi,{label:D.label,icon:D.icon,selected:D.id===S.value,action:()=>O(D)},D.id))}):null},F=D=>{D.stopPropagation(),b?b({...E,event:D}):w(!y)},G=l.jsx(k,{items:"center",onClick:F,className:A(`${cl}__icon-menu`,B.hBgH2,B.txtHighEmphasisH),children:l.jsx(Q,{icon:S.iconMenu,size:"14px"})});return l.jsx(dn,{className:A(cl,"gs-utl-flex",S.className),style:S.style,children:l.jsx(ss,{handler:l.jsx(ft,{className:A(`${cl}__btn`,h),icon:S.icon,size:S.size,disabled:S.disabled,onClick:T,block:!0,..._,children:N?l.jsxs(k,{items:"center",gap:"s",nowrap:!0,children:[l.jsx(k,{items:"center",children:H}),G]}):G}),buttonAs:"div",open:y,onClose:()=>w(!1),clickAway:!0,padding:!1,hideCloseButton:!0,children:L()})})}));function Wt(e){const{className:t,options:n,name:s,value:r,size:o="m",required:i,disabled:a,onChange:c,labelAs:u}=e,d=g=>{const m=n.filter(b=>b.id===g)[0];return n.indexOf(m)===n.length-1},p=(g,m)=>A("gs-utl-cursor-pointer",o==="m"&&we.xy,o==="s"&&"gs-utl-px-2 gs-utl-py-1 text-sm",o==="xs"&&"gs-utl-p-1 text-sm",B.br,g&&B.bgO,!d(m)&&X.br),h=Vr({...e,className:"gs-field-buttons"});return l.jsxs(Bh,{value:r,onChange:c,disabled:a,...h,children:[l.jsx(ns,{...e,as:u}),s&&l.jsx("input",{type:"hidden",name:s,value:r,required:i}),l.jsx(k,{className:A(t,X.b,X.rnd,B.br,"gs-utl-cursor-pointer"),items:"center",full:!0,nowrap:!0,children:n.map(({id:g,label:m,title:b,icon:v})=>l.jsx($t,{title:b,className:A("gs-utl-w-full"),classNameWrp:A("gs-utl-flex-1"),children:l.jsx(Bh.Option,{value:g,className:({checked:x})=>p(x,g),children:l.jsxs(k,{justify:"center",gap:"s",full:!0,children:[!!v&&l.jsx(Q,{...nt(v)?{icon:v,size:oe.s}:v}),m&&l.jsx(V,{children:m})]})})},g))})]})}const Q4="gs-cmp-button-group-field",eM=f.memo(ae(function({className:t,label:n,name:s,value:r,options:o,size:i,required:a,disabled:c,onChange:u,editorEvents:d}){const{editor:p}=me(),[h,g]=f.useState(()=>({className:t,label:n,name:s,value:r,options:o,size:i,required:a,disabled:c})),m=b=>{u({value:b,editor:p,state:h,setState:v=>g(x=>({...x,...v}))})};return zr({editor:p,editorEvents:d,localState:h,setLocalState:g}),l.jsx(Wt,{className:A(Q4,h.className),label:h.label,name:h.name,value:h.value,options:h.options??[],size:h.size,required:h.required,disabled:h.disabled,onChange:m})}));function Wc({colors:e,...t}){return e?l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 79 79",...t,children:[l.jsx("path",{fill:"url(#a)",d:"M39.6 77.1a37.5 37.5 0 1 0 0-75 37.5 37.5 0 0 0 0 75Z"}),l.jsx("path",{stroke:"#fff",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"5",d:"m40 19-14.58 8.79a6.36 6.36 0 0 0-2.82 5.33v14.13a6.14 6.14 0 0 0 3.12 5.13l11.21 5.8a6.12 6.12 0 0 0 6.14 0l11.41-6.3a6.09 6.09 0 0 0 3.12-5.13V33.12c0-1.28-1.4-2.07-2.52-1.48l-15.08 8"}),l.jsx("defs",{children:l.jsxs("linearGradient",{id:"a",x1:"2.1",x2:"77.2",y1:"39.6",y2:"39.6",gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#D7709E"}),l.jsx("stop",{offset:"1",stopColor:"#A84A87"})]})})]}):l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 76 76",...t,children:l.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M64.117 64.117a37.5 37.5 0 1 1-53.034-53.034 37.5 37.5 0 0 1 53.034 53.034ZM39.29 19.14a2.5 2.5 0 1 0-2.582-4.282l-14.583 8.79-.05.03-.047.032a8.861 8.861 0 0 0-2.917 3.229 8.729 8.729 0 0 0-1.011 4.203V45.293l.002.047a8.64 8.64 0 0 0 1.25 4.164 8.78 8.78 0 0 0 3.115 3.043l.05.03.053.027 11.165 5.769a8.62 8.62 0 0 0 4.264 1.127c1.507 0 2.99-.394 4.295-1.145l11.394-6.276.006-.004a8.585 8.585 0 0 0 3.178-3.05 8.443 8.443 0 0 0 1.227-4.225V31.123c0-3.265-3.502-5.122-6.19-3.688l-.005.003-15.076 7.995a2.5 2.5 0 0 0 2.342 4.418l13.93-7.387v12.263a3.444 3.444 0 0 1-.502 1.703 3.584 3.584 0 0 1-1.326 1.271l-.003.002-11.409 6.284-.024.014-.023.013a3.619 3.619 0 0 1-1.814.486 3.62 3.62 0 0 1-1.814-.486l-.052-.03-.054-.028-11.155-5.764a3.78 3.78 0 0 1-1.297-1.283 3.642 3.642 0 0 1-.527-1.715V31.081a3.73 3.73 0 0 1 .432-1.806 3.858 3.858 0 0 1 1.23-1.377L39.29 19.14Z",clipRule:"evenodd"})})}const tM=f.memo(ae(function(){const{isStage:e,updateStudio:t}=me(),{isDarkTheme:n}=_s(),s=f.useRef(null),{bg:r,text:o}=Nb(n);return P0({ref:s,show:e,update:n,reload:t,styles:{display:"flex",justifyContent:"center",position:"absolute",bottom:"0",right:"0",left:"0"},node:l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
326
272
  .gs-banner {
327
273
  box-shadow: 0 0 5px #1c1b1b21;
328
274
  padding: 30px 10px;
@@ -342,7 +288,7 @@ $2`),e=e.replace(/([^\s]);([^\s\}])/g,`$1;
342
288
  .gs-gs-logo {
343
289
  width: 35px;
344
290
  }
345
- `}),c.jsx(Xn,{className:"gs-banner",children:c.jsxs(k,{className:"gs-banner-row",children:[c.jsx(iu,{className:"gs-gs-logo",colors:!0}),c.jsx("div",{children:"GrapesJS Studio Demo!"})]})})]})}),c.jsx("div",{ref:s})})),X4=()=>`https://grapesjs.com?ref=${window.location.host}`,J4=h.memo(fe(function(){const{updateStudio:e,showPoweredBy:t}=ye(),{isDarkTheme:n}=Ds(),s=h.useRef(null),{bg:r,text:o,link:i}=gv(n);return ly({ref:s,show:t,update:n,reload:e,styles:{display:"flex",justifyContent:"center",position:"absolute",bottom:"0",left:"0"},node:c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
291
+ `}),l.jsx(Dn,{className:"gs-banner",children:l.jsxs(k,{className:"gs-banner-row",children:[l.jsx(Wc,{className:"gs-gs-logo",colors:!0}),l.jsx("div",{children:"GrapesJS Studio Demo!"})]})})]})}),l.jsx("div",{ref:s})})),nM=()=>`https://grapesjs.com?ref=${window.location.host}`,sM=f.memo(ae(function(){const{updateStudio:e,showPoweredBy:t}=me(),{isDarkTheme:n}=_s(),s=f.useRef(null),{bg:r,text:o,link:i}=Nb(n);return P0({ref:s,show:t,update:n,reload:e,styles:{display:"flex",justifyContent:"center",position:"absolute",bottom:"0",left:"0"},node:l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
346
292
  .gs-banner {
347
293
  box-shadow: 0 0 5px #1c1b1b21;
348
294
  padding: 5px 10px;
@@ -365,7 +311,7 @@ $2`),e=e.replace(/([^\s]);([^\s\}])/g,`$1;
365
311
  .gs-logo {
366
312
  width: 20px;
367
313
  }
368
- `}),c.jsx(Xn,{className:"gs-banner",children:c.jsxs(k,{className:"gs-banner-row",children:[c.jsx("a",{className:"gs-link",href:X4(),target:"_blank",children:"GrapesJS Studio"}),c.jsx(iu,{className:"gs-logo",colors:!0})]})})]})}),c.jsx("div",{ref:s})})),vm="gs-canvas-content",Q4=h.memo(fe(function({children:t}){const{isReady:n}=ye(),s=N(`${vm}__overlay gs-utl-pointer-events-none gs-utl-absolute gs-utl-inset-0`,z.bgH2);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:vm,children:[c.jsx("div",{className:s}),!n&&c.jsx(Co,{className:N("gs-utl-z-10"),abs:!0,full:!0}),n&&Ot(t)]}),c.jsx(Z4,{}),c.jsx(J4,{})]})})),eM="gs-canvas",cy=h.memo(function({className:t,style:n,grow:s,children:r}){return c.jsx(k4,{style:n,className:N(eM,"gs-utl-relative",s&&"gs-utl-flex-grow",t),children:c.jsx(Qa,{children:c.jsx(Q4,{children:r})})})}),Yp=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.window.document._=0}catch{return!1}return"showOpenFilePicker"in self})(),tM=Yp?Promise.resolve().then(function(){return aM}):Promise.resolve().then(function(){return pM});async function nM(...e){return(await tM).default(...e)}Yp?Promise.resolve().then(function(){return cM}):Promise.resolve().then(function(){return gM});const sM=Yp?Promise.resolve().then(function(){return dM}):Promise.resolve().then(function(){return bM});async function rM(...e){return(await sM).default(...e)}const oM=async e=>{const t=await e.getFile();return t.handle=e,t};var iM=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((r,o)=>{t[o]={description:r.description||"Files",accept:{}},r.mimeTypes?r.mimeTypes.map(i=>{t[o].accept[i]=r.extensions||[]}):t[o].accept["*/*"]=r.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),s=await Promise.all(n.map(oM));return e[0].multiple?s:s[0]},aM={__proto__:null,default:iM};function Ql(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var s=n.done;return Promise.resolve(n.value).then(function(r){return{value:r,done:s}})}return Ql=function(n){this.s=n,this.n=n.next},Ql.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var s=this.s.return;return s===void 0?Promise.resolve({value:n,done:!0}):t(s.apply(this.s,arguments))},throw:function(n){var s=this.s.return;return s===void 0?Promise.reject(n):t(s.apply(this.s,arguments))}},new Ql(e)}const uy=async(e,t,n=e.name,s)=>{const r=[],o=[];var i,a=!1,l=!1;try{for(var u,d=function(f){var p,g,m,b=2;for(typeof Symbol<"u"&&(g=Symbol.asyncIterator,m=Symbol.iterator);b--;){if(g&&(p=f[g])!=null)return p.call(f);if(m&&(p=f[m])!=null)return new Ql(p.call(f));g="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());a=!(u=await d.next()).done;a=!1){const f=u.value,p=`${n}/${f.name}`;f.kind==="file"?o.push(f.getFile().then(g=>(g.directoryHandle=e,g.handle=f,Object.defineProperty(g,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>p})))):f.kind!=="directory"||!t||s&&s(f)||r.push(uy(f,t,p,s))}}catch(f){l=!0,i=f}finally{try{a&&d.return!=null&&await d.return()}finally{if(l)throw i}}return[...(await Promise.all(r)).flat(),...await Promise.all(o)]};var lM=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:uy(t,e.recursive,void 0,e.skipDirectory)},cM={__proto__:null,default:lM},uM=async(e,t=[{}],n=null,s=!1,r=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const o=[];let i=null;if(e instanceof Blob&&e.type?i=e.type:e.headers&&e.headers.get("content-type")&&(i=e.headers.get("content-type")),t.forEach((u,d)=>{o[d]={description:u.description||"Files",accept:{}},u.mimeTypes?(d===0&&i&&u.mimeTypes.push(i),u.mimeTypes.map(f=>{o[d].accept[f]=u.extensions||[]})):i?o[d].accept[i]=u.extensions||[]:o[d].accept["*/*"]=u.extensions||[]}),n)try{await n.getFile()}catch(u){if(n=null,s)throw u}const a=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:o,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&r&&r(a);const l=await a.createWritable();return"stream"in e?(await e.stream().pipeTo(l),a):"body"in e?(await e.body.pipeTo(l),a):(await l.write(await e),await l.close(),a)},dM={__proto__:null,default:uM},fM=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const s=document.createElement("input");s.type="file";const r=[...e.map(l=>l.mimeTypes||[]),...e.map(l=>l.extensions||[])].join();s.multiple=e[0].multiple||!1,s.accept=r||"",s.style.display="none",document.body.append(s);const o=l=>{typeof i=="function"&&i(),t(l)},i=e[0].legacySetup&&e[0].legacySetup(o,()=>i(n),s),a=()=>{window.removeEventListener("focus",a),s.remove()};s.addEventListener("click",()=>{window.addEventListener("focus",a)}),s.addEventListener("change",()=>{window.removeEventListener("focus",a),s.remove(),o(s.multiple?Array.from(s.files):s.files[0])}),"showPicker"in HTMLInputElement.prototype?s.showPicker():s.click()})),pM={__proto__:null,default:fM},hM=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const s=document.createElement("input");s.type="file",s.webkitdirectory=!0;const r=i=>{typeof o=="function"&&o(),t(i)},o=e[0].legacySetup&&e[0].legacySetup(r,()=>o(n),s);s.addEventListener("change",()=>{let i=Array.from(s.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(i=i.filter(a=>a.webkitRelativePath.split("/").every(l=>!e[0].skipDirectory({name:l,kind:"directory"})))):i=i.filter(a=>a.webkitRelativePath.split("/").length===2),r(i)}),"showPicker"in HTMLInputElement.prototype?s.showPicker():s.click()})),gM={__proto__:null,default:hM},mM=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let s=e;"body"in e&&(s=await async function(i,a){const l=i.getReader(),u=new ReadableStream({start:p=>async function g(){return l.read().then(({done:m,value:b})=>{if(!m)return p.enqueue(b),g();p.close()})}()}),d=new Response(u),f=await d.blob();return l.releaseLock(),new Blob([f],{type:a})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await s);const r=()=>{typeof o=="function"&&o()},o=t.legacySetup&&t.legacySetup(r,()=>o(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),r()}),n.click(),null},bM={__proto__:null,default:mM};function Rr({children:e,label:t,s:n="m",pill:s,border:r,nopad:o,className:i,block:a,...l}){return c.jsx("div",{className:N(!a&&"gs-utl-inline-block",i,!o&&je.xyS2,s?re.pill:re.rnd,r&&`${re.b} ${z.br}`,n==="s"&&"gs-utl-text-sm",n==="xs"&&"gs-utl-p-1"),...l,children:t||e})}var ym={};const vM=ym.REACT_APP_VERSION??ym.NPM_PACKAGE_VERSION,yM=fe(function(){var n;const t=(n=window.grapesjs)==null?void 0:n.version;return c.jsxs(k,{col:!0,space:"m",children:[c.jsx(k,{justify:"center",children:c.jsxs(D,{className:ue("relative"),children:[c.jsx(iu,{className:ue("w-24 opacity-50")}),t&&c.jsx(Rr,{className:ue(z.bgA,"absolute gs-utl-right-[-20px] bottom-0"),label:`v${t}`,s:"s",pill:!0})]})}),c.jsxs(D,{children:[c.jsxs("p",{children:[c.jsx("b",{children:"GrapesJS Studio"})," is an innovative experimental editor, initially created to improve and extend the customization capability of the"," ",c.jsx("a",{className:ue($r.link),href:"https://grapesjs.com",children:"GrapesJS"})," ","library. Beyond pushing the evolution of the core library itself, this application aspires to empower individuals in creating and managing their web projects autonomously, free from subscriptions or dependency on the internet connection."]}),c.jsx("br",{}),c.jsxs("p",{children:["If you like the vision of this project and you're eager to play a role in its continued development, consider becoming a backer or sponsor through"," ",c.jsx("a",{className:ue($r.link),href:"https://opencollective.com/grapesjs",children:"Open Collective"}),"."]})]}),c.jsxs(D,{className:ue(z.txtLowEmphasis,"text-right"),children:["GrapesJS Studio: v",vM]})]})}),xM=fe(function(){return c.jsxs(k,{col:!0,space:"m",children:[c.jsx(k,{justify:"center",children:c.jsx(D,{className:ee("relative"),children:c.jsx(iu,{className:ee("w-24 opacity-50")})})}),c.jsx(D,{children:c.jsxs("p",{children:["We're excited to introduce the GrapesJS Studio SDK, an embeddable version of the Studio editor.",c.jsx("br",{}),c.jsx("br",{}),"The Studio SDK offers a powerful and flexible web editing experience that can be seamlessly integrated into your platform as a white-label editor. This enables your users to effortlessly create and manage content with advanced tools.",c.jsx("br",{}),c.jsx("br",{}),"You can try the initial release of the Studio SDK by creating a license and following the instructions on the"," ",c.jsx("a",{className:ee($r.link),href:"/dashboard/sdk/licenses",target:"_blank",children:"Studio SDK license page"}),c.jsx("br",{}),c.jsx("br",{}),"If you have any questions or need assistance with specific use cases, please fill out this"," ",c.jsx("a",{className:ee($r.link),href:"https://forms.gle/VUycp3rc8iCpbh9k8",target:"_blank",rel:"noreferrer",children:"form"})," ","and we'll get back to you as soon as possible."]})})]})}),wM=()=>[{id:yt.web,label:Ts(yt.web),content:c.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[c.jsx(oe,{icon:Z.web,size:le.s}),c.jsx("span",{children:Ts(yt.web)})]})},{id:yt.email,label:Ts(yt.email),content:c.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[c.jsx(oe,{icon:Z.emailOutline,size:le.s}),c.jsx("span",{children:Ts(yt.email)})]})}],Cl="gs-cmp-tabs";function Yr({tabs:e,className:t,classNamePanel:n,classNameTab:s,variant:r,style:o,onChange:i=Sw,value:a}){const l=r==="pills",u=l?N("gs-utl-rounded-full gs-utl-text-sm gs-utl-px-[2px] gs-utl-py-[2px]",z.bgH):"",d=b=>l?N("gs-utl-rounded-full gs-utl-px-3 gs-utl-py-1",b?z.bg:""):N("gs-utl-border-b-2",je.xy),f=b=>{b&&(b.tabIndex=-1)},p=b=>{const v=b.currentTarget;setTimeout(()=>v.blur(),10)},g=Lt(a)?e.findIndex(b=>b.id===a):void 0,m=!e.some(b=>!!b.content);return c.jsxs($i.Group,{onChange:b=>i(e[b].id),defaultIndex:e.findIndex(b=>b.id===a),selectedIndex:g,children:[c.jsx($i.List,{as:k,className:N(Cl,t,u),style:o,full:!0,nowrap:!0,children:e.map(b=>c.jsx($i,{disabled:b.disabled,className:({selected:v})=>N(`${Cl}__tab`,"gs-utl-flex-1 focus:gs-utl-outline-none",b.disabled&&"gs-utl-cursor-not-allowed gs-utl-opacity-50",pa.focus,d(v),v?`${z.tAo} ${z.bA}`:z.br,s),children:b.label},b.id))}),c.jsx($i.Panels,{className:N(`${Cl}__panels`,"gs-utl-overflow-hidden gs-utl-flex-1",m&&"gs-utl-hidden",n),children:e.map(b=>c.jsx($i.Panel,{tabIndex:-1,className:N(`${Cl}__panel`,"gs-utl-h-full"),ref:f,onFocus:p,children:b.content},b.id))})]})}const au=0,Zr=1,Ti=2,dy=4;function SM(e,t){return n=>e(t(n))}function CM(e,t){return t(e)}function fy(e,t){return n=>e(t,n)}function xm(e,t){return()=>e(t)}function Zp(e,t){return t(e),e}function Vo(...e){return e}function jM(e){e()}function wm(e){return()=>e}function EM(...e){return()=>{e.map(jM)}}function lu(){}function Zt(e,t){return e(Zr,t)}function kt(e,t){e(au,t)}function Xp(e){e(Ti)}function oi(e){return e(dy)}function ct(e,t){return Zt(e,fy(t,au))}function Sm(e,t){const n=e(Zr,s=>{n(),t(s)});return n}function _t(){const e=[];return(t,n)=>{switch(t){case Ti:e.splice(0,e.length);return;case Zr:return e.push(n),()=>{const s=e.indexOf(n);s>-1&&e.splice(s,1)};case au:e.slice().forEach(s=>{s(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function we(e){let t=e;const n=_t();return(s,r)=>{switch(s){case Zr:r(t);break;case au:t=r;break;case dy:return t}return n(s,r)}}function PM(e){let t,n;const s=()=>t&&t();return function(r,o){switch(r){case Zr:return o?n===o?void 0:(s(),n=o,t=Zt(e,o),t):(s(),lu);case Ti:s(),n=null;return;default:throw new Error(`unrecognized action ${r}`)}}}function ta(e){return Zp(_t(),t=>ct(e,t))}function ii(e,t){return Zp(we(t),n=>ct(e,n))}function _M(...e){return t=>e.reduceRight(CM,t)}function Pe(e,...t){const n=_M(...t);return(s,r)=>{switch(s){case Zr:return Zt(e,n(r));case Ti:Xp(e);return}}}function py(e,t){return e===t}function dn(e=py){let t;return n=>s=>{e(t,s)||(t=s,n(s))}}function Bt(e){return t=>n=>{e(n)&&t(n)}}function vt(e){return t=>SM(t,e)}function Sr(e){return t=>()=>t(e)}function jl(e,t){return n=>s=>n(t=e(t,s))}function vf(e){return t=>n=>{e>0?e--:t(n)}}function Ki(e){let t=null,n;return s=>r=>{t=r,!n&&(n=setTimeout(()=>{n=void 0,s(t)},e))}}function Cm(e){let t,n;return s=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{s(t)},e)}}function js(...e){const t=new Array(e.length);let n=0,s=null;const r=Math.pow(2,e.length)-1;return e.forEach((o,i)=>{const a=Math.pow(2,i);Zt(o,l=>{const u=n;n=n|a,t[i]=l,u!==r&&n===r&&s&&(s(),s=null)})}),o=>i=>{const a=()=>o([i].concat(t));n===r?a():s=a}}function jm(...e){return function(t,n){switch(t){case Zr:return EM(...e.map(s=>Zt(s,n)));case Ti:return;default:throw new Error(`unrecognized action ${t}`)}}}function Fe(e,t=py){return Pe(e,dn(t))}function er(...e){const t=_t(),n=new Array(e.length);let s=0;const r=Math.pow(2,e.length)-1;return e.forEach((o,i)=>{const a=Math.pow(2,i);Zt(o,l=>{n[i]=l,s=s|a,s===r&&kt(t,n)})}),function(o,i){switch(o){case Zr:return s===r&&i(n),Zt(t,i);case Ti:return Xp(t);default:throw new Error(`unrecognized action ${o}`)}}}function Fs(e,t=[],{singleton:n}={singleton:!0}){return{id:TM(),constructor:e,dependencies:t,singleton:n}}const TM=()=>Symbol();function OM(e){const t=new Map,n=({id:s,constructor:r,dependencies:o,singleton:i})=>{if(i&&t.has(s))return t.get(s);const a=r(o.map(l=>n(l)));return i&&t.set(s,a),a};return n(e)}function AM(e,t){const n={},s={};let r=0;const o=e.length;for(;r<o;)s[e[r]]=1,r+=1;for(const i in t)s.hasOwnProperty(i)||(n[i]=t[i]);return n}const El=typeof document<"u"?h.useLayoutEffect:h.useEffect;function NM(e,t,n){const s=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=h.createContext({});function l(x,y){x.propsReady&&kt(x.propsReady,!1);for(const w of s){const S=x[t.required[w]];kt(S,y[w])}for(const w of r)if(w in y){const S=x[t.optional[w]];kt(S,y[w])}x.propsReady&&kt(x.propsReady,!0)}function u(x){return o.reduce((y,w)=>(y[w]=S=>{const C=x[t.methods[w]];kt(C,S)},y),{})}function d(x){return i.reduce((y,w)=>(y[w]=PM(x[t.events[w]]),y),{})}const f=h.forwardRef((x,y)=>{const{children:w,...S}=x,[C]=h.useState(()=>Zp(OM(e),_=>l(_,S))),[j]=h.useState(xm(d,C));El(()=>{for(const _ of i)_ in S&&Zt(j[_],S[_]);return()=>{Object.values(j).map(Xp)}},[S,j,C]),El(()=>{l(C,S)}),h.useImperativeHandle(y,wm(u(C)));const E=n;return c.jsx(a.Provider,{value:C,children:n?c.jsx(E,{...AM([...s,...r,...i],S),children:w}):w})}),p=x=>h.useCallback(fy(kt,h.useContext(a)[x]),[x]),g=x=>{const w=h.useContext(a)[x],S=h.useCallback(C=>Zt(w,C),[w]);return h.useSyncExternalStore(S,()=>oi(w),()=>oi(w))},m=x=>{const w=h.useContext(a)[x],[S,C]=h.useState(xm(oi,w));return El(()=>Zt(w,j=>{j!==S&&C(wm(j))}),[w,S]),S},b=h.version.startsWith("18")?g:m;return{Component:f,usePublisher:p,useEmitterValue:b,useEmitter:(x,y)=>{const S=h.useContext(a)[x];El(()=>Zt(S,y),[y,S])}}}const hy=typeof document<"u"?h.useLayoutEffect:h.useEffect;var Jp=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Jp||{});const MM={0:"debug",1:"log",2:"warn",3:"error"},LM=()=>typeof globalThis>"u"?window:globalThis,gy=Fs(()=>{const e=we(3);return{log:we((n,s,r=1)=>{var o;const i=(o=LM().VIRTUOSO_LOG_LEVEL)!=null?o:oi(e);r>=i&&console[MM[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,s)}),logLevel:e}},[],{singleton:!0});function my(e,t,n){const s=h.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=h.useMemo(()=>new ResizeObserver(i=>{requestAnimationFrame(()=>{const l=i[0].target;l.offsetParent!==null&&e(l)})}),[e]);r=i=>{i&&t?(o.observe(i),s.current=i):(s.current&&o.unobserve(s.current),s.current=null)}}return{ref:s,callbackRef:r}}function cu(e,t,n){return my(e,t).callbackRef}function xc(e,t){return Math.round(e.getBoundingClientRect()[t])}function by(e,t){return Math.abs(e-t)<1.01}function vy(e,t,n,s=lu,r,o){const i=h.useRef(null),a=h.useRef(null),l=h.useRef(null),u=h.useCallback(p=>{const g=p.target,m=g===window||g===document,b=o?m?window.pageXOffset||document.documentElement.scrollLeft:g.scrollLeft:m?window.pageYOffset||document.documentElement.scrollTop:g.scrollTop,v=o?m?document.documentElement.scrollWidth:g.scrollWidth:m?document.documentElement.scrollHeight:g.scrollHeight,x=o?m?window.innerWidth:g.offsetWidth:m?window.innerHeight:g.offsetHeight,y=()=>{e({scrollTop:Math.max(b,0),scrollHeight:v,viewportHeight:x})};p.suppressFlushSync?y():Dn.flushSync(y),a.current!==null&&(b===a.current||b<=0||b===v-x)&&(a.current=null,t(!0),l.current&&(clearTimeout(l.current),l.current=null))},[e,t]);h.useEffect(()=>{const p=r||i.current;return s(r||i.current),u({target:p,suppressFlushSync:!0}),p.addEventListener("scroll",u,{passive:!0}),()=>{s(null),p.removeEventListener("scroll",u)}},[i,u,n,s,r]);function d(p){const g=i.current;if(!g||(o?"offsetWidth"in g&&g.offsetWidth===0:"offsetHeight"in g&&g.offsetHeight===0))return;const m=p.behavior==="smooth";let b,v,x;g===window?(v=Math.max(xc(document.documentElement,o?"width":"height"),o?document.documentElement.scrollWidth:document.documentElement.scrollHeight),b=o?window.innerWidth:window.innerHeight,x=o?document.documentElement.scrollLeft:document.documentElement.scrollTop):(v=g[o?"scrollWidth":"scrollHeight"],b=xc(g,o?"width":"height"),x=g[o?"scrollLeft":"scrollTop"]);const y=v-b;if(p.top=Math.ceil(Math.max(Math.min(y,p.top),0)),by(b,v)||p.top===x){e({scrollTop:x,scrollHeight:v,viewportHeight:b}),m&&t(!0);return}m?(a.current=p.top,l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{l.current=null,a.current=null,t(!0)},1e3)):a.current=null,o&&(p={left:p.top,behavior:p.behavior}),g.scrollTo(p)}function f(p){o&&(p={left:p.top,behavior:p.behavior}),i.current.scrollBy(p)}return{scrollerRef:i,scrollByCallback:f,scrollToCallback:d}}const uu=Fs(()=>{const e=_t(),t=_t(),n=we(0),s=_t(),r=we(0),o=_t(),i=_t(),a=we(0),l=we(0),u=we(0),d=we(0),f=_t(),p=_t(),g=we(!1),m=we(!1),b=we(!1);return ct(Pe(e,vt(({scrollTop:v})=>v)),t),ct(Pe(e,vt(({scrollHeight:v})=>v)),i),ct(t,r),{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:a,fixedHeaderHeight:l,fixedFooterHeight:u,footerHeight:d,scrollHeight:i,smoothScrollTargetReached:s,horizontalDirection:m,skipAnimationFrameInResizeObserver:b,scrollTo:f,scrollBy:p,statefulScrollTop:r,deviation:n,scrollingInProgress:g}},[],{singleton:!0}),RM=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function $M(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!RM)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const wc="up",na="down",kM="none",VM={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},IM=0,yy=Fs(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:s,footerHeight:r,scrollBy:o}])=>{const i=we(!1),a=we(!0),l=_t(),u=_t(),d=we(4),f=we(IM),p=ii(Pe(jm(Pe(Fe(t),vf(1),Sr(!0)),Pe(Fe(t),vf(1),Sr(!1),Cm(100))),dn()),!1),g=ii(Pe(jm(Pe(o,Sr(!0)),Pe(o,Sr(!1),Cm(200))),dn()),!1);ct(Pe(er(Fe(t),Fe(f)),vt(([y,w])=>y<=w),dn()),a),ct(Pe(a,Ki(50)),u);const m=ta(Pe(er(e,Fe(n),Fe(s),Fe(r),Fe(d)),jl((y,[{scrollTop:w,scrollHeight:S},C,j,E,_])=>{const T=w+C-S>-_,P={viewportHeight:C,scrollTop:w,scrollHeight:S};if(T){let M,R;return w>y.state.scrollTop?(M="SCROLLED_DOWN",R=y.state.scrollTop-w):(M="SIZE_DECREASED",R=y.state.scrollTop-w||y.scrollTopDelta),{atBottom:!0,state:P,atBottomBecause:M,scrollTopDelta:R}}let A;return P.scrollHeight>y.state.scrollHeight?A="SIZE_INCREASED":C<y.state.viewportHeight?A="VIEWPORT_HEIGHT_DECREASING":w<y.state.scrollTop?A="SCROLLING_UPWARDS":A="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:A,state:P}},VM),dn((y,w)=>y&&y.atBottom===w.atBottom))),b=ii(Pe(e,jl((y,{scrollTop:w,scrollHeight:S,viewportHeight:C})=>{if(by(y.scrollHeight,S))return{scrollTop:w,scrollHeight:S,jump:0,changed:!1};{const j=S-(w+C)<1;return y.scrollTop!==w&&j?{scrollHeight:S,scrollTop:w,jump:y.scrollTop-w,changed:!0}:{scrollHeight:S,scrollTop:w,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Bt(y=>y.changed),vt(y=>y.jump)),0);ct(Pe(m,vt(y=>y.atBottom)),i),ct(Pe(i,Ki(50)),l);const v=we(na);ct(Pe(e,vt(({scrollTop:y})=>y),dn(),jl((y,w)=>oi(g)?{direction:y.direction,prevScrollTop:w}:{direction:w<y.prevScrollTop?wc:na,prevScrollTop:w},{direction:na,prevScrollTop:0}),vt(y=>y.direction)),v),ct(Pe(e,Ki(50),Sr(kM)),v);const x=we(0);return ct(Pe(p,Bt(y=>!y),Sr(0)),x),ct(Pe(t,Ki(100),js(p),Bt(([y,w])=>!!w),jl(([y,w],[S])=>[w,S],[0,0]),vt(([y,w])=>w-y)),x),{isScrolling:p,isAtTop:a,isAtBottom:i,atBottomState:m,atTopStateChange:u,atBottomStateChange:l,scrollDirection:v,atBottomThreshold:d,atTopThreshold:f,scrollVelocity:x,lastJumpDueToItemResize:b}},Vo(uu)),DM=Fs(([{log:e}])=>{const t=we(!1),n=ta(Pe(t,Bt(s=>s),dn()));return Zt(t,s=>{s&&oi(e)("props updated",{},Jp.DEBUG)}),{propsReady:t,didMount:n}},Vo(gy),{singleton:!0});function xy(e,t){e==0?t():requestAnimationFrame(()=>xy(e-1,t))}function HM(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function yf(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function FM(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const Sc="top",Cc="bottom",Em="none";function Pm(e,t,n){return typeof e=="number"?n===wc&&t===Sc||n===na&&t===Cc?e:0:n===wc?t===Sc?e.main:e.reverse:t===Cc?e.main:e.reverse}function _m(e,t){return typeof e=="number"?e:e[t]||0}const BM=Fs(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:s,fixedHeaderHeight:r}])=>{const o=_t(),i=we(0),a=we(0),l=we(0),u=ii(Pe(er(Fe(e),Fe(t),Fe(s),Fe(o,yf),Fe(l),Fe(i),Fe(r),Fe(n),Fe(a)),vt(([d,f,p,[g,m],b,v,x,y,w])=>{const S=d-y,C=v+x,j=Math.max(p-S,0);let E=Em;const _=_m(w,Sc),T=_m(w,Cc);return g-=y,g+=p+x,m+=p+x,m-=y,g>d+C-_&&(E=wc),m<d-j+f+T&&(E=na),E!==Em?[Math.max(S-p-Pm(b,Sc,E)-_,0),S-j-x+f+Pm(b,Cc,E)+T]:null}),Bt(d=>d!=null),dn(yf)),[0,0]);return{listBoundary:o,overscan:l,topListHeight:i,increaseViewportBy:a,visibleRange:u}},Vo(uu),{singleton:!0}),zM=Fs(([{scrollVelocity:e}])=>{const t=we(!1),n=_t(),s=we(!1);return ct(Pe(e,js(s,t,n),Bt(([r,o])=>!!o),vt(([r,o,i,a])=>{const{exit:l,enter:u}=o;if(i){if(l(r,a))return!1}else if(u(r,a))return!0;return i}),dn()),t),Zt(Pe(er(t,e,n),js(s)),([[r,o,i],a])=>r&&a&&a.change&&a.change(o,i)),{isSeeking:t,scrollSeekConfiguration:s,scrollVelocity:e,scrollSeekRangeChanged:n}},Vo(yy),{singleton:!0});function UM(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const WM=Fs(([{scrollTo:e,scrollContainerState:t}])=>{const n=_t(),s=_t(),r=_t(),o=we(!1),i=we(void 0);return ct(Pe(er(n,s),vt(([{viewportHeight:a,scrollTop:l,scrollHeight:u},{offsetTop:d}])=>({scrollTop:Math.max(0,l-d),scrollHeight:u,viewportHeight:a}))),t),ct(Pe(e,js(s),vt(([a,{offsetTop:l}])=>({...a,top:a.top+l}))),r),{useWindowScroll:o,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:s,windowScrollTo:r}},Vo(uu)),dd="-webkit-sticky",Tm="sticky",wy=UM(()=>{if(typeof document>"u")return Tm;const e=document.createElement("div");return e.style.position=dd,e.style.position===dd?dd:Tm});function GM(e,t,n){const s=h.useRef(null),r=h.useCallback(l=>{if(l===null||!l.offsetParent)return;const u=l.getBoundingClientRect(),d=u.width;let f,p;if(t){const g=t.getBoundingClientRect(),m=u.top-g.top;f=g.height-Math.max(0,m),p=m+t.scrollTop}else f=window.innerHeight-Math.max(0,u.top),p=u.top+window.pageYOffset;s.current={offsetTop:p,visibleHeight:f,visibleWidth:d},e(s.current)},[e,t]),{callbackRef:o,ref:i}=my(r,!0),a=h.useCallback(()=>{r(i.current)},[r,i]);return h.useEffect(()=>{if(t){t.addEventListener("scroll",a);const l=new ResizeObserver(()=>{requestAnimationFrame(a)});return l.observe(t),()=>{t.removeEventListener("scroll",a),l.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}h.createContext(void 0);const Sy=h.createContext(void 0);function qM(e){return e}wy();const KM={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},YM={outline:"none",overflowX:"auto",position:"relative"},Cy=e=>({width:"100%",height:"100%",position:"absolute",top:0});wy();function mo(e,t){if(typeof e!="string")return{context:t}}function ZM({usePublisher:e,useEmitter:t,useEmitterValue:n}){return h.memo(function({style:o,children:i,...a}){const l=e("scrollContainerState"),u=n("ScrollerComponent"),d=e("smoothScrollTargetReached"),f=n("scrollerRef"),p=n("context"),g=n("horizontalDirection")||!1,{scrollerRef:m,scrollByCallback:b,scrollToCallback:v}=vy(l,d,u,f,void 0,g);t("scrollTo",v),t("scrollBy",b);const x=g?YM:KM;return c.jsx(u,{ref:m,style:{...x,...o},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...mo(u,p),children:i})})}function XM({usePublisher:e,useEmitter:t,useEmitterValue:n}){return h.memo(function({style:o,children:i,...a}){const l=e("windowScrollContainerState"),u=n("ScrollerComponent"),d=e("smoothScrollTargetReached"),f=n("totalListHeight"),p=n("deviation"),g=n("customScrollParent"),m=n("context"),{scrollerRef:b,scrollByCallback:v,scrollToCallback:x}=vy(l,d,u,lu,g);return hy(()=>(b.current=g||window,()=>{b.current=null}),[b,g]),t("windowScrollTo",x),t("scrollBy",v),c.jsx(u,{style:{position:"relative",...o,...f!==0?{height:f+p}:{}},"data-virtuoso-scroller":!0,...a,...mo(u,m),children:i})})}const Om={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},JM={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Am,ceil:Nm,floor:jc,min:fd,max:sa}=Math;function QM(e){return{...JM,items:e}}function Mm(e,t,n){return Array.from({length:t-e+1}).map((s,r)=>{const o=n===null?null:n[r+e];return{index:r+e,data:o}})}function eL(e,t){return e&&e.column===t.column&&e.row===t.row}function Pl(e,t){return e&&e.width===t.width&&e.height===t.height}const tL=Fs(([{overscan:e,visibleRange:t,listBoundary:n,increaseViewportBy:s},{scrollTop:r,viewportHeight:o,scrollBy:i,scrollTo:a,smoothScrollTargetReached:l,scrollContainerState:u,footerHeight:d,headerHeight:f},p,g,{propsReady:m,didMount:b},{windowViewportRect:v,useWindowScroll:x,customScrollParent:y,windowScrollContainerState:w,windowScrollTo:S},C])=>{const j=we(0),E=we(0),_=we(Om),T=we({height:0,width:0}),P=we({height:0,width:0}),A=_t(),M=_t(),R=we(0),F=we(null),L=we({row:0,column:0}),B=_t(),q=_t(),H=we(!1),$=we(0),I=we(!0),O=we(!1),V=we(!1);Zt(Pe(b,js($),Bt(([U,Q])=>!!Q)),()=>{kt(I,!1)}),Zt(Pe(er(b,I,P,T,$,O),Bt(([U,Q,se,de,,Se])=>U&&!Q&&se.height!==0&&de.height!==0&&!Se)),([,,,,U])=>{kt(O,!0),xy(1,()=>{kt(A,U)}),Sm(Pe(r),()=>{kt(n,[0,0]),kt(I,!0)})}),ct(Pe(q,Bt(U=>U!=null&&U.scrollTop>0),Sr(0)),E),Zt(Pe(b,js(q),Bt(([,U])=>U!=null)),([,U])=>{U&&(kt(T,U.viewport),kt(P,U==null?void 0:U.item),kt(L,U.gap),U.scrollTop>0&&(kt(H,!0),Sm(Pe(r,vf(1)),Q=>{kt(H,!1)}),kt(a,{top:U.scrollTop})))}),ct(Pe(T,vt(({height:U})=>U)),o),ct(Pe(er(Fe(T,Pl),Fe(P,Pl),Fe(L,(U,Q)=>U&&U.column===Q.column&&U.row===Q.row),Fe(r)),vt(([U,Q,se,de])=>({viewport:U,item:Q,gap:se,scrollTop:de}))),B),ct(Pe(er(Fe(j),t,Fe(L,eL),Fe(P,Pl),Fe(T,Pl),Fe(F),Fe(E),Fe(H),Fe(I),Fe($)),Bt(([,,,,,,,U])=>!U),vt(([U,[Q,se],de,Se,ne,Te,ke,,it,st])=>{const{row:xe,column:Ze}=de,{height:Xe,width:ft}=Se,{width:Ae}=ne;if(ke===0&&(U===0||Ae===0))return Om;if(ft===0){const $t=HM(st,U),zs=Math.max($t+ke-1,0);return QM(Mm($t,zs,Te))}const at=jy(Ae,ft,Ze);let rt,Ie;it?Q===0&&se===0&&ke>0?(rt=0,Ie=ke-1):(rt=at*jc((Q+xe)/(Xe+xe)),Ie=at*Nm((se+xe)/(Xe+xe))-1,Ie=fd(U-1,sa(Ie,at-1)),rt=fd(Ie,sa(0,rt))):(rt=0,Ie=-1);const Wt=Mm(rt,Ie,Te),{top:ge,bottom:$e}=Lm(ne,de,Se,Wt),Ve=Nm(U/at),wt=Ve*Xe+(Ve-1)*xe-$e;return{items:Wt,offsetTop:ge,offsetBottom:wt,top:ge,bottom:$e,itemHeight:Xe,itemWidth:ft}})),_),ct(Pe(F,Bt(U=>U!==null),vt(U=>U.length)),j),ct(Pe(er(T,P,_,L),Bt(([U,Q,{items:se}])=>se.length>0&&Q.height!==0&&U.height!==0),vt(([U,Q,{items:se},de])=>{const{top:Se,bottom:ne}=Lm(U,de,Q,se);return[Se,ne]}),dn(yf)),n);const G=we(!1);ct(Pe(r,js(G),vt(([U,Q])=>Q||U!==0)),G);const W=ta(Pe(Fe(_),Bt(({items:U})=>U.length>0),js(j,G),Bt(([{items:U},Q,se])=>se&&U[U.length-1].index===Q-1),vt(([,U])=>U-1),dn())),K=ta(Pe(Fe(_),Bt(({items:U})=>U.length>0&&U[0].index===0),Sr(0),dn())),J=ta(Pe(Fe(_),js(H),Bt(([{items:U},Q])=>U.length>0&&!Q),vt(([{items:U}])=>({startIndex:U[0].index,endIndex:U[U.length-1].index})),dn(FM),Ki(0)));ct(J,g.scrollSeekRangeChanged),ct(Pe(A,js(T,P,j,L),vt(([U,Q,se,de,Se])=>{const ne=$M(U),{align:Te,behavior:ke,offset:it}=ne;let st=ne.index;st==="LAST"&&(st=de-1),st=sa(0,st,fd(de-1,st));let xe=xf(Q,Se,se,st);return Te==="end"?xe=Am(xe-Q.height+se.height):Te==="center"&&(xe=Am(xe-Q.height/2+se.height/2)),it&&(xe+=it),{top:xe,behavior:ke}})),a);const Y=ii(Pe(_,vt(U=>U.offsetBottom+U.bottom)),0);return ct(Pe(v,vt(U=>({width:U.visibleWidth,height:U.visibleHeight}))),T),{data:F,totalCount:j,viewportDimensions:T,itemDimensions:P,scrollTop:r,scrollHeight:M,overscan:e,increaseViewportBy:s,scrollBy:i,scrollTo:a,scrollToIndex:A,smoothScrollTargetReached:l,windowViewportRect:v,windowScrollTo:S,useWindowScroll:x,customScrollParent:y,windowScrollContainerState:w,deviation:R,scrollContainerState:u,footerHeight:d,headerHeight:f,initialItemCount:E,gap:L,restoreStateFrom:q,...g,initialTopMostItemIndex:$,horizontalDirection:V,gridState:_,totalListHeight:Y,...p,startReached:K,endReached:W,rangeChanged:J,stateChanged:B,propsReady:m,stateRestoreInProgress:H,...C}},Vo(BM,uu,yy,zM,DM,WM,gy));function Lm(e,t,n,s){const{height:r}=n;if(r===void 0||s.length===0)return{top:0,bottom:0};const o=xf(e,t,n,s[0].index),i=xf(e,t,n,s[s.length-1].index)+r;return{top:o,bottom:i}}function xf(e,t,n,s){const r=jy(e.width,n.width,t.column),o=jc(s/r),i=o*n.height+sa(0,o-1)*t.row;return i>0?i+t.row:i}function jy(e,t,n){return sa(1,jc((e+n)/(jc(t)+n)))}const nL=Fs(()=>{const e=we(f=>`Item ${f}`),t=we({}),n=we(null),s=we("virtuoso-grid-item"),r=we("virtuoso-grid-list"),o=we(qM),i=we("div"),a=we(lu),l=(f,p=null)=>ii(Pe(t,vt(g=>g[f]),dn()),p),u=we(!1),d=we(!1);return ct(Fe(d),u),{readyStateChanged:u,reportReadyState:d,context:n,itemContent:e,components:t,computeItemKey:o,itemClassName:s,listClassName:r,headerFooterTag:i,scrollerRef:a,FooterComponent:l("Footer"),HeaderComponent:l("Header"),ListComponent:l("List","div"),ItemComponent:l("Item","div"),ScrollerComponent:l("Scroller","div"),ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),sL=Fs(([e,t])=>({...e,...t}),Vo(tL,nL)),rL=h.memo(function(){const t=St("gridState"),n=St("listClassName"),s=St("itemClassName"),r=St("itemContent"),o=St("computeItemKey"),i=St("isSeeking"),a=zn("scrollHeight"),l=St("ItemComponent"),u=St("ListComponent"),d=St("ScrollSeekPlaceholder"),f=St("context"),p=zn("itemDimensions"),g=zn("gap"),m=St("log"),b=St("stateRestoreInProgress"),v=zn("reportReadyState"),x=cu(h.useMemo(()=>y=>{const w=y.parentElement.parentElement.scrollHeight;a(w);const S=y.firstChild;if(S){const{width:C,height:j}=S.getBoundingClientRect();p({width:C,height:j})}g({row:Rm("row-gap",getComputedStyle(y).rowGap,m),column:Rm("column-gap",getComputedStyle(y).columnGap,m)})},[a,p,g,m]),!0);return hy(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),b?null:c.jsx(u,{ref:x,className:n,...mo(u,f),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list",children:t.items.map(y=>{const w=o(y.index,y.data,f);return i?c.jsx(d,{...mo(d,f),index:y.index,height:t.itemHeight,width:t.itemWidth},w):h.createElement(l,{...mo(l,f),className:s,"data-index":y.index,key:w},r(y.index,y.data,f))})})}),oL=h.memo(function(){const t=St("HeaderComponent"),n=zn("headerHeight"),s=St("headerFooterTag"),r=cu(h.useMemo(()=>i=>n(xc(i,"height")),[n]),!0),o=St("context");return t?c.jsx(s,{ref:r,children:c.jsx(t,{...mo(t,o)})}):null}),iL=h.memo(function(){const t=St("FooterComponent"),n=zn("footerHeight"),s=St("headerFooterTag"),r=cu(h.useMemo(()=>i=>n(xc(i,"height")),[n]),!0),o=St("context");return t?c.jsx(s,{ref:r,children:c.jsx(t,{...mo(t,o)})}):null}),aL=({children:e})=>{const t=h.useContext(Sy),n=zn("itemDimensions"),s=zn("viewportDimensions"),r=cu(h.useMemo(()=>o=>{s(o.getBoundingClientRect())},[s]),!0);return h.useEffect(()=>{t&&(s({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,s,n]),c.jsx("div",{style:Cy(),ref:r,children:e})},lL=({children:e})=>{const t=h.useContext(Sy),n=zn("windowViewportRect"),s=zn("itemDimensions"),r=St("customScrollParent"),o=GM(n,r);return h.useEffect(()=>{t&&(s({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,s]),c.jsx("div",{ref:o,style:Cy(),children:e})},cL=h.memo(function({...t}){const n=St("useWindowScroll"),s=St("customScrollParent"),r=s||n?fL:dL,o=s||n?lL:aL;return c.jsx(r,{...t,children:c.jsxs(o,{children:[c.jsx(oL,{}),c.jsx(rL,{}),c.jsx(iL,{})]})})}),{Component:uL,usePublisher:zn,useEmitterValue:St,useEmitter:Ey}=NM(sL,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},cL),dL=ZM({usePublisher:zn,useEmitterValue:St,useEmitter:Ey}),fL=XM({usePublisher:zn,useEmitterValue:St,useEmitter:Ey});function Rm(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Jp.WARN),t==="normal"?0:parseInt(t??"0",10)}const du=uL,Qp=e=>{const t="gs-utl-grid-cols-4",n=parseInt(`${e||4}`,10);return n===1?"gs-utl-grid-cols-1":n===2?"gs-utl-grid-cols-2":n===3?"gs-utl-grid-cols-3":n===4?t:n===5?"gs-utl-grid-cols-5":n===6?"gs-utl-grid-cols-6":n===7?"gs-utl-grid-cols-7":n===8?"gs-utl-grid-cols-8":n===9?"gs-utl-grid-cols-9":n===10?"gs-utl-grid-cols-10":n===11?"gs-utl-grid-cols-11":n===12?"gs-utl-grid-cols-12":t},pL=e=>!!(e&&!Array.isArray(e)&&typeof e=="object");async function hL(e){const t=e.map(({id:i,src:a})=>({id:i,src:a})),n=e.reduce((i,a)=>(i[a.id]=a,i),{}),s=[],r=[];return(await hw(t)).forEach(i=>{i.status==="fulfilled"?s.push(n[i.value]):r.push(n[i.reason])}),{loaded:s,failed:r}}const gL=async e=>{const t=[...e],n={};if(t.length){const s={},r=[];if(t.forEach((o,i)=>{pL(o)&&(s[o.id]={index:i},r.push(o))}),r.length){const{loaded:o}=await hL(r);o.forEach(({id:i,options:a})=>{s[i].loaded=!0,n[i]=a||{}})}Object.keys(s).forEach(o=>{const i=s[o];i.loaded?t[i.index]=o:t[i.index]=!1})}return{plugins:t.filter(Boolean),pluginOptions:n}},mL=(e,t,n,s={})=>{const{skipReplace:r}=s;e.loadData(t);const o=e.getCss()||"",i=r?o:o.replace(/:root\s*{/gi,"[data-body]{");let a=`${e.getHtml()}<style>${i}</style>`;if(n===yt.email)try{a=e.runCommand(tu).html}catch(l){console.error(l)}return s.removeScripts&&(a=a.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script[^>]*src=["'][^"']*["'][^>]*><\/script>/gi,"").replace(/<script[^>]*src=["'][^"']*["'][^>]*\/?>/gi,"")),r?a:a.replace("<body","<div data-body").replace("</body>","</div>")},bL=async(e,t,n)=>{const s=qx(t,{appStore:n}),r=await gL(s);return e==null?void 0:e.init({headless:!0,projectData:{},log:!1,undoManager:!1,noticeOnUnload:!1,storageManager:!1,plugins:[...r.plugins,o=>{o.Storage.setCurrent("")}],pluginsOpts:r.pluginOptions,protectedCss:`
314
+ `}),l.jsx(Dn,{className:"gs-banner",children:l.jsxs(k,{className:"gs-banner-row",children:[l.jsx("a",{className:"gs-link",href:nM(),target:"_blank",children:"GrapesJS Studio"}),l.jsx(Wc,{className:"gs-logo",colors:!0})]})})]})}),l.jsx("div",{ref:s})})),Hg="gs-canvas-content",rM=f.memo(ae(function({children:t}){const{isReady:n}=me(),s=A(`${Hg}__overlay gs-utl-pointer-events-none gs-utl-absolute gs-utl-inset-0`,B.bgH2);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Hg,children:[l.jsx("div",{className:s}),!n&&l.jsx(ho,{className:A("gs-utl-z-10"),abs:!0,full:!0}),n&&Pt(t)]}),l.jsx(tM,{}),l.jsx(sM,{})]})})),oM="gs-canvas",T0=f.memo(function({className:t,style:n,grow:s,children:r}){return l.jsx(F4,{style:n,className:A(oM,"gs-utl-relative",s&&"gs-utl-flex-grow",t),children:l.jsx(Ba,{children:l.jsx(rM,{children:r})})})}),Tf=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.window.document._=0}catch{return!1}return"showOpenFilePicker"in self})(),iM=Tf?Promise.resolve().then(function(){return pM}):Promise.resolve().then(function(){return vM});async function aM(...e){return(await iM).default(...e)}Tf?Promise.resolve().then(function(){return hM}):Promise.resolve().then(function(){return xM});const lM=Tf?Promise.resolve().then(function(){return mM}):Promise.resolve().then(function(){return SM});async function cM(...e){return(await lM).default(...e)}const uM=async e=>{const t=await e.getFile();return t.handle=e,t};var dM=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((r,o)=>{t[o]={description:r.description||"Files",accept:{}},r.mimeTypes?r.mimeTypes.map(i=>{t[o].accept[i]=r.extensions||[]}):t[o].accept["*/*"]=r.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),s=await Promise.all(n.map(uM));return e[0].multiple?s:s[0]},pM={__proto__:null,default:dM};function Dl(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var s=n.done;return Promise.resolve(n.value).then(function(r){return{value:r,done:s}})}return Dl=function(n){this.s=n,this.n=n.next},Dl.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var s=this.s.return;return s===void 0?Promise.resolve({value:n,done:!0}):t(s.apply(this.s,arguments))},throw:function(n){var s=this.s.return;return s===void 0?Promise.reject(n):t(s.apply(this.s,arguments))}},new Dl(e)}const O0=async(e,t,n=e.name,s)=>{const r=[],o=[];var i,a=!1,c=!1;try{for(var u,d=function(p){var h,g,m,b=2;for(typeof Symbol<"u"&&(g=Symbol.asyncIterator,m=Symbol.iterator);b--;){if(g&&(h=p[g])!=null)return h.call(p);if(m&&(h=p[m])!=null)return new Dl(h.call(p));g="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());a=!(u=await d.next()).done;a=!1){const p=u.value,h=`${n}/${p.name}`;p.kind==="file"?o.push(p.getFile().then(g=>(g.directoryHandle=e,g.handle=p,Object.defineProperty(g,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>h})))):p.kind!=="directory"||!t||s&&s(p)||r.push(O0(p,t,h,s))}}catch(p){c=!0,i=p}finally{try{a&&d.return!=null&&await d.return()}finally{if(c)throw i}}return[...(await Promise.all(r)).flat(),...await Promise.all(o)]};var fM=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:O0(t,e.recursive,void 0,e.skipDirectory)},hM={__proto__:null,default:fM},gM=async(e,t=[{}],n=null,s=!1,r=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const o=[];let i=null;if(e instanceof Blob&&e.type?i=e.type:e.headers&&e.headers.get("content-type")&&(i=e.headers.get("content-type")),t.forEach((u,d)=>{o[d]={description:u.description||"Files",accept:{}},u.mimeTypes?(d===0&&i&&u.mimeTypes.push(i),u.mimeTypes.map(p=>{o[d].accept[p]=u.extensions||[]})):i?o[d].accept[i]=u.extensions||[]:o[d].accept["*/*"]=u.extensions||[]}),n)try{await n.getFile()}catch(u){if(n=null,s)throw u}const a=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:o,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&r&&r(a);const c=await a.createWritable();return"stream"in e?(await e.stream().pipeTo(c),a):"body"in e?(await e.body.pipeTo(c),a):(await c.write(await e),await c.close(),a)},mM={__proto__:null,default:gM},bM=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const s=document.createElement("input");s.type="file";const r=[...e.map(c=>c.mimeTypes||[]),...e.map(c=>c.extensions||[])].join();s.multiple=e[0].multiple||!1,s.accept=r||"",s.style.display="none",document.body.append(s);const o=c=>{typeof i=="function"&&i(),t(c)},i=e[0].legacySetup&&e[0].legacySetup(o,()=>i(n),s),a=()=>{window.removeEventListener("focus",a),s.remove()};s.addEventListener("click",()=>{window.addEventListener("focus",a)}),s.addEventListener("change",()=>{window.removeEventListener("focus",a),s.remove(),o(s.multiple?Array.from(s.files):s.files[0])}),"showPicker"in HTMLInputElement.prototype?s.showPicker():s.click()})),vM={__proto__:null,default:bM},yM=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const s=document.createElement("input");s.type="file",s.webkitdirectory=!0;const r=i=>{typeof o=="function"&&o(),t(i)},o=e[0].legacySetup&&e[0].legacySetup(r,()=>o(n),s);s.addEventListener("change",()=>{let i=Array.from(s.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(i=i.filter(a=>a.webkitRelativePath.split("/").every(c=>!e[0].skipDirectory({name:c,kind:"directory"})))):i=i.filter(a=>a.webkitRelativePath.split("/").length===2),r(i)}),"showPicker"in HTMLInputElement.prototype?s.showPicker():s.click()})),xM={__proto__:null,default:yM},wM=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let s=e;"body"in e&&(s=await async function(i,a){const c=i.getReader(),u=new ReadableStream({start:h=>async function g(){return c.read().then(({done:m,value:b})=>{if(!m)return h.enqueue(b),g();h.close()})}()}),d=new Response(u),p=await d.blob();return c.releaseLock(),new Blob([p],{type:a})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await s);const r=()=>{typeof o=="function"&&o()},o=t.legacySetup&&t.legacySetup(r,()=>o(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),r()}),n.click(),null},SM={__proto__:null,default:wM};function jr({children:e,label:t,s:n="m",pill:s,border:r,nopad:o,className:i,block:a,...c}){return l.jsx("div",{className:A(!a&&"gs-utl-inline-block",i,!o&&we.xyS2,s?X.pill:X.rnd,r&&`${X.b} ${B.br}`,n==="s"&&"gs-utl-text-sm",n==="xs"&&"gs-utl-p-1"),...c,children:t||e})}var Dg={NODE_ENV:"production"};const CM=Dg.REACT_APP_VERSION??Dg.NPM_PACKAGE_VERSION,jM=ae(function(){var n;const t=(n=window.grapesjs)==null?void 0:n.version;return l.jsxs(k,{col:!0,space:"m",children:[l.jsx(k,{justify:"center",children:l.jsxs(V,{className:ie("relative"),children:[l.jsx(Wc,{className:ie("w-24 opacity-50")}),t&&l.jsx(jr,{className:ie(B.bgA,"absolute gs-utl-right-[-20px] bottom-0"),label:`v${t}`,s:"s",pill:!0})]})}),l.jsxs(V,{children:[l.jsxs("p",{children:[l.jsx("b",{children:"GrapesJS Studio"})," is an innovative experimental editor, initially created to improve and extend the customization capability of the"," ",l.jsx("a",{className:ie(Er.link),href:"https://grapesjs.com",children:"GrapesJS"})," ","library. Beyond pushing the evolution of the core library itself, this application aspires to empower individuals in creating and managing their web projects autonomously, free from subscriptions or dependency on the internet connection."]}),l.jsx("br",{}),l.jsxs("p",{children:["If you like the vision of this project and you're eager to play a role in its continued development, consider becoming a backer or sponsor through"," ",l.jsx("a",{className:ie(Er.link),href:"https://opencollective.com/grapesjs",children:"Open Collective"}),"."]})]}),l.jsxs(V,{className:ie(B.txtLowEmphasis,"text-right"),children:["GrapesJS Studio: v",CM]})]})}),EM=ae(function(){return l.jsxs(k,{col:!0,space:"m",children:[l.jsx(k,{justify:"center",children:l.jsx(V,{className:K("relative"),children:l.jsx(Wc,{className:K("w-24 opacity-50")})})}),l.jsx(V,{children:l.jsxs("p",{children:["We're excited to introduce the GrapesJS Studio SDK, an embeddable version of the Studio editor.",l.jsx("br",{}),l.jsx("br",{}),"The Studio SDK offers a powerful and flexible web editing experience that can be seamlessly integrated into your platform as a white-label editor. This enables your users to effortlessly create and manage content with advanced tools.",l.jsx("br",{}),l.jsx("br",{}),"You can try the initial release of the Studio SDK by creating a license and following the instructions on the"," ",l.jsx("a",{className:K(Er.link),href:"/dashboard/sdk/licenses",target:"_blank",children:"Studio SDK license page"}),l.jsx("br",{}),l.jsx("br",{}),"If you have any questions or need assistance with specific use cases, please fill out this"," ",l.jsx("a",{className:K(Er.link),href:"https://forms.gle/VUycp3rc8iCpbh9k8",target:"_blank",rel:"noreferrer",children:"form"})," ","and we'll get back to you as soon as possible."]})})]})}),PM=()=>[{id:mt.web,label:vs(mt.web),content:l.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[l.jsx(Q,{icon:U.web,size:oe.s}),l.jsx("span",{children:vs(mt.web)})]})},{id:mt.email,label:vs(mt.email),content:l.jsxs(k,{gap:"s",items:"center",nowrap:!0,children:[l.jsx(Q,{icon:U.emailOutline,size:oe.s}),l.jsx("span",{children:vs(mt.email)})]})}],ul="gs-cmp-tabs";function Dr({tabs:e,className:t,classNamePanel:n,classNameTab:s,variant:r,style:o,onChange:i=Hx,value:a}){const c=r==="pills",u=c?A("gs-utl-rounded-full gs-utl-text-sm gs-utl-px-[2px] gs-utl-py-[2px]",B.bgH):"",d=b=>c?A("gs-utl-rounded-full gs-utl-px-3 gs-utl-py-1",b?B.bg:""):A("gs-utl-border-b-2",we.xy),p=b=>{b&&(b.tabIndex=-1)},h=b=>{const v=b.currentTarget;setTimeout(()=>v.blur(),10)},g=At(a)?e.findIndex(b=>b.id===a):void 0,m=!e.some(b=>!!b.content);return l.jsxs(Si.Group,{onChange:b=>i(e[b].id),defaultIndex:e.findIndex(b=>b.id===a),selectedIndex:g,children:[l.jsx(Si.List,{as:k,className:A(ul,t,u),style:o,full:!0,nowrap:!0,children:e.map(b=>l.jsx(Si,{disabled:b.disabled,className:({selected:v})=>A(`${ul}__tab`,"gs-utl-flex-1 focus:gs-utl-outline-none",b.disabled&&"gs-utl-cursor-not-allowed gs-utl-opacity-50",ta.focus,d(v),v?`${B.tAo} ${B.bA}`:B.br,s),children:b.label},b.id))}),l.jsx(Si.Panels,{className:A(`${ul}__panels`,"gs-utl-overflow-hidden gs-utl-flex-1",m&&"gs-utl-hidden",n),children:e.map(b=>l.jsx(Si.Panel,{tabIndex:-1,className:A(`${ul}__panel`,"gs-utl-h-full"),ref:p,onFocus:h,children:b.content},b.id))})]})}const Gc=0,Fr=1,gi=2,_0=4;function TM(e,t){return n=>e(t(n))}function OM(e,t){return t(e)}function A0(e,t){return n=>e(t,n)}function Fg(e,t){return()=>e(t)}function Of(e,t){return t(e),e}function To(...e){return e}function _M(e){e()}function Bg(e){return()=>e}function AM(...e){return()=>{e.map(_M)}}function qc(){}function Gt(e,t){return e(Fr,t)}function Lt(e,t){e(Gc,t)}function _f(e){e(gi)}function Zo(e){return e(_0)}function ot(e,t){return Gt(e,A0(t,Gc))}function zg(e,t){const n=e(Fr,s=>{n(),t(s)});return n}function jt(){const e=[];return(t,n)=>{switch(t){case gi:e.splice(0,e.length);return;case Fr:return e.push(n),()=>{const s=e.indexOf(n);s>-1&&e.splice(s,1)};case Gc:e.slice().forEach(s=>{s(n)});return;default:throw new Error(`unrecognized action ${t}`)}}}function ye(e){let t=e;const n=jt();return(s,r)=>{switch(s){case Fr:r(t);break;case Gc:t=r;break;case _0:return t}return n(s,r)}}function MM(e){let t,n;const s=()=>t&&t();return function(r,o){switch(r){case Fr:return o?n===o?void 0:(s(),n=o,t=Gt(e,o),t):(s(),qc);case gi:s(),n=null;return;default:throw new Error(`unrecognized action ${r}`)}}}function Bi(e){return Of(jt(),t=>ot(e,t))}function Yo(e,t){return Of(ye(t),n=>ot(e,n))}function LM(...e){return t=>e.reduceRight(OM,t)}function Ce(e,...t){const n=LM(...t);return(s,r)=>{switch(s){case Fr:return Gt(e,n(r));case gi:_f(e);return}}}function M0(e,t){return e===t}function on(e=M0){let t;return n=>s=>{e(t,s)||(t=s,n(s))}}function Vt(e){return t=>n=>{e(n)&&t(n)}}function gt(e){return t=>TM(t,e)}function pr(e){return t=>()=>t(e)}function dl(e,t){return n=>s=>n(t=e(t,s))}function Xd(e){return t=>n=>{e>0?e--:t(n)}}function ki(e){let t=null,n;return s=>r=>{t=r,!n&&(n=setTimeout(()=>{n=void 0,s(t)},e))}}function Ug(e){let t,n;return s=>r=>{t=r,n&&clearTimeout(n),n=setTimeout(()=>{s(t)},e)}}function hs(...e){const t=new Array(e.length);let n=0,s=null;const r=Math.pow(2,e.length)-1;return e.forEach((o,i)=>{const a=Math.pow(2,i);Gt(o,c=>{const u=n;n=n|a,t[i]=c,u!==r&&n===r&&s&&(s(),s=null)})}),o=>i=>{const a=()=>o([i].concat(t));n===r?a():s=a}}function Wg(...e){return function(t,n){switch(t){case Fr:return AM(...e.map(s=>Gt(s,n)));case gi:return;default:throw new Error(`unrecognized action ${t}`)}}}function Ie(e,t=M0){return Ce(e,on(t))}function Us(...e){const t=jt(),n=new Array(e.length);let s=0;const r=Math.pow(2,e.length)-1;return e.forEach((o,i)=>{const a=Math.pow(2,i);Gt(o,c=>{n[i]=c,s=s|a,s===r&&Lt(t,n)})}),function(o,i){switch(o){case Fr:return s===r&&i(n),Gt(t,i);case gi:return _f(t);default:throw new Error(`unrecognized action ${o}`)}}}function Ms(e,t=[],{singleton:n}={singleton:!0}){return{id:NM(),constructor:e,dependencies:t,singleton:n}}const NM=()=>Symbol();function $M(e){const t=new Map,n=({id:s,constructor:r,dependencies:o,singleton:i})=>{if(i&&t.has(s))return t.get(s);const a=r(o.map(c=>n(c)));return i&&t.set(s,a),a};return n(e)}function kM(e,t){const n={},s={};let r=0;const o=e.length;for(;r<o;)s[e[r]]=1,r+=1;for(const i in t)s.hasOwnProperty(i)||(n[i]=t[i]);return n}const pl=typeof document<"u"?f.useLayoutEffect:f.useEffect;function RM(e,t,n){const s=Object.keys(t.required||{}),r=Object.keys(t.optional||{}),o=Object.keys(t.methods||{}),i=Object.keys(t.events||{}),a=f.createContext({});function c(x,y){x.propsReady&&Lt(x.propsReady,!1);for(const w of s){const S=x[t.required[w]];Lt(S,y[w])}for(const w of r)if(w in y){const S=x[t.optional[w]];Lt(S,y[w])}x.propsReady&&Lt(x.propsReady,!0)}function u(x){return o.reduce((y,w)=>(y[w]=S=>{const C=x[t.methods[w]];Lt(C,S)},y),{})}function d(x){return i.reduce((y,w)=>(y[w]=MM(x[t.events[w]]),y),{})}const p=f.forwardRef((x,y)=>{const{children:w,...S}=x,[C]=f.useState(()=>Of($M(e),T=>c(T,S))),[j]=f.useState(Fg(d,C));pl(()=>{for(const T of i)T in S&&Gt(j[T],S[T]);return()=>{Object.values(j).map(_f)}},[S,j,C]),pl(()=>{c(C,S)}),f.useImperativeHandle(y,Bg(u(C)));const E=n;return l.jsx(a.Provider,{value:C,children:n?l.jsx(E,{...kM([...s,...r,...i],S),children:w}):w})}),h=x=>f.useCallback(A0(Lt,f.useContext(a)[x]),[x]),g=x=>{const w=f.useContext(a)[x],S=f.useCallback(C=>Gt(w,C),[w]);return f.useSyncExternalStore(S,()=>Zo(w),()=>Zo(w))},m=x=>{const w=f.useContext(a)[x],[S,C]=f.useState(Fg(Zo,w));return pl(()=>Gt(w,j=>{j!==S&&C(Bg(j))}),[w,S]),S},b=f.version.startsWith("18")?g:m;return{Component:p,usePublisher:h,useEmitterValue:b,useEmitter:(x,y)=>{const S=f.useContext(a)[x];pl(()=>Gt(S,y),[y,S])}}}const L0=typeof document<"u"?f.useLayoutEffect:f.useEffect;var Af=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e))(Af||{});const IM={0:"debug",1:"log",2:"warn",3:"error"},VM=()=>typeof globalThis>"u"?window:globalThis,N0=Ms(()=>{const e=ye(3);return{log:ye((n,s,r=1)=>{var o;const i=(o=VM().VIRTUOSO_LOG_LEVEL)!=null?o:Zo(e);r>=i&&console[IM[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",n,s)}),logLevel:e}},[],{singleton:!0});function $0(e,t,n){const s=f.useRef(null);let r=o=>{};if(typeof ResizeObserver<"u"){const o=f.useMemo(()=>new ResizeObserver(i=>{requestAnimationFrame(()=>{const c=i[0].target;c.offsetParent!==null&&e(c)})}),[e]);r=i=>{i&&t?(o.observe(i),s.current=i):(s.current&&o.unobserve(s.current),s.current=null)}}return{ref:s,callbackRef:r}}function Kc(e,t,n){return $0(e,t).callbackRef}function ic(e,t){return Math.round(e.getBoundingClientRect()[t])}function k0(e,t){return Math.abs(e-t)<1.01}function R0(e,t,n,s=qc,r,o){const i=f.useRef(null),a=f.useRef(null),c=f.useRef(null),u=f.useCallback(h=>{const g=h.target,m=g===window||g===document,b=o?m?window.pageXOffset||document.documentElement.scrollLeft:g.scrollLeft:m?window.pageYOffset||document.documentElement.scrollTop:g.scrollTop,v=o?m?document.documentElement.scrollWidth:g.scrollWidth:m?document.documentElement.scrollHeight:g.scrollHeight,x=o?m?window.innerWidth:g.offsetWidth:m?window.innerHeight:g.offsetHeight,y=()=>{e({scrollTop:Math.max(b,0),scrollHeight:v,viewportHeight:x})};h.suppressFlushSync?y():Mn.flushSync(y),a.current!==null&&(b===a.current||b<=0||b===v-x)&&(a.current=null,t(!0),c.current&&(clearTimeout(c.current),c.current=null))},[e,t]);f.useEffect(()=>{const h=r||i.current;return s(r||i.current),u({target:h,suppressFlushSync:!0}),h.addEventListener("scroll",u,{passive:!0}),()=>{s(null),h.removeEventListener("scroll",u)}},[i,u,n,s,r]);function d(h){const g=i.current;if(!g||(o?"offsetWidth"in g&&g.offsetWidth===0:"offsetHeight"in g&&g.offsetHeight===0))return;const m=h.behavior==="smooth";let b,v,x;g===window?(v=Math.max(ic(document.documentElement,o?"width":"height"),o?document.documentElement.scrollWidth:document.documentElement.scrollHeight),b=o?window.innerWidth:window.innerHeight,x=o?document.documentElement.scrollLeft:document.documentElement.scrollTop):(v=g[o?"scrollWidth":"scrollHeight"],b=ic(g,o?"width":"height"),x=g[o?"scrollLeft":"scrollTop"]);const y=v-b;if(h.top=Math.ceil(Math.max(Math.min(y,h.top),0)),k0(b,v)||h.top===x){e({scrollTop:x,scrollHeight:v,viewportHeight:b}),m&&t(!0);return}m?(a.current=h.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,a.current=null,t(!0)},1e3)):a.current=null,o&&(h={left:h.top,behavior:h.behavior}),g.scrollTo(h)}function p(h){o&&(h={left:h.top,behavior:h.behavior}),i.current.scrollBy(h)}return{scrollerRef:i,scrollByCallback:p,scrollToCallback:d}}const Zc=Ms(()=>{const e=jt(),t=jt(),n=ye(0),s=jt(),r=ye(0),o=jt(),i=jt(),a=ye(0),c=ye(0),u=ye(0),d=ye(0),p=jt(),h=jt(),g=ye(!1),m=ye(!1),b=ye(!1);return ot(Ce(e,gt(({scrollTop:v})=>v)),t),ot(Ce(e,gt(({scrollHeight:v})=>v)),i),ot(t,r),{scrollContainerState:e,scrollTop:t,viewportHeight:o,headerHeight:a,fixedHeaderHeight:c,fixedFooterHeight:u,footerHeight:d,scrollHeight:i,smoothScrollTargetReached:s,horizontalDirection:m,skipAnimationFrameInResizeObserver:b,scrollTo:p,scrollBy:h,statefulScrollTop:r,deviation:n,scrollingInProgress:g}},[],{singleton:!0}),HM=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function DM(e){const t=typeof e=="number"?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!HM)&&(t.behavior="auto"),t.offset||(t.offset=0),t}const ac="up",zi="down",FM="none",BM={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollTop:0,viewportHeight:0,scrollHeight:0}},zM=0,I0=Ms(([{scrollContainerState:e,scrollTop:t,viewportHeight:n,headerHeight:s,footerHeight:r,scrollBy:o}])=>{const i=ye(!1),a=ye(!0),c=jt(),u=jt(),d=ye(4),p=ye(zM),h=Yo(Ce(Wg(Ce(Ie(t),Xd(1),pr(!0)),Ce(Ie(t),Xd(1),pr(!1),Ug(100))),on()),!1),g=Yo(Ce(Wg(Ce(o,pr(!0)),Ce(o,pr(!1),Ug(200))),on()),!1);ot(Ce(Us(Ie(t),Ie(p)),gt(([y,w])=>y<=w),on()),a),ot(Ce(a,ki(50)),u);const m=Bi(Ce(Us(e,Ie(n),Ie(s),Ie(r),Ie(d)),dl((y,[{scrollTop:w,scrollHeight:S},C,j,E,T])=>{const O=w+C-S>-T,P={viewportHeight:C,scrollTop:w,scrollHeight:S};if(O){let M,N;return w>y.state.scrollTop?(M="SCROLLED_DOWN",N=y.state.scrollTop-w):(M="SIZE_DECREASED",N=y.state.scrollTop-w||y.scrollTopDelta),{atBottom:!0,state:P,atBottomBecause:M,scrollTopDelta:N}}let _;return P.scrollHeight>y.state.scrollHeight?_="SIZE_INCREASED":C<y.state.viewportHeight?_="VIEWPORT_HEIGHT_DECREASING":w<y.state.scrollTop?_="SCROLLING_UPWARDS":_="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:_,state:P}},BM),on((y,w)=>y&&y.atBottom===w.atBottom))),b=Yo(Ce(e,dl((y,{scrollTop:w,scrollHeight:S,viewportHeight:C})=>{if(k0(y.scrollHeight,S))return{scrollTop:w,scrollHeight:S,jump:0,changed:!1};{const j=S-(w+C)<1;return y.scrollTop!==w&&j?{scrollHeight:S,scrollTop:w,jump:y.scrollTop-w,changed:!0}:{scrollHeight:S,scrollTop:w,jump:0,changed:!0}}},{scrollHeight:0,jump:0,scrollTop:0,changed:!1}),Vt(y=>y.changed),gt(y=>y.jump)),0);ot(Ce(m,gt(y=>y.atBottom)),i),ot(Ce(i,ki(50)),c);const v=ye(zi);ot(Ce(e,gt(({scrollTop:y})=>y),on(),dl((y,w)=>Zo(g)?{direction:y.direction,prevScrollTop:w}:{direction:w<y.prevScrollTop?ac:zi,prevScrollTop:w},{direction:zi,prevScrollTop:0}),gt(y=>y.direction)),v),ot(Ce(e,ki(50),pr(FM)),v);const x=ye(0);return ot(Ce(h,Vt(y=>!y),pr(0)),x),ot(Ce(t,ki(100),hs(h),Vt(([y,w])=>!!w),dl(([y,w],[S])=>[w,S],[0,0]),gt(([y,w])=>w-y)),x),{isScrolling:h,isAtTop:a,isAtBottom:i,atBottomState:m,atTopStateChange:u,atBottomStateChange:c,scrollDirection:v,atBottomThreshold:d,atTopThreshold:p,scrollVelocity:x,lastJumpDueToItemResize:b}},To(Zc)),UM=Ms(([{log:e}])=>{const t=ye(!1),n=Bi(Ce(t,Vt(s=>s),on()));return Gt(t,s=>{s&&Zo(e)("props updated",{},Af.DEBUG)}),{propsReady:t,didMount:n}},To(N0),{singleton:!0});function V0(e,t){e==0?t():requestAnimationFrame(()=>V0(e-1,t))}function WM(e,t){const n=t-1;return typeof e=="number"?e:e.index==="LAST"?n:e.index}function Jd(e,t){return!!(e&&e[0]===t[0]&&e[1]===t[1])}function GM(e,t){return!!(e&&e.startIndex===t.startIndex&&e.endIndex===t.endIndex)}const lc="top",cc="bottom",Gg="none";function qg(e,t,n){return typeof e=="number"?n===ac&&t===lc||n===zi&&t===cc?e:0:n===ac?t===lc?e.main:e.reverse:t===cc?e.main:e.reverse}function Kg(e,t){return typeof e=="number"?e:e[t]||0}const qM=Ms(([{scrollTop:e,viewportHeight:t,deviation:n,headerHeight:s,fixedHeaderHeight:r}])=>{const o=jt(),i=ye(0),a=ye(0),c=ye(0),u=Yo(Ce(Us(Ie(e),Ie(t),Ie(s),Ie(o,Jd),Ie(c),Ie(i),Ie(r),Ie(n),Ie(a)),gt(([d,p,h,[g,m],b,v,x,y,w])=>{const S=d-y,C=v+x,j=Math.max(h-S,0);let E=Gg;const T=Kg(w,lc),O=Kg(w,cc);return g-=y,g+=h+x,m+=h+x,m-=y,g>d+C-T&&(E=ac),m<d-j+p+O&&(E=zi),E!==Gg?[Math.max(S-h-qg(b,lc,E)-T,0),S-j-x+p+qg(b,cc,E)+O]:null}),Vt(d=>d!=null),on(Jd)),[0,0]);return{listBoundary:o,overscan:c,topListHeight:i,increaseViewportBy:a,visibleRange:u}},To(Zc),{singleton:!0}),KM=Ms(([{scrollVelocity:e}])=>{const t=ye(!1),n=jt(),s=ye(!1);return ot(Ce(e,hs(s,t,n),Vt(([r,o])=>!!o),gt(([r,o,i,a])=>{const{exit:c,enter:u}=o;if(i){if(c(r,a))return!1}else if(u(r,a))return!0;return i}),on()),t),Gt(Ce(Us(t,e,n),hs(s)),([[r,o,i],a])=>r&&a&&a.change&&a.change(o,i)),{isSeeking:t,scrollSeekConfiguration:s,scrollVelocity:e,scrollSeekRangeChanged:n}},To(I0),{singleton:!0});function ZM(e){let t=!1,n;return()=>(t||(t=!0,n=e()),n)}const YM=Ms(([{scrollTo:e,scrollContainerState:t}])=>{const n=jt(),s=jt(),r=jt(),o=ye(!1),i=ye(void 0);return ot(Ce(Us(n,s),gt(([{viewportHeight:a,scrollTop:c,scrollHeight:u},{offsetTop:d}])=>({scrollTop:Math.max(0,c-d),scrollHeight:u,viewportHeight:a}))),t),ot(Ce(e,hs(s),gt(([a,{offsetTop:c}])=>({...a,top:a.top+c}))),r),{useWindowScroll:o,customScrollParent:i,windowScrollContainerState:n,windowViewportRect:s,windowScrollTo:r}},To(Zc)),Gu="-webkit-sticky",Zg="sticky",H0=ZM(()=>{if(typeof document>"u")return Zg;const e=document.createElement("div");return e.style.position=Gu,e.style.position===Gu?Gu:Zg});function XM(e,t,n){const s=f.useRef(null),r=f.useCallback(c=>{if(c===null||!c.offsetParent)return;const u=c.getBoundingClientRect(),d=u.width;let p,h;if(t){const g=t.getBoundingClientRect(),m=u.top-g.top;p=g.height-Math.max(0,m),h=m+t.scrollTop}else p=window.innerHeight-Math.max(0,u.top),h=u.top+window.pageYOffset;s.current={offsetTop:h,visibleHeight:p,visibleWidth:d},e(s.current)},[e,t]),{callbackRef:o,ref:i}=$0(r,!0),a=f.useCallback(()=>{r(i.current)},[r,i]);return f.useEffect(()=>{if(t){t.addEventListener("scroll",a);const c=new ResizeObserver(()=>{requestAnimationFrame(a)});return c.observe(t),()=>{t.removeEventListener("scroll",a),c.unobserve(t)}}else return window.addEventListener("scroll",a),window.addEventListener("resize",a),()=>{window.removeEventListener("scroll",a),window.removeEventListener("resize",a)}},[a,t]),o}f.createContext(void 0);const D0=f.createContext(void 0);function JM(e){return e}H0();const QM={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},eL={outline:"none",overflowX:"auto",position:"relative"},F0=e=>({width:"100%",height:"100%",position:"absolute",top:0});H0();function io(e,t){if(typeof e!="string")return{context:t}}function tL({usePublisher:e,useEmitter:t,useEmitterValue:n}){return f.memo(function({style:o,children:i,...a}){const c=e("scrollContainerState"),u=n("ScrollerComponent"),d=e("smoothScrollTargetReached"),p=n("scrollerRef"),h=n("context"),g=n("horizontalDirection")||!1,{scrollerRef:m,scrollByCallback:b,scrollToCallback:v}=R0(c,d,u,p,void 0,g);t("scrollTo",v),t("scrollBy",b);const x=g?eL:QM;return l.jsx(u,{ref:m,style:{...x,...o},"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,tabIndex:0,...a,...io(u,h),children:i})})}function nL({usePublisher:e,useEmitter:t,useEmitterValue:n}){return f.memo(function({style:o,children:i,...a}){const c=e("windowScrollContainerState"),u=n("ScrollerComponent"),d=e("smoothScrollTargetReached"),p=n("totalListHeight"),h=n("deviation"),g=n("customScrollParent"),m=n("context"),{scrollerRef:b,scrollByCallback:v,scrollToCallback:x}=R0(c,d,u,qc,g);return L0(()=>(b.current=g||window,()=>{b.current=null}),[b,g]),t("windowScrollTo",x),t("scrollBy",v),l.jsx(u,{style:{position:"relative",...o,...p!==0?{height:p+h}:{}},"data-virtuoso-scroller":!0,...a,...io(u,m),children:i})})}const Yg={items:[],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},sL={items:[{index:0}],offsetBottom:0,offsetTop:0,top:0,bottom:0,itemHeight:0,itemWidth:0},{round:Xg,ceil:Jg,floor:uc,min:qu,max:Ui}=Math;function rL(e){return{...sL,items:e}}function Qg(e,t,n){return Array.from({length:t-e+1}).map((s,r)=>{const o=n===null?null:n[r+e];return{index:r+e,data:o}})}function oL(e,t){return e&&e.column===t.column&&e.row===t.row}function fl(e,t){return e&&e.width===t.width&&e.height===t.height}const iL=Ms(([{overscan:e,visibleRange:t,listBoundary:n,increaseViewportBy:s},{scrollTop:r,viewportHeight:o,scrollBy:i,scrollTo:a,smoothScrollTargetReached:c,scrollContainerState:u,footerHeight:d,headerHeight:p},h,g,{propsReady:m,didMount:b},{windowViewportRect:v,useWindowScroll:x,customScrollParent:y,windowScrollContainerState:w,windowScrollTo:S},C])=>{const j=ye(0),E=ye(0),T=ye(Yg),O=ye({height:0,width:0}),P=ye({height:0,width:0}),_=jt(),M=jt(),N=ye(0),H=ye(null),L=ye({row:0,column:0}),F=jt(),G=jt(),D=ye(!1),$=ye(0),I=ye(!0),R=ye(!1),z=ye(!1);Gt(Ce(b,hs($),Vt(([q,ne])=>!!ne)),()=>{Lt(I,!1)}),Gt(Ce(Us(b,I,P,O,$,R),Vt(([q,ne,ce,ge,,Re])=>q&&!ne&&ce.height!==0&&ge.height!==0&&!Re)),([,,,,q])=>{Lt(R,!0),V0(1,()=>{Lt(_,q)}),zg(Ce(r),()=>{Lt(n,[0,0]),Lt(I,!0)})}),ot(Ce(G,Vt(q=>q!=null&&q.scrollTop>0),pr(0)),E),Gt(Ce(b,hs(G),Vt(([,q])=>q!=null)),([,q])=>{q&&(Lt(O,q.viewport),Lt(P,q==null?void 0:q.item),Lt(L,q.gap),q.scrollTop>0&&(Lt(D,!0),zg(Ce(r,Xd(1)),ne=>{Lt(D,!1)}),Lt(a,{top:q.scrollTop})))}),ot(Ce(O,gt(({height:q})=>q)),o),ot(Ce(Us(Ie(O,fl),Ie(P,fl),Ie(L,(q,ne)=>q&&q.column===ne.column&&q.row===ne.row),Ie(r)),gt(([q,ne,ce,ge])=>({viewport:q,item:ne,gap:ce,scrollTop:ge}))),F),ot(Ce(Us(Ie(j),t,Ie(L,oL),Ie(P,fl),Ie(O,fl),Ie(H),Ie(E),Ie(D),Ie(I),Ie($)),Vt(([,,,,,,,q])=>!q),gt(([q,[ne,ce],ge,Re,ve,qe,Be,,ht,et])=>{const{row:be,column:Ze}=ge,{height:Ye,width:lt}=Re,{width:Pe}=ve;if(Be===0&&(q===0||Pe===0))return Yg;if(lt===0){const Mt=WM(et,q),Ns=Math.max(Mt+Be-1,0);return rL(Qg(Mt,Ns,qe))}const st=B0(Pe,lt,Ze);let tt,Ne;ht?ne===0&&ce===0&&Be>0?(tt=0,Ne=Be-1):(tt=st*uc((ne+be)/(Ye+be)),Ne=st*Jg((ce+be)/(Ye+be))-1,Ne=qu(q-1,Ui(Ne,st-1)),tt=qu(Ne,Ui(0,tt))):(tt=0,Ne=-1);const Dt=Qg(tt,Ne,qe),{top:pe,bottom:Me}=em(ve,ge,Re,Dt),Le=Jg(q/st),vt=Le*Ye+(Le-1)*be-Me;return{items:Dt,offsetTop:pe,offsetBottom:vt,top:pe,bottom:Me,itemHeight:Ye,itemWidth:lt}})),T),ot(Ce(H,Vt(q=>q!==null),gt(q=>q.length)),j),ot(Ce(Us(O,P,T,L),Vt(([q,ne,{items:ce}])=>ce.length>0&&ne.height!==0&&q.height!==0),gt(([q,ne,{items:ce},ge])=>{const{top:Re,bottom:ve}=em(q,ge,ne,ce);return[Re,ve]}),on(Jd)),n);const Y=ye(!1);ot(Ce(r,hs(Y),gt(([q,ne])=>ne||q!==0)),Y);const Z=Bi(Ce(Ie(T),Vt(({items:q})=>q.length>0),hs(j,Y),Vt(([{items:q},ne,ce])=>ce&&q[q.length-1].index===ne-1),gt(([,q])=>q-1),on())),J=Bi(Ce(Ie(T),Vt(({items:q})=>q.length>0&&q[0].index===0),pr(0),on())),ee=Bi(Ce(Ie(T),hs(D),Vt(([{items:q},ne])=>q.length>0&&!ne),gt(([{items:q}])=>({startIndex:q[0].index,endIndex:q[q.length-1].index})),on(GM),ki(0)));ot(ee,g.scrollSeekRangeChanged),ot(Ce(_,hs(O,P,j,L),gt(([q,ne,ce,ge,Re])=>{const ve=DM(q),{align:qe,behavior:Be,offset:ht}=ve;let et=ve.index;et==="LAST"&&(et=ge-1),et=Ui(0,et,qu(ge-1,et));let be=Qd(ne,Re,ce,et);return qe==="end"?be=Xg(be-ne.height+ce.height):qe==="center"&&(be=Xg(be-ne.height/2+ce.height/2)),ht&&(be+=ht),{top:be,behavior:Be}})),a);const te=Yo(Ce(T,gt(q=>q.offsetBottom+q.bottom)),0);return ot(Ce(v,gt(q=>({width:q.visibleWidth,height:q.visibleHeight}))),O),{data:H,totalCount:j,viewportDimensions:O,itemDimensions:P,scrollTop:r,scrollHeight:M,overscan:e,increaseViewportBy:s,scrollBy:i,scrollTo:a,scrollToIndex:_,smoothScrollTargetReached:c,windowViewportRect:v,windowScrollTo:S,useWindowScroll:x,customScrollParent:y,windowScrollContainerState:w,deviation:N,scrollContainerState:u,footerHeight:d,headerHeight:p,initialItemCount:E,gap:L,restoreStateFrom:G,...g,initialTopMostItemIndex:$,horizontalDirection:z,gridState:T,totalListHeight:te,...h,startReached:J,endReached:Z,rangeChanged:ee,stateChanged:F,propsReady:m,stateRestoreInProgress:D,...C}},To(qM,Zc,I0,KM,UM,YM,N0));function em(e,t,n,s){const{height:r}=n;if(r===void 0||s.length===0)return{top:0,bottom:0};const o=Qd(e,t,n,s[0].index),i=Qd(e,t,n,s[s.length-1].index)+r;return{top:o,bottom:i}}function Qd(e,t,n,s){const r=B0(e.width,n.width,t.column),o=uc(s/r),i=o*n.height+Ui(0,o-1)*t.row;return i>0?i+t.row:i}function B0(e,t,n){return Ui(1,uc((e+n)/(uc(t)+n)))}const aL=Ms(()=>{const e=ye(p=>`Item ${p}`),t=ye({}),n=ye(null),s=ye("virtuoso-grid-item"),r=ye("virtuoso-grid-list"),o=ye(JM),i=ye("div"),a=ye(qc),c=(p,h=null)=>Yo(Ce(t,gt(g=>g[p]),on()),h),u=ye(!1),d=ye(!1);return ot(Ie(d),u),{readyStateChanged:u,reportReadyState:d,context:n,itemContent:e,components:t,computeItemKey:o,itemClassName:s,listClassName:r,headerFooterTag:i,scrollerRef:a,FooterComponent:c("Footer"),HeaderComponent:c("Header"),ListComponent:c("List","div"),ItemComponent:c("Item","div"),ScrollerComponent:c("Scroller","div"),ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),lL=Ms(([e,t])=>({...e,...t}),To(iL,aL)),cL=f.memo(function(){const t=yt("gridState"),n=yt("listClassName"),s=yt("itemClassName"),r=yt("itemContent"),o=yt("computeItemKey"),i=yt("isSeeking"),a=kn("scrollHeight"),c=yt("ItemComponent"),u=yt("ListComponent"),d=yt("ScrollSeekPlaceholder"),p=yt("context"),h=kn("itemDimensions"),g=kn("gap"),m=yt("log"),b=yt("stateRestoreInProgress"),v=kn("reportReadyState"),x=Kc(f.useMemo(()=>y=>{const w=y.parentElement.parentElement.scrollHeight;a(w);const S=y.firstChild;if(S){const{width:C,height:j}=S.getBoundingClientRect();h({width:C,height:j})}g({row:tm("row-gap",getComputedStyle(y).rowGap,m),column:tm("column-gap",getComputedStyle(y).columnGap,m)})},[a,h,g,m]),!0);return L0(()=>{t.itemHeight>0&&t.itemWidth>0&&v(!0)},[t]),b?null:l.jsx(u,{ref:x,className:n,...io(u,p),style:{paddingTop:t.offsetTop,paddingBottom:t.offsetBottom},"data-testid":"virtuoso-item-list",children:t.items.map(y=>{const w=o(y.index,y.data,p);return i?l.jsx(d,{...io(d,p),index:y.index,height:t.itemHeight,width:t.itemWidth},w):f.createElement(c,{...io(c,p),className:s,"data-index":y.index,key:w},r(y.index,y.data,p))})})}),uL=f.memo(function(){const t=yt("HeaderComponent"),n=kn("headerHeight"),s=yt("headerFooterTag"),r=Kc(f.useMemo(()=>i=>n(ic(i,"height")),[n]),!0),o=yt("context");return t?l.jsx(s,{ref:r,children:l.jsx(t,{...io(t,o)})}):null}),dL=f.memo(function(){const t=yt("FooterComponent"),n=kn("footerHeight"),s=yt("headerFooterTag"),r=Kc(f.useMemo(()=>i=>n(ic(i,"height")),[n]),!0),o=yt("context");return t?l.jsx(s,{ref:r,children:l.jsx(t,{...io(t,o)})}):null}),pL=({children:e})=>{const t=f.useContext(D0),n=kn("itemDimensions"),s=kn("viewportDimensions"),r=Kc(f.useMemo(()=>o=>{s(o.getBoundingClientRect())},[s]),!0);return f.useEffect(()=>{t&&(s({height:t.viewportHeight,width:t.viewportWidth}),n({height:t.itemHeight,width:t.itemWidth}))},[t,s,n]),l.jsx("div",{style:F0(),ref:r,children:e})},fL=({children:e})=>{const t=f.useContext(D0),n=kn("windowViewportRect"),s=kn("itemDimensions"),r=yt("customScrollParent"),o=XM(n,r);return f.useEffect(()=>{t&&(s({height:t.itemHeight,width:t.itemWidth}),n({offsetTop:0,visibleHeight:t.viewportHeight,visibleWidth:t.viewportWidth}))},[t,n,s]),l.jsx("div",{ref:o,style:F0(),children:e})},hL=f.memo(function({...t}){const n=yt("useWindowScroll"),s=yt("customScrollParent"),r=s||n?bL:mL,o=s||n?fL:pL;return l.jsx(r,{...t,children:l.jsxs(o,{children:[l.jsx(uL,{}),l.jsx(cL,{}),l.jsx(dL,{})]})})}),{Component:gL,usePublisher:kn,useEmitterValue:yt,useEmitter:z0}=RM(lL,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},hL),mL=tL({usePublisher:kn,useEmitterValue:yt,useEmitter:z0}),bL=nL({usePublisher:kn,useEmitterValue:yt,useEmitter:z0});function tm(e,t,n){return t!=="normal"&&!(t!=null&&t.endsWith("px"))&&n(`${e} was not resolved to pixel value correctly`,t,Af.WARN),t==="normal"?0:parseInt(t??"0",10)}const Yc=gL,Mf=e=>{const t="gs-utl-grid-cols-4",n=parseInt(`${e||4}`,10);return n===1?"gs-utl-grid-cols-1":n===2?"gs-utl-grid-cols-2":n===3?"gs-utl-grid-cols-3":n===4?t:n===5?"gs-utl-grid-cols-5":n===6?"gs-utl-grid-cols-6":n===7?"gs-utl-grid-cols-7":n===8?"gs-utl-grid-cols-8":n===9?"gs-utl-grid-cols-9":n===10?"gs-utl-grid-cols-10":n===11?"gs-utl-grid-cols-11":n===12?"gs-utl-grid-cols-12":t},vL=e=>!!(e&&!Array.isArray(e)&&typeof e=="object");async function yL(e){const t=e.map(({id:i,src:a})=>({id:i,src:a})),n=e.reduce((i,a)=>(i[a.id]=a,i),{}),s=[],r=[];return(await Mx(t)).forEach(i=>{i.status==="fulfilled"?s.push(n[i.value]):r.push(n[i.reason])}),{loaded:s,failed:r}}const xL=async e=>{const t=[...e],n={};if(t.length){const s={},r=[];if(t.forEach((o,i)=>{vL(o)&&(s[o.id]={index:i},r.push(o))}),r.length){const{loaded:o}=await yL(r);o.forEach(({id:i,options:a})=>{s[i].loaded=!0,n[i]=a||{}})}Object.keys(s).forEach(o=>{const i=s[o];i.loaded?t[i.index]=o:t[i.index]=!1})}return{plugins:t.filter(Boolean),pluginOptions:n}},wL=(e,t,n,s={})=>{const{skipReplace:r}=s;e.loadData(t);const o=e.getCss()||"",i=r?o:o.replace(/:root\s*{/gi,"[data-body]{");let a=`${e.getHtml()}<style>${i}</style>`;if(n===mt.email)try{a=e.runCommand(Dc).html}catch(c){console.error(c)}return s.removeScripts&&(a=a.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script[^>]*src=["'][^"']*["'][^>]*><\/script>/gi,"").replace(/<script[^>]*src=["'][^"']*["'][^>]*\/?>/gi,"")),r?a:a.replace("<body","<div data-body").replace("</body>","</div>")},SL=async(e,t,n)=>{const s=dx(t,{appStore:n}),r=await xL(s);return e==null?void 0:e.init({headless:!0,projectData:{},log:!1,undoManager:!1,noticeOnUnload:!1,storageManager:!1,plugins:[...r.plugins,o=>{o.Storage.setCurrent("")}],pluginsOpts:r.pluginOptions,protectedCss:`
369
315
  * { box-sizing: border-box; }
370
316
  [data-body] {
371
317
  margin: 0;
@@ -383,42 +329,42 @@ $2`),e=e.replace(/([^\s]);([^\s\}])/g,`$1;
383
329
  height: 0px;
384
330
  overflow: hidden;
385
331
  }
386
- `})};function fu({children:e,text:t,onConfirm:n,onCancel:s,className:r="w-[200px]",confirmButtonProps:o={},...i}){const a=Re();return c.jsx(ps,{...i,overlay:!0,title:!1,buttonAs:"span",handler:e,children:({close:l})=>c.jsxs(k,{className:ee(r),space:"m",col:!0,children:[c.jsx(D,{grow:!0,className:ee("text-center"),children:t||a.t("confirmAction")}),c.jsxs(k,{justify:"center",items:"center",gap:"m",nowrap:!0,children:[c.jsx(Ke,{variant:"pr",size:"m2",className:"gs-utl-whitespace-nowrap",onClick:()=>{l(),n==null||n()},...o,children:o.children||a.t("confirm")}),c.jsx(Ke,{size:"m2",className:"gs-utl-whitespace-nowrap",onClick:()=>{l(),s==null||s()},children:a.t("cancel")})]})]})})}const $m=new Map,km=new Map,vL=async({html:e="",el:t})=>{const n=e,s={};if(document.body.attachShadow){const r=t.shadowRoot||t.attachShadow({mode:"open"});r.innerHTML=n}return s},yL=fe(function({template:t,projectType:n,skipProjectNamePopover:s,className:r,onSelect:o,onRemove:i}){var E;const a=Re(),l=ye(),u=l.editor,[d,f]=h.useState(""),p=h.useRef(null),g=a.t("projectManager.projectName"),m=!t.isTemplate&&l.currentProjectId===((E=t.data.custom)==null?void 0:E.id),b=n===yt.web,v=!t.isTemplate||s,x=()=>{v&&(o==null||o({editor:u,template:t,loadTemplate:y}))},y=l.setProject,w=_=>{_.preventDefault(),o({editor:u,template:t,loadTemplate:y})};h.useEffect(()=>{const T=setTimeout(async()=>{if(!p.current||!u)return;const P=`${t.isTemplate?"t-":""}${t.id}`;let A=$m.get(P);if(!A){let R=km.get(n);if(!R){const F=new m7({appEditorStore:{sdkProps:{options:{licenseKey:""}}}});R=await bL(u.config.grapesjs,n,F.appEditorStore),km.set(n,R)}A=R?mL(R,t.data,n):"",$m.set(P,A)}const M=p.current;vL({el:M,html:A})});return()=>clearTimeout(T)},[p,u,n,t.data]);const{media:S,author:C}=t,j=c.jsx(Ke,{className:ue("text-sm"),size:"m2",variant:"pr",onClick:x,disabled:m,children:a.t("select")});return c.jsx(Xn,{padding:!1,className:ue("overflow-hidden max-w-full group",r),children:c.jsxs(k,{col:!0,children:[c.jsxs(D,{className:ue("relative group h-36 bg-checker max-w-full"),children:[c.jsx("div",{className:ue("gs-utl-relative","gs-utl-h-full","gs-utl-overflow-hidden","gs-utl-flex","gs-utl-justify-center"),children:S?c.jsx("img",{src:S,alt:t.name,className:ue("max-w-full")}):c.jsx("div",{className:ue("gs-utl-w-[1200px]","gs-utl-flex-shrink-0","gs-utl-flex-grow-0","gs-utl-origin-top","gs-utl-bg-white","gs-utl-scale-[0.232]","gs-utl-h-[431.034%]"),ref:p})}),m&&c.jsx(Rr,{className:ue("absolute top-2 right-2",z.bgA2),label:a.t("current"),s:"s",pill:!0}),c.jsx(k,{justify:"center",items:"center",className:ue(Ee.coverAbs,z.bgH75,"group-hover:gs-utl-opacity-100 opacity-0 transition-opacity"),children:v?j:c.jsx(ps,{overlay:!0,title:!1,buttonAs:"span",handler:j,children:()=>c.jsx("form",{onSubmit:w,children:c.jsxs(k,{space:"m",col:!0,children:[c.jsx(D,{children:c.jsx(tt,{size:"s",value:d,onChange:f,placeholder:g,required:!0})}),c.jsx(D,{children:c.jsx(Ke,{type:"submit",variant:"pr",size:"m2",full:!0,children:a.t("load")})})]})})})})]}),c.jsxs(k,{className:ue("gjs-p-2 max-w-full",re.bt,z.br),col:!0,space:"s",children:[c.jsxs(k,{className:ue("text-sm w-full"),space:"s",nowrap:!0,children:[c.jsx(D,{className:ue(Ee.txtEllips,"max-w-full"),grow:!0,children:t.name}),!!C&&c.jsxs(D,{children:["by"," ",c.jsx("a",{className:ue($r.link),href:C.link,rel:"noreferrer",target:"_blank",children:C.name})]})]}),c.jsxs(k,{items:"center",children:[b&&c.jsxs(D,{className:ue("gjs-mr-auto"),children:[a.t("projectManager.pages"),": ",t.data.pages.length]}),!t.isTemplate&&i&&c.jsx(D,{className:ue("gjs-ml-auto"),children:c.jsx(fu,{onConfirm:()=>i(t),className:"",children:c.jsx(bt,{title:a.t("delete"),children:c.jsx(oe,{icon:Z.delete,size:le.sx})})})})]})]})]})})}),Py=fe(function({templates:e,projectType:t,content:n,skipProjectNamePopover:s,onSelect:r,onRemove:o}){const[i]=Bp(),l=Re().tScoped("templates"),d=ye().editor,f=Qp(n==null?void 0:n.itemsPerRow),p=r??(({template:g,loadTemplate:m})=>m(g));return c.jsx(c.Fragment,{children:d&&e?e.length===0?c.jsx(k,{justify:"center",children:l("notFound")}):c.jsx(du,{data:e,listClassName:ue("grid gap-2 gjs-pr-2",f),itemContent:(g,m)=>c.jsx(yL,{template:m,projectType:t,onSelect:p,onRemove:o,skipProjectNamePopover:s},m.id)},i):c.jsx(Co,{})})}),xL=fe(function(){var b;const t=ye(),n=C0(),{filteredTemplates:s,projectSourceFilter:r,projectTypeFilter:o}=n,i=Re(),a=ji(),{sdkOptions:l}=t,u=i.tScoped("projectManager"),d=async({loadTemplate:v,template:x})=>{v(x),a.close()},f=async v=>{n.setProjectTypeFilter(v),await n.loadAllTemplates()},p=v=>{n.removeProject(v.id),n.loadProjects()},g=h.useMemo(()=>[{id:ma.Existing,label:u("existentProjects")},{id:ma.Templates,label:u("templates")}],[i]),m=((b=l.project)==null?void 0:b.types)&&Ff();return h.useEffect(()=>{n.loadAllTemplates()},[]),c.jsxs(k,{col:!0,full:!0,space:"m",children:[m&&c.jsx(k,{items:"center",space:"m",children:c.jsx(D,{className:ue("gjs-ml-auto"),children:c.jsx(_e,{value:o,onChange:f,options:wM(),handlerSelected:v=>c.jsxs(c.Fragment,{children:[c.jsx("b",{children:u("projectType")}),": ",v.label]})})})}),c.jsx(D,{children:c.jsx(Yr,{tabs:g,value:r,onChange:n.setProjectSourceFilter})}),c.jsx(D,{grow:!0,children:c.jsx(Py,{templates:s,projectType:yt[o],onSelect:d,onRemove:p,content:{itemsPerRow:3}})})]})}),wL=({items:e,editor:t,customItems:n})=>n===!1?[]:Ye(n)?n({items:e,editor:t}):n||e,Vm=e=>({icon:Z.plus,size:le.s,className:ee("gs-utl-transition-transform",e&&"gs-utl-rotate-45")}),_y=e=>!e.type||e.type==="button",SL="gs-cmp-topbar-left",CL=fe(function({buttons:t,className:n,style:s}){const r=ye(),o=Re(),{isOpen:i,toggleOpen:a}=zA(),l=r.editor,d=o.tScoped("blockManager")("blocks"),f=wL({items:[{id:`blocks-${d}`,tooltip:d,size:W0.s,icon:Vm(i),variant:U0.primary,editorEvents:{[Tn.toggleBlocksPanel]:({fromEvent:p,setState:g})=>{g({icon:Vm(p.isOpen)})}},onClick:()=>a()}],customItems:t,editor:l});return c.jsx(k,{gap:"s",items:"center",justify:"start",className:ee(SL,je.xS,n),style:s,nowrap:!0,children:f.map(({id:p,...g})=>_y(g)?c.jsx(su,{...g},p):Ot({id:p,...g}))})}),jL=[{id:Nr.auto,label:"Auto"},{id:Nr.dark,label:"Dark"},{id:Nr.light,label:"Light"}],EL={size:"s"},pd=".grapesjs",PL=(e,t)=>{const n=e==null?void 0:e.settingsMenu;return n!==!1&&(n==null?void 0:n[t])!==!1},_L=({actions:e,editor:t,buttons:n,sdkOptions:s})=>{const r=s.actions;return r===!1?[]:Ye(r)?r({actions:e,editor:t}):r||(n?Ye(n)?n({items:e,editor:t}):n:e)},TL="gs-cmp-topbar-right",OL=fe(function({editor:t,className:n,buttons:s,...r}){const o=ye(),{theme:i,setTheme:a}=Ds(),{Commands:l,UndoManager:u}=t,{installEvent:d,appInstalled:f,isBrowserMode:p,setInstallEvent:g,sdkOptions:m,isProjectTypeEmail:b}=o,v=ji(),x=Re(),y=M=>x.t(`actions.${M}`),w=t.Storage.events,S=l.events,C="change:changesCount",j=(M,R)=>()=>{Ye(M)?M({editor:t}):l.isActive(M)?l.stop(M):l.run(M,R)},E=M=>({[`${S.runCommand}${M}`]:({setState:R})=>R({active:!0}),[`${S.stopCommand}${M}`]:({setState:R})=>R({active:!1})}),_=[{id:ts.componentOutline,icon:Z.borderRadius,tooltip:y("componentOutline.title"),onClick:j("core:component-outline"),editorEvents:E("core:component-outline")},{id:ts.preview,icon:Z.eye,tooltip:y("preview.title"),onClick:j("core:preview"),editorEvents:E("core:preview")},{id:ts.fullscreen,icon:Z.arrowExpandAll,tooltip:y("fullscreen.title"),onClick:j("core:fullscreen",{target:"body"}),editorEvents:E("core:fullscreen")},{id:ts.showCode,icon:Z.xml,tooltip:y("showCode.title"),onClick:()=>t.runCommand(ie.dialogExportCode)},{id:ts.showImportCode,icon:Z.trayArrowDown,tooltip:y("importCode.title"),onClick:()=>v.open({title:y("importCode.title"),content:()=>c.jsx(K0,{})})},{id:ts.clearCanvas,icon:Z.delete,tooltip:y("clearCanvas.title"),onClick:()=>v.confirm({title:y("clearCanvas.title"),content:y("clearCanvas.content"),confirmButton:{variant:"danger",children:y("clearCanvas.title")},onConfirm:()=>{b?t.loadProjectData({pages:[{component:"<mjml><mj-body></mj-body></mjml>"}]}):t.Components.clear()}})},{id:ts.store,tooltip:y("store.title"),onClick:async()=>!o.isSaving&&t.store(),editorEvents:{"change:changesCount":({setState:M})=>M({}),[w.startStore]:({setState:M})=>M({disabled:!0}),[w.endStore]:({setState:M})=>M({disabled:!1})},label:()=>c.jsxs("div",{className:ee("relative"),children:[c.jsx(oe,{icon:Z.floppy,size:le.s}),!!t.getDirtyCount()&&!o.isSaving&&c.jsx("div",{className:ee("absolute right-0 gjs-p-0.5 bottom-0 gjs-rounded-full",z.bg),children:c.jsx("div",{className:ee(Ee.dot,z.bgW)})}),o.isSaving&&c.jsx("div",{className:ee("absolute right-0 bottom-0 gjs-rounded-full",z.bg),children:c.jsx(oe,{icon:Z.refresh,size:"11px",className:ee(Ee.spin)})})]})},{id:ts.undo,icon:Z.arrowULeftTop,disabled:!0,onClick:j("core:undo"),editorEvents:{[C]:({setState:M})=>M({disabled:!u.hasUndo()})}},{id:ts.redo,icon:Z.arrowURightTop,disabled:!0,onClick:j("core:redo"),editorEvents:{[C]:({setState:M})=>M({disabled:!u.hasRedo()})}}],T=_L({actions:_,sdkOptions:m,editor:t,buttons:s}),P=[{id:"about",label:y("about.title"),icon:Z.helpCircle,action:()=>v.open({size:"m",title:y("about.title"),content:()=>c.jsx(yM,{})})},{id:"embed",label:y("embed.title"),icon:Z.powerPlug,action:()=>v.open({size:"m",title:y("embed.title"),content:()=>c.jsx(xM,{})})},{id:"openProject",label:y("open.title"),icon:Z.folder,action:async()=>{let M="";try{M=await(await nM({extensions:[pd]})).text()}catch(R){return console.error(R)}o.loadProjectData(JSON.parse(M))}},{id:"saveProject",label:y("save.title"),icon:Z.contentSave,action:async()=>{const M=t.getProjectData(),R=new Blob([JSON.stringify(M)]),F=`Untitled-${new Date().toISOString().replace("T","-").replace(/:|\./g,"").substring(0,17)}`;try{await rM(R,{fileName:`${F}${pd}`,extensions:[pd]})}catch(L){return console.error(L)}}},{id:"loadProject",label:y("newProject.title"),icon:Z.newspaperVariantOutline,action:()=>v.open({fullH:!0,title:y("newProject.title"),content:()=>c.jsx(xL,{})})},{id:"installApp",label:y(f?"installApp.installed":"installApp.title"),icon:Z.applicationBracketsOutline,action:async()=>{if(f)return;d==null||d.prompt();const M=await(d==null?void 0:d.userChoice);(M==null?void 0:M.outcome)==="accepted"&&g()}},...m.customTheme?[]:[{id:"theme",label:c.jsxs(k,{items:"center",space:"m",children:[c.jsx(D,{children:"Theme"}),c.jsx(D,{children:c.jsx(Yr,{tabs:jL,onChange:M=>a(M),value:i,variant:"pills"})})]})}]].filter(({id:M})=>!((!p||!d)&&M==="installApp"||!PL(m,M))),A=(M,R)=>F=>{Ye(M)&&(M(F),R())};return c.jsxs(k,{space:"s",items:"center",justify:"end",className:ee(TL,je.xS,n),nowrap:!0,...r,children:[T.map(({id:M,...R})=>_y(R)?c.jsx(su,{size:"s",...R},M):Ot({id:M,...R})),c.jsx(D,{children:m.settingsMenu!==!1&&P.length>0&&c.jsx(ps,{placement:"bottom-end",title:!1,padding:!1,handler:c.jsx(oe,{icon:Z.cog,size:le.s}),buttonProps:EL,overlay:!0,children:({close:M})=>c.jsx(c.Fragment,{children:P.map(R=>c.jsx(_i,{action:A(R.action,M),icon:R.icon,label:R.label},R.id))})})})]})});function AL({devices:e,selected:t,className:n,style:s,select:r}){const o=e.map(i=>({id:i.id,label:i.getName(),icon:i.attributes.icon}));return o.length?c.jsx(_e,{size:"xs",className:n,style:s,value:t,options:o,onChange:r}):null}const NL="gs-devices",Ty=h.memo(function({className:t,style:n}){return c.jsx(V4,{children:s=>c.jsx(AL,{className:N(NL,t),style:n,...s})})}),Hi="gs-cmp-editor-topbar",ML=fe(function({className:t,height:n,style:s,children:r,leftContainer:o,rightContainer:i,devices:a}){const{topBarSize:l,isInPreview:u,editor:d,isTopSidebarOpen:f}=ye(),p=n??l,g=h.useMemo(()=>({...s,minHeight:p,marginTop:u||!f?`-${p}px`:0}),[u,f,s]);return c.jsxs(c.Fragment,{children:[c.jsx(D,{className:N(Hi,"gs-utl-transition-spacing gs-utl-w-full",re.bb,z.br,t),style:g,children:r??c.jsxs(k,{className:N(`${Hi}__wrp`,"gs-utl-h-full"),items:"center",full:!0,nowrap:!0,children:[c.jsx(D,{className:N(`${Hi}__wrp-left`),grow:!0,children:o!==!1&&c.jsx(CL,{...o})}),c.jsx(D,{className:N(`${Hi}__wrp-center`),children:a!==!1&&c.jsx(Ty,{...a})}),c.jsx(D,{className:N(`${Hi}__wrp-right`),grow:!0,children:i!==!1&&d&&c.jsx(OL,{editor:d,...i})})]})}),c.jsx(D,{className:N("gs-utl-transition-transform gs-utl-absolute gs-utl-top-0 gs-utl-left-0 gs-utl-z-10",!u&&"-gs-utl-translate-y-full"),children:c.jsx(Ke,{className:N("gs-cmp-close-preview gs-utl-m-4",z.bg),size:"s",onClick:()=>d==null?void 0:d.Commands.stop("core:preview"),children:c.jsx(oe,{icon:Z.eyeOff,size:le.s})})})]})}),LL="gs-sidebar-top",Oy=h.memo(fe(function({height:t,children:n,...s}){return c.jsx(ML,{height:t,...s,style:ou(s),className:N(LL,"gs-utl-flex",ru(s)),children:n?Ot(n):void 0})})),RL="gs-canvas-sidebar-top",$L=h.memo(fe(function({className:t,sidebarTop:n,...s}){return c.jsxs(mn,{className:N(RL,"gs-utl-flex gs-utl-flex-col",t),grow:!0,...s,children:[c.jsx(Oy,{...n}),c.jsx(cy,{grow:!0})]})})),kL="gs-code-field",VL=fe(function(e){const{editor:t}=ye(),{isDarkTheme:n}=Ds(),{editorEvents:s,onChange:r}=e,[o,i]=h.useState(()=>e),a=u=>({value:u,editor:t,state:o,setState:d=>i(f=>({...f,...d}))}),l=u=>r==null?void 0:r(a(u||""));return Jr({editor:t,editorEvents:s,localState:o,setLocalState:i}),c.jsx(ir,{className:N(kL,o.className),language:o.language,style:o.style,label:o.label,name:o.name,defaultValue:o.value,size:o.size,required:o.required,disabled:o.disabled,readOnly:o.readOnly,minHeight:o.minHeight,row:o.row,isDarkTheme:n,monacoOptions:e.monacoOptions,onChange:l})});var IL={grad:.9,turn:360,rad:360/(2*Math.PI)},Gs=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Vt=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Un=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Ay=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Im=function(e){return{r:Un(e.r,0,255),g:Un(e.g,0,255),b:Un(e.b,0,255),a:Un(e.a)}},hd=function(e){return{r:Vt(e.r),g:Vt(e.g),b:Vt(e.b),a:Vt(e.a,3)}},DL=/^#([0-9a-f]{3,8})$/i,_l=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ny=function(e){var t=e.r,n=e.g,s=e.b,r=e.a,o=Math.max(t,n,s),i=o-Math.min(t,n,s),a=i?o===t?(n-s)/i:o===n?2+(s-t)/i:4+(t-n)/i:0;return{h:60*(a<0?a+6:a),s:o?i/o*100:0,v:o/255*100,a:r}},My=function(e){var t=e.h,n=e.s,s=e.v,r=e.a;t=t/360*6,n/=100,s/=100;var o=Math.floor(t),i=s*(1-n),a=s*(1-(t-o)*n),l=s*(1-(1-t+o)*n),u=o%6;return{r:255*[s,a,i,i,l,s][u],g:255*[l,s,s,a,i,i][u],b:255*[i,i,l,s,s,a][u],a:r}},Dm=function(e){return{h:Ay(e.h),s:Un(e.s,0,100),l:Un(e.l,0,100),a:Un(e.a)}},Hm=function(e){return{h:Vt(e.h),s:Vt(e.s),l:Vt(e.l),a:Vt(e.a,3)}},Fm=function(e){return My((n=(t=e).s,{h:t.h,s:(n*=((s=t.l)<50?s:100-s)/100)>0?2*n/(s+n)*100:0,v:s+n,a:t.a}));var t,n,s},ra=function(e){return{h:(t=Ny(e)).h,s:(r=(200-(n=t.s))*(s=t.v)/100)>0&&r<200?n*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,s,r},HL=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,FL=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,BL=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zL=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wf={string:[[function(e){var t=DL.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Vt(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Vt(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=BL.exec(e)||zL.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Im({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=HL.exec(e)||FL.exec(e);if(!t)return null;var n,s,r=Dm({h:(n=t[1],s=t[2],s===void 0&&(s="deg"),Number(n)*(IL[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Fm(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,s=e.b,r=e.a,o=r===void 0?1:r;return Gs(t)&&Gs(n)&&Gs(s)?Im({r:Number(t),g:Number(n),b:Number(s),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,n=e.s,s=e.l,r=e.a,o=r===void 0?1:r;if(!Gs(t)||!Gs(n)||!Gs(s))return null;var i=Dm({h:Number(t),s:Number(n),l:Number(s),a:Number(o)});return Fm(i)},"hsl"],[function(e){var t=e.h,n=e.s,s=e.v,r=e.a,o=r===void 0?1:r;if(!Gs(t)||!Gs(n)||!Gs(s))return null;var i=function(a){return{h:Ay(a.h),s:Un(a.s,0,100),v:Un(a.v,0,100),a:Un(a.a)}}({h:Number(t),s:Number(n),v:Number(s),a:Number(o)});return My(i)},"hsv"]]},Bm=function(e,t){for(var n=0;n<t.length;n++){var s=t[n][0](e);if(s)return[s,t[n][1]]}return[null,void 0]},UL=function(e){return typeof e=="string"?Bm(e.trim(),wf.string):typeof e=="object"&&e!==null?Bm(e,wf.object):[null,void 0]},gd=function(e,t){var n=ra(e);return{h:n.h,s:Un(n.s+100*t,0,100),l:n.l,a:n.a}},md=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},zm=function(e,t){var n=ra(e);return{h:n.h,s:n.s,l:Un(n.l+100*t,0,100),a:n.a}},Sf=function(){function e(t){this.parsed=UL(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Vt(md(this.rgba),2)},e.prototype.isDark=function(){return md(this.rgba)<.5},e.prototype.isLight=function(){return md(this.rgba)>=.5},e.prototype.toHex=function(){return t=hd(this.rgba),n=t.r,s=t.g,r=t.b,i=(o=t.a)<1?_l(Vt(255*o)):"","#"+_l(n)+_l(s)+_l(r)+i;var t,n,s,r,o,i},e.prototype.toRgb=function(){return hd(this.rgba)},e.prototype.toRgbString=function(){return t=hd(this.rgba),n=t.r,s=t.g,r=t.b,(o=t.a)<1?"rgba("+n+", "+s+", "+r+", "+o+")":"rgb("+n+", "+s+", "+r+")";var t,n,s,r,o},e.prototype.toHsl=function(){return Hm(ra(this.rgba))},e.prototype.toHslString=function(){return t=Hm(ra(this.rgba)),n=t.h,s=t.s,r=t.l,(o=t.a)<1?"hsla("+n+", "+s+"%, "+r+"%, "+o+")":"hsl("+n+", "+s+"%, "+r+"%)";var t,n,s,r,o},e.prototype.toHsv=function(){return t=Ny(this.rgba),{h:Vt(t.h),s:Vt(t.s),v:Vt(t.v),a:Vt(t.a,3)};var t},e.prototype.invert=function(){return vs({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),vs(gd(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),vs(gd(this.rgba,-t))},e.prototype.grayscale=function(){return vs(gd(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),vs(zm(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),vs(zm(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?vs({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):Vt(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=ra(this.rgba);return typeof t=="number"?vs({h:t,s:n.s,l:n.l,a:n.a}):Vt(n.h)},e.prototype.isEqual=function(t){return this.toHex()===vs(t).toHex()},e}(),vs=function(e){return e instanceof Sf?e:new Sf(e)},Um=[],WL=function(e){e.forEach(function(t){Um.indexOf(t)<0&&(t(Sf,wf),Um.push(t))})};function GL(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in n)s[n[r]]=r;var o={};e.prototype.toName=function(i){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,u=s[this.toHex()];if(u)return u;if(i!=null&&i.closest){var d=this.toRgb(),f=1/0,p="black";if(!o.length)for(var g in n)o[g]=new e(n[g]).toRgb();for(var m in n){var b=(a=d,l=o[m],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));b<f&&(f=b,p=m)}return p}},t.string.push([function(i){var a=i.toLowerCase(),l=a==="transparent"?"#0000":n[a];return l?new e(l).toRgb():null},"name"])}function pu(){return(pu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}function Ly(e,t){if(e==null)return{};var n,s,r={},o=Object.keys(e);for(s=0;s<o.length;s++)t.indexOf(n=o[s])>=0||(r[n]=e[n]);return r}function Cf(e){var t=h.useRef(e),n=h.useRef(function(s){t.current&&t.current(s)});return t.current=e,n.current}var xi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},oa=function(e){return"touches"in e},jf=function(e){return e&&e.ownerDocument.defaultView||self},Wm=function(e,t,n){var s=e.getBoundingClientRect(),r=oa(t)?function(o,i){for(var a=0;a<o.length;a++)if(o[a].identifier===i)return o[a];return o[0]}(t.touches,n):t;return{left:xi((r.pageX-(s.left+jf(e).pageXOffset))/s.width),top:xi((r.pageY-(s.top+jf(e).pageYOffset))/s.height)}},Gm=function(e){!oa(e)&&e.preventDefault()},eh=h.memo(function(e){var t=e.onMove,n=e.onKey,s=Ly(e,["onMove","onKey"]),r=h.useRef(null),o=Cf(t),i=Cf(n),a=h.useRef(null),l=h.useRef(!1),u=h.useMemo(function(){var g=function(v){Gm(v),(oa(v)?v.touches.length>0:v.buttons>0)&&r.current?o(Wm(r.current,v,a.current)):b(!1)},m=function(){return b(!1)};function b(v){var x=l.current,y=jf(r.current),w=v?y.addEventListener:y.removeEventListener;w(x?"touchmove":"mousemove",g),w(x?"touchend":"mouseup",m)}return[function(v){var x=v.nativeEvent,y=r.current;if(y&&(Gm(x),!function(S,C){return C&&!oa(S)}(x,l.current)&&y)){if(oa(x)){l.current=!0;var w=x.changedTouches||[];w.length&&(a.current=w[0].identifier)}y.focus(),o(Wm(y,x,a.current)),b(!0)}},function(v){var x=v.which||v.keyCode;x<37||x>40||(v.preventDefault(),i({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},b]},[i,o]),d=u[0],f=u[1],p=u[2];return h.useEffect(function(){return p},[p]),h.createElement("div",pu({},s,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:r,onKeyDown:f,tabIndex:0,role:"slider"}))}),hu=function(e){return e.filter(Boolean).join(" ")},th=function(e){var t=e.color,n=e.left,s=e.top,r=s===void 0?.5:s,o=hu(["react-colorful__pointer",e.className]);return h.createElement("div",{className:o,style:{top:100*r+"%",left:100*n+"%"}},h.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},rn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Ry=function(e){var t=e.s,n=e.v,s=e.a,r=(200-t)*n/100;return{h:rn(e.h),s:rn(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:rn(r/2),a:rn(s,2)}},Ef=function(e){var t=Ry(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},bd=function(e){var t=Ry(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},qL=function(e){var t=e.h,n=e.s,s=e.v,r=e.a;t=t/360*6,n/=100,s/=100;var o=Math.floor(t),i=s*(1-n),a=s*(1-(t-o)*n),l=s*(1-(1-t+o)*n),u=o%6;return{r:rn(255*[s,a,i,i,l,s][u]),g:rn(255*[l,s,s,a,i,i][u]),b:rn(255*[i,i,l,s,s,a][u]),a:rn(r,2)}},KL=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?YL({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},YL=function(e){var t=e.r,n=e.g,s=e.b,r=e.a,o=Math.max(t,n,s),i=o-Math.min(t,n,s),a=i?o===t?(n-s)/i:o===n?2+(s-t)/i:4+(t-n)/i:0;return{h:rn(60*(a<0?a+6:a)),s:rn(o?i/o*100:0),v:rn(o/255*100),a:r}},ZL=h.memo(function(e){var t=e.hue,n=e.onChange,s=hu(["react-colorful__hue",e.className]);return h.createElement("div",{className:s},h.createElement(eh,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:xi(t+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":rn(t),"aria-valuemax":"360","aria-valuemin":"0"},h.createElement(th,{className:"react-colorful__hue-pointer",left:t/360,color:Ef({h:t,s:100,v:100,a:1})})))}),XL=h.memo(function(e){var t=e.hsva,n=e.onChange,s={backgroundColor:Ef({h:t.h,s:100,v:100,a:1})};return h.createElement("div",{className:"react-colorful__saturation",style:s},h.createElement(eh,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:xi(t.s+100*r.left,0,100),v:xi(t.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+rn(t.s)+"%, Brightness "+rn(t.v)+"%"},h.createElement(th,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ef(t)})))}),JL=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},QL=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function eR(e,t,n){var s=Cf(n),r=h.useState(function(){return e.toHsva(t)}),o=r[0],i=r[1],a=h.useRef({color:t,hsva:o});h.useEffect(function(){if(!e.equal(t,a.current.color)){var u=e.toHsva(t);a.current={hsva:u,color:t},i(u)}},[t,e]),h.useEffect(function(){var u;JL(o,a.current.hsva)||e.equal(u=e.fromHsva(o),a.current.color)||(a.current={hsva:o,color:u},s(u))},[o,e,s]);var l=h.useCallback(function(u){i(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var tR=typeof window<"u"?h.useLayoutEffect:h.useEffect,nR=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},qm=new Map,sR=function(e){tR(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!qm.has(t)){var n=t.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}`,qm.set(t,n);var s=nR();s&&n.setAttribute("nonce",s),t.head.appendChild(n)}},[])},rR=function(e){var t=e.className,n=e.hsva,s=e.onChange,r={backgroundImage:"linear-gradient(90deg, "+bd(Object.assign({},n,{a:0}))+", "+bd(Object.assign({},n,{a:1}))+")"},o=hu(["react-colorful__alpha",t]),i=rn(100*n.a);return h.createElement("div",{className:o},h.createElement("div",{className:"react-colorful__alpha-gradient",style:r}),h.createElement(eh,{onMove:function(a){s({a:a.left})},onKey:function(a){s({a:xi(n.a+a.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},h.createElement(th,{className:"react-colorful__alpha-pointer",left:n.a,color:bd(n)})))},oR=function(e){var t=e.className,n=e.colorModel,s=e.color,r=s===void 0?n.defaultColor:s,o=e.onChange,i=Ly(e,["className","colorModel","color","onChange"]),a=h.useRef(null);sR(a);var l=eR(n,r,o),u=l[0],d=l[1],f=hu(["react-colorful",t]);return h.createElement("div",pu({},i,{ref:a,className:f}),h.createElement(XL,{hsva:u,onChange:d}),h.createElement(ZL,{hue:u.h,onChange:d}),h.createElement(rR,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},iR={defaultColor:"rgba(0, 0, 0, 1)",toHsva:KL,fromHsva:function(e){var t=qL(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:QL},aR=function(e){return h.createElement(oR,pu({},e,{colorModel:iR}))};WL([GL]);const lR=e=>e.startsWith("rgba")?e:vs(e).toRgbString();function $y({value:e,onChange:t,disabled:n}){const s=lR(e||""),r=h.useRef(s),[o,i]=h.useState(!1),a=Vs()&&!!window.EyeDropper,l=g=>{r.current=g,t==null||t(g)},u=g=>{r.current=g,t==null||t(g,!0)},d=()=>{a&&new window.EyeDropper().open().then(m=>l(m.sRGBHex)).catch(console.warn)},f=()=>{i(!0)},p=()=>{t==null||t(r.current,!1),i(!1)};return c.jsxs(c.Fragment,{children:[o&&c.jsx("div",{onPointerUp:p,className:"gs-utl-fixed gs-utl-inset-0 gs-utl-z-50 gs-utl-cursor-grabbing"}),c.jsx(aR,{className:"color-picker",color:s,onChange:u,onPointerDown:f,onPointerUp:p}),c.jsxs(k,{className:"gs-utl-mt-3",gap:"s",children:[c.jsx(D,{grow:!0,children:c.jsx(tt,{size:"s",value:s,onChange:l,disabled:n})}),a&&c.jsx(Ke,{type:"button",onClick:d,children:c.jsx(oe,{icon:Z.eyedropperVariant,size:le.s})})]})]})}const cR="gs-cmp-studio-color-picker",uR=h.memo(fe(function({className:t,style:n,value:s="",disabled:r,onChange:o,editorEvents:i}){const{editor:a}=ye(),[l,u]=h.useState(()=>({className:t,style:n,value:s,disabled:r})),d=(f,p)=>{const g=f||"";o==null||o({value:g,partial:p,editor:a,state:l,setState:m=>u(b=>({...b,...m}))})};return Jr({editor:a,editorEvents:i,localState:l,setLocalState:u}),c.jsx("div",{className:N(cR,l.className,je.m),style:l.style,children:c.jsx($y,{value:l.value||"",onChange:d,disabled:l.disabled})})})),dR="gs-cmp-column",fR=h.memo(function({className:t,children:n,full:s,...r}){return c.jsx(mn,{className:N(dR,z.bg,"gs-utl-flex gs-utl-flex-col",s&&"gs-utl-h-full",t),...r,children:Ot(n)})}),nh=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
387
- <path fill="currentColor" d="M20 6c0-2.168-3.663-4-8-4S4 3.832 4 6v2c0 2.168 3.663 4 8 4s8-1.832 8-4zm-8 13c-4.337 0-8-1.832-8-4v3c0 2.168 3.663 4 8 4s8-1.832 8-4v-3c0 2.168-3.663 4-8 4"/><path fill="currentColor" d="M20 10c0 2.168-3.663 4-8 4s-8-1.832-8-4v3c0 2.168 3.663 4 8 4s8-1.832 8-4z"/></svg>`,co="--before-content",sh={select:!0,activate:!0,category:{id:"data-sources",label:"Data Sources"}},ky={stylable:!1,traits:[]};function pR(e){return typeof e=="object"&&e.type===Dt.variable}function Km(e){if(pR(e)){const{path:t}=e;return Vy(t||"")}return e}function Vy(e){return`{{ ${e} }}`}function hR(e){const t={};return e.DataSources.getAll().forEach(n=>{const s=n.get("id");if(!s)return;const r=n.getRecords();if(!r){t[s]={};return}t[s]=r.reduce((o,i)=>{if(!i)return o;let a={...i.attributes};return delete a.__p,delete a.id,s===ko.globalStyles&&(a={value:a.value}),{...o,[i.id]:a}},{})}),t}function Iy(e){return Object.entries(e||{}).map(([t,n])=>({id:t,data:n}))}const rh=e=>{var o,i;const{isProjectTypeEmail:t,sdkOptions:n}=e;return((i=(o=n.dataSources)==null?void 0:o.exportConfig)==null?void 0:i.skipTags)??t?{...ky}:{}},Pf=e=>{var o,i;const{isProjectTypeEmail:t,sdkOptions:n}=e,s=(i=(o=n.dataSources)==null?void 0:o.exportConfig)==null?void 0:i.skipTags;return t||s===!0?{...ky}:{}},gR=e=>!!e&&typeof e=="object"&&"logicalOperator"in e,mR=e=>Array.isArray(e)?"array":e===null?"default":typeof e,bR=fe(({name:e,value:t,isActive:n,isCollection:s,onClick:r,className:o})=>{const i=Re().tScoped("dataSources"),a=typeof t=="object"&&t!==null,l={array:Z.codeBrackets,object:Z.codeBraces,string:Z.codeString,number:Z.number,boolean:Z.toggleSwitchOffOutline,default:Z.null},u=mR(t),d=N(o,"gs-utl-text-left",z.hBgH,re.b,re.rnd,je.xy,n?[re.bA,z.tA]:[z.br,z.txtHighEmphasisH]),f=p=>typeof p=="object"?Array.isArray(p)?i("items",{params:{length:p.length}}):p?i("properties",{params:{length:Object.keys(p).length}}):"null":String(p);return c.jsx(Ke,{onClick:r,border:!1,className:d,full:!0,children:c.jsxs(k,{items:"center",justify:"between",gap:"s",nowrap:!0,children:[c.jsxs(k,{className:"gs-utl-flex-grow gs-utl-overflow-hidden",gap:"s",col:!0,children:[c.jsxs(k,{className:"gs-utl-overflow-hidden",items:"center",gap:"s",full:!0,nowrap:!0,children:[c.jsx(oe,{icon:l[u],size:le.s}),c.jsx(D,{className:N(Ee.txtEllips,s&&"gs-utl-font-bold"),children:e})]}),c.jsx(D,{className:N("gs-utl-w-full",Ee.txtEllips,Ee.disabled),children:f(t)})]}),a&&c.jsx(D,{children:c.jsx(oe,{size:le.sx,icon:Z.arrowRight,className:N(n&&"gs-utl-rotate-180","gs-utl-transition-transform gs-utl-duration-200")})})]})})}),vR="gs-cmp-data-path-explorer",Ym=fe(function({additionalSources:t,onChange:n,path:s=""}){const{editor:r}=ye(),o=h.useRef({}),[i,a]=h.useState(()=>s.split(".")),[l,u]=h.useState([]),d=h.useMemo(()=>({...r?hR(r):{},...t}),[r,t]),f=(b,v)=>{let x=o.current;for(let y=0;y<v&&y<b.length;y++){const w=b[y];if(x&&typeof x=="object"&&w in x)x=x[w];else{x=void 0;break}}return!x||typeof x!="object"?[]:Object.entries(x).map(([y,w])=>{const S=b.slice(0,v).concat(y),C=i[v]===y,j=v===0&&ur(w)&&w.collectionId===y,E=()=>{const _=C?S.slice(0,-1):S;n==null||n(_.join("."),{paths:_}),a(_)};return c.jsx(bR,{className:N(j&&"-gs-utl-order-1"),isCollection:j,name:y,value:w,isActive:C,onClick:E},y)})};h.useEffect(()=>{o.current=d;const b=[];for(let v=0;v<=i.length;v++){const x=f(i,v);x.length>0&&b.push(x)}u(b)},[d,i]);const p=N(vR,z.bg,z.br,re.b,re.rnd,Ee.scrollX,"gs-utl-h-full"),g=N("gs-utl-min-w-[220px]",z.br),m=N("gs-utl-h-full gs-utl-max-h-[60vh]",Ee.scrollY,je.xyS);return c.jsx(k,{className:p,full:!0,nowrap:!0,children:l.map((b,v)=>c.jsx(D,{className:N(g,v!==l.length-1&&re.br),children:c.jsx(k,{col:!0,nowrap:!0,gap:"m",className:m,children:b})},v))})});function Dy(e){const{collectionId:t,variableType:n,path:s=""}=e;return t?[t,n,s].filter(Boolean).join("."):s}function oh(e,t){const[n="",s="",...r]=e.split(".");return n&&t[n]?{collectionId:n,variableType:s,path:r.join(".")}:{path:e,collectionId:void 0,variableType:void 0}}const yR=e=>{const{path:t,collectionId:n,variableType:s}=e.dataResolver||{};return n?[n,s,t].filter(Boolean).join("."):e.value||t||""},xR=e=>{const{dataResolver:t,editor:n,value:s,defaultValue:r,additionalSources:o}=e,{path:i="",collectionId:a,variableType:l}=t||{},u=n==null?void 0:n.DataSources;if(a){const d=o==null?void 0:o[a],f=l&&d?d[l]:d;return(u==null?void 0:u.getValue(i,r,{context:f}))||""}else return(u==null?void 0:u.getValue(s,r))||""},wR="gs-cmp-data-path-field",el=fe(e=>{const{size:t="m",value:n="",label:s,open:r,defaultValue:o,additionalSources:i,dataResolver:a,readOnly:l,disabled:u,pickerInPopover:d,onChange:f,onPickerToggle:p}=e,{editor:g}=ye(),m=Re().tScoped("dataSources"),[b,v]=h.useState(!!r),[x,y]=h.useState(!1),w=!!l||b||x,S=()=>y(!x),C=H=>{const $=H??!b;v($),p==null||p($)},j=()=>C(!1),E=(...H)=>{f==null||f(...H)},_=H=>{w||f==null||f(H,{paths:H.split(".")})},T=yR({dataResolver:a,value:n}),P=x&&g?`"${xR({editor:g,dataResolver:a,additionalSources:i,value:n,defaultValue:o})}"`:T,A=t==="m",M=A?"lg":t,R=A?le.l:le.s,F=m(b?"closePathExplorer":"openPathExplorer"),L={icon:b?Z.close:Z.databaseOutline,size:le.l},B={icon:x?Z.eyeOff:Z.eye,size:A?le.m:R},q=c.jsx(bt,{block:!0,variant:"pr",size:M,title:F,onClick:()=>C(),icon:L});return c.jsxs(k,{className:wR,gap:t,col:!0,children:[c.jsxs(k,{gap:t,items:"end",nowrap:!0,children:[c.jsx(tt,{readOnly:w,label:s,value:x?P:T,size:t,disabled:u,onChange:_,placeholder:m("selectVariablePath"),className:N("gs-utl-flex-grow",z.txt,Ee.txtEllips),afterInput:!!n&&c.jsx(bt,{block:!0,variant:"out-clear",size:"xs",border:!1,title:m("toggleResolvedPath"),onClick:S,className:Ee.hover,icon:B})}),d?c.jsx(ps,{placement:"bottom-end",classNameBody:"gs-utl-w-[400px] gs-utl-h-[300px]",title:!1,padding:!1,border:!1,buttonAs:"span",handler:q,onClose:j,overlay:!0,children:c.jsx(Ym,{path:T,onChange:E,additionalSources:i})}):q]}),!!b&&!d&&c.jsx(Ym,{path:T,onChange:E,additionalSources:i})]})}),SR=e=>{const t=parseFloat(e),n=e.replace(`${t}`,"").trim();return{number:t||t===0?`${t}`:"",unit:n}},Hy=({value:e,step:t})=>{const n=parseFloat(`${e}`);let s=0;if(Math.floor(n)!==n&&t){const r=`${t}`.split(".")[1];s=(r==null?void 0:r.length)||0}return s?parseFloat(n.toFixed(s)):n},CR=({value:e,key:t,shiftKey:n,min:s,max:r,step:o=1})=>{const i=t==="ArrowUp",a=t==="ArrowDown";let l=null;if(i||a){l=Number(e);const u=parseFloat(`${o}`);i&&(l+=(n?10:1)*u),a&&(l-=(n?10:1)*u),l=`${gu({min:s,max:r,value:l})}`,l=Hy({value:l,step:o})}return l},gu=({min:e,max:t,value:n})=>{const s=parseFloat(`${n}`);let r=s||0;return Lt(e)&&(r=Math.max(r,parseFloat(`${e}`)||0)),Lt(t)&&(r=Math.min(r,parseFloat(`${t}`)||0)),`${`${s}`!=`${n}`?n:r}`},jR=(e,t,n,s={})=>{const r=parseInt(`${e}`,10)||0,{min:o,max:i,step:a=1}=s;let l=r;const u=f=>{const p=f.clientY-t,g=r-p*parseFloat(`${a}`);l=Hy({value:gu({min:o,max:i,value:g}),step:a}),n(l,!0)},d=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),n(l)};window.addEventListener("mousemove",u),window.addEventListener("mouseup",d)},ER=(e,t,n={})=>{const{partial:s}=n,r=(o,i)=>o===i||s&&o.startsWith(i);return t.some(o=>r(typeof o=="string"?o:o.id,e))},Zm=e=>Lt(e)?e:"",PR="gs-cmp-number-field";function Ne(e){const{className:t,value:n,units:s,valueUnit:r,size:o="m",pan:i=!0,min:a,max:l,step:u,placeholder:d,disabled:f,onChange:p,onChangeUnit:g}=e,[m,b]=h.useState(Zm(n)),[v,x]=h.useState(!1),y=(s==null?void 0:s.map(T=>({id:T,label:T})))||[],w={min:a,max:l,step:u};h.useEffect(()=>{b(Zm(n))},[n,r]);const S=(T,P)=>{p==null||p(gu({min:a,max:l,value:T}),P)},C=T=>{if(f)return;x(!0);const P=(A,M)=>{S(A,!!M),!M&&x(!1)};jR(m,T.clientY,P,w)},j=T=>{const{key:P,shiftKey:A}=T;switch(P){case"Escape":return b(n);case"Enter":return S(m)}const M=CR({step:u,value:n,key:P,shiftKey:A});M!==null&&(T.preventDefault(),S(M))},E=()=>{S(m)},_=qr({...e,className:N(PR,t)});return c.jsxs("div",{..._,children:[v&&c.jsx("div",{className:N("gs-utl-fixed gs-utl-inset-0 gs-utl-z-50 gs-utl-cursor-ns")}),c.jsx(fs,{as:e.labelAs,...e}),c.jsxs(k,{className:Gp(e),items:"center",space:"x2s",children:[!!i&&c.jsx(D,{onMouseDown:C,className:N("gs-utl-opacity-50 gs-utl-cursor-ns",o==="m"&&"-gs-utl-ml-3",o==="s"&&"-gs-utl-ml-2",i!==!0&&"gs-utl-mr-0.5 -gs-utl-ml-1"),children:i===!0?c.jsx(oe,{icon:Z.panVertical,size:le.s2x}):i}),c.jsx(D,{grow:!0,children:c.jsx("input",{className:Xa(e),value:m,disabled:f,onChange:T=>b(T.target.value),placeholder:d,onBlur:E,onKeyDown:j})}),!!y.length&&c.jsx(D,{className:N(y.length===1&&"gs-utl-opacity-50 gs-utl-pointer-events-none"),children:c.jsx(_e,{caret:"",size:"x2s",pos:"right",width:"75px",emptyState:"-",border:!1,value:r,disabled:f,onChange:T=>g==null?void 0:g(T),options:y})})]})]})}const _R="gs-cmp-switch-field";function wa(e){const{className:t,value:n,label:s,labelAs:r,border:o,disabled:i,onChange:a}=e,l=!!n,u=N("gs-utl-relative gs-utl-inline-flex gs-utl-items-center gs-utl-h-6 gs-utl-rounded-full gs-utl-w-11 gs-utl-transition-colors focus:gs-utl-outline-none",l?z.bgA:z.bgH,pa.focus,o&&`${z.br} ${re.b}`);return c.jsx(Ku.Group,{children:c.jsxs(k,{items:"center",className:N(_R,t),full:!0,children:[!!s&&c.jsx(Ku.Label,{as:r,className:N("gs-utl-mr-4 gs-utl-flex-1"),passive:!0,children:c.jsx(fs,{...e,as:"span"})}),c.jsx(Ku,{checked:l,onChange:a,className:u,disabled:i,children:c.jsx("span",{className:N(z.bg,"gs-utl-inline-block gs-utl-w-4 gs-utl-h-4 gs-utl-transform gs-utl-rounded-full gs-utl-transition-transform",l?"gs-utl-translate-x-6":"gs-utl-translate-x-1")})})]})})}function ih(e){var i;const[t,n]=h.useState(((i=e.getDataResolver)==null?void 0:i.call(e))??{}),s=h.useRef(t),r=a=>{const l={...s.current,...a};s.current=l,n(l)},o=()=>{e.setDataResolver(s.current)};return h.useEffect(()=>{const a="change:dataResolver",l=()=>{const u=e.getDataResolver();n(u)};return e.on(a,l),()=>{e.off(a,l)}},[e]),{localData:t,updateLocalData:r,syncToComponent:o}}const TR="gs-cmp-data-collection-picker",OR=fe(({component:e,onConfirm:t})=>{const{localData:n,updateLocalData:s,syncToComponent:r}=ih(e),{collectionId:o="",dataSource:i={},startIndex:a=0,endIndex:l=10}=n,u=Dy(i),d=l===Number.MAX_VALUE,f=Re().tScoped("dataSources"),p=d?"":l,g=()=>{r(),t==null||t({value:n})},m=y=>s({dataSource:{...i,path:y}}),b=y=>s({startIndex:y}),v=y=>s({endIndex:y}),x=y=>s({endIndex:y?Number.MAX_VALUE:4});return c.jsxs(k,{className:TR,gap:"s",col:!0,nowrap:!0,children:[c.jsxs(k,{items:"end",gap:"s",nowrap:!0,children:[c.jsx(tt,{className:"gs-utl-flex-grow",size:"s",label:f("collectionId"),value:o,readOnly:!0,disabled:!0}),c.jsx(Z0,{size:"s",value:o,block:!0})]}),c.jsx(el,{label:f("variablePath"),value:u,onChange:m,dataResolver:n}),c.jsxs(k,{items:"end",gap:"s",nowrap:!0,children:[c.jsx(Ne,{size:"s",className:"gs-utl-flex-grow",label:f("collectionStartIndex"),value:a==null?void 0:a.toString(),onChange:b}),c.jsx(Ne,{size:"s",label:f("collectionEndIndex"),placeholder:d?"-":"",value:p==null?void 0:p.toString(),onChange:v,className:N("gs-utl-flex-grow",d&&"gs-utl-opacity-50 gs-utl-pointer-events-none")}),c.jsx(D,{children:c.jsx(wa,{label:f("collectionUpToEndIndex"),value:d,onChange:x})})]}),c.jsx(k,{full:!0,justify:"end",children:c.jsx(Ke,{onClick:g,variant:"pr",size:"m",children:f("confirm")})})]})}),AR="gs-data-collection-picker",NR=fe(function({className:t,component:n,onConfirm:s,...r}){return c.jsx(mn,{className:N(AR,t),...r,children:c.jsx(OR,{component:n,onConfirm:s})})});var Cn=(e=>(e.STRING="string",e.NUMBER="number",e.DATA_SOURCE="dataSource",e))(Cn||{}),yn=(e=>(e.equals="equals",e.isTruthy="isTruthy",e.isFalsy="isFalsy",e.isDefined="isDefined",e.isNull="isNull",e.isUndefined="isUndefined",e.isArray="isArray",e.isObject="isObject",e.isString="isString",e.isNumber="isNumber",e.isBoolean="isBoolean",e.isDefaultValue="isDefaultValue",e))(yn||{}),ah=(e=>(e.greaterThan=">",e.lessThan="<",e.greaterThanOrEqual=">=",e.lessThanOrEqual="<=",e.equals="=",e.notEquals="!=",e))(ah||{}),lh=(e=>(e.contains="contains",e.startsWith="startsWith",e.endsWith="endsWith",e.equalsIgnoreCase="equalsIgnoreCase",e.trimEquals="trimEquals",e))(lh||{});const MR=[...Object.values(lh),...Object.values(ah),...Object.values(yn)],_f={string:Object.values(lh),number:Object.values(ah),dataSource:MR},LR=h.memo(function(t){const{additionalSources:n,side:s,type:r,value:o,onChange:i}=t;switch(r){case Cn.DATA_SOURCE:return c.jsx(el,{size:"s",pickerInPopover:!0,value:Dy(o),onChange:a=>i(s,a,r),additionalSources:n});case Cn.NUMBER:return c.jsx(Ne,{size:"s",value:o,onChange:a=>i(s,a,r)});default:return c.jsx(tt,{size:"s",value:o,onChange:a=>i(s,a,r)})}}),RR="gs-cmp-statement-side",Xm=h.memo(function({side:t,type:n,value:s,label:r,onChange:o,onTypeChange:i,additionalSources:a,typeOptions:l}){return c.jsxs(k,{className:N(RR,"gs-utl-flex-grow"),col:!0,children:[c.jsx(Dr,{size:"s",children:r}),c.jsxs(k,{items:"center",gap:"xs",children:[c.jsx(D,{children:c.jsx(_e,{size:"s",value:n,options:l,onChange:u=>i(t,u)})}),c.jsx(D,{grow:!0,children:c.jsx(LR,{additionalSources:a,side:t,type:n,value:s,onChange:o})})]})]})}),Tl=e=>typeof e=="object"&&(e==null?void 0:e.type)==="data-variable"?Cn.DATA_SOURCE:typeof e=="string"?Cn.STRING:typeof e=="number"?Cn.NUMBER:Cn.STRING,$R=(e,t,n)=>{switch(t){case Cn.STRING:return e||"";case Cn.NUMBER:return e?Number(e):0;case Cn.DATA_SOURCE:{const s=n||{};return{type:"data-variable",...(ot(e)?oh(e,s):e)??{path:"",defaultValue:""}}}default:return e}},kR=e=>_f[e][0],VR=e=>![yn.isTruthy,yn.isFalsy,yn.isDefined,yn.isNull,yn.isUndefined,yn.isArray,yn.isObject,yn.isString,yn.isNumber,yn.isBoolean,yn.isDefaultValue].includes(e),IR="gs-cmp-statement",DR=fe(e=>{const{statement:t,onChange:n,className:s,additionalSources:r}=e,o=Re().tScoped("dataSources"),[i,a]=h.useState(()=>Tl(t.left)),[l,u]=h.useState(()=>Tl(t.right)),d=_f[i]||_f[Cn.STRING],f=h.useMemo(()=>Object.values(Cn).map(S=>({id:S,label:Ts(S)})),[]),p=h.useMemo(()=>d.map(S=>({id:S,label:o(`operators.${S}`)})),[d,o]);h.useEffect(()=>{a(Tl(t.left)),u(Tl(t.right))},[t.left,t.right]);const g=S=>{n({...t,...S})},m=(S,C,j)=>{const E=$R(C,j,r),_=S==="left",T=_&&j!==Cn.DATA_SOURCE;_?a(j):u(j),g({[S]:E,...T&&{operator:kR(j)}})},b=(S,C)=>m(S,null,C),v=S=>g({operator:S}),x=N(IR,s,z.br,re.b,re.rnd,je.xy),y=VR(t.operator),w={additionalSources:r,onChange:m,onTypeChange:b,typeOptions:f};return c.jsx(k,{className:N(x,"gs-utl-w-full"),items:"stretch",gap:"m",col:!0,full:!0,nowrap:!0,children:c.jsxs(k,{gap:"m",items:"center",full:!0,nowrap:!0,children:[c.jsx(Xm,{side:"left",type:i,value:t.left,label:o("leftValue"),...w}),c.jsx(D,{children:c.jsx(_e,{size:"s",label:o("operator"),value:t.operator,options:p,onChange:v})}),y&&c.jsx(Xm,{side:"right",type:l,value:t.right,label:o("rightValue"),...w})]})})}),vd="gs-cmp-statements-group",HR=e=>e==="and"||e==="or",Ec=e=>({...e,statements:[...e.statements??[],{left:"",operator:"equals",right:""}]}),Fy=fe(e=>{const{className:t,condition:n,onUpdate:s,additionalSources:r,skipAddCondition:o}=e,i=Re().tScoped("dataSources"),a=n.statements??[],l=n.logicalOperator||"and",u=m=>{HR(m)&&s({...n,logicalOperator:m})},d=()=>{Ec(n),s(Ec(n))},f=m=>{const b=a.filter((v,x)=>x!==m);s({...n,statements:b})},p=(m,b)=>{if(m>=0&&m<a.length){const v=[...a];v[m]=b,s({...n,statements:v})}},g=[{id:"and",label:i("conditionAnd")},{id:"or",label:i("conditionOr")}];return c.jsxs(k,{className:N(vd,t,"gs-utl-w-full"),full:!0,gap:"m",col:!0,nowrap:!0,children:[a.length>1&&c.jsx(Yr,{value:l,onChange:u,tabs:g}),c.jsx(k,{className:`${vd}__items`,gap:"s",col:!0,full:!0,nowrap:!0,children:a.map((m,b)=>c.jsxs(k,{className:N(`${vd}__item`),gap:"s",col:!0,children:[c.jsx(DR,{additionalSources:r,statement:m,onChange:v=>p(b,v)}),b<a.length-1&&c.jsxs(k,{justify:"center",items:"center",gap:"m",children:[c.jsx("span",{className:N(z.txtHighEmphasis,"gs-utl-text-sm gs-utl-font-bold"),children:l.toUpperCase()}),c.jsx(bt,{block:!0,variant:"out-clear",title:i("deleteCondition"),onClick:()=>f(b+1),icon:{icon:Z.delete,size:le.s}})]})]},`stmt-${b}`))}),!o&&c.jsx(k,{justify:"end",children:c.jsx(Ke,{variant:"pr",onClick:d,icon:{icon:Z.plus,size:le.s},children:i("addCondition")})})]})}),FR="gs-cmp-data-condition-picker",BR=fe(({component:e,onConfirm:t})=>{const{localData:n,updateLocalData:s,syncToComponent:r}=ih(e),o=Re().tScoped("dataSources"),i=n.condition,a=d=>s({condition:d}),l=()=>{r(),t==null||t({value:n})},u=()=>{s({condition:Ec(i)})};return c.jsxs(k,{className:FR,items:"stretch",gap:"m",full:!0,col:!0,children:[c.jsx(Fy,{additionalSources:e.collectionsStateMap??{},condition:i,onUpdate:a,skipAddCondition:!0}),c.jsxs(k,{gap:"m",justify:"end",full:!0,children:[c.jsx(Ke,{variant:"out",onClick:u,icon:{icon:Z.plus,size:le.s},children:o("addCondition")}),c.jsx(Ke,{onClick:l,variant:"pr",size:"m",children:o("confirm")})]})]})}),zR="gs-data-condition-picker",UR=fe(function({className:t,component:n,onConfirm:s,...r}){return c.jsx(mn,{className:N(zR,t),...r,children:c.jsx(BR,{component:n,onConfirm:s})})}),WR="gs-data-path-field",GR=fe(({className:e,value:t="",onChange:n,...s})=>c.jsx(mn,{className:N(WR,e),...s,children:c.jsx(el,{onChange:r=>n({value:r}),value:t})})),Ol={type:"data-variable",path:"",defaultValue:""},Jm={type:"data-condition",condition:{logicalOperator:"and",statements:[{left:"",operator:"",right:""}]},ifTrue:"",ifFalse:""};function Hr(e){return["data-variable","data-condition"].includes((e==null?void 0:e.type)??"")}const Qm="gs-cmp-dynamic-value-picker",qR=fe(({value:e,onChange:t,onConfirm:n,additionalSources:s})=>{const[r,o]=h.useState(()=>Hr(e)?e:Ol),[i,a]=h.useState(r.type),l=Re().tScoped("dataSources");h.useEffect(()=>{const w=Hr(e)?e:Ol;(w.type!==r.type||JSON.stringify(w)!==JSON.stringify(r))&&(o(w),a(w.type))},[e]);const u=w=>{o(w),t==null||t({value:w})},d=w=>{const S=w;a(S);const C=r.type===S?r:S==="data-variable"?Ol:Jm;u(C)},f=w=>{u({type:"data-variable",defaultValue:r.defaultValue,...oh(w,s)})},p=w=>{o(S=>{const C={...S,defaultValue:w};return t==null||t({value:C}),C})},g=w=>{u({...r,condition:w})},m=(w,S)=>{u({...r,[w]:S})},b=()=>{const w=r.condition;g(Ec(w))},v=[{id:"data-variable",label:l("variable")},{id:"data-condition",label:l("condition")}],x=(r==null?void 0:r.type)==="data-variable"?r:Ol,y=(r==null?void 0:r.type)==="data-condition"?r:Jm;return c.jsxs(k,{className:Qm,gap:"s",col:!0,nowrap:!0,children:[c.jsxs(k,{className:Qm,gap:"m",col:!0,nowrap:!0,full:!0,children:[c.jsx(Yr,{value:i,onChange:d,tabs:v}),c.jsx(D,{grow:!0,className:je.y,style:{overflowY:"auto",overflowX:"hidden"},children:i==="data-variable"?c.jsxs(k,{gap:"s",col:!0,nowrap:!0,children:[c.jsx(el,{value:x.path,label:l("variablePath"),additionalSources:s,defaultValue:x.defaultValue,onChange:f}),c.jsx(tt,{label:l("defaultValue"),value:x.defaultValue||"",onChange:p})]}):c.jsxs(k,{gap:"m",col:!0,children:[c.jsx(Fy,{additionalSources:s,condition:y.condition,onUpdate:g,skipAddCondition:!0}),c.jsxs(k,{gap:"s",col:!0,nowrap:!0,children:[c.jsx(tt,{label:l("ifTrue"),value:y.ifTrue,onChange:w=>m("ifTrue",w)}),c.jsx(tt,{label:l("ifFalse"),value:y.ifFalse,onChange:w=>m("ifFalse",w)})]})]})}),i==="data-condition"&&c.jsx(k,{full:!0,justify:"end",className:je.x,children:c.jsx(Ke,{variant:"out",onClick:b,icon:{icon:Z.plus,size:le.s},children:l("addCondition")})})]}),c.jsx(k,{full:!0,justify:"end",className:je.y,children:c.jsx(Ke,{onClick:()=>{n==null||n({value:r})},variant:"pr",size:"m",children:l("confirm")})})]})}),KR="gs-data-value-picker",YR=fe(({className:e,value:t={},onChange:n,onConfirm:s,additionalSources:r={},...o})=>c.jsx(mn,{className:N(KR,e),...o,children:c.jsx(qR,{value:t,onConfirm:i=>s==null?void 0:s(i),onChange:i=>n==null?void 0:n(i),additionalSources:r})})),ZR="gs-cmp-data-variable-picker",XR=fe(({component:e,onConfirm:t})=>{const{localData:n,updateLocalData:s,syncToComponent:r}=ih(e),o=Re().tScoped("dataSources"),{path:i="",defaultValue:a=""}=n,l=e.collectionsStateMap,u=p=>{s(oh(p,l))},d=()=>{r(),t==null||t({value:n})},f=p=>s({defaultValue:p});return c.jsxs(k,{className:ZR,gap:"s",col:!0,nowrap:!0,children:[c.jsx(el,{value:i,label:o("variablePath"),dataResolver:n,additionalSources:l,defaultValue:a,onChange:u}),c.jsx(tt,{label:o("defaultValue"),value:a,onChange:f}),c.jsx(k,{full:!0,justify:"end",className:je.y,children:c.jsx(Ke,{onClick:d,variant:"pr",size:"m",children:o("confirm")})})]})}),JR="gs-data-variable-picker",QR=fe(function({className:t,component:n,onConfirm:s,...r}){return c.jsx(mn,{className:N(JR,t),...r,children:c.jsx(XR,{component:n,onConfirm:s})})}),e$="gs-cmp-input-field",t$=h.memo(fe(function({className:t,style:n,label:s,name:r,value:o,size:i,disabled:a,inputType:l,readOnly:u,required:d,placeholder:f,onChange:p,onInput:g,editorEvents:m}){const{editor:b}=ye(),[v,x]=h.useState(()=>({className:t,style:n,label:s,name:r,value:o,size:i,readOnly:u,disabled:a,required:d,placeholder:f})),y=C=>({value:C,editor:b,state:v,setState:j=>x(E=>({...E,...j}))}),w=C=>p==null?void 0:p(y(C)),S=C=>g==null?void 0:g(y(C));return Jr({editor:b,editorEvents:m,localState:v,setLocalState:x}),c.jsx(tt,{type:l,className:N(e$,v.className),style:v.style,label:v.label,name:v.name,value:v.value,size:v.size,required:v.required,disabled:v.disabled,readOnly:v.readOnly,placeholder:v.placeholder,onChange:w,onInput:S})})),n$="gs-menu-list",s$=fe(function({className:e,items:t,onItemClick:n,...s}){const{editor:r}=ye(),[o,i]=h.useState(),a=u=>{const{onClick:d}=u;if(d&&r)return f=>d({item:u,editor:r,...f})},l=()=>{if(n&&r)return u=>n({...u,editor:r})};return c.jsx(mn,{className:N(n$,z.bg,"gs-utl-flex gs-utl-flex-col",e),...s,children:(t||[]).map((u,d)=>h.createElement(_i,{...u,label:u.layout?Ot(u.layout):u.label,key:u.id??d,className:u.className,action:a(u),onActive:()=>i(u),onItemClick:l(),active:o===u,items:u.items}))})});function r$({children:e,accept:t,onChange:n,multiple:s=!0,...r}){const o=Re(),i=h.useRef(null),a=()=>{const{current:l}=i;l&&(l.value="",l.click())};return c.jsxs(c.Fragment,{children:[c.jsx("input",{className:ee("hidden"),ref:i,type:"file",multiple:s,accept:t,onChange:n}),c.jsx(Ke,{variant:"pr",size:"m2",...r,onClick:a,children:e||o.t("upload")})]})}const o$=fe(r$),i$=fe(function({editor:t,assetProps:n,itemLayout:s,onSelect:r,onRemove:o}){const i=Ka();return Ot(s({asset:Er(i.toAsset(n)),assetProps:Er(n),onSelect:a=>r(i.toAssetProps(a)),onDelete:o&&(a=>o(i.toAssetProps(a))),editor:t}))}),a$="gs-cmp-asset-card",l$=fe(function(t){var f;const{assetProps:n,onSelect:s,onRemove:r,className:o,itemLayout:i}=t,a=Re(),{editor:l}=ye();if(i)return l?c.jsx(i$,{...t,editor:l,itemLayout:i}):null;const{src:u}=n,d=n.name||((f=u.split("/").pop())==null?void 0:f.split("?").shift());return c.jsx(Xn,{padding:!1,className:ue(a$,"overflow-hidden max-w-full group",o),children:c.jsxs(k,{col:!0,children:[c.jsxs(D,{className:ue("relative group h-24 cursor-pointer bg-checker"),onClick:()=>s(n),children:[c.jsx("div",{className:ue("w-full h-full bg-contain bg-no-repeat bg-center"),style:{backgroundImage:`url("${u}")`}}),c.jsx(k,{justify:"center",items:"center",className:ue(Ee.coverAbs,z.bgH75,"group-hover:gs-utl-opacity-100 opacity-0 transition-opacity"),children:c.jsx(Ke,{className:ue("text-sm"),size:"m2",variant:"pr",children:a.t("select")})})]}),c.jsxs(k,{className:ue("gjs-p-1 max-w-full"),space:"s",items:"center",nowrap:!0,children:[c.jsx(D,{className:ue(Ee.txtEllips,"text-sm gjs-mr-auto"),children:d}),r&&c.jsx(fu,{onConfirm:()=>r==null?void 0:r(n),text:c.jsxs(k,{col:!0,space:"m",items:"stretch",children:[c.jsx("p",{className:ue("text-center",z.txtHighEmphasis),children:a.t("assetManager.deleteConfirmQuestion")}),c.jsx("p",{className:ue("text-center"),children:a.t("assetManager.deleteConfirmExplanation")})]}),confirmButtonProps:{variant:"danger"},children:c.jsx(bt,{title:a.t("delete"),children:c.jsx(oe,{icon:Z.delete,size:le.sx})})})]})]})})}),bs="gs-asset-manager",c$={search:!0,addUrl:!0,upload:!0},u$=fe(function({assetProps:t,typeFilterOptions:n,providerFilterOptions:s,typeFilter:r,providerFilter:o,searchValue:i,isLoading:a,optionalType:l,optionalProvider:u,useLocalSearch:d,itemLayout:f,content:p,onSelect:g,onChangeTypeFilter:m,onChangeProviderFilter:b,onChangeSearchValue:v,onChangeUpload:x,onAddUrl:y,onRemove:w,onEndReached:S,layoutAfterHeader:C}){const j=ye(),{editor:E}=j,_=Re(),[T]=Bp(),P=Qp(p==null?void 0:p.itemsPerRow),[A,M]=h.useState(""),R=(p==null?void 0:p.header)===!1?!1:{...c$,...ur(p==null?void 0:p.header)?p.header:{}};if(!E)return;const F=d?t.filter(L=>!(i&&!ni(L.src,i)&&!ni(L.name??"",i))):t;return c.jsxs(k,{className:ee(bs,"relative gs-utl-h-full",a&&Ee.disabled),nowrap:!0,col:!0,space:"m",children:[R!==!1&&c.jsxs(k,{className:`${bs}__header`,gap:"m",justify:"between",items:"center",children:[c.jsxs(k,{className:`${bs}__header-filters`,items:"center",gap:"m",children:[R.search&&c.jsx(D,{children:c.jsx(tt,{className:`${bs}__search-filter`,size:"m",type:"search",value:i,onInput:v,placeholder:`${_.t("search")}...`})}),n.length>(l?0:1)&&c.jsx(D,{children:c.jsx(_e,{className:ee(`${bs}__type-filter`,"items-center"),size:"m",options:n,value:r,onChange:m,emptyState:_.t("assetManager.assetTypes.all"),includeEmpty:l})}),s.length>(u?0:1)&&c.jsx(D,{children:c.jsx(_e,{classNameContainer:ee(`${bs}__provider-filter`,"items-center"),size:"m",options:s.map(L=>({...L,label:Ye(L.label)?L.label({editor:E}):L.label,icon:L.icon})),value:o,onChange:b,emptyState:_.t("assetManager.noProvider"),includeEmpty:u})})]}),c.jsxs(k,{className:`${bs}__header-buttons`,items:"center",gap:"m",children:[R.upload&&c.jsx(D,{children:c.jsx(o$,{className:`${bs}__upload-field`,onChange:x})}),R.addUrl&&!!y&&c.jsx(D,{children:c.jsx(ps,{className:`${bs}__add-url-popover`,overlay:!0,placement:"bottom-end",title:!1,buttonAs:"span",handler:c.jsx(Ke,{variant:"pr",size:"m2",children:_.t("assetManager.addUrl")}),children:({close:L})=>c.jsxs(k,{gap:"m",children:[c.jsx(D,{children:c.jsx(tt,{type:"url",size:"s",value:A,onChange:M,placeholder:_.t("assetManager.inputPlh")})}),c.jsx(D,{children:c.jsx(Ke,{variant:"pr",size:"m2",onClick:()=>{y(A),L()},children:_.t("add")})})]})})})]}),C&&c.jsx(c.Fragment,{children:Ot(C({editor:E}))})]}),c.jsx(k,{className:ee(`${bs}__content`,"gs-utl-h-[75vh] gs-utl-flex-grow"),space:"m",col:!0,nowrap:!0,children:!a&&!F.length?c.jsx(k,{justify:"center",children:_.t("noItems")}):!!T&&c.jsx(du,{data:F,listClassName:ee("gs-utl-grid gs-utl-gap-2",P),endReached:S,itemContent:(L,B)=>c.jsx(l$,{assetProps:B,onSelect:g,onRemove:w,itemLayout:f},B.id),components:{Footer:S?d$:void 0}})}),a&&c.jsx(Co,{abs:!0})]})}),d$=()=>c.jsx("div",{style:{padding:"2rem",display:"flex",justifyContent:"center",height:200}}),f$=fe(function({panelId:t,content:n,assets:s,types:r,providers:o,typeId:i,providerId:a,optionalType:l,optionalProvider:u,onSelect:d,close:f,layoutAfterHeader:p}){const{appEditorStore:g,i18nStore:m}=bn(),{editor:b}=g,v=Ka(),{customOnLoad:x}=v,y=w0(t);h.useEffect(()=>{const E=T=>ot(T)?{id:T,label:m.t(`assetManager.assetTypes.${T}`)||T}:T;y.setCustomTypes(r==null?void 0:r.map(E)),y.setCustomProviders(ot(o)?[o]:o),i?y.setTypeFilter(i):y.initTypeFilter(),a?y.setProviderFilter(a):y.initProviderFilter(),Lt(l)?y.setOptionalType(l):y.initOptionalType(),Lt(u)?y.setOptionalProvider(u):y.initOptionalProvider();const _=setTimeout(()=>y.loadAssets());return()=>clearTimeout(_)},[r,o,i,a,l,u]);const w=E=>{v.addToProjectAssets([{id:E,src:E,type:y.typeFilter??go.image}])},S=E=>{b&&(d==null||d({asset:v.toAsset(E),assetProps:E,editor:b}),f==null||f())},C=s==null?void 0:s.map(v.toAssetProps),j=y.shouldLoadNextPage?()=>y.loadAssets(!1):void 0;return c.jsx(u$,{assetProps:C??y.assetProps,typeFilter:y.typeFilter,typeFilterOptions:y.typeFilterOptions,providerFilter:y.providerFilter,providerFilterOptions:y.providerFilterOptions,searchValue:y.searchValue,onChangeTypeFilter:E=>{y.setTypeFilter(E),y.loadAssets()},onChangeProviderFilter:E=>{y.setProviderFilter(E),y.loadAssets()},onChangeSearchValue:y.setSearchValue,onSelect:S,onAddUrl:x?void 0:w,onChangeUpload:E=>v.uploadFile(E.nativeEvent),onRemove:C?void 0:y.handleDelete,onEndReached:j,isLoading:y.isLoading,itemLayout:y.itemLayout,content:n,optionalType:y.optionalType,optionalProvider:y.optionalProvider,useLocalSearch:!y.reloadOnInput,layoutAfterHeader:p})});var p$=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(s[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function s(){this.constructor=t}t.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}}(),Tt=function(){return Tt=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Tt.apply(this,arguments)},e1={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},t1={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Al={width:"20px",height:"20px",position:"absolute"},h$={top:Tt(Tt({},e1),{top:"-5px"}),right:Tt(Tt({},t1),{left:void 0,right:"-5px"}),bottom:Tt(Tt({},e1),{top:void 0,bottom:"-5px"}),left:Tt(Tt({},t1),{left:"-5px"}),topRight:Tt(Tt({},Al),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Tt(Tt({},Al),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Tt(Tt({},Al),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Tt(Tt({},Al),{left:"-10px",top:"-10px",cursor:"nw-resize"})},g$=function(e){p$(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(s){n.props.onResizeStart(s,n.props.direction)},n.onTouchStart=function(s){n.props.onResizeStart(s,n.props.direction)},n}return t.prototype.render=function(){return et.createElement("div",{className:this.props.className||"",style:Tt(Tt({position:"absolute",userSelect:"none"},h$[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(et.PureComponent),m$=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(s[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function s(){this.constructor=t}t.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}}(),xs=function(){return xs=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},xs.apply(this,arguments)},b$={width:"auto",height:"auto"},Nl=function(e,t,n){return Math.max(Math.min(e,n),t)},n1=function(e,t,n){var s=Math.round(e/t);return s*t+n*(s-1)},Uo=function(e,t){return new RegExp(e,"i").test(t)},Ml=function(e){return!!(e.touches&&e.touches.length)},v$=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},s1=function(e,t,n){n===void 0&&(n=0);var s=t.reduce(function(o,i,a){return Math.abs(i-e)<Math.abs(t[o]-e)?a:o},0),r=Math.abs(t[s]-e);return n===0||r<n?t[s]:e},yd=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},Ll=function(e,t,n,s){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var r=Number(e.replace("%",""))/100;return t*r}if(e.endsWith("vw")){var r=Number(e.replace("vw",""))/100;return n*r}if(e.endsWith("vh")){var r=Number(e.replace("vh",""))/100;return s*r}}return e},y$=function(e,t,n,s,r,o,i){return s=Ll(s,e.width,t,n),r=Ll(r,e.height,t,n),o=Ll(o,e.width,t,n),i=Ll(i,e.height,t,n),{maxWidth:typeof s>"u"?void 0:Number(s),maxHeight:typeof r>"u"?void 0:Number(r),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof i>"u"?void 0:Number(i)}},x$=function(e){return Array.isArray(e)?e:[e,e]},w$=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],r1="__resizable_base__",S$=function(e){m$(t,e);function t(n){var s,r,o,i,a=e.call(this,n)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.appendBase=function(){if(!a.resizable||!a.window)return null;var l=a.parentNode;if(!l)return null;var u=a.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(r1):u.className+=r1,l.appendChild(u),u},a.removeBase=function(l){var u=a.parentNode;u&&u.removeChild(l)},a.state={isResizing:!1,width:(r=(s=a.propsSize)===null||s===void 0?void 0:s.width)!==null&&r!==void 0?r:"auto",height:(i=(o=a.propsSize)===null||o===void 0?void 0:o.height)!==null&&i!==void 0?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||b$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,s=0;if(this.resizable&&this.window){var r=this.resizable.offsetWidth,o=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:r,s=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=i}return{width:n,height:s}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,s=this.props.size,r=function(a){var l;if(typeof n.state[a]>"u"||n.state[a]==="auto")return"auto";if(n.propsSize&&n.propsSize[a]&&(!((l=n.propsSize[a])===null||l===void 0)&&l.toString().endsWith("%"))){if(n.state[a].toString().endsWith("%"))return n.state[a].toString();var u=n.getParentSize(),d=Number(n.state[a].toString().replace("px","")),f=d/u[a]*100;return f+"%"}return yd(n.state[a])},o=s&&typeof s.width<"u"&&!this.state.isResizing?yd(s.width):r("width"),i=s&&typeof s.height<"u"&&!this.state.isResizing?yd(s.height):r("height");return{width:o,height:i}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var s=!1,r=this.parentNode.style.flexWrap;r!=="wrap"&&(s=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return s&&(this.parentNode.style.flexWrap=r),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,s){var r=this.propsSize&&this.propsSize[s];return this.state[s]==="auto"&&this.state.original[s]===n&&(typeof r>"u"||r==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,s){var r=this.props.boundsByDirection,o=this.state.direction,i=r&&Uo("left",o),a=r&&Uo("top",o),l,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(l=i?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=a?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(l=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(l=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return l&&Number.isFinite(l)&&(n=n&&n<l?n:l),u&&Number.isFinite(u)&&(s=s&&s<u?s:u),{maxWidth:n,maxHeight:s}},t.prototype.calculateNewSizeFromDirection=function(n,s){var r=this.props.scale||1,o=x$(this.props.resizeRatio||1),i=o[0],a=o[1],l=this.state,u=l.direction,d=l.original,f=this.props,p=f.lockAspectRatio,g=f.lockAspectRatioExtraHeight,m=f.lockAspectRatioExtraWidth,b=d.width,v=d.height,x=g||0,y=m||0;return Uo("right",u)&&(b=d.width+(n-d.x)*i/r,p&&(v=(b-y)/this.ratio+x)),Uo("left",u)&&(b=d.width-(n-d.x)*i/r,p&&(v=(b-y)/this.ratio+x)),Uo("bottom",u)&&(v=d.height+(s-d.y)*a/r,p&&(b=(v-x)*this.ratio+y)),Uo("top",u)&&(v=d.height-(s-d.y)*a/r,p&&(b=(v-x)*this.ratio+y)),{newWidth:b,newHeight:v}},t.prototype.calculateNewSizeFromAspectRatio=function(n,s,r,o){var i=this.props,a=i.lockAspectRatio,l=i.lockAspectRatioExtraHeight,u=i.lockAspectRatioExtraWidth,d=typeof o.width>"u"?10:o.width,f=typeof r.width>"u"||r.width<0?n:r.width,p=typeof o.height>"u"?10:o.height,g=typeof r.height>"u"||r.height<0?s:r.height,m=l||0,b=u||0;if(a){var v=(p-m)*this.ratio+b,x=(g-m)*this.ratio+b,y=(d-b)/this.ratio+m,w=(f-b)/this.ratio+m,S=Math.max(d,v),C=Math.min(f,x),j=Math.max(p,y),E=Math.min(g,w);n=Nl(n,S,C),s=Nl(s,j,E)}else n=Nl(n,d,f),s=Nl(s,p,g);return{newWidth:n,newHeight:s}},t.prototype.setBoundingClientRect=function(){var n=1/(this.props.scale||1);if(this.props.bounds==="parent"){var s=this.parentNode;if(s){var r=s.getBoundingClientRect();this.parentLeft=r.left*n,this.parentTop=r.top*n}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*n,this.targetTop=o.top*n}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,l=i.top,u=i.right,d=i.bottom;this.resizableLeft=a*n,this.resizableRight=u*n,this.resizableTop=l*n,this.resizableBottom=d*n}},t.prototype.onResizeStart=function(n,s){if(!(!this.resizable||!this.window)){var r=0,o=0;if(n.nativeEvent&&v$(n.nativeEvent)?(r=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Ml(n.nativeEvent)&&(r=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(n,s,this.resizable);if(i===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var a,l=this.window.getComputedStyle(this.resizable);if(l.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",a=l.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var f={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:xs(xs({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:s,flexBasis:a};this.setState(f)}},t.prototype.onMouseMove=function(n){var s=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Ml(n))try{n.preventDefault(),n.stopPropagation()}catch{}var r=this.props,o=r.maxWidth,i=r.maxHeight,a=r.minWidth,l=r.minHeight,u=Ml(n)?n.touches[0].clientX:n.clientX,d=Ml(n)?n.touches[0].clientY:n.clientY,f=this.state,p=f.direction,g=f.original,m=f.width,b=f.height,v=this.getParentSize(),x=y$(v,this.window.innerWidth,this.window.innerHeight,o,i,a,l);o=x.maxWidth,i=x.maxHeight,a=x.minWidth,l=x.minHeight;var y=this.calculateNewSizeFromDirection(u,d),w=y.newHeight,S=y.newWidth,C=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(S=s1(S,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(w=s1(w,this.props.snap.y,this.props.snapGap));var j=this.calculateNewSizeFromAspectRatio(S,w,{width:C.maxWidth,height:C.maxHeight},{width:a,height:l});if(S=j.newWidth,w=j.newHeight,this.props.grid){var E=n1(S,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),_=n1(w,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),T=this.props.snapGap||0,P=T===0||Math.abs(E-S)<=T?E:S,A=T===0||Math.abs(_-w)<=T?_:w;S=P,w=A}var M={width:S-g.width,height:w-g.height};if(m&&typeof m=="string"){if(m.endsWith("%")){var R=S/v.width*100;S=R+"%"}else if(m.endsWith("vw")){var F=S/this.window.innerWidth*100;S=F+"vw"}else if(m.endsWith("vh")){var L=S/this.window.innerHeight*100;S=L+"vh"}}if(b&&typeof b=="string"){if(b.endsWith("%")){var R=w/v.height*100;w=R+"%"}else if(b.endsWith("vw")){var F=w/this.window.innerWidth*100;w=F+"vw"}else if(b.endsWith("vh")){var L=w/this.window.innerHeight*100;w=L+"vh"}}var B={width:this.createSizeForCssProperty(S,"width"),height:this.createSizeForCssProperty(w,"height")};this.flexDir==="row"?B.flexBasis=B.width:this.flexDir==="column"&&(B.flexBasis=B.height);var q=this.state.width!==B.width,H=this.state.height!==B.height,$=this.state.flexBasis!==B.flexBasis,I=q||H||$;I&&Dn.flushSync(function(){s.setState(B)}),this.props.onResize&&I&&this.props.onResize(n,p,this.resizable,M)}},t.prototype.onMouseUp=function(n){var s,r,o=this.state,i=o.isResizing,a=o.direction,l=o.original;if(!(!i||!this.resizable)){var u={width:this.size.width-l.width,height:this.size.height-l.height};this.props.onResizeStop&&this.props.onResizeStop(n,a,this.resizable,u),this.props.size&&this.setState({width:(s=this.props.size.width)!==null&&s!==void 0?s:"auto",height:(r=this.props.size.height)!==null&&r!==void 0?r:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:xs(xs({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){var s,r;this.setState({width:(s=n.width)!==null&&s!==void 0?s:"auto",height:(r=n.height)!==null&&r!==void 0?r:"auto"})},t.prototype.renderResizer=function(n){var s=this,r=this.props,o=r.enable,i=r.handleStyles,a=r.handleClasses,l=r.handleWrapperStyle,u=r.handleWrapperClass,d=r.handleComponent;if(!o)return null;var f=n.filter(function(p){return o[p]!==!1}).map(function(p){return o[p]!==!1?et.createElement(g$,{key:p,direction:p,onResizeStart:s.onResizeStart,replaceStyles:i&&i[p],className:a&&a[p]},d&&d[p]?d[p]:null):null});return et.createElement("div",{className:u,style:l},f)},t.prototype.render=function(){var n=this,s=Object.keys(this.props).reduce(function(i,a){return w$.indexOf(a)!==-1||(i[a]=n.props[a]),i},{}),r=xs(xs(xs({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return et.createElement(o,xs({style:r,className:this.props.className},s,{ref:function(i){i&&(n.resizable=i)}}),this.state.isResizing&&et.createElement("div",{style:this.state.backgroundStyle}),this.renderResizer(["topLeft","top","topRight","left"]),this.props.children,this.renderResizer(["right","bottomLeft","bottom","bottomRight"]))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(et.PureComponent);function mu({className:e,children:t,top:n,bottom:s,right:r,left:o,width:i,height:a,minHeight:l,minWidth:u,maxHeight:d,maxWidth:f,style:p,onResize:g,onResizeStop:m,...b}){const v={top:n||!1,right:r||!1,bottom:s||!1,left:o||!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},x={width:i||"auto",height:a||"auto"},y=N("gs-utl-z-10",z.hBgAct),w={top:y,bottom:y,right:y,left:y},S={top:{top:-1,height:2},bottom:{bottom:0,height:2},right:{right:-1,width:2},left:{left:-1,width:2}};return c.jsx(S$,{className:e,enable:b.enable??v,defaultSize:x,handleStyles:S,handleClasses:w,onResize:g,onResizeStop:m,minHeight:l,minWidth:u,maxHeight:d,maxWidth:f,style:p,children:t})}const ch="gs-cmp-accordion",Tf=`${ch}-handler`,Rl=`${Tf}__content`,C$=`${ch}-content`;function ar({className:e,classNameWrap:t,classNameContent:n,classNameHandlerContent:s,style:r,handler:o,handlerIcon:i,children:a,inverted:l,disabled:u,sticky:d,onChange:f,open:p}){return c.jsx(Wu,{as:"div",defaultOpen:p,className:ee(ch,t,"relative"),children:({open:g})=>c.jsxs(c.Fragment,{children:[c.jsx(Wu.Button,{as:u?"div":"button",disabled:u,style:r,onClick:m=>f==null?void 0:f({event:m,open:!g}),className:({open:m})=>N(Tf,Ye(e)?e(m):e,d&&"gs-utl-sticky gs-utl-top-0 gs-utl-z-10","gs-utl-w-full"),children:({open:m})=>c.jsxs(k,{items:"center",className:ee("gap-2"),full:!0,children:[c.jsx(D,{className:ee(Rl,s,"text-left"),grow:!0,children:Ye(o)?o(m):c.jsxs(k,{items:"center",className:ee(`${Rl}-wrp`,"gap-3"),nowrap:!0,children:[!!i&&c.jsx(oe,{className:ee(`${Rl}-icon`),icon:i,size:le.s2x}),c.jsx(D,{className:ee(`${Rl}-label gs-utl-w-full`),children:o})]})}),c.jsx(D,{className:ee(`${Tf}-toggle`,l&&"-order-1",u&&"gs-utl-hidden"),children:c.jsx(oe,{icon:Z.chevronDown,className:ee("w-5 h-5 transition-transform",m&&"rotate-180")})})]})}),c.jsx(Wu.Panel,{className:ee(C$,n),children:a})]})})}const Fi="gs-studio-panel",By=(e,t={})=>({...t,...e===!0?{}:e||void 0}),hs=h.memo(function({children:t,header:n,resizable:s,className:r,classNameAccordion:o,classNameAccordionContent:i,...a}){const l=c.jsx(mn,{className:N(Fi,r),...a,children:t}),u=s?s===!0?{top:!0,right:!0,bottom:!0,left:!0}:s:void 0,d=u?c.jsx(mu,{className:N([`${Fi}__resizer`]),...u,children:l}):l,f=n===!0?{collapsible:!0}:n||void 0;return f?c.jsx(ar,{classNameWrap:N(`${Fi}__accordion`,o),className:N(`${Fi}__accordion-header`,je.xy,f.className),classNameContent:N(`${Fi}__accordion-content`,i),disabled:f.collapsible===!1,style:f.style,handler:c.jsxs(k,{space:"s",items:"center",children:[!!f.icon&&c.jsx(oe,{icon:f.icon,size:le.s}),c.jsx(D,{grow:!0,children:f.label})]}),open:n?f.collapsed!==!0:!0,children:d}):d}),j$="gs-panel-assets",E$=h.memo(fe(function({className:t,onSelect:n,content:s,assets:r,types:o,providers:i,typeId:a,providerId:l,optionalType:u,optionalProvider:d,projectAssetsOption:f,layoutAfterHeader:p,...g}){var C;const m=ye(),b=Ka(),v=m.editor,x=(C=m.sdkOptions.assets)==null?void 0:C.layoutAfterHeader,y=p||x,[w]=h.useState(()=>g.id||n0());return h.useEffect(()=>(b.createAssetManager(w),()=>{b.removeAssetManager(w)}),[w]),w0(w)?c.jsx(hs,{className:N(j$,"gs-utl-overflow-hidden gs-utl-h-full",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...g,children:v&&c.jsx(f$,{panelId:w,assets:r,types:o,providers:i,onSelect:n,typeId:a,providerId:l,content:s,optionalType:u,optionalProvider:f??d,layoutAfterHeader:y})}):null}));var Yi=(e=>(e.REGULAR="regular",e.SYMBOLS="symbols",e))(Yi||{}),Ps=(e=>(e.before="before",e.beforeInside="beforeInside",e.afterInside="afterInside",e.after="after",e))(Ps||{});const o1="gs-block-item",P$=e=>{const{block:t,className:n,itemLayout:s,onClick:r,variant:o}=e,{editor:i}=ye(),a=Re(),[,l]=h.useState(0),u=a.tScoped("blockManager.labels"),d=t.getId(),f=!!t.get("full"),p=r||t.get("onClick"),g=t.get("disable"),m=t.get("mediaReact"),b=t.getMedia(),v=t.get("attributes")||{},x=u(d)||t.getLabel(),y=o==="compact",w=N(o1,`${o1}--${d}`,n,"gs-utl-px-2 gs-utl-transition-colors",re.b,re.rnd,z.br,f&&"gs-utl-col-span-full",y?"gs-utl-py-1":"gs-utl-py-2",y?"gs-utl-flex-row gs-utl-nowrap gs-utl-gap-3 gs-utl-justify-start":"gs-utl-flex-col",g?Ee.disabledM:N("gs-utl-cursor-pointer",z.hTAo,z.hBgH)),S=Lt(v.class)&&!y?v.class:N("gs-utl-block-media gs-utl-w-full",y?"gs-utl-max-h-7 gs-utl-max-w-7 gs-utl-overflow-hidden":"gs-utl-max-h-10 gs-utl-max-w-10"),C=N("gs-utl-text-center",Ee.txtEllips,!y&&"gs-utl-w-full");if(h.useEffect(()=>{if(!i)return;const{Blocks:A}=i,M=A.events.update,R=F=>F===t&&l(L=>++L);return i.on(M,R),()=>{i.off(M,R)}},[t,i]),!i)return null;const{Blocks:j}=i,T={className:w,...!g&&{onDragStart:()=>j.startDrag(t),onDragEnd:()=>j.endDrag(!1),draggable:!r},...!!p&&{onClick:()=>p(t,i)}},P=s==null?void 0:s({editor:i,block:t,attributes:T});return P&&Ot(P)||c.jsxs(k,{items:"center",...T,children:[m||c.jsx("div",{className:S,dangerouslySetInnerHTML:{__html:b}}),c.jsx("div",{className:C,title:x,children:x})]})},i1=fe(P$);function uh({className:e,value:t,onChange:n}){const[s,r]=h.useState(t),o=h.useRef(null),i=u=>{const{value:d}=u.target;r(d)},a=()=>{n(s||t)},l=u=>{switch(u.key){case"Escape":n(t);break;case"Enter":n(s||t);break}};return h.useEffect(()=>{o.current&&o.current.select()},[]),c.jsx("input",{autoFocus:!0,className:ee([e,"w-full",z.bgTr]),value:s,onChange:i,onBlur:a,onKeyDown:l,onPointerDown:bo,ref:o})}function zy({className:e,value:t,active:n,unstyled:s,activable:r,onChange:o,onActive:i,...a}){const[l,u]=h.useState(n);h.useEffect(()=>{u(n)},[n]);const d=p=>{i==null||i(p),u(p)},f=p=>{o(p),d(!1)};return c.jsx("div",{className:ee("truncate",e),...a,onDoubleClick:()=>r&&d(!0),children:l?c.jsx(uh,{className:ee(s&&Ee.noFocusOut),value:t,onChange:f}):c.jsx(c.Fragment,{children:t})})}const a1=ue("text-sm w-full",Ee.txtEllips),_$=({symbol:e,className:t})=>{const n=Ja(),{Components:s}=n,r=Re(),o=ji(),i=r.tScoped("blockManager.symbols"),a=()=>{const{draggable:x,droppable:y,attributes:w,type:S,tagName:C}=e.attributes;n.Canvas.startDrag({content:()=>s.addSymbol(e),model:e,dragDef:{type:S,tagName:C,draggable:x,droppable:y,attributes:w}})},l=()=>{n.Canvas.endDrag()},u=e.getIcon(),d=e.getName(),f=s.getSymbolInfo(e).instances.length,p=ue("h-10 w-10 block-media",z.grouphTAo),g=ue("gjs-pt-1 gjs-mt-2",re.bt,z.br),m=ue("cursor-pointer gjs-p-2 transition-colors group",re.b,re.rnd,z.br,z.hBgH,t),b=()=>{o.confirm({title:i("delete"),content:i("deleteConfirm"),onConfirm:()=>e.remove()})},v=x=>{e.set("custom-name",x)};return c.jsxs(k,{className:m,onDragStart:a,onDragEnd:l,items:"center",draggable:!0,col:!0,children:[c.jsx("div",{className:p,dangerouslySetInnerHTML:{__html:u}}),c.jsxs(k,{items:"center",justify:"between",className:g,space:"m",full:!0,children:[c.jsx(D,{children:c.jsx(k,{className:ue(a1,"gjs-mr-auto"),children:c.jsx(It,{title:`${f} ${i("instancesProject")}`,children:c.jsx(Rr,{label:`${f}`,className:ue(z.bgH75)})})})}),c.jsx(D,{className:ue("truncate"),grow:!0,title:d,children:c.jsx(zy,{activable:!0,value:d,className:a1,onChange:v})}),c.jsx(D,{className:ue(Ee.hoverGroup),children:c.jsx(k,{justify:"end",full:!0,children:c.jsx(bt,{onClick:b,title:i("delete"),border:!1,size:"",block:!0,children:c.jsx(oe,{icon:Z.delete,size:le.s})})})})]})]})},T$=fe(_$),vr="gs-block-manager",l1={id:Ps.before,title:"Add before",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <path d="M4 5v14"/> <rect fill="none" x="8" y="5" width="12" height="14" rx="2" ry="2"/> </svg>'},O$={id:Ps.beforeInside,title:"Add inside first",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <rect fill="none" x="4" y="5" width="16" height="14" rx="2" ry="2"/> <path d="M8 8v8"/> </svg>'},A$={id:Ps.afterInside,title:"Add inside last",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <rect fill="none" x="4" y="5" width="16" height="14" rx="2" ry="2"/> <path d="M16 8v8"/> </svg>'},c1={id:Ps.after,title:"Add after",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <rect fill="none" x="4" y="5" width="12" height="14" rx="2" ry="2"/> <path d="M20 5v14"/> </svg>'},u1=(e,t)=>{const n=t==null?void 0:t.getId();return n&&e.I18n.t(`blockManager.categories.${n}`)||(t==null?void 0:t.getLabel())||""},Uy=e=>{const t=e.getContent();return Ye(t)?e.getDragDef():t},N$=e=>{const t=Uy(e);return Array.isArray(t)?t[0]:t},M$=fe(function({isOpen:t,className:n,hideCategories:s,target:r,variant:o,itemLayout:i,...a}){var Ie,Wt;const{editor:l}=ye(),u=Re(),[d,f]=h.useState(0),[p,g]=h.useState(Yi.REGULAR),[m,b]=h.useState(""),[v,x]=h.useState(""),y=h.useRef(new Set),[w,S]=h.useState((r==null?void 0:r.position)||Ps.after),[C,j]=h.useState(()=>(l==null?void 0:l.Components.getSymbols())||[]),E=p===Yi.SYMBOLS,_=h.useRef(null),T=u.tScoped("blockManager"),P=r==null?void 0:r.component;if(h.useEffect(()=>{if(!l)return;const{Blocks:ge,Components:$e}=l,Ve=ge.events.custom,Me=$e.events.symbol,wt=()=>{j($e.getSymbols()),f($t=>++$t)};return l.on(Me,wt),l.on(Ve,wt),()=>{l.off(Me,wt),l.off(Ve,wt)}},[l]),h.useEffect(()=>{if(_.current&&t){const ge=_.current.querySelector("input");setTimeout(()=>ge==null?void 0:ge.focus(),tp)}},[_.current,t]),!l)return null;const{Blocks:A,Components:M}=l,R=ge=>T(`labels.${ge.getId()}`)||ge.getLabel(),F=C.filter(ge=>ni(ge.getName(),m)),L=A.getAll().map(ge=>ge),B=((Ie=a.blocks)==null?void 0:Ie.call(a,{blocks:L}))||L,q=w===Ps.before,H=w===Ps.beforeInside,$=w===Ps.afterInside,I=w===Ps.after,O=!!(P!=null&&P.attributes.droppable),V=B.filter(ge=>{const $e=u1(l,ge.category);if(m&&!ni($e,m)&&!ni(R(ge),m))return!1;if(P){const Ve=N$(ge);if(O&&(H||$)){const Me=H?0:void 0;return M.canMove(P,Ve,Me).result}else if(q||I){const Me=P.index(),wt=P.parent(),$t=q?Me:Me+1;return wt&&M.canMove(wt,Ve,$t).result}}return!0}),G=A.getBlocksByCategory(V),W=s?V:(Wt=G.find(ge=>!ge.category))==null?void 0:Wt.items,K=s?[]:G.filter(ge=>ge.category),J=a.symbols!==!1,Y=a.search!==!1,U=!J&&!Y,Q=o==="compact",se=T("search")||u.t("search"),de=N(vr,n,"gap-2"),Se=N(`${vr}__header`,"gs-utl-pt-2",je.xS,U&&"gs-utl-hidden"),ne=N(`${vr}__content`,Ee.scrollY,z.br,re.bt),Te=N(`${vr}__symbols`,"gs-utl-grid gs-utl-grid-cols-1 gs-utl-gap-2 gs-utl-p-2"),ke=N(`${vr}__not-found`,"gs-utl-text-center gs-utl-p-4"),it=N(`${vr}__blocks`,"gs-utl-grid gs-utl-gap-2 gs-utl-p-2 gs-utl-text-sm",Q?"gs-utl-grid-cols-1":"gs-utl-grid-cols-2"),st=N(`${vr}__no-category`,it,z.br,K.length&&re.bb),xe=N(z.tAo,z.bgH75,re.bA),Ze=`${vr}__category`,Xe=[{id:Yi.REGULAR,label:T("types.regular")},{id:Yi.SYMBOLS,label:T("types.symbols")}],ft=O?[l1,O$,A$,c1]:[l1,c1],Ae=P?ge=>{const $e=Uy(ge);if(!$e)return;let Ve;if(H||$){const Me=H?0:void 0;Ve=P.append($e,{at:Me})[0]}else if(q||I){const Me=P.index(),wt=P.parent(),$t=q?Me:Me+1;Ve=wt==null?void 0:wt.append($e,{at:$t})[0]}if(Ve){const{activate:Me,select:wt}=ge.attributes;wt||Me&&wt!==!1?l.em.setSelected(Ve,{activate:Me}):Me&&Ve.trigger("active")}}:void 0,at=ge=>{if(!P)return;const $e=Array.from(y.current);if(ge.key==="ArrowDown")ge.preventDefault(),x(Ve=>{const Me=$e.indexOf(Ve);return $e.at(Math.min(Me+1,$e.length-1))||""});else if(ge.key==="ArrowUp")ge.preventDefault(),x(Ve=>{const Me=$e.indexOf(Ve);return $e.at(Math.max(Me-1,0))||""});else if(ge.key==="Enter"&&v){const Ve=A.get(v);Ve&&(Ae==null||Ae(Ve))}},rt=ge=>{y.current.clear(),b(ge)};return c.jsxs(k,{className:de,col:!0,full:!0,children:[c.jsxs(k,{className:Se,gap:"s",col:!0,children:[J&&c.jsx(Yr,{tabs:Xe,onChange:g,value:p,variant:"pills"}),P&&c.jsx(Yt,{size:"s",options:ft,value:w,onChange:ge=>S(ge)}),Y&&c.jsx(tt,{ref:_,size:"s",value:m,onInput:rt,onKeyDown:at,placeholder:se,type:"search"})]}),c.jsxs(D,{className:ne,grow:!0,children:[E&&(F.length?c.jsx(k,{className:Te,children:F.map(ge=>c.jsx(T$,{symbol:ge},`${d}_${ge.getId()}`))}):c.jsx(k,{className:ke,justify:"center",children:T("symbols.notFound")})),!E&&(V.length?c.jsxs(c.Fragment,{children:[!!(W!=null&&W.length)&&c.jsx(k,{className:st,children:W==null?void 0:W.map(ge=>(y.current.add(`${ge.id}`),c.jsx(i1,{block:ge,itemLayout:i,onClick:Ae,variant:o,className:N(v===ge.id&&xe)},ge.id)))}),K.map(({category:ge,items:$e},Ve)=>c.jsx(ar,{sticky:!0,className:Me=>sp.itemList({index:Ve,open:Me,length:K.length}),open:!!(ge!=null&&ge.get("open")),onChange:({open:Me})=>ge==null?void 0:ge.set({open:Me}),handler:u1(l,ge),handlerIcon:ge==null?void 0:ge.get("icon"),classNameWrap:N(Ze,`${Ze}--${ge==null?void 0:ge.id}`),children:c.jsx(k,{className:it,children:$e.map(Me=>(y.current.add(`${Me.id}`),c.jsx(i1,{block:Me,itemLayout:i,onClick:Ae,variant:o,className:N(v===Me.id&&xe)},Me.id)))})},ge==null?void 0:ge.id))]}):c.jsx(k,{className:ke,justify:"center",children:T("notFound")}))]})]})}),L$=h.forwardRef(function({children:t,className:n,...s},r){return c.jsx("div",{className:N(ue("gs-block-manager-after"),n),ref:r,...s,children:t})}),R$=h.forwardRef(function({children:t,className:n,...s},r){return c.jsx("div",{className:N(ue("gs-block-manager-before"),n),ref:r,...s,children:t})}),$$="gs-panel-blocks",k$=h.memo(fe(function({className:t,symbols:n,search:s,hideCategories:r,target:o,variant:i,blocks:a,itemLayout:l,...u}){const d=ye().sdkProps.children,f={search:s,symbols:n,hideCategories:r,isOpen:!0,target:o,variant:i,blocks:a,itemLayout:l};return c.jsx(hs,{className:N($$,"gs-utl-overflow-hidden",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...u,children:c.jsxs(Qa,{children:[Bn(d,R$),c.jsx(M$,{className:N("gs-utl-overflow-hidden gs-utl-flex-nowrap"),...f}),Bn(d,L$)]})})})),V$="gs-cmp-color-picker",I$={backgroundSize:"10px"},D$=[0,15];function Wy({className:e,value:t,onChange:n,disabled:s}){const[r,o]=h.useState(!1),i=N(`${V$}-handler gs-utl-bg-checker gs-utl-overflow-hidden gs-utl-cursor-pointer`,e,re.b,re.rnd,z.br),a=()=>{o(!1)},l=c.jsxs("div",{style:I$,className:i,children:[r&&c.jsx("div",{onPointerUp:a,className:"gs-utl-fixed gs-utl-inset-0 gs-utl-z-50 gs-utl-cursor-grabbing"}),c.jsx("div",{className:"gs-utl-w-4 gs-utl-h-4",style:{backgroundColor:t}})]});return c.jsx(ps,{handler:l,title:"Color",size:"s",placement:"left-end",offset:D$,clickAway:!0,disabled:s,children:c.jsx($y,{value:t,onChange:n,disabled:s})})}const H$="gs-cmp-color-field";function lr(e){const{className:t,value:n,placeholder:s,preventSubmitOnEnter:r=!1,onChange:o,labelAs:i,disabled:a}=e,[l,u]=h.useState(yc(n)),d=Xa(e);h.useEffect(()=>{u(yc(n))},[n]);const f=(b,v)=>{o==null||o(b,v)},p=b=>{switch(b.key){case"Escape":return u(n);case"Enter":f(l),r&&(b.preventDefault(),b.stopPropagation())}},g=()=>{f(l)},m=qr({...e,className:N(H$,t)});return c.jsxs("div",{...m,children:[c.jsx(fs,{...e,as:i}),c.jsxs(k,{className:Gp(e),items:"center",space:"s",children:[c.jsx(D,{children:c.jsx(Wy,{value:n,onChange:o,disabled:a})}),c.jsx(D,{grow:!0,children:c.jsx("input",{className:N(d,a&&"gs-utl-pointer-events-none"),value:l,onChange:b=>u(b.target.value),placeholder:s,onBlur:g,onKeyDown:p,disabled:a})})]})]})}const F$=(e,t)=>{t.runCommand(ie.fontAdd,{font:e})},dh=(e,{onSelect:t,...n}={})=>{const s="font",i=e.runCommand(ie.assetProviderGet).filter(a=>ot(a.types)?a.types===s:a.types.includes(s))[0];if(!i){e.em.logWarning("No font provider found");return}e.Assets.open({types:[],modalTitle:e.I18n.t("fontManager.selectFont"),projectAssetsOption:!1,typeId:s,providerId:i.id,onSelect:a=>{const l=a.assetProps;F$(l.customData.font,e),t==null||t(a)},content:{header:{addUrl:!1,upload:!1},itemsPerRow:1},...n})},bu=fe(e=>{const{buttonClassName:t,value:n,...s}=e,{editor:r}=ye(),o=Re(),i=Ka(),a=Ya(),l=[...s.options||[],...a.fontFamilyOptions].map(u=>{const d=a.getFont(u.id),f=d?Hp(d):u.id;return{...u,content:c.jsx(k,{col:!0,children:c.jsx(D,{style:{fontFamily:f},children:u.label})})}});return c.jsx(_e,{...s,value:Po(n),options:l,afterLabel:a.sdkAddFonts&&i.hasType("font")&&c.jsx(bt,{className:t,title:o.t("fontManager.addFontToProject"),icon:Z.plus,size:"xs",border:!1,block:!0,onClick:()=>r&&dh(r,{onSelect:({assetProps:u})=>{const{customData:{font:d}}=u;s.onChange(Po(d.family))}})})})}),B$=(e,{t,id:n})=>t(`fields.${n}.label`)||Ts(`${e}`.replace(/-/g," ")),Gy=(e,{t,id:n})=>{const s=ot(e)?{id:e,label:e}:e;return{...s,label:t(`fields.${n}.options.${s.id}`)||s.label}},qy=e=>e.get("defaultValue")||"",tl=e=>e.get("field"),Ky=e=>{const t=tl(e);return ot(t)?{type:t}:t},Yy=e=>`${e.get("value")||qy(e)||Ky(e).defaultValue||""}`,z$=(e,t)=>e||qy(t)||"",Sa=({record:e,value:t,partial:n})=>{e.set({value:z$(t,e)},{partial:n}),e.em.refreshCanvas({tools:!0})},Ca=(e,t)=>{const{className:n,defaultValue:s,size:r,...o}=Ky(e),i=s??e.get("defaultValue");return{...o,hasClear:()=>{const a=e.get("value");return!!a&&Lt(i)&&a!==i},className:N(n,"gs-utl-w-full"),size:r||"s",value:Yy(e),label:B$(e.get("label")||e.id||"",t),onChange:(a,l)=>Sa({record:e,value:a,partial:l})}},U$=(e,t)=>{const n=tl(e),s=ur(n)?n:void 0,r=(s==null?void 0:s.units)||[],o=SR(Yy(e)),i=o.number,a=o.unit||r[0]||"";return{...Ca(e,t),value:i,valueUnit:a,min:s==null?void 0:s.min,max:s==null?void 0:s.max,step:s==null?void 0:s.step,units:s==null?void 0:s.units,onChange:(l,u)=>{Sa({value:l?`${l}${a}`:"",record:e,partial:u})},onChangeUnit:l=>{Sa({value:i?`${i}${l}`:"",record:e})}}},Zy=(e,t)=>{var o;const n=tl(e),s=ur(n)?n:void 0,r=((o=s==null?void 0:s.options)==null?void 0:o.map(i=>Gy(i,t)))||[];return{...Ca(e,t),options:r,onChange:i=>Sa({value:i,record:e})}},W$=(e,t)=>({...Ca(e,t),onChange:n=>Sa({value:n,record:e})}),G$=(e,t)=>{var o;const n=tl(e),s=ur(n)?n:void 0,r=((o=s==null?void 0:s.options)==null?void 0:o.map(i=>Gy(i,t)))||[];return{...Zy(e,t),size:"s",options:r}};function q$(e,t){const n=tl(e);switch(ot(n)?n:n==null?void 0:n.type){case"radio":return c.jsx(Yt,{...G$(e,t)});case"select":return c.jsx(_e,{...Zy(e,t)});case"selectFont":{const r=W$(e,t);return c.jsx(bu,{...r,labelAs:"div"})}case"number":return c.jsx(Ne,{...U$(e,t)});case"color":return c.jsx(lr,{...Ca(e,t)});default:return c.jsx(tt,{...Ca(e,t)})}}const d1="gs-cmp-global-style-field",K$=fe(function({record:t}){const n=ye(),r=Re().tScoped("globalStyleManager"),[,o]=h.useState(0),i=n.editor,a=t.id,l={t:r,id:a};return h.useEffect(()=>{if(!i)return;const u=`data:path:${t.getPath("value")}`,d=()=>o(f=>++f);return i.on(u,d),()=>{i.off(u,d)}},[i]),c.jsx(k,{className:N(d1,`${d1}__${a}`),children:q$(t,l)})}),ia="gs-cmp-global-style-manager",f1=({items:e,category:t,className:n})=>{const s=N(t?`${ia}__cat-fields--${t.id}`:`${ia}__uncat-fields`,"gs-utl-gap-2",je.xy,n);return c.jsx(k,{className:s,nowrap:!0,col:!0,children:e.map(r=>c.jsx(K$,{record:r},r.id))})},Y$=fe(function(){const t=UN(),{recordsByCategory:n,openCategories:s}=t,o=Re().tScoped("globalStyleManager");return c.jsx(k,{col:!0,full:!0,nowrap:!0,className:N(ia,"gs-utl-flex-grow gs-utl-overflow-hidden"),children:c.jsx(k,{col:!0,nowrap:!0,className:N(`${ia}__fields`,Ee.scrollY,"gs-utl-select-none"),children:n.length?n.map(({category:i,items:a},l)=>i?c.jsx(ar,{sticky:!0,open:s.get(i.id)??i.open,handler:o(`categories.${i.id}.label`)||i.label||i.id,onChange:({open:u})=>t.setCategoryOpen(i.id,u),className:u=>N(`${ia}__cat-fields`,sp.itemList({index:l,open:u,length:n.length}),l===0&&re.bt),children:c.jsx(f1,{category:i,items:a})},i.id):c.jsx(f1,{items:a,className:N(n.length!==1&&[re.bt,z.br])},l)):c.jsx(k,{className:N("gs-utl-text-center"),justify:"center",children:o("notFound")})})})}),Z$="gs-panel-global-styles",X$=h.memo(fe(function({className:t,...n}){return c.jsx(hs,{className:N(Z$,"gs-utl-overflow-auto",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-auto"),...n,children:c.jsx(Qa,{children:c.jsx(Y$,{})})})})),J$={maxWidth:`${Cw}px`},Q$="gs-cmp-layer-item";function Xy({component:e,draggingCmp:t,dragParent:n,...s}){const r=Ja(),{Layers:o}=r,i=h.useRef(null),[a,l]=h.useState(!1),[u,d]=h.useState(o.getLayerData(e)),{open:f,selected:p,hovered:g,components:m,visible:b,locked:v,name:x}=u,y=m.map(H=>H.cid),w=t===e,S=y.join("-"),C=s.level+1,j=g||n===e;h.useEffect(()=>{C===0&&d(o.getLayerData(e)),i.current&&(i.current.__cmp=e)},[e]),h.useEffect(()=>{const H=i.current;if(!H)return;const{select:$}=r.Components.events,I=O=>O===e&&H.scrollIntoView({block:"nearest"});return r.on($,I),()=>{r.off($,I)}},[e,i.current]),h.useEffect(()=>{const H=I=>{I===e&&d(o.getLayerData(I))},$=o.events.component;return r.on($,H),()=>{r.off($,H)}},[r,o,e]);const E=h.useMemo(()=>m.map(H=>c.jsx(Xy,{component:H,level:C,draggingCmp:t,dragParent:n},H.cid)),[S,t,n]),_=H=>{o.setLayerData(e,{name:H}),l(!1)},T=H=>{H.stopPropagation(),o.setLayerData(e,{open:!f})},P=H=>{H.stopPropagation(),o.setLayerData(e,{visible:!b})},A=H=>{H.stopPropagation(),o.setLayerData(e,{locked:!v})},M=H=>{H.stopPropagation(),o.setLayerData(e,{selected:!0},{event:H})},R=H=>{H.preventDefault(),r.runCommand(ie.contextMenuComponent,{source:Dp.layers,component:e,event:H.nativeEvent,x:H.clientX,y:H.clientY})},F=H=>{(!H||!t)&&o.setLayerData(e,{hovered:H})},L=mv(e),B=ee("layer-item",(p||L.isSymbol)&&L.bgSoftX,(!b||w)&&"opacity-50"),q=ee(je.xyS,re.b,j?L.border:re.bT,p&&L.bgSoft);return c.jsx("div",{className:Q$,children:c.jsxs(k,{col:!0,className:B,children:[c.jsx(D,{onClick:M,onContextMenu:R,onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),className:ee("group max-w-full"),"data-layer-item":!0,ref:i,children:c.jsxs(k,{items:"center",space:"xs",className:q,children:[c.jsx(D,{style:{marginLeft:`${C*10}px`},className:ee("cursor-pointer",!m.length&&"pointer-events-none opacity-0"),onClick:T,children:c.jsx(oe,{icon:Z.menuDown,size:le.sx,rotate:f?0:-90})}),c.jsx(D,{children:h0(e)}),c.jsx(D,{className:ee("truncate"),onDoubleClick:()=>l(!0),style:J$,grow:!0,children:a?c.jsx(uh,{value:x,onChange:_}):c.jsx(c.Fragment,{children:x})}),!a&&c.jsxs(c.Fragment,{children:[c.jsx(D,{className:ee("group-hover:gs-utl-opacity-100 cursor-pointer",v?"opacity-100":"opacity-0"),onClick:A,children:c.jsx(oe,{icon:v?Z.lock:Z.lockOpenVariant,size:le.s3x})}),c.jsx(D,{className:ee("group-hover:gs-utl-opacity-100 cursor-pointer",b?"opacity-0":"opacity-100"),onClick:P,children:c.jsx(oe,{icon:b?Z.eyeOutline:Z.eyeOffOutline,size:le.sx})})]})]})}),!!(f&&m.length)&&c.jsx(D,{className:ee("max-w-full",!f&&"hidden"),children:E})]})})}const e6={touchAction:"none"},p1=5,t6=e=>{var o,i;const t=document.elementFromPoint(e.clientX,e.clientY),n=t==null?void 0:t.closest("[data-layer-item]"),s=n==null?void 0:n.__cmp,r=((i=(o=s==null?void 0:s.delegate)==null?void 0:o.move)==null?void 0:i.call(o,s))||s;return{el:n,cmp:r}},Jy=fe(function({root:t,header:n}){const{editor:s}=ye(),[r,o]=h.useState(!1),[i,a]=h.useState({}),[l,u]=h.useState(),[d,f]=h.useState(),[p,g]=h.useState(),[m,b]=h.useState(),v=h.useRef(null);if(h.useEffect(()=>{const T=window.document,P=A=>{A.key==="Escape"&&(a({...i,result:!1}),S())};return T.addEventListener("keydown",P),()=>{T.removeEventListener("keydown",P)}},[]),!s)return null;const{Components:x}=s,y=T=>{T.button===0&&o(!0)},w=T=>{if(!r)return;const{cmp:P,el:A}=t6(T);if(!A||!P)return;const M=A.getBoundingClientRect(),R=A.offsetHeight,F=A.offsetTop,L=T.clientY,B=L<M.y+R/2,q=d||P,H=P.parent(),$=P.index()+(B?0:1);!d&&f(P),u(P);const I=x.canMove(H,q,$),O=x.canMove(P,q),V={...I,canMoveInside:O,index:$};let G=!1;O.result&&L>M.y+p1&&L<M.y+R-p1&&(G=!0,V.target=P,delete V.index),g(G?P:void 0),a(V),b({pointerInside:G,y:F+(B?0:R),h:R})},S=()=>{var T;i!=null&&i.result&&((T=i.source)==null||T.move(i.target,{at:i.index})),a({}),o(!1),f(void 0),u(void 0),g(void 0),b(void 0)},C=(l?l.parents():[]).length,j=!!(d&&m&&(i!=null&&i.result)&&!m.pointerInside),E=j?{top:m.y,left:0,marginLeft:C*10+20}:{},_=n&&(n==null?void 0:n.label)||"Layers";return c.jsxs(k,{col:!0,full:!0,nowrap:!0,className:ee("gs-layer-manager flex-grow overflow-hidden"),children:[n!==!1&&c.jsx(D,{children:c.jsxs(k,{space:"s",items:"center",className:ee([je.xy,re.bb,z.br]),children:[c.jsx(D,{children:c.jsx(oe,{icon:Z.layers,size:le.s})}),c.jsx(D,{grow:!0,children:_})]})}),c.jsxs(D,{className:ee("overflow-y-auto overflow-x-hidden text-sm select-none relative"),style:e6,onPointerDown:y,onPointerMove:w,onPointerUp:S,grow:!0,children:[!!t&&c.jsx(Xy,{component:t,level:-1,draggingCmp:d,dragParent:p}),j&&c.jsx("div",{ref:v,className:ee("absolute w-full gs-utl-h-0.5",z.cmp),style:E})]})]})}),Qy=h.forwardRef(function({children:t,className:n,...s},r){return c.jsx("div",{className:N(ue("gs-layer-manager-after"),n),ref:r,...s,children:t})}),ex=h.forwardRef(function({children:t,className:n,...s},r){return c.jsx("div",{className:N(ue("gs-layer-manager-before"),n),ref:r,...s,children:t})}),n6="gs-panel-layers",tx=h.memo(fe(function({className:t,...n}){const s=ye().sdkProps.children;return c.jsx(hs,{className:N(n6,"gs-utl-overflow-auto",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-auto"),...n,children:c.jsx(sy,{children:r=>c.jsxs(c.Fragment,{children:[Bn(s,ex),c.jsx(Jy,{...r,header:!1}),Bn(s,Qy)]})})})})),so="gs-cmp-file-field";function ja(e){var C;const{className:t,value:n,btnLabel:s,nameLabel:r,size:o,isContain:i,clear:a,inputField:l,placeholder:u,preview:d=50,disabled:f,hideButton:p,labelAs:g,onChange:m,onOpen:b}=e,v=(n||"").replace(/^"|"$/gi,""),x=((C=v.split("/").pop())==null?void 0:C.split("?")[0])||"",y={minWidth:d,minHeight:d},w=v?{...y,backgroundImage:`url("${v}")`}:y,S=N(" gs-utl-w-full gs-utl-bg-checker gs-utl-bg-no-repeat gs-utl-bg-center",i?"gs-utl-bg-contain":"gs-utl-bg-cover",re.b,re.rnd,z.br);return c.jsxs(k,{className:N(so,t,"gs-utl-gap-1"),col:!0,nowrap:!0,children:[c.jsx(fs,{...e,as:g}),c.jsxs(k,{className:N(`${so}-content gs-utl-gap-1`,z.bg),items:"center",nowrap:!0,children:[c.jsx(D,{className:N(`${so}-preview`),children:c.jsx("div",{className:S,style:w})}),c.jsxs(D,{className:N(`${so}-fields gs-utl-overflow-hidden`),grow:!0,children:[x&&r!==!1&&c.jsx(Dr,{className:N(`${so}-name`,"gs-utl-mb-2",Ee.txtEllips),as:"div",size:o,capitalize:!1,children:x}),c.jsxs(k,{className:N(`${so}-buttons`),space:"s",nowrap:!0,children:[!p&&c.jsx(Ke,{onClick:()=>b==null?void 0:b(n),size:o,type:"button",block:!0,full:!0,disabled:f,children:s||"Select image"}),!!n&&a&&c.jsx(bt,{onClick:()=>m==null?void 0:m(""),title:a.tooltip,size:o,icon:{icon:Z.close,size:le.s},type:"button",block:!0})]})]})]}),l&&c.jsx(tt,{className:N(`${so}-input`),value:v,onChange:m,size:o,placeholder:u})]})}function s6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return h.useMemo(()=>s=>{t.forEach(r=>r(s))},t)}const vu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Oi(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function fh(e){return"nodeType"in e}function Xr(e){var t,n;return e?Oi(e)?e:fh(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ph(e){const{Document:t}=Xr(e);return e instanceof t}function Ai(e){return Oi(e)?!1:e instanceof Xr(e).HTMLElement}function nx(e){return e instanceof Xr(e).SVGElement}function Ni(e){return e?Oi(e)?e.document:fh(e)?ph(e)?e:Ai(e)||nx(e)?e.ownerDocument:document:document:document}const _o=vu?h.useLayoutEffect:h.useEffect;function r6(e){const t=h.useRef(e);return _o(()=>{t.current=e}),h.useCallback(function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.current==null?void 0:t.current(...s)},[])}function o6(){const e=h.useRef(null),t=h.useCallback((s,r)=>{e.current=setInterval(s,r)},[]),n=h.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function nl(e,t){const n=h.useRef();return h.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function hh(e){const t=r6(e),n=h.useRef(null),s=h.useCallback(r=>{r!==n.current&&(t==null||t(r,n.current)),n.current=r},[]);return[n,s]}let xd={};function sl(e,t){return h.useMemo(()=>{if(t)return t;const n=xd[e]==null?0:xd[e]+1;return xd[e]=n,e+"-"+n},[e,t])}function sx(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return s.reduce((o,i)=>{const a=Object.entries(i);for(const[l,u]of a){const d=o[l];d!=null&&(o[l]=d+e*u)}return o},{...t})}}const Ea=sx(1),rx=sx(-1);function i6(e){return"clientX"in e&&"clientY"in e}function a6(e){if(!e)return!1;const{KeyboardEvent:t}=Xr(e.target);return t&&e instanceof t}function l6(e){if(!e)return!1;const{TouchEvent:t}=Xr(e.target);return t&&e instanceof t}function Of(e){if(l6(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return i6(e)?{x:e.clientX,y:e.clientY}:null}const Pa=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Pa.Translate.toString(e),Pa.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),c6={display:"none"};function u6(e){let{id:t,value:n}=e;return h.createElement("div",{id:t,style:c6},n)}function d6(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const r={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return h.createElement("div",{id:t,style:r,role:"status","aria-live":s,"aria-atomic":!0},n)}function f6(){const[e,t]=h.useState("");return{announce:h.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const p6={draggable:`
332
+ `})};function Xc({children:e,text:t,onConfirm:n,onCancel:s,className:r="w-[200px]",confirmButtonProps:o={},...i}){const a=Ae();return l.jsx(ss,{...i,overlay:!0,title:!1,buttonAs:"span",handler:e,children:({close:c})=>l.jsxs(k,{className:K(r),space:"m",col:!0,children:[l.jsx(V,{grow:!0,className:K("text-center"),children:t||a.t("confirmAction")}),l.jsxs(k,{justify:"center",items:"center",gap:"m",nowrap:!0,children:[l.jsx(Ge,{variant:"pr",size:"m2",className:"gs-utl-whitespace-nowrap",onClick:()=>{c(),n==null||n()},...o,children:o.children||a.t("confirm")}),l.jsx(Ge,{size:"m2",className:"gs-utl-whitespace-nowrap",onClick:()=>{c(),s==null||s()},children:a.t("cancel")})]})]})})}const nm=new Map,sm=new Map,CL=async({html:e="",el:t})=>{const n=e,s={};if(document.body.attachShadow){const r=t.shadowRoot||t.attachShadow({mode:"open"});r.innerHTML=n}return s},jL=ae(function({template:t,projectType:n,skipProjectNamePopover:s,className:r,onSelect:o,onRemove:i}){var E;const a=Ae(),c=me(),u=c.editor,[d,p]=f.useState(""),h=f.useRef(null),g=a.t("projectManager.projectName"),m=!t.isTemplate&&c.currentProjectId===((E=t.data.custom)==null?void 0:E.id),b=n===mt.web,v=!t.isTemplate||s,x=()=>{v&&(o==null||o({editor:u,template:t,loadTemplate:y}))},y=c.setProject,w=T=>{T.preventDefault(),o({editor:u,template:t,loadTemplate:y})};f.useEffect(()=>{const O=setTimeout(async()=>{if(!h.current||!u)return;const P=`${t.isTemplate?"t-":""}${t.id}`;let _=nm.get(P);if(!_){let N=sm.get(n);if(!N){const H=new w9({appEditorStore:{sdkProps:{options:{licenseKey:""}}}});N=await SL(u.config.grapesjs,n,H.appEditorStore),sm.set(n,N)}_=N?wL(N,t.data,n):"",nm.set(P,_)}const M=h.current;CL({el:M,html:_})});return()=>clearTimeout(O)},[h,u,n,t.data]);const{media:S,author:C}=t,j=l.jsx(Ge,{className:ie("text-sm"),size:"m2",variant:"pr",onClick:x,disabled:m,children:a.t("select")});return l.jsx(Dn,{padding:!1,className:ie("overflow-hidden max-w-full group",r),children:l.jsxs(k,{col:!0,children:[l.jsxs(V,{className:ie("relative group h-36 bg-checker max-w-full"),children:[l.jsx("div",{className:ie("gs-utl-relative","gs-utl-h-full","gs-utl-overflow-hidden","gs-utl-flex","gs-utl-justify-center"),children:S?l.jsx("img",{src:S,alt:t.name,className:ie("max-w-full")}):l.jsx("div",{className:ie("gs-utl-w-[1200px]","gs-utl-flex-shrink-0","gs-utl-flex-grow-0","gs-utl-origin-top","gs-utl-bg-white","gs-utl-scale-[0.232]","gs-utl-h-[431.034%]"),ref:h})}),m&&l.jsx(jr,{className:ie("absolute top-2 right-2",B.bgA2),label:a.t("current"),s:"s",pill:!0}),l.jsx(k,{justify:"center",items:"center",className:ie(Se.coverAbs,B.bgH75,"group-hover:gs-utl-opacity-100 opacity-0 transition-opacity"),children:v?j:l.jsx(ss,{overlay:!0,title:!1,buttonAs:"span",handler:j,children:()=>l.jsx("form",{onSubmit:w,children:l.jsxs(k,{space:"m",col:!0,children:[l.jsx(V,{children:l.jsx(Je,{size:"s",value:d,onChange:p,placeholder:g,required:!0})}),l.jsx(V,{children:l.jsx(Ge,{type:"submit",variant:"pr",size:"m2",full:!0,children:a.t("load")})})]})})})})]}),l.jsxs(k,{className:ie("gjs-p-2 max-w-full",X.bt,B.br),col:!0,space:"s",children:[l.jsxs(k,{className:ie("text-sm w-full"),space:"s",nowrap:!0,children:[l.jsx(V,{className:ie(Se.txtEllips,"max-w-full"),grow:!0,children:t.name}),!!C&&l.jsxs(V,{children:["by"," ",l.jsx("a",{className:ie(Er.link),href:C.link,rel:"noreferrer",target:"_blank",children:C.name})]})]}),l.jsxs(k,{items:"center",children:[b&&l.jsxs(V,{className:ie("gjs-mr-auto"),children:[a.t("projectManager.pages"),": ",t.data.pages.length]}),!t.isTemplate&&i&&l.jsx(V,{className:ie("gjs-ml-auto"),children:l.jsx(Xc,{onConfirm:()=>i(t),className:"",children:l.jsx(ft,{title:a.t("delete"),children:l.jsx(Q,{icon:U.delete,size:oe.sx})})})})]})]})]})})}),U0=ae(function({templates:e,projectType:t,content:n,skipProjectNamePopover:s,onSelect:r,onRemove:o}){const[i]=xf(),c=Ae().tScoped("templates"),d=me().editor,p=Mf(n==null?void 0:n.itemsPerRow),h=r??(({template:g,loadTemplate:m})=>m(g));return l.jsx(l.Fragment,{children:d&&e?e.length===0?l.jsx(k,{justify:"center",children:c("notFound")}):l.jsx(Yc,{data:e,listClassName:ie("grid gap-2 gjs-pr-2",p),itemContent:(g,m)=>l.jsx(jL,{template:m,projectType:t,onSelect:h,onRemove:o,skipProjectNamePopover:s},m.id)},i):l.jsx(ho,{})})}),EL=ae(function(){var b;const t=me(),n=Fv(),{filteredTemplates:s,projectSourceFilter:r,projectTypeFilter:o}=n,i=Ae(),a=di(),{sdkOptions:c}=t,u=i.tScoped("projectManager"),d=async({loadTemplate:v,template:x})=>{v(x),a.close()},p=async v=>{n.setProjectTypeFilter(v),await n.loadAllTemplates()},h=v=>{n.removeProject(v.id),n.loadProjects()},g=f.useMemo(()=>[{id:ra.Existing,label:u("existentProjects")},{id:ra.Templates,label:u("templates")}],[i]),m=((b=c.project)==null?void 0:b.types)&&xp();return f.useEffect(()=>{n.loadAllTemplates()},[]),l.jsxs(k,{col:!0,full:!0,space:"m",children:[m&&l.jsx(k,{items:"center",space:"m",children:l.jsx(V,{className:ie("gjs-ml-auto"),children:l.jsx(je,{value:o,onChange:p,options:PM(),handlerSelected:v=>l.jsxs(l.Fragment,{children:[l.jsx("b",{children:u("projectType")}),": ",v.label]})})})}),l.jsx(V,{children:l.jsx(Dr,{tabs:g,value:r,onChange:n.setProjectSourceFilter})}),l.jsx(V,{grow:!0,children:l.jsx(U0,{templates:s,projectType:mt[o],onSelect:d,onRemove:h,content:{itemsPerRow:3}})})]})}),PL=({items:e,editor:t,customItems:n})=>n===!1?[]:Ke(n)?n({items:e,editor:t}):n||e,rm=e=>({icon:U.plus,size:oe.s,className:K("gs-utl-transition-transform",e&&"gs-utl-rotate-45")}),W0=e=>!e.type||e.type==="button",TL="gs-cmp-topbar-left",OL=ae(function({buttons:t,className:n,style:s}){const r=me(),o=Ae(),{isOpen:i,toggleOpen:a}=K3(),c=r.editor,d=o.tScoped("blockManager")("blocks"),p=PL({items:[{id:`blocks-${d}`,tooltip:d,size:c0.s,icon:rm(i),variant:l0.primary,editorEvents:{[xn.toggleBlocksPanel]:({fromEvent:h,setState:g})=>{g({icon:rm(h.isOpen)})}},onClick:()=>a()}],customItems:t,editor:c});return l.jsx(k,{gap:"s",items:"center",justify:"start",className:K(TL,we.xS,n),style:s,nowrap:!0,children:p.map(({id:h,...g})=>W0(g)?l.jsx(Bc,{...g},h):Pt({id:h,...g}))})}),_L=[{id:wr.auto,label:"Auto"},{id:wr.dark,label:"Dark"},{id:wr.light,label:"Light"}],AL={size:"s"},Ku=".grapesjs",ML=(e,t)=>{const n=e==null?void 0:e.settingsMenu;return n!==!1&&(n==null?void 0:n[t])!==!1},LL=({actions:e,editor:t,buttons:n,sdkOptions:s})=>{const r=s.actions;return r===!1?[]:Ke(r)?r({actions:e,editor:t}):r||(n?Ke(n)?n({items:e,editor:t}):n:e)},NL="gs-cmp-topbar-right",$L=ae(function({editor:t,className:n,buttons:s,...r}){const o=me(),{theme:i,setTheme:a}=_s(),{Commands:c,UndoManager:u}=t,{installEvent:d,appInstalled:p,isBrowserMode:h,setInstallEvent:g,sdkOptions:m,isProjectTypeEmail:b}=o,v=di(),x=Ae(),y=M=>x.t(`actions.${M}`),w=t.Storage.events,S=c.events,C="change:changesCount",j=(M,N)=>()=>{Ke(M)?M({editor:t}):c.isActive(M)?c.stop(M):c.run(M,N)},E=M=>({[`${S.runCommand}${M}`]:({setState:N})=>N({active:!0}),[`${S.stopCommand}${M}`]:({setState:N})=>N({active:!1})}),T=[{id:Un.componentOutline,icon:U.borderRadius,tooltip:y("componentOutline.title"),onClick:j("core:component-outline"),editorEvents:E("core:component-outline")},{id:Un.preview,icon:U.eye,tooltip:y("preview.title"),onClick:j("core:preview"),editorEvents:E("core:preview")},{id:Un.fullscreen,icon:U.arrowExpandAll,tooltip:y("fullscreen.title"),onClick:j("core:fullscreen",{target:"body"}),editorEvents:E("core:fullscreen")},{id:Un.showCode,icon:U.xml,tooltip:y("showCode.title"),onClick:()=>t.runCommand(se.dialogExportCode)},{id:Un.showImportCode,icon:U.trayArrowDown,tooltip:y("importCode.title"),onClick:()=>v.open({title:y("importCode.title"),content:()=>l.jsx(p0,{})})},{id:Un.clearCanvas,icon:U.delete,tooltip:y("clearCanvas.title"),onClick:()=>v.confirm({title:y("clearCanvas.title"),content:y("clearCanvas.content"),confirmButton:{variant:"danger",children:y("clearCanvas.title")},onConfirm:()=>{b?t.loadProjectData({pages:[{component:"<mjml><mj-body></mj-body></mjml>"}]}):t.Components.clear()}})},{id:Un.store,tooltip:y("store.title"),onClick:async()=>!o.isSaving&&t.store(),editorEvents:{"change:changesCount":({setState:M})=>M({}),[w.startStore]:({setState:M})=>M({disabled:!0}),[w.endStore]:({setState:M})=>M({disabled:!1})},label:()=>l.jsxs("div",{className:K("relative"),children:[l.jsx(Q,{icon:U.floppy,size:oe.s}),!!t.getDirtyCount()&&!o.isSaving&&l.jsx("div",{className:K("absolute right-0 gjs-p-0.5 bottom-0 gjs-rounded-full",B.bg),children:l.jsx("div",{className:K(Se.dot,B.bgW)})}),o.isSaving&&l.jsx("div",{className:K("absolute right-0 bottom-0 gjs-rounded-full",B.bg),children:l.jsx(Q,{icon:U.refresh,size:"11px",className:K(Se.spin)})})]})},{id:Un.undo,icon:U.arrowULeftTop,disabled:!0,onClick:j("core:undo"),editorEvents:{[C]:({setState:M})=>M({disabled:!u.hasUndo()})}},{id:Un.redo,icon:U.arrowURightTop,disabled:!0,onClick:j("core:redo"),editorEvents:{[C]:({setState:M})=>M({disabled:!u.hasRedo()})}}],O=LL({actions:T,sdkOptions:m,editor:t,buttons:s}),P=[{id:"about",label:y("about.title"),icon:U.helpCircle,action:()=>v.open({size:"m",title:y("about.title"),content:()=>l.jsx(jM,{})})},{id:"embed",label:y("embed.title"),icon:U.powerPlug,action:()=>v.open({size:"m",title:y("embed.title"),content:()=>l.jsx(EM,{})})},{id:"openProject",label:y("open.title"),icon:U.folder,action:async()=>{let M="";try{M=await(await aM({extensions:[Ku]})).text()}catch(N){return console.error(N)}o.loadProjectData(JSON.parse(M))}},{id:"saveProject",label:y("save.title"),icon:U.contentSave,action:async()=>{const M=t.getProjectData(),N=new Blob([JSON.stringify(M)]),H=`Untitled-${new Date().toISOString().replace("T","-").replace(/:|\./g,"").substring(0,17)}`;try{await cM(N,{fileName:`${H}${Ku}`,extensions:[Ku]})}catch(L){return console.error(L)}}},{id:"loadProject",label:y("newProject.title"),icon:U.newspaperVariantOutline,action:()=>v.open({fullH:!0,title:y("newProject.title"),content:()=>l.jsx(EL,{})})},{id:"installApp",label:y(p?"installApp.installed":"installApp.title"),icon:U.applicationBracketsOutline,action:async()=>{if(p)return;d==null||d.prompt();const M=await(d==null?void 0:d.userChoice);(M==null?void 0:M.outcome)==="accepted"&&g()}},...m.customTheme?[]:[{id:"theme",label:l.jsxs(k,{items:"center",space:"m",children:[l.jsx(V,{children:"Theme"}),l.jsx(V,{children:l.jsx(Dr,{tabs:_L,onChange:M=>a(M),value:i,variant:"pills"})})]})}]].filter(({id:M})=>!((!h||!d)&&M==="installApp"||!ML(m,M))),_=(M,N)=>H=>{Ke(M)&&(M(H),N())};return l.jsxs(k,{space:"s",items:"center",justify:"end",className:K(NL,we.xS,n),nowrap:!0,...r,children:[O.map(({id:M,...N})=>W0(N)?l.jsx(Bc,{size:"s",...N},M):Pt({id:M,...N})),l.jsx(V,{children:m.settingsMenu!==!1&&P.length>0&&l.jsx(ss,{placement:"bottom-end",title:!1,padding:!1,handler:l.jsx(Q,{icon:U.cog,size:oe.s}),buttonProps:AL,overlay:!0,children:({close:M})=>l.jsx(l.Fragment,{children:P.map(N=>l.jsx(hi,{action:_(N.action,M),icon:N.icon,label:N.label},N.id))})})})]})});function kL({devices:e,selected:t,className:n,style:s,select:r}){const o=e.map(i=>({id:i.id,label:i.getName(),icon:i.attributes.icon}));return o.length?l.jsx(je,{size:"xs",className:n,style:s,value:t,options:o,onChange:r}):null}const RL="gs-devices",G0=f.memo(function({className:t,style:n}){return l.jsx(B4,{children:s=>l.jsx(kL,{className:A(RL,t),style:n,...s})})}),Ti="gs-cmp-editor-topbar",IL=ae(function({className:t,height:n,style:s,children:r,leftContainer:o,rightContainer:i,devices:a}){const{topBarSize:c,isInPreview:u,editor:d,isTopSidebarOpen:p}=me(),h=n??c,g=f.useMemo(()=>({...s,minHeight:h,marginTop:u||!p?`-${h}px`:0}),[u,p,s]);return l.jsxs(l.Fragment,{children:[l.jsx(V,{className:A(Ti,"gs-utl-transition-spacing gs-utl-w-full",X.bb,B.br,t),style:g,children:r??l.jsxs(k,{className:A(`${Ti}__wrp`,"gs-utl-h-full"),items:"center",full:!0,nowrap:!0,children:[l.jsx(V,{className:A(`${Ti}__wrp-left`),grow:!0,children:o!==!1&&l.jsx(OL,{...o})}),l.jsx(V,{className:A(`${Ti}__wrp-center`),children:a!==!1&&l.jsx(G0,{...a})}),l.jsx(V,{className:A(`${Ti}__wrp-right`),grow:!0,children:i!==!1&&d&&l.jsx($L,{editor:d,...i})})]})}),l.jsx(V,{className:A("gs-utl-transition-transform gs-utl-absolute gs-utl-top-0 gs-utl-left-0 gs-utl-z-10",!u&&"-gs-utl-translate-y-full"),children:l.jsx(Ge,{className:A("gs-cmp-close-preview gs-utl-m-4",B.bg),size:"s",onClick:()=>d==null?void 0:d.Commands.stop("core:preview"),children:l.jsx(Q,{icon:U.eyeOff,size:oe.s})})})]})}),VL="gs-sidebar-top",q0=f.memo(ae(function({height:t,children:n,...s}){return l.jsx(IL,{height:t,...s,style:Uc(s),className:A(VL,"gs-utl-flex",zc(s)),children:n?Pt(n):void 0})})),HL="gs-canvas-sidebar-top",DL=f.memo(ae(function({className:t,sidebarTop:n,...s}){return l.jsxs(dn,{className:A(HL,"gs-utl-flex gs-utl-flex-col",t),grow:!0,...s,children:[l.jsx(q0,{...n}),l.jsx(T0,{grow:!0})]})})),FL="gs-code-field",BL=ae(function(e){const{editor:t}=me(),{isDarkTheme:n}=_s(),{editorEvents:s,onChange:r}=e,[o,i]=f.useState(()=>e),a=u=>({value:u,editor:t,state:o,setState:d=>i(p=>({...p,...d}))}),c=u=>r==null?void 0:r(a(u||""));return zr({editor:t,editorEvents:s,localState:o,setLocalState:i}),l.jsx(Xs,{className:A(FL,o.className),language:o.language,style:o.style,label:o.label,name:o.name,defaultValue:o.value,size:o.size,required:o.required,disabled:o.disabled,readOnly:o.readOnly,minHeight:o.minHeight,row:o.row,isDarkTheme:n,monacoOptions:e.monacoOptions,onChange:c})});var zL={grad:.9,turn:360,rad:360/(2*Math.PI)},Rs=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Nt=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Rn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},K0=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},om=function(e){return{r:Rn(e.r,0,255),g:Rn(e.g,0,255),b:Rn(e.b,0,255),a:Rn(e.a)}},Zu=function(e){return{r:Nt(e.r),g:Nt(e.g),b:Nt(e.b),a:Nt(e.a,3)}},UL=/^#([0-9a-f]{3,8})$/i,hl=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Z0=function(e){var t=e.r,n=e.g,s=e.b,r=e.a,o=Math.max(t,n,s),i=o-Math.min(t,n,s),a=i?o===t?(n-s)/i:o===n?2+(s-t)/i:4+(t-n)/i:0;return{h:60*(a<0?a+6:a),s:o?i/o*100:0,v:o/255*100,a:r}},Y0=function(e){var t=e.h,n=e.s,s=e.v,r=e.a;t=t/360*6,n/=100,s/=100;var o=Math.floor(t),i=s*(1-n),a=s*(1-(t-o)*n),c=s*(1-(1-t+o)*n),u=o%6;return{r:255*[s,a,i,i,c,s][u],g:255*[c,s,s,a,i,i][u],b:255*[i,i,c,s,s,a][u],a:r}},im=function(e){return{h:K0(e.h),s:Rn(e.s,0,100),l:Rn(e.l,0,100),a:Rn(e.a)}},am=function(e){return{h:Nt(e.h),s:Nt(e.s),l:Nt(e.l),a:Nt(e.a,3)}},lm=function(e){return Y0((n=(t=e).s,{h:t.h,s:(n*=((s=t.l)<50?s:100-s)/100)>0?2*n/(s+n)*100:0,v:s+n,a:t.a}));var t,n,s},Wi=function(e){return{h:(t=Z0(e)).h,s:(r=(200-(n=t.s))*(s=t.v)/100)>0&&r<200?n*s/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,s,r},WL=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,GL=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,qL=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,KL=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ep={string:[[function(e){var t=UL.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Nt(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Nt(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=qL.exec(e)||KL.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:om({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=WL.exec(e)||GL.exec(e);if(!t)return null;var n,s,r=im({h:(n=t[1],s=t[2],s===void 0&&(s="deg"),Number(n)*(zL[s]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return lm(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,s=e.b,r=e.a,o=r===void 0?1:r;return Rs(t)&&Rs(n)&&Rs(s)?om({r:Number(t),g:Number(n),b:Number(s),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,n=e.s,s=e.l,r=e.a,o=r===void 0?1:r;if(!Rs(t)||!Rs(n)||!Rs(s))return null;var i=im({h:Number(t),s:Number(n),l:Number(s),a:Number(o)});return lm(i)},"hsl"],[function(e){var t=e.h,n=e.s,s=e.v,r=e.a,o=r===void 0?1:r;if(!Rs(t)||!Rs(n)||!Rs(s))return null;var i=function(a){return{h:K0(a.h),s:Rn(a.s,0,100),v:Rn(a.v,0,100),a:Rn(a.a)}}({h:Number(t),s:Number(n),v:Number(s),a:Number(o)});return Y0(i)},"hsv"]]},cm=function(e,t){for(var n=0;n<t.length;n++){var s=t[n][0](e);if(s)return[s,t[n][1]]}return[null,void 0]},ZL=function(e){return typeof e=="string"?cm(e.trim(),ep.string):typeof e=="object"&&e!==null?cm(e,ep.object):[null,void 0]},Yu=function(e,t){var n=Wi(e);return{h:n.h,s:Rn(n.s+100*t,0,100),l:n.l,a:n.a}},Xu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},um=function(e,t){var n=Wi(e);return{h:n.h,s:n.s,l:Rn(n.l+100*t,0,100),a:n.a}},tp=function(){function e(t){this.parsed=ZL(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return Nt(Xu(this.rgba),2)},e.prototype.isDark=function(){return Xu(this.rgba)<.5},e.prototype.isLight=function(){return Xu(this.rgba)>=.5},e.prototype.toHex=function(){return t=Zu(this.rgba),n=t.r,s=t.g,r=t.b,i=(o=t.a)<1?hl(Nt(255*o)):"","#"+hl(n)+hl(s)+hl(r)+i;var t,n,s,r,o,i},e.prototype.toRgb=function(){return Zu(this.rgba)},e.prototype.toRgbString=function(){return t=Zu(this.rgba),n=t.r,s=t.g,r=t.b,(o=t.a)<1?"rgba("+n+", "+s+", "+r+", "+o+")":"rgb("+n+", "+s+", "+r+")";var t,n,s,r,o},e.prototype.toHsl=function(){return am(Wi(this.rgba))},e.prototype.toHslString=function(){return t=am(Wi(this.rgba)),n=t.h,s=t.s,r=t.l,(o=t.a)<1?"hsla("+n+", "+s+"%, "+r+"%, "+o+")":"hsl("+n+", "+s+"%, "+r+"%)";var t,n,s,r,o},e.prototype.toHsv=function(){return t=Z0(this.rgba),{h:Nt(t.h),s:Nt(t.s),v:Nt(t.v),a:Nt(t.a,3)};var t},e.prototype.invert=function(){return ls({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),ls(Yu(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),ls(Yu(this.rgba,-t))},e.prototype.grayscale=function(){return ls(Yu(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),ls(um(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),ls(um(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?ls({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):Nt(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=Wi(this.rgba);return typeof t=="number"?ls({h:t,s:n.s,l:n.l,a:n.a}):Nt(n.h)},e.prototype.isEqual=function(t){return this.toHex()===ls(t).toHex()},e}(),ls=function(e){return e instanceof tp?e:new tp(e)},dm=[],YL=function(e){e.forEach(function(t){dm.indexOf(t)<0&&(t(tp,ep),dm.push(t))})};function XL(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},s={};for(var r in n)s[n[r]]=r;var o={};e.prototype.toName=function(i){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,c,u=s[this.toHex()];if(u)return u;if(i!=null&&i.closest){var d=this.toRgb(),p=1/0,h="black";if(!o.length)for(var g in n)o[g]=new e(n[g]).toRgb();for(var m in n){var b=(a=d,c=o[m],Math.pow(a.r-c.r,2)+Math.pow(a.g-c.g,2)+Math.pow(a.b-c.b,2));b<p&&(p=b,h=m)}return h}},t.string.push([function(i){var a=i.toLowerCase(),c=a==="transparent"?"#0000":n[a];return c?new e(c).toRgb():null},"name"])}function Jc(){return(Jc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e}).apply(this,arguments)}function X0(e,t){if(e==null)return{};var n,s,r={},o=Object.keys(e);for(s=0;s<o.length;s++)t.indexOf(n=o[s])>=0||(r[n]=e[n]);return r}function np(e){var t=f.useRef(e),n=f.useRef(function(s){t.current&&t.current(s)});return t.current=e,n.current}var ai=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Gi=function(e){return"touches"in e},sp=function(e){return e&&e.ownerDocument.defaultView||self},pm=function(e,t,n){var s=e.getBoundingClientRect(),r=Gi(t)?function(o,i){for(var a=0;a<o.length;a++)if(o[a].identifier===i)return o[a];return o[0]}(t.touches,n):t;return{left:ai((r.pageX-(s.left+sp(e).pageXOffset))/s.width),top:ai((r.pageY-(s.top+sp(e).pageYOffset))/s.height)}},fm=function(e){!Gi(e)&&e.preventDefault()},Lf=f.memo(function(e){var t=e.onMove,n=e.onKey,s=X0(e,["onMove","onKey"]),r=f.useRef(null),o=np(t),i=np(n),a=f.useRef(null),c=f.useRef(!1),u=f.useMemo(function(){var g=function(v){fm(v),(Gi(v)?v.touches.length>0:v.buttons>0)&&r.current?o(pm(r.current,v,a.current)):b(!1)},m=function(){return b(!1)};function b(v){var x=c.current,y=sp(r.current),w=v?y.addEventListener:y.removeEventListener;w(x?"touchmove":"mousemove",g),w(x?"touchend":"mouseup",m)}return[function(v){var x=v.nativeEvent,y=r.current;if(y&&(fm(x),!function(S,C){return C&&!Gi(S)}(x,c.current)&&y)){if(Gi(x)){c.current=!0;var w=x.changedTouches||[];w.length&&(a.current=w[0].identifier)}y.focus(),o(pm(y,x,a.current)),b(!0)}},function(v){var x=v.which||v.keyCode;x<37||x>40||(v.preventDefault(),i({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},b]},[i,o]),d=u[0],p=u[1],h=u[2];return f.useEffect(function(){return h},[h]),f.createElement("div",Jc({},s,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:r,onKeyDown:p,tabIndex:0,role:"slider"}))}),Qc=function(e){return e.filter(Boolean).join(" ")},Nf=function(e){var t=e.color,n=e.left,s=e.top,r=s===void 0?.5:s,o=Qc(["react-colorful__pointer",e.className]);return f.createElement("div",{className:o,style:{top:100*r+"%",left:100*n+"%"}},f.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},en=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},J0=function(e){var t=e.s,n=e.v,s=e.a,r=(200-t)*n/100;return{h:en(e.h),s:en(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:en(r/2),a:en(s,2)}},rp=function(e){var t=J0(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Ju=function(e){var t=J0(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},JL=function(e){var t=e.h,n=e.s,s=e.v,r=e.a;t=t/360*6,n/=100,s/=100;var o=Math.floor(t),i=s*(1-n),a=s*(1-(t-o)*n),c=s*(1-(1-t+o)*n),u=o%6;return{r:en(255*[s,a,i,i,c,s][u]),g:en(255*[c,s,s,a,i,i][u]),b:en(255*[i,i,c,s,s,a][u]),a:en(r,2)}},QL=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?eN({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},eN=function(e){var t=e.r,n=e.g,s=e.b,r=e.a,o=Math.max(t,n,s),i=o-Math.min(t,n,s),a=i?o===t?(n-s)/i:o===n?2+(s-t)/i:4+(t-n)/i:0;return{h:en(60*(a<0?a+6:a)),s:en(o?i/o*100:0),v:en(o/255*100),a:r}},tN=f.memo(function(e){var t=e.hue,n=e.onChange,s=Qc(["react-colorful__hue",e.className]);return f.createElement("div",{className:s},f.createElement(Lf,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:ai(t+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":en(t),"aria-valuemax":"360","aria-valuemin":"0"},f.createElement(Nf,{className:"react-colorful__hue-pointer",left:t/360,color:rp({h:t,s:100,v:100,a:1})})))}),nN=f.memo(function(e){var t=e.hsva,n=e.onChange,s={backgroundColor:rp({h:t.h,s:100,v:100,a:1})};return f.createElement("div",{className:"react-colorful__saturation",style:s},f.createElement(Lf,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:ai(t.s+100*r.left,0,100),v:ai(t.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+en(t.s)+"%, Brightness "+en(t.v)+"%"},f.createElement(Nf,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:rp(t)})))}),sN=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},rN=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function oN(e,t,n){var s=np(n),r=f.useState(function(){return e.toHsva(t)}),o=r[0],i=r[1],a=f.useRef({color:t,hsva:o});f.useEffect(function(){if(!e.equal(t,a.current.color)){var u=e.toHsva(t);a.current={hsva:u,color:t},i(u)}},[t,e]),f.useEffect(function(){var u;sN(o,a.current.hsva)||e.equal(u=e.fromHsva(o),a.current.color)||(a.current={hsva:o,color:u},s(u))},[o,e,s]);var c=f.useCallback(function(u){i(function(d){return Object.assign({},d,u)})},[]);return[o,c]}var iN=typeof window<"u"?f.useLayoutEffect:f.useEffect,aN=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},hm=new Map,lN=function(e){iN(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!hm.has(t)){var n=t.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}`,hm.set(t,n);var s=aN();s&&n.setAttribute("nonce",s),t.head.appendChild(n)}},[])},cN=function(e){var t=e.className,n=e.hsva,s=e.onChange,r={backgroundImage:"linear-gradient(90deg, "+Ju(Object.assign({},n,{a:0}))+", "+Ju(Object.assign({},n,{a:1}))+")"},o=Qc(["react-colorful__alpha",t]),i=en(100*n.a);return f.createElement("div",{className:o},f.createElement("div",{className:"react-colorful__alpha-gradient",style:r}),f.createElement(Lf,{onMove:function(a){s({a:a.left})},onKey:function(a){s({a:ai(n.a+a.left)})},"aria-label":"Alpha","aria-valuetext":i+"%","aria-valuenow":i,"aria-valuemin":"0","aria-valuemax":"100"},f.createElement(Nf,{className:"react-colorful__alpha-pointer",left:n.a,color:Ju(n)})))},uN=function(e){var t=e.className,n=e.colorModel,s=e.color,r=s===void 0?n.defaultColor:s,o=e.onChange,i=X0(e,["className","colorModel","color","onChange"]),a=f.useRef(null);lN(a);var c=oN(n,r,o),u=c[0],d=c[1],p=Qc(["react-colorful",t]);return f.createElement("div",Jc({},i,{ref:a,className:p}),f.createElement(nN,{hsva:u,onChange:d}),f.createElement(tN,{hue:u.h,onChange:d}),f.createElement(cN,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},dN={defaultColor:"rgba(0, 0, 0, 1)",toHsva:QL,fromHsva:function(e){var t=JL(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:rN},pN=function(e){return f.createElement(uN,Jc({},e,{colorModel:dN}))};YL([XL]);const fN=e=>e.startsWith("rgba")?e:ls(e).toRgbString();function Q0({value:e,onChange:t,disabled:n}){const s=fN(e||""),r=f.useRef(s),[o,i]=f.useState(!1),a=Ts()&&!!window.EyeDropper,c=g=>{r.current=g,t==null||t(g)},u=g=>{r.current=g,t==null||t(g,!0)},d=()=>{a&&new window.EyeDropper().open().then(m=>c(m.sRGBHex)).catch(console.warn)},p=()=>{i(!0)},h=()=>{t==null||t(r.current,!1),i(!1)};return l.jsxs(l.Fragment,{children:[o&&l.jsx("div",{onPointerUp:h,className:"gs-utl-fixed gs-utl-inset-0 gs-utl-z-50 gs-utl-cursor-grabbing"}),l.jsx(pN,{className:"color-picker",color:s,onChange:u,onPointerDown:p,onPointerUp:h}),l.jsxs(k,{className:"gs-utl-mt-3",gap:"s",children:[l.jsx(V,{grow:!0,children:l.jsx(Je,{size:"s",value:s,onChange:c,disabled:n})}),a&&l.jsx(Ge,{type:"button",onClick:d,children:l.jsx(Q,{icon:U.eyedropperVariant,size:oe.s})})]})]})}const hN="gs-cmp-studio-color-picker",gN=f.memo(ae(function({className:t,style:n,value:s="",disabled:r,onChange:o,editorEvents:i}){const{editor:a}=me(),[c,u]=f.useState(()=>({className:t,style:n,value:s,disabled:r})),d=(p,h)=>{const g=p||"";o==null||o({value:g,partial:h,editor:a,state:c,setState:m=>u(b=>({...b,...m}))})};return zr({editor:a,editorEvents:i,localState:c,setLocalState:u}),l.jsx("div",{className:A(hN,c.className,we.m),style:c.style,children:l.jsx(Q0,{value:c.value||"",onChange:d,disabled:c.disabled})})})),mN="gs-cmp-column",bN=f.memo(function({className:t,children:n,full:s,...r}){return l.jsx(dn,{className:A(mN,B.bg,"gs-utl-flex gs-utl-flex-col",s&&"gs-utl-h-full",t),...r,children:Pt(n)})}),$f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
333
+ <path fill="currentColor" d="M20 6c0-2.168-3.663-4-8-4S4 3.832 4 6v2c0 2.168 3.663 4 8 4s8-1.832 8-4zm-8 13c-4.337 0-8-1.832-8-4v3c0 2.168 3.663 4 8 4s8-1.832 8-4v-3c0 2.168-3.663 4-8 4"/><path fill="currentColor" d="M20 10c0 2.168-3.663 4-8 4s-8-1.832-8-4v3c0 2.168 3.663 4 8 4s8-1.832 8-4z"/></svg>`,Qr="--before-content",kf={select:!0,activate:!0,category:{id:"data-sources",label:"Data Sources"}},ey={stylable:!1,traits:[]};function vN(e){return typeof e=="object"&&e.type===kt.variable}function gm(e){if(vN(e)){const{path:t}=e;return ty(t||"")}return e}function ty(e){return`{{ ${e} }}`}function yN(e){const t={};return e.DataSources.getAll().forEach(n=>{const s=n.get("id");if(!s)return;const r=n.getRecords();if(!r){t[s]={};return}t[s]=r.reduce((o,i)=>{if(!i)return o;let a={...i.attributes};return delete a.__p,delete a.id,s===Po.globalStyles&&(a={value:a.value}),{...o,[i.id]:a}},{})}),t}function ny(e){return Object.entries(e||{}).map(([t,n])=>({id:t,data:n}))}const Rf=e=>{var o,i;const{isProjectTypeEmail:t,sdkOptions:n}=e;return((i=(o=n.dataSources)==null?void 0:o.exportConfig)==null?void 0:i.skipTags)??t?{...ey}:{}},op=e=>{var o,i;const{isProjectTypeEmail:t,sdkOptions:n}=e,s=(i=(o=n.dataSources)==null?void 0:o.exportConfig)==null?void 0:i.skipTags;return t||s===!0?{...ey}:{}},xN=e=>!!e&&typeof e=="object"&&"logicalOperator"in e,wN=e=>Array.isArray(e)?"array":e===null?"default":typeof e,SN=ae(({name:e,value:t,isActive:n,isCollection:s,onClick:r,className:o})=>{const i=Ae().tScoped("dataSources"),a=typeof t=="object"&&t!==null,c={array:U.codeBrackets,object:U.codeBraces,string:U.codeString,number:U.number,boolean:U.toggleSwitchOffOutline,default:U.null},u=wN(t),d=A(o,"gs-utl-text-left",B.hBgH,X.b,X.rnd,we.xy,n?[X.bA,B.tA]:[B.br,B.txtHighEmphasisH]),p=h=>typeof h=="object"?Array.isArray(h)?i("items",{params:{length:h.length}}):h?i("properties",{params:{length:Object.keys(h).length}}):"null":String(h);return l.jsx(Ge,{onClick:r,border:!1,className:d,full:!0,children:l.jsxs(k,{items:"center",justify:"between",gap:"s",nowrap:!0,children:[l.jsxs(k,{className:"gs-utl-flex-grow gs-utl-overflow-hidden",gap:"s",col:!0,children:[l.jsxs(k,{className:"gs-utl-overflow-hidden",items:"center",gap:"s",full:!0,nowrap:!0,children:[l.jsx(Q,{icon:c[u],size:oe.s}),l.jsx(V,{className:A(Se.txtEllips,s&&"gs-utl-font-bold"),children:e})]}),l.jsx(V,{className:A("gs-utl-w-full",Se.txtEllips,Se.disabled),children:p(t)})]}),a&&l.jsx(V,{children:l.jsx(Q,{size:oe.sx,icon:U.arrowRight,className:A(n&&"gs-utl-rotate-180","gs-utl-transition-transform gs-utl-duration-200")})})]})})}),CN="gs-cmp-data-path-explorer",mm=ae(function({additionalSources:t,onChange:n,path:s=""}){const{editor:r}=me(),o=f.useRef({}),[i,a]=f.useState(()=>s.split(".")),[c,u]=f.useState([]),d=f.useMemo(()=>({...r?yN(r):{},...t}),[r,t]),p=(b,v)=>{let x=o.current;for(let y=0;y<v&&y<b.length;y++){const w=b[y];if(x&&typeof x=="object"&&w in x)x=x[w];else{x=void 0;break}}return!x||typeof x!="object"?[]:Object.entries(x).map(([y,w])=>{const S=b.slice(0,v).concat(y),C=i[v]===y,j=v===0&&tr(w)&&w.collectionId===y,E=()=>{const T=C?S.slice(0,-1):S;n==null||n(T.join("."),{paths:T}),a(T)};return l.jsx(SN,{className:A(j&&"-gs-utl-order-1"),isCollection:j,name:y,value:w,isActive:C,onClick:E},y)})};f.useEffect(()=>{o.current=d;const b=[];for(let v=0;v<=i.length;v++){const x=p(i,v);x.length>0&&b.push(x)}u(b)},[d,i]);const h=A(CN,B.bg,B.br,X.b,X.rnd,Se.scrollX,"gs-utl-h-full"),g=A("gs-utl-min-w-[220px]",B.br),m=A("gs-utl-h-full gs-utl-max-h-[60vh]",Se.scrollY,we.xyS);return l.jsx(k,{className:h,full:!0,nowrap:!0,children:c.map((b,v)=>l.jsx(V,{className:A(g,v!==c.length-1&&X.br),children:l.jsx(k,{col:!0,nowrap:!0,gap:"m",className:m,children:b})},v))})});function sy(e){const{collectionId:t,variableType:n,path:s=""}=e;return t?[t,n,s].filter(Boolean).join("."):s}function If(e,t){const[n="",s="",...r]=e.split(".");return n&&t[n]?{collectionId:n,variableType:s,path:r.join(".")}:{path:e,collectionId:void 0,variableType:void 0}}const jN=e=>{const{path:t,collectionId:n,variableType:s}=e.dataResolver||{};return n?[n,s,t].filter(Boolean).join("."):e.value||t||""},EN=e=>{const{dataResolver:t,editor:n,value:s,defaultValue:r,additionalSources:o}=e,{path:i="",collectionId:a,variableType:c}=t||{},u=n==null?void 0:n.DataSources;if(a){const d=o==null?void 0:o[a],p=c&&d?d[c]:d;return(u==null?void 0:u.getValue(i,r,{context:p}))||""}else return(u==null?void 0:u.getValue(s,r))||""},PN="gs-cmp-data-path-field",za=ae(e=>{const{size:t="m",value:n="",label:s,open:r,defaultValue:o,additionalSources:i,dataResolver:a,readOnly:c,disabled:u,pickerInPopover:d,onChange:p,onPickerToggle:h}=e,{editor:g}=me(),m=Ae().tScoped("dataSources"),[b,v]=f.useState(!!r),[x,y]=f.useState(!1),w=!!c||b||x,S=()=>y(!x),C=D=>{const $=D??!b;v($),h==null||h($)},j=()=>C(!1),E=(...D)=>{p==null||p(...D)},T=D=>{w||p==null||p(D,{paths:D.split(".")})},O=jN({dataResolver:a,value:n}),P=x&&g?`"${EN({editor:g,dataResolver:a,additionalSources:i,value:n,defaultValue:o})}"`:O,_=t==="m",M=_?"lg":t,N=_?oe.l:oe.s,H=m(b?"closePathExplorer":"openPathExplorer"),L={icon:b?U.close:U.databaseOutline,size:oe.l},F={icon:x?U.eyeOff:U.eye,size:_?oe.m:N},G=l.jsx(ft,{block:!0,variant:"pr",size:M,title:H,onClick:()=>C(),icon:L});return l.jsxs(k,{className:PN,gap:t,col:!0,children:[l.jsxs(k,{gap:t,items:"end",nowrap:!0,children:[l.jsx(Je,{readOnly:w,label:s,value:x?P:O,size:t,disabled:u,onChange:T,placeholder:m("selectVariablePath"),className:A("gs-utl-flex-grow",B.txt,Se.txtEllips),afterInput:!!n&&l.jsx(ft,{block:!0,variant:"out-clear",size:"xs",border:!1,title:m("toggleResolvedPath"),onClick:S,className:Se.hover,icon:F})}),d?l.jsx(ss,{placement:"bottom-end",classNameBody:"gs-utl-w-[400px] gs-utl-h-[300px]",title:!1,padding:!1,border:!1,buttonAs:"span",handler:G,onClose:j,overlay:!0,children:l.jsx(mm,{path:O,onChange:E,additionalSources:i})}):G]}),!!b&&!d&&l.jsx(mm,{path:O,onChange:E,additionalSources:i})]})}),TN=e=>{const t=parseFloat(e),n=e.replace(`${t}`,"").trim();return{number:t||t===0?`${t}`:"",unit:n}},ry=({value:e,step:t})=>{const n=parseFloat(`${e}`);let s=0;if(Math.floor(n)!==n&&t){const r=`${t}`.split(".")[1];s=(r==null?void 0:r.length)||0}return s?parseFloat(n.toFixed(s)):n},ON=({value:e,key:t,shiftKey:n,min:s,max:r,step:o=1})=>{const i=t==="ArrowUp",a=t==="ArrowDown";let c=null;if(i||a){c=Number(e);const u=parseFloat(`${o}`);i&&(c+=(n?10:1)*u),a&&(c-=(n?10:1)*u),c=`${eu({min:s,max:r,value:c})}`,c=ry({value:c,step:o})}return c},eu=({min:e,max:t,value:n})=>{const s=parseFloat(`${n}`);let r=s||0;return At(e)&&(r=Math.max(r,parseFloat(`${e}`)||0)),At(t)&&(r=Math.min(r,parseFloat(`${t}`)||0)),`${`${s}`!=`${n}`?n:r}`},_N=(e,t,n,s={})=>{const r=parseInt(`${e}`,10)||0,{min:o,max:i,step:a=1}=s;let c=r;const u=p=>{const h=p.clientY-t,g=r-h*parseFloat(`${a}`);c=ry({value:eu({min:o,max:i,value:g}),step:a}),n(c,!0)},d=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),n(c)};window.addEventListener("mousemove",u),window.addEventListener("mouseup",d)},AN=(e,t,n={})=>{const{partial:s}=n,r=(o,i)=>o===i||s&&o.startsWith(i);return t.some(o=>r(typeof o=="string"?o:o.id,e))},bm=e=>At(e)?e:"",MN="gs-cmp-number-field";function Te(e){const{className:t,value:n,units:s,valueUnit:r,size:o="m",pan:i=!0,min:a,max:c,step:u,placeholder:d,disabled:p,onChange:h,onChangeUnit:g}=e,[m,b]=f.useState(bm(n)),[v,x]=f.useState(!1),y=(s==null?void 0:s.map(O=>({id:O,label:O})))||[],w={min:a,max:c,step:u};f.useEffect(()=>{b(bm(n))},[n,r]);const S=(O,P)=>{h==null||h(eu({min:a,max:c,value:O}),P)},C=O=>{if(p)return;x(!0);const P=(_,M)=>{S(_,!!M),!M&&x(!1)};_N(m,O.clientY,P,w)},j=O=>{const{key:P,shiftKey:_}=O;switch(P){case"Escape":return b(n);case"Enter":return S(m)}const M=ON({step:u,value:n,key:P,shiftKey:_});M!==null&&(O.preventDefault(),S(M))},E=()=>{S(m)},T=Vr({...e,className:A(MN,t)});return l.jsxs("div",{...T,children:[v&&l.jsx("div",{className:A("gs-utl-fixed gs-utl-inset-0 gs-utl-z-50 gs-utl-cursor-ns")}),l.jsx(ns,{as:e.labelAs,...e}),l.jsxs(k,{className:jf(e),items:"center",space:"x2s",children:[!!i&&l.jsx(V,{onMouseDown:C,className:A("gs-utl-opacity-50 gs-utl-cursor-ns",o==="m"&&"-gs-utl-ml-3",o==="s"&&"-gs-utl-ml-2",i!==!0&&"gs-utl-mr-0.5 -gs-utl-ml-1"),children:i===!0?l.jsx(Q,{icon:U.panVertical,size:oe.s2x}):i}),l.jsx(V,{grow:!0,children:l.jsx("input",{className:Da(e),value:m,disabled:p,onChange:O=>b(O.target.value),placeholder:d,onBlur:E,onKeyDown:j})}),!!y.length&&l.jsx(V,{className:A(y.length===1&&"gs-utl-opacity-50 gs-utl-pointer-events-none"),children:l.jsx(je,{caret:"",size:"x2s",pos:"right",width:"75px",emptyState:"-",border:!1,value:r,disabled:p,onChange:O=>g==null?void 0:g(O),options:y})})]})]})}const LN="gs-cmp-switch-field";function ca(e){const{className:t,value:n,label:s,labelAs:r,border:o,disabled:i,onChange:a}=e,c=!!n,u=A("gs-utl-relative gs-utl-inline-flex gs-utl-items-center gs-utl-h-6 gs-utl-rounded-full gs-utl-w-11 gs-utl-transition-colors focus:gs-utl-outline-none",c?B.bgA:B.bgH,ta.focus,o&&`${B.br} ${X.b}`);return l.jsx(_u.Group,{children:l.jsxs(k,{items:"center",className:A(LN,t),full:!0,children:[!!s&&l.jsx(_u.Label,{as:r,className:A("gs-utl-mr-4 gs-utl-flex-1"),passive:!0,children:l.jsx(ns,{...e,as:"span"})}),l.jsx(_u,{checked:c,onChange:a,className:u,disabled:i,children:l.jsx("span",{className:A(B.bg,"gs-utl-inline-block gs-utl-w-4 gs-utl-h-4 gs-utl-transform gs-utl-rounded-full gs-utl-transition-transform",c?"gs-utl-translate-x-6":"gs-utl-translate-x-1")})})]})})}function Vf(e){var i;const[t,n]=f.useState(((i=e.getDataResolver)==null?void 0:i.call(e))??{}),s=f.useRef(t),r=a=>{const c={...s.current,...a};s.current=c,n(c)},o=()=>{e.setDataResolver(s.current)};return f.useEffect(()=>{const a="change:dataResolver",c=()=>{const u=e.getDataResolver();n(u)};return e.on(a,c),()=>{e.off(a,c)}},[e]),{localData:t,updateLocalData:r,syncToComponent:o}}const NN="gs-cmp-data-collection-picker",$N=ae(({component:e,onConfirm:t})=>{const{localData:n,updateLocalData:s,syncToComponent:r}=Vf(e),{collectionId:o="",dataSource:i={},startIndex:a=0,endIndex:c=10}=n,u=sy(i),d=c===Number.MAX_VALUE,p=Ae().tScoped("dataSources"),h=d?"":c,g=()=>{r(),t==null||t({value:n})},m=y=>s({dataSource:{...i,path:y}}),b=y=>s({startIndex:y}),v=y=>s({endIndex:y}),x=y=>s({endIndex:y?Number.MAX_VALUE:4});return l.jsxs(k,{className:NN,gap:"s",col:!0,nowrap:!0,children:[l.jsxs(k,{items:"end",gap:"s",nowrap:!0,children:[l.jsx(Je,{className:"gs-utl-flex-grow",size:"s",label:p("collectionId"),value:o,readOnly:!0,disabled:!0}),l.jsx(h0,{size:"s",value:o,block:!0})]}),l.jsx(za,{label:p("variablePath"),value:u,onChange:m,dataResolver:n}),l.jsxs(k,{items:"end",gap:"s",nowrap:!0,children:[l.jsx(Te,{size:"s",className:"gs-utl-flex-grow",label:p("collectionStartIndex"),value:a==null?void 0:a.toString(),onChange:b}),l.jsx(Te,{size:"s",label:p("collectionEndIndex"),placeholder:d?"-":"",value:h==null?void 0:h.toString(),onChange:v,className:A("gs-utl-flex-grow",d&&"gs-utl-opacity-50 gs-utl-pointer-events-none")}),l.jsx(V,{children:l.jsx(ca,{label:p("collectionUpToEndIndex"),value:d,onChange:x})})]}),l.jsx(k,{full:!0,justify:"end",children:l.jsx(Ge,{onClick:g,variant:"pr",size:"m",children:p("confirm")})})]})}),kN="gs-data-collection-picker",RN=ae(function({className:t,component:n,onConfirm:s,...r}){return l.jsx(dn,{className:A(kN,t),...r,children:l.jsx($N,{component:n,onConfirm:s})})});var vn=(e=>(e.STRING="string",e.NUMBER="number",e.DATA_SOURCE="dataSource",e))(vn||{}),hn=(e=>(e.equals="equals",e.isTruthy="isTruthy",e.isFalsy="isFalsy",e.isDefined="isDefined",e.isNull="isNull",e.isUndefined="isUndefined",e.isArray="isArray",e.isObject="isObject",e.isString="isString",e.isNumber="isNumber",e.isBoolean="isBoolean",e.isDefaultValue="isDefaultValue",e))(hn||{}),Hf=(e=>(e.greaterThan=">",e.lessThan="<",e.greaterThanOrEqual=">=",e.lessThanOrEqual="<=",e.equals="=",e.notEquals="!=",e))(Hf||{}),Df=(e=>(e.contains="contains",e.startsWith="startsWith",e.endsWith="endsWith",e.equalsIgnoreCase="equalsIgnoreCase",e.trimEquals="trimEquals",e))(Df||{});const IN=[...Object.values(Df),...Object.values(Hf),...Object.values(hn)],ip={string:Object.values(Df),number:Object.values(Hf),dataSource:IN},VN=f.memo(function(t){const{additionalSources:n,side:s,type:r,value:o,onChange:i}=t;switch(r){case vn.DATA_SOURCE:return l.jsx(za,{size:"s",pickerInPopover:!0,value:sy(o),onChange:a=>i(s,a,r),additionalSources:n});case vn.NUMBER:return l.jsx(Te,{size:"s",value:o,onChange:a=>i(s,a,r)});default:return l.jsx(Je,{size:"s",value:o,onChange:a=>i(s,a,r)})}}),HN="gs-cmp-statement-side",vm=f.memo(function({side:t,type:n,value:s,label:r,onChange:o,onTypeChange:i,additionalSources:a,typeOptions:c}){return l.jsxs(k,{className:A(HN,"gs-utl-flex-grow"),col:!0,children:[l.jsx(_r,{size:"s",children:r}),l.jsxs(k,{items:"center",gap:"xs",children:[l.jsx(V,{children:l.jsx(je,{size:"s",value:n,options:c,onChange:u=>i(t,u)})}),l.jsx(V,{grow:!0,children:l.jsx(VN,{additionalSources:a,side:t,type:n,value:s,onChange:o})})]})]})}),gl=e=>typeof e=="object"&&(e==null?void 0:e.type)==="data-variable"?vn.DATA_SOURCE:typeof e=="string"?vn.STRING:typeof e=="number"?vn.NUMBER:vn.STRING,DN=(e,t,n)=>{switch(t){case vn.STRING:return e||"";case vn.NUMBER:return e?Number(e):0;case vn.DATA_SOURCE:{const s=n||{};return{type:"data-variable",...(nt(e)?If(e,s):e)??{path:"",defaultValue:""}}}default:return e}},FN=e=>ip[e][0],BN=e=>![hn.isTruthy,hn.isFalsy,hn.isDefined,hn.isNull,hn.isUndefined,hn.isArray,hn.isObject,hn.isString,hn.isNumber,hn.isBoolean,hn.isDefaultValue].includes(e),zN="gs-cmp-statement",UN=ae(e=>{const{statement:t,onChange:n,className:s,additionalSources:r}=e,o=Ae().tScoped("dataSources"),[i,a]=f.useState(()=>gl(t.left)),[c,u]=f.useState(()=>gl(t.right)),d=ip[i]||ip[vn.STRING],p=f.useMemo(()=>Object.values(vn).map(S=>({id:S,label:vs(S)})),[]),h=f.useMemo(()=>d.map(S=>({id:S,label:o(`operators.${S}`)})),[d,o]);f.useEffect(()=>{a(gl(t.left)),u(gl(t.right))},[t.left,t.right]);const g=S=>{n({...t,...S})},m=(S,C,j)=>{const E=DN(C,j,r),T=S==="left",O=T&&j!==vn.DATA_SOURCE;T?a(j):u(j),g({[S]:E,...O&&{operator:FN(j)}})},b=(S,C)=>m(S,null,C),v=S=>g({operator:S}),x=A(zN,s,B.br,X.b,X.rnd,we.xy),y=BN(t.operator),w={additionalSources:r,onChange:m,onTypeChange:b,typeOptions:p};return l.jsx(k,{className:A(x,"gs-utl-w-full"),items:"stretch",gap:"m",col:!0,full:!0,nowrap:!0,children:l.jsxs(k,{gap:"m",items:"center",full:!0,nowrap:!0,children:[l.jsx(vm,{side:"left",type:i,value:t.left,label:o("leftValue"),...w}),l.jsx(V,{children:l.jsx(je,{size:"s",label:o("operator"),value:t.operator,options:h,onChange:v})}),y&&l.jsx(vm,{side:"right",type:c,value:t.right,label:o("rightValue"),...w})]})})}),Qu="gs-cmp-statements-group",WN=e=>e==="and"||e==="or",dc=e=>({...e,statements:[...e.statements??[],{left:"",operator:"equals",right:""}]}),oy=ae(e=>{const{className:t,condition:n,onUpdate:s,additionalSources:r,skipAddCondition:o}=e,i=Ae().tScoped("dataSources"),a=n.statements??[],c=n.logicalOperator||"and",u=m=>{WN(m)&&s({...n,logicalOperator:m})},d=()=>{dc(n),s(dc(n))},p=m=>{const b=a.filter((v,x)=>x!==m);s({...n,statements:b})},h=(m,b)=>{if(m>=0&&m<a.length){const v=[...a];v[m]=b,s({...n,statements:v})}},g=[{id:"and",label:i("conditionAnd")},{id:"or",label:i("conditionOr")}];return l.jsxs(k,{className:A(Qu,t,"gs-utl-w-full"),full:!0,gap:"m",col:!0,nowrap:!0,children:[a.length>1&&l.jsx(Dr,{value:c,onChange:u,tabs:g}),l.jsx(k,{className:`${Qu}__items`,gap:"s",col:!0,full:!0,nowrap:!0,children:a.map((m,b)=>l.jsxs(k,{className:A(`${Qu}__item`),gap:"s",col:!0,children:[l.jsx(UN,{additionalSources:r,statement:m,onChange:v=>h(b,v)}),b<a.length-1&&l.jsxs(k,{justify:"center",items:"center",gap:"m",children:[l.jsx("span",{className:A(B.txtHighEmphasis,"gs-utl-text-sm gs-utl-font-bold"),children:c.toUpperCase()}),l.jsx(ft,{block:!0,variant:"out-clear",title:i("deleteCondition"),onClick:()=>p(b+1),icon:{icon:U.delete,size:oe.s}})]})]},`stmt-${b}`))}),!o&&l.jsx(k,{justify:"end",children:l.jsx(Ge,{variant:"pr",onClick:d,icon:{icon:U.plus,size:oe.s},children:i("addCondition")})})]})}),GN="gs-cmp-data-condition-picker",qN=ae(({component:e,onConfirm:t})=>{const{localData:n,updateLocalData:s,syncToComponent:r}=Vf(e),o=Ae().tScoped("dataSources"),i=n.condition,a=d=>s({condition:d}),c=()=>{r(),t==null||t({value:n})},u=()=>{s({condition:dc(i)})};return l.jsxs(k,{className:GN,items:"stretch",gap:"m",full:!0,col:!0,children:[l.jsx(oy,{additionalSources:e.collectionsStateMap??{},condition:i,onUpdate:a,skipAddCondition:!0}),l.jsxs(k,{gap:"m",justify:"end",full:!0,children:[l.jsx(Ge,{variant:"out",onClick:u,icon:{icon:U.plus,size:oe.s},children:o("addCondition")}),l.jsx(Ge,{onClick:c,variant:"pr",size:"m",children:o("confirm")})]})]})}),KN="gs-data-condition-picker",ZN=ae(function({className:t,component:n,onConfirm:s,...r}){return l.jsx(dn,{className:A(KN,t),...r,children:l.jsx(qN,{component:n,onConfirm:s})})}),YN="gs-data-path-field",XN=ae(({className:e,value:t="",onChange:n,...s})=>l.jsx(dn,{className:A(YN,e),...s,children:l.jsx(za,{onChange:r=>n({value:r}),value:t})})),ml={type:"data-variable",path:"",defaultValue:""},ym={type:"data-condition",condition:{logicalOperator:"and",statements:[{left:"",operator:"",right:""}]},ifTrue:"",ifFalse:""};function Ar(e){return["data-variable","data-condition"].includes((e==null?void 0:e.type)??"")}const xm="gs-cmp-dynamic-value-picker",JN=ae(({value:e,onChange:t,onConfirm:n,additionalSources:s})=>{const[r,o]=f.useState(()=>Ar(e)?e:ml),[i,a]=f.useState(r.type),c=Ae().tScoped("dataSources");f.useEffect(()=>{const w=Ar(e)?e:ml;(w.type!==r.type||JSON.stringify(w)!==JSON.stringify(r))&&(o(w),a(w.type))},[e]);const u=w=>{o(w),t==null||t({value:w})},d=w=>{const S=w;a(S);const C=r.type===S?r:S==="data-variable"?ml:ym;u(C)},p=w=>{u({type:"data-variable",defaultValue:r.defaultValue,...If(w,s)})},h=w=>{o(S=>{const C={...S,defaultValue:w};return t==null||t({value:C}),C})},g=w=>{u({...r,condition:w})},m=(w,S)=>{u({...r,[w]:S})},b=()=>{const w=r.condition;g(dc(w))},v=[{id:"data-variable",label:c("variable")},{id:"data-condition",label:c("condition")}],x=(r==null?void 0:r.type)==="data-variable"?r:ml,y=(r==null?void 0:r.type)==="data-condition"?r:ym;return l.jsxs(k,{className:xm,gap:"s",col:!0,nowrap:!0,children:[l.jsxs(k,{className:xm,gap:"m",col:!0,nowrap:!0,full:!0,children:[l.jsx(Dr,{value:i,onChange:d,tabs:v}),l.jsx(V,{grow:!0,className:we.y,style:{overflowY:"auto",overflowX:"hidden"},children:i==="data-variable"?l.jsxs(k,{gap:"s",col:!0,nowrap:!0,children:[l.jsx(za,{value:x.path,label:c("variablePath"),additionalSources:s,defaultValue:x.defaultValue,onChange:p}),l.jsx(Je,{label:c("defaultValue"),value:x.defaultValue||"",onChange:h})]}):l.jsxs(k,{gap:"m",col:!0,children:[l.jsx(oy,{additionalSources:s,condition:y.condition,onUpdate:g,skipAddCondition:!0}),l.jsxs(k,{gap:"s",col:!0,nowrap:!0,children:[l.jsx(Je,{label:c("ifTrue"),value:y.ifTrue,onChange:w=>m("ifTrue",w)}),l.jsx(Je,{label:c("ifFalse"),value:y.ifFalse,onChange:w=>m("ifFalse",w)})]})]})}),i==="data-condition"&&l.jsx(k,{full:!0,justify:"end",className:we.x,children:l.jsx(Ge,{variant:"out",onClick:b,icon:{icon:U.plus,size:oe.s},children:c("addCondition")})})]}),l.jsx(k,{full:!0,justify:"end",className:we.y,children:l.jsx(Ge,{onClick:()=>{n==null||n({value:r})},variant:"pr",size:"m",children:c("confirm")})})]})}),QN="gs-data-value-picker",e$=ae(({className:e,value:t={},onChange:n,onConfirm:s,additionalSources:r={},...o})=>l.jsx(dn,{className:A(QN,e),...o,children:l.jsx(JN,{value:t,onConfirm:i=>s==null?void 0:s(i),onChange:i=>n==null?void 0:n(i),additionalSources:r})})),t$="gs-cmp-data-variable-picker",n$=ae(({component:e,onConfirm:t})=>{const{localData:n,updateLocalData:s,syncToComponent:r}=Vf(e),o=Ae().tScoped("dataSources"),{path:i="",defaultValue:a=""}=n,c=e.collectionsStateMap,u=h=>{s(If(h,c))},d=()=>{r(),t==null||t({value:n})},p=h=>s({defaultValue:h});return l.jsxs(k,{className:t$,gap:"s",col:!0,nowrap:!0,children:[l.jsx(za,{value:i,label:o("variablePath"),dataResolver:n,additionalSources:c,defaultValue:a,onChange:u}),l.jsx(Je,{label:o("defaultValue"),value:a,onChange:p}),l.jsx(k,{full:!0,justify:"end",className:we.y,children:l.jsx(Ge,{onClick:d,variant:"pr",size:"m",children:o("confirm")})})]})}),s$="gs-data-variable-picker",r$=ae(function({className:t,component:n,onConfirm:s,...r}){return l.jsx(dn,{className:A(s$,t),...r,children:l.jsx(n$,{component:n,onConfirm:s})})}),o$="gs-cmp-input-field",i$=f.memo(ae(function({className:t,style:n,label:s,name:r,value:o,size:i,disabled:a,inputType:c,readOnly:u,required:d,placeholder:p,onChange:h,onInput:g,editorEvents:m}){const{editor:b}=me(),[v,x]=f.useState(()=>({className:t,style:n,label:s,name:r,value:o,size:i,readOnly:u,disabled:a,required:d,placeholder:p})),y=C=>({value:C,editor:b,state:v,setState:j=>x(E=>({...E,...j}))}),w=C=>h==null?void 0:h(y(C)),S=C=>g==null?void 0:g(y(C));return zr({editor:b,editorEvents:m,localState:v,setLocalState:x}),l.jsx(Je,{type:c,className:A(o$,v.className),style:v.style,label:v.label,name:v.name,value:v.value,size:v.size,required:v.required,disabled:v.disabled,readOnly:v.readOnly,placeholder:v.placeholder,onChange:w,onInput:S})})),a$="gs-menu-list",l$=ae(function({className:e,items:t,onItemClick:n,...s}){const{editor:r}=me(),[o,i]=f.useState(),a=u=>{const{onClick:d}=u;if(d&&r)return p=>d({item:u,editor:r,...p})},c=()=>{if(n&&r)return u=>n({...u,editor:r})};return l.jsx(dn,{className:A(a$,B.bg,"gs-utl-flex gs-utl-flex-col",e),...s,children:(t||[]).map((u,d)=>f.createElement(hi,{...u,label:u.layout?Pt(u.layout):u.label,key:u.id??d,className:u.className,action:a(u),onActive:()=>i(u),onItemClick:c(),active:o===u,items:u.items}))})});function c$({children:e,accept:t,onChange:n,multiple:s=!0,...r}){const o=Ae(),i=f.useRef(null),a=()=>{const{current:c}=i;c&&(c.value="",c.click())};return l.jsxs(l.Fragment,{children:[l.jsx("input",{className:K("hidden"),ref:i,type:"file",multiple:s,accept:t,onChange:n}),l.jsx(Ge,{variant:"pr",size:"m2",...r,onClick:a,children:e||o.t("upload")})]})}const u$=ae(c$),d$=ae(function({editor:t,assetProps:n,itemLayout:s,onSelect:r,onRemove:o}){const i=Ia();return Pt(s({asset:gr(i.toAsset(n)),assetProps:gr(n),onSelect:a=>r(i.toAssetProps(a)),onDelete:o&&(a=>o(i.toAssetProps(a))),editor:t}))}),p$="gs-cmp-asset-card",f$=ae(function(t){var p;const{assetProps:n,onSelect:s,onRemove:r,className:o,itemLayout:i}=t,a=Ae(),{editor:c}=me();if(i)return c?l.jsx(d$,{...t,editor:c,itemLayout:i}):null;const{src:u}=n,d=n.name||((p=u.split("/").pop())==null?void 0:p.split("?").shift());return l.jsx(Dn,{padding:!1,className:ie(p$,"overflow-hidden max-w-full group",o),children:l.jsxs(k,{col:!0,children:[l.jsxs(V,{className:ie("relative group h-24 cursor-pointer bg-checker"),onClick:()=>s(n),children:[l.jsx("div",{className:ie("w-full h-full bg-contain bg-no-repeat bg-center"),style:{backgroundImage:`url("${u}")`}}),l.jsx(k,{justify:"center",items:"center",className:ie(Se.coverAbs,B.bgH75,"group-hover:gs-utl-opacity-100 opacity-0 transition-opacity"),children:l.jsx(Ge,{className:ie("text-sm"),size:"m2",variant:"pr",children:a.t("select")})})]}),l.jsxs(k,{className:ie("gjs-p-1 max-w-full"),space:"s",items:"center",nowrap:!0,children:[l.jsx(V,{className:ie(Se.txtEllips,"text-sm gjs-mr-auto"),children:d}),r&&l.jsx(Xc,{onConfirm:()=>r==null?void 0:r(n),text:l.jsxs(k,{col:!0,space:"m",items:"stretch",children:[l.jsx("p",{className:ie("text-center",B.txtHighEmphasis),children:a.t("assetManager.deleteConfirmQuestion")}),l.jsx("p",{className:ie("text-center"),children:a.t("assetManager.deleteConfirmExplanation")})]}),confirmButtonProps:{variant:"danger"},children:l.jsx(ft,{title:a.t("delete"),children:l.jsx(Q,{icon:U.delete,size:oe.sx})})})]})]})})}),as="gs-asset-manager",h$={search:!0,addUrl:!0,upload:!0},g$=ae(function({assetProps:t,typeFilterOptions:n,providerFilterOptions:s,typeFilter:r,providerFilter:o,searchValue:i,isLoading:a,optionalType:c,optionalProvider:u,useLocalSearch:d,itemLayout:p,content:h,onSelect:g,onChangeTypeFilter:m,onChangeProviderFilter:b,onChangeSearchValue:v,onChangeUpload:x,onAddUrl:y,onRemove:w,onEndReached:S,layoutAfterHeader:C}){const j=me(),{editor:E}=j,T=Ae(),[O]=xf(),P=Mf(h==null?void 0:h.itemsPerRow),[_,M]=f.useState(""),N=(h==null?void 0:h.header)===!1?!1:{...h$,...tr(h==null?void 0:h.header)?h.header:{}};if(!E)return;const H=d?t.filter(L=>!(i&&!Go(L.src,i)&&!Go(L.name??"",i))):t;return l.jsxs(k,{className:K(as,"relative gs-utl-h-full",a&&Se.disabled),nowrap:!0,col:!0,space:"m",children:[N!==!1&&l.jsxs(k,{className:`${as}__header`,gap:"m",justify:"between",items:"center",children:[l.jsxs(k,{className:`${as}__header-filters`,items:"center",gap:"m",children:[N.search&&l.jsx(V,{children:l.jsx(Je,{className:`${as}__search-filter`,size:"m",type:"search",value:i,onInput:v,placeholder:`${T.t("search")}...`})}),n.length>(c?0:1)&&l.jsx(V,{children:l.jsx(je,{className:K(`${as}__type-filter`,"items-center"),size:"m",options:n,value:r,onChange:m,emptyState:T.t("assetManager.assetTypes.all"),includeEmpty:c})}),s.length>(u?0:1)&&l.jsx(V,{children:l.jsx(je,{classNameContainer:K(`${as}__provider-filter`,"items-center"),size:"m",options:s.map(L=>({...L,label:Ke(L.label)?L.label({editor:E}):L.label,icon:L.icon})),value:o,onChange:b,emptyState:T.t("assetManager.noProvider"),includeEmpty:u})})]}),l.jsxs(k,{className:`${as}__header-buttons`,items:"center",gap:"m",children:[N.upload&&l.jsx(V,{children:l.jsx(u$,{className:`${as}__upload-field`,onChange:x})}),N.addUrl&&!!y&&l.jsx(V,{children:l.jsx(ss,{className:`${as}__add-url-popover`,overlay:!0,placement:"bottom-end",title:!1,buttonAs:"span",handler:l.jsx(Ge,{variant:"pr",size:"m2",children:T.t("assetManager.addUrl")}),children:({close:L})=>l.jsxs(k,{gap:"m",children:[l.jsx(V,{children:l.jsx(Je,{type:"url",size:"s",value:_,onChange:M,placeholder:T.t("assetManager.inputPlh")})}),l.jsx(V,{children:l.jsx(Ge,{variant:"pr",size:"m2",onClick:()=>{y(_),L()},children:T.t("add")})})]})})})]}),C&&l.jsx(l.Fragment,{children:Pt(C({editor:E}))})]}),l.jsx(k,{className:K(`${as}__content`,"gs-utl-h-[75vh] gs-utl-flex-grow"),space:"m",col:!0,nowrap:!0,children:!a&&!H.length?l.jsx(k,{justify:"center",children:T.t("noItems")}):!!O&&l.jsx(Yc,{data:H,listClassName:K("gs-utl-grid gs-utl-gap-2",P),endReached:S,itemContent:(L,F)=>l.jsx(f$,{assetProps:F,onSelect:g,onRemove:w,itemLayout:p},F.id),components:{Footer:S?m$:void 0}})}),a&&l.jsx(ho,{abs:!0})]})}),m$=()=>l.jsx("div",{style:{padding:"2rem",display:"flex",justifyContent:"center",height:200}}),b$=ae(function({panelId:t,content:n,assets:s,types:r,providers:o,typeId:i,providerId:a,optionalType:c,optionalProvider:u,onSelect:d,close:p,layoutAfterHeader:h}){const{appEditorStore:g,i18nStore:m}=pn(),{editor:b}=g,v=Ia(),{customOnLoad:x}=v,y=Hv(t);f.useEffect(()=>{const E=O=>nt(O)?{id:O,label:m.t(`assetManager.assetTypes.${O}`)||O}:O;y.setCustomTypes(r==null?void 0:r.map(E)),y.setCustomProviders(nt(o)?[o]:o),i?y.setTypeFilter(i):y.initTypeFilter(),a?y.setProviderFilter(a):y.initProviderFilter(),At(c)?y.setOptionalType(c):y.initOptionalType(),At(u)?y.setOptionalProvider(u):y.initOptionalProvider();const T=setTimeout(()=>y.loadAssets());return()=>clearTimeout(T)},[r,o,i,a,c,u]);const w=E=>{v.addToProjectAssets([{id:E,src:E,type:y.typeFilter??oo.image}])},S=E=>{b&&(d==null||d({asset:v.toAsset(E),assetProps:E,editor:b}),p==null||p())},C=s==null?void 0:s.map(v.toAssetProps),j=y.shouldLoadNextPage?()=>y.loadAssets(!1):void 0;return l.jsx(g$,{assetProps:C??y.assetProps,typeFilter:y.typeFilter,typeFilterOptions:y.typeFilterOptions,providerFilter:y.providerFilter,providerFilterOptions:y.providerFilterOptions,searchValue:y.searchValue,onChangeTypeFilter:E=>{y.setTypeFilter(E),y.loadAssets()},onChangeProviderFilter:E=>{y.setProviderFilter(E),y.loadAssets()},onChangeSearchValue:y.setSearchValue,onSelect:S,onAddUrl:x?void 0:w,onChangeUpload:E=>v.uploadFile(E.nativeEvent),onRemove:C?void 0:y.handleDelete,onEndReached:j,isLoading:y.isLoading,itemLayout:y.itemLayout,content:n,optionalType:y.optionalType,optionalProvider:y.optionalProvider,useLocalSearch:!y.reloadOnInput,layoutAfterHeader:h})});var v$=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(s[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function s(){this.constructor=t}t.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}}(),Et=function(){return Et=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},Et.apply(this,arguments)},wm={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Sm={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},bl={width:"20px",height:"20px",position:"absolute"},y$={top:Et(Et({},wm),{top:"-5px"}),right:Et(Et({},Sm),{left:void 0,right:"-5px"}),bottom:Et(Et({},wm),{top:void 0,bottom:"-5px"}),left:Et(Et({},Sm),{left:"-5px"}),topRight:Et(Et({},bl),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Et(Et({},bl),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Et(Et({},bl),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Et(Et({},bl),{left:"-10px",top:"-10px",cursor:"nw-resize"})},x$=function(e){v$(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(s){n.props.onResizeStart(s,n.props.direction)},n.onTouchStart=function(s){n.props.onResizeStart(s,n.props.direction)},n}return t.prototype.render=function(){return Xe.createElement("div",{className:this.props.className||"",style:Et(Et({position:"absolute",userSelect:"none"},y$[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(Xe.PureComponent),w$=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,r){s.__proto__=r}||function(s,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(s[o]=r[o])},e(t,n)};return function(t,n){e(t,n);function s(){this.constructor=t}t.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}}(),us=function(){return us=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},us.apply(this,arguments)},S$={width:"auto",height:"auto"},vl=function(e,t,n){return Math.max(Math.min(e,n),t)},Cm=function(e,t,n){var s=Math.round(e/t);return s*t+n*(s-1)},$o=function(e,t){return new RegExp(e,"i").test(t)},yl=function(e){return!!(e.touches&&e.touches.length)},C$=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},jm=function(e,t,n){n===void 0&&(n=0);var s=t.reduce(function(o,i,a){return Math.abs(i-e)<Math.abs(t[o]-e)?a:o},0),r=Math.abs(t[s]-e);return n===0||r<n?t[s]:e},ed=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},xl=function(e,t,n,s){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var r=Number(e.replace("%",""))/100;return t*r}if(e.endsWith("vw")){var r=Number(e.replace("vw",""))/100;return n*r}if(e.endsWith("vh")){var r=Number(e.replace("vh",""))/100;return s*r}}return e},j$=function(e,t,n,s,r,o,i){return s=xl(s,e.width,t,n),r=xl(r,e.height,t,n),o=xl(o,e.width,t,n),i=xl(i,e.height,t,n),{maxWidth:typeof s>"u"?void 0:Number(s),maxHeight:typeof r>"u"?void 0:Number(r),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof i>"u"?void 0:Number(i)}},E$=function(e){return Array.isArray(e)?e:[e,e]},P$=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Em="__resizable_base__",T$=function(e){w$(t,e);function t(n){var s,r,o,i,a=e.call(this,n)||this;return a.ratio=1,a.resizable=null,a.parentLeft=0,a.parentTop=0,a.resizableLeft=0,a.resizableRight=0,a.resizableTop=0,a.resizableBottom=0,a.targetLeft=0,a.targetTop=0,a.appendBase=function(){if(!a.resizable||!a.window)return null;var c=a.parentNode;if(!c)return null;var u=a.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(Em):u.className+=Em,c.appendChild(u),u},a.removeBase=function(c){var u=a.parentNode;u&&u.removeChild(c)},a.state={isResizing:!1,width:(r=(s=a.propsSize)===null||s===void 0?void 0:s.width)!==null&&r!==void 0?r:"auto",height:(i=(o=a.propsSize)===null||o===void 0?void 0:o.height)!==null&&i!==void 0?i:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},a.onResizeStart=a.onResizeStart.bind(a),a.onMouseMove=a.onMouseMove.bind(a),a.onMouseUp=a.onMouseUp.bind(a),a}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||S$},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,s=0;if(this.resizable&&this.window){var r=this.resizable.offsetWidth,o=this.resizable.offsetHeight,i=this.resizable.style.position;i!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:r,s=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=i}return{width:n,height:s}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,s=this.props.size,r=function(a){var c;if(typeof n.state[a]>"u"||n.state[a]==="auto")return"auto";if(n.propsSize&&n.propsSize[a]&&(!((c=n.propsSize[a])===null||c===void 0)&&c.toString().endsWith("%"))){if(n.state[a].toString().endsWith("%"))return n.state[a].toString();var u=n.getParentSize(),d=Number(n.state[a].toString().replace("px","")),p=d/u[a]*100;return p+"%"}return ed(n.state[a])},o=s&&typeof s.width<"u"&&!this.state.isResizing?ed(s.width):r("width"),i=s&&typeof s.height<"u"&&!this.state.isResizing?ed(s.height):r("height");return{width:o,height:i}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var s=!1,r=this.parentNode.style.flexWrap;r!=="wrap"&&(s=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return s&&(this.parentNode.style.flexWrap=r),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,s){var r=this.propsSize&&this.propsSize[s];return this.state[s]==="auto"&&this.state.original[s]===n&&(typeof r>"u"||r==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,s){var r=this.props.boundsByDirection,o=this.state.direction,i=r&&$o("left",o),a=r&&$o("top",o),c,u;if(this.props.bounds==="parent"){var d=this.parentNode;d&&(c=i?this.resizableRight-this.parentLeft:d.offsetWidth+(this.parentLeft-this.resizableLeft),u=a?this.resizableBottom-this.parentTop:d.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(c=i?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(c=i?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return c&&Number.isFinite(c)&&(n=n&&n<c?n:c),u&&Number.isFinite(u)&&(s=s&&s<u?s:u),{maxWidth:n,maxHeight:s}},t.prototype.calculateNewSizeFromDirection=function(n,s){var r=this.props.scale||1,o=E$(this.props.resizeRatio||1),i=o[0],a=o[1],c=this.state,u=c.direction,d=c.original,p=this.props,h=p.lockAspectRatio,g=p.lockAspectRatioExtraHeight,m=p.lockAspectRatioExtraWidth,b=d.width,v=d.height,x=g||0,y=m||0;return $o("right",u)&&(b=d.width+(n-d.x)*i/r,h&&(v=(b-y)/this.ratio+x)),$o("left",u)&&(b=d.width-(n-d.x)*i/r,h&&(v=(b-y)/this.ratio+x)),$o("bottom",u)&&(v=d.height+(s-d.y)*a/r,h&&(b=(v-x)*this.ratio+y)),$o("top",u)&&(v=d.height-(s-d.y)*a/r,h&&(b=(v-x)*this.ratio+y)),{newWidth:b,newHeight:v}},t.prototype.calculateNewSizeFromAspectRatio=function(n,s,r,o){var i=this.props,a=i.lockAspectRatio,c=i.lockAspectRatioExtraHeight,u=i.lockAspectRatioExtraWidth,d=typeof o.width>"u"?10:o.width,p=typeof r.width>"u"||r.width<0?n:r.width,h=typeof o.height>"u"?10:o.height,g=typeof r.height>"u"||r.height<0?s:r.height,m=c||0,b=u||0;if(a){var v=(h-m)*this.ratio+b,x=(g-m)*this.ratio+b,y=(d-b)/this.ratio+m,w=(p-b)/this.ratio+m,S=Math.max(d,v),C=Math.min(p,x),j=Math.max(h,y),E=Math.min(g,w);n=vl(n,S,C),s=vl(s,j,E)}else n=vl(n,d,p),s=vl(s,h,g);return{newWidth:n,newHeight:s}},t.prototype.setBoundingClientRect=function(){var n=1/(this.props.scale||1);if(this.props.bounds==="parent"){var s=this.parentNode;if(s){var r=s.getBoundingClientRect();this.parentLeft=r.left*n,this.parentTop=r.top*n}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*n,this.targetTop=o.top*n}if(this.resizable){var i=this.resizable.getBoundingClientRect(),a=i.left,c=i.top,u=i.right,d=i.bottom;this.resizableLeft=a*n,this.resizableRight=u*n,this.resizableTop=c*n,this.resizableBottom=d*n}},t.prototype.onResizeStart=function(n,s){if(!(!this.resizable||!this.window)){var r=0,o=0;if(n.nativeEvent&&C$(n.nativeEvent)?(r=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&yl(n.nativeEvent)&&(r=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var i=this.props.onResizeStart(n,s,this.resizable);if(i===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var a,c=this.window.getComputedStyle(this.resizable);if(c.flexBasis!=="auto"){var u=this.parentNode;if(u){var d=this.window.getComputedStyle(u).flexDirection;this.flexDir=d.startsWith("row")?"row":"column",a=c.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var p={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:us(us({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:s,flexBasis:a};this.setState(p)}},t.prototype.onMouseMove=function(n){var s=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&yl(n))try{n.preventDefault(),n.stopPropagation()}catch{}var r=this.props,o=r.maxWidth,i=r.maxHeight,a=r.minWidth,c=r.minHeight,u=yl(n)?n.touches[0].clientX:n.clientX,d=yl(n)?n.touches[0].clientY:n.clientY,p=this.state,h=p.direction,g=p.original,m=p.width,b=p.height,v=this.getParentSize(),x=j$(v,this.window.innerWidth,this.window.innerHeight,o,i,a,c);o=x.maxWidth,i=x.maxHeight,a=x.minWidth,c=x.minHeight;var y=this.calculateNewSizeFromDirection(u,d),w=y.newHeight,S=y.newWidth,C=this.calculateNewMaxFromBoundary(o,i);this.props.snap&&this.props.snap.x&&(S=jm(S,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(w=jm(w,this.props.snap.y,this.props.snapGap));var j=this.calculateNewSizeFromAspectRatio(S,w,{width:C.maxWidth,height:C.maxHeight},{width:a,height:c});if(S=j.newWidth,w=j.newHeight,this.props.grid){var E=Cm(S,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),T=Cm(w,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),O=this.props.snapGap||0,P=O===0||Math.abs(E-S)<=O?E:S,_=O===0||Math.abs(T-w)<=O?T:w;S=P,w=_}var M={width:S-g.width,height:w-g.height};if(m&&typeof m=="string"){if(m.endsWith("%")){var N=S/v.width*100;S=N+"%"}else if(m.endsWith("vw")){var H=S/this.window.innerWidth*100;S=H+"vw"}else if(m.endsWith("vh")){var L=S/this.window.innerHeight*100;S=L+"vh"}}if(b&&typeof b=="string"){if(b.endsWith("%")){var N=w/v.height*100;w=N+"%"}else if(b.endsWith("vw")){var H=w/this.window.innerWidth*100;w=H+"vw"}else if(b.endsWith("vh")){var L=w/this.window.innerHeight*100;w=L+"vh"}}var F={width:this.createSizeForCssProperty(S,"width"),height:this.createSizeForCssProperty(w,"height")};this.flexDir==="row"?F.flexBasis=F.width:this.flexDir==="column"&&(F.flexBasis=F.height);var G=this.state.width!==F.width,D=this.state.height!==F.height,$=this.state.flexBasis!==F.flexBasis,I=G||D||$;I&&Mn.flushSync(function(){s.setState(F)}),this.props.onResize&&I&&this.props.onResize(n,h,this.resizable,M)}},t.prototype.onMouseUp=function(n){var s,r,o=this.state,i=o.isResizing,a=o.direction,c=o.original;if(!(!i||!this.resizable)){var u={width:this.size.width-c.width,height:this.size.height-c.height};this.props.onResizeStop&&this.props.onResizeStop(n,a,this.resizable,u),this.props.size&&this.setState({width:(s=this.props.size.width)!==null&&s!==void 0?s:"auto",height:(r=this.props.size.height)!==null&&r!==void 0?r:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:us(us({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(n){var s,r;this.setState({width:(s=n.width)!==null&&s!==void 0?s:"auto",height:(r=n.height)!==null&&r!==void 0?r:"auto"})},t.prototype.renderResizer=function(n){var s=this,r=this.props,o=r.enable,i=r.handleStyles,a=r.handleClasses,c=r.handleWrapperStyle,u=r.handleWrapperClass,d=r.handleComponent;if(!o)return null;var p=n.filter(function(h){return o[h]!==!1}).map(function(h){return o[h]!==!1?Xe.createElement(x$,{key:h,direction:h,onResizeStart:s.onResizeStart,replaceStyles:i&&i[h],className:a&&a[h]},d&&d[h]?d[h]:null):null});return Xe.createElement("div",{className:u,style:c},p)},t.prototype.render=function(){var n=this,s=Object.keys(this.props).reduce(function(i,a){return P$.indexOf(a)!==-1||(i[a]=n.props[a]),i},{}),r=us(us(us({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(r.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return Xe.createElement(o,us({style:r,className:this.props.className},s,{ref:function(i){i&&(n.resizable=i)}}),this.state.isResizing&&Xe.createElement("div",{style:this.state.backgroundStyle}),this.renderResizer(["topLeft","top","topRight","left"]),this.props.children,this.renderResizer(["right","bottomLeft","bottom","bottomRight"]))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(Xe.PureComponent);function tu({className:e,children:t,top:n,bottom:s,right:r,left:o,width:i,height:a,minHeight:c,minWidth:u,maxHeight:d,maxWidth:p,style:h,onResize:g,onResizeStop:m,...b}){const v={top:n||!1,right:r||!1,bottom:s||!1,left:o||!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},x={width:i||"auto",height:a||"auto"},y=A("gs-utl-z-10",B.hBgAct),w={top:y,bottom:y,right:y,left:y},S={top:{top:-1,height:2},bottom:{bottom:0,height:2},right:{right:-1,width:2},left:{left:-1,width:2}};return l.jsx(T$,{className:e,enable:b.enable??v,defaultSize:x,handleStyles:S,handleClasses:w,onResize:g,onResizeStop:m,minHeight:c,minWidth:u,maxHeight:d,maxWidth:p,style:h,children:t})}const Ff="gs-cmp-accordion",ap=`${Ff}-handler`,wl=`${ap}__content`,O$=`${Ff}-content`;function Js({className:e,classNameWrap:t,classNameContent:n,classNameHandlerContent:s,style:r,handler:o,handlerIcon:i,children:a,inverted:c,disabled:u,sticky:d,onChange:p,open:h}){return l.jsx(Pu,{as:"div",defaultOpen:h,className:K(Ff,t,"relative"),children:({open:g})=>l.jsxs(l.Fragment,{children:[l.jsx(Pu.Button,{as:u?"div":"button",disabled:u,style:r,onClick:m=>p==null?void 0:p({event:m,open:!g}),className:({open:m})=>A(ap,Ke(e)?e(m):e,d&&"gs-utl-sticky gs-utl-top-0 gs-utl-z-10","gs-utl-w-full"),children:({open:m})=>l.jsxs(k,{items:"center",className:K("gap-2"),full:!0,children:[l.jsx(V,{className:K(wl,s,"text-left"),grow:!0,children:Ke(o)?o(m):l.jsxs(k,{items:"center",className:K(`${wl}-wrp`,"gap-3"),nowrap:!0,children:[!!i&&l.jsx(Q,{className:K(`${wl}-icon`),icon:i,size:oe.s2x}),l.jsx(V,{className:K(`${wl}-label gs-utl-w-full`),children:o})]})}),l.jsx(V,{className:K(`${ap}-toggle`,c&&"-order-1",u&&"gs-utl-hidden"),children:l.jsx(Q,{icon:U.chevronDown,className:K("w-5 h-5 transition-transform",m&&"rotate-180")})})]})}),l.jsx(Pu.Panel,{className:K(O$,n),children:a})]})})}const Oi="gs-studio-panel",iy=(e,t={})=>({...t,...e===!0?{}:e||void 0}),rs=f.memo(function({children:t,header:n,resizable:s,className:r,classNameAccordion:o,classNameAccordionContent:i,...a}){const c=l.jsx(dn,{className:A(Oi,r),...a,children:t}),u=s?s===!0?{top:!0,right:!0,bottom:!0,left:!0}:s:void 0,d=u?l.jsx(tu,{className:A([`${Oi}__resizer`]),...u,children:c}):c,p=n===!0?{collapsible:!0}:n||void 0;return p?l.jsx(Js,{classNameWrap:A(`${Oi}__accordion`,o),className:A(`${Oi}__accordion-header`,we.xy,p.className),classNameContent:A(`${Oi}__accordion-content`,i),disabled:p.collapsible===!1,style:p.style,handler:l.jsxs(k,{space:"s",items:"center",children:[!!p.icon&&l.jsx(Q,{icon:p.icon,size:oe.s}),l.jsx(V,{grow:!0,children:p.label})]}),open:n?p.collapsed!==!0:!0,children:d}):d}),_$="gs-panel-assets",A$=f.memo(ae(function({className:t,onSelect:n,content:s,assets:r,types:o,providers:i,typeId:a,providerId:c,optionalType:u,optionalProvider:d,projectAssetsOption:p,layoutAfterHeader:h,...g}){var C;const m=me(),b=Ia(),v=m.editor,x=(C=m.sdkOptions.assets)==null?void 0:C.layoutAfterHeader,y=h||x,[w]=f.useState(()=>g.id||xv());return f.useEffect(()=>(b.createAssetManager(w),()=>{b.removeAssetManager(w)}),[w]),Hv(w)?l.jsx(rs,{className:A(_$,"gs-utl-overflow-hidden gs-utl-h-full",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...g,children:v&&l.jsx(b$,{panelId:w,assets:r,types:o,providers:i,onSelect:n,typeId:a,providerId:c,content:s,optionalType:u,optionalProvider:p??d,layoutAfterHeader:y})}):null}));var Ri=(e=>(e.REGULAR="regular",e.SYMBOLS="symbols",e))(Ri||{}),ms=(e=>(e.before="before",e.beforeInside="beforeInside",e.afterInside="afterInside",e.after="after",e))(ms||{});const Pm="gs-block-item",M$=e=>{const{block:t,className:n,itemLayout:s,onClick:r,variant:o}=e,{editor:i}=me(),a=Ae(),[,c]=f.useState(0),u=a.tScoped("blockManager.labels"),d=t.getId(),p=!!t.get("full"),h=r||t.get("onClick"),g=t.get("disable"),m=t.get("mediaReact"),b=t.getMedia(),v=t.get("attributes")||{},x=u(d)||t.getLabel(),y=o==="compact",w=A(Pm,`${Pm}--${d}`,n,"gs-utl-px-2 gs-utl-transition-colors",X.b,X.rnd,B.br,p&&"gs-utl-col-span-full",y?"gs-utl-py-1":"gs-utl-py-2",y?"gs-utl-flex-row gs-utl-nowrap gs-utl-gap-3 gs-utl-justify-start":"gs-utl-flex-col",g?Se.disabledM:A("gs-utl-cursor-pointer",B.hTAo,B.hBgH)),S=At(v.class)&&!y?v.class:A("gs-utl-block-media gs-utl-w-full",y?"gs-utl-max-h-7 gs-utl-max-w-7 gs-utl-overflow-hidden":"gs-utl-max-h-10 gs-utl-max-w-10"),C=A("gs-utl-text-center",Se.txtEllips,!y&&"gs-utl-w-full");if(f.useEffect(()=>{if(!i)return;const{Blocks:_}=i,M=_.events.update,N=H=>H===t&&c(L=>++L);return i.on(M,N),()=>{i.off(M,N)}},[t,i]),!i)return null;const{Blocks:j}=i,O={className:w,...!g&&{onDragStart:()=>j.startDrag(t),onDragEnd:()=>j.endDrag(!1),draggable:!r},...!!h&&{onClick:()=>h(t,i)}},P=s==null?void 0:s({editor:i,block:t,attributes:O});return P&&Pt(P)||l.jsxs(k,{items:"center",...O,children:[m||l.jsx("div",{className:S,dangerouslySetInnerHTML:{__html:b}}),l.jsx("div",{className:C,title:x,children:x})]})},Tm=ae(M$);function Bf({className:e,value:t,onChange:n}){const[s,r]=f.useState(t),o=f.useRef(null),i=u=>{const{value:d}=u.target;r(d)},a=()=>{n(s||t)},c=u=>{switch(u.key){case"Escape":n(t);break;case"Enter":n(s||t);break}};return f.useEffect(()=>{o.current&&o.current.select()},[]),l.jsx("input",{autoFocus:!0,className:K([e,"w-full",B.bgTr]),value:s,onChange:i,onBlur:a,onKeyDown:c,onPointerDown:ao,ref:o})}function ay({className:e,value:t,active:n,unstyled:s,activable:r,onChange:o,onActive:i,...a}){const[c,u]=f.useState(n);f.useEffect(()=>{u(n)},[n]);const d=h=>{i==null||i(h),u(h)},p=h=>{o(h),d(!1)};return l.jsx("div",{className:K("truncate",e),...a,onDoubleClick:()=>r&&d(!0),children:c?l.jsx(Bf,{className:K(s&&Se.noFocusOut),value:t,onChange:p}):l.jsx(l.Fragment,{children:t})})}const Om=ie("text-sm w-full",Se.txtEllips),L$=({symbol:e,className:t})=>{const n=Fa(),{Components:s}=n,r=Ae(),o=di(),i=r.tScoped("blockManager.symbols"),a=()=>{const{draggable:x,droppable:y,attributes:w,type:S,tagName:C}=e.attributes;n.Canvas.startDrag({content:()=>s.addSymbol(e),model:e,dragDef:{type:S,tagName:C,draggable:x,droppable:y,attributes:w}})},c=()=>{n.Canvas.endDrag()},u=e.getIcon(),d=e.getName(),p=s.getSymbolInfo(e).instances.length,h=ie("h-10 w-10 block-media",B.grouphTAo),g=ie("gjs-pt-1 gjs-mt-2",X.bt,B.br),m=ie("cursor-pointer gjs-p-2 transition-colors group",X.b,X.rnd,B.br,B.hBgH,t),b=()=>{o.confirm({title:i("delete"),content:i("deleteConfirm"),onConfirm:()=>e.remove()})},v=x=>{e.set("custom-name",x)};return l.jsxs(k,{className:m,onDragStart:a,onDragEnd:c,items:"center",draggable:!0,col:!0,children:[l.jsx("div",{className:h,dangerouslySetInnerHTML:{__html:u}}),l.jsxs(k,{items:"center",justify:"between",className:g,space:"m",full:!0,children:[l.jsx(V,{children:l.jsx(k,{className:ie(Om,"gjs-mr-auto"),children:l.jsx($t,{title:`${p} ${i("instancesProject")}`,children:l.jsx(jr,{label:`${p}`,className:ie(B.bgH75)})})})}),l.jsx(V,{className:ie("truncate"),grow:!0,title:d,children:l.jsx(ay,{activable:!0,value:d,className:Om,onChange:v})}),l.jsx(V,{className:ie(Se.hoverGroup),children:l.jsx(k,{justify:"end",full:!0,children:l.jsx(ft,{onClick:b,title:i("delete"),border:!1,size:"",block:!0,children:l.jsx(Q,{icon:U.delete,size:oe.s})})})})]})]})},N$=ae(L$),lr="gs-block-manager",_m={id:ms.before,title:"Add before",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <path d="M4 5v14"/> <rect fill="none" x="8" y="5" width="12" height="14" rx="2" ry="2"/> </svg>'},$$={id:ms.beforeInside,title:"Add inside first",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <rect fill="none" x="4" y="5" width="16" height="14" rx="2" ry="2"/> <path d="M8 8v8"/> </svg>'},k$={id:ms.afterInside,title:"Add inside last",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <rect fill="none" x="4" y="5" width="16" height="14" rx="2" ry="2"/> <path d="M16 8v8"/> </svg>'},Am={id:ms.after,title:"Add after",icon:'<svg xmlns="http://www.w3.org/2000/svg" stroke="currentColor" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"> <rect fill="none" x="4" y="5" width="12" height="14" rx="2" ry="2"/> <path d="M20 5v14"/> </svg>'},Mm=(e,t)=>{const n=t==null?void 0:t.getId();return n&&e.I18n.t(`blockManager.categories.${n}`)||(t==null?void 0:t.getLabel())||""},ly=e=>{const t=e.getContent();return Ke(t)?e.getDragDef():t},R$=e=>{const t=ly(e);return Array.isArray(t)?t[0]:t},I$=ae(function({isOpen:t,className:n,hideCategories:s,target:r,variant:o,itemLayout:i,...a}){var Ne,Dt;const{editor:c}=me(),u=Ae(),[d,p]=f.useState(0),[h,g]=f.useState(Ri.REGULAR),[m,b]=f.useState(""),[v,x]=f.useState(""),y=f.useRef(new Set),[w,S]=f.useState((r==null?void 0:r.position)||ms.after),[C,j]=f.useState(()=>(c==null?void 0:c.Components.getSymbols())||[]),E=h===Ri.SYMBOLS,T=f.useRef(null),O=u.tScoped("blockManager"),P=r==null?void 0:r.component;if(f.useEffect(()=>{if(!c)return;const{Blocks:pe,Components:Me}=c,Le=pe.events.custom,Oe=Me.events.symbol,vt=()=>{j(Me.getSymbols()),p(Mt=>++Mt)};return c.on(Oe,vt),c.on(Le,vt),()=>{c.off(Oe,vt),c.off(Le,vt)}},[c]),f.useEffect(()=>{if(T.current&&t){const pe=T.current.querySelector("input");setTimeout(()=>pe==null?void 0:pe.focus(),Lp)}},[T.current,t]),!c)return null;const{Blocks:_,Components:M}=c,N=pe=>O(`labels.${pe.getId()}`)||pe.getLabel(),H=C.filter(pe=>Go(pe.getName(),m)),L=_.getAll().map(pe=>pe),F=((Ne=a.blocks)==null?void 0:Ne.call(a,{blocks:L}))||L,G=w===ms.before,D=w===ms.beforeInside,$=w===ms.afterInside,I=w===ms.after,R=!!(P!=null&&P.attributes.droppable),z=F.filter(pe=>{const Me=Mm(c,pe.category);if(m&&!Go(Me,m)&&!Go(N(pe),m))return!1;if(P){const Le=R$(pe);if(R&&(D||$)){const Oe=D?0:void 0;return M.canMove(P,Le,Oe).result}else if(G||I){const Oe=P.index(),vt=P.parent(),Mt=G?Oe:Oe+1;return vt&&M.canMove(vt,Le,Mt).result}}return!0}),Y=_.getBlocksByCategory(z),Z=s?z:(Dt=Y.find(pe=>!pe.category))==null?void 0:Dt.items,J=s?[]:Y.filter(pe=>pe.category),ee=a.symbols!==!1,te=a.search!==!1,q=!ee&&!te,ne=o==="compact",ce=O("search")||u.t("search"),ge=A(lr,n,"gap-2"),Re=A(`${lr}__header`,"gs-utl-pt-2",we.xS,q&&"gs-utl-hidden"),ve=A(`${lr}__content`,Se.scrollY,B.br,X.bt),qe=A(`${lr}__symbols`,"gs-utl-grid gs-utl-grid-cols-1 gs-utl-gap-2 gs-utl-p-2"),Be=A(`${lr}__not-found`,"gs-utl-text-center gs-utl-p-4"),ht=A(`${lr}__blocks`,"gs-utl-grid gs-utl-gap-2 gs-utl-p-2 gs-utl-text-sm",ne?"gs-utl-grid-cols-1":"gs-utl-grid-cols-2"),et=A(`${lr}__no-category`,ht,B.br,J.length&&X.bb),be=A(B.tAo,B.bgH75,X.bA),Ze=`${lr}__category`,Ye=[{id:Ri.REGULAR,label:O("types.regular")},{id:Ri.SYMBOLS,label:O("types.symbols")}],lt=R?[_m,$$,k$,Am]:[_m,Am],Pe=P?pe=>{const Me=ly(pe);if(!Me)return;let Le;if(D||$){const Oe=D?0:void 0;Le=P.append(Me,{at:Oe})[0]}else if(G||I){const Oe=P.index(),vt=P.parent(),Mt=G?Oe:Oe+1;Le=vt==null?void 0:vt.append(Me,{at:Mt})[0]}if(Le){const{activate:Oe,select:vt}=pe.attributes;vt||Oe&&vt!==!1?c.em.setSelected(Le,{activate:Oe}):Oe&&Le.trigger("active")}}:void 0,st=pe=>{if(!P)return;const Me=Array.from(y.current);if(pe.key==="ArrowDown")pe.preventDefault(),x(Le=>{const Oe=Me.indexOf(Le);return Me.at(Math.min(Oe+1,Me.length-1))||""});else if(pe.key==="ArrowUp")pe.preventDefault(),x(Le=>{const Oe=Me.indexOf(Le);return Me.at(Math.max(Oe-1,0))||""});else if(pe.key==="Enter"&&v){const Le=_.get(v);Le&&(Pe==null||Pe(Le))}},tt=pe=>{y.current.clear(),b(pe)};return l.jsxs(k,{className:ge,col:!0,full:!0,children:[l.jsxs(k,{className:Re,gap:"s",col:!0,children:[ee&&l.jsx(Dr,{tabs:Ye,onChange:g,value:h,variant:"pills"}),P&&l.jsx(Wt,{size:"s",options:lt,value:w,onChange:pe=>S(pe)}),te&&l.jsx(Je,{ref:T,size:"s",value:m,onInput:tt,onKeyDown:st,placeholder:ce,type:"search"})]}),l.jsxs(V,{className:ve,grow:!0,children:[E&&(H.length?l.jsx(k,{className:qe,children:H.map(pe=>l.jsx(N$,{symbol:pe},`${d}_${pe.getId()}`))}):l.jsx(k,{className:Be,justify:"center",children:O("symbols.notFound")})),!E&&(z.length?l.jsxs(l.Fragment,{children:[!!(Z!=null&&Z.length)&&l.jsx(k,{className:et,children:Z==null?void 0:Z.map(pe=>(y.current.add(`${pe.id}`),l.jsx(Tm,{block:pe,itemLayout:i,onClick:Pe,variant:o,className:A(v===pe.id&&be)},pe.id)))}),J.map(({category:pe,items:Me},Le)=>l.jsx(Js,{sticky:!0,className:Oe=>$p.itemList({index:Le,open:Oe,length:J.length}),open:!!(pe!=null&&pe.get("open")),onChange:({open:Oe})=>pe==null?void 0:pe.set({open:Oe}),handler:Mm(c,pe),handlerIcon:pe==null?void 0:pe.get("icon"),classNameWrap:A(Ze,`${Ze}--${pe==null?void 0:pe.id}`),children:l.jsx(k,{className:ht,children:Me.map(Oe=>(y.current.add(`${Oe.id}`),l.jsx(Tm,{block:Oe,itemLayout:i,onClick:Pe,variant:o,className:A(v===Oe.id&&be)},Oe.id)))})},pe==null?void 0:pe.id))]}):l.jsx(k,{className:Be,justify:"center",children:O("notFound")}))]})]})}),V$=f.forwardRef(function({children:t,className:n,...s},r){return l.jsx("div",{className:A(ie("gs-block-manager-after"),n),ref:r,...s,children:t})}),H$=f.forwardRef(function({children:t,className:n,...s},r){return l.jsx("div",{className:A(ie("gs-block-manager-before"),n),ref:r,...s,children:t})}),D$="gs-panel-blocks",F$=f.memo(ae(function({className:t,symbols:n,search:s,hideCategories:r,target:o,variant:i,blocks:a,itemLayout:c,...u}){const d=me().sdkProps.children,p={search:s,symbols:n,hideCategories:r,isOpen:!0,target:o,variant:i,blocks:a,itemLayout:c};return l.jsx(rs,{className:A(D$,"gs-utl-overflow-hidden",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...u,children:l.jsxs(Ba,{children:[$n(d,H$),l.jsx(I$,{className:A("gs-utl-overflow-hidden gs-utl-flex-nowrap"),...p}),$n(d,V$)]})})})),B$="gs-cmp-color-picker",z$={backgroundSize:"10px"},U$=[0,15];function cy({className:e,value:t,onChange:n,disabled:s}){const[r,o]=f.useState(!1),i=A(`${B$}-handler gs-utl-bg-checker gs-utl-overflow-hidden gs-utl-cursor-pointer`,e,X.b,X.rnd,B.br),a=()=>{o(!1)},c=l.jsxs("div",{style:z$,className:i,children:[r&&l.jsx("div",{onPointerUp:a,className:"gs-utl-fixed gs-utl-inset-0 gs-utl-z-50 gs-utl-cursor-grabbing"}),l.jsx("div",{className:"gs-utl-w-4 gs-utl-h-4",style:{backgroundColor:t}})]});return l.jsx(ss,{handler:c,title:"Color",size:"s",placement:"left-end",offset:U$,clickAway:!0,disabled:s,children:l.jsx(Q0,{value:t,onChange:n,disabled:s})})}const W$="gs-cmp-color-field";function Qs(e){const{className:t,value:n,placeholder:s,preventSubmitOnEnter:r=!1,onChange:o,labelAs:i,disabled:a}=e,[c,u]=f.useState(oc(n)),d=Da(e);f.useEffect(()=>{u(oc(n))},[n]);const p=(b,v)=>{o==null||o(b,v)},h=b=>{switch(b.key){case"Escape":return u(n);case"Enter":p(c),r&&(b.preventDefault(),b.stopPropagation())}},g=()=>{p(c)},m=Vr({...e,className:A(W$,t)});return l.jsxs("div",{...m,children:[l.jsx(ns,{...e,as:i}),l.jsxs(k,{className:jf(e),items:"center",space:"s",children:[l.jsx(V,{children:l.jsx(cy,{value:n,onChange:o,disabled:a})}),l.jsx(V,{grow:!0,children:l.jsx("input",{className:A(d,a&&"gs-utl-pointer-events-none"),value:c,onChange:b=>u(b.target.value),placeholder:s,onBlur:g,onKeyDown:h,disabled:a})})]})]})}const G$=(e,t)=>{t.runCommand(se.fontAdd,{font:e})},zf=(e,{onSelect:t,...n}={})=>{const s="font",i=e.runCommand(se.assetProviderGet).filter(a=>nt(a.types)?a.types===s:a.types.includes(s))[0];if(!i){e.em.logWarning("No font provider found");return}e.Assets.open({types:[],modalTitle:e.I18n.t("fontManager.selectFont"),projectAssetsOption:!1,typeId:s,providerId:i.id,onSelect:a=>{const c=a.assetProps;G$(c.customData.font,e),t==null||t(a)},content:{header:{addUrl:!1,upload:!1},itemsPerRow:1},...n})},nu=ae(e=>{const{buttonClassName:t,value:n,...s}=e,{editor:r}=me(),o=Ae(),i=Ia(),a=Va(),c=[...s.options||[],...a.fontFamilyOptions].map(u=>{const d=a.getFont(u.id),p=d?vf(d):u.id;return{...u,content:l.jsx(k,{col:!0,children:l.jsx(V,{style:{fontFamily:p},children:u.label})})}});return l.jsx(je,{...s,value:bo(n),options:c,afterLabel:a.sdkAddFonts&&i.hasType("font")&&l.jsx(ft,{className:t,title:o.t("fontManager.addFontToProject"),icon:U.plus,size:"xs",border:!1,block:!0,onClick:()=>r&&zf(r,{onSelect:({assetProps:u})=>{const{customData:{font:d}}=u;s.onChange(bo(d.family))}})})})}),q$=(e,{t,id:n})=>t(`fields.${n}.label`)||vs(`${e}`.replace(/-/g," ")),uy=(e,{t,id:n})=>{const s=nt(e)?{id:e,label:e}:e;return{...s,label:t(`fields.${n}.options.${s.id}`)||s.label}},dy=e=>e.get("defaultValue")||"",Ua=e=>e.get("field"),py=e=>{const t=Ua(e);return nt(t)?{type:t}:t},fy=e=>`${e.get("value")||dy(e)||py(e).defaultValue||""}`,K$=(e,t)=>e||dy(t)||"",ua=({record:e,value:t,partial:n})=>{e.set({value:K$(t,e)},{partial:n}),e.em.refreshCanvas({tools:!0})},da=(e,t)=>{const{className:n,defaultValue:s,size:r,...o}=py(e),i=s??e.get("defaultValue");return{...o,hasClear:()=>{const a=e.get("value");return!!a&&At(i)&&a!==i},className:A(n,"gs-utl-w-full"),size:r||"s",value:fy(e),label:q$(e.get("label")||e.id||"",t),onChange:(a,c)=>ua({record:e,value:a,partial:c})}},Z$=(e,t)=>{const n=Ua(e),s=tr(n)?n:void 0,r=(s==null?void 0:s.units)||[],o=TN(fy(e)),i=o.number,a=o.unit||r[0]||"";return{...da(e,t),value:i,valueUnit:a,min:s==null?void 0:s.min,max:s==null?void 0:s.max,step:s==null?void 0:s.step,units:s==null?void 0:s.units,onChange:(c,u)=>{ua({value:c?`${c}${a}`:"",record:e,partial:u})},onChangeUnit:c=>{ua({value:i?`${i}${c}`:"",record:e})}}},hy=(e,t)=>{var o;const n=Ua(e),s=tr(n)?n:void 0,r=((o=s==null?void 0:s.options)==null?void 0:o.map(i=>uy(i,t)))||[];return{...da(e,t),options:r,onChange:i=>ua({value:i,record:e})}},Y$=(e,t)=>({...da(e,t),onChange:n=>ua({value:n,record:e})}),X$=(e,t)=>{var o;const n=Ua(e),s=tr(n)?n:void 0,r=((o=s==null?void 0:s.options)==null?void 0:o.map(i=>uy(i,t)))||[];return{...hy(e,t),size:"s",options:r}};function J$(e,t){const n=Ua(e);switch(nt(n)?n:n==null?void 0:n.type){case"radio":return l.jsx(Wt,{...X$(e,t)});case"select":return l.jsx(je,{...hy(e,t)});case"selectFont":{const r=Y$(e,t);return l.jsx(nu,{...r,labelAs:"div"})}case"number":return l.jsx(Te,{...Z$(e,t)});case"color":return l.jsx(Qs,{...da(e,t)});default:return l.jsx(Je,{...da(e,t)})}}const Lm="gs-cmp-global-style-field",Q$=ae(function({record:t}){const n=me(),r=Ae().tScoped("globalStyleManager"),[,o]=f.useState(0),i=n.editor,a=t.id,c={t:r,id:a};return f.useEffect(()=>{if(!i)return;const u=`data:path:${t.getPath("value")}`,d=()=>o(p=>++p);return i.on(u,d),()=>{i.off(u,d)}},[i]),l.jsx(k,{className:A(Lm,`${Lm}__${a}`),children:J$(t,c)})}),qi="gs-cmp-global-style-manager",Nm=({items:e,category:t,className:n})=>{const s=A(t?`${qi}__cat-fields--${t.id}`:`${qi}__uncat-fields`,"gs-utl-gap-2",we.xy,n);return l.jsx(k,{className:s,nowrap:!0,col:!0,children:e.map(r=>l.jsx(Q$,{record:r},r.id))})},e6=ae(function(){const t=Z_(),{recordsByCategory:n,openCategories:s}=t,o=Ae().tScoped("globalStyleManager");return l.jsx(k,{col:!0,full:!0,nowrap:!0,className:A(qi,"gs-utl-flex-grow gs-utl-overflow-hidden"),children:l.jsx(k,{col:!0,nowrap:!0,className:A(`${qi}__fields`,Se.scrollY,"gs-utl-select-none"),children:n.length?n.map(({category:i,items:a},c)=>i?l.jsx(Js,{sticky:!0,open:s.get(i.id)??i.open,handler:o(`categories.${i.id}.label`)||i.label||i.id,onChange:({open:u})=>t.setCategoryOpen(i.id,u),className:u=>A(`${qi}__cat-fields`,$p.itemList({index:c,open:u,length:n.length}),c===0&&X.bt),children:l.jsx(Nm,{category:i,items:a})},i.id):l.jsx(Nm,{items:a,className:A(n.length!==1&&[X.bt,B.br])},c)):l.jsx(k,{className:A("gs-utl-text-center"),justify:"center",children:o("notFound")})})})}),t6="gs-panel-global-styles",n6=f.memo(ae(function({className:t,...n}){return l.jsx(rs,{className:A(t6,"gs-utl-overflow-auto",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-auto"),...n,children:l.jsx(Ba,{children:l.jsx(e6,{})})})})),s6={maxWidth:`${Dx}px`},r6="gs-cmp-layer-item";function gy({component:e,draggingCmp:t,dragParent:n,...s}){const r=Fa(),{Layers:o}=r,i=f.useRef(null),[a,c]=f.useState(!1),[u,d]=f.useState(o.getLayerData(e)),{open:p,selected:h,hovered:g,components:m,visible:b,locked:v,name:x}=u,y=m.map(D=>D.cid),w=t===e,S=y.join("-"),C=s.level+1,j=g||n===e;f.useEffect(()=>{C===0&&d(o.getLayerData(e)),i.current&&(i.current.__cmp=e)},[e]),f.useEffect(()=>{const D=i.current;if(!D)return;const{select:$}=r.Components.events,I=R=>R===e&&D.scrollIntoView({block:"nearest"});return r.on($,I),()=>{r.off($,I)}},[e,i.current]),f.useEffect(()=>{const D=I=>{I===e&&d(o.getLayerData(I))},$=o.events.component;return r.on($,D),()=>{r.off($,D)}},[r,o,e]);const E=f.useMemo(()=>m.map(D=>l.jsx(gy,{component:D,level:C,draggingCmp:t,dragParent:n},D.cid)),[S,t,n]),T=D=>{o.setLayerData(e,{name:D}),c(!1)},O=D=>{D.stopPropagation(),o.setLayerData(e,{open:!p})},P=D=>{D.stopPropagation(),o.setLayerData(e,{visible:!b})},_=D=>{D.stopPropagation(),o.setLayerData(e,{locked:!v})},M=D=>{D.stopPropagation(),o.setLayerData(e,{selected:!0},{event:D})},N=D=>{D.preventDefault(),r.runCommand(se.contextMenuComponent,{source:bf.layers,component:e,event:D.nativeEvent,x:D.clientX,y:D.clientY})},H=D=>{(!D||!t)&&o.setLayerData(e,{hovered:D})},L=$b(e),F=K("layer-item",(h||L.isSymbol)&&L.bgSoftX,(!b||w)&&"opacity-50"),G=K(we.xyS,X.b,j?L.border:X.bT,h&&L.bgSoft);return l.jsx("div",{className:r6,children:l.jsxs(k,{col:!0,className:F,children:[l.jsx(V,{onClick:M,onContextMenu:N,onMouseEnter:()=>H(!0),onMouseLeave:()=>H(!1),className:K("group max-w-full"),"data-layer-item":!0,ref:i,children:l.jsxs(k,{items:"center",space:"xs",className:G,children:[l.jsx(V,{style:{marginLeft:`${C*10}px`},className:K("cursor-pointer",!m.length&&"pointer-events-none opacity-0"),onClick:O,children:l.jsx(Q,{icon:U.menuDown,size:oe.sx,rotate:p?0:-90})}),l.jsx(V,{children:Lv(e)}),l.jsx(V,{className:K("truncate"),onDoubleClick:()=>c(!0),style:s6,grow:!0,children:a?l.jsx(Bf,{value:x,onChange:T}):l.jsx(l.Fragment,{children:x})}),!a&&l.jsxs(l.Fragment,{children:[l.jsx(V,{className:K("group-hover:gs-utl-opacity-100 cursor-pointer",v?"opacity-100":"opacity-0"),onClick:_,children:l.jsx(Q,{icon:v?U.lock:U.lockOpenVariant,size:oe.s3x})}),l.jsx(V,{className:K("group-hover:gs-utl-opacity-100 cursor-pointer",b?"opacity-0":"opacity-100"),onClick:P,children:l.jsx(Q,{icon:b?U.eyeOutline:U.eyeOffOutline,size:oe.sx})})]})]})}),!!(p&&m.length)&&l.jsx(V,{className:K("max-w-full",!p&&"hidden"),children:E})]})})}const o6={touchAction:"none"},$m=5,i6=e=>{var o,i;const t=document.elementFromPoint(e.clientX,e.clientY),n=t==null?void 0:t.closest("[data-layer-item]"),s=n==null?void 0:n.__cmp,r=((i=(o=s==null?void 0:s.delegate)==null?void 0:o.move)==null?void 0:i.call(o,s))||s;return{el:n,cmp:r}},my=ae(function({root:t,header:n}){const{editor:s}=me(),[r,o]=f.useState(!1),[i,a]=f.useState({}),[c,u]=f.useState(),[d,p]=f.useState(),[h,g]=f.useState(),[m,b]=f.useState(),v=f.useRef(null);if(f.useEffect(()=>{const O=window.document,P=_=>{_.key==="Escape"&&(a({...i,result:!1}),S())};return O.addEventListener("keydown",P),()=>{O.removeEventListener("keydown",P)}},[]),!s)return null;const{Components:x}=s,y=O=>{O.button===0&&o(!0)},w=O=>{if(!r)return;const{cmp:P,el:_}=i6(O);if(!_||!P)return;const M=_.getBoundingClientRect(),N=_.offsetHeight,H=_.offsetTop,L=O.clientY,F=L<M.y+N/2,G=d||P,D=P.parent(),$=P.index()+(F?0:1);!d&&p(P),u(P);const I=x.canMove(D,G,$),R=x.canMove(P,G),z={...I,canMoveInside:R,index:$};let Y=!1;R.result&&L>M.y+$m&&L<M.y+N-$m&&(Y=!0,z.target=P,delete z.index),g(Y?P:void 0),a(z),b({pointerInside:Y,y:H+(F?0:N),h:N})},S=()=>{var O;i!=null&&i.result&&((O=i.source)==null||O.move(i.target,{at:i.index})),a({}),o(!1),p(void 0),u(void 0),g(void 0),b(void 0)},C=(c?c.parents():[]).length,j=!!(d&&m&&(i!=null&&i.result)&&!m.pointerInside),E=j?{top:m.y,left:0,marginLeft:C*10+20}:{},T=n&&(n==null?void 0:n.label)||"Layers";return l.jsxs(k,{col:!0,full:!0,nowrap:!0,className:K("gs-layer-manager flex-grow overflow-hidden"),children:[n!==!1&&l.jsx(V,{children:l.jsxs(k,{space:"s",items:"center",className:K([we.xy,X.bb,B.br]),children:[l.jsx(V,{children:l.jsx(Q,{icon:U.layers,size:oe.s})}),l.jsx(V,{grow:!0,children:T})]})}),l.jsxs(V,{className:K("overflow-y-auto overflow-x-hidden text-sm select-none relative"),style:o6,onPointerDown:y,onPointerMove:w,onPointerUp:S,grow:!0,children:[!!t&&l.jsx(gy,{component:t,level:-1,draggingCmp:d,dragParent:h}),j&&l.jsx("div",{ref:v,className:K("absolute w-full gs-utl-h-0.5",B.cmp),style:E})]})]})}),by=f.forwardRef(function({children:t,className:n,...s},r){return l.jsx("div",{className:A(ie("gs-layer-manager-after"),n),ref:r,...s,children:t})}),vy=f.forwardRef(function({children:t,className:n,...s},r){return l.jsx("div",{className:A(ie("gs-layer-manager-before"),n),ref:r,...s,children:t})}),a6="gs-panel-layers",yy=f.memo(ae(function({className:t,...n}){const s=me().sdkProps.children;return l.jsx(rs,{className:A(a6,"gs-utl-overflow-auto",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-auto"),...n,children:l.jsx(w0,{children:r=>l.jsxs(l.Fragment,{children:[$n(s,vy),l.jsx(my,{...r,header:!1}),$n(s,by)]})})})})),qr="gs-cmp-file-field";function pa(e){var C;const{className:t,value:n,btnLabel:s,nameLabel:r,size:o,isContain:i,clear:a,inputField:c,placeholder:u,preview:d=50,disabled:p,hideButton:h,labelAs:g,onChange:m,onOpen:b}=e,v=(n||"").replace(/^"|"$/gi,""),x=((C=v.split("/").pop())==null?void 0:C.split("?")[0])||"",y={minWidth:d,minHeight:d},w=v?{...y,backgroundImage:`url("${v}")`}:y,S=A(" gs-utl-w-full gs-utl-bg-checker gs-utl-bg-no-repeat gs-utl-bg-center",i?"gs-utl-bg-contain":"gs-utl-bg-cover",X.b,X.rnd,B.br);return l.jsxs(k,{className:A(qr,t,"gs-utl-gap-1"),col:!0,nowrap:!0,children:[l.jsx(ns,{...e,as:g}),l.jsxs(k,{className:A(`${qr}-content gs-utl-gap-1`,B.bg),items:"center",nowrap:!0,children:[l.jsx(V,{className:A(`${qr}-preview`),children:l.jsx("div",{className:S,style:w})}),l.jsxs(V,{className:A(`${qr}-fields gs-utl-overflow-hidden`),grow:!0,children:[x&&r!==!1&&l.jsx(_r,{className:A(`${qr}-name`,"gs-utl-mb-2",Se.txtEllips),as:"div",size:o,capitalize:!1,children:x}),l.jsxs(k,{className:A(`${qr}-buttons`),space:"s",nowrap:!0,children:[!h&&l.jsx(Ge,{onClick:()=>b==null?void 0:b(n),size:o,type:"button",block:!0,full:!0,disabled:p,children:s||"Select image"}),!!n&&a&&l.jsx(ft,{onClick:()=>m==null?void 0:m(""),title:a.tooltip,size:o,icon:{icon:U.close,size:oe.s},type:"button",block:!0})]})]})]}),c&&l.jsx(Je,{className:A(`${qr}-input`),value:v,onChange:m,size:o,placeholder:u})]})}function l6(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>s=>{t.forEach(r=>r(s))},t)}const su=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function mi(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Uf(e){return"nodeType"in e}function Br(e){var t,n;return e?mi(e)?e:Uf(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Wf(e){const{Document:t}=Br(e);return e instanceof t}function bi(e){return mi(e)?!1:e instanceof Br(e).HTMLElement}function xy(e){return e instanceof Br(e).SVGElement}function vi(e){return e?mi(e)?e.document:Uf(e)?Wf(e)?e:bi(e)||xy(e)?e.ownerDocument:document:document:document}const vo=su?f.useLayoutEffect:f.useEffect;function c6(e){const t=f.useRef(e);return vo(()=>{t.current=e}),f.useCallback(function(){for(var n=arguments.length,s=new Array(n),r=0;r<n;r++)s[r]=arguments[r];return t.current==null?void 0:t.current(...s)},[])}function u6(){const e=f.useRef(null),t=f.useCallback((s,r)=>{e.current=setInterval(s,r)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Wa(e,t){const n=f.useRef();return f.useMemo(()=>{const s=e(n.current);return n.current=s,s},[...t])}function Gf(e){const t=c6(e),n=f.useRef(null),s=f.useCallback(r=>{r!==n.current&&(t==null||t(r,n.current)),n.current=r},[]);return[n,s]}let td={};function Ga(e,t){return f.useMemo(()=>{if(t)return t;const n=td[e]==null?0:td[e]+1;return td[e]=n,e+"-"+n},[e,t])}function wy(e){return function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];return s.reduce((o,i)=>{const a=Object.entries(i);for(const[c,u]of a){const d=o[c];d!=null&&(o[c]=d+e*u)}return o},{...t})}}const fa=wy(1),Sy=wy(-1);function d6(e){return"clientX"in e&&"clientY"in e}function p6(e){if(!e)return!1;const{KeyboardEvent:t}=Br(e.target);return t&&e instanceof t}function f6(e){if(!e)return!1;const{TouchEvent:t}=Br(e.target);return t&&e instanceof t}function lp(e){if(f6(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return d6(e)?{x:e.clientX,y:e.clientY}:null}const ha=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[ha.Translate.toString(e),ha.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:s}=e;return t+" "+n+"ms "+s}}}),h6={display:"none"};function g6(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:h6},n)}function m6(e){let{id:t,announcement:n,ariaLiveType:s="assertive"}=e;const r={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return f.createElement("div",{id:t,style:r,role:"status","aria-live":s,"aria-atomic":!0},n)}function b6(){const[e,t]=f.useState("");return{announce:f.useCallback(s=>{s!=null&&t(s)},[]),announcement:e}}const v6={draggable:`
388
334
  To pick up a draggable item, press the space bar.
389
335
  While dragging, use the arrow keys to move the item.
390
336
  Press space again to drop the item in its new position, or press escape to cancel.
391
- `},h6={onDragStart(e){return`Picked up draggable item ${e}.`},onDragOver(e,t){return t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`},onDragEnd(e,t){return t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`},onDragCancel(e){return`Dragging was cancelled. Draggable item ${e} was dropped.`}};var ut;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ut||(ut={}));function wd(...e){}class aa extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:t})=>!t)}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const yu=h.createContext({activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,activeNodeClientRect:null,activators:[],ariaDescribedById:{draggable:""},containerNodeRect:null,dispatch:wd,draggableNodes:{},droppableRects:new Map,droppableContainers:new aa,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:wd},scrollableAncestors:[],scrollableAncestorRects:[],recomputeLayouts:wd,windowRect:null,willRecomputeLayouts:!1});function g6(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new aa}}}function m6(e,t){switch(t.type){case ut.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ut.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case ut.DragEnd:case ut.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ut.RegisterDroppable:{const{element:n}=t,{id:s}=n,r=new aa(e.droppable.containers);return r.set(s,n),{...e,droppable:{...e.droppable,containers:r}}}case ut.SetDroppableDisabled:{const{id:n,key:s,disabled:r}=t,o=e.droppable.containers.get(n);if(!o||s!==o.key)return e;const i=new aa(e.droppable.containers);return i.set(n,{...o,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case ut.UnregisterDroppable:{const{id:n,key:s}=t,r=e.droppable.containers.get(n);if(!r||s!==r.key)return e;const o=new aa(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}const ox=h.createContext({type:null,event:null});function b6({onDragStart:e,onDragMove:t,onDragOver:n,onDragEnd:s,onDragCancel:r}){const o=h.useContext(ox),i=h.useRef(o);h.useEffect(()=>{if(o!==i.current){const{type:a,event:l}=o;switch(a){case ut.DragStart:e==null||e(l);break;case ut.DragMove:t==null||t(l);break;case ut.DragOver:n==null||n(l);break;case ut.DragCancel:r==null||r(l);break;case ut.DragEnd:s==null||s(l);break}i.current=o}},[o,e,t,n,s,r])}function v6({announcements:e=h6,hiddenTextDescribedById:t,screenReaderInstructions:n}){const{announce:s,announcement:r}=f6(),o=sl("DndLiveRegion"),[i,a]=h.useState(!1);return h.useEffect(()=>{a(!0)},[]),b6(h.useMemo(()=>({onDragStart({active:l}){s(e.onDragStart(l.id))},onDragMove({active:l,over:u}){e.onDragMove&&s(e.onDragMove(l.id,u==null?void 0:u.id))},onDragOver({active:l,over:u}){s(e.onDragOver(l.id,u==null?void 0:u.id))},onDragEnd({active:l,over:u}){s(e.onDragEnd(l.id,u==null?void 0:u.id))},onDragCancel({active:l}){s(e.onDragCancel(l.id))}}),[s,e])),i?Dn.createPortal(h.createElement(h.Fragment,null,h.createElement(u6,{id:t,value:n.draggable}),h.createElement(d6,{id:o,announcement:r})),document.body):null}const cr=Object.freeze({x:0,y:0});function ix(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function h1(e,t=e.offsetLeft,n=e.offsetTop){return{x:t+e.width*.5,y:n+e.height*.5}}const y6=({collisionRect:e,droppableContainers:t})=>{const n=h1(e,e.left,e.top);let s=1/0,r=null;for(const o of t){const{rect:{current:i}}=o;if(i){const a=ix(h1(i),n);a<s&&(s=a,r=o.id)}}return r};function x6(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function w6(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:cr}function S6(e){return function(n,...s){return s.reduce((r,o)=>({...r,top:r.top+e*o.y,bottom:r.bottom+e*o.y,left:r.left+e*o.x,right:r.right+e*o.x,offsetLeft:r.offsetLeft+e*o.x,offsetTop:r.offsetTop+e*o.y}),{...n})}}const g1=S6(1);function C6(e,t=window.getComputedStyle(e)){return t.position==="fixed"}function j6(e,t=window.getComputedStyle(e)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].find(r=>{const o=t[r];return typeof o=="string"?n.test(o):!1})!=null}function gh(e){const t=[];function n(s){if(!s)return t;if(ph(s)&&s.scrollingElement!=null&&!t.includes(s.scrollingElement))return t.push(s.scrollingElement),t;if(!Ai(s)||nx(s)||t.includes(s))return t;const r=window.getComputedStyle(s);return j6(s,r)&&t.push(s),C6(s,r)?t:n(s.parentNode)}return e?n(e.parentNode):t}function Sd(e){return!vu||!e?null:Oi(e)?e:fh(e)?ph(e)||e===Ni(e).scrollingElement?window:Ai(e)?e:null:null}function Af(e){return Oi(e)?{x:e.scrollX,y:e.scrollY}:{x:e.scrollLeft,y:e.scrollTop}}var ti;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ti||(ti={}));function ax(e){const t={x:0,y:0},n={x:e.scrollWidth-e.clientWidth,y:e.scrollHeight-e.clientHeight},s=e.scrollTop<=t.y,r=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:s,isLeft:r,isBottom:o,isRight:i,maxScroll:n,minScroll:t}}function E6(e){return!vu||!e?!1:e===document.scrollingElement}const P6={x:.2,y:.2};function _6(e,t,{top:n,left:s,right:r,bottom:o},i=10,a=P6){const{clientHeight:l,clientWidth:u}=e,d=E6(e)?{top:0,left:0,right:u,bottom:l,width:u,height:l}:t,{isTop:f,isBottom:p,isLeft:g,isRight:m}=ax(e),b={x:0,y:0},v={x:0,y:0},x={height:d.height*a.y,width:d.width*a.x};return!f&&n<=d.top+x.height?(b.y=ti.Backward,v.y=i*Math.abs((d.top+x.height-n)/x.height)):!p&&o>=d.bottom-x.height&&(b.y=ti.Forward,v.y=i*Math.abs((d.bottom-x.height-o)/x.height)),!m&&r>=d.right-x.width?(b.x=ti.Forward,v.x=i*Math.abs((d.right-x.width-r)/x.width)):!g&&s<=d.left+x.width&&(b.x=ti.Backward,v.x=i*Math.abs((d.left+x.width-s)/x.width)),{direction:b,speed:v}}function T6(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:t,left:n,right:s,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:r,width:e.clientWidth,height:e.clientHeight}}function lx(e){return e.reduce((t,n)=>Ea(t,Af(n)),cr)}function cx(e,t,n=cr){if(!e||!Ai(e))return n;const s={x:n.x+e.offsetLeft,y:n.y+e.offsetTop};return e.offsetParent===t?s:cx(e.offsetParent,t,s)}function xu(e){const{offsetWidth:t,offsetHeight:n}=e,{x:s,y:r}=cx(e,null);return{width:t,height:n,offsetTop:r,offsetLeft:s}}function wu(e){if(Oi(e)){const u=window.innerWidth,d=window.innerHeight;return{top:0,left:0,right:u,bottom:d,width:u,height:d,offsetTop:0,offsetLeft:0}}const{offsetTop:t,offsetLeft:n}=xu(e),{width:s,height:r,top:o,bottom:i,left:a,right:l}=e.getBoundingClientRect();return{width:s,height:r,top:o,bottom:i,right:l,left:a,offsetTop:t,offsetLeft:n}}function Nf(e){const{width:t,height:n,offsetTop:s,offsetLeft:r}=xu(e),o=gh(e),i=lx(o),a=s-i.y,l=r-i.x;return{width:t,height:n,top:a,bottom:a+n,right:l+t,left:l,offsetTop:s,offsetLeft:r}}function m1(e){return"top"in e}function b1(e,t=e.offsetLeft,n=e.offsetTop){return[{x:t,y:n},{x:t+e.width,y:n},{x:t,y:n+e.height},{x:t+e.width,y:n+e.height}]}const O6=({collisionRect:e,droppableContainers:t})=>{let n=1/0,s=null;const r=b1(e,e.left,e.top);for(const o of t){const{rect:{current:i}}=o;if(i){const a=b1(i,m1(i)?i.left:void 0,m1(i)?i.top:void 0),l=r.reduce((d,f,p)=>d+ix(a[p],f),0),u=Number((l/4).toFixed(4));u<n&&(n=u,s=o.id)}}return s};function A6(e,t){const n=Math.max(t.top,e.offsetTop),s=Math.max(t.left,e.offsetLeft),r=Math.min(t.left+t.width,e.offsetLeft+e.width),o=Math.min(t.top+t.height,e.offsetTop+e.height),i=r-s,a=o-n;if(s<r&&n<o){const l=t.width*t.height,u=e.width*e.height,d=i*a,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const N6=({collisionRect:e,droppableContainers:t})=>{let n=0,s=null;for(const r of t){const{rect:{current:o}}=r;if(o){const i=A6(o,e);i>n&&(n=i,s=r.id)}}return s};var la;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(la||(la={}));var Pc;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Pc||(Pc={}));function M6({acceleration:e,activator:t=la.Pointer,canScroll:n,draggingRect:s,enabled:r,interval:o=5,order:i=Pc.TreeOrder,pointerCoordinates:a,scrollableAncestors:l,scrollableAncestorRects:u,threshold:d}){const[f,p]=o6(),g=h.useRef({x:1,y:1}),m=h.useMemo(()=>{switch(t){case la.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case la.DraggableRect:return s}return null},[t,s,a]),b=h.useRef(cr),v=h.useRef(null),x=h.useCallback(()=>{const w=v.current;if(!w)return;const S=g.current.x*b.current.x,C=g.current.y*b.current.y;w.scrollBy(S,C)},[]),y=h.useMemo(()=>i===Pc.TreeOrder?[...l].reverse():l,[i,l]);h.useEffect(()=>{if(!r||!l.length||!m){p();return}for(const w of y){if((n==null?void 0:n(w))===!1)continue;const S=l.indexOf(w),C=u[S];if(!C)continue;const{direction:j,speed:E}=_6(w,C,m,e,d);if(E.x>0||E.y>0){p(),v.current=w,f(x,o),g.current=E,b.current=j;return}}g.current={x:0,y:0},b.current={x:0,y:0},p()},[e,x,n,p,r,o,JSON.stringify(m),f,l,y,u,JSON.stringify(d)])}function L6(e,t){const n=t!==null?e[t]:void 0,s=n?n.node.current:null;return nl(r=>{var o;return t===null?null:(o=s??r)!=null?o:null},[s,t])}function R6(e,t){return h.useMemo(()=>e.reduce((n,s)=>{const{sensor:r}=s,o=r.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,s)}));return[...n,...o]},[]),[e,t])}function ux(e){const t=h.useRef(e);return _o(()=>{t.current!==e&&(t.current=e)},[e]),t}var _a;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(_a||(_a={}));var Mf;(function(e){e.Optimized="optimized"})(Mf||(Mf={}));const v1=new Map,$6={measure:xu,strategy:_a.WhileDragging,frequency:Mf.Optimized};function k6(e,{dragging:t,dependencies:n,config:s}){const[r,o]=h.useState(!1),{frequency:i,measure:a,strategy:l}={...$6,...s},u=h.useRef(e),d=h.useCallback(()=>o(!0),[]),f=h.useRef(null),p=m(),g=nl(b=>{if(p&&!t)return v1;if(!b||b===v1||u.current!==e||r){for(let v of e)v&&(v.rect.current=v.node.current?a(v.node.current):null);return V6(e)}return b},[e,t,p,a,r]);return h.useEffect(()=>{u.current=e},[e]),h.useEffect(()=>{r&&o(!1)},[r]),h.useEffect(function(){p||requestAnimationFrame(d)},[t,p]),h.useEffect(function(){p||typeof i!="number"||f.current!==null||(f.current=setTimeout(()=>{d(),f.current=null},i))},[i,p,d,...n]),{layoutRectMap:g,recomputeLayouts:d,willRecomputeLayouts:r};function m(){switch(l){case _a.Always:return!1;case _a.BeforeDragging:return t;default:return!t}}}function V6(e){const t=new Map;if(e)for(const n of e){if(!n)continue;const{id:s,rect:r}=n;r.current!=null&&t.set(s,r.current)}return t}function I6(e){const[t,n]=h.useState(null),s=h.useRef(e),r=h.useCallback(o=>{const i=Sd(o.target);i&&n(a=>a?(a.set(i,Af(i)),new Map(a)):null)},[]);return h.useEffect(()=>{const o=s.current;if(e!==o){i(o);const a=e.map(l=>{const u=Sd(l);return u?(u.addEventListener("scroll",r,{passive:!0}),[u,Af(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),s.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(l=>{const u=Sd(l);u==null||u.removeEventListener("scroll",r)})}},[r,e]),h.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,i)=>Ea(o,i),cr):lx(e):cr,[e,t])}const D6=[];function H6(e){const t=h.useRef(e),n=nl(s=>e?s&&e&&t.current&&e.parentNode===t.current.parentNode?s:gh(e):D6,[e]);return h.useEffect(()=>{t.current=e},[e]),n}function F6(e){h.useEffect(()=>{if(!vu)return;const t=e.map(({sensor:n})=>n.setup==null?void 0:n.setup());return()=>{for(const n of t)n==null||n()}},e.map(({sensor:t})=>t))}function B6(e,t){return h.useMemo(()=>e.reduce((n,{eventName:s,handler:r})=>(n[s]=o=>{r(o,t)},n),{}),[e,t])}const Cd=fx(wu),z6=U6(wu);function dx(e,t,n){const s=h.useRef(e);return nl(r=>e?n||!r&&e||e!==s.current?Ai(e)&&e.parentNode==null?null:t(e):r??null:null,[e,n,t])}function fx(e){return(t,n)=>dx(t,e,n)}function U6(e){const t=[];return function(s,r){const o=h.useRef(s);return nl(i=>s.length?r||!i&&s.length||s!==o.current?s.map(a=>e(a)):i??t:t,[s,r])}}function W6(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ai(t)?t:e}function G6(e){const{width:t,height:n,offsetLeft:s,offsetTop:r}=xu(e);return{top:r,bottom:r+n,left:s,right:s+t,width:t,height:n,offsetTop:r,offsetLeft:s}}const q6=fx(G6);function K6({disabled:e,forceRecompute:t}){const[n,s]=hh(),r=q6(e?null:W6(n.current),t);return h.useMemo(()=>({nodeRef:n,rect:r,setRef:s}),[r,n,s])}function y1(e,t){return h.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Y6(...e){return h.useMemo(()=>[...e].filter(t=>t!=null),[...e])}class ca{constructor(t){this.target=t,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})}}add(t,n,s){var r;(r=this.target)==null||r.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function Z6(e){const{EventTarget:t}=Xr(e);return e instanceof t?e:Ni(e)}function jd(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var $n;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})($n||($n={}));function x1(e){e.preventDefault()}function X6(e){e.stopPropagation()}var Be;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Be||(Be={}));const px={start:[Be.Space,Be.Enter],cancel:[Be.Esc],end:[Be.Space,Be.Enter]},J6=(e,{currentCoordinates:t})=>{switch(e.code){case Be.Right:return{...t,x:t.x+25};case Be.Left:return{...t,x:t.x-25};case Be.Down:return{...t,y:t.y+25};case Be.Up:return{...t,y:t.y-25}}};class mh{constructor(t){this.props=t,this.autoScrollEnabled=!1,this.coordinates=cr;const{event:{target:n}}=t;this.props=t,this.listeners=new ca(Ni(n)),this.windowListeners=new ca(Xr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add($n.Resize,this.handleCancel),this.windowListeners.add($n.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($n.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props;if(!t.node.current)throw new Error("Active draggable node is undefined");const s=wu(t.node.current),r={x:s.left,y:s.top};this.coordinates=r,n(r)}handleKeyDown(t){if(a6(t)){const{coordinates:n}=this,{active:s,context:r,options:o}=this.props,{keyboardCodes:i=px,coordinateGetter:a=J6,scrollBehavior:l="smooth"}=o,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.cancel.includes(u)){this.handleCancel(t);return}const d=a(t,{active:s,context:r.current,currentCoordinates:n});if(d){const f={x:0,y:0},{scrollableAncestors:p}=r.current;for(const g of p){const m=t.code,b=rx(d,n),{isTop:v,isRight:x,isLeft:y,isBottom:w,maxScroll:S,minScroll:C}=ax(g),j=T6(g),E={x:Math.min(m===Be.Right?j.right-j.width/2:j.right,Math.max(m===Be.Right?j.left:j.left+j.width/2,d.x)),y:Math.min(m===Be.Down?j.bottom-j.height/2:j.bottom,Math.max(m===Be.Down?j.top:j.top+j.height/2,d.y))},_=m===Be.Right&&!x||m===Be.Left&&!y,T=m===Be.Down&&!w||m===Be.Up&&!v;if(_&&E.x!==d.x){if(m===Be.Right&&g.scrollLeft+b.x<=S.x||m===Be.Left&&g.scrollLeft+b.x>=C.x){g.scrollBy({left:b.x,behavior:l});return}f.x=m===Be.Right?g.scrollLeft-S.x:g.scrollLeft-C.x,g.scrollBy({left:-f.x,behavior:l});break}else if(T&&E.y!==d.y){if(m===Be.Down&&g.scrollTop+b.y<=S.y||m===Be.Up&&g.scrollTop+b.y>=C.y){g.scrollBy({top:b.y,behavior:l});return}f.y=m===Be.Down?g.scrollTop-S.y:g.scrollTop-C.y,g.scrollBy({top:-f.y,behavior:l});break}}this.handleMove(t,Ea(d,f))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n),this.coordinates=n}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}mh.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=px,onActivation:n})=>{const{code:s}=e.nativeEvent;return t.start.includes(s)?(e.preventDefault(),n==null||n({event:e.nativeEvent}),!0):!1}}];function w1(e){return!!(e&&"distance"in e)}function S1(e){return!!(e&&"delay"in e)}class bh{constructor(t,n,s=Z6(t.event.target)){this.props=t,this.events=n,this.autoScrollEnabled=!0,this.activated=!1,this.timeoutId=null;const{event:r}=t,{target:o}=r;this.props=t,this.events=n,this.document=Ni(o),this.documentListeners=new ca(this.document),this.listeners=new ca(s),this.windowListeners=new ca(Xr(o)),this.initialCoordinates=Of(r),this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add($n.Resize,this.handleCancel),this.windowListeners.add($n.DragStart,x1),this.windowListeners.add($n.VisibilityChange,this.handleCancel),this.windowListeners.add($n.ContextMenu,x1),this.documentListeners.add($n.Keydown,this.handleKeydown),n){if(w1(n))return;if(S1(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add($n.Click,X6,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($n.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){const{activated:n,initialCoordinates:s,props:r}=this,{onMove:o,options:{activationConstraint:i}}=r;if(!s)return;const a=Of(t),l=rx(s,a);if(!n&&i){if(S1(i))return jd(l,i.tolerance)?this.handleCancel():void 0;if(w1(i))return i.tolerance!=null&&jd(l,i.tolerance)?this.handleCancel():jd(l,i.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),o(a)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Be.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Q6={move:{name:"pointermove"},end:{name:"pointerup"}};class vh extends bh{constructor(t){const{event:n}=t,s=Ni(n.target);super(t,Q6,s)}}vh.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!e.isPrimary||e.button!==0?!1:(t==null||t({event:e}),!0)}];const ek={move:{name:"mousemove"},end:{name:"mouseup"}};var Lf;(function(e){e[e.RightClick=2]="RightClick"})(Lf||(Lf={}));class tk extends bh{constructor(t){super(t,ek,Ni(t.event.target))}}tk.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button===Lf.RightClick?!1:(t==null||t({event:e}),!0)}];const Ed={move:{name:"touchmove"},end:{name:"touchend"}};class nk extends bh{constructor(t){super(t,Ed)}static setup(){return window.addEventListener(Ed.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ed.move.name,t)};function t(){}}}nk.activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return n.length>1?!1:(t==null||t({event:e}),!0)}}];function sk(e,{transform:t,...n}){return e!=null&&e.length?e.reduce((s,r)=>r({transform:s,...n}),t):t}const rk=[{sensor:vh,options:{}},{sensor:mh,options:{}}],ok={current:{}},hx=h.createContext({...cr,scaleX:1,scaleY:1}),ik=h.memo(function({id:t,autoScroll:n=!0,announcements:s,children:r,sensors:o=rk,collisionDetection:i=N6,measuring:a,modifiers:l,screenReaderInstructions:u=p6,...d}){var f,p,g,m,b;const v=h.useReducer(m6,void 0,g6),[x,y]=v,[w,S]=h.useState(()=>({type:null,event:null})),[C,j]=h.useState(!1),{draggable:{active:E,nodes:_,translate:T},droppable:{containers:P}}=x,A=E?_[E]:null,M=h.useRef({initial:null,translated:null}),R=h.useMemo(()=>{var We;return E!=null?{id:E,data:(We=A==null?void 0:A.data)!=null?We:ok,rect:M}:null},[E,A]),F=h.useRef(null),[L,B]=h.useState(null),[q,H]=h.useState(null),$=h.useRef(d),I=sl("DndDescribedBy",t),O=h.useMemo(()=>P.getEnabled(),[P]),{layoutRectMap:V,recomputeLayouts:G,willRecomputeLayouts:W}=k6(O,{dragging:C,dependencies:[T.x,T.y],config:a==null?void 0:a.droppable}),K=L6(_,E),J=q?Of(q):null,Y=dx(K,(f=a==null||(p=a.draggable)==null?void 0:p.measure)!=null?f:Nf),U=Cd(K),Q=h.useRef(null),se=Q.current,de=h.useRef({active:null,activeNode:K,collisionRect:null,droppableRects:V,draggableNodes:_,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null,translatedRect:null}),Se=P.getNodeFor((g=de.current.over)==null?void 0:g.id),ne=Cd(K?K.ownerDocument.defaultView:null),Te=Cd(K?K.parentElement:null),ke=H6(E?Se??K:null),it=z6(ke),st=K6({disabled:E==null,forceRecompute:W}),xe=(m=st.rect)!=null?m:Y,Ze=xe===Y?w6(Y,se):cr,Xe=sk(l,{transform:{x:T.x-Ze.x,y:T.y-Ze.y,scaleX:1,scaleY:1},activatorEvent:q,active:R,activeNodeRect:U,containerNodeRect:Te,draggingNodeRect:xe,over:de.current.over,overlayNodeRect:st.rect,scrollableAncestors:ke,scrollableAncestorRects:it,windowRect:ne}),ft=J?Ea(J,T):null,Ae=I6(ke),at=Ea(Xe,Ae),rt=xe?g1(xe,Xe):null,Ie=rt?g1(rt,Ae):null,Wt=R&&Ie?i({active:R,collisionRect:Ie,droppableContainers:O}):null,[ge,$e]=h.useState(null),Ve=x6(Xe,(b=ge==null?void 0:ge.rect)!=null?b:null,Y),Me=h.useCallback((We,{sensor:pt,options:Gt})=>{if(!F.current)return;const Nn=_[F.current];if(!Nn)return;const Ht=new pt({active:F.current,activeNode:Nn,event:We.nativeEvent,options:Gt,context:de,onStart(an){const Us=F.current;if(!Us)return;const fr=_[Us];if(!fr)return;const{onDragStart:pr}=$.current,hr={active:{id:Us,data:fr.data,rect:M}};Dn.unstable_batchedUpdates(()=>{y({type:ut.DragStart,initialCoordinates:an,active:Us}),S({type:ut.DragStart,event:hr})}),pr==null||pr(hr)},onMove(an){y({type:ut.DragMove,coordinates:an})},onEnd:eo(ut.DragEnd),onCancel:eo(ut.DragCancel)});Dn.unstable_batchedUpdates(()=>{B(Ht),H(We.nativeEvent)});function eo(an){return async function(){const{active:fr,over:pr,scrollAdjustedTranslate:hr}=de.current;let gr=null;if(fr&&hr){const{cancelDrop:Xt}=$.current;gr={active:fr,delta:hr,over:pr},an===ut.DragEnd&&typeof Xt=="function"&&await Promise.resolve(Xt(gr))&&(an=ut.DragCancel)}if(F.current=null,Dn.unstable_batchedUpdates(()=>{y({type:an}),$e(null),j(!1),B(null),H(null),gr&&S({type:an,event:gr})}),gr){const{onDragCancel:Xt,onDragEnd:Qn}=$.current,ol=an===ut.DragEnd?Qn:Xt;ol==null||ol(gr)}}}},[y,_]),wt=h.useCallback((We,pt)=>(Gt,Nn)=>{const Ht=Gt.nativeEvent;F.current!==null||Ht.dndKit||Ht.defaultPrevented||We(Gt,pt.options)===!0&&(Ht.dndKit={capturedBy:pt.sensor},F.current=Nn,Me(Gt,pt))},[Me]),$t=R6(o,wt);F6(o),_o(()=>{$.current=d},Object.values(d)),h.useEffect(()=>{E!=null&&j(!0)},[E]),h.useEffect(()=>{R||(Q.current=null),R&&Y&&!Q.current&&(Q.current=Y)},[Y,R]),h.useEffect(()=>{const{onDragMove:We}=$.current,{active:pt,over:Gt}=de.current;if(!pt)return;const Nn={active:pt,delta:{x:at.x,y:at.y},over:Gt};S({type:ut.DragMove,event:Nn}),We==null||We(Nn)},[at.x,at.y]),h.useEffect(()=>{const{active:We,droppableContainers:pt,scrollAdjustedTranslate:Gt}=de.current;if(!We||!F.current||!Gt)return;const{onDragOver:Nn}=$.current,Ht=pt.get(Wt),eo=Ht&&Ht.rect.current?{id:Ht.id,rect:Ht.rect.current,data:Ht.data,disabled:Ht.disabled}:null,an={active:We,delta:{x:Gt.x,y:Gt.y},over:eo};Dn.unstable_batchedUpdates(()=>{$e(eo),S({type:ut.DragOver,event:an}),Nn==null||Nn(an)})},[Wt]),_o(()=>{de.current={active:R,activeNode:K,collisionRect:Ie,droppableRects:V,draggableNodes:_,draggingNodeRect:xe,droppableContainers:P,over:ge,scrollableAncestors:ke,scrollAdjustedTranslate:at,translatedRect:rt},M.current={initial:xe,translated:rt}},[R,K,Ie,_,xe,V,P,ge,ke,at,rt]),M6({...Qr(),draggingRect:rt,pointerCoordinates:ft,scrollableAncestors:ke,scrollableAncestorRects:it});const zs=h.useMemo(()=>({active:R,activeNode:K,activeNodeRect:Y,activeNodeClientRect:U,activatorEvent:q,activators:$t,ariaDescribedById:{draggable:I},containerNodeRect:Te,dispatch:y,dragOverlay:st,draggableNodes:_,droppableContainers:P,droppableRects:V,over:ge,recomputeLayouts:G,scrollableAncestors:ke,scrollableAncestorRects:it,willRecomputeLayouts:W,windowRect:ne}),[R,K,U,Y,q,$t,Te,st,y,_,I,P,V,ge,G,ke,it,W,ne]);return h.createElement(ox.Provider,{value:w},h.createElement(yu.Provider,{value:zs},h.createElement(hx.Provider,{value:Ve},r)),h.createElement(v6,{announcements:s,hiddenTextDescribedById:I,screenReaderInstructions:u}));function Qr(){const We=(L==null?void 0:L.autoScrollEnabled)===!1,pt=typeof n=="object"?n.enabled===!1:n===!1,Gt=!We&&!pt;return typeof n=="object"?{...n,enabled:Gt}:{enabled:Gt}}}),ak=h.createContext(null),C1="button",lk="Droppable";function ck({id:e,data:t,disabled:n=!1,attributes:s}){const r=sl(lk),{active:o,activeNodeRect:i,activatorEvent:a,ariaDescribedById:l,draggableNodes:u,droppableRects:d,activators:f,over:p}=h.useContext(yu),{role:g=C1,roleDescription:m="draggable",tabIndex:b=0}=s??{},v=(o==null?void 0:o.id)===e,x=h.useContext(v?hx:ak),[y,w]=hh(),S=B6(f,e),C=ux(t);h.useEffect(()=>(u[e]={id:e,key:r,node:y,data:C},()=>{const E=u[e];E&&E.key===r&&delete u[e]}),[u,e]);const j=h.useMemo(()=>({role:g,tabIndex:b,"aria-pressed":v&&g===C1?!0:void 0,"aria-roledescription":m,"aria-describedby":l.draggable}),[g,b,v,m,l.draggable]);return{active:o,activeNodeRect:i,activatorEvent:a,attributes:j,droppableRects:d,isDragging:v,listeners:n?void 0:S,node:y,over:p,setNodeRef:w,transform:x}}function uk(){return h.useContext(yu)}const dk="Droppable";function fk({data:e,disabled:t=!1,id:n}){const s=sl(dk),{active:r,dispatch:o,over:i}=h.useContext(yu),a=h.useRef(null),[l,u]=hh(),d=ux(e);return _o(()=>(o({type:ut.RegisterDroppable,element:{id:n,key:s,disabled:t,node:l,rect:a,data:d}}),()=>o({type:ut.UnregisterDroppable,key:s,id:n})),[n]),h.useEffect(()=>{o({type:ut.SetDroppableDisabled,id:n,key:s,disabled:t})},[t]),{active:r,rect:a,isOver:(i==null?void 0:i.id)===n,node:l,over:i,setNodeRef:u}}function pk(e,t,n){const s={...e};return t.top+e.y<=n.top?s.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(s.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?s.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(s.x=n.left+n.width-t.right),s}const hk=({draggingNodeRect:e,transform:t,scrollableAncestorRects:n})=>{const s=n[0];return!e||!s?t:pk(t,e,s)},gk=({transform:e})=>({...e,x:0});function gx(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function mk(e,t){return e.reduce((n,s,r)=>{const o=t.get(s);return o&&(n[r]=o),n},Array(e.length))}function $l(e){return e!==null&&e>=0}const mx=({layoutRects:e,activeIndex:t,overIndex:n,index:s})=>{const r=gx(e,n,t),o=e[s],i=r[s];return!i||!o?null:{x:i.offsetLeft-o.offsetLeft,y:i.offsetTop-o.offsetTop,scaleX:i.width/o.width,scaleY:i.height/o.height}},kl={scaleX:1,scaleY:1},bk=({activeIndex:e,activeNodeRect:t,index:n,layoutRects:s,overIndex:r})=>{var o;const i=(o=s[e])!=null?o:t;if(!i)return null;if(n===e){const l=s[r];return l?{x:0,y:e<r?l.offsetTop+l.height-(i.offsetTop+i.height):l.offsetTop-i.offsetTop,...kl}:null}const a=vk(s,n,e);return n>e&&n<=r?{x:0,y:-i.height-a,...kl}:n<e&&n>=r?{x:0,y:i.height+a,...kl}:{x:0,y:0,...kl}};function vk(e,t,n){const s=e[t],r=e[t-1],o=e[t+1];return s?n<t?r?s.offsetTop-(r.offsetTop+r.height):o?o.offsetTop-(s.offsetTop+s.height):0:o?o.offsetTop-(s.offsetTop+s.height):r?s.offsetTop-(r.offsetTop+r.height):0:0}const bx="Sortable",vx=h.createContext({activeIndex:-1,containerId:bx,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:mx,wasDragging:{current:!1}});function yk({children:e,id:t,items:n,strategy:s=mx}){const{active:r,dragOverlay:o,droppableRects:i,over:a,recomputeLayouts:l,willRecomputeLayouts:u}=uk(),d=sl(bx,t),f=o.rect!==null,p=h.useMemo(()=>n.map(E=>typeof E=="string"?E:E.id),[n]),g=r!=null,m=h.useRef(!1),b=r?p.indexOf(r.id):-1,v=b!==-1,x=a?p.indexOf(a.id):-1,y=h.useRef(p),w=mk(p,i),S=!xk(p,y.current),C=x!==-1&&b===-1||S;_o(()=>{S&&v&&!u&&l()},[S,v,l,u]),h.useEffect(()=>{y.current=p},[p]),h.useEffect(()=>{const E=setTimeout(()=>{m.current=g},100);return()=>clearTimeout(E)},[g]);const j=h.useMemo(()=>({activeIndex:b,containerId:d,disableTransforms:C,items:p,overIndex:x,useDragOverlay:f,sortedRects:w,strategy:s,wasDragging:m}),[b,d,C,p,x,w,f,s,m]);return h.createElement(vx.Provider,{value:j},e)}function xk(e,t){return e.join()===t.join()}const wk=({id:e,items:t,activeIndex:n,overIndex:s})=>gx(t,n,s).indexOf(e),Sk=({containerId:e,isSorting:t,wasDragging:n,index:s,items:r,newIndex:o,previousItems:i,previousContainerId:a,transition:l})=>!l||!n||i!==r&&s===o?!1:t?!0:o!==s&&e===a,Ck={duration:200,easing:"ease"},yx="transform",jk=Pa.Transition.toString({property:yx,duration:0,easing:"linear"}),Ek={roleDescription:"sortable"};function Pk({disabled:e,index:t,node:n,rect:s}){const[r,o]=h.useState(null),i=h.useRef(t);return _o(()=>{if(!e&&t!==i.current&&n.current){const a=s.current;if(a){const l=wu(n.current),u={x:a.offsetLeft-l.offsetLeft,y:a.offsetTop-l.offsetTop,scaleX:a.width/l.width,scaleY:a.height/l.height};(u.x||u.y)&&o(u)}}t!==i.current&&(i.current=t)},[e,t,n,s]),h.useEffect(()=>{r&&requestAnimationFrame(()=>{o(null)})},[r]),r}function _k({animateLayoutChanges:e=Sk,attributes:t,disabled:n,data:s,getNewIndex:r=wk,id:o,strategy:i,transition:a=Ck}){const{items:l,containerId:u,activeIndex:d,disableTransforms:f,sortedRects:p,overIndex:g,useDragOverlay:m,strategy:b,wasDragging:v}=h.useContext(vx),x=l.indexOf(o),y=h.useMemo(()=>({sortable:{containerId:u,index:x,items:l},...s}),[u,s,x,l]),{rect:w,node:S,setNodeRef:C}=fk({id:o,data:y}),{active:j,activeNodeRect:E,activatorEvent:_,attributes:T,setNodeRef:P,listeners:A,isDragging:M,over:R,transform:F}=ck({id:o,data:y,attributes:{...Ek,...t},disabled:n}),L=s6(C,P),B=!!j,q=B&&v.current&&!f&&$l(d)&&$l(g),H=!m&&M,$=H&&q?F:null,O=q?$??(i??b)({layoutRects:p,activeNodeRect:E,activeIndex:d,overIndex:g,index:x}):null,V=$l(d)&&$l(g)?r({id:o,items:l,activeIndex:d,overIndex:g}):x,G=h.useRef(l),W=l!==G.current,K=h.useRef(V),J=h.useRef(u),Y=e({active:j,containerId:u,isDragging:M,isSorting:B,id:o,index:x,items:l,newIndex:K.current,previousItems:G.current,previousContainerId:J.current,transition:a,wasDragging:v.current}),U=Pk({disabled:!Y,index:x,node:S,rect:w});return h.useEffect(()=>{B&&K.current!==V&&(K.current=V),u!==J.current&&(J.current=u),l!==G.current&&(G.current=l)},[B,V,u,l]),{active:j,attributes:T,activatorEvent:_,rect:w,index:x,isSorting:B,isDragging:M,listeners:A,node:S,overIndex:g,over:R,setNodeRef:L,setDroppableNodeRef:C,setDraggableNodeRef:P,transform:U??O,transition:Q()};function Q(){if(U||W&&K.current===x)return jk;if(!(H||!a)&&(B||Y))return Pa.Transition.toString({...a,property:yx})}}const Tk=[Be.Down,Be.Right,Be.Up,Be.Left],Ok=(e,{context:{active:t,droppableContainers:n,translatedRect:s,scrollableAncestors:r}})=>{if(Tk.includes(e.code)){if(e.preventDefault(),!t||!s)return;const i=[];n.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const u=l==null?void 0:l.node.current;if(!u)return;const d=Nf(u),f={...l,rect:{current:d}};switch(e.code){case Be.Down:s.top+s.height<=d.top&&i.push(f);break;case Be.Up:s.top>=d.top+d.height&&i.push(f);break;case Be.Left:s.left>=d.left+d.width&&i.push(f);break;case Be.Right:s.left+s.width<=d.left&&i.push(f);break}});const a=O6({active:t,collisionRect:s,droppableContainers:i});if(a){var o;const l=(o=n.get(a))==null?void 0:o.node.current;if(l){const d=gh(l).some((m,b)=>r[b]!==m),f=Nf(l),p=d?{x:0,y:0}:{x:s.width-f.width,y:s.height-f.height};return{x:f.left-p.x,y:f.top-p.y}}}}};function Ak(e){const{id:t,item:n,className:s,select:r,remove:o,renderItem:i,previewStyle:a,sortable:l=!0,disabled:u,confirmRemove:d}=e,{attributes:f,listeners:p,setNodeRef:g,transform:m,transition:b}=_k({id:t,disabled:u}),v={transform:Pa.Transform.toString(m),transition:b},x=()=>!u&&(r==null?void 0:r(n));return c.jsx("div",{...l?{ref:g,style:v,...f}:{},children:c.jsxs(k,{space:"s",onClick:x,className:s,items:"center",nowrap:!0,children:[l&&c.jsx(D,{className:ee(!u&&Ee.hover,!u&&"cursor-grab"),...p,children:c.jsx(oe,{icon:Z.dotsVertical,size:le.sx})}),c.jsx(D,{grow:!0,className:ee("overflow-hidden"),children:c.jsxs(k,{children:[c.jsx(D,{grow:!0,className:ee("overflow-ellipsis overflow-hidden"),children:i(n)}),!!a&&c.jsx(D,{children:c.jsx("div",{className:ee("w-4 h-4 gjs-bg-white",re.b,re.rnd),style:a(n)})})]})}),o&&d?c.jsx(fu,{disabled:u,onConfirm:()=>{o==null||o(n)},children:c.jsx(D,{className:ee(!u&&Ee.click),children:c.jsx(oe,{icon:Z.close,size:le.sx})})}):c.jsx(D,{className:ee(!u&&Ee.click),onClick:y=>{bo(y),!u&&(o==null||o(n))},children:c.jsx(oe,{icon:Z.close,size:le.sx})})]},n.getIndex?n.getIndex():n.id||n.cid)})}function Es(e){const{className:t,items:n,selected:s,renderItem:r,select:o,add:i,remove:a,move:l,previewStyle:u,getItemId:d=P=>P.id||P.name||P.title||P.label||"",label:f,labelAs:p,children:g,title:m="Select",titleAdd:b="Add",emptyState:v,disabled:x=!1,hidePopover:y,popoverPlacement:w="left",confirmRemove:S}=e,C=Y6(y1(vh),y1(mh,{coordinateGetter:Ok}));function j(P){const{active:A,over:M}=P;if(A.id!==(M==null?void 0:M.id)){const R=n.find(L=>d(L)===A.id),F=n.findIndex(L=>d(L)===(M==null?void 0:M.id));R&&(l==null||l(R,F))}}const E=ee(re.rnd,z.br,n.length&&re.b,n.length&&"gjs-mt-1");let _=c.jsxs("div",{className:E,children:[n.length===0&&v&&c.jsx(k,{className:N("gs-utl-p-2 gs-utl-text-center",z.txtLowEmphasis),items:"center",justify:"center",children:v}),n.map((P,A)=>{const M=d(P),R=P===s,F=ee("gjs-px-2 gjs-py-2 text-xs",z.br,A&&re.bt,!!o&&!R&&!x&&z.hBgH2,R&&z.bgH,x&&"opacity-75");return c.jsx(Ak,{id:M,item:P,className:F,select:o,remove:a,renderItem:r,previewStyle:u,sortable:!!l,disabled:x,confirmRemove:S},M||A)})]});l&&(_=c.jsx(ik,{sensors:C,collisionDetection:y6,onDragEnd:j,modifiers:[gk,hk],children:c.jsx(yk,{items:n.map(d),strategy:bk,children:_})})),o&&!y&&(_=c.jsx(ps,{placement:w,size:"s",buttonAs:"div",title:m,classNameBody:"gs-utl-gap-2 gs-utl-flex gs-utl-flex-col",open:!!s&&!x,onClose:()=>o==null?void 0:o(null),handler:_,children:g}));const T=i?[{type:"button",icon:Z.plus,tooltip:b,variant:"outline",size:"xs",disabled:x,onClick:i}]:[];return c.jsxs("div",{className:ee(t,"w-full"),children:[!!(f||i)&&c.jsx(fs,{...e,as:p,afterLabelButtons:T}),_]})}const Nk=fe(function(){const t=Re(),{editor:n}=ye(),s=Ka(),r=Ya(),o=r.sortedFonts;return n?c.jsx(Es,{items:o,selected:null,renderItem:i=>{const a=Hp(i);return c.jsxs(k,{col:!0,children:[c.jsx(D,{className:"gs-utl-text-lg",style:{fontFamily:a},children:i.familyLabel}),c.jsx(D,{children:i.familyLabel})]})},remove:i=>r.removeFont(i.family),add:r.sdkAddFonts&&s.hasType("font")?()=>dh(n):void 0,titleAdd:t.t("fontManager.addFontToProject"),label:t.t("fontManager.projectFonts"),getItemId:i=>i.family,emptyState:t.t("fontManager.emptyProjectFonts")}):null}),xx=h.forwardRef(function({size:t="m",className:n,classNameContent:s,border:r=!0,children:o,...i},a){const l=ue(z.bg,z.br,r&&`${re.b} ${re.rnd}`,t==="m"&&je.xy,t==="s"&&"gjs-px-3 gjs-py-1",n);return c.jsx(k,{className:l,items:"center",space:"x2s",...i,ref:a,children:c.jsx(D,{grow:!0,className:s,children:o})})}),wx=h.forwardRef(({autoResize:e,style:t={},...n},s)=>{const r=h.useRef(null),o=s||r;return h.useEffect(()=>{!o.current||!e||(o.current.style.height="auto",o.current.style.height=o.current.scrollHeight+"px")},[n.value,e,o]),c.jsx("textarea",{ref:o,style:{...t,...e?{resize:"none"}:{}},...n})});wx.displayName="TextAreaWithAutoResize";const Mk="gs-field-textarea";function j1(e){const{className:t,value:n,label:s,size:r,description:o,placeholder:i,readOnly:a,disabled:l,required:u,onChange:d,onKeyDown:f,afterInput:p,minHeight:g,maxHeight:m,autoResize:b,classNameField:v,classNameFieldContent:x,classNameInput:y}=e,w=Xa(e);return c.jsxs("div",{className:ee(Mk,t),children:[!!s&&c.jsx(Dr,{size:r,children:s}),!!o&&c.jsx(Dr,{size:r,as:"span",className:ee(z.txtLowEmphasis),capitalize:!1,children:o}),c.jsxs(xx,{size:r,className:v,classNameContent:x,children:[c.jsx(wx,{className:ee(w,y),autoResize:b,value:n,placeholder:i,readOnly:a,disabled:l,required:u,onChange:S=>d==null?void 0:d(S.target.value),onKeyDown:f,style:{minHeight:g,maxHeight:m}}),p]})]})}const Su="gs-page-settings",Lk=`${Su}-header`,Rk=`${Su}-content`,$k=`${Su}-footer`,E1="",kk=fe(function({className:t,classNameHeader:n,classNameContent:s,classNameFooter:r,page:o,size:i=Wp.m}){const a=ye(),{isDarkTheme:l}=Ds(),u=Ya(),d=Re(),[f,p]=h.useState(o),[g,m]=h.useState(()=>Bg(f,a)),[b,v]=h.useState(()=>d.t("update")),x=d.tScoped("pageManager.settings"),y=d.tScoped("pageManager.settings.fields"),{editor:w}=a,S={containerClassName:"gs-utl-min-h-80",size:i,padding:5,isDarkTheme:l,clean:!0};if(!w)return null;const C=R=>m(F=>({...F,...R})),j=R=>{R.preventDefault();const{name:F,...L}=g;L.customCodeHead=bw(L.customCodeHead),L.customCodeBody=mw(L.customCodeBody),f?(mA(f,L),f.setName(F)):a.setProjectDataCustom({globalPageSettings:L}),v(d.t("updated")),setTimeout(()=>v(d.t("update")),2e3),g0(w),w.trigger(Tn.pageSettingsUpdate,{page:f,data:{name:F,...L}})},E={tooltip:d.t("clear")},_=(f==null?void 0:f.getId())??E1,T=R=>{const F=w.Pages.get(R);p(F),m(Bg(F,a))},P=Fp(f),A=!!f&&Qc(f),M=[{id:E1,label:x("global")},...w.Pages.getAll().map(R=>({icon:p0(R),id:R.getId(),label:R.getName()}))];return c.jsx("form",{onSubmit:j,className:N(Su,"gs-utl-h-full",t),children:c.jsxs(k,{col:!0,full:!0,className:"gs-utl-gap-1 gs-utl-overflow-hidden",nowrap:!0,children:[c.jsx(D,{className:N(Lk,n,z.br,re.bb),children:c.jsx(_e,{value:_,onChange:T,options:M,handlerSelected:R=>c.jsxs(k,{items:"center",gap:"xs",nowrap:!0,children:[c.jsxs("b",{children:[d.t("pageManager.page"),":"]}),R.icon&&ot(R.icon)&&c.jsx(oe,{icon:R.icon,size:le.s2x}),c.jsx("span",{children:R.label})]})})}),c.jsxs(k,{col:!0,className:N(Rk,"gs-utl-gap-5 gs-utl-overflow-y-auto",s),nowrap:!0,children:[!!_&&c.jsxs(c.Fragment,{children:[c.jsx(tt,{size:i,value:g.name,onChange:R=>C({name:R}),label:y("name.label"),description:y("name.description"),required:!0}),!P&&c.jsx(tt,{size:i,value:g.slug,onChange:R=>C({slug:A?Ow(R,["id"]):Ac(R)}),label:y("slug.label"),description:y("slug.description"),required:!0})]}),c.jsx(tt,{size:i,value:g.title,onChange:R=>C({title:R}),label:y("title.label"),description:y("title.description")}),c.jsx(j1,{size:i,value:g.description,onChange:R=>C({description:R}),label:y("description.label"),description:y("description.description")}),c.jsx(ja,{size:i,clear:E,value:g.favicon,onChange:R=>C({favicon:R}),onOpen:()=>{w.Assets.open({select(R){C({favicon:R.getSrc()}),w.Assets.close()}})},label:y("favicon.label"),description:y("favicon.description")}),c.jsx(tt,{size:i,value:g.keywords,onChange:R=>C({keywords:R}),label:y("keywords.label"),description:y("keywords.description")}),c.jsx(tt,{size:i,value:g.socialTitle,onChange:R=>C({socialTitle:R}),label:y("socialTitle.label"),description:y("socialTitle.description")}),c.jsx(ja,{size:i,clear:E,value:g.socialImage,onChange:R=>C({socialImage:R}),onOpen:()=>{w.Assets.open({select(R){C({socialImage:R.getSrc()}),w.Assets.close()}})},label:y("socialImage.label"),description:y("socialImage.description")}),c.jsx(j1,{size:i,value:g.socialDescription,onChange:R=>C({socialDescription:R}),label:y("socialDescription.label"),description:y("socialDescription.description")}),c.jsx(ir,{language:"html",defaultValue:g.customCodeHead,onChange:R=>C({customCodeHead:R}),label:y("customCodeHead.label"),description:y("customCodeHead.description"),...S},`head-${_}`),c.jsx(ir,{language:"html",defaultValue:g.customCodeBody,onChange:R=>C({customCodeBody:R}),label:y("customCodeBody.label"),description:y("customCodeBody.description"),...S},`body-${_}`),u.sdkShowProjectFonts&&!_&&c.jsx(Nk,{})]}),c.jsx(k,{className:N($k,"gs-utl-mt-auto",r,z.br,re.bt),children:c.jsx(Ke,{type:"submit",variant:"pr",size:"m2",full:!0,children:b})})]})})}),Vk="gs-panel-page-settings",Ik=h.memo(fe(function({className:t,page:n,...s}){return c.jsx(hs,{className:N(Vk,"gs-utl-overflow-hidden",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...s,children:c.jsx(Qa,{children:c.jsx(kk,{className:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),page:n,size:Wp.s,classNameHeader:je.s,classNameContent:je.s,classNameFooter:je.s})})})})),Vl="gs-page-item",P1=fe(function({page:t,rename:n,setRename:s,commandItems:r}){const o=ye(),i=Re(),a=o.editor,{Pages:l}=a,u=o.sdkPagesConfig,d=u==null?void 0:u.settings,f=u==null?void 0:u.showHomeIcon,p=u==null?void 0:u.layoutBefore,g=j=>i.t(`pageManager.${j}`),m=j=>l.select(j),b=j=>l.getSelected()===j,v=j=>j===n,x=b(t),y=j=>j.getName()||j.getId(),w=j=>{n==null||n.set({name:j}),s(void 0)},S=ue("group-hover:gs-utl-opacity-100 opacity-0 cursor-pointer transition-opacity"),C=()=>a.runCommand(ie.setPageSettings,{page:t,isOpen:!0});return c.jsxs(k,{gap:"s",items:"center",onClick:()=>m(t),className:ue([Vl,"group cursor-default",je.xy,x?z.bgH:z.hBgH2]),children:[f&&Fp(t)&&c.jsx(D,{className:`${Vl}__icon-home`,title:g("homePage"),children:c.jsx(oe,{icon:Z.home,size:le.s3x})}),p&&Ot(p({page:t,editor:a,isSelected:x})),c.jsx(D,{className:ue(`${Vl}__name truncate`),grow:!0,children:v(t)?c.jsx(uh,{value:y(t),onChange:w}):c.jsx(c.Fragment,{children:y(t)})}),c.jsxs(k,{className:`${Vl}__actions`,gap:"xs",onClick:bo,items:"center",children:[!n&&d!==!1&&c.jsx(bt,{className:S,size:"xs",border:!1,title:g("settings.label"),onClick:C,block:!0,children:c.jsx(oe,{icon:Z.cog,size:le.s3x})}),x&&!!r.length&&c.jsx(ps,{placement:"right-start",handler:c.jsx(oe,{icon:Z.dotsVertical,size:le.s}),title:!1,padding:!1,fixed:!0,overlay:!0,children:({close:j})=>r.map(E=>c.jsx(_i,{icon:E.icon,label:Ye(E.label)?E.label({editor:a}):E.label,action:()=>{var _;j(),(_=E.cmd)==null||_.call(E,{page:t,editor:a})}},E.id))})]})]},t.getId())});function Dk({dragging:e,dragRect:t}){const n=!!(e&&t),s=n?{top:t.y,left:0,marginLeft:0}:{};return{showIndicator:n,indicatorStyle:s}}var Sx=(e=>(e.horizontal="horizontal",e.vertical="vertical",e))(Sx||{});const Pd="gs-cmp-sortable",_1=3;function Hk({items:e,direction:t,onDrop:n,renderItem:s}){const[r,o]=h.useState(null),[i,a]=h.useState(-1),[l,u]=h.useState(),[d,f]=h.useState(!1),p=h.useRef(null),{showIndicator:g,indicatorStyle:m}=Dk({dragging:!!r&&d,dragRect:l}),b=h.useMemo(()=>[],[e]);h.useEffect(()=>{const E=window.document,_=T=>T.key==="Escape"&&y(T);return E.addEventListener("keydown",_),()=>E.removeEventListener("keydown",_)},[]);const v=E=>_=>{_.button===0&&(p.current={x:_.clientX,y:_.clientY},o(E),f(!1),_.target.setPointerCapture(_.pointerId))},x=E=>{const _=p.current;if(!r||!_)return;if(!d){const R=Math.abs(E.clientX-_.x),F=Math.abs(E.clientY-_.y);(t==="vertical"?F>_1:R>_1)&&f(!0);return}const T=E.clientY;let P=-1;b.forEach((R,F)=>{const L=R.getBoundingClientRect();T>L.top+L.height/2&&(P=F)});const A=e.findIndex(R=>R.id===r.id);P<A&&(P+=1),P=Math.min(P,e.length-1),a(P);const M=b[P];if(M){const{height:R,top:F}=M.getBoundingClientRect(),L=T<F+R/2;u({y:M.offsetTop+(L?0:R),h:R})}},y=E=>{o(null),f(!1),p.current=null,u(void 0);const _=E.target,{pointerId:T}=E;T&&(_==null||_.releasePointerCapture(T))},w=E=>{!r||!p.current||(l&&i!==-1&&(n==null||n(r,i)),y(E))},S=N(Pd,"gs-utl-relative"),C=N(`${Pd}__indicator`,z.cmp,"gs-utl-absolute gs-utl-w-full gs-utl-h-0.5"),j=E=>N(`${Pd}__item`,g&&(r==null?void 0:r.id)===E.id&&"gs-utl-opacity-50 gs-utl-select-none");return c.jsxs(c.Fragment,{children:[c.jsx(k,{col:t==="vertical",className:S,children:e.map((E,_)=>c.jsx(D,{ref:T=>{T&&(b[_]=T)},className:j(E),onPointerDown:v(E),onPointerMove:x,onPointerUp:w,children:s(E)},E.id))}),g&&c.jsx("div",{className:C,style:m})]})}const Fk=({pages:e,commandItems:t,rename:n,setRename:s,editor:r})=>{if(!r.Pages.move)return e.map(l=>c.jsx(P1,{page:l,commandItems:t,rename:n,setRename:s},l.getId()));const o=(l,u)=>{r.Pages.move(l.entity,{at:u})},i=l=>c.jsx(P1,{page:l.entity,commandItems:t,rename:n,setRename:s},l.id),a=e.map(l=>({id:l.getId(),entity:l}));return c.jsx(Hk,{items:a,direction:Sx.vertical,onDrop:o,renderItem:i})},Bk=({items:e,editor:t,sdkPageConfig:n})=>{const s=n==null?void 0:n.commandItems;return s===!1?[]:Ye(s)?s({items:e,editor:t}):s||e},_d="gs-panel-page-manager",Cx=fe(function({pages:t,select:n,add:s,remove:r,header:o,resizable:i={bottom:!0},height:a=200}){const l=ye(),u=ji(),d=Re(),{sdkPagesConfig:f}=l,p=l.editor,[g,m]=h.useState(),b=M=>d.t(`pageManager.${M}`),v=f==null?void 0:f.add,x=f==null?void 0:f.duplicate,y=f==null?void 0:f.remove,w=M=>{bo(M);const R=L=>{const B=t.length+1;return s({name:`${b("page")} ${B}`,component:`<div>${b("newPage")} ${B}</div>`,...L},{select:!0})};if(v)return v({event:M,editor:p,rename:m,addPage:R});const F=R();F&&m(F)},S=({page:M})=>{if(y)return y({editor:p,page:M});u.confirm({title:b("deletePage"),content:b("confirmDelete"),confirmButton:{variant:"danger",children:b("deletePage")},onConfirm:()=>{const R=t.indexOf(M),F=t[R+1]||t[0];n(F),r(M)}})},C=({page:M})=>{if(x)return x({editor:p,page:M,rename:m});const R=M.getMainComponent(),F=s({name:`${M.getName()} (${b("copy")})`,component:R.clone()},{select:!0});F&&m(F)},j=[{id:"rename",label:b("rename"),icon:Z.pencil,cmd:({page:M})=>m(M)},x!==!1&&{id:"duplicate",label:b("duplicate"),icon:Z.contentCopy,cmd:C},t.length>1&&y!==!1&&{id:"remove",label:b("delete"),icon:Z.delete,cmd:S}].filter(Boolean),E=Bk({items:j,editor:p,sdkPageConfig:f}),_=By(o,{collapsible:!0,label:b("pages"),icon:Z.textBoxMultiple}),T=i?i===!0?{top:!0,right:!0,bottom:!0,left:!0}:i:void 0,P=c.jsx(Fk,{pages:t,commandItems:E,rename:g,setRename:m,editor:p}),A=T?c.jsx(mu,{className:ee([`${_d}__content`,"text-sm overflow-auto",re.bt,z.br]),height:a,...T,children:P}):P;return c.jsx(ar,{classNameWrap:_d,className:ee(`${_d}__header`,je.xy,o===!1&&"gs-utl-hidden"),disabled:_&&_.collapsible===!1,handler:c.jsxs(k,{space:"s",items:"center",children:[!!_.icon&&c.jsx(D,{children:c.jsx(oe,{icon:_.icon,size:le.s})}),c.jsx(D,{grow:!0,children:_.label}),v!==!1&&c.jsx(It,{title:b("add"),children:c.jsx(k,{onClick:w,className:ee("cursor-pointer"),children:c.jsx(oe,{icon:Z.plus,size:le.s})})})]}),open:_?_.collapsed!==!0:!0,children:A})}),jx=h.forwardRef(function({children:t,className:n,...s},r){return c.jsx("div",{className:N(ue("gs-page-manager-after"),n),ref:r,...s,children:t})}),Ex=h.forwardRef(function({children:t,className:n,...s},r){return c.jsx("div",{className:N(ue("gs-page-manager-before"),n),ref:r,...s,children:t})}),zk="gs-panel-pages",Px=h.memo(fe(function({className:t,header:n,height:s,resizable:r,...o}){const i=ye().sdkProps.children;return c.jsx(mn,{className:N(zk,t),...o,children:c.jsx(ry,{children:a=>c.jsxs(c.Fragment,{children:[Bn(i,Ex),c.jsx(Cx,{header:n,height:s,resizable:r,...a}),Bn(i,jx)]})})})})),Uk="gs-panel-pages-layers",Wk=h.memo(fe(function({className:t,panelPagesProps:n,panelLayersProps:s,...r}){const{showPages:o}=ye(),i=Re(),{className:a,...l}=n||{},u=By(s==null?void 0:s.header,{icon:Z.layers,collapsible:!1,label:i.t("layerManager.layers"),className:N(re.bb,z.br)});return c.jsxs(hs,{className:N(Uk,"gs-utl-flex gs-utl-flex-col gs-utl-h-full",t),...r,children:[o&&c.jsx(Px,{className:N(a,re.bb,z.br),...l}),c.jsx(tx,{...s,header:u})]})})),Gk="gs-trait-custom",qk=fe(function(t){const{trait:n,editor:s,value:r,disabled:o,labelAs:i,className:a}=t,[,l]=h.useState(0),u=h.useRef(null),d=n.get("component"),f=n.get("render"),p=n.target,g=u.current;if(h.useEffect(()=>{if(p){let v=()=>{},x=()=>{};const y=()=>{x(),l(w=>++w)};if(p.on("change",y),!d&&f&&g){const w=j=>g.appendChild(j),S=j=>g.removeChild(j),C=f({editor:s,component:p,trait:n,addEl:w,removeEl:S,onUpdate:j=>{x=j}});C instanceof HTMLElement?(w(C),v=()=>S(C)):Ye(C)&&(v=()=>C())}return()=>{p.off("change",y),v()}}},[p,g,r]),!p)return null;const m=qr({...t,className:N(Gk,a)}),b={trait:n,component:p,editor:s,value:r,disabled:o};return c.jsxs("div",{...m,children:[c.jsx(fs,{...t,as:i}),c.jsx("div",{className:N(o&&"gs-utl-pointer-events-none opacity-50"),children:d?c.jsx(d,{...b}):f?c.jsx("div",{ref:u}):null})]})});function _x({className:e,options:t,value:n,name:s,label:r,border:o,hideCaret:i,size:a="s",autoFocus:l,open:u,allowNew:d,onChange:f,onBlur:p,placeholder:g}){const[m,b]=h.useState(null),[v,x]=h.useState(null),{styles:y,attributes:w}=Wa(m,v,qp),[S,C]=h.useState(""),j=Xa(),E=S===""?t:t.filter(F=>F.label.toLowerCase().includes(S.toLowerCase())),_=F=>C(F.target.value),T=F=>F==null?void 0:F.label,P=d&&S.length>0&&!E.some(F=>F.label===S),A=Ye(d)?d(S):d,M={minWidth:`${m==null?void 0:m.offsetWidth}px`,maxHeight:200},R=()=>p==null?void 0:p();return c.jsxs("div",{className:ee("w-full",e),children:[!!r&&c.jsx(Dr,{size:a,children:r}),c.jsxs(Bo,{value:n,onChange:f,name:s,nullable:!0,children:[c.jsx(xx,{size:a,ref:b,border:o,children:c.jsxs(k,{nowrap:!0,children:[c.jsx(Bo.Input,{autoFocus:l,className:j,displayValue:T,onChange:_,onBlur:R,placeholder:g}),!i&&c.jsx(Bo.Button,{children:c.jsx(oe,{icon:Z.chevronDown,size:le.sx})})]})}),c.jsx(Bo.Options,{static:u,className:J0,ref:x,style:y.popper,...w.popper,children:c.jsxs(Xn,{className:ee("h-full"),padding:!1,style:M,children:[P&&c.jsx(Bo.Option,{value:{id:null,label:S},children:({active:F})=>c.jsx(pm,{option:{id:null,label:A},active:F,selected:n})}),!P&&E.length===0&&c.jsx("div",{className:ee(je.xy),children:"No items found"}),E.map(F=>c.jsx(Bo.Option,{value:F,children:({active:L})=>c.jsx(pm,{option:F,active:L,selected:n})},F.id))]})})]})]})}const Kk=(e,t)=>{const n=`${Xc}${t}`,s=e.get(n,{skipResolve:!0});return s?Tx(s):e.get(n)||""};function Tx(e){return`${e.collectionId}.${e.variableType}.${e.path}`}const Yk=({page:e,component:t})=>{const{DataSources:n,I18n:s}=e.em,r=["prevItem","currentItem","nextItem"],o=Jc(e)||"",i=Object.values((t==null?void 0:t.collectionsStateMap)||{}).map(u=>{const d=u;return r.map(f=>{if(d!=null&&d[f]){const{collectionId:p}=d,g=s.t(`dataSources.collections.${p}`)||p,m=s.t(`dataSources.variableTypes.${f}`)||f,b={collectionId:p,path:"id",type:n.dataComponentTypes.variable,variableType:f};return{id:Tx(b),label:`${g} > ${m}`,dataVariable:b}}}).filter(Boolean)}).flat().filter(Boolean),a=n.get(o),l=a==null?void 0:a.getRecords().map(u=>({id:u.id,label:u.get("title")||u.get("name")||u.id}));return[...i,...l]},Ox="#",ec="mailto:",Td="subject=",Rf="tel:",Ax="hrefType",T1="showIdList",O1=(e,t)=>{const n=t==null?void 0:t.get(Ax);return n||(e.startsWith(Rf)?"phone":e.startsWith(ec)?"email":e.startsWith(va)?"pages":e.startsWith(Ox)?"elements":"url")},A1=e=>`${e.getName()} - #${e.getId()}`,Zk="gs-trait-href",Xk=fe(function(t){const{trait:n,value:s,disabled:r,labelAs:o,className:i}=t,a=n.component,l=ye(),{isSelectingTarget:u,editor:d}=l,[,f]=h.useState(0),[p,g]=h.useState(""),[m,b]=h.useState(""),[v,x]=h.useState(""),[y,w]=h.useState([]),S=Re(),C=d==null?void 0:d.Pages.getAll(),j=S.tScoped("traitManager.traits.labels"),E=()=>f(J=>++J),_=a.get(T1)??!1,T=O1(s,a),P=T==="pages"?s==null?void 0:s.replace(va,""):"",A=!!P&&(d==null?void 0:d.Pages.get(P)),M=A?Qc(A):!1,R=h.useMemo(()=>!M||!A||!d?[]:Yk({page:A,component:a}),[d,A,M,a]),F=J=>{n.setValue(J)},L=J=>{a.set({[T1]:J}),E()},B=J=>{g(""),b(""),x(""),F(""),a.set({[Ax]:J}),E()},q=J=>{F(J),E()},H=(J,Y)=>{yA(a,"id",(Y==null?void 0:Y.dataVariable)||J),E()},$=J=>{J&&(F(J.id),E())},I=J=>{F(`${Rf}${J}`),x(J)},O=J=>{F(`${ec}${J}${m?`?${Td}${m}`:""}`),g(J)},V=J=>{F(`${ec}${p}${J?`?${Td}${J}`:""}`),b(J)},G=()=>{l.setSelectingTarget(!u)},W=J=>{const Y=J.replace(Ox,""),U=d==null?void 0:d.Components.componentsById[Y];return{id:J,label:U?A1(U):J}};h.useEffect(()=>{var Y;const J=[];if(_){const U=["path","br","b","u","i","strike"],Q=(Y=d==null?void 0:d.Pages.getSelected())==null?void 0:Y.getMainComponent();Q==null||Q.forEachChild(se=>{!se.is("comment")&&!se.is("textnode")&&!U.includes(se.get("tagName"))&&J.push({id:`#${se.getId()}`,label:A1(se)})})}w(J)},[d,_]),h.useEffect(()=>{let J=()=>{};const Y=()=>{J(),!(d!=null&&d.em.destroyed)&&(d==null||d.stopCommand(Tc))};return u&&(J=fw(Y),d==null||d.runCommand(Tc,{onSelect:U=>F(`#${U.getId()}`)})),Y},[d,u]),h.useEffect(()=>{if(!s)return;switch(O1(s,a)){case"phone":x(s.replace(Rf,""));break;case"email":{const[Y,U=""]=s.replace(ec,"").split("?");g(Y),b(U.replace(Td,""));break}}},[s]);const K=qr({className:N(Zk,i)});return c.jsxs("div",{...K,children:[c.jsx(fs,{...t,as:o}),c.jsx("div",{className:N(r&&"gs-utl-pointer-events-none opacity-50"),children:c.jsx(Yr,{onChange:B,classNamePanel:"gs-utl-p-1",value:T,tabs:[{id:"url",label:c.jsx(oe,{icon:Z.link,size:le.s}),content:c.jsx(tt,{placeholder:"eg. https://google.com",value:s,label:"URL",onChange:F,size:"s",type:"url"})},{id:"pages",label:c.jsx(oe,{icon:Z.textBoxMultiple,size:le.s}),content:c.jsxs(k,{gap:"s",col:!0,children:[c.jsx(_e,{size:"s",options:(C||[]).map(J=>({id:`${va}${J.getId()}`,icon:p0(J),label:J.getName()})),value:s,onChange:q,label:"Page"}),M&&c.jsx(_e,{size:"s",options:R,value:Kk(a,"id"),onChange:H,label:S.t("dataSources.collectionItem")})]})},{id:"elements",label:c.jsx(oe,{icon:Z.viewDayOutline,size:le.s}),content:c.jsxs(k,{gap:"s",col:!0,children:[c.jsx(Dr,{size:"s",children:"Element ID"}),c.jsxs(k,{gap:"xs",nowrap:!0,children:[_?c.jsx(_x,{options:y,onChange:$,value:W(s),placeholder:S.t("selectList")}):c.jsx(tt,{size:"s",placeholder:"eg. #my-element-in-page",value:s,onChange:F,className:"gs-utl-flex-1"}),c.jsx(bt,{title:S.t("selectTarget"),size:"m2",active:u,onClick:G,className:"gs-utl-h-[30px]",children:c.jsx(oe,{icon:Z.target,size:le.sx})})]}),c.jsx(wa,{value:_,onChange:L,label:j("showList")})]})},{id:"email",label:c.jsx(oe,{icon:Z.email,size:le.s}),content:c.jsxs(k,{gap:"s",col:!0,children:[c.jsx(tt,{placeholder:"eg. mail@gmail.com",value:p,onChange:O,size:"s",label:"Email",type:"email"}),c.jsx(tt,{placeholder:"eg. My subject",value:m,onChange:V,label:"Subject",size:"s"})]})},{id:"phone",label:c.jsx(oe,{icon:Z.phone,size:le.s}),content:c.jsx(tt,{size:"s",type:"tel",label:"Phone",placeholder:"eg. +55123456789",value:v,onChange:I})}]})})]})});function Jk({trait:e,value:t,disabled:n,label:s,labelAs:r}){const[o,i]=h.useState(),a=e.get("properties"),l=e.get("addItem"),u=e.get("labelItem"),d=t||[],f=d.findIndex(p=>p.id===(o==null?void 0:o.id));return c.jsx(Es,{items:d,selected:f>-1?o:null,select:i,disabled:n,label:s,labelAs:r,add:()=>{const p=d.length+1,g=l?l(p):{id:`opt${p}`,label:`New option ${p}`};e.setValue([...d,g])},move:(p,g)=>{const m=e.getValue().filter(b=>b.id!==p.id);m.splice(g,0,p),e.setValue(m)},remove:p=>{const g=e.getValue().filter(m=>m.id!==p.id);e.setValue(g,{removed:p})},renderItem:p=>u?u(p):p.label,children:c.jsx(k,{space:"m",col:!0,children:!!o&&a.map(p=>{const{name:g,getValue:m}=p,b=p.setValue,v=p.label||g,x=d[f];if(!x)return null;const y=x[g],w=m?m(y):y,S=j=>{const E={...x};x[g]=b?b(j,w):j,e.setValue([...d],{item:x,previous:E}),g==="id"&&i(x)};let C=c.jsx(tt,{label:v,value:w,onChange:S});switch(p.type){case"select":C=c.jsx(_e,{label:v,options:p.options,value:w,onChange:S})}return c.jsx(h.Fragment,{children:C},g)})})})}const Qk="gs-trait-custom-type",e8=fe(function({trait:t,editor:n}){const s=h.useRef(null),r=t.getType(),o=t.target,{Traits:i}=n,a=i.getType(r),l=!!(o&&a);return h.useEffect(()=>{const u=s.current;if(a&&u&&o){const d=new a({model:t,config:i.getConfig(),attributes:t.get("attributes")}),f=d.render().el;return u.appendChild(f),d.listenTo(o,"change",()=>d.postUpdate()),()=>{u.removeChild(f),d.removeView()}}},[o,a,t]),l&&c.jsx("div",{className:Qk,ref:s})}),t8=e=>{const{value:t={},onConfirm:n,additionalSources:s,editor:r}=e;if(!r)return;const o="DataValuePicker",i={id:o,header:!1,layout:{type:"panelDataValuePicker",value:t,onConfirm:({value:a})=>{n==null||n(a),r.runCommand(ie.layoutRemove,{id:o})},additionalSources:s},placer:{type:"dialog",size:"l"}};r.runCommand(ie.layoutToggle,{...i})};function Nx(e){const{initialDataValue:t,handleDataValueChange:n,handleValueClear:s,editor:r,additionalSources:o,enableDataValue:i,hasDataResolverValue:a}=e;if(!r||!i)return[];const l={type:"button",className:a?z.tAo:"",variant:"out-clear",size:"x2s",block:!0,border:!1},u=[{...l,title:r.I18n.t("dataSources.connectDataValue"),icon:{icon:Z.databaseOutline,size:le.s2x},onClick:()=>t8({value:t,onConfirm:n,additionalSources:o,editor:r})}];return a&&u.push({...l,title:r.I18n.t("dataSources.clearDataValue"),icon:{icon:Z.close,size:le.s2x},onClick:s}),u}function n8(e,t){const n=e.em.getEditor(),s=e.target;let r=!1;t===!0?r=!0:ur(t)&&Ye(t.enable)&&(r=t.enable({trait:e,component:s,editor:n}));const o=e.getValue({skipResolve:!0}),i=s.collectionsStateMap,a=Hr(o);return{hasDataResolverValue:a,dataResolverValue:a?e.getValue():void 0,enableDataValue:r,initialDataValue:o,handleDataValueChange:l=>e.setValue(l),handleValueClear:()=>{const l=e.getValue();e.setValue(""),e.setValue(l)},editor:n,additionalSources:i}}const s8=({label:e,buttons:t})=>c.jsxs(k,{items:"center",nowrap:!0,full:!0,children:[c.jsx(D,{grow:!0,children:e}),c.jsx(k,{nowrap:!0,items:"center",justify:"end",gap:"x2s",children:t.map((n,s)=>c.jsx(bt,{...n},s))})]}),Mx=e=>Ts((e||"").replace(/-/g," ")),r8=(e,t)=>({size:"s",tip:e.get("tip"),type:e.getType(),value:e.getValue(),label:e.get("label")!==!1&&Mx(e.getLabel({locale:!0})),placeholder:(t==null?void 0:t.t(`traitManager.traits.attributes.${e.getId()}.placeholder`))||e.get("placeholder")||"",onChange:(n,s)=>e.setValue(n,{partial:s})}),gs=(e,t,n)=>{const s=n8(e,n.traitManagerDataConfig),r=Nx(s),{hasDataResolverValue:o,dataResolverValue:i}=s,a=r8(e,t);return{...a,value:i??a.value,disabled:o,labelAs:r.length?"span":void 0,label:c.jsx(s8,{label:a.label,buttons:r})}},N1=(e,t,n)=>gs(e,t,n),o8=(e,t,n)=>gs(e,t,n),i8=(e,t,n)=>{const s=Hr(e.getValue({skipResolve:!0})),r=gs(e,t,n),o={min:e.get("min"),max:e.get("max"),step:e.get("step"),pan:!s,units:s?[]:e.get("units"),onChange:(i,a)=>{const l=a||isNaN(parseFloat(i))?i:parseFloat(i);e.setValue(l,{partial:a})}};return{...r,...o}},Lx=(e,t,n)=>{const s=e.get("labelToTitle"),r=Hr(e.getValue({skipResolve:!0})),o=gs(e,t,n),i={options:e.getOptions().map(a=>{const l=a.labelReact||a.name||a.label||a.value;return ot(a)?{id:a,label:a}:{id:a.id||a.value,title:s?l:a.title,icon:a.icon,label:s?"":l}}),onChange:a=>e.setValue(a),emptyState:r&&e.getValue()||void 0,hideCaret:r};return{...o,...i}},a8=(e,t,n)=>{const{options:s,onChange:r}=Lx(e,t,n),o={options:s,onChange:r};return{...gs(e,t,n),...o}},l8=(e,t,n)=>{const s=e.get("typeProps")||{},r=Hr(e.getValue({skipResolve:!0}));return{...gs(e,t,n),isContain:!0,hideButton:r,btnLabel:e.get("text"),onOpen(){if(r)return;const i=t==null?void 0:t.Assets;i==null||i.open({select(a){e.setValue(a.getSrc()),i.close()}})},...s}},c8=e=>({children:Mx(e.getLabel()||e.get("text")||e.get("labelButton")),onClick:()=>{const t=e.em.Editor,n=e.get("command");ot(n)?t.runCommand(n):n==null||n(t,e)},full:!0}),u8=(e,t,n)=>{const s=gs(e,t,n),o={value:!!(s.disabled?s.value:e.getValue({useType:!0})),onChange:i=>e.setValue(i)};return{...s,...o}},d8=(e,t,n)=>{const s=gs(e,t,n),r=e.get("typeProps")||{},o=Hr(e.getValue({skipResolve:!0}));return{language:"css",...r,...s,formatOnMount:!o,onChange:i=>e.setValue(i)}},f8=(e,t,n)=>({...gs(e,t,n),trait:e}),p8=(e,t,n)=>({...gs(e,t,n),trait:e}),h8=(e,t,n)=>({...gs(e,t,n),trait:e,editor:t});function g8(e,t,n={}){var i;const s=e.get("visible"),r=e.getType(),o={traitManagerDataConfig:n.traitManagerDataConfig};if(Ye(s)&&s({component:e.target,trait:e})===!1)return null;switch(r){case"text":return c.jsx(tt,{...N1(e,t,o)});case"select":return c.jsx(_e,{...Lx(e,t,o)});case"number":return c.jsx(Ne,{...i8(e,t,o)});case"color":return c.jsx(lr,{...o8(e,t,o)});case"checkbox":return c.jsx(wa,{...u8(e,t,o)});case"button":return c.jsx(Ke,{...c8(e)});case"radio":return c.jsx(Yt,{...a8(e,t,o)});case"code":return c.jsx(ir,{...d8(e,t,o),...n},((i=t==null?void 0:t.getSelected())==null?void 0:i.getId())||"");case"image":case"file":return c.jsx(ja,{...l8(e,t,o)});case"stack":return c.jsx(Jk,{...f8(e,t,o)});case"href":return c.jsx(Xk,{...p8(e,t,o)});case"custom":return c.jsx(qk,{...h8(e,t,o)});default:return!!t.Traits.getType(r)?c.jsx(e8,{editor:t,trait:e}):c.jsx(tt,{...N1(e,t,o)})}}const $f="gs-trait-manager",M1=({trait:e,isDarkTheme:t,traitManagerDataConfig:n})=>c.jsx(D,{className:ee(`${$f}-field gs-utl-mb-2 gs-utl-w-full`),children:g8(e,e.em.getEditor(),{isDarkTheme:t,traitManagerDataConfig:n})});function m8({traits:e,className:t}){var d,f;const n=Ja(),{isDarkTheme:s}=Ds(),o=(d=ye().sdkOptions.dataSources)==null?void 0:d.traitManager,i=n.Traits.getTraitsByCategory(e),a=(f=i.find(p=>!p.category))==null?void 0:f.items,l=i.filter(p=>p.category),u=ee("gs-utl-text-center");return c.jsx(k,{className:ee($f,t),col:!0,children:n.getSelected()?e.length?c.jsxs(c.Fragment,{children:[a==null?void 0:a.map(p=>c.jsx(M1,{trait:p,isDarkTheme:s,traitManagerDataConfig:o},p.id)),l.map(({category:p,items:g},m)=>c.jsx(ar,{open:!!(p!=null&&p.get("open")),onChange:({open:b})=>p==null?void 0:p.set({open:b}),handler:p==null?void 0:p.getLabel(),handlerIcon:p==null?void 0:p.get("icon"),classNameContent:"gs-utl-p-2",classNameWrap:`${$f}-category -gs-utl-mx-2`,className:b=>ee(sp.itemList({index:m+(a?1:0),open:b,length:l.length})),children:g.map(b=>c.jsx(M1,{trait:b,isDarkTheme:s,traitManagerDataConfig:o},b.id))},p==null?void 0:p.id))]}):c.jsx(D,{className:u,children:"No properties available"}):c.jsx(D,{className:u,children:n.t("traitManager.empty")})})}const kf=fe(m8),b8="gs-panel-properties",v8=h.memo(fe(function({className:t,...n}){return c.jsx(hs,{className:N(b8,"gs-utl-overflow-auto gs-utl-h-full",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-auto"),...n,children:c.jsx(bf,{children:s=>c.jsx(kf,{...s})})})})),y8=async({html:e="",css:t="",el:n})=>{const s=`<span style="color: initial; display: inline-block;"><style> body { margin: 0; } ${t}</style>${e}</span>`,r={};if(document.body.attachShadow){const o=n.shadowRoot||n.attachShadow({mode:"open"});o.innerHTML=s}return r},x8=fe(function({rule:t,onSelect:n,onRemove:s,className:r}){const o=h.useRef(null),a=ye().editor,l=Re(),u=t.getDevice(),d=t.getState(),{isDarkTheme:f}=Ds(),[p,g]=h.useState(t.toCSS({allowEmpty:!0})),[m,b]=h.useState(p),v=t.selectorsToString(),x=()=>{a.select(),setTimeout(()=>a.Selectors.select(t)),n==null||n()},y=()=>{a.Css.remove(t),s==null||s()},w=()=>{if(m){const S=a.Parser.parseCss(m)[0];S&&(t.setStyle(S.style),g(m))}};return h.useEffect(()=>{if(o.current){const S=o.current;y8({el:S,html:'<div class="prv-rule">Preview</div>',css:`
337
+ `},y6={onDragStart(e){return`Picked up draggable item ${e}.`},onDragOver(e,t){return t?`Draggable item ${e} was moved over droppable area ${t}.`:`Draggable item ${e} is no longer over a droppable area.`},onDragEnd(e,t){return t?`Draggable item ${e} was dropped over droppable area ${t}`:`Draggable item ${e} was dropped.`},onDragCancel(e){return`Dragging was cancelled. Draggable item ${e} was dropped.`}};var it;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(it||(it={}));function nd(...e){}class Ki extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(({disabled:t})=>!t)}getNodeFor(t){var n,s;return(n=(s=this.get(t))==null?void 0:s.node.current)!=null?n:void 0}}const ru=f.createContext({activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,activeNodeClientRect:null,activators:[],ariaDescribedById:{draggable:""},containerNodeRect:null,dispatch:nd,draggableNodes:{},droppableRects:new Map,droppableContainers:new Ki,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nd},scrollableAncestors:[],scrollableAncestorRects:[],recomputeLayouts:nd,windowRect:null,willRecomputeLayouts:!1});function x6(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:{},translate:{x:0,y:0}},droppable:{containers:new Ki}}}function w6(e,t){switch(t.type){case it.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case it.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case it.DragEnd:case it.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case it.RegisterDroppable:{const{element:n}=t,{id:s}=n,r=new Ki(e.droppable.containers);return r.set(s,n),{...e,droppable:{...e.droppable,containers:r}}}case it.SetDroppableDisabled:{const{id:n,key:s,disabled:r}=t,o=e.droppable.containers.get(n);if(!o||s!==o.key)return e;const i=new Ki(e.droppable.containers);return i.set(n,{...o,disabled:r}),{...e,droppable:{...e.droppable,containers:i}}}case it.UnregisterDroppable:{const{id:n,key:s}=t,r=e.droppable.containers.get(n);if(!r||s!==r.key)return e;const o=new Ki(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}const Cy=f.createContext({type:null,event:null});function S6({onDragStart:e,onDragMove:t,onDragOver:n,onDragEnd:s,onDragCancel:r}){const o=f.useContext(Cy),i=f.useRef(o);f.useEffect(()=>{if(o!==i.current){const{type:a,event:c}=o;switch(a){case it.DragStart:e==null||e(c);break;case it.DragMove:t==null||t(c);break;case it.DragOver:n==null||n(c);break;case it.DragCancel:r==null||r(c);break;case it.DragEnd:s==null||s(c);break}i.current=o}},[o,e,t,n,s,r])}function C6({announcements:e=y6,hiddenTextDescribedById:t,screenReaderInstructions:n}){const{announce:s,announcement:r}=b6(),o=Ga("DndLiveRegion"),[i,a]=f.useState(!1);return f.useEffect(()=>{a(!0)},[]),S6(f.useMemo(()=>({onDragStart({active:c}){s(e.onDragStart(c.id))},onDragMove({active:c,over:u}){e.onDragMove&&s(e.onDragMove(c.id,u==null?void 0:u.id))},onDragOver({active:c,over:u}){s(e.onDragOver(c.id,u==null?void 0:u.id))},onDragEnd({active:c,over:u}){s(e.onDragEnd(c.id,u==null?void 0:u.id))},onDragCancel({active:c}){s(e.onDragCancel(c.id))}}),[s,e])),i?Mn.createPortal(f.createElement(f.Fragment,null,f.createElement(g6,{id:t,value:n.draggable}),f.createElement(m6,{id:o,announcement:r})),document.body):null}const er=Object.freeze({x:0,y:0});function jy(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function km(e,t=e.offsetLeft,n=e.offsetTop){return{x:t+e.width*.5,y:n+e.height*.5}}const j6=({collisionRect:e,droppableContainers:t})=>{const n=km(e,e.left,e.top);let s=1/0,r=null;for(const o of t){const{rect:{current:i}}=o;if(i){const a=jy(km(i),n);a<s&&(s=a,r=o.id)}}return r};function E6(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function P6(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:er}function T6(e){return function(n,...s){return s.reduce((r,o)=>({...r,top:r.top+e*o.y,bottom:r.bottom+e*o.y,left:r.left+e*o.x,right:r.right+e*o.x,offsetLeft:r.offsetLeft+e*o.x,offsetTop:r.offsetTop+e*o.y}),{...n})}}const Rm=T6(1);function O6(e,t=window.getComputedStyle(e)){return t.position==="fixed"}function _6(e,t=window.getComputedStyle(e)){const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].find(r=>{const o=t[r];return typeof o=="string"?n.test(o):!1})!=null}function qf(e){const t=[];function n(s){if(!s)return t;if(Wf(s)&&s.scrollingElement!=null&&!t.includes(s.scrollingElement))return t.push(s.scrollingElement),t;if(!bi(s)||xy(s)||t.includes(s))return t;const r=window.getComputedStyle(s);return _6(s,r)&&t.push(s),O6(s,r)?t:n(s.parentNode)}return e?n(e.parentNode):t}function sd(e){return!su||!e?null:mi(e)?e:Uf(e)?Wf(e)||e===vi(e).scrollingElement?window:bi(e)?e:null:null}function cp(e){return mi(e)?{x:e.scrollX,y:e.scrollY}:{x:e.scrollLeft,y:e.scrollTop}}var Wo;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Wo||(Wo={}));function Ey(e){const t={x:0,y:0},n={x:e.scrollWidth-e.clientWidth,y:e.scrollHeight-e.clientHeight},s=e.scrollTop<=t.y,r=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:s,isLeft:r,isBottom:o,isRight:i,maxScroll:n,minScroll:t}}function A6(e){return!su||!e?!1:e===document.scrollingElement}const M6={x:.2,y:.2};function L6(e,t,{top:n,left:s,right:r,bottom:o},i=10,a=M6){const{clientHeight:c,clientWidth:u}=e,d=A6(e)?{top:0,left:0,right:u,bottom:c,width:u,height:c}:t,{isTop:p,isBottom:h,isLeft:g,isRight:m}=Ey(e),b={x:0,y:0},v={x:0,y:0},x={height:d.height*a.y,width:d.width*a.x};return!p&&n<=d.top+x.height?(b.y=Wo.Backward,v.y=i*Math.abs((d.top+x.height-n)/x.height)):!h&&o>=d.bottom-x.height&&(b.y=Wo.Forward,v.y=i*Math.abs((d.bottom-x.height-o)/x.height)),!m&&r>=d.right-x.width?(b.x=Wo.Forward,v.x=i*Math.abs((d.right-x.width-r)/x.width)):!g&&s<=d.left+x.width&&(b.x=Wo.Backward,v.x=i*Math.abs((d.left+x.width-s)/x.width)),{direction:b,speed:v}}function N6(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:t,left:n,right:s,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:s,bottom:r,width:e.clientWidth,height:e.clientHeight}}function Py(e){return e.reduce((t,n)=>fa(t,cp(n)),er)}function Ty(e,t,n=er){if(!e||!bi(e))return n;const s={x:n.x+e.offsetLeft,y:n.y+e.offsetTop};return e.offsetParent===t?s:Ty(e.offsetParent,t,s)}function ou(e){const{offsetWidth:t,offsetHeight:n}=e,{x:s,y:r}=Ty(e,null);return{width:t,height:n,offsetTop:r,offsetLeft:s}}function iu(e){if(mi(e)){const u=window.innerWidth,d=window.innerHeight;return{top:0,left:0,right:u,bottom:d,width:u,height:d,offsetTop:0,offsetLeft:0}}const{offsetTop:t,offsetLeft:n}=ou(e),{width:s,height:r,top:o,bottom:i,left:a,right:c}=e.getBoundingClientRect();return{width:s,height:r,top:o,bottom:i,right:c,left:a,offsetTop:t,offsetLeft:n}}function up(e){const{width:t,height:n,offsetTop:s,offsetLeft:r}=ou(e),o=qf(e),i=Py(o),a=s-i.y,c=r-i.x;return{width:t,height:n,top:a,bottom:a+n,right:c+t,left:c,offsetTop:s,offsetLeft:r}}function Im(e){return"top"in e}function Vm(e,t=e.offsetLeft,n=e.offsetTop){return[{x:t,y:n},{x:t+e.width,y:n},{x:t,y:n+e.height},{x:t+e.width,y:n+e.height}]}const $6=({collisionRect:e,droppableContainers:t})=>{let n=1/0,s=null;const r=Vm(e,e.left,e.top);for(const o of t){const{rect:{current:i}}=o;if(i){const a=Vm(i,Im(i)?i.left:void 0,Im(i)?i.top:void 0),c=r.reduce((d,p,h)=>d+jy(a[h],p),0),u=Number((c/4).toFixed(4));u<n&&(n=u,s=o.id)}}return s};function k6(e,t){const n=Math.max(t.top,e.offsetTop),s=Math.max(t.left,e.offsetLeft),r=Math.min(t.left+t.width,e.offsetLeft+e.width),o=Math.min(t.top+t.height,e.offsetTop+e.height),i=r-s,a=o-n;if(s<r&&n<o){const c=t.width*t.height,u=e.width*e.height,d=i*a,p=d/(c+u-d);return Number(p.toFixed(4))}return 0}const R6=({collisionRect:e,droppableContainers:t})=>{let n=0,s=null;for(const r of t){const{rect:{current:o}}=r;if(o){const i=k6(o,e);i>n&&(n=i,s=r.id)}}return s};var Zi;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Zi||(Zi={}));var pc;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(pc||(pc={}));function I6({acceleration:e,activator:t=Zi.Pointer,canScroll:n,draggingRect:s,enabled:r,interval:o=5,order:i=pc.TreeOrder,pointerCoordinates:a,scrollableAncestors:c,scrollableAncestorRects:u,threshold:d}){const[p,h]=u6(),g=f.useRef({x:1,y:1}),m=f.useMemo(()=>{switch(t){case Zi.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case Zi.DraggableRect:return s}return null},[t,s,a]),b=f.useRef(er),v=f.useRef(null),x=f.useCallback(()=>{const w=v.current;if(!w)return;const S=g.current.x*b.current.x,C=g.current.y*b.current.y;w.scrollBy(S,C)},[]),y=f.useMemo(()=>i===pc.TreeOrder?[...c].reverse():c,[i,c]);f.useEffect(()=>{if(!r||!c.length||!m){h();return}for(const w of y){if((n==null?void 0:n(w))===!1)continue;const S=c.indexOf(w),C=u[S];if(!C)continue;const{direction:j,speed:E}=L6(w,C,m,e,d);if(E.x>0||E.y>0){h(),v.current=w,p(x,o),g.current=E,b.current=j;return}}g.current={x:0,y:0},b.current={x:0,y:0},h()},[e,x,n,h,r,o,JSON.stringify(m),p,c,y,u,JSON.stringify(d)])}function V6(e,t){const n=t!==null?e[t]:void 0,s=n?n.node.current:null;return Wa(r=>{var o;return t===null?null:(o=s??r)!=null?o:null},[s,t])}function H6(e,t){return f.useMemo(()=>e.reduce((n,s)=>{const{sensor:r}=s,o=r.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,s)}));return[...n,...o]},[]),[e,t])}function Oy(e){const t=f.useRef(e);return vo(()=>{t.current!==e&&(t.current=e)},[e]),t}var ga;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ga||(ga={}));var dp;(function(e){e.Optimized="optimized"})(dp||(dp={}));const Hm=new Map,D6={measure:ou,strategy:ga.WhileDragging,frequency:dp.Optimized};function F6(e,{dragging:t,dependencies:n,config:s}){const[r,o]=f.useState(!1),{frequency:i,measure:a,strategy:c}={...D6,...s},u=f.useRef(e),d=f.useCallback(()=>o(!0),[]),p=f.useRef(null),h=m(),g=Wa(b=>{if(h&&!t)return Hm;if(!b||b===Hm||u.current!==e||r){for(let v of e)v&&(v.rect.current=v.node.current?a(v.node.current):null);return B6(e)}return b},[e,t,h,a,r]);return f.useEffect(()=>{u.current=e},[e]),f.useEffect(()=>{r&&o(!1)},[r]),f.useEffect(function(){h||requestAnimationFrame(d)},[t,h]),f.useEffect(function(){h||typeof i!="number"||p.current!==null||(p.current=setTimeout(()=>{d(),p.current=null},i))},[i,h,d,...n]),{layoutRectMap:g,recomputeLayouts:d,willRecomputeLayouts:r};function m(){switch(c){case ga.Always:return!1;case ga.BeforeDragging:return t;default:return!t}}}function B6(e){const t=new Map;if(e)for(const n of e){if(!n)continue;const{id:s,rect:r}=n;r.current!=null&&t.set(s,r.current)}return t}function z6(e){const[t,n]=f.useState(null),s=f.useRef(e),r=f.useCallback(o=>{const i=sd(o.target);i&&n(a=>a?(a.set(i,cp(i)),new Map(a)):null)},[]);return f.useEffect(()=>{const o=s.current;if(e!==o){i(o);const a=e.map(c=>{const u=sd(c);return u?(u.addEventListener("scroll",r,{passive:!0}),[u,cp(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),s.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(c=>{const u=sd(c);u==null||u.removeEventListener("scroll",r)})}},[r,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,i)=>fa(o,i),er):Py(e):er,[e,t])}const U6=[];function W6(e){const t=f.useRef(e),n=Wa(s=>e?s&&e&&t.current&&e.parentNode===t.current.parentNode?s:qf(e):U6,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function G6(e){f.useEffect(()=>{if(!su)return;const t=e.map(({sensor:n})=>n.setup==null?void 0:n.setup());return()=>{for(const n of t)n==null||n()}},e.map(({sensor:t})=>t))}function q6(e,t){return f.useMemo(()=>e.reduce((n,{eventName:s,handler:r})=>(n[s]=o=>{r(o,t)},n),{}),[e,t])}const rd=Ay(iu),K6=Z6(iu);function _y(e,t,n){const s=f.useRef(e);return Wa(r=>e?n||!r&&e||e!==s.current?bi(e)&&e.parentNode==null?null:t(e):r??null:null,[e,n,t])}function Ay(e){return(t,n)=>_y(t,e,n)}function Z6(e){const t=[];return function(s,r){const o=f.useRef(s);return Wa(i=>s.length?r||!i&&s.length||s!==o.current?s.map(a=>e(a)):i??t:t,[s,r])}}function Y6(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return bi(t)?t:e}function X6(e){const{width:t,height:n,offsetLeft:s,offsetTop:r}=ou(e);return{top:r,bottom:r+n,left:s,right:s+t,width:t,height:n,offsetTop:r,offsetLeft:s}}const J6=Ay(X6);function Q6({disabled:e,forceRecompute:t}){const[n,s]=Gf(),r=J6(e?null:Y6(n.current),t);return f.useMemo(()=>({nodeRef:n,rect:r,setRef:s}),[r,n,s])}function Dm(e,t){return f.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function ek(...e){return f.useMemo(()=>[...e].filter(t=>t!=null),[...e])}class Yi{constructor(t){this.target=t,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var s;return(s=this.target)==null?void 0:s.removeEventListener(...n)})}}add(t,n,s){var r;(r=this.target)==null||r.addEventListener(t,n,s),this.listeners.push([t,n,s])}}function tk(e){const{EventTarget:t}=Br(e);return e instanceof t?e:vi(e)}function od(e,t){const n=Math.abs(e.x),s=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+s**2)>t:"x"in t&&"y"in t?n>t.x&&s>t.y:"x"in t?n>t.x:"y"in t?s>t.y:!1}var Tn;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Tn||(Tn={}));function Fm(e){e.preventDefault()}function nk(e){e.stopPropagation()}var Ve;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Ve||(Ve={}));const My={start:[Ve.Space,Ve.Enter],cancel:[Ve.Esc],end:[Ve.Space,Ve.Enter]},sk=(e,{currentCoordinates:t})=>{switch(e.code){case Ve.Right:return{...t,x:t.x+25};case Ve.Left:return{...t,x:t.x-25};case Ve.Down:return{...t,y:t.y+25};case Ve.Up:return{...t,y:t.y-25}}};class Kf{constructor(t){this.props=t,this.autoScrollEnabled=!1,this.coordinates=er;const{event:{target:n}}=t;this.props=t,this.listeners=new Yi(vi(n)),this.windowListeners=new Yi(Br(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Tn.Resize,this.handleCancel),this.windowListeners.add(Tn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Tn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props;if(!t.node.current)throw new Error("Active draggable node is undefined");const s=iu(t.node.current),r={x:s.left,y:s.top};this.coordinates=r,n(r)}handleKeyDown(t){if(p6(t)){const{coordinates:n}=this,{active:s,context:r,options:o}=this.props,{keyboardCodes:i=My,coordinateGetter:a=sk,scrollBehavior:c="smooth"}=o,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.cancel.includes(u)){this.handleCancel(t);return}const d=a(t,{active:s,context:r.current,currentCoordinates:n});if(d){const p={x:0,y:0},{scrollableAncestors:h}=r.current;for(const g of h){const m=t.code,b=Sy(d,n),{isTop:v,isRight:x,isLeft:y,isBottom:w,maxScroll:S,minScroll:C}=Ey(g),j=N6(g),E={x:Math.min(m===Ve.Right?j.right-j.width/2:j.right,Math.max(m===Ve.Right?j.left:j.left+j.width/2,d.x)),y:Math.min(m===Ve.Down?j.bottom-j.height/2:j.bottom,Math.max(m===Ve.Down?j.top:j.top+j.height/2,d.y))},T=m===Ve.Right&&!x||m===Ve.Left&&!y,O=m===Ve.Down&&!w||m===Ve.Up&&!v;if(T&&E.x!==d.x){if(m===Ve.Right&&g.scrollLeft+b.x<=S.x||m===Ve.Left&&g.scrollLeft+b.x>=C.x){g.scrollBy({left:b.x,behavior:c});return}p.x=m===Ve.Right?g.scrollLeft-S.x:g.scrollLeft-C.x,g.scrollBy({left:-p.x,behavior:c});break}else if(O&&E.y!==d.y){if(m===Ve.Down&&g.scrollTop+b.y<=S.y||m===Ve.Up&&g.scrollTop+b.y>=C.y){g.scrollBy({top:b.y,behavior:c});return}p.y=m===Ve.Down?g.scrollTop-S.y:g.scrollTop-C.y,g.scrollBy({top:-p.y,behavior:c});break}}this.handleMove(t,fa(d,p))}}}handleMove(t,n){const{onMove:s}=this.props;t.preventDefault(),s(n),this.coordinates=n}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Kf.activators=[{eventName:"onKeyDown",handler:(e,{keyboardCodes:t=My,onActivation:n})=>{const{code:s}=e.nativeEvent;return t.start.includes(s)?(e.preventDefault(),n==null||n({event:e.nativeEvent}),!0):!1}}];function Bm(e){return!!(e&&"distance"in e)}function zm(e){return!!(e&&"delay"in e)}class Zf{constructor(t,n,s=tk(t.event.target)){this.props=t,this.events=n,this.autoScrollEnabled=!0,this.activated=!1,this.timeoutId=null;const{event:r}=t,{target:o}=r;this.props=t,this.events=n,this.document=vi(o),this.documentListeners=new Yi(this.document),this.listeners=new Yi(s),this.windowListeners=new Yi(Br(o)),this.initialCoordinates=lp(r),this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(Tn.Resize,this.handleCancel),this.windowListeners.add(Tn.DragStart,Fm),this.windowListeners.add(Tn.VisibilityChange,this.handleCancel),this.windowListeners.add(Tn.ContextMenu,Fm),this.documentListeners.add(Tn.Keydown,this.handleKeydown),n){if(Bm(n))return;if(zm(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Tn.Click,nk,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Tn.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){const{activated:n,initialCoordinates:s,props:r}=this,{onMove:o,options:{activationConstraint:i}}=r;if(!s)return;const a=lp(t),c=Sy(s,a);if(!n&&i){if(zm(i))return od(c,i.tolerance)?this.handleCancel():void 0;if(Bm(i))return i.tolerance!=null&&od(c,i.tolerance)?this.handleCancel():od(c,i.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),o(a)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Ve.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const rk={move:{name:"pointermove"},end:{name:"pointerup"}};class Yf extends Zf{constructor(t){const{event:n}=t,s=vi(n.target);super(t,rk,s)}}Yf.activators=[{eventName:"onPointerDown",handler:({nativeEvent:e},{onActivation:t})=>!e.isPrimary||e.button!==0?!1:(t==null||t({event:e}),!0)}];const ok={move:{name:"mousemove"},end:{name:"mouseup"}};var pp;(function(e){e[e.RightClick=2]="RightClick"})(pp||(pp={}));class ik extends Zf{constructor(t){super(t,ok,vi(t.event.target))}}ik.activators=[{eventName:"onMouseDown",handler:({nativeEvent:e},{onActivation:t})=>e.button===pp.RightClick?!1:(t==null||t({event:e}),!0)}];const id={move:{name:"touchmove"},end:{name:"touchend"}};class ak extends Zf{constructor(t){super(t,id)}static setup(){return window.addEventListener(id.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(id.move.name,t)};function t(){}}}ak.activators=[{eventName:"onTouchStart",handler:({nativeEvent:e},{onActivation:t})=>{const{touches:n}=e;return n.length>1?!1:(t==null||t({event:e}),!0)}}];function lk(e,{transform:t,...n}){return e!=null&&e.length?e.reduce((s,r)=>r({transform:s,...n}),t):t}const ck=[{sensor:Yf,options:{}},{sensor:Kf,options:{}}],uk={current:{}},Ly=f.createContext({...er,scaleX:1,scaleY:1}),dk=f.memo(function({id:t,autoScroll:n=!0,announcements:s,children:r,sensors:o=ck,collisionDetection:i=R6,measuring:a,modifiers:c,screenReaderInstructions:u=v6,...d}){var p,h,g,m,b;const v=f.useReducer(w6,void 0,x6),[x,y]=v,[w,S]=f.useState(()=>({type:null,event:null})),[C,j]=f.useState(!1),{draggable:{active:E,nodes:T,translate:O},droppable:{containers:P}}=x,_=E?T[E]:null,M=f.useRef({initial:null,translated:null}),N=f.useMemo(()=>{var ze;return E!=null?{id:E,data:(ze=_==null?void 0:_.data)!=null?ze:uk,rect:M}:null},[E,_]),H=f.useRef(null),[L,F]=f.useState(null),[G,D]=f.useState(null),$=f.useRef(d),I=Ga("DndDescribedBy",t),R=f.useMemo(()=>P.getEnabled(),[P]),{layoutRectMap:z,recomputeLayouts:Y,willRecomputeLayouts:Z}=F6(R,{dragging:C,dependencies:[O.x,O.y],config:a==null?void 0:a.droppable}),J=V6(T,E),ee=G?lp(G):null,te=_y(J,(p=a==null||(h=a.draggable)==null?void 0:h.measure)!=null?p:up),q=rd(J),ne=f.useRef(null),ce=ne.current,ge=f.useRef({active:null,activeNode:J,collisionRect:null,droppableRects:z,draggableNodes:T,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null,translatedRect:null}),Re=P.getNodeFor((g=ge.current.over)==null?void 0:g.id),ve=rd(J?J.ownerDocument.defaultView:null),qe=rd(J?J.parentElement:null),Be=W6(E?Re??J:null),ht=K6(Be),et=Q6({disabled:E==null,forceRecompute:Z}),be=(m=et.rect)!=null?m:te,Ze=be===te?P6(te,ce):er,Ye=lk(c,{transform:{x:O.x-Ze.x,y:O.y-Ze.y,scaleX:1,scaleY:1},activatorEvent:G,active:N,activeNodeRect:q,containerNodeRect:qe,draggingNodeRect:be,over:ge.current.over,overlayNodeRect:et.rect,scrollableAncestors:Be,scrollableAncestorRects:ht,windowRect:ve}),lt=ee?fa(ee,O):null,Pe=z6(Be),st=fa(Ye,Pe),tt=be?Rm(be,Ye):null,Ne=tt?Rm(tt,Pe):null,Dt=N&&Ne?i({active:N,collisionRect:Ne,droppableContainers:R}):null,[pe,Me]=f.useState(null),Le=E6(Ye,(b=pe==null?void 0:pe.rect)!=null?b:null,te),Oe=f.useCallback((ze,{sensor:ct,options:Ft})=>{if(!H.current)return;const Cn=T[H.current];if(!Cn)return;const Rt=new ct({active:H.current,activeNode:Cn,event:ze.nativeEvent,options:Ft,context:ge,onStart(nn){const $s=H.current;if(!$s)return;const nr=T[$s];if(!nr)return;const{onDragStart:sr}=$.current,rr={active:{id:$s,data:nr.data,rect:M}};Mn.unstable_batchedUpdates(()=>{y({type:it.DragStart,initialCoordinates:nn,active:$s}),S({type:it.DragStart,event:rr})}),sr==null||sr(rr)},onMove(nn){y({type:it.DragMove,coordinates:nn})},onEnd:Wr(it.DragEnd),onCancel:Wr(it.DragCancel)});Mn.unstable_batchedUpdates(()=>{F(Rt),D(ze.nativeEvent)});function Wr(nn){return async function(){const{active:nr,over:sr,scrollAdjustedTranslate:rr}=ge.current;let or=null;if(nr&&rr){const{cancelDrop:qt}=$.current;or={active:nr,delta:rr,over:sr},nn===it.DragEnd&&typeof qt=="function"&&await Promise.resolve(qt(or))&&(nn=it.DragCancel)}if(H.current=null,Mn.unstable_batchedUpdates(()=>{y({type:nn}),Me(null),j(!1),F(null),D(null),or&&S({type:nn,event:or})}),or){const{onDragCancel:qt,onDragEnd:Bn}=$.current,Ka=nn===it.DragEnd?Bn:qt;Ka==null||Ka(or)}}}},[y,T]),vt=f.useCallback((ze,ct)=>(Ft,Cn)=>{const Rt=Ft.nativeEvent;H.current!==null||Rt.dndKit||Rt.defaultPrevented||ze(Ft,ct.options)===!0&&(Rt.dndKit={capturedBy:ct.sensor},H.current=Cn,Oe(Ft,ct))},[Oe]),Mt=H6(o,vt);G6(o),vo(()=>{$.current=d},Object.values(d)),f.useEffect(()=>{E!=null&&j(!0)},[E]),f.useEffect(()=>{N||(ne.current=null),N&&te&&!ne.current&&(ne.current=te)},[te,N]),f.useEffect(()=>{const{onDragMove:ze}=$.current,{active:ct,over:Ft}=ge.current;if(!ct)return;const Cn={active:ct,delta:{x:st.x,y:st.y},over:Ft};S({type:it.DragMove,event:Cn}),ze==null||ze(Cn)},[st.x,st.y]),f.useEffect(()=>{const{active:ze,droppableContainers:ct,scrollAdjustedTranslate:Ft}=ge.current;if(!ze||!H.current||!Ft)return;const{onDragOver:Cn}=$.current,Rt=ct.get(Dt),Wr=Rt&&Rt.rect.current?{id:Rt.id,rect:Rt.rect.current,data:Rt.data,disabled:Rt.disabled}:null,nn={active:ze,delta:{x:Ft.x,y:Ft.y},over:Wr};Mn.unstable_batchedUpdates(()=>{Me(Wr),S({type:it.DragOver,event:nn}),Cn==null||Cn(nn)})},[Dt]),vo(()=>{ge.current={active:N,activeNode:J,collisionRect:Ne,droppableRects:z,draggableNodes:T,draggingNodeRect:be,droppableContainers:P,over:pe,scrollableAncestors:Be,scrollAdjustedTranslate:st,translatedRect:tt},M.current={initial:be,translated:tt}},[N,J,Ne,T,be,z,P,pe,Be,st,tt]),I6({...Ur(),draggingRect:tt,pointerCoordinates:lt,scrollableAncestors:Be,scrollableAncestorRects:ht});const Ns=f.useMemo(()=>({active:N,activeNode:J,activeNodeRect:te,activeNodeClientRect:q,activatorEvent:G,activators:Mt,ariaDescribedById:{draggable:I},containerNodeRect:qe,dispatch:y,dragOverlay:et,draggableNodes:T,droppableContainers:P,droppableRects:z,over:pe,recomputeLayouts:Y,scrollableAncestors:Be,scrollableAncestorRects:ht,willRecomputeLayouts:Z,windowRect:ve}),[N,J,q,te,G,Mt,qe,et,y,T,I,P,z,pe,Y,Be,ht,Z,ve]);return f.createElement(Cy.Provider,{value:w},f.createElement(ru.Provider,{value:Ns},f.createElement(Ly.Provider,{value:Le},r)),f.createElement(C6,{announcements:s,hiddenTextDescribedById:I,screenReaderInstructions:u}));function Ur(){const ze=(L==null?void 0:L.autoScrollEnabled)===!1,ct=typeof n=="object"?n.enabled===!1:n===!1,Ft=!ze&&!ct;return typeof n=="object"?{...n,enabled:Ft}:{enabled:Ft}}}),pk=f.createContext(null),Um="button",fk="Droppable";function hk({id:e,data:t,disabled:n=!1,attributes:s}){const r=Ga(fk),{active:o,activeNodeRect:i,activatorEvent:a,ariaDescribedById:c,draggableNodes:u,droppableRects:d,activators:p,over:h}=f.useContext(ru),{role:g=Um,roleDescription:m="draggable",tabIndex:b=0}=s??{},v=(o==null?void 0:o.id)===e,x=f.useContext(v?Ly:pk),[y,w]=Gf(),S=q6(p,e),C=Oy(t);f.useEffect(()=>(u[e]={id:e,key:r,node:y,data:C},()=>{const E=u[e];E&&E.key===r&&delete u[e]}),[u,e]);const j=f.useMemo(()=>({role:g,tabIndex:b,"aria-pressed":v&&g===Um?!0:void 0,"aria-roledescription":m,"aria-describedby":c.draggable}),[g,b,v,m,c.draggable]);return{active:o,activeNodeRect:i,activatorEvent:a,attributes:j,droppableRects:d,isDragging:v,listeners:n?void 0:S,node:y,over:h,setNodeRef:w,transform:x}}function gk(){return f.useContext(ru)}const mk="Droppable";function bk({data:e,disabled:t=!1,id:n}){const s=Ga(mk),{active:r,dispatch:o,over:i}=f.useContext(ru),a=f.useRef(null),[c,u]=Gf(),d=Oy(e);return vo(()=>(o({type:it.RegisterDroppable,element:{id:n,key:s,disabled:t,node:c,rect:a,data:d}}),()=>o({type:it.UnregisterDroppable,key:s,id:n})),[n]),f.useEffect(()=>{o({type:it.SetDroppableDisabled,id:n,key:s,disabled:t})},[t]),{active:r,rect:a,isOver:(i==null?void 0:i.id)===n,node:c,over:i,setNodeRef:u}}function vk(e,t,n){const s={...e};return t.top+e.y<=n.top?s.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(s.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?s.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(s.x=n.left+n.width-t.right),s}const yk=({draggingNodeRect:e,transform:t,scrollableAncestorRects:n})=>{const s=n[0];return!e||!s?t:vk(t,e,s)},xk=({transform:e})=>({...e,x:0});function Ny(e,t,n){const s=e.slice();return s.splice(n<0?s.length+n:n,0,s.splice(t,1)[0]),s}function wk(e,t){return e.reduce((n,s,r)=>{const o=t.get(s);return o&&(n[r]=o),n},Array(e.length))}function Sl(e){return e!==null&&e>=0}const $y=({layoutRects:e,activeIndex:t,overIndex:n,index:s})=>{const r=Ny(e,n,t),o=e[s],i=r[s];return!i||!o?null:{x:i.offsetLeft-o.offsetLeft,y:i.offsetTop-o.offsetTop,scaleX:i.width/o.width,scaleY:i.height/o.height}},Cl={scaleX:1,scaleY:1},Sk=({activeIndex:e,activeNodeRect:t,index:n,layoutRects:s,overIndex:r})=>{var o;const i=(o=s[e])!=null?o:t;if(!i)return null;if(n===e){const c=s[r];return c?{x:0,y:e<r?c.offsetTop+c.height-(i.offsetTop+i.height):c.offsetTop-i.offsetTop,...Cl}:null}const a=Ck(s,n,e);return n>e&&n<=r?{x:0,y:-i.height-a,...Cl}:n<e&&n>=r?{x:0,y:i.height+a,...Cl}:{x:0,y:0,...Cl}};function Ck(e,t,n){const s=e[t],r=e[t-1],o=e[t+1];return s?n<t?r?s.offsetTop-(r.offsetTop+r.height):o?o.offsetTop-(s.offsetTop+s.height):0:o?o.offsetTop-(s.offsetTop+s.height):r?s.offsetTop-(r.offsetTop+r.height):0:0}const ky="Sortable",Ry=f.createContext({activeIndex:-1,containerId:ky,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:$y,wasDragging:{current:!1}});function jk({children:e,id:t,items:n,strategy:s=$y}){const{active:r,dragOverlay:o,droppableRects:i,over:a,recomputeLayouts:c,willRecomputeLayouts:u}=gk(),d=Ga(ky,t),p=o.rect!==null,h=f.useMemo(()=>n.map(E=>typeof E=="string"?E:E.id),[n]),g=r!=null,m=f.useRef(!1),b=r?h.indexOf(r.id):-1,v=b!==-1,x=a?h.indexOf(a.id):-1,y=f.useRef(h),w=wk(h,i),S=!Ek(h,y.current),C=x!==-1&&b===-1||S;vo(()=>{S&&v&&!u&&c()},[S,v,c,u]),f.useEffect(()=>{y.current=h},[h]),f.useEffect(()=>{const E=setTimeout(()=>{m.current=g},100);return()=>clearTimeout(E)},[g]);const j=f.useMemo(()=>({activeIndex:b,containerId:d,disableTransforms:C,items:h,overIndex:x,useDragOverlay:p,sortedRects:w,strategy:s,wasDragging:m}),[b,d,C,h,x,w,p,s,m]);return f.createElement(Ry.Provider,{value:j},e)}function Ek(e,t){return e.join()===t.join()}const Pk=({id:e,items:t,activeIndex:n,overIndex:s})=>Ny(t,n,s).indexOf(e),Tk=({containerId:e,isSorting:t,wasDragging:n,index:s,items:r,newIndex:o,previousItems:i,previousContainerId:a,transition:c})=>!c||!n||i!==r&&s===o?!1:t?!0:o!==s&&e===a,Ok={duration:200,easing:"ease"},Iy="transform",_k=ha.Transition.toString({property:Iy,duration:0,easing:"linear"}),Ak={roleDescription:"sortable"};function Mk({disabled:e,index:t,node:n,rect:s}){const[r,o]=f.useState(null),i=f.useRef(t);return vo(()=>{if(!e&&t!==i.current&&n.current){const a=s.current;if(a){const c=iu(n.current),u={x:a.offsetLeft-c.offsetLeft,y:a.offsetTop-c.offsetTop,scaleX:a.width/c.width,scaleY:a.height/c.height};(u.x||u.y)&&o(u)}}t!==i.current&&(i.current=t)},[e,t,n,s]),f.useEffect(()=>{r&&requestAnimationFrame(()=>{o(null)})},[r]),r}function Lk({animateLayoutChanges:e=Tk,attributes:t,disabled:n,data:s,getNewIndex:r=Pk,id:o,strategy:i,transition:a=Ok}){const{items:c,containerId:u,activeIndex:d,disableTransforms:p,sortedRects:h,overIndex:g,useDragOverlay:m,strategy:b,wasDragging:v}=f.useContext(Ry),x=c.indexOf(o),y=f.useMemo(()=>({sortable:{containerId:u,index:x,items:c},...s}),[u,s,x,c]),{rect:w,node:S,setNodeRef:C}=bk({id:o,data:y}),{active:j,activeNodeRect:E,activatorEvent:T,attributes:O,setNodeRef:P,listeners:_,isDragging:M,over:N,transform:H}=hk({id:o,data:y,attributes:{...Ak,...t},disabled:n}),L=l6(C,P),F=!!j,G=F&&v.current&&!p&&Sl(d)&&Sl(g),D=!m&&M,$=D&&G?H:null,R=G?$??(i??b)({layoutRects:h,activeNodeRect:E,activeIndex:d,overIndex:g,index:x}):null,z=Sl(d)&&Sl(g)?r({id:o,items:c,activeIndex:d,overIndex:g}):x,Y=f.useRef(c),Z=c!==Y.current,J=f.useRef(z),ee=f.useRef(u),te=e({active:j,containerId:u,isDragging:M,isSorting:F,id:o,index:x,items:c,newIndex:J.current,previousItems:Y.current,previousContainerId:ee.current,transition:a,wasDragging:v.current}),q=Mk({disabled:!te,index:x,node:S,rect:w});return f.useEffect(()=>{F&&J.current!==z&&(J.current=z),u!==ee.current&&(ee.current=u),c!==Y.current&&(Y.current=c)},[F,z,u,c]),{active:j,attributes:O,activatorEvent:T,rect:w,index:x,isSorting:F,isDragging:M,listeners:_,node:S,overIndex:g,over:N,setNodeRef:L,setDroppableNodeRef:C,setDraggableNodeRef:P,transform:q??R,transition:ne()};function ne(){if(q||Z&&J.current===x)return _k;if(!(D||!a)&&(F||te))return ha.Transition.toString({...a,property:Iy})}}const Nk=[Ve.Down,Ve.Right,Ve.Up,Ve.Left],$k=(e,{context:{active:t,droppableContainers:n,translatedRect:s,scrollableAncestors:r}})=>{if(Nk.includes(e.code)){if(e.preventDefault(),!t||!s)return;const i=[];n.getEnabled().forEach(c=>{if(!c||c!=null&&c.disabled)return;const u=c==null?void 0:c.node.current;if(!u)return;const d=up(u),p={...c,rect:{current:d}};switch(e.code){case Ve.Down:s.top+s.height<=d.top&&i.push(p);break;case Ve.Up:s.top>=d.top+d.height&&i.push(p);break;case Ve.Left:s.left>=d.left+d.width&&i.push(p);break;case Ve.Right:s.left+s.width<=d.left&&i.push(p);break}});const a=$6({active:t,collisionRect:s,droppableContainers:i});if(a){var o;const c=(o=n.get(a))==null?void 0:o.node.current;if(c){const d=qf(c).some((m,b)=>r[b]!==m),p=up(c),h=d?{x:0,y:0}:{x:s.width-p.width,y:s.height-p.height};return{x:p.left-h.x,y:p.top-h.y}}}}};function kk(e){const{id:t,item:n,className:s,select:r,remove:o,renderItem:i,previewStyle:a,sortable:c=!0,disabled:u,confirmRemove:d}=e,{attributes:p,listeners:h,setNodeRef:g,transform:m,transition:b}=Lk({id:t,disabled:u}),v={transform:ha.Transform.toString(m),transition:b},x=()=>!u&&(r==null?void 0:r(n));return l.jsx("div",{...c?{ref:g,style:v,...p}:{},children:l.jsxs(k,{space:"s",onClick:x,className:s,items:"center",nowrap:!0,children:[c&&l.jsx(V,{className:K(!u&&Se.hover,!u&&"cursor-grab"),...h,children:l.jsx(Q,{icon:U.dotsVertical,size:oe.sx})}),l.jsx(V,{grow:!0,className:K("overflow-hidden"),children:l.jsxs(k,{children:[l.jsx(V,{grow:!0,className:K("overflow-ellipsis overflow-hidden"),children:i(n)}),!!a&&l.jsx(V,{children:l.jsx("div",{className:K("w-4 h-4 gjs-bg-white",X.b,X.rnd),style:a(n)})})]})}),o&&d?l.jsx(Xc,{disabled:u,onConfirm:()=>{o==null||o(n)},children:l.jsx(V,{className:K(!u&&Se.click),children:l.jsx(Q,{icon:U.close,size:oe.sx})})}):l.jsx(V,{className:K(!u&&Se.click),onClick:y=>{ao(y),!u&&(o==null||o(n))},children:l.jsx(Q,{icon:U.close,size:oe.sx})})]},n.getIndex?n.getIndex():n.id||n.cid)})}function gs(e){const{className:t,items:n,selected:s,renderItem:r,select:o,add:i,remove:a,move:c,previewStyle:u,getItemId:d=P=>P.id||P.name||P.title||P.label||"",label:p,labelAs:h,children:g,title:m="Select",titleAdd:b="Add",emptyState:v,disabled:x=!1,hidePopover:y,popoverPlacement:w="left",confirmRemove:S}=e,C=ek(Dm(Yf),Dm(Kf,{coordinateGetter:$k}));function j(P){const{active:_,over:M}=P;if(_.id!==(M==null?void 0:M.id)){const N=n.find(L=>d(L)===_.id),H=n.findIndex(L=>d(L)===(M==null?void 0:M.id));N&&(c==null||c(N,H))}}const E=K(X.rnd,B.br,n.length&&X.b,n.length&&"gjs-mt-1");let T=l.jsxs("div",{className:E,children:[n.length===0&&v&&l.jsx(k,{className:A("gs-utl-p-2 gs-utl-text-center",B.txtLowEmphasis),items:"center",justify:"center",children:v}),n.map((P,_)=>{const M=d(P),N=P===s,H=K("gjs-px-2 gjs-py-2 text-xs",B.br,_&&X.bt,!!o&&!N&&!x&&B.hBgH2,N&&B.bgH,x&&"opacity-75");return l.jsx(kk,{id:M,item:P,className:H,select:o,remove:a,renderItem:r,previewStyle:u,sortable:!!c,disabled:x,confirmRemove:S},M||_)})]});c&&(T=l.jsx(dk,{sensors:C,collisionDetection:j6,onDragEnd:j,modifiers:[xk,yk],children:l.jsx(jk,{items:n.map(d),strategy:Sk,children:T})})),o&&!y&&(T=l.jsx(ss,{placement:w,size:"s",buttonAs:"div",title:m,classNameBody:"gs-utl-gap-2 gs-utl-flex gs-utl-flex-col",open:!!s&&!x,onClose:()=>o==null?void 0:o(null),handler:T,children:g}));const O=i?[{type:"button",icon:U.plus,tooltip:b,variant:"outline",size:"xs",disabled:x,onClick:i}]:[];return l.jsxs("div",{className:K(t,"w-full"),children:[!!(p||i)&&l.jsx(ns,{...e,as:h,afterLabelButtons:O}),T]})}const Rk=ae(function(){const t=Ae(),{editor:n}=me(),s=Ia(),r=Va(),o=r.sortedFonts;return n?l.jsx(gs,{items:o,selected:null,renderItem:i=>{const a=vf(i);return l.jsxs(k,{col:!0,children:[l.jsx(V,{className:"gs-utl-text-lg",style:{fontFamily:a},children:i.familyLabel}),l.jsx(V,{children:i.familyLabel})]})},remove:i=>r.removeFont(i.family),add:r.sdkAddFonts&&s.hasType("font")?()=>zf(n):void 0,titleAdd:t.t("fontManager.addFontToProject"),label:t.t("fontManager.projectFonts"),getItemId:i=>i.family,emptyState:t.t("fontManager.emptyProjectFonts")}):null}),Vy=f.forwardRef(function({size:t="m",className:n,classNameContent:s,border:r=!0,children:o,...i},a){const c=ie(B.bg,B.br,r&&`${X.b} ${X.rnd}`,t==="m"&&we.xy,t==="s"&&"gjs-px-3 gjs-py-1",n);return l.jsx(k,{className:c,items:"center",space:"x2s",...i,ref:a,children:l.jsx(V,{grow:!0,className:s,children:o})})}),Hy=f.forwardRef(({autoResize:e,style:t={},...n},s)=>{const r=f.useRef(null),o=s||r;return f.useEffect(()=>{!o.current||!e||(o.current.style.height="auto",o.current.style.height=o.current.scrollHeight+"px")},[n.value,e,o]),l.jsx("textarea",{ref:o,style:{...t,...e?{resize:"none"}:{}},...n})});Hy.displayName="TextAreaWithAutoResize";const Ik="gs-field-textarea";function Wm(e){const{className:t,value:n,label:s,size:r,description:o,placeholder:i,readOnly:a,disabled:c,required:u,onChange:d,onKeyDown:p,afterInput:h,minHeight:g,maxHeight:m,autoResize:b,classNameField:v,classNameFieldContent:x,classNameInput:y}=e,w=Da(e);return l.jsxs("div",{className:K(Ik,t),children:[!!s&&l.jsx(_r,{size:r,children:s}),!!o&&l.jsx(_r,{size:r,as:"span",className:K(B.txtLowEmphasis),capitalize:!1,children:o}),l.jsxs(Vy,{size:r,className:v,classNameContent:x,children:[l.jsx(Hy,{className:K(w,y),autoResize:b,value:n,placeholder:i,readOnly:a,disabled:c,required:u,onChange:S=>d==null?void 0:d(S.target.value),onKeyDown:p,style:{minHeight:g,maxHeight:m}}),h]})]})}const au="gs-page-settings",Vk=`${au}-header`,Hk=`${au}-content`,Dk=`${au}-footer`,Gm="",Fk=ae(function({className:t,classNameHeader:n,classNameContent:s,classNameFooter:r,page:o,size:i=Cf.m}){const a=me(),{isDarkTheme:c}=_s(),u=Va(),d=Ae(),[p,h]=f.useState(o),[g,m]=f.useState(()=>cg(p,a)),[b,v]=f.useState(()=>d.t("update")),x=d.tScoped("pageManager.settings"),y=d.tScoped("pageManager.settings.fields"),{editor:w}=a,S={containerClassName:"gs-utl-min-h-80",size:i,padding:5,isDarkTheme:c,clean:!0};if(!w)return null;const C=N=>m(H=>({...H,...N})),j=N=>{N.preventDefault();const{name:H,...L}=g;L.customCodeHead=$x(L.customCodeHead),L.customCodeBody=Nx(L.customCodeBody),p?(w3(p,L),p.setName(H)):a.setProjectDataCustom({globalPageSettings:L}),v(d.t("updated")),setTimeout(()=>v(d.t("update")),2e3),Nv(w),w.trigger(xn.pageSettingsUpdate,{page:p,data:{name:H,...L}})},E={tooltip:d.t("clear")},T=(p==null?void 0:p.getId())??Gm,O=N=>{const H=w.Pages.get(N);h(H),m(cg(H,a))},P=yf(p),_=!!p&&Vc(p),M=[{id:Gm,label:x("global")},...w.Pages.getAll().map(N=>({icon:Mv(N),id:N.getId(),label:N.getName()}))];return l.jsx("form",{onSubmit:j,className:A(au,"gs-utl-h-full",t),children:l.jsxs(k,{col:!0,full:!0,className:"gs-utl-gap-1 gs-utl-overflow-hidden",nowrap:!0,children:[l.jsx(V,{className:A(Vk,n,B.br,X.bb),children:l.jsx(je,{value:T,onChange:O,options:M,handlerSelected:N=>l.jsxs(k,{items:"center",gap:"xs",nowrap:!0,children:[l.jsxs("b",{children:[d.t("pageManager.page"),":"]}),N.icon&&nt(N.icon)&&l.jsx(Q,{icon:N.icon,size:oe.s2x}),l.jsx("span",{children:N.label})]})})}),l.jsxs(k,{col:!0,className:A(Hk,"gs-utl-gap-5 gs-utl-overflow-y-auto",s),nowrap:!0,children:[!!T&&l.jsxs(l.Fragment,{children:[l.jsx(Je,{size:i,value:g.name,onChange:N=>C({name:N}),label:y("name.label"),description:y("name.description"),required:!0}),!P&&l.jsx(Je,{size:i,value:g.slug,onChange:N=>C({slug:_?Gx(N,["id"]):mc(N)}),label:y("slug.label"),description:y("slug.description"),required:!0})]}),l.jsx(Je,{size:i,value:g.title,onChange:N=>C({title:N}),label:y("title.label"),description:y("title.description")}),l.jsx(Wm,{size:i,value:g.description,onChange:N=>C({description:N}),label:y("description.label"),description:y("description.description")}),l.jsx(pa,{size:i,clear:E,value:g.favicon,onChange:N=>C({favicon:N}),onOpen:()=>{w.Assets.open({select(N){C({favicon:N.getSrc()}),w.Assets.close()}})},label:y("favicon.label"),description:y("favicon.description")}),l.jsx(Je,{size:i,value:g.keywords,onChange:N=>C({keywords:N}),label:y("keywords.label"),description:y("keywords.description")}),l.jsx(Je,{size:i,value:g.socialTitle,onChange:N=>C({socialTitle:N}),label:y("socialTitle.label"),description:y("socialTitle.description")}),l.jsx(pa,{size:i,clear:E,value:g.socialImage,onChange:N=>C({socialImage:N}),onOpen:()=>{w.Assets.open({select(N){C({socialImage:N.getSrc()}),w.Assets.close()}})},label:y("socialImage.label"),description:y("socialImage.description")}),l.jsx(Wm,{size:i,value:g.socialDescription,onChange:N=>C({socialDescription:N}),label:y("socialDescription.label"),description:y("socialDescription.description")}),l.jsx(Xs,{language:"html",defaultValue:g.customCodeHead,onChange:N=>C({customCodeHead:N}),label:y("customCodeHead.label"),description:y("customCodeHead.description"),...S},`head-${T}`),l.jsx(Xs,{language:"html",defaultValue:g.customCodeBody,onChange:N=>C({customCodeBody:N}),label:y("customCodeBody.label"),description:y("customCodeBody.description"),...S},`body-${T}`),u.sdkShowProjectFonts&&!T&&l.jsx(Rk,{})]}),l.jsx(k,{className:A(Dk,"gs-utl-mt-auto",r,B.br,X.bt),children:l.jsx(Ge,{type:"submit",variant:"pr",size:"m2",full:!0,children:b})})]})})}),Bk="gs-panel-page-settings",zk=f.memo(ae(function({className:t,page:n,...s}){return l.jsx(rs,{className:A(Bk,"gs-utl-overflow-hidden",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...s,children:l.jsx(Ba,{children:l.jsx(Fk,{className:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),page:n,size:Cf.s,classNameHeader:we.s,classNameContent:we.s,classNameFooter:we.s})})})})),jl="gs-page-item",qm=ae(function({page:t,rename:n,setRename:s,commandItems:r}){const o=me(),i=Ae(),a=o.editor,{Pages:c}=a,u=o.sdkPagesConfig,d=u==null?void 0:u.settings,p=u==null?void 0:u.showHomeIcon,h=u==null?void 0:u.layoutBefore,g=j=>i.t(`pageManager.${j}`),m=j=>c.select(j),b=j=>c.getSelected()===j,v=j=>j===n,x=b(t),y=j=>j.getName()||j.getId(),w=j=>{n==null||n.set({name:j}),s(void 0)},S=ie("group-hover:gs-utl-opacity-100 opacity-0 cursor-pointer transition-opacity"),C=()=>a.runCommand(se.setPageSettings,{page:t,isOpen:!0});return l.jsxs(k,{gap:"s",items:"center",onClick:()=>m(t),className:ie([jl,"group cursor-default",we.xy,x?B.bgH:B.hBgH2]),children:[p&&yf(t)&&l.jsx(V,{className:`${jl}__icon-home`,title:g("homePage"),children:l.jsx(Q,{icon:U.home,size:oe.s3x})}),h&&Pt(h({page:t,editor:a,isSelected:x})),l.jsx(V,{className:ie(`${jl}__name truncate`),grow:!0,children:v(t)?l.jsx(Bf,{value:y(t),onChange:w}):l.jsx(l.Fragment,{children:y(t)})}),l.jsxs(k,{className:`${jl}__actions`,gap:"xs",onClick:ao,items:"center",children:[!n&&d!==!1&&l.jsx(ft,{className:S,size:"xs",border:!1,title:g("settings.label"),onClick:C,block:!0,children:l.jsx(Q,{icon:U.cog,size:oe.s3x})}),x&&!!r.length&&l.jsx(ss,{placement:"right-start",handler:l.jsx(Q,{icon:U.dotsVertical,size:oe.s}),title:!1,padding:!1,fixed:!0,overlay:!0,children:({close:j})=>r.map(E=>l.jsx(hi,{icon:E.icon,label:Ke(E.label)?E.label({editor:a}):E.label,action:()=>{var T;j(),(T=E.cmd)==null||T.call(E,{page:t,editor:a})}},E.id))})]})]},t.getId())});function Uk({dragging:e,dragRect:t}){const n=!!(e&&t),s=n?{top:t.y,left:0,marginLeft:0}:{};return{showIndicator:n,indicatorStyle:s}}var Dy=(e=>(e.horizontal="horizontal",e.vertical="vertical",e))(Dy||{});const ad="gs-cmp-sortable",Km=3;function Wk({items:e,direction:t,onDrop:n,renderItem:s}){const[r,o]=f.useState(null),[i,a]=f.useState(-1),[c,u]=f.useState(),[d,p]=f.useState(!1),h=f.useRef(null),{showIndicator:g,indicatorStyle:m}=Uk({dragging:!!r&&d,dragRect:c}),b=f.useMemo(()=>[],[e]);f.useEffect(()=>{const E=window.document,T=O=>O.key==="Escape"&&y(O);return E.addEventListener("keydown",T),()=>E.removeEventListener("keydown",T)},[]);const v=E=>T=>{T.button===0&&(h.current={x:T.clientX,y:T.clientY},o(E),p(!1),T.target.setPointerCapture(T.pointerId))},x=E=>{const T=h.current;if(!r||!T)return;if(!d){const N=Math.abs(E.clientX-T.x),H=Math.abs(E.clientY-T.y);(t==="vertical"?H>Km:N>Km)&&p(!0);return}const O=E.clientY;let P=-1;b.forEach((N,H)=>{const L=N.getBoundingClientRect();O>L.top+L.height/2&&(P=H)});const _=e.findIndex(N=>N.id===r.id);P<_&&(P+=1),P=Math.min(P,e.length-1),a(P);const M=b[P];if(M){const{height:N,top:H}=M.getBoundingClientRect(),L=O<H+N/2;u({y:M.offsetTop+(L?0:N),h:N})}},y=E=>{o(null),p(!1),h.current=null,u(void 0);const T=E.target,{pointerId:O}=E;O&&(T==null||T.releasePointerCapture(O))},w=E=>{!r||!h.current||(c&&i!==-1&&(n==null||n(r,i)),y(E))},S=A(ad,"gs-utl-relative"),C=A(`${ad}__indicator`,B.cmp,"gs-utl-absolute gs-utl-w-full gs-utl-h-0.5"),j=E=>A(`${ad}__item`,g&&(r==null?void 0:r.id)===E.id&&"gs-utl-opacity-50 gs-utl-select-none");return l.jsxs(l.Fragment,{children:[l.jsx(k,{col:t==="vertical",className:S,children:e.map((E,T)=>l.jsx(V,{ref:O=>{O&&(b[T]=O)},className:j(E),onPointerDown:v(E),onPointerMove:x,onPointerUp:w,children:s(E)},E.id))}),g&&l.jsx("div",{className:C,style:m})]})}const Gk=({pages:e,commandItems:t,rename:n,setRename:s,editor:r})=>{if(!r.Pages.move)return e.map(c=>l.jsx(qm,{page:c,commandItems:t,rename:n,setRename:s},c.getId()));const o=(c,u)=>{r.Pages.move(c.entity,{at:u})},i=c=>l.jsx(qm,{page:c.entity,commandItems:t,rename:n,setRename:s},c.id),a=e.map(c=>({id:c.getId(),entity:c}));return l.jsx(Wk,{items:a,direction:Dy.vertical,onDrop:o,renderItem:i})},qk=({items:e,editor:t,sdkPageConfig:n})=>{const s=n==null?void 0:n.commandItems;return s===!1?[]:Ke(s)?s({items:e,editor:t}):s||e},ld="gs-panel-page-manager",Fy=ae(function({pages:t,select:n,add:s,remove:r,header:o,resizable:i={bottom:!0},height:a=200}){const c=me(),u=di(),d=Ae(),{sdkPagesConfig:p}=c,h=c.editor,[g,m]=f.useState(),b=M=>d.t(`pageManager.${M}`),v=p==null?void 0:p.add,x=p==null?void 0:p.duplicate,y=p==null?void 0:p.remove,w=M=>{ao(M);const N=L=>{const F=t.length+1;return s({name:`${b("page")} ${F}`,component:`<div>${b("newPage")} ${F}</div>`,...L},{select:!0})};if(v)return v({event:M,editor:h,rename:m,addPage:N});const H=N();H&&m(H)},S=({page:M})=>{if(y)return y({editor:h,page:M});u.confirm({title:b("deletePage"),content:b("confirmDelete"),confirmButton:{variant:"danger",children:b("deletePage")},onConfirm:()=>{const N=t.indexOf(M),H=t[N+1]||t[0];n(H),r(M)}})},C=({page:M})=>{if(x)return x({editor:h,page:M,rename:m});const N=M.getMainComponent(),H=s({name:`${M.getName()} (${b("copy")})`,component:N.clone()},{select:!0});H&&m(H)},j=[{id:"rename",label:b("rename"),icon:U.pencil,cmd:({page:M})=>m(M)},x!==!1&&{id:"duplicate",label:b("duplicate"),icon:U.contentCopy,cmd:C},t.length>1&&y!==!1&&{id:"remove",label:b("delete"),icon:U.delete,cmd:S}].filter(Boolean),E=qk({items:j,editor:h,sdkPageConfig:p}),T=iy(o,{collapsible:!0,label:b("pages"),icon:U.textBoxMultiple}),O=i?i===!0?{top:!0,right:!0,bottom:!0,left:!0}:i:void 0,P=l.jsx(Gk,{pages:t,commandItems:E,rename:g,setRename:m,editor:h}),_=O?l.jsx(tu,{className:K([`${ld}__content`,"text-sm overflow-auto",X.bt,B.br]),height:a,...O,children:P}):P;return l.jsx(Js,{classNameWrap:ld,className:K(`${ld}__header`,we.xy,o===!1&&"gs-utl-hidden"),disabled:T&&T.collapsible===!1,handler:l.jsxs(k,{space:"s",items:"center",children:[!!T.icon&&l.jsx(V,{children:l.jsx(Q,{icon:T.icon,size:oe.s})}),l.jsx(V,{grow:!0,children:T.label}),v!==!1&&l.jsx($t,{title:b("add"),children:l.jsx(k,{onClick:w,className:K("cursor-pointer"),children:l.jsx(Q,{icon:U.plus,size:oe.s})})})]}),open:T?T.collapsed!==!0:!0,children:_})}),By=f.forwardRef(function({children:t,className:n,...s},r){return l.jsx("div",{className:A(ie("gs-page-manager-after"),n),ref:r,...s,children:t})}),zy=f.forwardRef(function({children:t,className:n,...s},r){return l.jsx("div",{className:A(ie("gs-page-manager-before"),n),ref:r,...s,children:t})}),Kk="gs-panel-pages",Uy=f.memo(ae(function({className:t,header:n,height:s,resizable:r,...o}){const i=me().sdkProps.children;return l.jsx(dn,{className:A(Kk,t),...o,children:l.jsx(S0,{children:a=>l.jsxs(l.Fragment,{children:[$n(i,zy),l.jsx(Fy,{header:n,height:s,resizable:r,...a}),$n(i,By)]})})})})),Zk="gs-panel-pages-layers",Yk=f.memo(ae(function({className:t,panelPagesProps:n,panelLayersProps:s,...r}){const{showPages:o}=me(),i=Ae(),{className:a,...c}=n||{},u=iy(s==null?void 0:s.header,{icon:U.layers,collapsible:!1,label:i.t("layerManager.layers"),className:A(X.bb,B.br)});return l.jsxs(rs,{className:A(Zk,"gs-utl-flex gs-utl-flex-col gs-utl-h-full",t),...r,children:[o&&l.jsx(Uy,{className:A(a,X.bb,B.br),...c}),l.jsx(yy,{...s,header:u})]})})),Xk="gs-trait-custom",Jk=ae(function(t){const{trait:n,editor:s,value:r,disabled:o,labelAs:i,className:a}=t,[,c]=f.useState(0),u=f.useRef(null),d=n.get("component"),p=n.get("render"),h=n.target,g=u.current;if(f.useEffect(()=>{if(h){let v=()=>{},x=()=>{};const y=()=>{x(),c(w=>++w)};if(h.on("change",y),!d&&p&&g){const w=j=>g.appendChild(j),S=j=>g.removeChild(j),C=p({editor:s,component:h,trait:n,addEl:w,removeEl:S,onUpdate:j=>{x=j}});C instanceof HTMLElement?(w(C),v=()=>S(C)):Ke(C)&&(v=()=>C())}return()=>{h.off("change",y),v()}}},[h,g,r]),!h)return null;const m=Vr({...t,className:A(Xk,a)}),b={trait:n,component:h,editor:s,value:r,disabled:o};return l.jsxs("div",{...m,children:[l.jsx(ns,{...t,as:i}),l.jsx("div",{className:A(o&&"gs-utl-pointer-events-none opacity-50"),children:d?l.jsx(d,{...b}):p?l.jsx("div",{ref:u}):null})]})});function Wy({className:e,options:t,value:n,name:s,label:r,border:o,hideCaret:i,size:a="s",autoFocus:c,open:u,allowNew:d,onChange:p,onBlur:h,placeholder:g}){const[m,b]=f.useState(null),[v,x]=f.useState(null),{styles:y,attributes:w}=$a(m,v,Ef),[S,C]=f.useState(""),j=Da(),E=S===""?t:t.filter(H=>H.label.toLowerCase().includes(S.toLowerCase())),T=H=>C(H.target.value),O=H=>H==null?void 0:H.label,P=d&&S.length>0&&!E.some(H=>H.label===S),_=Ke(d)?d(S):d,M={minWidth:`${m==null?void 0:m.offsetWidth}px`,maxHeight:200},N=()=>h==null?void 0:h();return l.jsxs("div",{className:K("w-full",e),children:[!!r&&l.jsx(_r,{size:a,children:r}),l.jsxs(Lo,{value:n,onChange:p,name:s,nullable:!0,children:[l.jsx(Vy,{size:a,ref:b,border:o,children:l.jsxs(k,{nowrap:!0,children:[l.jsx(Lo.Input,{autoFocus:c,className:j,displayValue:O,onChange:T,onBlur:N,placeholder:g}),!i&&l.jsx(Lo.Button,{children:l.jsx(Q,{icon:U.chevronDown,size:oe.sx})})]})}),l.jsx(Lo.Options,{static:u,className:m0,ref:x,style:y.popper,...w.popper,children:l.jsxs(Dn,{className:K("h-full"),padding:!1,style:M,children:[P&&l.jsx(Lo.Option,{value:{id:null,label:S},children:({active:H})=>l.jsx($g,{option:{id:null,label:_},active:H,selected:n})}),!P&&E.length===0&&l.jsx("div",{className:K(we.xy),children:"No items found"}),E.map(H=>l.jsx(Lo.Option,{value:H,children:({active:L})=>l.jsx($g,{option:H,active:L,selected:n})},H.id))]})})]})]})}const Qk=(e,t)=>{const n=`${Rc}${t}`,s=e.get(n,{skipResolve:!0});return s?Gy(s):e.get(n)||""};function Gy(e){return`${e.collectionId}.${e.variableType}.${e.path}`}const e8=({page:e,component:t})=>{const{DataSources:n,I18n:s}=e.em,r=["prevItem","currentItem","nextItem"],o=Ic(e)||"",i=Object.values((t==null?void 0:t.collectionsStateMap)||{}).map(u=>{const d=u;return r.map(p=>{if(d!=null&&d[p]){const{collectionId:h}=d,g=s.t(`dataSources.collections.${h}`)||h,m=s.t(`dataSources.variableTypes.${p}`)||p,b={collectionId:h,path:"id",type:n.dataComponentTypes.variable,variableType:p};return{id:Gy(b),label:`${g} > ${m}`,dataVariable:b}}}).filter(Boolean)}).flat().filter(Boolean),a=n.get(o),c=a==null?void 0:a.getRecords().map(u=>({id:u.id,label:u.get("title")||u.get("name")||u.id}));return[...i,...c]},qy="#",Fl="mailto:",cd="subject=",fp="tel:",Ky="hrefType",Zm="showIdList",Ym=(e,t)=>{const n=t==null?void 0:t.get(Ky);return n||(e.startsWith(fp)?"phone":e.startsWith(Fl)?"email":e.startsWith(ia)?"pages":e.startsWith(qy)?"elements":"url")},Xm=e=>`${e.getName()} - #${e.getId()}`,t8="gs-trait-href",n8=ae(function(t){const{trait:n,value:s,disabled:r,labelAs:o,className:i}=t,a=n.component,c=me(),{isSelectingTarget:u,editor:d}=c,[,p]=f.useState(0),[h,g]=f.useState(""),[m,b]=f.useState(""),[v,x]=f.useState(""),[y,w]=f.useState([]),S=Ae(),C=d==null?void 0:d.Pages.getAll(),j=S.tScoped("traitManager.traits.labels"),E=()=>p(ee=>++ee),T=a.get(Zm)??!1,O=Ym(s,a),P=O==="pages"?s==null?void 0:s.replace(ia,""):"",_=!!P&&(d==null?void 0:d.Pages.get(P)),M=_?Vc(_):!1,N=f.useMemo(()=>!M||!_||!d?[]:e8({page:_,component:a}),[d,_,M,a]),H=ee=>{n.setValue(ee)},L=ee=>{a.set({[Zm]:ee}),E()},F=ee=>{g(""),b(""),x(""),H(""),a.set({[Ky]:ee}),E()},G=ee=>{H(ee),E()},D=(ee,te)=>{j3(a,"id",(te==null?void 0:te.dataVariable)||ee),E()},$=ee=>{ee&&(H(ee.id),E())},I=ee=>{H(`${fp}${ee}`),x(ee)},R=ee=>{H(`${Fl}${ee}${m?`?${cd}${m}`:""}`),g(ee)},z=ee=>{H(`${Fl}${h}${ee?`?${cd}${ee}`:""}`),b(ee)},Y=()=>{c.setSelectingTarget(!u)},Z=ee=>{const te=ee.replace(qy,""),q=d==null?void 0:d.Components.componentsById[te];return{id:ee,label:q?Xm(q):ee}};f.useEffect(()=>{var te;const ee=[];if(T){const q=["path","br","b","u","i","strike"],ne=(te=d==null?void 0:d.Pages.getSelected())==null?void 0:te.getMainComponent();ne==null||ne.forEachChild(ce=>{!ce.is("comment")&&!ce.is("textnode")&&!q.includes(ce.get("tagName"))&&ee.push({id:`#${ce.getId()}`,label:Xm(ce)})})}w(ee)},[d,T]),f.useEffect(()=>{let ee=()=>{};const te=()=>{ee(),!(d!=null&&d.em.destroyed)&&(d==null||d.stopCommand(hc))};return u&&(ee=_x(te),d==null||d.runCommand(hc,{onSelect:q=>H(`#${q.getId()}`)})),te},[d,u]),f.useEffect(()=>{if(!s)return;switch(Ym(s,a)){case"phone":x(s.replace(fp,""));break;case"email":{const[te,q=""]=s.replace(Fl,"").split("?");g(te),b(q.replace(cd,""));break}}},[s]);const J=Vr({className:A(t8,i)});return l.jsxs("div",{...J,children:[l.jsx(ns,{...t,as:o}),l.jsx("div",{className:A(r&&"gs-utl-pointer-events-none opacity-50"),children:l.jsx(Dr,{onChange:F,classNamePanel:"gs-utl-p-1",value:O,tabs:[{id:"url",label:l.jsx(Q,{icon:U.link,size:oe.s}),content:l.jsx(Je,{placeholder:"eg. https://google.com",value:s,label:"URL",onChange:H,size:"s",type:"url"})},{id:"pages",label:l.jsx(Q,{icon:U.textBoxMultiple,size:oe.s}),content:l.jsxs(k,{gap:"s",col:!0,children:[l.jsx(je,{size:"s",options:(C||[]).map(ee=>({id:`${ia}${ee.getId()}`,icon:Mv(ee),label:ee.getName()})),value:s,onChange:G,label:"Page"}),M&&l.jsx(je,{size:"s",options:N,value:Qk(a,"id"),onChange:D,label:S.t("dataSources.collectionItem")})]})},{id:"elements",label:l.jsx(Q,{icon:U.viewDayOutline,size:oe.s}),content:l.jsxs(k,{gap:"s",col:!0,children:[l.jsx(_r,{size:"s",children:"Element ID"}),l.jsxs(k,{gap:"xs",nowrap:!0,children:[T?l.jsx(Wy,{options:y,onChange:$,value:Z(s),placeholder:S.t("selectList")}):l.jsx(Je,{size:"s",placeholder:"eg. #my-element-in-page",value:s,onChange:H,className:"gs-utl-flex-1"}),l.jsx(ft,{title:S.t("selectTarget"),size:"m2",active:u,onClick:Y,className:"gs-utl-h-[30px]",children:l.jsx(Q,{icon:U.target,size:oe.sx})})]}),l.jsx(ca,{value:T,onChange:L,label:j("showList")})]})},{id:"email",label:l.jsx(Q,{icon:U.email,size:oe.s}),content:l.jsxs(k,{gap:"s",col:!0,children:[l.jsx(Je,{placeholder:"eg. mail@gmail.com",value:h,onChange:R,size:"s",label:"Email",type:"email"}),l.jsx(Je,{placeholder:"eg. My subject",value:m,onChange:z,label:"Subject",size:"s"})]})},{id:"phone",label:l.jsx(Q,{icon:U.phone,size:oe.s}),content:l.jsx(Je,{size:"s",type:"tel",label:"Phone",placeholder:"eg. +55123456789",value:v,onChange:I})}]})})]})});function s8({trait:e,value:t,disabled:n,label:s,labelAs:r}){const[o,i]=f.useState(),a=e.get("properties"),c=e.get("addItem"),u=e.get("labelItem"),d=t||[],p=d.findIndex(h=>h.id===(o==null?void 0:o.id));return l.jsx(gs,{items:d,selected:p>-1?o:null,select:i,disabled:n,label:s,labelAs:r,add:()=>{const h=d.length+1,g=c?c(h):{id:`opt${h}`,label:`New option ${h}`};e.setValue([...d,g])},move:(h,g)=>{const m=e.getValue().filter(b=>b.id!==h.id);m.splice(g,0,h),e.setValue(m)},remove:h=>{const g=e.getValue().filter(m=>m.id!==h.id);e.setValue(g,{removed:h})},renderItem:h=>u?u(h):h.label,children:l.jsx(k,{space:"m",col:!0,children:!!o&&a.map(h=>{const{name:g,getValue:m}=h,b=h.setValue,v=h.label||g,x=d[p];if(!x)return null;const y=x[g],w=m?m(y):y,S=j=>{const E={...x};x[g]=b?b(j,w):j,e.setValue([...d],{item:x,previous:E}),g==="id"&&i(x)};let C=l.jsx(Je,{label:v,value:w,onChange:S});switch(h.type){case"select":C=l.jsx(je,{label:v,options:h.options,value:w,onChange:S})}return l.jsx(f.Fragment,{children:C},g)})})})}const r8="gs-trait-custom-type",o8=ae(function({trait:t,editor:n}){const s=f.useRef(null),r=t.getType(),o=t.target,{Traits:i}=n,a=i.getType(r),c=!!(o&&a);return f.useEffect(()=>{const u=s.current;if(a&&u&&o){const d=new a({model:t,config:i.getConfig(),attributes:t.get("attributes")}),p=d.render().el;return u.appendChild(p),d.listenTo(o,"change",()=>d.postUpdate()),()=>{u.removeChild(p),d.removeView()}}},[o,a,t]),c&&l.jsx("div",{className:r8,ref:s})}),i8=e=>{const{value:t={},onConfirm:n,additionalSources:s,editor:r}=e;if(!r)return;const o="DataValuePicker",i={id:o,header:!1,layout:{type:"panelDataValuePicker",value:t,onConfirm:({value:a})=>{n==null||n(a),r.runCommand(se.layoutRemove,{id:o})},additionalSources:s},placer:{type:"dialog",size:"l"}};r.runCommand(se.layoutToggle,{...i})};function Zy(e){const{initialDataValue:t,handleDataValueChange:n,handleValueClear:s,editor:r,additionalSources:o,enableDataValue:i,hasDataResolverValue:a}=e;if(!r||!i)return[];const c={type:"button",className:a?B.tAo:"",variant:"out-clear",size:"x2s",block:!0,border:!1},u=[{...c,title:r.I18n.t("dataSources.connectDataValue"),icon:{icon:U.databaseOutline,size:oe.s2x},onClick:()=>i8({value:t,onConfirm:n,additionalSources:o,editor:r})}];return a&&u.push({...c,title:r.I18n.t("dataSources.clearDataValue"),icon:{icon:U.close,size:oe.s2x},onClick:s}),u}function a8(e,t){const n=e.em.getEditor(),s=e.target;let r=!1;t===!0?r=!0:tr(t)&&Ke(t.enable)&&(r=t.enable({trait:e,component:s,editor:n}));const o=e.getValue({skipResolve:!0}),i=s.collectionsStateMap,a=Ar(o);return{hasDataResolverValue:a,dataResolverValue:a?e.getValue():void 0,enableDataValue:r,initialDataValue:o,handleDataValueChange:c=>e.setValue(c),handleValueClear:()=>{const c=e.getValue();e.setValue(""),e.setValue(c)},editor:n,additionalSources:i}}const l8=({label:e,buttons:t})=>l.jsxs(k,{items:"center",nowrap:!0,full:!0,children:[l.jsx(V,{grow:!0,children:e}),l.jsx(k,{nowrap:!0,items:"center",justify:"end",gap:"x2s",children:t.map((n,s)=>l.jsx(ft,{...n},s))})]}),Yy=e=>vs((e||"").replace(/-/g," ")),c8=(e,t)=>({size:"s",tip:e.get("tip"),type:e.getType(),value:e.getValue(),label:e.get("label")!==!1&&Yy(e.getLabel({locale:!0})),placeholder:(t==null?void 0:t.t(`traitManager.traits.attributes.${e.getId()}.placeholder`))||e.get("placeholder")||"",onChange:(n,s)=>e.setValue(n,{partial:s})}),os=(e,t,n)=>{const s=a8(e,n.traitManagerDataConfig),r=Zy(s),{hasDataResolverValue:o,dataResolverValue:i}=s,a=c8(e,t);return{...a,value:i??a.value,disabled:o,labelAs:r.length?"span":void 0,label:l.jsx(l8,{label:a.label,buttons:r})}},Jm=(e,t,n)=>os(e,t,n),u8=(e,t,n)=>os(e,t,n),d8=(e,t,n)=>{const s=Ar(e.getValue({skipResolve:!0})),r=os(e,t,n),o={min:e.get("min"),max:e.get("max"),step:e.get("step"),pan:!s,units:s?[]:e.get("units"),onChange:(i,a)=>{const c=a||isNaN(parseFloat(i))?i:parseFloat(i);e.setValue(c,{partial:a})}};return{...r,...o}},Xy=(e,t,n)=>{const s=e.get("labelToTitle"),r=Ar(e.getValue({skipResolve:!0})),o=os(e,t,n),i={options:e.getOptions().map(a=>{const c=a.labelReact||a.name||a.label||a.value;return nt(a)?{id:a,label:a}:{id:a.id||a.value,title:s?c:a.title,icon:a.icon,label:s?"":c}}),onChange:a=>e.setValue(a),emptyState:r&&e.getValue()||void 0,hideCaret:r};return{...o,...i}},p8=(e,t,n)=>{const{options:s,onChange:r}=Xy(e,t,n),o={options:s,onChange:r};return{...os(e,t,n),...o}},f8=(e,t,n)=>{const s=e.get("typeProps")||{},r=Ar(e.getValue({skipResolve:!0}));return{...os(e,t,n),isContain:!0,hideButton:r,btnLabel:e.get("text"),onOpen(){if(r)return;const i=t==null?void 0:t.Assets;i==null||i.open({select(a){e.setValue(a.getSrc()),i.close()}})},...s}},h8=e=>({children:Yy(e.getLabel()||e.get("text")||e.get("labelButton")),onClick:()=>{const t=e.em.Editor,n=e.get("command");nt(n)?t.runCommand(n):n==null||n(t,e)},full:!0}),g8=(e,t,n)=>{const s=os(e,t,n),o={value:!!(s.disabled?s.value:e.getValue({useType:!0})),onChange:i=>e.setValue(i)};return{...s,...o}},m8=(e,t,n)=>{const s=os(e,t,n),r=e.get("typeProps")||{},o=Ar(e.getValue({skipResolve:!0}));return{language:"css",...r,...s,formatOnMount:!o,onChange:i=>e.setValue(i)}},b8=(e,t,n)=>({...os(e,t,n),trait:e}),v8=(e,t,n)=>({...os(e,t,n),trait:e}),y8=(e,t,n)=>({...os(e,t,n),trait:e,editor:t});function x8(e,t,n={}){var i;const s=e.get("visible"),r=e.getType(),o={traitManagerDataConfig:n.traitManagerDataConfig};if(Ke(s)&&s({component:e.target,trait:e})===!1)return null;switch(r){case"text":return l.jsx(Je,{...Jm(e,t,o)});case"select":return l.jsx(je,{...Xy(e,t,o)});case"number":return l.jsx(Te,{...d8(e,t,o)});case"color":return l.jsx(Qs,{...u8(e,t,o)});case"checkbox":return l.jsx(ca,{...g8(e,t,o)});case"button":return l.jsx(Ge,{...h8(e)});case"radio":return l.jsx(Wt,{...p8(e,t,o)});case"code":return l.jsx(Xs,{...m8(e,t,o),...n},((i=t==null?void 0:t.getSelected())==null?void 0:i.getId())||"");case"image":case"file":return l.jsx(pa,{...f8(e,t,o)});case"stack":return l.jsx(s8,{...b8(e,t,o)});case"href":return l.jsx(n8,{...v8(e,t,o)});case"custom":return l.jsx(Jk,{...y8(e,t,o)});default:return!!t.Traits.getType(r)?l.jsx(o8,{editor:t,trait:e}):l.jsx(Je,{...Jm(e,t,o)})}}const hp="gs-trait-manager",Qm=({trait:e,isDarkTheme:t,traitManagerDataConfig:n})=>l.jsx(V,{className:K(`${hp}-field gs-utl-mb-2 gs-utl-w-full`),children:x8(e,e.em.getEditor(),{isDarkTheme:t,traitManagerDataConfig:n})});function w8({traits:e,className:t}){var d,p;const n=Fa(),{isDarkTheme:s}=_s(),o=(d=me().sdkOptions.dataSources)==null?void 0:d.traitManager,i=n.Traits.getTraitsByCategory(e),a=(p=i.find(h=>!h.category))==null?void 0:p.items,c=i.filter(h=>h.category),u=K("gs-utl-text-center");return l.jsx(k,{className:K(hp,t),col:!0,children:n.getSelected()?e.length?l.jsxs(l.Fragment,{children:[a==null?void 0:a.map(h=>l.jsx(Qm,{trait:h,isDarkTheme:s,traitManagerDataConfig:o},h.id)),c.map(({category:h,items:g},m)=>l.jsx(Js,{open:!!(h!=null&&h.get("open")),onChange:({open:b})=>h==null?void 0:h.set({open:b}),handler:h==null?void 0:h.getLabel(),handlerIcon:h==null?void 0:h.get("icon"),classNameContent:"gs-utl-p-2",classNameWrap:`${hp}-category -gs-utl-mx-2`,className:b=>K($p.itemList({index:m+(a?1:0),open:b,length:c.length})),children:g.map(b=>l.jsx(Qm,{trait:b,isDarkTheme:s,traitManagerDataConfig:o},b.id))},h==null?void 0:h.id))]}):l.jsx(V,{className:u,children:"No properties available"}):l.jsx(V,{className:u,children:n.t("traitManager.empty")})})}const gp=ae(w8),S8="gs-panel-properties",C8=f.memo(ae(function({className:t,...n}){return l.jsx(rs,{className:A(S8,"gs-utl-overflow-auto gs-utl-h-full",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-auto"),...n,children:l.jsx(Yd,{children:s=>l.jsx(gp,{...s})})})})),j8=async({html:e="",css:t="",el:n})=>{const s=`<span style="color: initial; display: inline-block;"><style> body { margin: 0; } ${t}</style>${e}</span>`,r={};if(document.body.attachShadow){const o=n.shadowRoot||n.attachShadow({mode:"open"});o.innerHTML=s}return r},E8=ae(function({rule:t,onSelect:n,onRemove:s,className:r}){const o=f.useRef(null),a=me().editor,c=Ae(),u=t.getDevice(),d=t.getState(),{isDarkTheme:p}=_s(),[h,g]=f.useState(t.toCSS({allowEmpty:!0})),[m,b]=f.useState(h),v=t.selectorsToString(),x=()=>{a.select(),setTimeout(()=>a.Selectors.select(t)),n==null||n()},y=()=>{a.Css.remove(t),s==null||s()},w=()=>{if(m){const S=a.Parser.parseCss(m)[0];S&&(t.setStyle(S.style),g(m))}};return f.useEffect(()=>{if(o.current){const S=o.current;j8({el:S,html:'<div class="prv-rule">Preview</div>',css:`
392
338
  .prv-rule {
393
339
  background-color: #fff;
394
340
  padding: 5px;
395
341
  }
396
- .prv-rule, ${p}
397
- `})}},[o,p]),c.jsx(Xn,{padding:!1,className:ue("overflow-hidden max-w-full group",r),children:c.jsxs(k,{col:!0,space:"xs",children:[c.jsx(k,{className:ue("bg-checker gjs-p-3 overflow-auto overflow-x-hidden h-20"),justify:"center",items:"center",children:c.jsx("div",{ref:o,className:ue("relative flex items-center justify-center")})}),c.jsxs(k,{className:ue("gjs-p-1 w-full"),col:!0,space:"s",children:[c.jsxs(k,{nowrap:!0,items:"center",space:"xs",full:!0,children:[c.jsx(D,{grow:!0,children:c.jsx("pre",{className:ue("text-xs bg-white/10",z.txt,re.rnd,je.xyS),children:v})}),!!u&&u.getWidthMedia()&&c.jsx(D,{children:c.jsx(It,{title:c.jsxs(c.Fragment,{children:[l.t("deviceManager.device"),": ",c.jsx("b",{children:u.getName()})]}),children:c.jsx(oe,{icon:Z.cellphoneLink,size:le.sx})})}),!!d&&c.jsx(D,{children:c.jsx(It,{title:c.jsxs(c.Fragment,{children:[l.t("selectorManager.state"),": ",c.jsx("b",{children:d.getLabel()})]}),children:c.jsx(oe,{icon:Z.flare,size:le.sx})})})]}),c.jsxs(k,{nowrap:!0,className:ue(Ee.txtEllips),space:"s",children:[c.jsx(D,{className:ue("group-hover:gs-utl-opacity-100 opacity-0 transition-opacity"),grow:!0,children:c.jsx(Ke,{onClick:x,className:ue("text-sm gjs-mr-auto"),size:"m2",full:!0,children:l.t("select")})}),c.jsx(ps,{overlay:!0,title:!1,padding:!1,buttonAs:"span",handler:c.jsx(bt,{title:l.t("selectorManager.showCSS"),children:c.jsx(oe,{icon:Z.codeBraces,size:le.sx})}),children:({close:S})=>c.jsxs(k,{className:ue("relative w-80 h-48"),col:!0,children:[c.jsx(D,{grow:!0,children:c.jsx(ir,{defaultValue:Kp(p),onChange:b,language:"css",padding:5,isDarkTheme:f,clean:!0})}),c.jsx(Ke,{className:ue("absolute right-2 bottom-2 text-sm"),variant:"pr",size:"m2",onClick:()=>{w(),S()},children:l.t("update")})]})}),c.jsx(fu,{onConfirm:y,className:ue("w-48"),children:c.jsx(bt,{title:l.t("selectorManager.deleteStyle"),children:c.jsx(oe,{icon:Z.delete,size:le.sx})})})]})]})]},t.cid)})}),w8=fe(function(){const[t]=Bp(),n=ji(),s=Re(),[r,o]=h.useState(""),[i,a]=h.useState(""),u=ye().editor,[d,f]=h.useState(u.Css.getRules("")),p=u.Devices.getDevices().map(b=>({id:b.id,label:b.getName()})),g=d.filter(b=>{var v;return!(r&&!ni(b.selectorsToString(),r)||i&&((v=b.getDevice())==null?void 0:v.id)!==i)}),m=()=>f(u.Css.getRules(""));return c.jsxs(k,{col:!0,space:"m",children:[c.jsxs(k,{items:"center",space:"m",children:[c.jsx(D,{children:c.jsx(tt,{size:"s",type:"search",value:r,onInput:o,placeholder:`${s.t("selectorManager.searchStyle")}...`})}),c.jsx(D,{children:c.jsx(_e,{includeEmpty:!0,size:"s",value:i,options:p,onChange:a,emptyState:s.t("deviceManager.allDevices"),handlerSelected:b=>c.jsxs(k,{space:"s",items:"center",children:[c.jsx(oe,{icon:Z.cellphoneLink,size:le.sx}),c.jsx("span",{children:b.label})]})})})]}),c.jsx(D,{className:ue("gs-utl-h-[75vh] w-full overflow-auto"),children:g.length?c.jsx(du,{data:g,listClassName:ue("grid grid-cols-4 gap-2 gjs-pr-2"),itemContent:(b,v)=>c.jsx(x8,{rule:v,onRemove:m,onSelect:n.close},v.cid)},t):c.jsx(k,{justify:"center",children:s.t("modals.styleCatalog.noStyles")})})]})}),S8=fe(function({selector:t,className:n,removable:s,toggleable:r}){const o=Re(),i=ye(),[a,l]=h.useState(),[u,d]=h.useState(t.getActive()),f=i.editor,{Selectors:p}=f,g=t.getLabel(),m=c.jsx(oe,{icon:Z.dotsVertical,size:le.sx}),b=()=>{p.removeSelected(t)},v=j=>{a&&p.rename(a,j),l(void 0)},x=()=>{p.duplicateSelected(t)},y=()=>{const j=!t.getActive();d(j),t.setActive(j)},S=[{id:"rename",label:o.t("rename"),action:()=>l(t)},{id:"duplicate",label:o.t("duplicate"),action:x},s&&{id:"delete",label:o.t("delete"),action:b},r&&{id:"active",label:o.t(u?"disable":"enable"),action:y}].filter(Boolean),C=(j,E)=>_=>{j(),Ye(E)&&E(_)};return c.jsx(Rr,{className:ue(["gjs-ml-1 gjs-my-1 group overflow-hidden cursor-default relative",z.sel,n]),s:"s",children:c.jsxs(k,{items:"center",children:[c.jsx(D,{className:ue("gjs-mr-4",!a&&!u&&"opacity-50 line-through"),children:c.jsx(zy,{value:g,onChange:v,active:!!a,unstyled:!0})}),c.jsx(k,{className:ue("absolute h-full right-0 transition-opacity",z.sel,z.selBr,re.bl),children:c.jsx(ps,{handler:m,title:!1,padding:!1,fixed:!0,overlay:!0,children:({close:j})=>S.map(E=>c.jsx(_i,{className:ue(z.txt),label:E.label,action:C(j,E.action)},E.id))})})]})})}),C8=e=>(e==null?void 0:e.get("groups"))||[],j8=/^\.[a-zA-Z_][\w-]*$/;function E8(e,t={}){const n=e.Css.getAll().filter(s=>C8(s).some(r=>r.startsWith(ko.globalStyles)));return t.withSingleClass?n.filter(s=>j8.test(s.getSelectorsString())):n}const P8=e=>{const{Selectors:t}=e,n=t.getAll({array:!0});return t.getSelectedAll().reduce((o,i)=>{const a=o.indexOf(i);return a>=0&&o.splice(a,1),o},n).filter(o=>o.isClass())},_8=(e,t)=>{const{sdkGlobalStylesConfig:n}=t,{i18nStore:s}=t.store,o=(n!=null&&n.showInClassSelectors?E8(e,{withSingleClass:!0}):[]).map(a=>{const l=a.getSelectorsString().replace(".","");return{id:l,label:`${s.t("globalStyleManager.globalStyles")}: ${l}`}});return[...P8(e).map(a=>({id:a,label:a.getLabel()})),...o]},T8=e=>{var s,r;let t=(s=e==null?void 0:e.selectorsToString)==null?void 0:s.call(e);const n=(r=e==null?void 0:e.getAtRule)==null?void 0:r.call(e);return t&&n&&(t=`${n} {
342
+ .prv-rule, ${h}
343
+ `})}},[o,h]),l.jsx(Dn,{padding:!1,className:ie("overflow-hidden max-w-full group",r),children:l.jsxs(k,{col:!0,space:"xs",children:[l.jsx(k,{className:ie("bg-checker gjs-p-3 overflow-auto overflow-x-hidden h-20"),justify:"center",items:"center",children:l.jsx("div",{ref:o,className:ie("relative flex items-center justify-center")})}),l.jsxs(k,{className:ie("gjs-p-1 w-full"),col:!0,space:"s",children:[l.jsxs(k,{nowrap:!0,items:"center",space:"xs",full:!0,children:[l.jsx(V,{grow:!0,children:l.jsx("pre",{className:ie("text-xs bg-white/10",B.txt,X.rnd,we.xyS),children:v})}),!!u&&u.getWidthMedia()&&l.jsx(V,{children:l.jsx($t,{title:l.jsxs(l.Fragment,{children:[c.t("deviceManager.device"),": ",l.jsx("b",{children:u.getName()})]}),children:l.jsx(Q,{icon:U.cellphoneLink,size:oe.sx})})}),!!d&&l.jsx(V,{children:l.jsx($t,{title:l.jsxs(l.Fragment,{children:[c.t("selectorManager.state"),": ",l.jsx("b",{children:d.getLabel()})]}),children:l.jsx(Q,{icon:U.flare,size:oe.sx})})})]}),l.jsxs(k,{nowrap:!0,className:ie(Se.txtEllips),space:"s",children:[l.jsx(V,{className:ie("group-hover:gs-utl-opacity-100 opacity-0 transition-opacity"),grow:!0,children:l.jsx(Ge,{onClick:x,className:ie("text-sm gjs-mr-auto"),size:"m2",full:!0,children:c.t("select")})}),l.jsx(ss,{overlay:!0,title:!1,padding:!1,buttonAs:"span",handler:l.jsx(ft,{title:c.t("selectorManager.showCSS"),children:l.jsx(Q,{icon:U.codeBraces,size:oe.sx})}),children:({close:S})=>l.jsxs(k,{className:ie("relative w-80 h-48"),col:!0,children:[l.jsx(V,{grow:!0,children:l.jsx(Xs,{defaultValue:Pf(h),onChange:b,language:"css",padding:5,isDarkTheme:p,clean:!0})}),l.jsx(Ge,{className:ie("absolute right-2 bottom-2 text-sm"),variant:"pr",size:"m2",onClick:()=>{w(),S()},children:c.t("update")})]})}),l.jsx(Xc,{onConfirm:y,className:ie("w-48"),children:l.jsx(ft,{title:c.t("selectorManager.deleteStyle"),children:l.jsx(Q,{icon:U.delete,size:oe.sx})})})]})]})]},t.cid)})}),P8=ae(function(){const[t]=xf(),n=di(),s=Ae(),[r,o]=f.useState(""),[i,a]=f.useState(""),u=me().editor,[d,p]=f.useState(u.Css.getRules("")),h=u.Devices.getDevices().map(b=>({id:b.id,label:b.getName()})),g=d.filter(b=>{var v;return!(r&&!Go(b.selectorsToString(),r)||i&&((v=b.getDevice())==null?void 0:v.id)!==i)}),m=()=>p(u.Css.getRules(""));return l.jsxs(k,{col:!0,space:"m",children:[l.jsxs(k,{items:"center",space:"m",children:[l.jsx(V,{children:l.jsx(Je,{size:"s",type:"search",value:r,onInput:o,placeholder:`${s.t("selectorManager.searchStyle")}...`})}),l.jsx(V,{children:l.jsx(je,{includeEmpty:!0,size:"s",value:i,options:h,onChange:a,emptyState:s.t("deviceManager.allDevices"),handlerSelected:b=>l.jsxs(k,{space:"s",items:"center",children:[l.jsx(Q,{icon:U.cellphoneLink,size:oe.sx}),l.jsx("span",{children:b.label})]})})})]}),l.jsx(V,{className:ie("gs-utl-h-[75vh] w-full overflow-auto"),children:g.length?l.jsx(Yc,{data:g,listClassName:ie("grid grid-cols-4 gap-2 gjs-pr-2"),itemContent:(b,v)=>l.jsx(E8,{rule:v,onRemove:m,onSelect:n.close},v.cid)},t):l.jsx(k,{justify:"center",children:s.t("modals.styleCatalog.noStyles")})})]})}),T8=ae(function({selector:t,className:n,removable:s,toggleable:r}){const o=Ae(),i=me(),[a,c]=f.useState(),[u,d]=f.useState(t.getActive()),p=i.editor,{Selectors:h}=p,g=t.getLabel(),m=l.jsx(Q,{icon:U.dotsVertical,size:oe.sx}),b=()=>{h.removeSelected(t)},v=j=>{a&&h.rename(a,j),c(void 0)},x=()=>{h.duplicateSelected(t)},y=()=>{const j=!t.getActive();d(j),t.setActive(j)},S=[{id:"rename",label:o.t("rename"),action:()=>c(t)},{id:"duplicate",label:o.t("duplicate"),action:x},s&&{id:"delete",label:o.t("delete"),action:b},r&&{id:"active",label:o.t(u?"disable":"enable"),action:y}].filter(Boolean),C=(j,E)=>T=>{j(),Ke(E)&&E(T)};return l.jsx(jr,{className:ie(["gjs-ml-1 gjs-my-1 group overflow-hidden cursor-default relative",B.sel,n]),s:"s",children:l.jsxs(k,{items:"center",children:[l.jsx(V,{className:ie("gjs-mr-4",!a&&!u&&"opacity-50 line-through"),children:l.jsx(ay,{value:g,onChange:v,active:!!a,unstyled:!0})}),l.jsx(k,{className:ie("absolute h-full right-0 transition-opacity",B.sel,B.selBr,X.bl),children:l.jsx(ss,{handler:m,title:!1,padding:!1,fixed:!0,overlay:!0,children:({close:j})=>S.map(E=>l.jsx(hi,{className:ie(B.txt),label:E.label,action:C(j,E.action)},E.id))})})]})})}),O8=e=>(e==null?void 0:e.get("groups"))||[],_8=/^\.[a-zA-Z_][\w-]*$/;function A8(e,t={}){const n=e.Css.getAll().filter(s=>O8(s).some(r=>r.startsWith(Po.globalStyles)));return t.withSingleClass?n.filter(s=>_8.test(s.getSelectorsString())):n}const M8=e=>{const{Selectors:t}=e,n=t.getAll({array:!0});return t.getSelectedAll().reduce((o,i)=>{const a=o.indexOf(i);return a>=0&&o.splice(a,1),o},n).filter(o=>o.isClass())},L8=(e,t)=>{const{sdkGlobalStylesConfig:n}=t,{i18nStore:s}=t.store,o=(n!=null&&n.showInClassSelectors?A8(e,{withSingleClass:!0}):[]).map(a=>{const c=a.getSelectorsString().replace(".","");return{id:c,label:`${s.t("globalStyleManager.globalStyles")}: ${c}`}});return[...M8(e).map(a=>({id:a,label:a.getLabel()})),...o]},N8=e=>{var s,r;let t=(s=e==null?void 0:e.selectorsToString)==null?void 0:s.call(e);const n=(r=e==null?void 0:e.getAtRule)==null?void 0:r.call(e);return t&&n&&(t=`${n} {
398
344
  ${t}
399
- }`),t},Rn="gs-cmp-selector-manager",Od={},Rx=fe(function(t){var se,de,Se;const{selectedState:n,states:s,setState:r,styleCatalog:o,stateSelector:i}=t,a=ye(),[l,u]=h.useState(!1),[d,f]=h.useState([]),[p,g]=h.useState(Od),{toggleCssPanel:m,isCssPanelActive:b,editor:v,store:x}=ye(),{i18nStore:y,modalStore:w}=x,S=v==null?void 0:v.getSelected(),C=v==null?void 0:v.Styles.getSelected();if(h.useEffect(()=>{if(v&&C&&a){const ne=setTimeout(()=>{let Te=Od;const ke=S==null?void 0:S.get("selectorManager");S&&Ye(ke)&&(Te=ke({editor:v,component:S})),g(Te||Od),f(_8(v,a))});return()=>clearTimeout(ne)}},[S,v,C,a]),!v)return null;const{Selectors:j}=v,E=p.disableClasses,_=p.disableComponent,T=E&&_,P=j.getComponentFirst()&&!_,A=j.getSelectedAll(),M=v.getSelectedAll(),R=s.map(ne=>({id:ne.getName(),label:ne.getLabel()})),F=v.getModel(),L=(se=C==null?void 0:C.getDevice)==null?void 0:se.call(C),B=(de=C==null?void 0:C.getState)==null?void 0:de.call(C),q=N("gs-utl-overflow-hidden",re.b,re.rnd,z.br),H=N(z.bA),$=N("gs-utl-flex gs-utl-h-full gs-utl-cursor-pointer gs-utl-p-2",re.br,z.br),I=`${z.bgA}`,O=T8(C),V=A.length>0,G=M.length>0,W=V||G,K=P&&G||!P&&!V,J=K?"Components":"Selectors",Y=ne=>y.t(`selectorManager.${ne}`),U=y.t("modals.styleCatalog.title"),Q=()=>w.open({title:U,content:c.jsx(w8,{})});return c.jsxs(k,{className:Rn,gap:"s",col:!0,full:!0,children:[c.jsxs(k,{className:N(`${Rn}__head`),items:"center",justify:"between",gap:"m",children:[c.jsxs(k,{className:N(`${Rn}__head-start`),items:"center",gap:"s",children:[c.jsx(D,{className:N(`${Rn}__head-title`),children:Y("selection")}),o!==!1&&c.jsx(D,{className:N(`${Rn}__style-catalog`),children:c.jsx(It,{className:"gs-utl-cursor-pointer",onClick:Q,title:U,children:c.jsx(oe,{icon:Z.paletteSwatch,size:le.s})})})]}),!!C&&i!==!1&&!T&&c.jsx(D,{className:`${Rn}__head-end`,children:c.jsx(_e,{size:"s",value:n,options:R,includeEmpty:!0,onChange:r,emptyState:`- ${Y("state")} -`,className:N(n&&z.bA)})})]}),W&&!T?c.jsxs(c.Fragment,{children:[!E&&c.jsxs(k,{className:N(`${Rn}__field-selectors`,q,!K&&H),items:"stretch",gap:"xs",children:[c.jsx(It,{title:Y(V?"applyOnSelector":"noSelectors"),className:N($,!K&&I),onClick:()=>V&&j.setComponentFirst(!1),children:c.jsx(k,{className:"gs-utl-h-full",items:"center",children:c.jsx(oe,{icon:Z.tag,size:le.sx})})}),c.jsx(D,{grow:!0,children:c.jsx(k,{className:"gs-utl-h-full gs-utl-pr-1",items:"center",children:l?c.jsx(_x,{autoFocus:!0,open:!0,hideCaret:!0,border:!1,options:d,allowNew:Y("addNewSelector"),onBlur:()=>setTimeout(()=>u(!1),100),onChange:ne=>{ne&&(j.addSelected(ne.id||ne.label),u(!1))}}):c.jsxs(c.Fragment,{children:[G&&c.jsx(bt,{title:Y("addNewSelector"),variant:"out",size:"xs",className:"gs-utl-p-0.5",onClick:()=>u(!0),block:!0,children:c.jsx(oe,{icon:Z.plus,size:le.sx})}),A.map(ne=>c.jsx(S8,{selector:ne,removable:G,toggleable:G&&A.filter(Te=>Te.getActive()||Te===ne).length>1},ne.toString()))]})})})]}),!_&&c.jsxs(k,{className:N(`${Rn}__field-components`,q,K&&H),items:"stretch",gap:"xs",children:[c.jsx(It,{title:Y(G?"applyOnComponents":"noComponents"),onClick:()=>G&&j.setComponentFirst(!0),className:N($,K&&I),children:c.jsx(k,{className:"gs-utl-h-full",items:"center",children:c.jsx(oe,{icon:Z.targetVariant,size:le.sx})})}),c.jsx(D,{grow:!0,className:"gs-utl-py-0.5",children:c.jsx(k,{className:"gs-utl-h-full gs-utl-pr-1",items:"center",children:M.map(ne=>c.jsx(Rr,{s:"s",className:N("gs-utl-ml-1 gs-utl-my-0.5 gs-utl-cursor-default",z.cmp),onPointerEnter:()=>F.setHovered(ne),onPointerOut:()=>F.setHovered(),label:ne.getName()},ne.getId()))})})]}),c.jsxs(k,{className:`${Rn}__actions`,gap:"s",items:"center",justify:"between",children:[c.jsx(It,{title:c.jsxs(c.Fragment,{children:[c.jsx("div",{children:Y("selected")}),c.jsx("pre",{className:N("gs-utl-text-xs gs-utl-mt-1 gs-utl-bg-white/10 gs-utl-text-gray-400",re.rnd,je.xyS),children:O}),c.jsx("div",{className:"gs-utl-text-xs gs-utl-mt-1.5",children:Y("currentSelection")})]}),children:c.jsx(Rr,{className:N(re.b,re.rnd,z.br),s:"xs",nopad:!0,block:!0,children:c.jsx(oe,{icon:Z.target,size:le.sx})})}),c.jsx(D,{className:"gs-utl-text-sm",children:c.jsx(Rr,{className:N(re.b,re.rnd,z.br),s:"xs",nopad:!0,children:c.jsxs(k,{space:"xs",items:"center",nowrap:!0,children:[!!L&&L.getWidthMedia()&&c.jsxs(c.Fragment,{children:[c.jsx(It,{title:c.jsxs(c.Fragment,{children:[Y("device"),": ",c.jsx("b",{children:L.getName()})]}),children:c.jsx(oe,{icon:Z.cellphoneLink,size:le.sx})}),c.jsx(D,{className:"gs-utl-opacity-30",children:"|"})]}),c.jsx(It,{title:c.jsxs(c.Fragment,{children:[Y("target"),": ",c.jsx("b",{children:J}),c.jsxs("span",{className:"gs-utl-text-xs gs-utl-opacity-75",children:[" ",(Se=C==null?void 0:C.selectorsToString)==null?void 0:Se.call(C,{skipState:1})]})]}),children:c.jsx(oe,{icon:K?Z.targetVariant:Z.tag,size:le.sx})}),!!B&&c.jsxs(c.Fragment,{children:[c.jsx(D,{className:"gs-utl-opacity-30",children:"|"}),c.jsx(It,{title:c.jsxs(c.Fragment,{children:[Y("state"),": ",c.jsx("b",{children:B.getLabel()})]}),children:c.jsx(oe,{icon:Z.flare,size:le.sx})})]})]})})}),c.jsx(bt,{title:y.t("toggleCss"),onClick:m,active:b,size:"s",children:c.jsx(oe,{icon:Z.codeBraces,size:le.sx})})]})]}):c.jsxs(k,{className:N(`${Rn}__empty-state`,"gs-utl-text-sm gs-utl-leading-6 gs-utl-my-4"),col:!0,children:[c.jsx(D,{className:`${Rn}__empty-state-title`,children:Y("noSelecton")}),c.jsxs("ul",{className:N(`${Rn}__empty-state-list`,"gs-utl-list-disc gs-utl-pl-5 gs-utl-mt-2"),children:[c.jsx("li",{children:Y("selectFromCanvas")}),c.jsx("li",{children:Y("selectFromList")})]})]})]})}),O8="gs-panel-selectors",A8=h.memo(fe(function({className:t,styleCatalog:n,stateSelector:s,...r}){return c.jsx(hs,{className:N(O8,t),...r,children:c.jsx(oy,{children:o=>c.jsx(Rx,{...o,styleCatalog:n,stateSelector:s})})})}));function Cr({label:e,property:t,hasValue:n,empty:s,onClear:r,children:o,shallow:i,row:a,tooltip:l,skipClear:u,className:d,...f}){const p=e||(t==null?void 0:t.getLabel()),g=t==null?void 0:t.getParentTarget(),m=n||!s&&(t==null?void 0:t.hasValue({noParent:!0})),b=!m&&(t==null?void 0:t.hasValue())&&g,v=g==null?void 0:g.getDevice(),x=g==null?void 0:g.getState(),y=g==null?void 0:g.getComponent(),w=()=>r?r():t==null?void 0:t.clear(),S={className:N(d,"gs-utl-text-sm gs-utl-w-full"),col:!a,items:a?"center":void 0,...f},C=N("gs-utl-flex-1",m&&!i&&z.tAo);return t&&!t.isVisible()?null:c.jsxs(k,{gap:"xs",...S,children:[c.jsxs(k,{className:C,as:"label",items:"center",gap:"xs",nowrap:!0,children:[l&&c.jsx(D,{children:c.jsx(It,{title:l,children:c.jsx(oe,{icon:Z.information,size:le.sx})})}),c.jsx(D,{children:s?c.jsx("span",{children:" "}):p}),!!b&&!i&&c.jsx(It,{title:c.jsxs(c.Fragment,{children:[c.jsx("div",{className:N("gs-utl-mb-1"),children:"Value inherited from"}),!!v&&c.jsxs(k,{gap:"s",children:[c.jsx(D,{children:c.jsx(oe,{icon:Z.cellphoneLink,size:le.sx})}),c.jsx(D,{children:c.jsx("b",{children:v.getName()})})]}),c.jsxs(k,{gap:"s",children:[c.jsx(D,{children:c.jsx(oe,{icon:y?Z.targetVariant:Z.tag,size:le.sx})}),c.jsxs(D,{children:[c.jsx("b",{children:y?"Components":"Selectors"}),c.jsxs("span",{className:N("gs-utl-text-xs gs-utl-opacity-75"),children:[" ",g==null?void 0:g.selectorsToString({skipState:1})]})]})]}),!!x&&c.jsxs(k,{gap:"s",children:[c.jsx(D,{children:c.jsx(oe,{icon:Z.flare,size:le.sx})}),c.jsx(D,{children:c.jsx("b",{children:x.getLabel()})})]})]}),children:c.jsx("div",{className:N("gs-utl-w-[6px] gs-utl-h-[6px] gs-utl-rounded-full",z.bgW)})}),m&&!i&&!u&&c.jsx(It,{title:"Clear value",onClick:w,children:c.jsx(oe,{className:Ee.click,icon:Z.close,size:le.s2x})})]}),!!o&&c.jsx(D,{grow:!0,className:"gs-utl-max-w-full",children:o})]})}function Cu(e){const t=e.indexOf("(")+1,n=e.lastIndexOf(")");return{name:e.substring(0,t-1).trim(),value:String.prototype.substring.apply(e,[t,n>=0?n:void 0]).trim()}}const N8=/^-?[0-9]+(\.[0-9]+)?[a-zA-Z%]{0,}$/,M8=/,(?![^(]*\))/,Ad=/\s(?![^(]*\))/,L8=/^(closest-side|closest-corner|farthest-side|farthest-corner)/i,Nd=/^circle|ellipse/i,yh=e=>{var d;const t=[],{name:n,value:s}=Cu(e),[r,...o]=s.split(M8).map(f=>f.trim()).filter(Boolean),i=o.length>1,a=i?r:"",l={type:"none"},u=i?o:[r,...o];if(N8.test(a))l.type="angle",l.value=a;else if(/^to\s/.test(a))l.type="side-or-corner",l.value=a;else if(L8.test(a))l.type="size",l.value=a;else if(Nd.test(a)||/^at\s/.test(a)||/\sat\s/.test(a)){l.type="at",l.value=a;const f=((d=a.match(Nd))==null?void 0:d[0])||"circle";l.shape=f;const p={x:"0%",y:"0%"},g={x:"0%",y:"0%"},[m,b]=a.replace(Nd,"").trim().split("at").map(v=>v.trim());if(m){const[v,x]=m.split(Ad);p.x=v,p.y=x||v}if(b){const[v,x]=b.split(Ad);g.x=v,g.y=x||v}l.size=p,l.position=g}return u.forEach(f=>{const[p,g]=f.split(Ad);t.push({color:p,hint:g?parseFloat(g):null})}),t.forEach((f,p)=>{f.hint===null&&(f.hint=p/(t.length-1)*100)}),{name:n,orientation:l,colorStops:t}},yr=({stops:e,orientation:t="to right",name:n="linear-gradient"})=>{const r=(e.length===1?[{color:e[0].color,hint:null},{color:e[0].color,hint:null}]:e).map(o=>`${o.color} ${o.hint?`${o.hint}%`:""}`.trim()).join(", ");return r?`${n}(${t}, ${r})`:"none"},R8=e=>e.slice().sort((t,n)=>(t.hint||0)-(n.hint||0)),$8="gs-cmp-grad-picker";function k8({className:e,value:t,onChange:n}){var B,q,H;const s=yh(t),[r,o]=h.useState(s.colorStops),[i,a]=h.useState(null),l=h.useRef(null),u=ee($8,"gs-grad-picker gs-utl-select-none gs-utl-gap-1",e,re.rnd),d=s.name||"linear-gradient",f=d.indexOf("radial")>=0,p=d.indexOf("repeating")>=0,g=s.orientation.value,m=`${parseFloat(`${g}`)||180}`,b=`${parseFloat(`${(B=s.orientation.size)==null?void 0:B.x}`)||0}`,v=`${parseFloat(`${(q=s.orientation.position)==null?void 0:q.x}`)||0}`,x=`${parseFloat(`${(H=s.orientation.position)==null?void 0:H.y}`)||0}`,y=0,w=100,S=($,I=!1)=>{const O=R8($);o(O),n==null||n(yr({name:d,orientation:g,stops:O}),I)},C=($,I=!1)=>{n==null||n(yr({stops:r,name:d,orientation:`${$}deg`}),I)},j=($,I=!1)=>{n==null||n(yr({stops:r,name:d,orientation:`${$}px at ${v}% ${x}%`}),I)},E=($,I=!1)=>{n==null||n(yr({stops:r,name:d,orientation:`${b}px at ${$}% ${x}%`}),I)},_=($,I=!1)=>{n==null||n(yr({stops:r,name:d,orientation:`${b}px at ${v}% ${$}%`}),I)},T=$=>{const I=`${$?"repeating-":""}${f?"radial":"linear"}-gradient`;n==null||n(yr({stops:r,orientation:g,name:I}))},P=$=>{const I=`${p?"repeating-":""}${$?"radial":"linear"}-gradient`;n==null||n(yr({stops:r,orientation:$?"100px at 50% 50%":"90deg",name:I}))};h.useEffect(()=>{if(!i)return;const $=parseFloat(`${i.stop.hint}`),I=V=>{let W=(V.clientX-i.x)*100;W=W/i.w,W=$+W,W=W<y?y:W,W=W>w?w:W,i.stop.hint=parseInt(`${W}`,10),S(r,!0)},O=()=>{a(null),S(r)};return window.addEventListener("pointermove",I),window.addEventListener("pointerup",O),()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",O),O()}},[i]);const A=($,I)=>{const O=l.current;a({stop:I,w:(O==null?void 0:O.clientWidth)||0,h:(O==null?void 0:O.clientHeight)||0,x:$.clientX,y:$.clientY})},M=$=>{const I=l.current,O=(I==null?void 0:I.clientWidth)||0,V=(I==null?void 0:I.clientHeight)||0,G=$.nativeEvent.offsetX-((I==null?void 0:I.clientLeft)||0),W=$.nativeEvent.offsetY-((I==null?void 0:I.clientTop)||0),K=G/O*100,J=document.createElement("canvas"),Y=J.getContext("2d");if(!Y)return;J.width=O,J.height=V;const U=Y.createLinearGradient(0,0,O,V);r.forEach(ne=>U.addColorStop(parseFloat(`${ne.hint}`)/100,ne.color)),Y.fillStyle=U,Y.fillRect(0,0,J.width,J.height),J.style.background="black";const Q=Y.getImageData(G,W,1,1).data,se=Q[3]?(100/255*Q[3]/100).toFixed(2):0,de=`rgba(${Q[0]}, ${Q[1]}, ${Q[2]}, ${se})`,Se=de==="rgba(0, 0, 0, 0)"?"#000":de;S([...r,{color:Se,hint:K}])},R=$=>{S(r.filter(I=>I!==$))},F=($,I,O)=>{I&&($.color=I),S(r,O)},L=$=>(i==null?void 0:i.stop)===$;return c.jsxs(k,{className:u,col:!0,children:[!!(i!=null&&i.stop)&&c.jsx("div",{className:ee("fixed inset-0 z-50 cursor-colr")}),c.jsxs("div",{className:ee("relative gjs-mb-6 gjs-mt-3"),children:[c.jsx("div",{className:ee("bg-checker h-8",re.rnd),children:c.jsx("div",{ref:l,className:ee("w-full h-full cursor-cross",re.b,re.rnd,z.br),style:{backgroundImage:yr({stops:r})},onClick:M})}),r.map(($,I)=>c.jsxs("div",{className:ee("absolute top-0 h-full"),style:{left:`${$.hint}%`},children:[c.jsx("div",{className:ee("cursor-pointer absolute gs-utl-translate-x-[-50%] gs-utl-top-[-14px]"),onClick:()=>R($),children:c.jsx(oe,{icon:Z.close,size:le.s3x})}),c.jsx("div",{onPointerDown:O=>A(O,$),className:ee("h-full w-1 gs-utl-translate-x-[-50%] cursor-colr opacity-50 gjs-border-white",re.br,re.bl,L($)?"gjs-bg-white":"gjs-bg-black")}),c.jsx("div",{className:ee("cursor-pointer gs-utl-bottom-[-17px] gs-utl-left-[-7px] absolute"),children:c.jsx(Wy,{value:$.color,onChange:(O,V)=>F($,O,V),className:ee("h-4 w-4 gjs-rounded-full gjs-border-2")})})]},I))]}),c.jsxs(k,{space:"s",items:"center",children:[c.jsx(D,{grow:!0,children:c.jsx(wa,{label:"Repeat",value:p,onChange:T})}),c.jsx(D,{grow:!0,children:c.jsx(wa,{label:"Radial",value:f,onChange:P})})]}),f?c.jsxs(k,{space:"s",col:!0,children:[c.jsx(D,{children:c.jsx(k,{space:"s",items:"center",children:c.jsx(D,{grow:!0,children:c.jsx(Ne,{pan:"S",size:"s",value:b,onChange:j,valueUnit:"px",units:["px"]})})})}),c.jsx(D,{children:c.jsxs(k,{space:"s",children:[c.jsx(D,{grow:!0,children:c.jsx(Ne,{pan:"X",size:"s",value:v,onChange:E,valueUnit:"%",units:["%"]})}),c.jsx(D,{grow:!0,children:c.jsx(Ne,{pan:"Y",size:"s",value:x,onChange:_,valueUnit:"%",units:["%"]})})]})})]}):c.jsx(k,{space:"s",items:"center",nowrap:!0,children:c.jsx(D,{grow:!0,children:c.jsx(Ne,{pan:"A",size:"s",value:m,onChange:C,valueUnit:"deg",units:["deg"]})})})]})}const V8="gs-sm-custom-type",I8=fe(function({property:t,editor:n}){const s=h.useRef(null),r=t.getType(),o=n.StyleManager,i=o.getType(r),a=i==null?void 0:i.view;return h.useEffect(()=>{const l=s.current;if(a&&l){const u=new a({model:t,config:o.getConfig(),attributes:t.get("attributes")}),d=u.render().el;return l.appendChild(d),()=>{l.removeChild(d),u.remove()}}},[a,t,n]),a&&c.jsx("div",{className:V8,ref:s})});function $x(e){return e.isFull()||["slider","composite","stack","file"].includes(e.getType())}const L1="gs-cmp-style-field";function kx({property:e,sector:t,styleManagerDataConfig:n,fieldProps:s}){const r=N(L1,`${L1}__${e.id}`),o={sector:t,styleManagerDataConfig:n},i=t.em.getEditor(),a=e.getType();switch(a){case"selectFont":return c.jsx(bu,{className:r,...Fx(e,o),...s});case"number":case"slider":case"integer":return c.jsx(Ne,{className:r,...nt(e,o),...s});case"color":return c.jsx(lr,{className:r,...To(e,o),...s});case"select":return c.jsx(_e,{className:r,...jt(e,o),...s});case"radio":return c.jsx(Yt,{className:r,..._s(e,o),...s});case"file":return c.jsx(ja,{className:r,...a9(e,o),...s});case"composite":return c.jsx(fn,{className:r,property:e,corners:e.get("corners"),generic:e.get("generic"),...o});case"stack":{const l=e.getProperties();return c.jsx(Es,{className:r,...jr(e,o),children:c.jsx(Bs,{properties:l,sector:t})})}default:{const l=i.StyleManager.getType(a);return!!(l!=null&&l.create)&&!!(l!=null&&l.view)?c.jsx(I8,{editor:i,property:e}):c.jsx(tt,{className:r,...xh(e,o)})}}}const R1="gs-cmp-style-prop-row";function Bs({properties:e,sector:t,styleManagerDataConfig:n}){const s={sector:t,styleManagerDataConfig:n};return c.jsx(c.Fragment,{children:e.map(r=>{const o=r.getId(),i=N(R1,`${R1}__${o}`,$x(r)&&"gs-utl-col-span-full");return r.isVisible()?c.jsx("div",{className:i,children:c.jsx(kx,{property:r,...s})},o):null})})}function D8({sector:e,styleManagerDataConfig:t}){const n=Ya(),s=e.getProperties().filter(r=>r.isVisible()).map(r=>(n.sdkAddFonts&&r.getId()==="font-family"&&r.set("type","selectFont"),r));return c.jsx("div",{className:N("gs-utl-grid gs-utl-grid-cols-2 gs-utl-gap-2"),children:c.jsx(Bs,{properties:s,sector:e,styleManagerDataConfig:t})})}const H8="gs-cmp-sector-row";function be({className:e,children:t,bottom:n,separator:s,separatorTop:r,property:o,...i}){const a=c.jsx("div",{className:ee("gjs-mb-2 -gjs-ml-2 -gjs-mr-2",re.bb,z.br)}),l=ee(H8,e,"w-full gs-utl-gap-2",n),u=(Array.isArray(o)?o:[o]).filter(Boolean);return(u.length?u.some(f=>f.isVisible()):!0)?c.jsxs(c.Fragment,{children:[r&&a,c.jsx(k,{className:l,nowrap:!0,...i,children:t}),s&&a]}):null}function Bi(e,t,n={}){const s=e.getType(),{compact:r=!1,sector:o,styleManagerDataConfig:i}=n,a=e.getParent(),l={sector:o,styleManagerDataConfig:i},u=e.getDefaultValue();if(s==="select"){const f={property:a.getName()};return c.jsx(_e,{...jt(e,l,f),...t?{value:t.same?e.getValue({noDefault:!0}):"",emptyState:t.same?e.getOptionLabel(u,f)||u:"Custom",onChange:p=>t.all.map(g=>g.upValue(p))}:{},label:void 0})}else return s==="color"?c.jsx(lr,{...To(e,l),...t?{value:t.same?e.getValue({noDefault:!0}):"",placeholder:t.same?u:"Custom",onChange:(d,f)=>t.all.map(p=>p.upValue(d,{partial:f}))}:{},label:void 0}):c.jsx(Ne,{...nt(e,l),...r?{pan:e.getLabel()[0]}:{},...t?{value:t.same?e.getValue({noDefault:!0}):"",valueUnit:t.same?e.getUnit():"",placeholder:t.same?u:"Custom",onChange:(d,f)=>t.all.map(p=>p.upValue(d,{partial:f})),onChangeUnit:d=>t.all.map(f=>f.upUnit(d))}:{},label:void 0})}const Il="gs-cmp-style-prop-composite";function fn({className:e,property:t,sector:n,styleManagerDataConfig:s,corners:r,compact:o,generic:i,children:a,options:l}){const[u,d]=h.useState(null);if(!(t!=null&&t.isVisible()))return null;const f={id:"custom",label:c.jsx(oe,{icon:Z.borderStyle,size:le.s}),title:"Custom"},p=[{id:"all",label:c.jsx(oe,{icon:Z.borderAllVariant,size:le.s}),title:"All"},f],g=t.isDetached(),m=t.getProperties(),b=m.length,[v,x,y,w]=m,S=v.getFullValue(),j=m.map(H=>H.getFullValue()).every(H=>H===S),E=u!==null?u:j||l?"all":f.id,_=l?[...l,f]:[],T=t.getFullValue(),P=_.some(H=>H.id===T),A=E===f.id||(l?!P:!1)||!!i,M={compact:o,sector:n,styleManagerDataConfig:s},R=c.jsx(Cr,{property:o?null:v,shallow:!g,children:Bi(v,null,M)}),F=c.jsx(Cr,{property:o?null:x,shallow:!g,children:Bi(x,null,M)}),L=!!y&&c.jsx(Cr,{property:o?null:y,shallow:!g,children:Bi(y,null,M)}),B=!!w&&c.jsx(Cr,{property:o?null:w,shallow:!g,children:Bi(w,null,M)}),q=o?{label:t.getLabel()}:{property:t};return c.jsxs(k,{className:ee(Il,e,"gs-utl-w-full gs-utl-gap-2"),col:!0,nowrap:!0,children:[c.jsx(be,{className:`${Il}__main`,children:c.jsx(Cr,{...q,children:!i&&c.jsx(be,{bottom:"0",children:a!==void 0?a:l?c.jsx(c.Fragment,{children:c.jsx(D,{grow:!0,children:c.jsx(Yt,{size:"s",options:_,value:A?f.id:T,onChange:H=>{H===f.id?d(H):(t.upValue(H),d(""))}})})}):c.jsxs(c.Fragment,{children:[c.jsx(D,{grow:!0,children:Bi(v,{same:j,all:m},M)}),c.jsx(D,{grow:!0,children:c.jsx(Yt,{size:"s",options:p,value:E,onChange:d})})]})})})}),A&&c.jsx(be,{col:!0,className:ee(`${Il}__details`,"gjs-px-2 gjs-py-1",z.bgH2,re.rnd,re.b,z.br),children:i?c.jsx("div",{className:ee(`${Il}__props`,"grid grid-cols-2 gap-2"),children:m.map(H=>c.jsx(Cr,{property:H,shallow:!g,className:ee($x(H)&&"col-span-full"),children:c.jsx(kx,{property:H,...M,fieldProps:{label:void 0}})},H.getId()))}):b===2?c.jsx(c.Fragment,{children:c.jsxs(k,{space:"s",children:[c.jsx(D,{grow:!0,children:R}),c.jsx(D,{grow:!0,children:F})]})}):b===3?c.jsxs(c.Fragment,{children:[c.jsxs(k,{space:"s",children:[c.jsx(D,{grow:!0,children:R}),c.jsx(D,{grow:!0,children:F})]}),c.jsx(k,{space:"s",children:c.jsx(D,{grow:!0,children:L})})]}):r?c.jsxs(c.Fragment,{children:[c.jsxs(k,{space:"s",children:[c.jsx(D,{grow:!0,children:R}),c.jsx(D,{grow:!0,children:F})]}),c.jsxs(k,{space:"s",children:[c.jsx(D,{grow:!0,children:B}),c.jsx(D,{grow:!0,children:L})]})]}):c.jsxs(c.Fragment,{children:[c.jsx(k,{className:ee("gs-utl-w-1/2 gjs-m-auto"),children:R}),c.jsxs(k,{space:"s",children:[c.jsx(D,{grow:!0,children:B}),c.jsx(D,{grow:!0,children:F})]}),c.jsx(k,{className:ee("gs-utl-w-1/2 gjs-m-auto"),children:L})]})})]})}var Or=(e=>(e.Image="image",e.Gradient="gradient",e.Color="color",e))(Or||{});const tc="background-image",Ns="__background-type",ua=tc,Vx="https://placehold.co/150/777/white.png?text=IMAGE",Vf="50px",F8={[Ns]:"image","background-image":`url("${Vx}")`,"background-size":`${Vf} ${Vf}`,"background-repeat":"repeat","background-position":"0px 0px"},B8=e=>(e.includes("gradient(")?yh(e).colorStops[0].color:e)||"";function z8({sector:e,styleManagerDataConfig:t}){var S;const n=Ja(),s=e.getProperty("background"),r=s.getProperty(Ns),o=s.getProperty("background-image"),i=s.getProperty("background-position"),a=s.getProperty("background-size"),l=e.getProperty("background-color"),u=e.getProperty("background-clip"),d={sector:e,styleManagerDataConfig:t},f=[s,l,u].map(C=>C==null?void 0:C.id),p=e.getProperties().filter(C=>!f.includes(`${C.id}`)),g=((S=s.getSelectedLayer())==null?void 0:S.getIndex())||-1,m=r==null?void 0:r.getValue(),b=m==="image",v=o.getValue(),x=()=>{const C=n.Assets;C.open({select(j){const E=j.getSrc();o.upValue(`url("${E}")`),C.close()}})},y=C=>{let j="none",E="100%";C==="image"?(j=`url("${Vx}")`,E=Vf):C==="gradient"?j="linear-gradient(90deg, black 10%, white 90%)":C==="color"&&(j="rgba(0, 0, 0, 0.5)"),o.upValue(j),r.upValue(C),i.upValue("0 0"),a.upValue(`${E} ${E}`)},w=o9(r,[{id:"image",label:c.jsx(oe,{icon:Z.image,size:le.s})},{id:"gradient",label:c.jsx(oe,{icon:Z.gradientVertical,size:le.s})},{id:"color",label:c.jsx(oe,{icon:Z.checkboxBlank,size:le.s})}]);return c.jsxs(c.Fragment,{children:[c.jsx(be,{property:s,separator:!0,children:c.jsxs(Es,{...jr(s,d,F8),previewStyle:C=>s.getStyleFromLayer(C,{camelCase:!0}),children:[c.jsx(be,{children:c.jsx(Yt,{..._s(r,d),options:w,onChange:y,label:void 0})}),c.jsx(be,{children:c.jsxs(Cr,{children:[b&&c.jsx(ja,{value:Cu(v).value,onOpen:x}),m==="color"&&c.jsx(lr,{...To(o,d),value:B8(v),label:void 0}),m==="gradient"&&c.jsx(k8,{value:v,onChange:(C,j)=>o.upValue(C,{partial:j})},g)]})}),b&&c.jsxs(c.Fragment,{children:[c.jsx(be,{col:!0,children:c.jsx(fn,{property:i,...d})}),c.jsx(be,{col:!0,children:c.jsx(fn,{property:a,...d})}),c.jsxs(be,{children:[c.jsx(_e,{...jt(s.getProperty("background-repeat"),{sector:e})}),c.jsx(_e,{...jt(s.getProperty("background-attachment"),{sector:e})})]}),c.jsx(be,{children:c.jsx(_e,{...jt(s.getProperty("background-origin"),{sector:e})})})]})]})}),c.jsx(be,{property:l,children:c.jsx(lr,{...To(l,d)})}),c.jsx(be,{property:u,children:c.jsx(_e,{...jt(u,d)})}),p.length>0&&c.jsx(Bs,{properties:p,...d})]})}function U8({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("border-radius"),s=e.getProperty("border-width"),r=e.getProperty("border-style"),o=e.getProperty("border-color"),i={sector:e,styleManagerDataConfig:t},a=[n,s,r,o].map(u=>u==null?void 0:u.id),l=e.getProperties().filter(u=>!a.includes(`${u.id}`));return c.jsxs(c.Fragment,{children:[c.jsx(fn,{property:n,corners:!0,...i}),c.jsx(fn,{property:s,...i}),c.jsx(fn,{property:r,...i}),c.jsx(fn,{property:o,...i}),l.length>0&&c.jsx(Bs,{properties:l,...i})]})}const ro=e=>gu({value:parseFloat(e),min:-3,max:3}),Md=(e,t="filter",n)=>{const s=e.getProperty(`${t}-value`),r=e.getProperty(`${t}-name`).getOption()||{},o=r.units||[],i=s.getUnit(),a=ER(i,o)?i:o[0];return{...nt(s,n),units:o,valueUnit:a,onChange:(l,u)=>{s.upValue(l,{partial:u,units:o,min:r.min,max:r.max})}}},$1=(e,t,n,s)=>{const r=e.getProperty(`${t}-name`),o=e.getProperty(`${t}-value`);return{...jt(r,n,s),onChange:i=>{r.upValue(i),o.upValue("")}}},W8={"text-shadow-h":"1px","text-shadow-v":"1px","text-shadow-blur":"5px"};function G8({sector:e,styleManagerDataConfig:t}){const n=Re(),s=_=>n.t(`styleManager.effects.${_}`),r=e.getProperty("box-shadow"),o=e.getProperty("text-shadow"),i=e.getProperty("filter"),a=e.getProperty("backdrop-filter"),l=e.getProperty("transition"),u=e.getProperty("transform"),d=e.getProperty("perspective-origin"),f=e.getProperty("backface-visibility"),p=e.getProperty("perspective"),g=e.getProperty("transform-style"),m=e.getProperty("opacity"),b=e.getProperty("mix-blend-mode"),v=e.getProperty("cursor"),x=e.getProperty("transform-origin"),y=e.getProperty("overflow"),w={sector:e,styleManagerDataConfig:t},S=[r,o,i,a,l,u,d,f,p,g,m,b,v,x,y].map(_=>_==null?void 0:_.id),C=e.getProperties().filter(_=>!S.includes(`${_.id}`)),j=_=>{const{boxShadowH:T,boxShadowV:P,boxShadowBlur:A,boxShadowColor:M,boxShadowSpread:R,boxShadowType:F}=_.getValues({camelCase:!0}),L=ro(T),B=ro(P),q=ro(A),H=ro(R),$=`${L}px ${B}px ${q}px ${H}px ${M} ${F}`.trim();return c.jsxs(k,{space:"s",items:"center",children:[c.jsxs(D,{grow:!0,children:[T," ",P," ",A," ",R]}),c.jsx(D,{children:c.jsx("div",{className:ee("w-4 h-4 gjs-bg-white",re.b,re.rnd),style:{boxShadow:$}})})]})},E=_=>{const{textShadowH:T,textShadowV:P,textShadowBlur:A,textShadowColor:M}=_.getValues({camelCase:!0}),R=ro(T),F=ro(P),L=ro(A),B=`${R}px ${F}px ${L}px ${M}`.trim();return c.jsxs(k,{space:"s",items:"center",children:[c.jsxs(D,{grow:!0,children:[T," ",P," ",A]}),c.jsx(D,{children:c.jsx("div",{className:ee("w-4 h-4 gjs-bg-white",re.b,re.rnd),style:{boxShadow:B}})})]})};return c.jsxs(c.Fragment,{children:[c.jsxs(be,{property:[m,b],children:[c.jsx(Ne,{...nt(m,w)}),c.jsx(_e,{...jt(b,w)})]}),c.jsx(be,{property:v,separator:!0,children:c.jsx(_e,{...jt(v,w)})}),c.jsx(be,{property:r,separator:!0,children:c.jsxs(Es,{...jr(r,w),renderItem:j,children:[c.jsx(be,{children:c.jsx(Yt,{..._s(r.getProperty("box-shadow-type"),w),label:""})}),c.jsxs(be,{children:[c.jsx(Ne,{...nt(r.getProperty("box-shadow-h"),w),label:s("boxShadow.xOffset")}),c.jsx(Ne,{...nt(r.getProperty("box-shadow-v"),w),label:s("boxShadow.yOffset")})]}),c.jsxs(be,{children:[c.jsx(Ne,{...nt(r.getProperty("box-shadow-blur"),w),label:s("boxShadow.blur")}),c.jsx(Ne,{...nt(r.getProperty("box-shadow-spread"),w),label:s("boxShadow.spread")})]}),c.jsx(be,{children:c.jsx(lr,{...To(r.getProperty("box-shadow-color"),w),label:s("boxShadow.color")})})]})}),c.jsx(be,{property:o,separator:!0,children:c.jsxs(Es,{...jr(o,w,W8),renderItem:E,children:[c.jsxs(be,{children:[c.jsx(Ne,{...nt(o.getProperty("text-shadow-h"),w),label:s("textShadow.xOffset")}),c.jsx(Ne,{...nt(o.getProperty("text-shadow-v"),w),label:s("textShadow.yOffset")})]}),c.jsx(be,{children:c.jsx(Ne,{...nt(o.getProperty("text-shadow-blur"),w),label:s("textShadow.blur")})}),c.jsx(be,{children:c.jsx(lr,{...To(o.getProperty("text-shadow-color"),w),label:s("textShadow.color")})})]})}),c.jsx(be,{property:i,separator:!0,children:c.jsx(Es,{...jr(i,w,{"filter-name":"blur","filter-value":"3px"}),children:c.jsxs(be,{children:[c.jsx(_e,{...$1(i,"filter",w),label:s("filter.type")}),c.jsx(Ne,{...Md(i,void 0,w),label:s("filter.value")})]})})}),c.jsx(be,{property:a,separator:!0,children:c.jsx(Es,{...jr(a,w,{"backdrop-filter-name":"blur","backdrop-filter-value":"3px"}),children:c.jsxs(be,{children:[c.jsx(_e,{...jt(a.getProperty("backdrop-filter-name"),w),label:s("backdropFilter.type")}),c.jsx(Ne,{...Md(a,"backdrop-filter",w),label:s("backdropFilter.value")})]})})}),c.jsx(be,{property:l,separator:!0,children:c.jsxs(Es,{...jr(l,w),children:[c.jsx(be,{children:c.jsx(_e,{...jt(l.getProperty("transition-property"),w),label:s("transition.type")})}),c.jsx(be,{children:c.jsx(_e,{...jt(l.getProperty("transition-timing-function"),w),label:s("transition.easing")})}),c.jsxs(be,{children:[c.jsx(Ne,{...nt(l.getProperty("transition-duration"),w),label:s("transition.duration")}),c.jsx(Ne,{...nt(l.getProperty("transition-delay"),w),label:s("transition.delay")})]})]})}),c.jsx(be,{property:u,separator:!0,children:c.jsx(Es,{...jr(u,w),children:c.jsxs(be,{children:[c.jsx(_e,{...$1(u,"transform",w),label:s("transform.type")}),c.jsx(Ne,{...Md(u,"transform",w),label:s("transform.value")})]})})}),c.jsx(fn,{property:x,...w}),c.jsx(fn,{property:y,...w}),c.jsx(be,{property:f,children:c.jsx(Yt,{..._s(f,w)})}),c.jsx(be,{property:[p,g,d],separatorTop:!0,children:s("childrenTransform")}),c.jsxs(be,{property:[p,g],children:[c.jsx(Ne,{...nt(p,w)}),c.jsx(Yt,{..._s(g,w)})]}),c.jsx(fn,{property:d,...w}),C.length>0&&c.jsx(Bs,{properties:C,...w})]})}function q8(e,t){return e.indexOf(t)>=0}const ht=le.s,Dl="M6 6v12h13V6H6zm0 13v5H5V0h1v5h13c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H6zm6-14h1v14h-1V5z",Hl="M6 6v12h13V6H6zm0-1h13c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H6a1 1 0 01-1-1V6c0-.6.4-1 1-1zm6-5h1v24h-1V0z",Fl="M6 6v12h13V6H6zm13-1V0h1v24h-1v-5H6a1 1 0 01-1-1V6c0-.6.4-1 1-1h13zm-7 0h1v14h-1V5z",k1="M2 6v12h6V6H2zm0 13v5H1V0h1v5h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H2zM16 6v12h6V6h-6zm6-1V0h1v24h-1v-5h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1h6z",V1="M11 0h1v24h-1V0zM1 6h6v12H1V6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H1a1 1 0 01-1-1V6c0-.6.4-1 1-1zm15 1h6v12h-6V6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1z",K8="M3 6v12h6V6H3zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H3a1 1 0 01-1-1V6c0-.6.4-1 1-1zM0 0h1v24H0V0zm14 6v12h6V6h-6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1zm8-5h1v24h-1V0zM11 0h1v24h-1V0z",Ld="M15 19H9V6h6v13zM8 6v13H0v1h24v-1h-8V6h8V5H0v1h8z";function Y8({sector:e,styleManagerDataConfig:t}){const n=e.em.getEditor(),s=Re(),[r,o]=h.useState({}),[i,a]=h.useState({}),l=e.getProperty("display"),u=e.getProperty("flex-direction"),d=e.getProperty("justify-content"),f=e.getProperty("align-items"),p=e.getProperty("flex-wrap"),g=e.getProperty("align-content"),m=e.getProperty("align-self"),b=e.getProperty("order"),v=e.getProperty("gap"),x=e.getProperty("flex"),y={sector:e,styleManagerDataConfig:t},w=[l,u,d,f,p,g,m,b,v,x].map(H=>H.id),S=e.getProperties().filter(H=>!w.includes(`${H.id}`)),C=H=>s.t(`styleManager.layout.${H}`),j=l.getValue(),E=j==="flex",_=(i.display||"").indexOf("flex")>=0,T=u.getValue(),P=T.indexOf("reverse")>=0,A=!q8(["column","column-reverse"],T),M=[{id:"row",label:c.jsx(oe,{icon:Z.arrowRight,size:le.sx}),title:C("direction.title.row")},{id:"row-reverse",label:c.jsx(oe,{icon:Z.arrowRight,size:ht,horizontal:!0}),title:C("direction.title.row-reverse")},{id:"column",label:c.jsx(oe,{icon:Z.arrowDown,size:le.sx}),title:C("direction.title.column")},{id:"column-reverse",label:c.jsx(oe,{icon:Z.arrowDown,size:ht,vertical:!0}),title:C("direction.title.column-reverse")}],R=[{id:"flex-start",title:C("justify.title.start"),label:c.jsx(oe,{icon:Dl,size:ht,rotate:A?0:90,horizontal:A&&P,vertical:!A&&P})},{id:"center",title:C("justify.title.center"),label:c.jsx(oe,{icon:Hl,size:ht,rotate:A?0:90})},{id:"flex-end",title:C("justify.title.end"),label:c.jsx(oe,{icon:Fl,size:ht,rotate:A?0:90,horizontal:A&&P,vertical:!A&&P})},{id:"space-between",title:C("justify.title.spaceBetween"),label:c.jsx(oe,{icon:k1,size:ht,rotate:A?0:90})},{id:"space-around",title:C("justify.title.spaceAround"),label:c.jsx(oe,{icon:V1,size:ht,rotate:A?0:90})},{id:"space-evenly",title:C("justify.title.spaceEvenly"),label:c.jsx(oe,{icon:K8,size:ht,rotate:A?0:90})}],F=[{id:"stretch",title:C("align.title.stretch"),label:c.jsx(oe,{icon:Ld,size:ht,rotate:A?0:90})},{id:"flex-start",title:C("align.title.start"),label:c.jsx(oe,{icon:Dl,size:ht,rotate:A?90:0})},{id:"center",title:C("align.title.center"),label:c.jsx(oe,{icon:Hl,size:ht,rotate:A?90:0})},{id:"flex-end",title:C("align.title.end"),label:c.jsx(oe,{icon:Fl,size:ht,rotate:A?90:0})}],L=[{id:"flex-start",title:C("alignContent.title.start"),label:c.jsx(oe,{icon:Dl,size:ht,rotate:A?90:0,horizontal:A&&P,vertical:!A&&P})},{id:"center",title:C("alignContent.title.center"),label:c.jsx(oe,{icon:Hl,size:ht,rotate:A?90:0})},{id:"flex-end",title:C("alignContent.title.end"),label:c.jsx(oe,{icon:Fl,size:ht,rotate:A?90:0,horizontal:A&&P,vertical:!A&&P})},{id:"space-between",title:C("alignContent.title.spaceBetween"),label:c.jsx(oe,{icon:k1,size:ht,rotate:A?90:0})},{id:"space-around",title:C("alignContent.title.spaceAround"),label:c.jsx(oe,{icon:V1,size:ht,rotate:A?90:0})},{id:"stretch",title:C("alignContent.title.stretch"),label:c.jsx(oe,{icon:Ld,size:ht,rotate:A?0:90})}],B=[{id:"auto",title:C("alignSelf.title.auto"),label:c.jsx(oe,{icon:Z.close,size:ht})},{id:"flex-start",title:C("alignSelf.title.start"),label:c.jsx(oe,{icon:Dl,size:ht,rotate:90})},{id:"center",title:C("alignSelf.title.center"),label:c.jsx(oe,{icon:Hl,size:ht,rotate:90})},{id:"flex-end",title:C("alignSelf.title.end"),label:c.jsx(oe,{icon:Fl,size:ht,rotate:90})},{id:"stretch",title:C("alignSelf.title.stretch"),label:c.jsx(oe,{icon:Ld,size:ht,rotate:0})}],q=[{id:"0 0 auto",label:c.jsx(oe,{icon:Z.close,size:ht}),title:C("flex.title.auto")},{id:"1 1 0%",label:c.jsx(oe,{icon:Z.unfoldMoreHorizontal,size:ht,rotate:90}),title:C("flex.title.fillContainer")},{id:"0 1 auto",label:c.jsx(oe,{icon:Z.unfoldLessHorizontal,size:ht,rotate:90}),title:C("flex.title.hugContents")}];return h.useEffect(()=>{if(!n)return()=>{};const{Styles:H}=n,$=()=>{const O=n.getSelected();let V={},G={};if(O){const W=O.getEl();if(W){V=window.getComputedStyle(W);const K=W.parentElement;K&&(G=window.getComputedStyle(K))}}o(V),a(G)},I=H.events.target;return n.on(I,$),$(),()=>n.off(I,$)},[n]),c.jsxs(c.Fragment,{children:[c.jsx(be,{children:c.jsx(_e,{...jt(l,y),...If,tip:C(`display.tips.${j}`)})}),E&&c.jsxs(c.Fragment,{children:[c.jsx(be,{children:c.jsx(Yt,{..._s(u,y),options:M})}),c.jsx(be,{children:c.jsx(Yt,{..._s(d,y),options:R})}),c.jsx(be,{children:c.jsx(Yt,{..._s(f,y),options:F})}),c.jsx(be,{children:c.jsx(fn,{property:v,...y})}),c.jsx(be,{children:c.jsx(_e,{...jt(p,y),...If})}),p.getValue()!=="nowrap"&&c.jsx(be,{children:c.jsx(Yt,{..._s(g,y),options:L})})]}),_&&c.jsxs(c.Fragment,{children:[c.jsx(be,{separatorTop:!0,children:C("flexChild")}),c.jsx(be,{children:c.jsx(fn,{property:x,options:q,...y})}),c.jsx(be,{children:c.jsx(Yt,{..._s(m,y),options:B})}),c.jsx(be,{children:c.jsx(Ne,{...nt(b,{sector:e,styleManagerDataConfig:t})})})]}),S.length>0&&c.jsx(Bs,{properties:S,...y})]})}const Z8=["topLeft","topRight","bottomLeft","bottomRight","left","right","bottom","top","full"];function X8({sector:e,styleManagerDataConfig:t}){var x;const n=Re(),s=e.getProperty("position"),r=s.getValue(),o=e.getProperty("top"),i=e.getProperty("right"),a=e.getProperty("bottom"),l=e.getProperty("left"),u=e.getProperty("z-index"),d={sector:e,styleManagerDataConfig:t},f=y=>n.t(`styleManager.position.${y}`),p=[s,o,i,a,l,u].map(y=>y==null?void 0:y.id),g=e.getProperties().filter(y=>!p.includes(`${y.id}`)),m=Z8.map(y=>({id:y,label:f(`presets.options.${y}`)})),b=["absolute","fixed"].includes(r),v=y=>{let w="auto",S="auto",C="auto",j="auto";switch(y){case"topLeft":w="0%",j="0%";break;case"topRight":w="0%",S="0%";break;case"bottomLeft":C="0%",j="0%";break;case"bottomRight":C="0%",S="0%";break;case"left":w="0%",C="0%",j="0%";break;case"right":w="0%",C="0%",S="0%";break;case"bottom":j="0%",C="0%",S="0%";break;case"top":j="0%",w="0%",S="0%";break;case"full":j="0%",w="0%",S="0%",C="0%";break}o.upValue(w),i.upValue(S),a.upValue(C),l.upValue(j)};return c.jsxs(c.Fragment,{children:[c.jsxs(be,{property:s,children:[c.jsx(_e,{...jt(s,d),tip:f(`tips.${(x=s.getOption())==null?void 0:x.id}`),...If}),b&&c.jsx(D,{children:c.jsx(It,{title:f("presets.title"),children:c.jsx(_e,{options:m,onChange:v,emptyState:"P",size:"s",caret:"",value:!0})})})]}),r!=="static"&&c.jsxs(c.Fragment,{children:[c.jsxs(be,{col:!0,children:[c.jsx(k,{className:ee("gs-utl-w-1/2 gjs-m-auto"),children:c.jsx(Ne,{...nt(o,d)})}),c.jsxs(k,{gap:"s",children:[c.jsx(D,{grow:!0,children:c.jsx(Ne,{...nt(l,d)})}),c.jsx(D,{grow:!0,children:c.jsx(Ne,{...nt(i,d)})})]}),c.jsx(k,{className:ee("gs-utl-w-1/2 gjs-m-auto"),children:c.jsx(Ne,{...nt(a,d)})})]}),c.jsx(be,{children:c.jsx(Ne,{...nt(u,d)})})]}),g.length>0&&c.jsx(Bs,{properties:g,...d})]})}function J8({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("width"),s=e.getProperty("min-width"),r=e.getProperty("max-width"),o=e.getProperty("height"),i=e.getProperty("min-height"),a=e.getProperty("max-height"),l={sector:e,styleManagerDataConfig:t},u=[n,s,r,o,i,a].map(f=>f==null?void 0:f.id),d=e.getProperties().filter(f=>!u.includes(`${f.id}`));return c.jsxs(c.Fragment,{children:[c.jsxs(be,{property:[n,o],children:[c.jsx(Ne,{...nt(n,l)}),c.jsx(Ne,{...nt(o,l)})]}),c.jsxs(be,{property:[s,i],children:[c.jsx(Ne,{...nt(s,l)}),c.jsx(Ne,{...nt(i,l)})]}),c.jsxs(be,{property:[r,a],children:[c.jsx(Ne,{...nt(r,l)}),c.jsx(Ne,{...nt(a,l)})]}),d.length>0&&c.jsx(Bs,{properties:d,...l})]})}function Q8({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("padding"),s=e.getProperty("margin"),r={sector:e,styleManagerDataConfig:t},o=[n,s].map(a=>a==null?void 0:a.id),i=e.getProperties().filter(a=>!o.includes(`${a.id}`));return c.jsxs(c.Fragment,{children:[c.jsx(fn,{property:n,...r}),c.jsx(fn,{property:s,...r}),i.length>0&&c.jsx(Bs,{properties:i,...r})]})}function e9({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("font-family"),s=e.getProperty("color"),r=e.getProperty("font-size"),o=e.getProperty("font-weight"),i=e.getProperty("line-height"),a=e.getProperty("letter-spacing"),l=e.getProperty("text-align"),u=e.getProperty("vertical-align"),d=e.getProperty("text-decoration"),f=e.getProperty("text-transform"),p=e.getProperty("direction"),g=e.getProperty("white-space"),m={sector:e,styleManagerDataConfig:t},b=[n,s,r,o,i,a,l,u,d,f,p,g].map(y=>y==null?void 0:y.id),v=e.getProperties().filter(y=>!b.includes(`${y.id}`)),{sdkAddFonts:x}=Ya();return c.jsxs(c.Fragment,{children:[!!n&&c.jsx(be,{property:n,children:x?c.jsx(bu,{...Fx(n,m)}):c.jsx(_e,{...jt(n,m)})}),!!s&&c.jsx(be,{property:s,children:c.jsx(lr,{...To(s,m)})}),c.jsxs(be,{property:[r,o],children:[!!r&&c.jsx(Ne,{...nt(r,m)}),!!o&&c.jsx(_e,{...jt(o,m)})]}),c.jsxs(be,{property:[i,a],children:[!!i&&c.jsx(Ne,{...nt(i,m)}),!!a&&c.jsx(Ne,{...nt(a,m)})]}),c.jsxs(be,{property:[l,u],children:[!!l&&c.jsx(_e,{...jt(l,m)}),!!u&&c.jsx(_e,{...jt(u,m)})]}),c.jsxs(be,{property:[f,p],children:[!!f&&c.jsx(_e,{...jt(f,m)}),!!p&&c.jsx(_e,{...jt(p,m)})]}),c.jsxs(be,{property:[g,d],children:[!!g&&c.jsx(_e,{...jt(g,m)}),!!d&&c.jsx(_e,{...jt(d,m)})]}),v.length>0&&c.jsx(Bs,{properties:v,...m})]})}const If={row:!0,classNameLabel:"gs-utl-w-full"},t9=({property:e,skipClear:t,label:n,afterLabelButtons:s=[]})=>c.jsxs(k,{nowrap:!0,full:!0,items:"center",justify:"between",gap:"s",children:[c.jsx(D,{grow:!1,children:c.jsx(Cr,{property:e,skipClear:t,label:n})}),!!s.length&&c.jsx(k,{nowrap:!0,items:"center",justify:"start",gap:"x2s",children:s.map((r,o)=>c.jsx(bt,{...r},o))})]}),Ix="gs-style-manager",_c=`${Ix}-sector`,n9=`${_c}-header`,s9=`${_c}-content`,Dx=(e,t=0,n=!0)=>N(n9,z.bgH2,je.xyS,z.br,t&&re.bt,(e||n)&&re.bb),r9=(e,t={})=>e.getOptions().map(n=>({id:e.getOptionId(n),label:e.getOptionLabel(e.getOptionId(n),t),title:n.title})),o9=(e,t)=>t.map(n=>({...n,title:e.getOptionLabel(e.getOptionId(n))})),rl=(e,t)=>{const n=i9(e,t),s=Nx(n),{hasDataResolverValue:r}=n,{label:o}=t;return{connectDataSources:n,commonProps:{size:"s",disabled:r,placeholder:e.getDefaultValue(),tip:e.get("tip")||e.get("info"),labelAs:s.length?"span":void 0,label:c.jsx(t9,{property:e,skipClear:r,label:o,afterLabelButtons:s})}}},xh=(e,t)=>{const{connectDataSources:n,commonProps:s}=rl(e,t);return{...s,value:n.dataResolverValue??e.getValue({noDefault:!0}),onChange:(r,o)=>e.upValue(r,{partial:o})}},Hx=(e,t,n)=>{const{connectDataSources:s,commonProps:r}=rl(e,t),{hasDataResolverValue:o,initialDataValue:i}=s;return{fieldProps:{...r,value:o?i:e.getValue(),options:r9(e,n??{}),onChange:a=>e.upValue(a)},connectDataSources:s}},_s=(e,t,n)=>Hx(e,t,n).fieldProps,jt=(e,t,n)=>{const{fieldProps:s,connectDataSources:r}=Hx(e,t,n),{hasDataResolverValue:o}=r,i=o?e.getValue()||" ":s.emptyState;return{...s,emptyState:i,hideCaret:o}},Fx=(e,t)=>{const{commonProps:n,connectDataSources:s}=rl(e,t),r=s.hasDataResolverValue?e.getValue()||" ":void 0;return{...n,options:void 0,emptyState:r,hideCaret:s.hasDataResolverValue,value:s.dataResolverValue??e.getValue(),onChange:o=>e.upValue(o)}},jr=(e,t,n={})=>{const{connectDataSources:s,commonProps:r}=rl(e,t),{hasDataResolverValue:o,dataResolverValue:i}=s;return{...r,title:e.getLabel(),emptyState:o?i:void 0,titleAdd:`Add new ${e.getLabel()}`,items:o?[]:e.getLayers(),selected:e.getSelectedLayer(),renderItem:a=>e.getLayerLabel(a),add:o?void 0:()=>e.addLayer(n,{at:0}),select:a=>e.selectLayer(a),remove:a=>e.removeLayer(a),move:(a,l=0)=>e.moveLayer(a,l)}},nt=(e,t)=>{const{connectDataSources:n,commonProps:s}=rl(e,t),{hasDataResolverValue:r}=n;return{...s,value:n.dataResolverValue??e.getValue({noDefault:!0}),onChange:(o,i)=>e.upValue(o,{partial:i}),valueUnit:e.getUnit(),pan:!r,units:r?[]:e.getUnits(),min:e.getMin(),max:e.getMax()||void 0,step:e.getStep(),onChangeUnit:o=>e.upUnit(o)}};function i9(e,t){const{styleManagerDataConfig:n=!1,sector:s}=t,r=e.em.getEditor(),{Styles:o}=r,i=r.getSelected(),a=o.getSelectedAll(),l=o.getSelected();let u=!1;n===!0?u=!0:i&&ur(n)&&Ye(n.enable)&&(u=n.enable({property:e,sector:s,component:i,editor:r}));const d=e.getName(),f=(l==null?void 0:l.getStyle("",{skipResolve:!0})[d])??"",p=Hr(f),g=i==null?void 0:i.collectionsStateMap;return{hasDataResolverValue:p,dataResolverValue:p?l==null?void 0:l.getStyle()[d]:void 0,enableDataValue:u,initialDataValue:f,handleDataValueChange:m=>{a.forEach(b=>{b.addStyle({[d]:m})})},handleValueClear:()=>{a.forEach(m=>{const b=m.getStyle()[d]??"";m.addStyle({[d]:b})})},editor:r,additionalSources:g}}const To=(e,t)=>xh(e,t),a9=(e,t)=>{const{label:n,...s}=xh(e,t);return{...s,label:n,isContain:e.get("contain")??!0,hideButton:s.disabled,inputField:e.get("inputField"),onOpen(){const r=e.em.Assets;r.open({select(o){e.upValue(o.getSrc()),r.close()}})}}},l9=(e,{styleManagerDataConfig:t})=>{const n=e.getId();let s=D8;switch(n){case"gs-layout":s=Y8;break;case"gs-size":s=J8;break;case"gs-space":s=Q8;break;case"gs-position":s=X8;break;case"gs-borders":s=U8;break;case"gs-effects":s=G8;break;case"gs-typography":s=e9;break;case"gs-background":s=z8;break}return c.jsx(s,{sector:e,styleManagerDataConfig:t})},Rd={},Bx=fe(function({className:t,sectors:n}){var p;const[s,r]=h.useState(Rd),o=ye(),{editor:i}=o,a=i==null?void 0:i.Styles,l=a==null?void 0:a.getSelected(),u=i==null?void 0:i.getSelected();if(h.useEffect(()=>{if(u&&i){const g=setTimeout(()=>{let m=Rd;const b=u.get("styleManager");Ye(b)&&(m=b({editor:i,component:u})),r(m||Rd)});return()=>clearTimeout(g)}},[u,i]),!a||!l)return null;const d=n.length?n:a.getSectors({visible:!0}),f=(p=o.sdkOptions.dataSources)==null?void 0:p.styleManager;return s.disabled?null:c.jsx("div",{className:N(Ix,t,"gs-utl-select-none"),children:d.map((g,m)=>c.jsx(ar,{open:g.isOpen(),onChange:({open:b})=>g.setOpen(b),classNameWrap:N(_c,`${_c}__${g.id}`),sticky:!0,handler:()=>{const b=g.getProperties({withValue:!0}).length>0,v=g.getProperties({withParentValue:!0}).length>0;return c.jsxs(k,{gap:"xs",items:"center",children:[c.jsx(D,{className:"gs-utl-mr-2",children:g.getName()}),b&&c.jsx(D,{children:c.jsx("div",{className:N(Ee.dot,z.bgA2)})}),v&&c.jsx(D,{children:c.jsx("div",{className:N(Ee.dot,z.bgW)})})]})},className:b=>Dx(b,m,m===d.length-1),children:c.jsx(k,{className:N(s9,"gs-utl-p-2 gs-utl-gap-2"),col:!0,children:l9(g,{styleManagerDataConfig:f})})},g.id))})}),c9=h.forwardRef(function({children:t,className:n,content:s,...r},o){return c.jsx("div",{className:N(ue("gs-design-manager-tab"),n),ref:o,...r,children:t})}),I1="gs-cmp-sidebar-right",D1="gs-cmp-traits-provider",$d=N("gs-utl-overflow-y-auto gs-utl-overflow-x-hidden gs-utl-max-w-full");function u9(){var y,w,S;const{isCssPanelActive:e,selectedDesignerTab:t,showSelectors:n,setSelectedDesignerTab:s,sdkProps:r,sdkOptions:o,isProjectTypeEmail:i}=ye(),a=Re(),l=N(e&&"gs-utl-hidden"),d=(((y=Bn(r.children,c9))==null?void 0:y.filter(Boolean))||[]).map(({props:C},j)=>({id:C.id,label:C.label,content:c.jsx(Qa,{children:C.children}),order:C.order??2+j+1})),f=(w=o.designPanel)==null?void 0:w.propsInStyles,p=(S=o.designPanel)==null?void 0:S.hideTabs,g=f===!0||i&&f!==!1,m=p===!0||i&&p!==!1,b=a.t("traitManager.panelLabel"),x=[{id:"style",label:a.t("styleManager.panelLabel"),order:1,content:c.jsxs(k,{col:!0,full:!0,children:[!!n&&c.jsx(D,{className:N("gs-cmp-selectors-provider",je.s,re.bb,z.br),children:c.jsx(oy,{children:C=>c.jsx(Rx,{...C})})}),g&&c.jsx(D,{className:N(D1,$d),children:c.jsx(ar,{handler:b,className:Dx(!1),sticky:!0,open:!0,children:c.jsx(bf,{children:C=>c.jsx(kf,{...C,className:N("gs-utl-p-2",z.br,re.bb)})})})}),c.jsx(D,{className:N("gs-cmp-styles-provider",$d),grow:!0,children:c.jsx(iy,{children:C=>c.jsxs(c.Fragment,{children:[e&&c.jsx(ay,{}),c.jsx(Bx,{className:l,...C})]})})})]})},!g&&{id:"props",label:b,order:2,content:c.jsx(k,{className:D1,col:!0,full:!0,children:c.jsx(D,{className:N(je.s,$d),children:c.jsx(bf,{children:C=>c.jsx(kf,{...C})})})})},...d].filter(Boolean).sort((C,j)=>C.order-j.order);return c.jsx(k,{className:I1,col:!0,full:!0,nowrap:!0,children:c.jsx(Yr,{value:t,onChange:s,tabs:x,className:N(`${I1}__tabs`,m&&"gs-utl-hidden")})})}const zx=fe(u9),d9="gs-panel-sidebar-tabs",f9=h.memo(fe(function({className:t,...n}){return c.jsx(hs,{className:N(d9,"gs-utl-h-full",t),...n,children:c.jsx(zx,{})})})),p9="gs-panel-styles",h9=h.memo(fe(function({className:t,...n}){const{isCssPanelActive:s}=ye(),r=N(s&&" gs-utl-hidden");return c.jsx(hs,{className:N(p9,"gs-utl-overflow-auto gs-utl-h-full",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-auto"),...n,children:c.jsx(iy,{children:o=>c.jsxs(c.Fragment,{children:[s&&c.jsx(ay,{}),c.jsx(Bx,{className:r,...o})]})})})})),g9="gs-panel-templates",m9=h.memo(fe(function({className:t,templates:n,content:s,onSelect:r,...o}){const i=C0(),{projectTypeFilter:a}=i;let l=n??i.templates;return l=l==null?void 0:l.map(u=>({...u,isTemplate:!0})),h.useEffect(()=>{n||i.loadTemplates()},[n]),c.jsx(hs,{className:N(g9,"gs-utl-overflow-hidden gs-utl-h-full",t),classNameAccordion:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:N("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...o,children:c.jsx(k,{className:ue("relative gs-utl-h-full"),nowrap:!0,col:!0,space:"m",children:c.jsx(k,{className:ue("gs-utl-h-[75vh] gs-utl-flex-grow"),nowrap:!0,col:!0,space:"m",children:c.jsx(Py,{templates:l,projectType:yt[a],content:s,onSelect:r,skipProjectNamePopover:!0})})})})})),b9="gs-cmp-row",v9=h.memo(function({className:t,children:n,full:s,...r}){return c.jsx(mn,{className:N(b9,z.bg,"gs-utl-flex",s&&"gs-utl-w-full",t),...r,children:Ot(n)})}),y9="gs-cmp-select-field",x9=h.memo(fe(function({className:t,style:n,label:s,name:r,value:o,options:i,size:a,onChange:l,required:u,disabled:d,emptyState:f,editorEvents:p}){const{editor:g}=ye(),[m,b]=h.useState(()=>({required:u,disabled:d,style:n,className:t,label:s,name:r,value:o,options:i,size:a,emptyState:f})),v=x=>{l({value:x,editor:g,state:m,setState:y=>b(w=>({...w,...y}))})};return Jr({editor:g,editorEvents:p,localState:m,setLocalState:b}),c.jsx(_e,{classNameContainer:N(y9,m.className),style:m.style,label:m.label,name:m.name,value:m.value??"",options:m.options??[],size:m.size,required:m.required,disabled:m.disabled,emptyState:m.emptyState,onChange:v})})),w9="gs-cmp-select-field",S9=h.memo(fe(function({className:t,style:n,label:s,name:r,value:o,size:i,onChange:a,required:l,disabled:u,emptyState:d,editorEvents:f}){const{editor:p}=ye(),[g,m]=h.useState(()=>({required:l,disabled:u,style:n,className:t,label:s,name:r,value:o,size:i,emptyState:d})),b=v=>{a({value:v,editor:p,state:g,setState:x=>m(y=>({...y,...x}))})};return Jr({editor:p,editorEvents:f,localState:g,setLocalState:m}),c.jsx(bu,{classNameContainer:N(w9,g.className),style:g.style,label:g.label,name:g.name,value:g.value??"",size:g.size,required:g.required,disabled:g.disabled,emptyState:g.emptyState,onChange:b})})),C9="gs-sidebar-bottom",j9=h.memo(fe(function({children:t,className:n,style:s,height:r,...o}){const{isInPreview:i,isBottomSidebarOpen:a}=ye(),l=r??35,u=h.useMemo(()=>({height:l,marginBottom:i||!a?`-${l}px`:0,...s}),[i,a,s]);return c.jsx(mn,{className:N(C9,"gs-utl-flex gs-utl-transition-spacing",re.bt,z.br,n),style:u,...o,children:t?Ot(t):void 0})})),E9=fe(function(t){var w;const{leftSidebarSize:n,setLeftSidebarSize:s,editor:r,isInPreview:o,isLeftSidebarOpen:i,sdkProps:a,showPages:l}=ye(),u=a.children,d=((w=t.style)==null?void 0:w.width)??t.width,f=d??n,p=t.resizable===!1,g=N(t.className,"gs-utl-h-full gs-utl-transition-spacing",re.br,z.br),m=N("gs-utl-w-full",re.bb,z.br),b=N("gs-utl-w-full gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),v=h.useMemo(()=>({marginLeft:o||!i?`-${f}px`:0,...t.style}),[f,o,i,t.style]),x=()=>r==null?void 0:r.refresh(),y=(S,C,j)=>{s(j.getBoundingClientRect().width)};return c.jsx(mu,{className:g,enable:p?!1:void 0,right:!p,style:v,height:"100%",width:f,minWidth:d??200,maxWidth:d??400,onResize:x,onResizeStop:y,children:t.children??c.jsxs(k,{full:!0,col:!0,children:[l&&c.jsx(D,{className:m,children:c.jsx(ry,{children:S=>c.jsxs(c.Fragment,{children:[Bn(u,Ex),c.jsx(Cx,{...S}),Bn(u,jx)]})})}),c.jsx(D,{className:b,grow:!0,children:c.jsx(sy,{children:S=>c.jsxs(c.Fragment,{children:[Bn(u,ex),c.jsx(Jy,{...S}),Bn(u,Qy)]})})})]})})}),P9="gs-sidebar-left",_9=h.memo(fe(function({children:t,width:n,resizable:s,...r}){return c.jsx(E9,{className:N(P9,"gs-utl-flex gs-utl-flex-col gs-utl-flex-nowrap",ru(r)),width:n,resizable:s,style:ou(r),children:t?Ot(t):void 0})})),T9=fe(function(t){var m;const{rightSidebarSize:n,setRightSidebarSize:s,editor:r,isInPreview:o,isRightSidebarOpen:i}=ye(),a=((m=t.style)==null?void 0:m.width)??t.width,l=a??n,u=t.resizable===!1,d=N(t.className,"gs-utl-h-full gs-utl-transition-spacing",re.bl,z.br),f=h.useMemo(()=>({marginRight:o||!i?`-${l}px`:0,...t.style}),[l,o,i,t.style]),p=()=>r==null?void 0:r.refresh(),g=(b,v,x)=>{s(x.getBoundingClientRect().width)};return c.jsx(mu,{className:d,enable:u?!1:void 0,left:!u,style:f,height:"100%",width:l,minWidth:a??200,maxWidth:a??400,onResize:p,onResizeStop:g,children:t.children??c.jsx(zx,{})})}),O9="gs-sidebar-right",A9=h.memo(fe(function({children:t,resizable:n,...s}){return c.jsx(T9,{className:N(O9,"gs-utl-flex gs-utl-flex-col gs-utl-flex-nowrap",ru(s)),resizable:n,style:ou(s),children:t?Ot(t):void 0})})),N9=fe(function({className:t,variant:n,value:s,tabs:r,style:o,editorEvents:i,onChange:a}){const{editor:l}=ye(),[u,d]=h.useState(()=>({tabs:r,style:o,value:s,variant:n,className:t})),f=h.useMemo(()=>{var g;return((g=u.tabs)==null?void 0:g.map(m=>({...m,content:Ot(m.children)})))||[]},[u.tabs]),p=g=>{a&&l?a({value:g,editor:l,state:u,setState:m=>d(b=>({...b,...m}))}):d(m=>({...m,value:g}))};return Jr({editor:l,editorEvents:i,localState:u,setLocalState:d}),c.jsx(Yr,{tabs:f,className:N(u.className),variant:u.variant,value:u.value,style:u.style,onChange:p})}),M9="gs-cmp-text",L9=h.memo(function({className:t,content:n,children:s,...r}){return c.jsx(mn,{className:N(M9,t),...r,children:s||n})}),R9="gs-cmp-virtual-list",$9=fe(function({id:t,items:n,itemLayout:s,itemsPerRow:r=12,className:o,style:i,htmlAttrs:a}){const[l,u]=h.useState(0),{editor:d,transitionTime:f}=ye(),p=Qp(r);return h.useEffect(()=>{const g=setTimeout(()=>u(m=>++m),f);return()=>clearTimeout(g)},[f]),!!l&&c.jsx(du,{...a,data:n,className:N(R9,"gs-utl-h-full",o),listClassName:`gs-utl-grid gs-utl-gap-2 gs-utl-pr-2 ${p}`,style:i,itemContent:(g,m)=>c.jsx(h.Fragment,{children:s?Ot(s({item:m,editor:d})):c.jsx("pre",{children:JSON.stringify(m,void 0,2)})},m.id??g)},t)});var Df=(e=>(e.icon="icon",e.text="text",e.row="row",e.column="column",e.button="button",e.buttonMenu="buttonMenu",e.buttonGroupField="buttonGroupField",e.colorPicker="colorPicker",e.menuList="menuList",e.inputField="inputField",e.codeField="codeField",e.selectField="selectField",e.selectFontField="selectFontField",e.tabs="tabs",e.devices="devices",e.custom="custom",e.panelLayers="panelLayers",e.panelPages="panelPages",e.panelSelectors="panelSelectors",e.panelStyles="panelStyles",e.panelProperties="panelProperties",e.panelSidebarTabs="panelSidebarTabs",e.panelPagesLayers="panelPagesLayers",e.panelBlocks="panelBlocks",e.panelPageSettings="panelPageSettings",e.panelGlobalStyles="panelGlobalStyles",e.panelAssets="panelAssets",e.panelTemplates="panelTemplates",e.sidebarLeft="sidebarLeft",e.sidebarRight="sidebarRight",e.sidebarTop="sidebarTop",e.sidebarBottom="sidebarBottom",e.canvas="canvas",e.canvasSidebarTop="canvasSidebarTop",e.virtualList="virtualList",e.dataPathField="dataPathField",e.panelDataVariablePicker="panelDataVariablePicker",e.panelDataConditionPicker="panelDataConditionPicker",e.panelDataCollectionPicker="panelDataCollectionPicker",e.panelDataValuePicker="panelDataValuePicker",e))(Df||{});const k9={icon:oe,row:v9,column:fR,text:L9,tabs:N9,button:su,buttonMenu:q4,buttonGroupField:Y4,colorPicker:uR,menuList:s$,inputField:t$,codeField:VL,selectField:x9,selectFontField:S9,devices:Ty,panelPages:Px,panelPageSettings:Ik,panelLayers:tx,panelPagesLayers:Wk,panelBlocks:k$,panelGlobalStyles:X$,panelSelectors:A8,panelStyles:h9,panelProperties:v8,panelSidebarTabs:f9,panelAssets:E$,panelTemplates:m9,sidebarRight:A9,sidebarLeft:_9,sidebarTop:Oy,sidebarBottom:j9,canvas:cy,canvasSidebarTop:$L,virtualList:$9,dataPathField:GR,panelDataVariablePicker:QR,panelDataConditionPicker:UR,panelDataCollectionPicker:NR,panelDataValuePicker:YR},Ot=e=>{const t=Array.isArray(e)?e:e?[e]:[],n=IA();return t.filter(Boolean).map((s,r)=>{const{type:o,...i}=ot(s)?{type:Df.text,content:s}:s||{},a=i.id||"",l=k9[o],u=n.layoutChildren.get(a),d=n.customLayoutComponents.get(o),f=a||r;if(u)return c.jsx(ff,{id:a,...u},f);if(d){const p=d({id:a,...i});return Ot([p])[0]}else{if(o===Df.custom)return c.jsx(ff,{id:a,...i},f);if(l)return c.jsx(l,{id:a,...i},f)}return null})},V9=fe(({components:e})=>(S0().customLayoutComponents,Ot(e))),Jr=e=>{const{editorEvents:t,editor:n,localState:s,setLocalState:r}=e;h.useEffect(()=>{if(!t||!n)return;const o=Object.keys(t).reduce((a,l)=>(a[l]=(u={})=>{const d=t[l];d({fromEvent:u,editor:n,state:s,setState:f=>r(p=>({...p,...f}))})},a),{}),i=Object.keys(o);return i.forEach(a=>n.on(a,o[a])),()=>{i.forEach(a=>n.off(a,o[a]))}},[n,s])},I9=e=>e.Assets.getAll().reduce((s,r)=>{const o=r.getSrc(),i=o.match(/^data:([^;]+);/);if(i){const a=o.split(",")[1],l=dA(r.get("name"));s[o]={mime:i[1],name:l,base64:a}}return s},{}),D9=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),H1=(e,t,n={})=>{let s=e;const r=n.pathPfx||"";for(const o in t)if(s.includes(o)){const i=t[o];s=s.replace(new RegExp(D9(o),"g"),`${r}${i.name}`),i.found=!0}return s},H9=(e,t,n)=>`${t||""}${e||""}${n||""}`,F9=(e,t)=>{const n=e?`<div ${mc}>${e}</div>`:"",s=t?`<div ${mc} data-gjs-global>${t}</div>`:"";return`${n}${s}`},B9=async(e,t={})=>{const{page:n,skipProject:s,assetsFolder:r="assets",filenameCss:o="style.css",styles:i,isMJML:a,exportConfig:l,skipGlobalCode:u,skipCustomCodeBody:d,scriptComponents:f}=t,p={...l,...e.config.optsHtml||{},...t.optionsHtml},g=[],m=n?[n]:e.Pages.getAll(),b=I9(e),v=`${r}/`,x=e.getCss({keepUnusedStyles:!0,component:n==null?void 0:n.getMainComponent(),...t.optionsCss})||"",y=H1(x,b,{pathPfx:v}),w=i==="inline",S=i==="skip",C=i==="skipInPage",j=f==="skip",E=u?{}:yi(e).globalPageSettings||{},_=[],T=(P,A)=>{var $t,zs,Qr;const{pageSettingOpts:M}=A||{},R=P.getName(),F=w||(M==null?void 0:M.replaceDataSources),L=br(P,"title",M)||R,B=br(P,"favicon",M),q=br(P,"description",M),H=br(P,"keywords",M),$=br(P,"socialTitle",M),I=br(P,"socialDescription",M),O=br(P,"socialImage",M),V=u?"":f0(br(P,"fonts")),G=Qt({page:P,key:"customCodeHead",opts:M})??"",W=H9(G,E.customCodeHead,V),K=Qt({page:P,key:"customCodeBody",opts:M})??"",J=d?"":F9(K,E.customCodeBody),Y=P.getMainComponent(),U=j?"":e.getJs({component:Y}),Q=U?`<script>${U}<\/script>`:"",se=[],de=[],Se={asDocument:!1,...p},ne=Y.toHTML(Se).replace("</body>",()=>`${J}${Q}</body>`),Te=Y.head;let ke=L&&`<title>${L}</title>`,it=B&&`<link rel="icon" href="${B}"/>`,st=q&&`<meta name="description" content="${q}"/>`,xe=H&&`<meta name="keywords" content="${H}"/>`,Ze=$&&`<meta property="og:title" content="${$}"/>`,Xe=I&&`<meta property="og:description" content="${I}"/>`,ft=O&&`<meta property="og:image" content="${O}"/>`,Ae='<meta charset="utf-8">',at='<meta name="viewport" content="width=device-width,initial-scale=1">',rt='<meta name="robots" content="index,follow">',Ie='<meta name="generator" content="GrapesJS Studio">';Te.components().forEach(We=>{const pt=We.toHTML(p);lt.title({cmp:We})?ke=pt:lt.favicon({cmp:We})?it=pt:lt.description({cmp:We})?st=pt:lt.keywords({cmp:We})?xe=pt:lt.socialTitle({cmp:We})?Ze=pt:lt.socialDescription({cmp:We})?Xe=pt:lt.socialImage({cmp:We})?ft=pt:lt.charset({cmp:We})?Ae=pt:lt.viewport({cmp:We})?at=pt:lt.robots({cmp:We})?rt=pt:lt.generator({cmp:We})&&(Ie=pt)}),ke&&se.push(ke),Ae&&se.push(Ae),at&&se.push(at),rt&&se.push(rt),Ie&&se.push(Ie),st&&se.push(st),xe&&se.push(xe),Ze&&se.push(Ze),Xe&&se.push(Xe),ft&&se.push(ft),it&&se.push(it),de.length&&se.push(...de),W&&se.push(W),y&&!(S||C)&&se.push(F?`<style>${y}</style>`:`<link rel="stylesheet" href="./${o}">`);const ge=Y.doctype||"<!DOCTYPE html>",$e=(zs=($t=Y.docEl).__attrToString)==null?void 0:zs.call($t,p),Ve=(Qr=Te.__attrToString)==null?void 0:Qr.call(Te,p),Me=e.getHtml(p).trim(),wt=a?e.runCommand(tu,{mjml:Me}).html:`${ge}
400
- <html${$e?` ${$e}`:""}>
401
- <head${Ve?` ${Ve}`:""}>
402
- ${se.join(`
345
+ }`),t},Pn="gs-cmp-selector-manager",ud={},Jy=ae(function(t){var ce,ge,Re;const{selectedState:n,states:s,setState:r,styleCatalog:o,stateSelector:i}=t,a=me(),[c,u]=f.useState(!1),[d,p]=f.useState([]),[h,g]=f.useState(ud),{toggleCssPanel:m,isCssPanelActive:b,editor:v,store:x}=me(),{i18nStore:y,modalStore:w}=x,S=v==null?void 0:v.getSelected(),C=v==null?void 0:v.Styles.getSelected();if(f.useEffect(()=>{if(v&&C&&a){const ve=setTimeout(()=>{let qe=ud;const Be=S==null?void 0:S.get("selectorManager");S&&Ke(Be)&&(qe=Be({editor:v,component:S})),g(qe||ud),p(L8(v,a))});return()=>clearTimeout(ve)}},[S,v,C,a]),!v)return null;const{Selectors:j}=v,E=h.disableClasses,T=h.disableComponent,O=E&&T,P=j.getComponentFirst()&&!T,_=j.getSelectedAll(),M=v.getSelectedAll(),N=s.map(ve=>({id:ve.getName(),label:ve.getLabel()})),H=v.getModel(),L=(ce=C==null?void 0:C.getDevice)==null?void 0:ce.call(C),F=(ge=C==null?void 0:C.getState)==null?void 0:ge.call(C),G=A("gs-utl-overflow-hidden",X.b,X.rnd,B.br),D=A(B.bA),$=A("gs-utl-flex gs-utl-h-full gs-utl-cursor-pointer gs-utl-p-2",X.br,B.br),I=`${B.bgA}`,R=N8(C),z=_.length>0,Y=M.length>0,Z=z||Y,J=P&&Y||!P&&!z,ee=J?"Components":"Selectors",te=ve=>y.t(`selectorManager.${ve}`),q=y.t("modals.styleCatalog.title"),ne=()=>w.open({title:q,content:l.jsx(P8,{})});return l.jsxs(k,{className:Pn,gap:"s",col:!0,full:!0,children:[l.jsxs(k,{className:A(`${Pn}__head`),items:"center",justify:"between",gap:"m",children:[l.jsxs(k,{className:A(`${Pn}__head-start`),items:"center",gap:"s",children:[l.jsx(V,{className:A(`${Pn}__head-title`),children:te("selection")}),o!==!1&&l.jsx(V,{className:A(`${Pn}__style-catalog`),children:l.jsx($t,{className:"gs-utl-cursor-pointer",onClick:ne,title:q,children:l.jsx(Q,{icon:U.paletteSwatch,size:oe.s})})})]}),!!C&&i!==!1&&!O&&l.jsx(V,{className:`${Pn}__head-end`,children:l.jsx(je,{size:"s",value:n,options:N,includeEmpty:!0,onChange:r,emptyState:`- ${te("state")} -`,className:A(n&&B.bA)})})]}),Z&&!O?l.jsxs(l.Fragment,{children:[!E&&l.jsxs(k,{className:A(`${Pn}__field-selectors`,G,!J&&D),items:"stretch",gap:"xs",children:[l.jsx($t,{title:te(z?"applyOnSelector":"noSelectors"),className:A($,!J&&I),onClick:()=>z&&j.setComponentFirst(!1),children:l.jsx(k,{className:"gs-utl-h-full",items:"center",children:l.jsx(Q,{icon:U.tag,size:oe.sx})})}),l.jsx(V,{grow:!0,children:l.jsx(k,{className:"gs-utl-h-full gs-utl-pr-1",items:"center",children:c?l.jsx(Wy,{autoFocus:!0,open:!0,hideCaret:!0,border:!1,options:d,allowNew:te("addNewSelector"),onBlur:()=>setTimeout(()=>u(!1),100),onChange:ve=>{ve&&(j.addSelected(ve.id||ve.label),u(!1))}}):l.jsxs(l.Fragment,{children:[Y&&l.jsx(ft,{title:te("addNewSelector"),variant:"out",size:"xs",className:"gs-utl-p-0.5",onClick:()=>u(!0),block:!0,children:l.jsx(Q,{icon:U.plus,size:oe.sx})}),_.map(ve=>l.jsx(T8,{selector:ve,removable:Y,toggleable:Y&&_.filter(qe=>qe.getActive()||qe===ve).length>1},ve.toString()))]})})})]}),!T&&l.jsxs(k,{className:A(`${Pn}__field-components`,G,J&&D),items:"stretch",gap:"xs",children:[l.jsx($t,{title:te(Y?"applyOnComponents":"noComponents"),onClick:()=>Y&&j.setComponentFirst(!0),className:A($,J&&I),children:l.jsx(k,{className:"gs-utl-h-full",items:"center",children:l.jsx(Q,{icon:U.targetVariant,size:oe.sx})})}),l.jsx(V,{grow:!0,className:"gs-utl-py-0.5",children:l.jsx(k,{className:"gs-utl-h-full gs-utl-pr-1",items:"center",children:M.map(ve=>l.jsx(jr,{s:"s",className:A("gs-utl-ml-1 gs-utl-my-0.5 gs-utl-cursor-default",B.cmp),onPointerEnter:()=>H.setHovered(ve),onPointerOut:()=>H.setHovered(),label:ve.getName()},ve.getId()))})})]}),l.jsxs(k,{className:`${Pn}__actions`,gap:"s",items:"center",justify:"between",children:[l.jsx($t,{title:l.jsxs(l.Fragment,{children:[l.jsx("div",{children:te("selected")}),l.jsx("pre",{className:A("gs-utl-text-xs gs-utl-mt-1 gs-utl-bg-white/10 gs-utl-text-gray-400",X.rnd,we.xyS),children:R}),l.jsx("div",{className:"gs-utl-text-xs gs-utl-mt-1.5",children:te("currentSelection")})]}),children:l.jsx(jr,{className:A(X.b,X.rnd,B.br),s:"xs",nopad:!0,block:!0,children:l.jsx(Q,{icon:U.target,size:oe.sx})})}),l.jsx(V,{className:"gs-utl-text-sm",children:l.jsx(jr,{className:A(X.b,X.rnd,B.br),s:"xs",nopad:!0,children:l.jsxs(k,{space:"xs",items:"center",nowrap:!0,children:[!!L&&L.getWidthMedia()&&l.jsxs(l.Fragment,{children:[l.jsx($t,{title:l.jsxs(l.Fragment,{children:[te("device"),": ",l.jsx("b",{children:L.getName()})]}),children:l.jsx(Q,{icon:U.cellphoneLink,size:oe.sx})}),l.jsx(V,{className:"gs-utl-opacity-30",children:"|"})]}),l.jsx($t,{title:l.jsxs(l.Fragment,{children:[te("target"),": ",l.jsx("b",{children:ee}),l.jsxs("span",{className:"gs-utl-text-xs gs-utl-opacity-75",children:[" ",(Re=C==null?void 0:C.selectorsToString)==null?void 0:Re.call(C,{skipState:1})]})]}),children:l.jsx(Q,{icon:J?U.targetVariant:U.tag,size:oe.sx})}),!!F&&l.jsxs(l.Fragment,{children:[l.jsx(V,{className:"gs-utl-opacity-30",children:"|"}),l.jsx($t,{title:l.jsxs(l.Fragment,{children:[te("state"),": ",l.jsx("b",{children:F.getLabel()})]}),children:l.jsx(Q,{icon:U.flare,size:oe.sx})})]})]})})}),l.jsx(ft,{title:y.t("toggleCss"),onClick:m,active:b,size:"s",children:l.jsx(Q,{icon:U.codeBraces,size:oe.sx})})]})]}):l.jsxs(k,{className:A(`${Pn}__empty-state`,"gs-utl-text-sm gs-utl-leading-6 gs-utl-my-4"),col:!0,children:[l.jsx(V,{className:`${Pn}__empty-state-title`,children:te("noSelecton")}),l.jsxs("ul",{className:A(`${Pn}__empty-state-list`,"gs-utl-list-disc gs-utl-pl-5 gs-utl-mt-2"),children:[l.jsx("li",{children:te("selectFromCanvas")}),l.jsx("li",{children:te("selectFromList")})]})]})]})}),$8="gs-panel-selectors",k8=f.memo(ae(function({className:t,styleCatalog:n,stateSelector:s,...r}){return l.jsx(rs,{className:A($8,t),...r,children:l.jsx(C0,{children:o=>l.jsx(Jy,{...o,styleCatalog:n,stateSelector:s})})})}));function fr({label:e,property:t,hasValue:n,empty:s,onClear:r,children:o,shallow:i,row:a,tooltip:c,skipClear:u,className:d,...p}){const h=e||(t==null?void 0:t.getLabel()),g=t==null?void 0:t.getParentTarget(),m=n||!s&&(t==null?void 0:t.hasValue({noParent:!0})),b=!m&&(t==null?void 0:t.hasValue())&&g,v=g==null?void 0:g.getDevice(),x=g==null?void 0:g.getState(),y=g==null?void 0:g.getComponent(),w=()=>r?r():t==null?void 0:t.clear(),S={className:A(d,"gs-utl-text-sm gs-utl-w-full"),col:!a,items:a?"center":void 0,...p},C=A("gs-utl-flex-1",m&&!i&&B.tAo);return t&&!t.isVisible()?null:l.jsxs(k,{gap:"xs",...S,children:[l.jsxs(k,{className:C,as:"label",items:"center",gap:"xs",nowrap:!0,children:[c&&l.jsx(V,{children:l.jsx($t,{title:c,children:l.jsx(Q,{icon:U.information,size:oe.sx})})}),l.jsx(V,{children:s?l.jsx("span",{children:" "}):h}),!!b&&!i&&l.jsx($t,{title:l.jsxs(l.Fragment,{children:[l.jsx("div",{className:A("gs-utl-mb-1"),children:"Value inherited from"}),!!v&&l.jsxs(k,{gap:"s",children:[l.jsx(V,{children:l.jsx(Q,{icon:U.cellphoneLink,size:oe.sx})}),l.jsx(V,{children:l.jsx("b",{children:v.getName()})})]}),l.jsxs(k,{gap:"s",children:[l.jsx(V,{children:l.jsx(Q,{icon:y?U.targetVariant:U.tag,size:oe.sx})}),l.jsxs(V,{children:[l.jsx("b",{children:y?"Components":"Selectors"}),l.jsxs("span",{className:A("gs-utl-text-xs gs-utl-opacity-75"),children:[" ",g==null?void 0:g.selectorsToString({skipState:1})]})]})]}),!!x&&l.jsxs(k,{gap:"s",children:[l.jsx(V,{children:l.jsx(Q,{icon:U.flare,size:oe.sx})}),l.jsx(V,{children:l.jsx("b",{children:x.getLabel()})})]})]}),children:l.jsx("div",{className:A("gs-utl-w-[6px] gs-utl-h-[6px] gs-utl-rounded-full",B.bgW)})}),m&&!i&&!u&&l.jsx($t,{title:"Clear value",onClick:w,children:l.jsx(Q,{className:Se.click,icon:U.close,size:oe.s2x})})]}),!!o&&l.jsx(V,{grow:!0,className:"gs-utl-max-w-full",children:o})]})}function lu(e){const t=e.indexOf("(")+1,n=e.lastIndexOf(")");return{name:e.substring(0,t-1).trim(),value:String.prototype.substring.apply(e,[t,n>=0?n:void 0]).trim()}}const R8=/^-?[0-9]+(\.[0-9]+)?[a-zA-Z%]{0,}$/,I8=/,(?![^(]*\))/,dd=/\s(?![^(]*\))/,V8=/^(closest-side|closest-corner|farthest-side|farthest-corner)/i,pd=/^circle|ellipse/i,Xf=e=>{var d;const t=[],{name:n,value:s}=lu(e),[r,...o]=s.split(I8).map(p=>p.trim()).filter(Boolean),i=o.length>1,a=i?r:"",c={type:"none"},u=i?o:[r,...o];if(R8.test(a))c.type="angle",c.value=a;else if(/^to\s/.test(a))c.type="side-or-corner",c.value=a;else if(V8.test(a))c.type="size",c.value=a;else if(pd.test(a)||/^at\s/.test(a)||/\sat\s/.test(a)){c.type="at",c.value=a;const p=((d=a.match(pd))==null?void 0:d[0])||"circle";c.shape=p;const h={x:"0%",y:"0%"},g={x:"0%",y:"0%"},[m,b]=a.replace(pd,"").trim().split("at").map(v=>v.trim());if(m){const[v,x]=m.split(dd);h.x=v,h.y=x||v}if(b){const[v,x]=b.split(dd);g.x=v,g.y=x||v}c.size=h,c.position=g}return u.forEach(p=>{const[h,g]=p.split(dd);t.push({color:h,hint:g?parseFloat(g):null})}),t.forEach((p,h)=>{p.hint===null&&(p.hint=h/(t.length-1)*100)}),{name:n,orientation:c,colorStops:t}},cr=({stops:e,orientation:t="to right",name:n="linear-gradient"})=>{const r=(e.length===1?[{color:e[0].color,hint:null},{color:e[0].color,hint:null}]:e).map(o=>`${o.color} ${o.hint?`${o.hint}%`:""}`.trim()).join(", ");return r?`${n}(${t}, ${r})`:"none"},H8=e=>e.slice().sort((t,n)=>(t.hint||0)-(n.hint||0)),D8="gs-cmp-grad-picker";function F8({className:e,value:t,onChange:n}){var F,G,D;const s=Xf(t),[r,o]=f.useState(s.colorStops),[i,a]=f.useState(null),c=f.useRef(null),u=K(D8,"gs-grad-picker gs-utl-select-none gs-utl-gap-1",e,X.rnd),d=s.name||"linear-gradient",p=d.indexOf("radial")>=0,h=d.indexOf("repeating")>=0,g=s.orientation.value,m=`${parseFloat(`${g}`)||180}`,b=`${parseFloat(`${(F=s.orientation.size)==null?void 0:F.x}`)||0}`,v=`${parseFloat(`${(G=s.orientation.position)==null?void 0:G.x}`)||0}`,x=`${parseFloat(`${(D=s.orientation.position)==null?void 0:D.y}`)||0}`,y=0,w=100,S=($,I=!1)=>{const R=H8($);o(R),n==null||n(cr({name:d,orientation:g,stops:R}),I)},C=($,I=!1)=>{n==null||n(cr({stops:r,name:d,orientation:`${$}deg`}),I)},j=($,I=!1)=>{n==null||n(cr({stops:r,name:d,orientation:`${$}px at ${v}% ${x}%`}),I)},E=($,I=!1)=>{n==null||n(cr({stops:r,name:d,orientation:`${b}px at ${$}% ${x}%`}),I)},T=($,I=!1)=>{n==null||n(cr({stops:r,name:d,orientation:`${b}px at ${v}% ${$}%`}),I)},O=$=>{const I=`${$?"repeating-":""}${p?"radial":"linear"}-gradient`;n==null||n(cr({stops:r,orientation:g,name:I}))},P=$=>{const I=`${h?"repeating-":""}${$?"radial":"linear"}-gradient`;n==null||n(cr({stops:r,orientation:$?"100px at 50% 50%":"90deg",name:I}))};f.useEffect(()=>{if(!i)return;const $=parseFloat(`${i.stop.hint}`),I=z=>{let Z=(z.clientX-i.x)*100;Z=Z/i.w,Z=$+Z,Z=Z<y?y:Z,Z=Z>w?w:Z,i.stop.hint=parseInt(`${Z}`,10),S(r,!0)},R=()=>{a(null),S(r)};return window.addEventListener("pointermove",I),window.addEventListener("pointerup",R),()=>{window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",R),R()}},[i]);const _=($,I)=>{const R=c.current;a({stop:I,w:(R==null?void 0:R.clientWidth)||0,h:(R==null?void 0:R.clientHeight)||0,x:$.clientX,y:$.clientY})},M=$=>{const I=c.current,R=(I==null?void 0:I.clientWidth)||0,z=(I==null?void 0:I.clientHeight)||0,Y=$.nativeEvent.offsetX-((I==null?void 0:I.clientLeft)||0),Z=$.nativeEvent.offsetY-((I==null?void 0:I.clientTop)||0),J=Y/R*100,ee=document.createElement("canvas"),te=ee.getContext("2d");if(!te)return;ee.width=R,ee.height=z;const q=te.createLinearGradient(0,0,R,z);r.forEach(ve=>q.addColorStop(parseFloat(`${ve.hint}`)/100,ve.color)),te.fillStyle=q,te.fillRect(0,0,ee.width,ee.height),ee.style.background="black";const ne=te.getImageData(Y,Z,1,1).data,ce=ne[3]?(100/255*ne[3]/100).toFixed(2):0,ge=`rgba(${ne[0]}, ${ne[1]}, ${ne[2]}, ${ce})`,Re=ge==="rgba(0, 0, 0, 0)"?"#000":ge;S([...r,{color:Re,hint:J}])},N=$=>{S(r.filter(I=>I!==$))},H=($,I,R)=>{I&&($.color=I),S(r,R)},L=$=>(i==null?void 0:i.stop)===$;return l.jsxs(k,{className:u,col:!0,children:[!!(i!=null&&i.stop)&&l.jsx("div",{className:K("fixed inset-0 z-50 cursor-colr")}),l.jsxs("div",{className:K("relative gjs-mb-6 gjs-mt-3"),children:[l.jsx("div",{className:K("bg-checker h-8",X.rnd),children:l.jsx("div",{ref:c,className:K("w-full h-full cursor-cross",X.b,X.rnd,B.br),style:{backgroundImage:cr({stops:r})},onClick:M})}),r.map(($,I)=>l.jsxs("div",{className:K("absolute top-0 h-full"),style:{left:`${$.hint}%`},children:[l.jsx("div",{className:K("cursor-pointer absolute gs-utl-translate-x-[-50%] gs-utl-top-[-14px]"),onClick:()=>N($),children:l.jsx(Q,{icon:U.close,size:oe.s3x})}),l.jsx("div",{onPointerDown:R=>_(R,$),className:K("h-full w-1 gs-utl-translate-x-[-50%] cursor-colr opacity-50 gjs-border-white",X.br,X.bl,L($)?"gjs-bg-white":"gjs-bg-black")}),l.jsx("div",{className:K("cursor-pointer gs-utl-bottom-[-17px] gs-utl-left-[-7px] absolute"),children:l.jsx(cy,{value:$.color,onChange:(R,z)=>H($,R,z),className:K("h-4 w-4 gjs-rounded-full gjs-border-2")})})]},I))]}),l.jsxs(k,{space:"s",items:"center",children:[l.jsx(V,{grow:!0,children:l.jsx(ca,{label:"Repeat",value:h,onChange:O})}),l.jsx(V,{grow:!0,children:l.jsx(ca,{label:"Radial",value:p,onChange:P})})]}),p?l.jsxs(k,{space:"s",col:!0,children:[l.jsx(V,{children:l.jsx(k,{space:"s",items:"center",children:l.jsx(V,{grow:!0,children:l.jsx(Te,{pan:"S",size:"s",value:b,onChange:j,valueUnit:"px",units:["px"]})})})}),l.jsx(V,{children:l.jsxs(k,{space:"s",children:[l.jsx(V,{grow:!0,children:l.jsx(Te,{pan:"X",size:"s",value:v,onChange:E,valueUnit:"%",units:["%"]})}),l.jsx(V,{grow:!0,children:l.jsx(Te,{pan:"Y",size:"s",value:x,onChange:T,valueUnit:"%",units:["%"]})})]})})]}):l.jsx(k,{space:"s",items:"center",nowrap:!0,children:l.jsx(V,{grow:!0,children:l.jsx(Te,{pan:"A",size:"s",value:m,onChange:C,valueUnit:"deg",units:["deg"]})})})]})}const B8="gs-sm-custom-type",z8=ae(function({property:t,editor:n}){const s=f.useRef(null),r=t.getType(),o=n.StyleManager,i=o.getType(r),a=i==null?void 0:i.view;return f.useEffect(()=>{const c=s.current;if(a&&c){const u=new a({model:t,config:o.getConfig(),attributes:t.get("attributes")}),d=u.render().el;return c.appendChild(d),()=>{c.removeChild(d),u.remove()}}},[a,t,n]),a&&l.jsx("div",{className:B8,ref:s})});function Qy(e){return e.isFull()||["slider","composite","stack","file"].includes(e.getType())}const e1="gs-cmp-style-field";function ex({property:e,sector:t,styleManagerDataConfig:n,fieldProps:s}){const r=A(e1,`${e1}__${e.id}`),o={sector:t,styleManagerDataConfig:n},i=t.em.getEditor(),a=e.getType();switch(a){case"selectFont":return l.jsx(nu,{className:r,...ox(e,o),...s});case"number":case"slider":case"integer":return l.jsx(Te,{className:r,...Qe(e,o),...s});case"color":return l.jsx(Qs,{className:r,...yo(e,o),...s});case"select":return l.jsx(je,{className:r,...wt(e,o),...s});case"radio":return l.jsx(Wt,{className:r,...bs(e,o),...s});case"file":return l.jsx(pa,{className:r,...pR(e,o),...s});case"composite":return l.jsx(an,{className:r,property:e,corners:e.get("corners"),generic:e.get("generic"),...o});case"stack":{const c=e.getProperties();return l.jsx(gs,{className:r,...hr(e,o),children:l.jsx(Ls,{properties:c,sector:t})})}default:{const c=i.StyleManager.getType(a);return!!(c!=null&&c.create)&&!!(c!=null&&c.view)?l.jsx(z8,{editor:i,property:e}):l.jsx(Je,{className:r,...Jf(e,o)})}}}const t1="gs-cmp-style-prop-row";function Ls({properties:e,sector:t,styleManagerDataConfig:n}){const s={sector:t,styleManagerDataConfig:n};return l.jsx(l.Fragment,{children:e.map(r=>{const o=r.getId(),i=A(t1,`${t1}__${o}`,Qy(r)&&"gs-utl-col-span-full");return r.isVisible()?l.jsx("div",{className:i,children:l.jsx(ex,{property:r,...s})},o):null})})}function U8({sector:e,styleManagerDataConfig:t}){const n=Va(),s=e.getProperties().filter(r=>r.isVisible()).map(r=>(n.sdkAddFonts&&r.getId()==="font-family"&&r.set("type","selectFont"),r));return l.jsx("div",{className:A("gs-utl-grid gs-utl-grid-cols-2 gs-utl-gap-2"),children:l.jsx(Ls,{properties:s,sector:e,styleManagerDataConfig:t})})}const W8="gs-cmp-sector-row";function fe({className:e,children:t,bottom:n,separator:s,separatorTop:r,property:o,...i}){const a=l.jsx("div",{className:K("gjs-mb-2 -gjs-ml-2 -gjs-mr-2",X.bb,B.br)}),c=K(W8,e,"w-full gs-utl-gap-2",n),u=(Array.isArray(o)?o:[o]).filter(Boolean);return(u.length?u.some(p=>p.isVisible()):!0)?l.jsxs(l.Fragment,{children:[r&&a,l.jsx(k,{className:c,nowrap:!0,...i,children:t}),s&&a]}):null}function _i(e,t,n={}){const s=e.getType(),{compact:r=!1,sector:o,styleManagerDataConfig:i}=n,a=e.getParent(),c={sector:o,styleManagerDataConfig:i},u=e.getDefaultValue();if(s==="select"){const p={property:a.getName()};return l.jsx(je,{...wt(e,c,p),...t?{value:t.same?e.getValue({noDefault:!0}):"",emptyState:t.same?e.getOptionLabel(u,p)||u:"Custom",onChange:h=>t.all.map(g=>g.upValue(h))}:{},label:void 0})}else return s==="color"?l.jsx(Qs,{...yo(e,c),...t?{value:t.same?e.getValue({noDefault:!0}):"",placeholder:t.same?u:"Custom",onChange:(d,p)=>t.all.map(h=>h.upValue(d,{partial:p}))}:{},label:void 0}):l.jsx(Te,{...Qe(e,c),...r?{pan:e.getLabel()[0]}:{},...t?{value:t.same?e.getValue({noDefault:!0}):"",valueUnit:t.same?e.getUnit():"",placeholder:t.same?u:"Custom",onChange:(d,p)=>t.all.map(h=>h.upValue(d,{partial:p})),onChangeUnit:d=>t.all.map(p=>p.upUnit(d))}:{},label:void 0})}const El="gs-cmp-style-prop-composite";function an({className:e,property:t,sector:n,styleManagerDataConfig:s,corners:r,compact:o,generic:i,children:a,options:c}){const[u,d]=f.useState(null);if(!(t!=null&&t.isVisible()))return null;const p={id:"custom",label:l.jsx(Q,{icon:U.borderStyle,size:oe.s}),title:"Custom"},h=[{id:"all",label:l.jsx(Q,{icon:U.borderAllVariant,size:oe.s}),title:"All"},p],g=t.isDetached(),m=t.getProperties(),b=m.length,[v,x,y,w]=m,S=v.getFullValue(),j=m.map(D=>D.getFullValue()).every(D=>D===S),E=u!==null?u:j||c?"all":p.id,T=c?[...c,p]:[],O=t.getFullValue(),P=T.some(D=>D.id===O),_=E===p.id||(c?!P:!1)||!!i,M={compact:o,sector:n,styleManagerDataConfig:s},N=l.jsx(fr,{property:o?null:v,shallow:!g,children:_i(v,null,M)}),H=l.jsx(fr,{property:o?null:x,shallow:!g,children:_i(x,null,M)}),L=!!y&&l.jsx(fr,{property:o?null:y,shallow:!g,children:_i(y,null,M)}),F=!!w&&l.jsx(fr,{property:o?null:w,shallow:!g,children:_i(w,null,M)}),G=o?{label:t.getLabel()}:{property:t};return l.jsxs(k,{className:K(El,e,"gs-utl-w-full gs-utl-gap-2"),col:!0,nowrap:!0,children:[l.jsx(fe,{className:`${El}__main`,children:l.jsx(fr,{...G,children:!i&&l.jsx(fe,{bottom:"0",children:a!==void 0?a:c?l.jsx(l.Fragment,{children:l.jsx(V,{grow:!0,children:l.jsx(Wt,{size:"s",options:T,value:_?p.id:O,onChange:D=>{D===p.id?d(D):(t.upValue(D),d(""))}})})}):l.jsxs(l.Fragment,{children:[l.jsx(V,{grow:!0,children:_i(v,{same:j,all:m},M)}),l.jsx(V,{grow:!0,children:l.jsx(Wt,{size:"s",options:h,value:E,onChange:d})})]})})})}),_&&l.jsx(fe,{col:!0,className:K(`${El}__details`,"gjs-px-2 gjs-py-1",B.bgH2,X.rnd,X.b,B.br),children:i?l.jsx("div",{className:K(`${El}__props`,"grid grid-cols-2 gap-2"),children:m.map(D=>l.jsx(fr,{property:D,shallow:!g,className:K(Qy(D)&&"col-span-full"),children:l.jsx(ex,{property:D,...M,fieldProps:{label:void 0}})},D.getId()))}):b===2?l.jsx(l.Fragment,{children:l.jsxs(k,{space:"s",children:[l.jsx(V,{grow:!0,children:N}),l.jsx(V,{grow:!0,children:H})]})}):b===3?l.jsxs(l.Fragment,{children:[l.jsxs(k,{space:"s",children:[l.jsx(V,{grow:!0,children:N}),l.jsx(V,{grow:!0,children:H})]}),l.jsx(k,{space:"s",children:l.jsx(V,{grow:!0,children:L})})]}):r?l.jsxs(l.Fragment,{children:[l.jsxs(k,{space:"s",children:[l.jsx(V,{grow:!0,children:N}),l.jsx(V,{grow:!0,children:H})]}),l.jsxs(k,{space:"s",children:[l.jsx(V,{grow:!0,children:F}),l.jsx(V,{grow:!0,children:L})]})]}):l.jsxs(l.Fragment,{children:[l.jsx(k,{className:K("gs-utl-w-1/2 gjs-m-auto"),children:N}),l.jsxs(k,{space:"s",children:[l.jsx(V,{grow:!0,children:F}),l.jsx(V,{grow:!0,children:H})]}),l.jsx(k,{className:K("gs-utl-w-1/2 gjs-m-auto"),children:L})]})})]})}var yr=(e=>(e.Image="image",e.Gradient="gradient",e.Color="color",e))(yr||{});const Bl="background-image",xs="__background-type",Xi=Bl,tx="https://placehold.co/150/777/white.png?text=IMAGE",mp="50px",G8={[xs]:"image","background-image":`url("${tx}")`,"background-size":`${mp} ${mp}`,"background-repeat":"repeat","background-position":"0px 0px"},q8=e=>(e.includes("gradient(")?Xf(e).colorStops[0].color:e)||"";function K8({sector:e,styleManagerDataConfig:t}){var S;const n=Fa(),s=e.getProperty("background"),r=s.getProperty(xs),o=s.getProperty("background-image"),i=s.getProperty("background-position"),a=s.getProperty("background-size"),c=e.getProperty("background-color"),u=e.getProperty("background-clip"),d={sector:e,styleManagerDataConfig:t},p=[s,c,u].map(C=>C==null?void 0:C.id),h=e.getProperties().filter(C=>!p.includes(`${C.id}`)),g=((S=s.getSelectedLayer())==null?void 0:S.getIndex())||-1,m=r==null?void 0:r.getValue(),b=m==="image",v=o.getValue(),x=()=>{const C=n.Assets;C.open({select(j){const E=j.getSrc();o.upValue(`url("${E}")`),C.close()}})},y=C=>{let j="none",E="100%";C==="image"?(j=`url("${tx}")`,E=mp):C==="gradient"?j="linear-gradient(90deg, black 10%, white 90%)":C==="color"&&(j="rgba(0, 0, 0, 0.5)"),o.upValue(j),r.upValue(C),i.upValue("0 0"),a.upValue(`${E} ${E}`)},w=uR(r,[{id:"image",label:l.jsx(Q,{icon:U.image,size:oe.s})},{id:"gradient",label:l.jsx(Q,{icon:U.gradientVertical,size:oe.s})},{id:"color",label:l.jsx(Q,{icon:U.checkboxBlank,size:oe.s})}]);return l.jsxs(l.Fragment,{children:[l.jsx(fe,{property:s,separator:!0,children:l.jsxs(gs,{...hr(s,d,G8),previewStyle:C=>s.getStyleFromLayer(C,{camelCase:!0}),children:[l.jsx(fe,{children:l.jsx(Wt,{...bs(r,d),options:w,onChange:y,label:void 0})}),l.jsx(fe,{children:l.jsxs(fr,{children:[b&&l.jsx(pa,{value:lu(v).value,onOpen:x}),m==="color"&&l.jsx(Qs,{...yo(o,d),value:q8(v),label:void 0}),m==="gradient"&&l.jsx(F8,{value:v,onChange:(C,j)=>o.upValue(C,{partial:j})},g)]})}),b&&l.jsxs(l.Fragment,{children:[l.jsx(fe,{col:!0,children:l.jsx(an,{property:i,...d})}),l.jsx(fe,{col:!0,children:l.jsx(an,{property:a,...d})}),l.jsxs(fe,{children:[l.jsx(je,{...wt(s.getProperty("background-repeat"),{sector:e})}),l.jsx(je,{...wt(s.getProperty("background-attachment"),{sector:e})})]}),l.jsx(fe,{children:l.jsx(je,{...wt(s.getProperty("background-origin"),{sector:e})})})]})]})}),l.jsx(fe,{property:c,children:l.jsx(Qs,{...yo(c,d)})}),l.jsx(fe,{property:u,children:l.jsx(je,{...wt(u,d)})}),h.length>0&&l.jsx(Ls,{properties:h,...d})]})}function Z8({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("border-radius"),s=e.getProperty("border-width"),r=e.getProperty("border-style"),o=e.getProperty("border-color"),i={sector:e,styleManagerDataConfig:t},a=[n,s,r,o].map(u=>u==null?void 0:u.id),c=e.getProperties().filter(u=>!a.includes(`${u.id}`));return l.jsxs(l.Fragment,{children:[l.jsx(an,{property:n,corners:!0,...i}),l.jsx(an,{property:s,...i}),l.jsx(an,{property:r,...i}),l.jsx(an,{property:o,...i}),c.length>0&&l.jsx(Ls,{properties:c,...i})]})}const Kr=e=>eu({value:parseFloat(e),min:-3,max:3}),fd=(e,t="filter",n)=>{const s=e.getProperty(`${t}-value`),r=e.getProperty(`${t}-name`).getOption()||{},o=r.units||[],i=s.getUnit(),a=AN(i,o)?i:o[0];return{...Qe(s,n),units:o,valueUnit:a,onChange:(c,u)=>{s.upValue(c,{partial:u,units:o,min:r.min,max:r.max})}}},n1=(e,t,n,s)=>{const r=e.getProperty(`${t}-name`),o=e.getProperty(`${t}-value`);return{...wt(r,n,s),onChange:i=>{r.upValue(i),o.upValue("")}}},Y8={"text-shadow-h":"1px","text-shadow-v":"1px","text-shadow-blur":"5px"};function X8({sector:e,styleManagerDataConfig:t}){const n=Ae(),s=T=>n.t(`styleManager.effects.${T}`),r=e.getProperty("box-shadow"),o=e.getProperty("text-shadow"),i=e.getProperty("filter"),a=e.getProperty("backdrop-filter"),c=e.getProperty("transition"),u=e.getProperty("transform"),d=e.getProperty("perspective-origin"),p=e.getProperty("backface-visibility"),h=e.getProperty("perspective"),g=e.getProperty("transform-style"),m=e.getProperty("opacity"),b=e.getProperty("mix-blend-mode"),v=e.getProperty("cursor"),x=e.getProperty("transform-origin"),y=e.getProperty("overflow"),w={sector:e,styleManagerDataConfig:t},S=[r,o,i,a,c,u,d,p,h,g,m,b,v,x,y].map(T=>T==null?void 0:T.id),C=e.getProperties().filter(T=>!S.includes(`${T.id}`)),j=T=>{const{boxShadowH:O,boxShadowV:P,boxShadowBlur:_,boxShadowColor:M,boxShadowSpread:N,boxShadowType:H}=T.getValues({camelCase:!0}),L=Kr(O),F=Kr(P),G=Kr(_),D=Kr(N),$=`${L}px ${F}px ${G}px ${D}px ${M} ${H}`.trim();return l.jsxs(k,{space:"s",items:"center",children:[l.jsxs(V,{grow:!0,children:[O," ",P," ",_," ",N]}),l.jsx(V,{children:l.jsx("div",{className:K("w-4 h-4 gjs-bg-white",X.b,X.rnd),style:{boxShadow:$}})})]})},E=T=>{const{textShadowH:O,textShadowV:P,textShadowBlur:_,textShadowColor:M}=T.getValues({camelCase:!0}),N=Kr(O),H=Kr(P),L=Kr(_),F=`${N}px ${H}px ${L}px ${M}`.trim();return l.jsxs(k,{space:"s",items:"center",children:[l.jsxs(V,{grow:!0,children:[O," ",P," ",_]}),l.jsx(V,{children:l.jsx("div",{className:K("w-4 h-4 gjs-bg-white",X.b,X.rnd),style:{boxShadow:F}})})]})};return l.jsxs(l.Fragment,{children:[l.jsxs(fe,{property:[m,b],children:[l.jsx(Te,{...Qe(m,w)}),l.jsx(je,{...wt(b,w)})]}),l.jsx(fe,{property:v,separator:!0,children:l.jsx(je,{...wt(v,w)})}),l.jsx(fe,{property:r,separator:!0,children:l.jsxs(gs,{...hr(r,w),renderItem:j,children:[l.jsx(fe,{children:l.jsx(Wt,{...bs(r.getProperty("box-shadow-type"),w),label:""})}),l.jsxs(fe,{children:[l.jsx(Te,{...Qe(r.getProperty("box-shadow-h"),w),label:s("boxShadow.xOffset")}),l.jsx(Te,{...Qe(r.getProperty("box-shadow-v"),w),label:s("boxShadow.yOffset")})]}),l.jsxs(fe,{children:[l.jsx(Te,{...Qe(r.getProperty("box-shadow-blur"),w),label:s("boxShadow.blur")}),l.jsx(Te,{...Qe(r.getProperty("box-shadow-spread"),w),label:s("boxShadow.spread")})]}),l.jsx(fe,{children:l.jsx(Qs,{...yo(r.getProperty("box-shadow-color"),w),label:s("boxShadow.color")})})]})}),l.jsx(fe,{property:o,separator:!0,children:l.jsxs(gs,{...hr(o,w,Y8),renderItem:E,children:[l.jsxs(fe,{children:[l.jsx(Te,{...Qe(o.getProperty("text-shadow-h"),w),label:s("textShadow.xOffset")}),l.jsx(Te,{...Qe(o.getProperty("text-shadow-v"),w),label:s("textShadow.yOffset")})]}),l.jsx(fe,{children:l.jsx(Te,{...Qe(o.getProperty("text-shadow-blur"),w),label:s("textShadow.blur")})}),l.jsx(fe,{children:l.jsx(Qs,{...yo(o.getProperty("text-shadow-color"),w),label:s("textShadow.color")})})]})}),l.jsx(fe,{property:i,separator:!0,children:l.jsx(gs,{...hr(i,w,{"filter-name":"blur","filter-value":"3px"}),children:l.jsxs(fe,{children:[l.jsx(je,{...n1(i,"filter",w),label:s("filter.type")}),l.jsx(Te,{...fd(i,void 0,w),label:s("filter.value")})]})})}),l.jsx(fe,{property:a,separator:!0,children:l.jsx(gs,{...hr(a,w,{"backdrop-filter-name":"blur","backdrop-filter-value":"3px"}),children:l.jsxs(fe,{children:[l.jsx(je,{...wt(a.getProperty("backdrop-filter-name"),w),label:s("backdropFilter.type")}),l.jsx(Te,{...fd(a,"backdrop-filter",w),label:s("backdropFilter.value")})]})})}),l.jsx(fe,{property:c,separator:!0,children:l.jsxs(gs,{...hr(c,w),children:[l.jsx(fe,{children:l.jsx(je,{...wt(c.getProperty("transition-property"),w),label:s("transition.type")})}),l.jsx(fe,{children:l.jsx(je,{...wt(c.getProperty("transition-timing-function"),w),label:s("transition.easing")})}),l.jsxs(fe,{children:[l.jsx(Te,{...Qe(c.getProperty("transition-duration"),w),label:s("transition.duration")}),l.jsx(Te,{...Qe(c.getProperty("transition-delay"),w),label:s("transition.delay")})]})]})}),l.jsx(fe,{property:u,separator:!0,children:l.jsx(gs,{...hr(u,w),children:l.jsxs(fe,{children:[l.jsx(je,{...n1(u,"transform",w),label:s("transform.type")}),l.jsx(Te,{...fd(u,"transform",w),label:s("transform.value")})]})})}),l.jsx(an,{property:x,...w}),l.jsx(an,{property:y,...w}),l.jsx(fe,{property:p,children:l.jsx(Wt,{...bs(p,w)})}),l.jsx(fe,{property:[h,g,d],separatorTop:!0,children:s("childrenTransform")}),l.jsxs(fe,{property:[h,g],children:[l.jsx(Te,{...Qe(h,w)}),l.jsx(Wt,{...bs(g,w)})]}),l.jsx(an,{property:d,...w}),C.length>0&&l.jsx(Ls,{properties:C,...w})]})}function J8(e,t){return e.indexOf(t)>=0}const ut=oe.s,Pl="M6 6v12h13V6H6zm0 13v5H5V0h1v5h13c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H6zm6-14h1v14h-1V5z",Tl="M6 6v12h13V6H6zm0-1h13c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H6a1 1 0 01-1-1V6c0-.6.4-1 1-1zm6-5h1v24h-1V0z",Ol="M6 6v12h13V6H6zm13-1V0h1v24h-1v-5H6a1 1 0 01-1-1V6c0-.6.4-1 1-1h13zm-7 0h1v14h-1V5z",s1="M2 6v12h6V6H2zm0 13v5H1V0h1v5h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H2zM16 6v12h6V6h-6zm6-1V0h1v24h-1v-5h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1h6z",r1="M11 0h1v24h-1V0zM1 6h6v12H1V6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H1a1 1 0 01-1-1V6c0-.6.4-1 1-1zm15 1h6v12h-6V6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1z",Q8="M3 6v12h6V6H3zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1H3a1 1 0 01-1-1V6c0-.6.4-1 1-1zM0 0h1v24H0V0zm14 6v12h6V6h-6zm0-1h6c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6a1 1 0 01-1-1V6c0-.6.4-1 1-1zm8-5h1v24h-1V0zM11 0h1v24h-1V0z",hd="M15 19H9V6h6v13zM8 6v13H0v1h24v-1h-8V6h8V5H0v1h8z";function eR({sector:e,styleManagerDataConfig:t}){const n=e.em.getEditor(),s=Ae(),[r,o]=f.useState({}),[i,a]=f.useState({}),c=e.getProperty("display"),u=e.getProperty("flex-direction"),d=e.getProperty("justify-content"),p=e.getProperty("align-items"),h=e.getProperty("flex-wrap"),g=e.getProperty("align-content"),m=e.getProperty("align-self"),b=e.getProperty("order"),v=e.getProperty("gap"),x=e.getProperty("flex"),y={sector:e,styleManagerDataConfig:t},w=[c,u,d,p,h,g,m,b,v,x].map(D=>D.id),S=e.getProperties().filter(D=>!w.includes(`${D.id}`)),C=D=>s.t(`styleManager.layout.${D}`),j=c.getValue(),E=j==="flex",T=(i.display||"").indexOf("flex")>=0,O=u.getValue(),P=O.indexOf("reverse")>=0,_=!J8(["column","column-reverse"],O),M=[{id:"row",label:l.jsx(Q,{icon:U.arrowRight,size:oe.sx}),title:C("direction.title.row")},{id:"row-reverse",label:l.jsx(Q,{icon:U.arrowRight,size:ut,horizontal:!0}),title:C("direction.title.row-reverse")},{id:"column",label:l.jsx(Q,{icon:U.arrowDown,size:oe.sx}),title:C("direction.title.column")},{id:"column-reverse",label:l.jsx(Q,{icon:U.arrowDown,size:ut,vertical:!0}),title:C("direction.title.column-reverse")}],N=[{id:"flex-start",title:C("justify.title.start"),label:l.jsx(Q,{icon:Pl,size:ut,rotate:_?0:90,horizontal:_&&P,vertical:!_&&P})},{id:"center",title:C("justify.title.center"),label:l.jsx(Q,{icon:Tl,size:ut,rotate:_?0:90})},{id:"flex-end",title:C("justify.title.end"),label:l.jsx(Q,{icon:Ol,size:ut,rotate:_?0:90,horizontal:_&&P,vertical:!_&&P})},{id:"space-between",title:C("justify.title.spaceBetween"),label:l.jsx(Q,{icon:s1,size:ut,rotate:_?0:90})},{id:"space-around",title:C("justify.title.spaceAround"),label:l.jsx(Q,{icon:r1,size:ut,rotate:_?0:90})},{id:"space-evenly",title:C("justify.title.spaceEvenly"),label:l.jsx(Q,{icon:Q8,size:ut,rotate:_?0:90})}],H=[{id:"stretch",title:C("align.title.stretch"),label:l.jsx(Q,{icon:hd,size:ut,rotate:_?0:90})},{id:"flex-start",title:C("align.title.start"),label:l.jsx(Q,{icon:Pl,size:ut,rotate:_?90:0})},{id:"center",title:C("align.title.center"),label:l.jsx(Q,{icon:Tl,size:ut,rotate:_?90:0})},{id:"flex-end",title:C("align.title.end"),label:l.jsx(Q,{icon:Ol,size:ut,rotate:_?90:0})}],L=[{id:"flex-start",title:C("alignContent.title.start"),label:l.jsx(Q,{icon:Pl,size:ut,rotate:_?90:0,horizontal:_&&P,vertical:!_&&P})},{id:"center",title:C("alignContent.title.center"),label:l.jsx(Q,{icon:Tl,size:ut,rotate:_?90:0})},{id:"flex-end",title:C("alignContent.title.end"),label:l.jsx(Q,{icon:Ol,size:ut,rotate:_?90:0,horizontal:_&&P,vertical:!_&&P})},{id:"space-between",title:C("alignContent.title.spaceBetween"),label:l.jsx(Q,{icon:s1,size:ut,rotate:_?90:0})},{id:"space-around",title:C("alignContent.title.spaceAround"),label:l.jsx(Q,{icon:r1,size:ut,rotate:_?90:0})},{id:"stretch",title:C("alignContent.title.stretch"),label:l.jsx(Q,{icon:hd,size:ut,rotate:_?0:90})}],F=[{id:"auto",title:C("alignSelf.title.auto"),label:l.jsx(Q,{icon:U.close,size:ut})},{id:"flex-start",title:C("alignSelf.title.start"),label:l.jsx(Q,{icon:Pl,size:ut,rotate:90})},{id:"center",title:C("alignSelf.title.center"),label:l.jsx(Q,{icon:Tl,size:ut,rotate:90})},{id:"flex-end",title:C("alignSelf.title.end"),label:l.jsx(Q,{icon:Ol,size:ut,rotate:90})},{id:"stretch",title:C("alignSelf.title.stretch"),label:l.jsx(Q,{icon:hd,size:ut,rotate:0})}],G=[{id:"0 0 auto",label:l.jsx(Q,{icon:U.close,size:ut}),title:C("flex.title.auto")},{id:"1 1 0%",label:l.jsx(Q,{icon:U.unfoldMoreHorizontal,size:ut,rotate:90}),title:C("flex.title.fillContainer")},{id:"0 1 auto",label:l.jsx(Q,{icon:U.unfoldLessHorizontal,size:ut,rotate:90}),title:C("flex.title.hugContents")}];return f.useEffect(()=>{if(!n)return()=>{};const{Styles:D}=n,$=()=>{const R=n.getSelected();let z={},Y={};if(R){const Z=R.getEl();if(Z){z=window.getComputedStyle(Z);const J=Z.parentElement;J&&(Y=window.getComputedStyle(J))}}o(z),a(Y)},I=D.events.target;return n.on(I,$),$(),()=>n.off(I,$)},[n]),l.jsxs(l.Fragment,{children:[l.jsx(fe,{children:l.jsx(je,{...wt(c,y),...bp,tip:C(`display.tips.${j}`)})}),E&&l.jsxs(l.Fragment,{children:[l.jsx(fe,{children:l.jsx(Wt,{...bs(u,y),options:M})}),l.jsx(fe,{children:l.jsx(Wt,{...bs(d,y),options:N})}),l.jsx(fe,{children:l.jsx(Wt,{...bs(p,y),options:H})}),l.jsx(fe,{children:l.jsx(an,{property:v,...y})}),l.jsx(fe,{children:l.jsx(je,{...wt(h,y),...bp})}),h.getValue()!=="nowrap"&&l.jsx(fe,{children:l.jsx(Wt,{...bs(g,y),options:L})})]}),T&&l.jsxs(l.Fragment,{children:[l.jsx(fe,{separatorTop:!0,children:C("flexChild")}),l.jsx(fe,{children:l.jsx(an,{property:x,options:G,...y})}),l.jsx(fe,{children:l.jsx(Wt,{...bs(m,y),options:F})}),l.jsx(fe,{children:l.jsx(Te,{...Qe(b,{sector:e,styleManagerDataConfig:t})})})]}),S.length>0&&l.jsx(Ls,{properties:S,...y})]})}const tR=["topLeft","topRight","bottomLeft","bottomRight","left","right","bottom","top","full"];function nR({sector:e,styleManagerDataConfig:t}){var x;const n=Ae(),s=e.getProperty("position"),r=s.getValue(),o=e.getProperty("top"),i=e.getProperty("right"),a=e.getProperty("bottom"),c=e.getProperty("left"),u=e.getProperty("z-index"),d={sector:e,styleManagerDataConfig:t},p=y=>n.t(`styleManager.position.${y}`),h=[s,o,i,a,c,u].map(y=>y==null?void 0:y.id),g=e.getProperties().filter(y=>!h.includes(`${y.id}`)),m=tR.map(y=>({id:y,label:p(`presets.options.${y}`)})),b=["absolute","fixed"].includes(r),v=y=>{let w="auto",S="auto",C="auto",j="auto";switch(y){case"topLeft":w="0%",j="0%";break;case"topRight":w="0%",S="0%";break;case"bottomLeft":C="0%",j="0%";break;case"bottomRight":C="0%",S="0%";break;case"left":w="0%",C="0%",j="0%";break;case"right":w="0%",C="0%",S="0%";break;case"bottom":j="0%",C="0%",S="0%";break;case"top":j="0%",w="0%",S="0%";break;case"full":j="0%",w="0%",S="0%",C="0%";break}o.upValue(w),i.upValue(S),a.upValue(C),c.upValue(j)};return l.jsxs(l.Fragment,{children:[l.jsxs(fe,{property:s,children:[l.jsx(je,{...wt(s,d),tip:p(`tips.${(x=s.getOption())==null?void 0:x.id}`),...bp}),b&&l.jsx(V,{children:l.jsx($t,{title:p("presets.title"),children:l.jsx(je,{options:m,onChange:v,emptyState:"P",size:"s",caret:"",value:!0})})})]}),r!=="static"&&l.jsxs(l.Fragment,{children:[l.jsxs(fe,{col:!0,children:[l.jsx(k,{className:K("gs-utl-w-1/2 gjs-m-auto"),children:l.jsx(Te,{...Qe(o,d)})}),l.jsxs(k,{gap:"s",children:[l.jsx(V,{grow:!0,children:l.jsx(Te,{...Qe(c,d)})}),l.jsx(V,{grow:!0,children:l.jsx(Te,{...Qe(i,d)})})]}),l.jsx(k,{className:K("gs-utl-w-1/2 gjs-m-auto"),children:l.jsx(Te,{...Qe(a,d)})})]}),l.jsx(fe,{children:l.jsx(Te,{...Qe(u,d)})})]}),g.length>0&&l.jsx(Ls,{properties:g,...d})]})}function sR({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("width"),s=e.getProperty("min-width"),r=e.getProperty("max-width"),o=e.getProperty("height"),i=e.getProperty("min-height"),a=e.getProperty("max-height"),c={sector:e,styleManagerDataConfig:t},u=[n,s,r,o,i,a].map(p=>p==null?void 0:p.id),d=e.getProperties().filter(p=>!u.includes(`${p.id}`));return l.jsxs(l.Fragment,{children:[l.jsxs(fe,{property:[n,o],children:[l.jsx(Te,{...Qe(n,c)}),l.jsx(Te,{...Qe(o,c)})]}),l.jsxs(fe,{property:[s,i],children:[l.jsx(Te,{...Qe(s,c)}),l.jsx(Te,{...Qe(i,c)})]}),l.jsxs(fe,{property:[r,a],children:[l.jsx(Te,{...Qe(r,c)}),l.jsx(Te,{...Qe(a,c)})]}),d.length>0&&l.jsx(Ls,{properties:d,...c})]})}function rR({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("padding"),s=e.getProperty("margin"),r={sector:e,styleManagerDataConfig:t},o=[n,s].map(a=>a==null?void 0:a.id),i=e.getProperties().filter(a=>!o.includes(`${a.id}`));return l.jsxs(l.Fragment,{children:[l.jsx(an,{property:n,...r}),l.jsx(an,{property:s,...r}),i.length>0&&l.jsx(Ls,{properties:i,...r})]})}function oR({sector:e,styleManagerDataConfig:t}){const n=e.getProperty("font-family"),s=e.getProperty("color"),r=e.getProperty("font-size"),o=e.getProperty("font-weight"),i=e.getProperty("line-height"),a=e.getProperty("letter-spacing"),c=e.getProperty("text-align"),u=e.getProperty("vertical-align"),d=e.getProperty("text-decoration"),p=e.getProperty("text-transform"),h=e.getProperty("direction"),g=e.getProperty("white-space"),m={sector:e,styleManagerDataConfig:t},b=[n,s,r,o,i,a,c,u,d,p,h,g].map(y=>y==null?void 0:y.id),v=e.getProperties().filter(y=>!b.includes(`${y.id}`)),{sdkAddFonts:x}=Va();return l.jsxs(l.Fragment,{children:[!!n&&l.jsx(fe,{property:n,children:x?l.jsx(nu,{...ox(n,m)}):l.jsx(je,{...wt(n,m)})}),!!s&&l.jsx(fe,{property:s,children:l.jsx(Qs,{...yo(s,m)})}),l.jsxs(fe,{property:[r,o],children:[!!r&&l.jsx(Te,{...Qe(r,m)}),!!o&&l.jsx(je,{...wt(o,m)})]}),l.jsxs(fe,{property:[i,a],children:[!!i&&l.jsx(Te,{...Qe(i,m)}),!!a&&l.jsx(Te,{...Qe(a,m)})]}),l.jsxs(fe,{property:[c,u],children:[!!c&&l.jsx(je,{...wt(c,m)}),!!u&&l.jsx(je,{...wt(u,m)})]}),l.jsxs(fe,{property:[p,h],children:[!!p&&l.jsx(je,{...wt(p,m)}),!!h&&l.jsx(je,{...wt(h,m)})]}),l.jsxs(fe,{property:[g,d],children:[!!g&&l.jsx(je,{...wt(g,m)}),!!d&&l.jsx(je,{...wt(d,m)})]}),v.length>0&&l.jsx(Ls,{properties:v,...m})]})}const bp={row:!0,classNameLabel:"gs-utl-w-full"},iR=({property:e,skipClear:t,label:n,afterLabelButtons:s=[]})=>l.jsxs(k,{nowrap:!0,full:!0,items:"center",justify:"between",gap:"s",children:[l.jsx(V,{grow:!1,children:l.jsx(fr,{property:e,skipClear:t,label:n})}),!!s.length&&l.jsx(k,{nowrap:!0,items:"center",justify:"start",gap:"x2s",children:s.map((r,o)=>l.jsx(ft,{...r},o))})]}),nx="gs-style-manager",fc=`${nx}-sector`,aR=`${fc}-header`,lR=`${fc}-content`,sx=(e,t=0,n=!0)=>A(aR,B.bgH2,we.xyS,B.br,t&&X.bt,(e||n)&&X.bb),cR=(e,t={})=>e.getOptions().map(n=>({id:e.getOptionId(n),label:e.getOptionLabel(e.getOptionId(n),t),title:n.title})),uR=(e,t)=>t.map(n=>({...n,title:e.getOptionLabel(e.getOptionId(n))})),qa=(e,t)=>{const n=dR(e,t),s=Zy(n),{hasDataResolverValue:r}=n,{label:o}=t;return{connectDataSources:n,commonProps:{size:"s",disabled:r,placeholder:e.getDefaultValue(),tip:e.get("tip")||e.get("info"),labelAs:s.length?"span":void 0,label:l.jsx(iR,{property:e,skipClear:r,label:o,afterLabelButtons:s})}}},Jf=(e,t)=>{const{connectDataSources:n,commonProps:s}=qa(e,t);return{...s,value:n.dataResolverValue??e.getValue({noDefault:!0}),onChange:(r,o)=>e.upValue(r,{partial:o})}},rx=(e,t,n)=>{const{connectDataSources:s,commonProps:r}=qa(e,t),{hasDataResolverValue:o,initialDataValue:i}=s;return{fieldProps:{...r,value:o?i:e.getValue(),options:cR(e,n??{}),onChange:a=>e.upValue(a)},connectDataSources:s}},bs=(e,t,n)=>rx(e,t,n).fieldProps,wt=(e,t,n)=>{const{fieldProps:s,connectDataSources:r}=rx(e,t,n),{hasDataResolverValue:o}=r,i=o?e.getValue()||" ":s.emptyState;return{...s,emptyState:i,hideCaret:o}},ox=(e,t)=>{const{commonProps:n,connectDataSources:s}=qa(e,t),r=s.hasDataResolverValue?e.getValue()||" ":void 0;return{...n,options:void 0,emptyState:r,hideCaret:s.hasDataResolverValue,value:s.dataResolverValue??e.getValue(),onChange:o=>e.upValue(o)}},hr=(e,t,n={})=>{const{connectDataSources:s,commonProps:r}=qa(e,t),{hasDataResolverValue:o,dataResolverValue:i}=s;return{...r,title:e.getLabel(),emptyState:o?i:void 0,titleAdd:`Add new ${e.getLabel()}`,items:o?[]:e.getLayers(),selected:e.getSelectedLayer(),renderItem:a=>e.getLayerLabel(a),add:o?void 0:()=>e.addLayer(n,{at:0}),select:a=>e.selectLayer(a),remove:a=>e.removeLayer(a),move:(a,c=0)=>e.moveLayer(a,c)}},Qe=(e,t)=>{const{connectDataSources:n,commonProps:s}=qa(e,t),{hasDataResolverValue:r}=n;return{...s,value:n.dataResolverValue??e.getValue({noDefault:!0}),onChange:(o,i)=>e.upValue(o,{partial:i}),valueUnit:e.getUnit(),pan:!r,units:r?[]:e.getUnits(),min:e.getMin(),max:e.getMax()||void 0,step:e.getStep(),onChangeUnit:o=>e.upUnit(o)}};function dR(e,t){const{styleManagerDataConfig:n=!1,sector:s}=t,r=e.em.getEditor(),{Styles:o}=r,i=r.getSelected(),a=o.getSelectedAll(),c=o.getSelected();let u=!1;n===!0?u=!0:i&&tr(n)&&Ke(n.enable)&&(u=n.enable({property:e,sector:s,component:i,editor:r}));const d=e.getName(),p=(c==null?void 0:c.getStyle("",{skipResolve:!0})[d])??"",h=Ar(p),g=i==null?void 0:i.collectionsStateMap;return{hasDataResolverValue:h,dataResolverValue:h?c==null?void 0:c.getStyle()[d]:void 0,enableDataValue:u,initialDataValue:p,handleDataValueChange:m=>{a.forEach(b=>{b.addStyle({[d]:m})})},handleValueClear:()=>{a.forEach(m=>{const b=m.getStyle()[d]??"";m.addStyle({[d]:b})})},editor:r,additionalSources:g}}const yo=(e,t)=>Jf(e,t),pR=(e,t)=>{const{label:n,...s}=Jf(e,t);return{...s,label:n,isContain:e.get("contain")??!0,hideButton:s.disabled,inputField:e.get("inputField"),onOpen(){const r=e.em.Assets;r.open({select(o){e.upValue(o.getSrc()),r.close()}})}}},fR=(e,{styleManagerDataConfig:t})=>{const n=e.getId();let s=U8;switch(n){case"gs-layout":s=eR;break;case"gs-size":s=sR;break;case"gs-space":s=rR;break;case"gs-position":s=nR;break;case"gs-borders":s=Z8;break;case"gs-effects":s=X8;break;case"gs-typography":s=oR;break;case"gs-background":s=K8;break}return l.jsx(s,{sector:e,styleManagerDataConfig:t})},gd={},ix=ae(function({className:t,sectors:n}){var h;const[s,r]=f.useState(gd),o=me(),{editor:i}=o,a=i==null?void 0:i.Styles,c=a==null?void 0:a.getSelected(),u=i==null?void 0:i.getSelected();if(f.useEffect(()=>{if(u&&i){const g=setTimeout(()=>{let m=gd;const b=u.get("styleManager");Ke(b)&&(m=b({editor:i,component:u})),r(m||gd)});return()=>clearTimeout(g)}},[u,i]),!a||!c)return null;const d=n.length?n:a.getSectors({visible:!0}),p=(h=o.sdkOptions.dataSources)==null?void 0:h.styleManager;return s.disabled?null:l.jsx("div",{className:A(nx,t,"gs-utl-select-none"),children:d.map((g,m)=>l.jsx(Js,{open:g.isOpen(),onChange:({open:b})=>g.setOpen(b),classNameWrap:A(fc,`${fc}__${g.id}`),sticky:!0,handler:()=>{const b=g.getProperties({withValue:!0}).length>0,v=g.getProperties({withParentValue:!0}).length>0;return l.jsxs(k,{gap:"xs",items:"center",children:[l.jsx(V,{className:"gs-utl-mr-2",children:g.getName()}),b&&l.jsx(V,{children:l.jsx("div",{className:A(Se.dot,B.bgA2)})}),v&&l.jsx(V,{children:l.jsx("div",{className:A(Se.dot,B.bgW)})})]})},className:b=>sx(b,m,m===d.length-1),children:l.jsx(k,{className:A(lR,"gs-utl-p-2 gs-utl-gap-2"),col:!0,children:fR(g,{styleManagerDataConfig:p})})},g.id))})}),hR=f.forwardRef(function({children:t,className:n,content:s,...r},o){return l.jsx("div",{className:A(ie("gs-design-manager-tab"),n),ref:o,...r,children:t})}),o1="gs-cmp-sidebar-right",i1="gs-cmp-traits-provider",md=A("gs-utl-overflow-y-auto gs-utl-overflow-x-hidden gs-utl-max-w-full");function gR(){var y,w,S;const{isCssPanelActive:e,selectedDesignerTab:t,showSelectors:n,setSelectedDesignerTab:s,sdkProps:r,sdkOptions:o,isProjectTypeEmail:i}=me(),a=Ae(),c=A(e&&"gs-utl-hidden"),d=(((y=$n(r.children,hR))==null?void 0:y.filter(Boolean))||[]).map(({props:C},j)=>({id:C.id,label:C.label,content:l.jsx(Ba,{children:C.children}),order:C.order??2+j+1})),p=(w=o.designPanel)==null?void 0:w.propsInStyles,h=(S=o.designPanel)==null?void 0:S.hideTabs,g=p===!0||i&&p!==!1,m=h===!0||i&&h!==!1,b=a.t("traitManager.panelLabel"),x=[{id:"style",label:a.t("styleManager.panelLabel"),order:1,content:l.jsxs(k,{col:!0,full:!0,children:[!!n&&l.jsx(V,{className:A("gs-cmp-selectors-provider",we.s,X.bb,B.br),children:l.jsx(C0,{children:C=>l.jsx(Jy,{...C})})}),g&&l.jsx(V,{className:A(i1,md),children:l.jsx(Js,{handler:b,className:sx(!1),sticky:!0,open:!0,children:l.jsx(Yd,{children:C=>l.jsx(gp,{...C,className:A("gs-utl-p-2",B.br,X.bb)})})})}),l.jsx(V,{className:A("gs-cmp-styles-provider",md),grow:!0,children:l.jsx(j0,{children:C=>l.jsxs(l.Fragment,{children:[e&&l.jsx(E0,{}),l.jsx(ix,{className:c,...C})]})})})]})},!g&&{id:"props",label:b,order:2,content:l.jsx(k,{className:i1,col:!0,full:!0,children:l.jsx(V,{className:A(we.s,md),children:l.jsx(Yd,{children:C=>l.jsx(gp,{...C})})})})},...d].filter(Boolean).sort((C,j)=>C.order-j.order);return l.jsx(k,{className:o1,col:!0,full:!0,nowrap:!0,children:l.jsx(Dr,{value:t,onChange:s,tabs:x,className:A(`${o1}__tabs`,m&&"gs-utl-hidden")})})}const ax=ae(gR),mR="gs-panel-sidebar-tabs",bR=f.memo(ae(function({className:t,...n}){return l.jsx(rs,{className:A(mR,"gs-utl-h-full",t),...n,children:l.jsx(ax,{})})})),vR="gs-panel-styles",yR=f.memo(ae(function({className:t,...n}){const{isCssPanelActive:s}=me(),r=A(s&&" gs-utl-hidden");return l.jsx(rs,{className:A(vR,"gs-utl-overflow-auto gs-utl-h-full",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-auto"),...n,children:l.jsx(j0,{children:o=>l.jsxs(l.Fragment,{children:[s&&l.jsx(E0,{}),l.jsx(ix,{className:r,...o})]})})})})),xR="gs-panel-templates",wR=f.memo(ae(function({className:t,templates:n,content:s,onSelect:r,...o}){const i=Fv(),{projectTypeFilter:a}=i;let c=n??i.templates;return c=c==null?void 0:c.map(u=>({...u,isTemplate:!0})),f.useEffect(()=>{n||i.loadTemplates()},[n]),l.jsx(rs,{className:A(xR,"gs-utl-overflow-hidden gs-utl-h-full",t),classNameAccordion:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),classNameAccordionContent:A("gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),...o,children:l.jsx(k,{className:ie("relative gs-utl-h-full"),nowrap:!0,col:!0,space:"m",children:l.jsx(k,{className:ie("gs-utl-h-[75vh] gs-utl-flex-grow"),nowrap:!0,col:!0,space:"m",children:l.jsx(U0,{templates:c,projectType:mt[a],content:s,onSelect:r,skipProjectNamePopover:!0})})})})})),SR="gs-cmp-row",CR=f.memo(function({className:t,children:n,full:s,...r}){return l.jsx(dn,{className:A(SR,B.bg,"gs-utl-flex",s&&"gs-utl-w-full",t),...r,children:Pt(n)})}),jR="gs-cmp-select-field",ER=f.memo(ae(function({className:t,style:n,label:s,name:r,value:o,options:i,size:a,onChange:c,required:u,disabled:d,emptyState:p,editorEvents:h}){const{editor:g}=me(),[m,b]=f.useState(()=>({required:u,disabled:d,style:n,className:t,label:s,name:r,value:o,options:i,size:a,emptyState:p})),v=x=>{c({value:x,editor:g,state:m,setState:y=>b(w=>({...w,...y}))})};return zr({editor:g,editorEvents:h,localState:m,setLocalState:b}),l.jsx(je,{classNameContainer:A(jR,m.className),style:m.style,label:m.label,name:m.name,value:m.value??"",options:m.options??[],size:m.size,required:m.required,disabled:m.disabled,emptyState:m.emptyState,onChange:v})})),PR="gs-cmp-select-field",TR=f.memo(ae(function({className:t,style:n,label:s,name:r,value:o,size:i,onChange:a,required:c,disabled:u,emptyState:d,editorEvents:p}){const{editor:h}=me(),[g,m]=f.useState(()=>({required:c,disabled:u,style:n,className:t,label:s,name:r,value:o,size:i,emptyState:d})),b=v=>{a({value:v,editor:h,state:g,setState:x=>m(y=>({...y,...x}))})};return zr({editor:h,editorEvents:p,localState:g,setLocalState:m}),l.jsx(nu,{classNameContainer:A(PR,g.className),style:g.style,label:g.label,name:g.name,value:g.value??"",size:g.size,required:g.required,disabled:g.disabled,emptyState:g.emptyState,onChange:b})})),OR="gs-sidebar-bottom",_R=f.memo(ae(function({children:t,className:n,style:s,height:r,...o}){const{isInPreview:i,isBottomSidebarOpen:a}=me(),c=r??35,u=f.useMemo(()=>({height:c,marginBottom:i||!a?`-${c}px`:0,...s}),[i,a,s]);return l.jsx(dn,{className:A(OR,"gs-utl-flex gs-utl-transition-spacing",X.bt,B.br,n),style:u,...o,children:t?Pt(t):void 0})})),AR=ae(function(t){var w;const{leftSidebarSize:n,setLeftSidebarSize:s,editor:r,isInPreview:o,isLeftSidebarOpen:i,sdkProps:a,showPages:c}=me(),u=a.children,d=((w=t.style)==null?void 0:w.width)??t.width,p=d??n,h=t.resizable===!1,g=A(t.className,"gs-utl-h-full gs-utl-transition-spacing",X.br,B.br),m=A("gs-utl-w-full",X.bb,B.br),b=A("gs-utl-w-full gs-utl-overflow-hidden gs-utl-flex gs-utl-flex-col"),v=f.useMemo(()=>({marginLeft:o||!i?`-${p}px`:0,...t.style}),[p,o,i,t.style]),x=()=>r==null?void 0:r.refresh(),y=(S,C,j)=>{s(j.getBoundingClientRect().width)};return l.jsx(tu,{className:g,enable:h?!1:void 0,right:!h,style:v,height:"100%",width:p,minWidth:d??200,maxWidth:d??400,onResize:x,onResizeStop:y,children:t.children??l.jsxs(k,{full:!0,col:!0,children:[c&&l.jsx(V,{className:m,children:l.jsx(S0,{children:S=>l.jsxs(l.Fragment,{children:[$n(u,zy),l.jsx(Fy,{...S}),$n(u,By)]})})}),l.jsx(V,{className:b,grow:!0,children:l.jsx(w0,{children:S=>l.jsxs(l.Fragment,{children:[$n(u,vy),l.jsx(my,{...S}),$n(u,by)]})})})]})})}),MR="gs-sidebar-left",LR=f.memo(ae(function({children:t,width:n,resizable:s,...r}){return l.jsx(AR,{className:A(MR,"gs-utl-flex gs-utl-flex-col gs-utl-flex-nowrap",zc(r)),width:n,resizable:s,style:Uc(r),children:t?Pt(t):void 0})})),NR=ae(function(t){var m;const{rightSidebarSize:n,setRightSidebarSize:s,editor:r,isInPreview:o,isRightSidebarOpen:i}=me(),a=((m=t.style)==null?void 0:m.width)??t.width,c=a??n,u=t.resizable===!1,d=A(t.className,"gs-utl-h-full gs-utl-transition-spacing",X.bl,B.br),p=f.useMemo(()=>({marginRight:o||!i?`-${c}px`:0,...t.style}),[c,o,i,t.style]),h=()=>r==null?void 0:r.refresh(),g=(b,v,x)=>{s(x.getBoundingClientRect().width)};return l.jsx(tu,{className:d,enable:u?!1:void 0,left:!u,style:p,height:"100%",width:c,minWidth:a??200,maxWidth:a??400,onResize:h,onResizeStop:g,children:t.children??l.jsx(ax,{})})}),$R="gs-sidebar-right",kR=f.memo(ae(function({children:t,resizable:n,...s}){return l.jsx(NR,{className:A($R,"gs-utl-flex gs-utl-flex-col gs-utl-flex-nowrap",zc(s)),resizable:n,style:Uc(s),children:t?Pt(t):void 0})})),RR=ae(function({className:t,variant:n,value:s,tabs:r,style:o,editorEvents:i,onChange:a}){const{editor:c}=me(),[u,d]=f.useState(()=>({tabs:r,style:o,value:s,variant:n,className:t})),p=f.useMemo(()=>{var g;return((g=u.tabs)==null?void 0:g.map(m=>({...m,content:Pt(m.children)})))||[]},[u.tabs]),h=g=>{a&&c?a({value:g,editor:c,state:u,setState:m=>d(b=>({...b,...m}))}):d(m=>({...m,value:g}))};return zr({editor:c,editorEvents:i,localState:u,setLocalState:d}),l.jsx(Dr,{tabs:p,className:A(u.className),variant:u.variant,value:u.value,style:u.style,onChange:h})}),IR="gs-cmp-text",VR=f.memo(function({className:t,content:n,children:s,...r}){return l.jsx(dn,{className:A(IR,t),...r,children:s||n})}),HR="gs-cmp-virtual-list",DR=ae(function({id:t,items:n,itemLayout:s,itemsPerRow:r=12,className:o,style:i,htmlAttrs:a}){const[c,u]=f.useState(0),{editor:d,transitionTime:p}=me(),h=Mf(r);return f.useEffect(()=>{const g=setTimeout(()=>u(m=>++m),p);return()=>clearTimeout(g)},[p]),!!c&&l.jsx(Yc,{...a,data:n,className:A(HR,"gs-utl-h-full",o),listClassName:`gs-utl-grid gs-utl-gap-2 gs-utl-pr-2 ${h}`,style:i,itemContent:(g,m)=>l.jsx(f.Fragment,{children:s?Pt(s({item:m,editor:d})):l.jsx("pre",{children:JSON.stringify(m,void 0,2)})},m.id??g)},t)});var vp=(e=>(e.icon="icon",e.text="text",e.row="row",e.column="column",e.button="button",e.buttonMenu="buttonMenu",e.buttonGroupField="buttonGroupField",e.colorPicker="colorPicker",e.menuList="menuList",e.inputField="inputField",e.codeField="codeField",e.selectField="selectField",e.selectFontField="selectFontField",e.tabs="tabs",e.devices="devices",e.custom="custom",e.panelLayers="panelLayers",e.panelPages="panelPages",e.panelSelectors="panelSelectors",e.panelStyles="panelStyles",e.panelProperties="panelProperties",e.panelSidebarTabs="panelSidebarTabs",e.panelPagesLayers="panelPagesLayers",e.panelBlocks="panelBlocks",e.panelPageSettings="panelPageSettings",e.panelGlobalStyles="panelGlobalStyles",e.panelAssets="panelAssets",e.panelTemplates="panelTemplates",e.sidebarLeft="sidebarLeft",e.sidebarRight="sidebarRight",e.sidebarTop="sidebarTop",e.sidebarBottom="sidebarBottom",e.canvas="canvas",e.canvasSidebarTop="canvasSidebarTop",e.virtualList="virtualList",e.dataPathField="dataPathField",e.panelDataVariablePicker="panelDataVariablePicker",e.panelDataConditionPicker="panelDataConditionPicker",e.panelDataCollectionPicker="panelDataCollectionPicker",e.panelDataValuePicker="panelDataValuePicker",e))(vp||{});const FR={icon:Q,row:CR,column:bN,text:VR,tabs:RR,button:Bc,buttonMenu:J4,buttonGroupField:eM,colorPicker:gN,menuList:l$,inputField:i$,codeField:BL,selectField:ER,selectFontField:TR,devices:G0,panelPages:Uy,panelPageSettings:zk,panelLayers:yy,panelPagesLayers:Yk,panelBlocks:F$,panelGlobalStyles:n6,panelSelectors:k8,panelStyles:yR,panelProperties:C8,panelSidebarTabs:bR,panelAssets:A$,panelTemplates:wR,sidebarRight:kR,sidebarLeft:LR,sidebarTop:q0,sidebarBottom:_R,canvas:T0,canvasSidebarTop:DL,virtualList:DR,dataPathField:XN,panelDataVariablePicker:r$,panelDataConditionPicker:ZN,panelDataCollectionPicker:RN,panelDataValuePicker:e$},Pt=e=>{const t=Array.isArray(e)?e:e?[e]:[],n=z3();return t.filter(Boolean).map((s,r)=>{const{type:o,...i}=nt(s)?{type:vp.text,content:s}:s||{},a=i.id||"",c=FR[o],u=n.layoutChildren.get(a),d=n.customLayoutComponents.get(o),p=a||r;if(u)return l.jsx(Wd,{id:a,...u},p);if(d){const h=d({id:a,...i});return Pt([h])[0]}else{if(o===vp.custom)return l.jsx(Wd,{id:a,...i},p);if(c)return l.jsx(c,{id:a,...i},p)}return null})},BR=ae(({components:e})=>(Dv().customLayoutComponents,Pt(e))),zr=e=>{const{editorEvents:t,editor:n,localState:s,setLocalState:r}=e;f.useEffect(()=>{if(!t||!n)return;const o=Object.keys(t).reduce((a,c)=>(a[c]=(u={})=>{const d=t[c];d({fromEvent:u,editor:n,state:s,setState:p=>r(h=>({...h,...p}))})},a),{}),i=Object.keys(o);return i.forEach(a=>n.on(a,o[a])),()=>{i.forEach(a=>n.off(a,o[a]))}},[n,s])},zR=e=>e.Assets.getAll().reduce((s,r)=>{const o=r.getSrc(),i=o.match(/^data:([^;]+);/);if(i){const a=o.split(",")[1],c=m3(r.get("name"));s[o]={mime:i[1],name:c,base64:a}}return s},{}),UR=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),a1=(e,t,n={})=>{let s=e;const r=n.pathPfx||"";for(const o in t)if(s.includes(o)){const i=t[o];s=s.replace(new RegExp(UR(o),"g"),`${r}${i.name}`),i.found=!0}return s},WR=(e,t,n)=>`${t||""}${e||""}${n||""}`,GR=(e,t)=>{const n=e?`<div ${nc}>${e}</div>`:"",s=t?`<div ${nc} data-gjs-global>${t}</div>`:"";return`${n}${s}`},qR=async(e,t={})=>{const{page:n,skipProject:s,assetsFolder:r="assets",filenameCss:o="style.css",styles:i,isMJML:a,exportConfig:c,skipGlobalCode:u,skipCustomCodeBody:d,scriptComponents:p}=t,h={...c,...e.config.optsHtml||{},...t.optionsHtml},g=[],m=n?[n]:e.Pages.getAll(),b=zR(e),v=`${r}/`,x=e.getCss({keepUnusedStyles:!0,component:n==null?void 0:n.getMainComponent(),...t.optionsCss})||"",y=a1(x,b,{pathPfx:v}),w=i==="inline",S=i==="skip",C=i==="skipInPage",j=p==="skip",E=u?{}:ii(e).globalPageSettings||{},T=[],O=(P,_)=>{var Mt,Ns,Ur;const{pageSettingOpts:M}=_||{},N=P.getName(),H=w||(M==null?void 0:M.replaceDataSources),L=ar(P,"title",M)||N,F=ar(P,"favicon",M),G=ar(P,"description",M),D=ar(P,"keywords",M),$=ar(P,"socialTitle",M),I=ar(P,"socialDescription",M),R=ar(P,"socialImage",M),z=u?"":Av(ar(P,"fonts")),Y=Zt({page:P,key:"customCodeHead",opts:M})??"",Z=WR(Y,E.customCodeHead,z),J=Zt({page:P,key:"customCodeBody",opts:M})??"",ee=d?"":GR(J,E.customCodeBody),te=P.getMainComponent(),q=j?"":e.getJs({component:te}),ne=q?`<script>${q}<\/script>`:"",ce=[],ge=[],Re={asDocument:!1,...h},ve=te.toHTML(Re).replace("</body>",()=>`${ee}${ne}</body>`),qe=te.head;let Be=L&&`<title>${L}</title>`,ht=F&&`<link rel="icon" href="${F}"/>`,et=G&&`<meta name="description" content="${G}"/>`,be=D&&`<meta name="keywords" content="${D}"/>`,Ze=$&&`<meta property="og:title" content="${$}"/>`,Ye=I&&`<meta property="og:description" content="${I}"/>`,lt=R&&`<meta property="og:image" content="${R}"/>`,Pe='<meta charset="utf-8">',st='<meta name="viewport" content="width=device-width,initial-scale=1">',tt='<meta name="robots" content="index,follow">',Ne='<meta name="generator" content="GrapesJS Studio">';qe.components().forEach(ze=>{const ct=ze.toHTML(h);rt.title({cmp:ze})?Be=ct:rt.favicon({cmp:ze})?ht=ct:rt.description({cmp:ze})?et=ct:rt.keywords({cmp:ze})?be=ct:rt.socialTitle({cmp:ze})?Ze=ct:rt.socialDescription({cmp:ze})?Ye=ct:rt.socialImage({cmp:ze})?lt=ct:rt.charset({cmp:ze})?Pe=ct:rt.viewport({cmp:ze})?st=ct:rt.robots({cmp:ze})?tt=ct:rt.generator({cmp:ze})&&(Ne=ct)}),Be&&ce.push(Be),Pe&&ce.push(Pe),st&&ce.push(st),tt&&ce.push(tt),Ne&&ce.push(Ne),et&&ce.push(et),be&&ce.push(be),Ze&&ce.push(Ze),Ye&&ce.push(Ye),lt&&ce.push(lt),ht&&ce.push(ht),ge.length&&ce.push(...ge),Z&&ce.push(Z),y&&!(S||C)&&ce.push(H?`<style>${y}</style>`:`<link rel="stylesheet" href="./${o}">`);const pe=te.doctype||"<!DOCTYPE html>",Me=(Ns=(Mt=te.docEl).__attrToString)==null?void 0:Ns.call(Mt,h),Le=(Ur=qe.__attrToString)==null?void 0:Ur.call(qe,h),Oe=e.getHtml(h).trim(),vt=a?e.runCommand(Dc,{mjml:Oe}).html:`${pe}
346
+ <html${Me?` ${Me}`:""}>
347
+ <head${Le?` ${Le}`:""}>
348
+ ${ce.join(`
403
349
  `)}
404
350
  </head>
405
- ${ne}
351
+ ${ve}
406
352
  </html>
407
- `;return{filename:uf(e,P),content:H1(wt,b,{pathPfx:v}),mimeType:"text/html"}};m.forEach(P=>{if(Jc(P)){const M=P.getMainComponent(),{dataSourceItem:R}=t,F=R?[R]:M.getDataSourceItems(),L=M.resolverCurrentItem;Object.entries(F).forEach(([B,q])=>{const H=q;M.setResolverCurrentItem(H.id??B);const $=T(P,{pageSettingOpts:{replaceDataSources:!0}}),{path:I,filename:O}=y0(P,{currentItem:H});$.path=I,$.filename=O,_.push($)}),M.setResolverCurrentItem(L)}else _.push(T(P))}),g.push(..._),a&&m.forEach(P=>{g.push({filename:uf(e,P,"mjml"),content:P.getMainComponent().toHTML(p),mimeType:"text/mjml"})});for(const P in b){const A=b[P];A.found&&g.push({path:r,filename:A.name,content:atob(A.base64),mimeType:A.mime})}return y&&!w&&!S&&g.push({filename:o,content:y,mimeType:"text/css"}),s||g.push({filename:"gjs-project.grapesjs",content:JSON.stringify(e.getProjectData()),mimeType:"application/json"}),g};function z9(e){const{Components:t,Blocks:n}=e,s=r=>{const{model:o,id:i}=r,a=o.getDefaults(),l=n.get(i),u=a.icon,d=l==null?void 0:l.get("media"),f='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',p=u&&u!==f&&!d?u:d||f;t.addType(i,{model:{defaults:{icon:p}}})};t.getTypes().forEach(s),e.on("component:type:add",s)}const U9=(e,t)=>{const{contextMenu:n}=t.appStore.store,{Canvas:s}=e;e.on(s.events.frameLoad,({window:r,el:o})=>{r.document.addEventListener("contextmenu",async a=>{if(!n.isEnabled||e.getEditing())return;a.preventDefault();const l=a.target,u=e.getModel().get("componentHovered")||e.Utils.helpers.getModel(l);if(u){const d=o.getBoundingClientRect(),f=s.getZoomDecimal();e.runCommand(ie.contextMenuComponent,{component:u,event:a,x:a.clientX*f+d.left,y:a.clientY*f+d.top})}})})};function W9(e,t){var g;const{Components:n,I18n:s}=e,{appStore:r}=t,o=s.t("dataSources.collection"),i=Dt.collection,a=Dt.collectionItem,l="data-type-data-collection",u='<svg viewBox="0 0 24 24"><path d="M2 14H8V20H2M16 8H10V10H16M2 10H8V4H2M10 4V6H22V4M10 20H16V18H10M10 16H22V14H10" /></svg>',d=(g=t.appStore.sdkOptions.dataSources)==null?void 0:g.blocks,f=m=>{const b=m.is(i)?m:m.closestType(i);if(!b)return;const v="dataCollectionPicker",x={id:v,header:!1,layout:{type:"panelDataCollectionPicker",component:b,onConfirm:()=>e.runCommand(ie.layoutRemove,{id:v})},placer:{type:"dialog",title:s.t("dataSources.editCollection"),size:"l"}};e.runCommand(ie.layoutToggle,{...x})},p=({items:m,component:b})=>[{id:`open-${i}-picker`,label:nh,command:()=>f(b)},...m];n.addType(a,{isComponent:m=>ri(m,a),model:{defaults:{...Pf(r),name:s.t("dataSources.collectionItem"),copyable:!1,emptyState:!0,icon:'<svg viewBox="0 0 24 24"><path d="M22 13H14V11H22V13M22 7H14V9H22V7M14 17H22V15H14V17M12 9V15C12 16.1 11.1 17 10 17H4C2.9 17 2 16.1 2 15V9C2 7.9 2.9 7 4 7H10C11.1 7 12 7.9 12 9M10.5 15L8.3 12L6.5 14.3L5.3 12.8L3.5 15H10.5Z" /></svg>',toolbarItems:p}}}),n.addType(i,{isComponent:m=>Ga(m,l)||ri(m,i),block:d&&{label:o,media:u,content:{type:i,components:{type:a},dataResolver:{startIndex:0,endIndex:1,dataSource:{type:"data-variable",path:""}}},...sh},model:{defaults:{...rh(r),icon:u,name:o,attributes:{[l]:!0},toolbarItems:p},init(){const m="collection-";if(!this.getCollectionId()){const v=m+Math.random().toString(36).substring(2,9);this.setCollectionId(v)}}},view:{onActive(m){m==null||m.stopPropagation(),f(this.model)}}})}function G9(e,t){var x;const{Components:n,I18n:s}=e,r=s.t("dataSources.condition"),o=s.t("dataSources.conditionTrue"),i=s.t("dataSources.conditionFalse"),a=s.t("dataSources.conditionElse"),{appStore:l}=t,u=(x=l.sdkOptions.dataSources)==null?void 0:x.blocks,d=Dt.condition,f=Dt.conditionTrue,p=Dt.conditionFalse,g="data-type-data-condition",m=`<svg viewBox="0 0 24 24">
353
+ `;return{filename:zd(e,P),content:a1(vt,b,{pathPfx:v}),mimeType:"text/html"}};m.forEach(P=>{if(Ic(P)){const M=P.getMainComponent(),{dataSourceItem:N}=t,H=N?[N]:M.getDataSourceItems(),L=M.resolverCurrentItem;Object.entries(H).forEach(([F,G])=>{const D=G;M.setResolverCurrentItem(D.id??F);const $=O(P,{pageSettingOpts:{replaceDataSources:!0}}),{path:I,filename:R}=Iv(P,{currentItem:D});$.path=I,$.filename=R,T.push($)}),M.setResolverCurrentItem(L)}else T.push(O(P))}),g.push(...T),a&&m.forEach(P=>{g.push({filename:zd(e,P,"mjml"),content:P.getMainComponent().toHTML(h),mimeType:"text/mjml"})});for(const P in b){const _=b[P];_.found&&g.push({path:r,filename:_.name,content:atob(_.base64),mimeType:_.mime})}return y&&!w&&!S&&g.push({filename:o,content:y,mimeType:"text/css"}),s||g.push({filename:"gjs-project.grapesjs",content:JSON.stringify(e.getProjectData()),mimeType:"application/json"}),g};function KR(e){const{Components:t,Blocks:n}=e,s=r=>{const{model:o,id:i}=r,a=o.getDefaults(),c=n.get(i),u=a.icon,d=c==null?void 0:c.get("media"),p='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M19 3H5c-1.11 0-2 .89-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5a2 2 0 0 0-2-2m0 2v14H5V5h14z"></path></svg>',h=u&&u!==p&&!d?u:d||p;t.addType(i,{model:{defaults:{icon:h}}})};t.getTypes().forEach(s),e.on("component:type:add",s)}const ZR=(e,t)=>{const{contextMenu:n}=t.appStore.store,{Canvas:s}=e;e.on(s.events.frameLoad,({window:r,el:o})=>{r.document.addEventListener("contextmenu",async a=>{if(!n.isEnabled||e.getEditing())return;a.preventDefault();const c=a.target,u=e.getModel().get("componentHovered")||e.Utils.helpers.getModel(c);if(u){const d=o.getBoundingClientRect(),p=s.getZoomDecimal();e.runCommand(se.contextMenuComponent,{component:u,event:a,x:a.clientX*p+d.left,y:a.clientY*p+d.top})}})})};function YR(e,t){var g;const{Components:n,I18n:s}=e,{appStore:r}=t,o=s.t("dataSources.collection"),i=kt.collection,a=kt.collectionItem,c="data-type-data-collection",u='<svg viewBox="0 0 24 24"><path d="M2 14H8V20H2M16 8H10V10H16M2 10H8V4H2M10 4V6H22V4M10 20H16V18H10M10 16H22V14H10" /></svg>',d=(g=t.appStore.sdkOptions.dataSources)==null?void 0:g.blocks,p=m=>{const b=m.is(i)?m:m.closestType(i);if(!b)return;const v="dataCollectionPicker",x={id:v,header:!1,layout:{type:"panelDataCollectionPicker",component:b,onConfirm:()=>e.runCommand(se.layoutRemove,{id:v})},placer:{type:"dialog",title:s.t("dataSources.editCollection"),size:"l"}};e.runCommand(se.layoutToggle,{...x})},h=({items:m,component:b})=>[{id:`open-${i}-picker`,label:$f,command:()=>p(b)},...m];n.addType(a,{isComponent:m=>Ko(m,a),model:{defaults:{...op(r),name:s.t("dataSources.collectionItem"),copyable:!1,emptyState:!0,icon:'<svg viewBox="0 0 24 24"><path d="M22 13H14V11H22V13M22 7H14V9H22V7M14 17H22V15H14V17M12 9V15C12 16.1 11.1 17 10 17H4C2.9 17 2 16.1 2 15V9C2 7.9 2.9 7 4 7H10C11.1 7 12 7.9 12 9M10.5 15L8.3 12L6.5 14.3L5.3 12.8L3.5 15H10.5Z" /></svg>',toolbarItems:h}}}),n.addType(i,{isComponent:m=>ka(m,c)||Ko(m,i),block:d&&{label:o,media:u,content:{type:i,components:{type:a},dataResolver:{startIndex:0,endIndex:1,dataSource:{type:"data-variable",path:""}}},...kf},model:{defaults:{...Rf(r),icon:u,name:o,attributes:{[c]:!0},toolbarItems:h},init(){const m="collection-";if(!this.getCollectionId()){const v=m+Math.random().toString(36).substring(2,9);this.setCollectionId(v)}}},view:{onActive(m){m==null||m.stopPropagation(),p(this.model)}}})}function XR(e,t){var x;const{Components:n,I18n:s}=e,r=s.t("dataSources.condition"),o=s.t("dataSources.conditionTrue"),i=s.t("dataSources.conditionFalse"),a=s.t("dataSources.conditionElse"),{appStore:c}=t,u=(x=c.sdkOptions.dataSources)==null?void 0:x.blocks,d=kt.condition,p=kt.conditionTrue,h=kt.conditionFalse,g="data-type-data-condition",m=`<svg viewBox="0 0 24 24">
408
354
  <path d="M14,4L16.29,6.29L13.41,9.17L14.83,10.59L17.71,7.71L20,10V4M10,4H4V10L6.29,7.71L11,12.41V20H13V11.59L7.71,6.29" />
409
- </svg>`,b=y=>{const w=y.is(d)?y:y.closestType(d);if(!w)return;const S="dataConditionPicker",C={id:S,header:!1,layout:{type:"panelDataConditionPicker",component:w,onConfirm:()=>e.runCommand(ie.layoutRemove,{id:S})},placer:{type:"dialog",title:s.t("dataSources.editCondition"),size:"l"}};e.runCommand(ie.layoutToggle,{...C})},v=({items:y,component:w})=>[{id:`open-${d}-picker`,label:nh,command:()=>b(w)},...y];n.addType(f,{isComponent:y=>ri(y,f),model:{defaults:{...Pf(l),tagName:"span",name:o,copyable:!1,emptyState:{styleIn:"display: inherit;"},icon:'<svg viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg>',toolbarItems:v}}}),n.addType(p,{isComponent:y=>ri(y,p),model:{defaults:{...Pf(l),tagName:"span",name:i,copyable:!1,emptyState:{styleIn:"display: inherit;"},icon:'<svg viewBox="0 0 24 24"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>',toolbarItems:v}}}),n.addType(d,{isComponent:y=>Ga(y,g)||ri(y,d),block:u&&{label:r,media:m,content:{type:d,dataResolver:{condition:{logicalOperator:"and",statements:[{left:1,operator:">",right:0}]}},components:[{type:f},{type:p}]},...sh},model:{defaults:{...rh(l),icon:m,name:r,textable:!0,stylable:!1,tagName:"span",attributes:{[g]:!0},toolbarItems:v}},view:{events:()=>({dblclick:"onActive"}),init(){const{em:y}=this;this.listenTo(y,Tn.toggleDataSourcesPreview,this.renderDataResolver)},onActive(y){e.getEditing()||(y==null||y.stopPropagation(),b(this.model))},getConditionString(){const{model:y}=this,{operator:w,statements:S=[]}=y.getCondition(),C=w==="AND"?" AND ":" OR ",E=S.map(_=>{const{left:T="",operator:P="",right:A=""}=_,M=Km(T),R=Km(A);return`(${M} ${P} ${R})`}).join(C);return`${r}: ${E}`},renderDataResolver(){const y=this.model,w=y.getIfTrueContent(),S=y.getIfFalseContent(),C=w==null?void 0:w.getEl(),j=S==null?void 0:S.getEl();if(e.runCommand(ie.getStateDataSource).showPlaceholder){C&&(C.style.display="",C.style.setProperty(co,`"${this.getConditionString()} "`)),j&&(j.style.display="",j.style.setProperty(co,`" ${a} "`));return}const _=y.isTrue();C&&(C.style.removeProperty(co),C.style.display=_?"":"none"),j&&(j.style.removeProperty(co),j.style.display=_?"none":"")}}})}function q9(e,t){var f;const{Components:n,I18n:s}=e,r=Dt.variable,o="data-type-data-variable",i="Variable",a=`<svg viewBox="0 0 24 24"><path fill="currentColor" d="${Zl.codeBraces}"/></svg>`,{appStore:l}=t,u=(f=l.sdkOptions.dataSources)==null?void 0:f.blocks,d=p=>{const g="dataVariablePicker",m={id:g,header:!1,layout:{type:"panelDataVariablePicker",component:p,onConfirm:()=>e.runCommand(ie.layoutRemove,{id:g})},placer:{type:"dialog",title:s.t("dataSources.editVariable"),size:"l"}};e.runCommand(ie.layoutToggle,{...m})};n.addType(r,{isComponent:p=>Ga(p,o)||ri(p,r),block:u&&{label:i,media:a,content:{type:r,dataResolver:{path:"",defaultValue:s.t("dataSources.defaultValue")}},...sh},model:{defaults:{...rh(l),icon:a,name:i,textable:!0,tagName:"span",attributes:{[o]:!0},toolbarItems:({items:p,component:g})=>[{id:`open-${r}-modal`,label:nh,command:()=>d(g)},...p]}},view:{events:()=>({dblclick:"onActive"}),init(){const{em:p}=this;this.listenTo(p,Tn.toggleDataSourcesPreview,this.renderDataResolver)},onActive(p){e.getEditing()||(p==null||p.stopPropagation(),d(this.model))},renderDataResolver(){const{model:p,el:g}=this;if(e.runCommand(ie.getStateDataSource).showPlaceholder){const b=p.getPath();g.textContent="",g.style.setProperty(co,`"${Vy(b)}"`);return}g.style.removeProperty(co),g.textContent=p.getDataValue()}}})}const Wo=(e,t,n)=>{const s=e.Components.getType(t);if(!s){console.warn(`Component type ${t} not found`);return}const r=s.model;e.Components.addType(t,{model:{...n,toHTML(o){var a;const{exporter:i}=o??{};return i?((a=n.toHTML)==null?void 0:a.call(this,o))??"":r.prototype.toHTML.call(this,o)??""}}})};function Bl({component:e,value:t,getCustomPath:n}){if(ur(t)&&t.path&&!t.collectionId&&n){const s=t.path??"",r=s.split(".");return{...t,path:n({component:e,path:s,paths:r})}}return t}function K9(e,{isProjectTypeEmail:t}){const n=({content:o})=>t?`<mj-raw>${o}</mj-raw>`:o,s=({content:o})=>o;function r(o){const i=this.getInnerHTML(o);if(t||o.skipTags)return i;const a=this.tagName,l=this.__attrToString(o),u=l?` ${l}`:"",d=`<${a}${u}>`,f=`</${a}>`;return`${d}${i}${f}`}Wo(e,Dt.variable,{toHTML(o){var v;const i=o.skipTags??t,a=o.exporter,l=o.wrapTemplateContent??s,u=x=>l({component:this,content:x}),d=this.tagName,f=this.__attrToString(o),p=(v=this.getDataResolver)==null?void 0:v.call(this),g=Bl({component:this,value:p,getCustomPath:o==null?void 0:o.getCustomPath}),m=a.getVariableSyntax({component:this,dataResolver:g}),b=u(m);return i?b:`<${d}${f?` ${f}`:""}>${b}</${d}>`}}),Wo(e,Dt.condition,{toHTML(o){var w,S,C;const{exporter:i}=o,a=o.wrapTemplateContent??n,l=j=>a({component:this,content:j}),u={component:this},d=o==null?void 0:o.getCustomPath,[f,p]=((w=this.components())==null?void 0:w.models)??[],g=(S=this.getDataResolver)==null?void 0:S.call(this),m=((C=this.resolveCondition)==null?void 0:C.call(this,g==null?void 0:g.condition,d))??{};let b="";if(p){const j=i.getConditionElseSyntax(u);b=`
410
- ${l(j)}
411
- ${p.toHTML(o)??""}`}const v=i.getConditionalStartSyntax({...u,dataResolver:{condition:m}}),x=i.getConditionalEndSyntax(u);return`
412
- ${`${l(v)}
413
- ${(f==null?void 0:f.toHTML(o))??""}${b}
414
- ${l(x)}`}
415
- `},resolveCondition(o,i){if(typeof o=="boolean")return o;if(!o)return{};if(gR(o))return{...o,statements:o.statements.map(l=>this.resolveCondition(l,i))??[]};const a={component:this,getCustomPath:i};return{...o,left:Bl({...a,value:o.left}),right:Bl({...a,value:o.right})}}}),Wo(e,Dt.collection,{toHTML(o){const i=o.skipTags??t,{exporter:a}=o,l=o.wrapTemplateContent??n,u=E=>l({component:this,content:E}),d={component:this},f=this.getDataResolver(),p={...f,dataSource:Bl({component:this,value:f==null?void 0:f.dataSource,getCustomPath:o==null?void 0:o.getCustomPath})},g=this.components().at(0),m=a.getCollectionStartSyntax({...d,dataResolver:p}),b=a.getCollectionEndSyntax(d),v=(g==null?void 0:g.toHTML(o))??"",x=`${u(m)}
355
+ </svg>`,b=y=>{const w=y.is(d)?y:y.closestType(d);if(!w)return;const S="dataConditionPicker",C={id:S,header:!1,layout:{type:"panelDataConditionPicker",component:w,onConfirm:()=>e.runCommand(se.layoutRemove,{id:S})},placer:{type:"dialog",title:s.t("dataSources.editCondition"),size:"l"}};e.runCommand(se.layoutToggle,{...C})},v=({items:y,component:w})=>[{id:`open-${d}-picker`,label:$f,command:()=>b(w)},...y];n.addType(p,{isComponent:y=>Ko(y,p),model:{defaults:{...op(c),tagName:"span",name:o,copyable:!1,emptyState:{styleIn:"display: inherit;"},icon:'<svg viewBox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg>',toolbarItems:v}}}),n.addType(h,{isComponent:y=>Ko(y,h),model:{defaults:{...op(c),tagName:"span",name:i,copyable:!1,emptyState:{styleIn:"display: inherit;"},icon:'<svg viewBox="0 0 24 24"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>',toolbarItems:v}}}),n.addType(d,{isComponent:y=>ka(y,g)||Ko(y,d),block:u&&{label:r,media:m,content:{type:d,dataResolver:{condition:{logicalOperator:"and",statements:[{left:1,operator:">",right:0}]}},components:[{type:p},{type:h}]},...kf},model:{defaults:{...Rf(c),icon:m,name:r,textable:!0,stylable:!1,tagName:"span",attributes:{[g]:!0},toolbarItems:v}},view:{events:()=>({dblclick:"onActive"}),init(){const{em:y}=this;this.listenTo(y,xn.toggleDataSourcesPreview,this.renderDataResolver)},onActive(y){e.getEditing()||(y==null||y.stopPropagation(),b(this.model))},getConditionString(){const{model:y}=this,{operator:w,statements:S=[]}=y.getCondition(),C=w==="AND"?" AND ":" OR ",E=S.map(T=>{const{left:O="",operator:P="",right:_=""}=T,M=gm(O),N=gm(_);return`(${M} ${P} ${N})`}).join(C);return`${r}: ${E}`},renderDataResolver(){const y=this.model,w=y.getIfTrueContent(),S=y.getIfFalseContent(),C=w==null?void 0:w.getEl(),j=S==null?void 0:S.getEl();if(e.runCommand(se.getStateDataSource).showPlaceholder){C&&(C.style.display="",C.style.setProperty(Qr,`"${this.getConditionString()} "`)),j&&(j.style.display="",j.style.setProperty(Qr,`" ${a} "`));return}const T=y.isTrue();C&&(C.style.removeProperty(Qr),C.style.display=T?"":"none"),j&&(j.style.removeProperty(Qr),j.style.display=T?"none":"")}}})}function JR(e,t){var p;const{Components:n,I18n:s}=e,r=kt.variable,o="data-type-data-variable",i="Variable",a=`<svg viewBox="0 0 24 24"><path fill="currentColor" d="${Il.codeBraces}"/></svg>`,{appStore:c}=t,u=(p=c.sdkOptions.dataSources)==null?void 0:p.blocks,d=h=>{const g="dataVariablePicker",m={id:g,header:!1,layout:{type:"panelDataVariablePicker",component:h,onConfirm:()=>e.runCommand(se.layoutRemove,{id:g})},placer:{type:"dialog",title:s.t("dataSources.editVariable"),size:"l"}};e.runCommand(se.layoutToggle,{...m})};n.addType(r,{isComponent:h=>ka(h,o)||Ko(h,r),block:u&&{label:i,media:a,content:{type:r,dataResolver:{path:"",defaultValue:s.t("dataSources.defaultValue")}},...kf},model:{defaults:{...Rf(c),icon:a,name:i,textable:!0,tagName:"span",attributes:{[o]:!0},toolbarItems:({items:h,component:g})=>[{id:`open-${r}-modal`,label:$f,command:()=>d(g)},...h]}},view:{events:()=>({dblclick:"onActive"}),init(){const{em:h}=this;this.listenTo(h,xn.toggleDataSourcesPreview,this.renderDataResolver)},onActive(h){e.getEditing()||(h==null||h.stopPropagation(),d(this.model))},renderDataResolver(){const{model:h,el:g}=this;if(e.runCommand(se.getStateDataSource).showPlaceholder){const b=h.getPath();g.textContent="",g.style.setProperty(Qr,`"${ty(b)}"`);return}g.style.removeProperty(Qr),g.textContent=h.getDataValue()}}})}const ko=(e,t,n)=>{const s=e.Components.getType(t);if(!s){console.warn(`Component type ${t} not found`);return}const r=s.model;e.Components.addType(t,{model:{...n,toHTML(o){var a;const{exporter:i}=o??{};return i?((a=n.toHTML)==null?void 0:a.call(this,o))??"":r.prototype.toHTML.call(this,o)??""}}})};function _l({component:e,value:t,getCustomPath:n}){if(tr(t)&&t.path&&!t.collectionId&&n){const s=t.path??"",r=s.split(".");return{...t,path:n({component:e,path:s,paths:r})}}return t}function QR(e,{isProjectTypeEmail:t}){const n=({content:o})=>t?`<mj-raw>${o}</mj-raw>`:o,s=({content:o})=>o;function r(o){const i=this.getInnerHTML(o);if(t||o.skipTags)return i;const a=this.tagName,c=this.__attrToString(o),u=c?` ${c}`:"",d=`<${a}${u}>`,p=`</${a}>`;return`${d}${i}${p}`}ko(e,kt.variable,{toHTML(o){var v;const i=o.skipTags??t,a=o.exporter,c=o.wrapTemplateContent??s,u=x=>c({component:this,content:x}),d=this.tagName,p=this.__attrToString(o),h=(v=this.getDataResolver)==null?void 0:v.call(this),g=_l({component:this,value:h,getCustomPath:o==null?void 0:o.getCustomPath}),m=a.getVariableSyntax({component:this,dataResolver:g}),b=u(m);return i?b:`<${d}${p?` ${p}`:""}>${b}</${d}>`}}),ko(e,kt.condition,{toHTML(o){var w,S,C;const{exporter:i}=o,a=o.wrapTemplateContent??n,c=j=>a({component:this,content:j}),u={component:this},d=o==null?void 0:o.getCustomPath,[p,h]=((w=this.components())==null?void 0:w.models)??[],g=(S=this.getDataResolver)==null?void 0:S.call(this),m=((C=this.resolveCondition)==null?void 0:C.call(this,g==null?void 0:g.condition,d))??{};let b="";if(h){const j=i.getConditionElseSyntax(u);b=`
356
+ ${c(j)}
357
+ ${h.toHTML(o)??""}`}const v=i.getConditionalStartSyntax({...u,dataResolver:{condition:m}}),x=i.getConditionalEndSyntax(u);return`
358
+ ${`${c(v)}
359
+ ${(p==null?void 0:p.toHTML(o))??""}${b}
360
+ ${c(x)}`}
361
+ `},resolveCondition(o,i){if(typeof o=="boolean")return o;if(!o)return{};if(xN(o))return{...o,statements:o.statements.map(c=>this.resolveCondition(c,i))??[]};const a={component:this,getCustomPath:i};return{...o,left:_l({...a,value:o.left}),right:_l({...a,value:o.right})}}}),ko(e,kt.collection,{toHTML(o){const i=o.skipTags??t,{exporter:a}=o,c=o.wrapTemplateContent??n,u=E=>c({component:this,content:E}),d={component:this},p=this.getDataResolver(),h={...p,dataSource:_l({component:this,value:p==null?void 0:p.dataSource,getCustomPath:o==null?void 0:o.getCustomPath})},g=this.components().at(0),m=a.getCollectionStartSyntax({...d,dataResolver:h}),b=a.getCollectionEndSyntax(d),v=(g==null?void 0:g.toHTML(o))??"",x=`${u(m)}
416
362
  ${v}
417
363
  ${u(b)}`;if(i)return`
418
364
  ${x}
419
365
  `;const y=this.tagName,w=this.__attrToString(o),S=w?` ${w}`:"",C=`<${y}${S}>`,j=`</${y}>`;return`
420
366
  ${C}${x}${j}
421
- `}}),Wo(e,Dt.conditionTrue,{toHTML:r}),Wo(e,Dt.conditionFalse,{toHTML:r}),Wo(e,Dt.collectionItem,{toHTML:r})}const Y9=function(e,t){const{Components:n,Canvas:s,events:r}=e;if(!n.getType(Dt.conditionTrue))return;const{isProjectTypeEmail:o,sdkOptions:i}=t.appStore,{dataSources:a}=i;a!=null&&a.globalData&&e.on(r.projectLoad,()=>{e.DataSources.add({id:ko.globalData,records:Iy(a.globalData),skipFromStorage:!0})}),e.on(s.events.frameLoadBody,({window:l})=>{const u="data-outline-ds",d=l.document;if(d.querySelector(`style[${u}]`))return;const p=d.createElement("style"),g=[Dt.variable,Dt.condition,Dt.collection].map(m=>`.gjs-dashed [data-gjs-highlightable][data-gjs-type="${m}"]`);p.setAttribute(u,""),p.textContent=`
367
+ `}}),ko(e,kt.conditionTrue,{toHTML:r}),ko(e,kt.conditionFalse,{toHTML:r}),ko(e,kt.collectionItem,{toHTML:r})}const e9=function(e,t){const{Components:n,Canvas:s,events:r}=e;if(!n.getType(kt.conditionTrue))return;const{isProjectTypeEmail:o,sdkOptions:i}=t.appStore,{dataSources:a}=i;a!=null&&a.globalData&&e.on(r.projectLoad,()=>{e.DataSources.add({id:Po.globalData,records:ny(a.globalData),skipFromStorage:!0})}),e.on(s.events.frameLoadBody,({window:c})=>{const u="data-outline-ds",d=c.document;if(d.querySelector(`style[${u}]`))return;const h=d.createElement("style"),g=[kt.variable,kt.condition,kt.collection].map(m=>`.gjs-dashed [data-gjs-highlightable][data-gjs-type="${m}"]`);h.setAttribute(u,""),h.textContent=`
422
368
  ${g.join(",")} {
423
369
  outline: 2px dotted #8b5cf6;
424
370
  }
@@ -431,7 +377,7 @@ ${C}${x}${j}
431
377
  [data-gjs-type="data-variable"]::before,
432
378
  [data-gjs-type="data-condition-true-content"]::before,
433
379
  [data-gjs-type="data-condition-false-content"]::before {
434
- content: var(${co});
380
+ content: var(${Qr});
435
381
  font-style: italic;
436
382
  color: #666;
437
383
  white-space: nowrap;
@@ -442,7 +388,7 @@ ${C}${x}${j}
442
388
  font-weight: 500;
443
389
  font-family: sans-serif;
444
390
  }
445
- `,d.head.appendChild(p)}),q9(e,t),G9(e,t),W9(e,t),K9(e,{isProjectTypeEmail:o})};function Z9(e){const{Components:t}=e,n=s=>{const{id:r,model:o}=s;if(r==="custom-code"){const i="<span>Insert here your custom code</span>";t.addType(r,{model:{defaults:{emptyState:!0,icon:'<svg viewBox="0 0 24 24"><path d="M14.6 16.6l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4z"></path></svg>',classes:"gjs-custom-code",components:i,"custom-code-plugin__code":i,styles:".gjs-custom-code { padding: 5px; }"}}})}if(r==="typed"){const i=o.getDefaults().traits.map(a=>a.name==="strings"?{...a,type:"stack",addItem(l){return{id:l,label:`New string ${l}`}},getValue({component:l}){return l.get("strings").map((u,d)=>({id:`${d}`,label:u}))},setValue:({component:l,value:u})=>{const d=u.map(f=>f.label);l.set({strings:d}),l.trigger("rerender")},properties:[{name:"label"}]}:a);t.addType(r,{model:{defaults:{traits:i,strings:["These are the default values...!!!","Use your own strings from Properties!","Have a great day!"],icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><path d="M212.3 44l2.3 49.6h-6A60 60 0 00204 75c-3.2-6-7.5-10.5-12.9-13.3a44.9 44.9 0 00-21.1-4.3h-29.8V219c0 13 1.4 21 4.2 24.3 4 4.4 10 6.6 18.2 6.6h7.4v5.7H80.2V250h7.5c9 0 15.3-2.7 19-8.2 2.4-3.3 3.5-10.9 3.5-22.7V57.3H84.8a71 71 0 00-21.1 2.2 29 29 0 00-13.9 11.3 46.1 46.1 0 00-6.9 22.8H37L39.5 44h172.8zM245 22h18v256h-18z"/></svg>',classes:"gjs-typed",styles:`
391
+ `,d.head.appendChild(h)}),JR(e,t),XR(e,t),YR(e,t),QR(e,{isProjectTypeEmail:o})};function t9(e){const{Components:t}=e,n=s=>{const{id:r,model:o}=s;if(r==="custom-code"){const i="<span>Insert here your custom code</span>";t.addType(r,{model:{defaults:{emptyState:!0,icon:'<svg viewBox="0 0 24 24"><path d="M14.6 16.6l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4m-5.2 0L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4z"></path></svg>',classes:"gjs-custom-code",components:i,"custom-code-plugin__code":i,styles:".gjs-custom-code { padding: 5px; }"}}})}if(r==="typed"){const i=o.getDefaults().traits.map(a=>a.name==="strings"?{...a,type:"stack",addItem(c){return{id:c,label:`New string ${c}`}},getValue({component:c}){return c.get("strings").map((u,d)=>({id:`${d}`,label:u}))},setValue:({component:c,value:u})=>{const d=u.map(p=>p.label);c.set({strings:d}),c.trigger("rerender")},properties:[{name:"label"}]}:a);t.addType(r,{model:{defaults:{traits:i,strings:["These are the default values...!!!","Use your own strings from Properties!","Have a great day!"],icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 300"><path d="M212.3 44l2.3 49.6h-6A60 60 0 00204 75c-3.2-6-7.5-10.5-12.9-13.3a44.9 44.9 0 00-21.1-4.3h-29.8V219c0 13 1.4 21 4.2 24.3 4 4.4 10 6.6 18.2 6.6h7.4v5.7H80.2V250h7.5c9 0 15.3-2.7 19-8.2 2.4-3.3 3.5-10.9 3.5-22.7V57.3H84.8a71 71 0 00-21.1 2.2 29 29 0 00-13.9 11.3 46.1 46.1 0 00-6.9 22.8H37L39.5 44h172.8zM245 22h18v256h-18z"/></svg>',classes:"gjs-typed",styles:`
446
392
  .gjs-typed {
447
393
  padding: 5px;
448
394
  }
@@ -450,4 +396,4 @@ ${C}${x}${j}
450
396
  <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
451
397
  <path d="M22 9.3c0-.8-.5-1.3-1.3-1.3H3.4C2.5 8 2 8.5 2 9.3v7.4c0 .8.5 1.3 1.3 1.3h17.4c.8 0 1.3-.5 1.3-1.3V9.3zM21 17H3V9h18v8z" fill-rule="nonzero"/><rect x="3" y="5" width="4" height="2" rx=".5"/><rect x="8" y="5" width="4" height="2" rx=".5"/><rect x="13" y="5" width="4" height="2" rx=".5"/>
452
398
  </svg>
453
- `:void 0};r==="tab"&&(a.traits=[{type:"button",label:!1,text:"Style Active",command:l=>{l.select(),l.runCommand(Wx),setTimeout(()=>l.Selectors.select(".tab.tab-active"))}}]),t.addType(r,{model:{defaults:a}})}};e.on("component:type:add",n)}const X9=(e,t)=>{const n=t.appStore.store.globalStylesStore;e.on(e.events.projectLoad,({loaded:s})=>s&&n.onLoad())},J9=(e,t)=>{const{assetsStore:n}=t.appStore.store;if(n.onCloudOrCustomUpload){const{Assets:s}=e;s.getConfig().uploadFile=async(...r)=>{const o=r[0],i=await n.handleUpload(o),a=r[1];i&&(a==null||a({data:i}))}}e.on(e.events.destroy,()=>n.setAllProviders([]))},Q9=()=>{const{baseApiUrl:e}=x0();return`${e}/sdk/projects`},Ux=e=>`${Q9()}/${e}`,e7=async({licenseKey:e,projectId:t,...n})=>{const s=await Is.put(Ux(t),{body:JSON.stringify(n),params:{d:window.location.hostname,licenseKey:e}});return s==null?void 0:s.result},t7=async(e,t)=>await Is.put(t,{body:e,headers:{"Content-Type":"application/json"}}),n7=async(e,t,n,s)=>{const r=JSON.stringify(e),o=await e7({licenseKey:t,projectId:n,fileMetadata:{size:new Blob([r]).size},identityId:s,name:e.name,description:e.description});if(!o)throw new Error("Project not found");const{uploadUrl:i}=o;await t7(r,i)},s7=(e,t,n)=>Is.get(Ux(t),{params:{d:window.location.hostname,licenseKey:e,identityId:n}}),r7=async e=>await Is.get(e),o7=async(e,t,n,s)=>{const r=await s7(t,n,s),o=r==null?void 0:r.result,i=r==null?void 0:r.errorData;if(!o&&(i!=null&&i.notFoundInDb))return{id:n,project:{}};if(!o)throw new Error("Project not found");const{downloadUrl:a}=o,l=await r7(a);if(!l||l instanceof Error)throw new Error("Project download failed");return{id:n,project:l}},i7=(e,t)=>{const{appEditorStore:n,toastStore:s,i18nStore:r}=t.appStore.store,{isUsingProjectSelfHosted:o,isUsingProjectCloud:i,sdkOptions:a}=n,l=a.storage||{},{project:u,onLoad:d,onSave:f,autosaveChanges:p,autosaveIntervalMs:g}=l;let m,b,v,x;if(o)v=d,x=f,m=p,b=g;else if(i){const j=a.licenseKey,E=n.sdkProjectId,_=n.sdkIdentityId,T=10,P=1e4;x=({project:A})=>n7(A,j,E,_),v=({editor:A})=>o7(A,j,E,_),m=Math.max(T,p??T),g&&(b=Math.max(P,g))}const{Storage:y,events:w}=e,{events:S}=y;let C=!1;if(e.once(w.projectLoad,j=>{C=!!j.loaded}),e.once("change:readyLoad",()=>{var E;const j=(E=a.project)==null?void 0:E.default;!C&&j&&e.loadProjectData(j)}),e.on(S.startStore,()=>n.setIsSaving(!0)),e.on(S.endStore,()=>n.setIsSaving(!1)),(v||u)&&x){const j="remote";y.setCurrent(j),y.add(j,{async load(){return u||(await v({editor:e})).project},async store(E){await x({project:E,editor:e})}}),e.on(S.errorLoad,E=>{s.addError("storage-error-load",{header:r.t("storageManager.errorLoad"),content:E.message})}),e.on(S.errorStore,E=>{s.addError("storage-error-store",{header:r.t("storageManager.errorStore"),content:E.message})}),m&&y.setStepsBeforeSave(m),b&&e.onReady(()=>{const E=setInterval(async()=>{e.getDirtyCount()>0&&!n.isSaving&&await e.store()},b);e.on("destroy",()=>clearInterval(E))})}},Tc="select-target",Wx="enable-sm";function a7(e,t){var L,B,q,H;const{appStore:n}=t,{appEditorStore:s,blockManagerStore:r,toastStore:o,modalStore:i,layoutStore:a,contextMenu:l,assetsStore:u,fontsStore:d}=n.store,{projectIdToLoad:f,nextProjectData:p,sdkOptions:g}=s,m=()=>r.toggleOpen(),b=()=>s.toggleLeftSidebar(),v=()=>s.toggleRightSidebar(),x=e.getConfig(),{Assets:y,Storage:w,Commands:S}=e,C=S.events,j=e.events,E=(B=(L=g.gjsOptions)==null?void 0:L.assetManager)==null?void 0:B.custom;let _=!1;if(y.all.model.prototype.idAttribute="src",Lt(E)&&(y.getConfig().custom=E),p&&(x.projectData=p,s.setNextProjectData()),f){const $=w.getConfig().options;$&&($.local.key=f)}e.on(j.projectLoad,({project:$})=>{var I;n.setProjectDataCustom($.custom||{projectType:(I=s.sdkOptions.project)==null?void 0:I.type}),d.loadFonts()}),e.on(j.projectGet,({project:$})=>{$.custom=yi(e)}),e.RichTextEditor.getConfig().custom=!0;const{Canvas:T}=e,P=Tr(()=>s.setCanvasPanning(!1),200);e.on(T.events.coords,()=>{s.setCanvasPanning(!0),P()}),e.on(T.events.frameLoad,({el:$})=>{$.tabIndex=-1});const{Parser:A}=e,M=((q=s.sdkOptions.parser)==null?void 0:q.showErrors)!==!1;(H=A.events)!=null&&H.css&&M&&e.on(A.events.css,$=>{const{error:I}=$;if(I){const O=ot(I)?I:I.name&&I.reason?`${I.name}: ${I.reason}`:I.message;o.addError("css-error",{header:"CSS Parser Error",content:O})}}),[{id:"toggle-lsidebar",keys:"alt+ctrl+,",cmd:b},{id:"toggle-lsidebar2",keys:"alt+⌘+,",cmd:b},{id:"toggle-rsidebar",keys:"alt+ctrl+., alt+⌘+.",cmd:v},{id:"show-blocks",keys:"ctrl+b, ⌘+b",cmd:m},{id:"add-symbol",keys:"alt+ctrl+k, alt+⌘+k",cmd:ie.symbolAdd},{id:"detach-symbol",keys:"shift+alt+ctrl+k, shift+alt+⌘+k",cmd:ie.symbolDetach}].forEach(({id:$,keys:I,cmd:O})=>{e.Keymaps.add(`preset:${$}`,I,O,{prevent:!0})}),e.on(`${C.runCommand}core:preview`,()=>{s.setPreview(!0),r.setOpen(!1),fm(e,!1)}),e.on(`${C.stopCommand}core:preview`,()=>{s.setPreview(!1),fm(e,!0),setTimeout(()=>{e.refresh()},s.transitionTime)});const R="target-selection",{Components:F}=e;S.add(Tc,{opts:{},init(){this.beforeSelect=this.beforeSelect.bind(this)},onComponentHover($,I){const O={id:R,type:"target",component:I};I?T.addSpot(O):T.removeSpots(O)},beforeSelect($,I={}){I.abort=!0,I.useValid=!1,this.opts.onSelect($),e.stopCommand(Tc)},run($,I,O){this.opts=O,e.on("component:select:before",this.beforeSelect),e.on("change:componentHovered",this.onComponentHover)},stop(){e.off("component:select:before",this.beforeSelect),e.off("change:componentHovered",this.onComponentHover),T.removeSpots({id:R}),s.setSelectingTarget(!1)}}),S.add(Wx,()=>{s.setSelectedDesignerTab("style")}),S.add(ie.toastAdd,($,I,O)=>{o.add(O.id,O)}),S.add(ie.toastRemove,($,I,O)=>{o.remove(O.id)}),S.add(ie.dialogOpen,($,I,O)=>{i.open(O)}),S.add(ie.dialogClose,()=>{i.close()}),S.add(ie.dialogExportCode,()=>{i.open({title:e.t("actions.showCode.title"),content:()=>{var $,I;return h.createElement(U4,{options:(I=($=g.commands)==null?void 0:$.options)==null?void 0:I[ts.showCode]})}})}),S.add(ie.sidebarLeftGet,()=>({visible:s.isLeftSidebarOpen})),S.add(ie.sidebarLeftSet,($,I,O)=>{s.setLeftSidebarOpen(!!O.visible)}),S.add(ie.sidebarLeftToggle,()=>{s.setLeftSidebarOpen(!s.isLeftSidebarOpen)}),S.add(ie.sidebarRightGet,()=>({visible:s.isRightSidebarOpen})),S.add(ie.sidebarRightSet,($,I,O)=>{s.setRightSidebarOpen(!!O.visible)}),S.add(ie.sidebarRightToggle,()=>{s.setRightSidebarOpen(!s.isRightSidebarOpen)}),S.add(ie.sidebarTopGet,()=>({visible:s.isTopSidebarOpen})),S.add(ie.sidebarTopSet,($,I,O)=>{s.setTopSidebarOpen(!!O.visible)}),S.add(ie.sidebarTopToggle,()=>{s.setTopSidebarOpen(!s.isTopSidebarOpen)}),S.add(ie.sidebarBottomGet,()=>({visible:s.isBottomSidebarOpen})),S.add(ie.sidebarBottomSet,($,I,O)=>{s.setBottomSidebarOpen(!!O.visible)}),S.add(ie.sidebarBottomToggle,()=>{s.setBottomSidebarOpen(!s.isBottomSidebarOpen)}),S.add(ie.layoutAdd,($,I,O)=>{O.id&&a.add(O.id,O)}),S.add(ie.layoutRemove,($,I,O)=>{const{id:V,...G}=O;a.remove(V,G)}),S.add(ie.layoutToggle,($,I,O)=>{const{id:V,...G}=O;V&&(a.get(V)?a.remove(V,G):a.add(V,G))}),S.add(ie.layoutUpdate,($,I,O)=>{const V=O;e.runCommand(ie.layoutRemove,{id:V.id,layout:{placer:{...V.placer,skipCleanup:!0}},force:!0}),setTimeout(()=>e.runCommand(ie.layoutAdd,{...V}))}),S.add(ie.layoutGet,($,I,O)=>[Er(a.get(O.id))]),S.add(ie.layoutConfigGet,()=>Er(a.customConfig)),S.add(ie.layoutConfigSet,($,I,O)=>{const V=O;a.setCustomConfig(V)}),S.add(ie.layoutComponentAdd,($,I,O)=>{const{type:V,component:G}=O;V&&G&&a.addCustomLayoutComponent(V,G)}),S.add(ie.layoutComponentGet,($,I,O)=>a.getCustomLayoutComponent(O.type)),S.add(ie.layoutComponentRemove,($,I,O)=>{a.removeCustomLayoutComponent(O.type)}),S.add(ie.layoutComponentRender,($,I,O)=>h.createElement(V9,{components:O.components})),S.add(ie.getStateTheme,()=>s.publicStateTheme),S.add(ie.setStateTheme,($,I,O)=>s.setPublicStateTheme(O)),S.add(ie.getPagesConfig,()=>s.sdkPagesConfig),S.add(ie.setPagesConfig,($,I,O)=>{const{config:V}=O||{};Lt(V)&&s.setSdkPagesConfig(V)}),S.add(ie.getPageSettings,()=>JSON.parse(JSON.stringify(s.panelPageSettings))),S.add(ie.setPageSettings,($,I,O)=>{s.setPanelPageSettings(O)}),S.add(ie.clearPage,()=>{const $=I=>e.t(`actions.${I}`);i.confirm({title:$("clearCanvas.title"),content:$("clearCanvas.content"),confirmButton:{variant:"danger",children:$("clearCanvas.title")},onConfirm:()=>{gA(e)?e.loadProjectData({pages:[{component:"<mjml><mj-body></mj-body></mjml>"}]}):e.Components.clear()}})}),S.add(ie.projectFiles,($,I,O)=>{var K,J;const V=(K=s.sdkOptions.dataSources)==null?void 0:K.exportConfig,G=((J=O.exportConfig)==null?void 0:J.exportPreset)??V,W={isMJML:s.isProjectTypeEmail,exportConfig:G,...O};return B9($,W)}),S.add(ie.validateCode,($,I,O)=>R0({...O,appStore:n})),S.add(ie.getBlocksPanel,()=>({isOpen:r.isOpen})),S.add(ie.setBlocksPanel,($,I,O)=>{const V=O||{};Lt(V.isOpen)&&r.setOpen(V.isOpen)}),S.add(ie.canvasReload,()=>{const $=e.getSelected(),I=T.getCanvasView(),{frames:O}=T.canvas;O.once("loaded:all",()=>{const V=$==null?void 0:$.getView();V&&!V.isInViewport()&&V.el.scrollIntoView({block:"center"})}),I.renderFrames()}),S.add(ie.contextMenuComponent,($,I,O)=>{const{component:V,...G}=O;l.showForComponent(V,G)}),S.add(ie.getStateContextMenu,()=>l.publicState),S.add(ie.setStateContextMenu,($,I,O)=>{l.setPublicState(O)}),S.add(ie.symbolAdd,($,I,O)=>{const V=O.component||e.getSelected();if(V)return F.getSymbolInfo(V).isSymbol?o.add("skip-symbol",{header:"The selected element is already a symbol",variant:nn.Warning}):F.addSymbol(V)}),S.add(ie.symbolDetach,($,I,O)=>{const V=O.component||e.getSelected();V&&F.getSymbolInfo(V).isRoot&&F.detachSymbol(V)}),S.add(ie.symbolOverride,($,I,O)=>{const V=O.component||e.getSelected();V&&(V.setSymbolOverride(O.override),e.Layers.updateLayer(V))}),S.add(ie.symbolPropagateStyles,($,I,O)=>{const V=O.component||e.getSelected();if(!V)return;const{Css:G}=e,W=G.getComponentRules(V,{current:!0})[0];if(W){const{state:K,mediaText:J}=W.attributes,Y=W.getStyle();F.getSymbolInfo(V).relatives.forEach(U=>{G.setIdRule(U.getId(),Y,{state:K,mediaText:J})})}O.deep&&V.components().forEach(K=>e.runCommand(ie.symbolPropagateStyles,{...O,component:K}))}),S.add(ie.assetProviderGet,()=>Er(u.allProviders)),S.add(ie.assetProviderAdd,($,I,{provider:O,index:V})=>{u.addProvider(O,V)}),S.add(ie.assetProviderRemove,($,I,{id:O})=>{const V=u.allProviders.filter(G=>G.id!==O);u.setAllProviders(V)}),S.add(ie.fontGet,()=>Er(d.fonts)),S.add(ie.fontAdd,($,I,{font:O})=>{d.addFont(O)}),S.add(ie.fontRemove,($,I,{family:O})=>{d.removeFont(O)}),S.add(ie.fontManagerOpen,($,I,O)=>{dh($,O)}),S.add(ie.menuFontLoad,($,I,{font:O})=>Hp(O,!1)),S.add(ie.toggleStateDataSource,()=>(_=!_,e.trigger(Tn.toggleDataSourcesPreview,{showPlaceholder:_}),e.refresh({tools:!0}),{showPlaceholder:_})),S.add(ie.getStateDataSource,()=>({showPlaceholder:_})),S.add(ie.dataSourceSetGlobalData,($,I,{globalData:O})=>{const V=Iy(O);return e.DataSources.get(ko.globalData).setRecords(V)}),S.add(ie.setDragAbsolute,($,I,{enabled:O})=>{s.setIsDraggingAbsolute(!!O)}),S.add(ie.dataSourceSetImporter,($,I,O)=>{e.on(e.Parser.events.htmlBefore,V=>{V.input=O.import(V.input)})}),S.add(ie.dataSourceSetExporter,($,I,O)=>{e.config.optsHtml={...e.config.optsHtml,exporter:O}}),J9(e,t),i7(e,t),X9(e,t),Z9(e),z9(e),v4(e),U9(e,t),Y9(e,t)}const l7=/\s(?![^(]*\))/,F1=/^-?[0-9]+[a-zA-Z%]{0,}$/;function B1(e){const t=e.split(l7),n=t.indexOf("inset")>=0,s=t.filter(d=>d!=="inset"),r=s.filter(d=>!F1.test(d))[0]||"currentColor",o=s.filter(d=>F1.test(d)),[i="0",a="0",l="0",u="0"]=o;return{x:i,y:a,blur:l,spread:u,inset:n,color:r}}const zl=["%"],Ul=["s","ms"],zi=["deg","rad","grad"],ws=["px","%","em","rem","vw","vh"],z1={type:"select",options:["visible","hidden","scroll","auto"].map(e=>({id:e})),default:"visible"},c7=e=>`linear-gradient(${e} 1%, ${e} 100%)`,Oc=e=>({id:e,label:e.split("-").map(Ts).join(" ")}),Gx=e=>({property:t,to:n})=>{if(n.value){const s=t.getOption(),r=t.getParent().getProperty(e),o=r.getUnit(),i={units:s.units||[],min:s.min,max:s.max,unit:""};(!o||(i==null?void 0:i.units.indexOf(o))<0)&&(i.unit=(i==null?void 0:i.units[0])||""),r.up(i)}},u7=e=>{const t=`${e}-name`,n=`${e}-value`;return(s,{separatorLayers:r})=>{const o=s[e]||"";return o?o.split(r).map(i=>{const{name:a,value:l}=Cu(i);return{[t]:a,[n]:l}}):[]}},U1=e=>{const t={[ua]:e};if(e.indexOf("url(")>-1)t[Ns]=Or.Image;else if(e.indexOf("gradient(")>-1){const n=yh(e),s=n.colorStops,r=n.name.indexOf("linear")>=0;s.length===2&&r&&s[0].color===s[1].color?t[Ns]=Or.Color:t[Ns]=Or.Gradient}else t[Ns]=Or.Color,t[ua]=c7(e);return t},W1=(e="filter")=>{const t=`${e}-name`,n=`${e}-value`;return{property:e,type:"stack",layerSeparator:" ",fromStyle(s,{separatorLayers:r}){const o=s[e]||"";return o?o.split(r).map(i=>{const{name:a,value:l}=Cu(i);return{[t]:a,[n]:l}}):[]},toStyle(s,{name:r}){return{[r]:`${s[t]}(${s[n]||"0"})`}},properties:[{property:t,type:"select",default:"blur",options:[{id:"blur",label:"Blur",min:0,units:["px","em","rem","vw","vh"]},{id:"brightness",label:"Brightness",min:0,units:["%"]},{id:"contrast",label:"Contrast",min:0,units:["%"]},{id:"grayscale",label:"Grayscale",min:0,max:100,units:["%"]},{id:"hue-rotate",label:"Hue rotate",min:0,max:360,units:["deg","rad","grad"]},{id:"invert",label:"Invert",min:0,max:100,units:["%"]},{id:"saturate",label:"Saturate",min:0,units:["%"]},{id:"sepia",label:"Sepia",min:0,max:100,units:["%"]}],onChange:Gx(n)},{property:n,type:"integer"}]}},Wl=(e,{x:t,y:n,mergable:s}={})=>{const r={property:`${e}-x`,type:"integer",units:ws,...t},o={property:`${e}-y`,type:"integer",units:ws,...n};return{property:e,type:"composite",properties:[r,o],...s&&{fromStyle(i,{name:a,separator:l,property:u}){const[d,f]=u.getProperties(),[p,g]=(i[a]||"").split(l);return{[d.getId()]:i[d.getName()]||p||"",[f.getId()]:i[f.getName()]||g||p||""}},toStyle(i,{name:a,property:l}){const[u,d]=l.getProperties(),f=i[u.getId()],p=i[d.getId()];return{[a]:f===p?f:`${f} ${p}`}}}}},d7=(e,t="")=>{const n=`${e}-name`,s=`${e}-value`;return(r,{name:o})=>({[o]:`${r[n]}(${r[s]||t})`})};["top","middle","bottom"].map(Oc),["none","solid","dotted","dashed","double","groove","ridge","inset","outset"].map(Oc),["background-position-x","background-position-y"].map(e=>({type:"integer",property:e,fixedValues:e==="background-position-x"?["left","center","right"]:["top","center","bottom"],units:["px"],default:"auto"}));Wl("gap",{x:{property:"row-gap",min:0,default:"0"},y:{property:"column-gap",min:0,default:"0"},mergable:!0}),["baseline","top","middle","bottom"].map(Oc),yw("(?<!\\(.*[^)]),(?![^()]*\\))"),Or.Image,Or.Gradient,Or.Color,["background-position-x","background-position-y"].map(e=>({type:"integer",property:e,units:ws,default:"0px"})),["background-size-x","background-size-y"].map(e=>({type:"integer",property:e,units:ws,default:"auto"})),["border-top-width","border-right-width","border-bottom-width","border-left-width"].map(e=>({type:"integer",property:e,default:"0",units:ws})),["border-top-style","border-right-style","border-bottom-style","border-left-style"].map(e=>({type:"select",property:e,default:"none",options:[{id:"none",label:"None"},{id:"solid",label:"Solid"},{id:"dotted",label:"Dotted"},{id:"dashed",label:"Dashed"},{id:"double",label:"Double"},{id:"groove",label:"Groove"},{id:"ridge",label:"Ridge"},{id:"inset",label:"Inset"},{id:"outset",label:"Outset"}]})),["border-top-color","border-right-color","border-bottom-color","border-left-color"].map(e=>({type:"color",property:e,default:"currentColor"})),Wl("overflow",{x:z1,y:z1,mergable:!0}),W1(),W1("backdrop-filter"),["width","height","min-width","min-height","max-width","max-height","padding","margin","color","font-size","line-height","letter-height","border","border-radius","background","opacity","box-shadow","text-shadow","filter","backdrop-filter","transform","all"].map(Oc),Ul[0],Ul[0],u7("transform"),d7("transform","0"),Gx("transform-value"),Wl("transform-origin",{x:{default:"50%"},y:{default:"50%"}}),Wl("perspective-origin",{x:{default:"50%"},y:{default:"50%"}});function qx(e,t){return[n=>P4(n,t),...E4[e],n=>a7(n,t),w4(e,t)]}class f7{constructor(t){this.loadCounter=0,this.pendingInstalled=[],this.pendingUninstalled=[],this.selectedShown=!1,this.store=t,on(this,{},{autoBind:!0})}get hasPending(){return!!this.pendingInstalled.length||!!this.pendingUninstalled.length}*initProjectPlugins(t){this.clearPending();const s=(yield h7()).filter(r=>r.projectType.includes(t));this.setProjectPlugins(s)}setProjectPlugins(t,n={}){this.projectPlugins=[...t],n.clearPending&&this.clearPending()}clearPending(){this.pendingInstalled=[],this.pendingUninstalled=[]}getPluginsToLoad(t,n){const s=[...qx(t,{appStore:n}),...this.projectPlugins||[]],r=n.sdkOptions.plugins||[];return Ye(r)?r({plugins:s}):[...s,...r]}addPendingInstalled(t){const{pendingInstalled:n,pendingUninstalled:s}=this,r=t.id;s.includes(r)?this.pendingUninstalled=s.filter(o=>o!==r):n.includes(r)||n.push(r)}addPendingUninstalled(t){const{pendingInstalled:n,pendingUninstalled:s}=this,r=t.id;n.includes(r)?this.pendingInstalled=n.filter(o=>o!==r):s.push(r)}setSelectedShown(t){this.selectedShown=t}}const p7={db:s0.gjsStudio},h7=()=>new Promise(async e=>{let t=[];try{t=await IO(Yc.Settings,"plugins",p7)||[]}catch(n){Vs()&&console.error(n)}e(t)}),g7=h.createContext(void 0);class m7{constructor(t){this.blockManagerStore=new BA(this),this.appEditorStore=new jA(this,t==null?void 0:t.appEditorStore),this.localSettingsStore=new qN(t==null?void 0:t.localSettingsStore),this.toastStore=new FA(this),this.modalStore=new KN(this),this.i18nStore=new $A(this),this.pluginStore=new f7(this),this.pointerBadgeStore=new DA(this),this.contextMenu=new b7(this),this.layoutStore=new VA(this),this.templatesStore=new HA(this),this.assetsStore=new LA(this),this.globalStylesStore=new zN(this),this.fontsStore=new RA(this),this.appEditorStore.init(),Ff()&&(window.__gjss=this)}}const bn=()=>{const e=h.useContext(g7);if(!e)throw new Error("useStore must be used inside of StoreProvider");return e},wh=()=>{throw new Error("Store has not been initialized")};class b7{constructor(t){this.isOpen=!1,this.isEnabled=!0,this.items=[],this.coordinates={x:0,y:0},this.getItemsForComponent=So(function*(n,s={}){var x;if(!(n!=null&&n.em))return[];const r=n.em.getEditor(),{isSymbol:o,isRoot:i}=r.Components.getSymbolInfo(n),a=!!n.getSymbolOverride(),l=!!n.get("removable"),u=!!n.parent()&&!!n.toolbar.length,d=!!n.get("copyable"),f=[u&&{id:xr.selectParent,icon:Z.arrowUp,label:"Select parent",onClick:()=>{r.runCommand("core:component-exit",{force:!0})}},d&&{id:xr.duplicate,icon:Z.contentCopy,label:"Duplicate",onClick:()=>{r.runCommand("tlb-clone")}},!o&&l&&{id:xr.symbolCreate,icon:Z.rhombusSplit,label:"Create Symbol",onClick:()=>{r.runCommand(ie.symbolAdd)}},o&&i&&{id:xr.symbolDetach,icon:Z.alertRhombus,label:"Detach instance",onClick:()=>{r.runCommand(ie.symbolDetach)}},o&&!a&&{id:xr.symbolOverride,icon:Z.rhombusOutline,label:"Make overridable",onClick:()=>{r.runCommand(ie.symbolOverride,{override:!0})}},o&&a&&{id:xr.symbolOverrideClear,icon:Z.rhombusSplitOutline,label:"Clear overridable",onClick:()=>{r.runCommand(ie.symbolOverride)}},l&&{id:xr.delete,icon:Z.delete,label:"Delete",onClick:()=>{r.runCommand("core:component-delete")}}].filter(Boolean),p=n.get("contextMenu"),g={...s,items:f,component:n,editor:r,type:n.get("type")||"default",source:s.source||Dp.canvas},m=yield G1(p,g),b=(x=this.store.appEditorStore.sdkComponentsConfig)==null?void 0:x.contextMenu;return yield G1(b,{...g,items:m})}),this.store=t,on(this,{},{autoBind:!0})}get publicState(){return{enabled:this.isEnabled}}setPublicState(t){t.enabled!==void 0&&(this.isEnabled=t.enabled)}*showForComponent(t,n){const s=t==null?void 0:t.em;if(!s)return;n.skipSelect||s.selected.hasComponent(t)||s.setSelected(t);const r=yield this.getItemsForComponent(t,n);r.length&&this.show({...n,items:r})}show({items:t,x:n,y:s,w:r,h:o}){this.isOpen=!0,this.coordinates={x:n,y:s,w:r,h:o},this.items=t}hide(){this.isOpen=!1,setTimeout(this.clear,101)}clear(){this.items=[],this.coordinates={x:0,y:0}}}const G1=async(e,t)=>Ye(e)?(await e(t)).filter(Boolean):t.items,v7=()=>bn().contextMenu,q1=Vs()&&document.body,Sh=(e={})=>({...qp,placement:"right-start",modifiers:[{name:"offset",options:{offset:e.offset||[0,5]}},{name:"flip",options:{boundary:e.boundary??q1}},{name:"preventOverflow",options:{boundary:e.boundary??q1}}]}),y7=Sh(),Gl="gs-ctx-menu-list",x7=fe(function({onItemClick:t,open:n,items:s,x:r,y:o,w:i,h:a,className:l}){const u=v7(),[d,f]=h.useState(),[p,g]=h.useState(null),m=h.useMemo(()=>({getBoundingClientRect:()=>new DOMRect(r,o,i,a)}),[r,o,i,a,n]),{styles:b,attributes:v}=Wa(m,p,y7),x=N(`${Gl}-wrp gs-utl-z-20`,l),y=N(`${Gl} gs-utl-z-20`),w=N(`${Gl}-body gs-utl-max-w-56`),S=N(`${Gl}-item`),C="gs-utl-max-w-40",j=E=>{const{action:_,onClick:T}=E;if(_||T)return P=>{const A={editor:u.store.appEditorStore.editor,...P};Ye(_)?(_(A),u.hide()):Ye(T)&&(T(A),u.hide())}};return c.jsx("div",{className:x,ref:g,style:b.popper,...v.popper,children:c.jsx(Ap,{show:!!n,...AE,unmount:!1,children:c.jsx(Xn,{padding:!1,className:y,classNameBody:w,children:s.map((E,_)=>h.createElement(_i,{onItemClick:t,...E,key:E.id??_,className:S,classNameLabel:C,action:j(E),onActive:()=>f(E),active:d===E}))})})})}),kd="gs-cmp-tooltip";function It({className:e,classNameWrp:t,classNameContent:n,strategy:s,placement:r="bottom",children:o,title:i,onClick:a,inline:l,size:u}){const[d,f]=h.useState(!1),[p,g]=h.useState(!1),m=Lt(u),[b,v]=h.useState(null),[x,y]=h.useState(null),w=Wa(b,x,{...Sh(),placement:r,...s?{strategy:s}:{}});h.useEffect(()=>{var j;d&&((j=w.update)==null||j.call(w))},[d,w.update]),h.useEffect(()=>{const j=setTimeout(()=>f(p),10);return()=>clearTimeout(j)},[p]);const S=N(`${kd}-target`,!l&&"gs-utl-block",e,!a&&"gs-utl-cursor-auto"),C=N(`${kd}-content`,n,"gs-utl-fixed gs-utl-z-30 gs-utl-text-sm",!m&&!n&&"gs-utl-whitespace-nowrap",u==="s"&&"gs-utl-w-60");return c.jsxs("div",{className:N(kd,"gs-utl-relative",t),children:[c.jsx("span",{ref:v,className:S,onMouseEnter:()=>i&&g(!0),onMouseLeave:()=>g(!1),children:c.jsx("div",{className:N(l&&"gs-utl-inline-block"),onClick:()=>{g(!1),a==null||a()},children:o})}),!!p&&c.jsx("div",{className:C,ref:y,style:w.styles.popper,...w.attributes.popper,children:c.jsx(Ap,{show:!!d,unmount:!1,...hv,children:c.jsx(Xn,{className:ug.txt,bg:ug.bg,size:"s",border:!1,children:i})})})]})}function bt({children:e,title:t,classNameWrp:n,tooltipProps:s,...r}){return c.jsx(It,{title:t,classNameWrp:n,...s,children:c.jsx(Ke,{...r,children:e})})}const Go="gs-cmp-ai-chat-assets",w7=e=>{var t;return((t=e.mediaType)==null?void 0:t.startsWith("image/"))||e.mediaType==="image/*"},S7=e=>e.mediaType==="application/pdf",Kx=({editor:e,assets:t,className:n,onRemove:s,style:r})=>{const o=`${Go}__asset-item`,i=N(`${Go}__asset-image`,"gs-utl-object-cover",re.rnd,hl.m),a=N(`${Go}__asset-pdf`,"gs-utl-overflow-hidden",re.rnd,hl.m),l=N(`${Go}__asset-file`,"gs-utl-flex gs-utl-items-center gs-utl-justify-center",re.rnd,hl.m,z.bgH2),u=N(`${Go}__asset-remove`,"gs-utl-absolute gs-utl--top-2 gs-utl--right-1 gs-utl-text-white gs-utl-flex gs-utl-items-center gs-utl-justify-center gs-utl-z-10",hl.s,re.pill,z.bgRed,z.hBgRed),d="aiChat.input.assets";if(t.length<=0)return null;const f=(p,g)=>{const m={params:{num:g+1}},b=e.t(`${d}.imageAlt`,m),v=e.t(`${d}.pdfTitle`,m);return w7(p)?c.jsx("img",{src:p.src,alt:b,className:i}):S7(p)?c.jsx("iframe",{src:p.src,title:v,className:a}):c.jsx("div",{className:l,children:c.jsx(oe,{icon:XS,size:le.l})})};return c.jsx(k,{className:N(Go,n),gap:"xs",wrap:"wrap",style:r,children:t.map((p,g)=>c.jsxs("div",{className:N(o,"gs-utl-relative gs-utl-inline-block"),children:[f(p,g),s&&c.jsx(bt,{title:e.t(`${d}.remove`),icon:{icon:Z.close,size:le.s3x},onClick:()=>s(g),size:"x2s",border:!1,className:u})]},p.src))})},en="gs-cmp-ai-chat-input",C7=e=>{const{className:t,style:n,editor:s,disabled:r,maxAssets:o,currentAssetsCount:i,acceptAssetType:a,onFilesSelected:l,onAssetSelected:u}=e,d=h.useRef(null);if(o<=0)return null;const f=`${en}__attach-btn`,p=`${en}__file-input`,g=i>=o,m="aiChat.input.attach",b=s.t(`${m}.upload`),v=s.t(`${m}.selectFromAssets`),x=s.t(`${m}.title`),y=s.t(`${m}.maxAssets`,{params:{count:o}}),w=C=>{const j=Array.from(C.target.files||[]);j.length>0&&l(j),d.current&&(d.current.value="")},S=C=>{if(!s||g)return;const j="btnAttachImages",E=()=>s.runCommand(ie.layoutRemove,{id:j});s.runCommand(ie.layoutToggle,{id:j,header:!1,placer:{type:"popover",target:C.currentTarget,closeOnClickAway:!0,options:{placement:"top-start"}},layout:{type:"menuList",className:"gs-utl-text-sm",onItemClick:E,items:[{id:"upload",label:b,icon:Z.trayArrowDown,onClick:()=>{var _;return(_=d.current)==null?void 0:_.click()}},{id:"assets",label:v,icon:a2,onClick:()=>{s.Assets.open({onSelect:({asset:_})=>{const T=_.getSrc();T&&u(T)}})}}]}})};return c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:d,type:"file",accept:a,multiple:!0,onChange:w,className:p,style:{display:"none"}}),c.jsx(bt,{className:N(f,re.pill,t),style:n,title:g?y:x,icon:Z.plus,border:!1,onClick:S,disabled:r||g,size:"s",block:!0})]})},j7=({editor:e,className:t,style:n,contextComponents:s,disabled:r})=>{const[o,i]=h.useState(()=>e.getSelectedAll()),a="aiChat.input.context";h.useEffect(()=>{const y=e.Components.events.select,w=()=>i(e.getSelectedAll());return e.on(y,w),()=>{e.off(y,w)}},[e]),h.useEffect(()=>{s.clear(),o.forEach(y=>s.add(y))},[o,s]);const l=()=>i([]);if(o.length===0)return null;const u=`${en}__context`,d=`${en}__context-icon`,f=`${en}__context-badge`,p=`${en}__context-name`,g=`${en}__context-divider`,m=o.length===1,b=o[0],v=e.t(`${a}.multiple`,{params:{count:o.length}}),x=m?b.getName():v;return c.jsxs(k,{className:N(u,r&&Ee.disabled,t),style:n,gap:"s",items:"center",nowrap:!0,children:[c.jsx(oe,{icon:Z.target,size:le.sx,className:N(d,z.txtLowEmphasis)}),c.jsx(Rr,{className:N(f,mv(b).bg,je.xyS2),s:"s",children:c.jsxs(k,{gap:"xs",items:"center",nowrap:!0,children:[m&&h0(b),c.jsx("div",{className:N(p,Ee.txtEllips,"gs-utl-max-w-36"),children:x}),!r&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:N(g,re.br,"gs-utl-h-[18px] gs-utl-opacity-30")}),c.jsx(bt,{title:e.t(`${a}.clear`),icon:{icon:Z.close,size:le.s3x},onClick:l,size:"x2s",border:!1,block:!0})]})]})})]})};function K1(){return typeof window<"u"&&(window.SpeechRecognition||window.webkitSpeechRecognition)}function E7(){const[e,t]=h.useState(""),[n,s]=h.useState(!1),[r,o]=h.useState(!1),i=h.useRef();h.useEffect(()=>o(!!K1()),[]);const a=()=>{const u=K1();if(!u)return;t("");const d=new u;d.lang="en-US",d.continuous=!0,d.interimResults=!0,d.onstart=()=>s(!0),d.onend=l,d.onresult=f=>{const g=Array.from(f.results).map(m=>m[0].transcript).join("");t(g)},d.onerror=f=>{console.error("Speech recognition error",f),l()},i.current=d,d.start()},l=()=>{var u;(u=i.current)==null||u.stop(),s(!1)};return{transcript:e,isSupported:r,isListening:n,start:a,stop:l}}const P7=({editor:e,disabled:t,onTranscript:n,onListeningChange:s,className:r,style:o})=>{const i=`${en}__dictate`,{transcript:a,isSupported:l,isListening:u,start:d,stop:f}=E7(),p="aiChat.input.dictate",g=e.t(`${p}.start`),m=e.t(`${p}.stop`),b=u?m:g;return h.useEffect(()=>{a&&n(a)},[a]),h.useEffect(()=>{s==null||s(u)},[u]),l?c.jsx(bt,{block:!0,size:"s",border:!1,className:N(i,re.pill,r),style:o,title:b,disabled:t,icon:u?y2:v2,onClick:u?f:d,variant:u?"danger":"out-clear"}):null},_7=({autoResize:e,autoFocus:t,style:n={},...s})=>{const r=h.useRef(null);return h.useEffect(()=>{!r.current||!e||(r.current.style.height="auto",r.current.style.height=r.current.scrollHeight+"px")},[s.value,e]),h.useEffect(()=>{const o=r.current;if(o&&t){const i=setTimeout(()=>o==null?void 0:o.focus(),150);return()=>clearTimeout(i)}},[r.current,t]),c.jsx("textarea",{ref:r,style:{...n,...e?{resize:"none"}:{}},...s})},Y1=e=>{e.forEach(t=>{t.startsWith("blob:")&&URL.revokeObjectURL(t)})},Z1=(e,t)=>e?t?!e.endsWith(" ")&&!t.startsWith(" ")?`${e} ${t}`:`${e}${t}`:e:t,T7=({className:e,style:t,chatContext:n,editor:s,maxAssets:r=5,acceptAssetType:o="image/jpeg,image/png,image/gif,image/webp,application/pdf",uploadProjectAssets:i,layoutBefore:a,layoutAfter:l,onSubmit:u,contextSectionProps:d,textareaProps:f,assetsSectionProps:p,attachButtonProps:g,dictateButtonProps:m,submitButtonProps:b,value:v})=>{const[x,y]=h.useState(v||""),[w,S]=h.useState(""),[C,j]=h.useState(!1),[E,_]=h.useState([]),[T,P]=h.useState(!1),A="aiChat.input",M=s.runCommand(Ss.getChatApi),R=s.runCommand(Ss.getChatState),{status:F,stop:L,sendMessage:B,setError:q}=n||M,H=F==="streaming"||F==="submitted",$=E.length>0,I=w?Z1(x,w):x,O=!T&&(H||I.trim()||$),V={input:I,assets:E},G=xe=>{const Ze=r-E.length,Xe=xe.slice(0,Ze);if(Xe.length===0)return;const ft=Xe.map(Ae=>({src:URL.createObjectURL(Ae),file:Ae,mediaType:Ae.type}));_(Ae=>[...Ae,...ft])},W=xe=>{E.length>=r||_(Ze=>[...Ze,{src:xe,mediaType:"image/*"}])},K=xe=>{const Ze=E[xe];Ze!=null&&Ze.file&&Y1([Ze.src]),_(Xe=>Xe.filter((ft,Ae)=>Ae!==xe))},J=async xe=>{if(xe.preventDefault(),H||T)return;const Ze=()=>Y();if(u){u({event:xe,submit:Ze,state:V});return}Ze()},Y=async()=>{if(H||T)return;const xe=I.trim();if(!xe&&!$)return;const Ze=E.filter(Ae=>Ae.file).map(Ae=>Ae.file);let ft=E.filter(Ae=>!Ae.file).map(Ae=>({type:"file",url:Ae.src,mediaType:Ae.mediaType}));if(Ze.length>0){P(!0);try{const at=await async function(Ie){return i?await i({files:Ie}):new Promise((Wt,ge)=>{try{const $e={dataTransfer:{files:Ie}};s.Assets.FileUploader().uploadFile($e,({data:Ve})=>{Wt(Ve)})}catch($e){ge($e)}})}(Ze),rt=E.filter(Ie=>Ie.file).map(Ie=>Ie.src);ft=[...ft,...at.map(Ie=>({type:"file",url:Ie.src,mediaType:Ie.mimeType}))],Y1(rt)}catch(Ae){const at=s.t(`${A}.uploadError`);q(Ae instanceof Error?Ae:new Error(at)),P(!1);return}finally{P(!1)}}B({text:xe,files:ft.length>0?ft:void 0,metadata:{createdAt:Date.now()}}),y(""),_([])},U=xe=>{xe.key==="Enter"&&!xe.shiftKey&&(xe.preventDefault(),J(xe))};h.useEffect(()=>{C||y(xe=>Z1(xe,w)),S("")},[C]);const Q=`${en}__root`,se=`${en}__actions`,de=`${en}__actions-left`,Se=`${en}__actions-right`,ne=`${en}__submit-btn`,Te=N(`${en}__textarea gs-utl-w-full`,z.bgTr,$r.inputText,Ee.noFocusOut,Ee.noResize),ke=s.t(`${A}.placeholder`),it=a==null?void 0:a({state:V}),st=l==null?void 0:l({state:V});return c.jsxs("form",{onSubmit:J,className:N(en,je.s,re.bt,z.br,e),style:t,children:[it&&sn(s,it),c.jsxs(k,{className:N(Q,re.b,re.rndLg,z.br,z.bg,je.s,"gs-utl-relative"),col:!0,gap:"s",children:[T&&c.jsx(Co,{abs:!0,full:!0,className:z.bgH25}),c.jsx(j7,{editor:s,disabled:H,contextComponents:R.contextComponents,...d}),c.jsx(_7,{value:I,name:"prompt",onChange:xe=>y(xe.target.value),onKeyDown:U,placeholder:ke,readOnly:C,disabled:H,className:Te,style:{minHeight:40,maxHeight:100},autoResize:!0,...f}),c.jsx(Kx,{editor:s,assets:E,onRemove:K,...p}),c.jsxs(k,{className:se,justify:"between",items:"center",gap:"s",full:!0,children:[c.jsx(k,{className:de,gap:"s",items:"center",children:c.jsx(C7,{editor:s,disabled:H,maxAssets:r,currentAssetsCount:E.length,acceptAssetType:o,onFilesSelected:G,onAssetSelected:W,...g})}),c.jsxs(k,{className:Se,gap:"s",items:"center",children:[c.jsx(P7,{editor:s,disabled:H,onTranscript:S,onListeningChange:j,...m}),c.jsx(Ke,{className:N(ne,re.pill),size:"s",type:H?"button":"submit",onClick:H?L:void 0,icon:H?Z.stop:Z.arrowUp,variant:H?"out-clear":"pr",disabled:!O,disabledClassName:Ee.disabledM,...b})]})]})]}),st&&sn(s,st)]})},O7="gs-cmp-ai-chat-loading-state",A7=({className:e,chatContext:t,editor:n,...s})=>c.jsx(k,{className:N(O7,e),items:"center",justify:"center",full:!0,col:!0,...s,children:c.jsx(Co,{})}),N7="file-refs",Yx="gs-cmp-ai-chat-markdown",gt=`${Yx}__el`,M7={ul:({children:e})=>c.jsx("ul",{className:`${gt}-ul ${Nt.ul}`,children:e}),ol:({children:e})=>c.jsx("ol",{className:`${gt}-ol ${Nt.ol}`,children:e}),li:({children:e})=>c.jsx("li",{className:`${gt}-li`,children:e}),p:({children:e})=>c.jsx("p",{className:`${gt}-p`,children:e}),h1:({children:e})=>c.jsx("h1",{className:`${gt}-h1 ${Nt.h1}`,children:e}),h2:({children:e})=>c.jsx("h2",{className:`${gt}-h2 ${Nt.h2}`,children:e}),h3:({children:e})=>c.jsx("h3",{className:`${gt}-h3 ${Nt.h3}`,children:e}),h4:({children:e})=>c.jsx("h4",{className:`${gt}-h4 ${Nt.h4}`,children:e}),h5:({children:e})=>c.jsx("h5",{className:`${gt}-h5 ${Nt.h5}`,children:e}),h6:({children:e})=>c.jsx("h6",{className:`${gt}-h6 ${Nt.h6}`,children:e}),a:({href:e,children:t})=>c.jsx("a",{href:e,className:`${gt}-a ${$r.link} gs-utl-underline`,target:"_blank",rel:"noopener noreferrer",children:t}),code:({children:e,className:t})=>!t?c.jsx("code",{className:`${gt}-code-inline ${Nt.codeInline}`,children:e}):c.jsx("code",{className:`${gt}-code-block ${t||""}`,children:e}),pre:({children:e})=>c.jsx("pre",{className:`${gt}-pre ${Nt.pre}`,children:e}),blockquote:({children:e})=>c.jsx("blockquote",{className:`${gt}-blockquote ${Nt.blockquote} ${z.br} [&>p]:gs-utl-my-0`,children:e}),hr:()=>c.jsx("hr",{className:`${gt}-hr ${Nt.hr} ${z.br}`}),strong:({children:e})=>c.jsx("strong",{className:`${gt}-strong ${Nt.strong}`,children:e}),em:({children:e})=>c.jsx("em",{className:`${gt}-em ${Nt.em}`,children:e}),del:({children:e})=>c.jsx("del",{className:`${gt}-del gs-utl-line-through`,children:e}),table:({children:e})=>c.jsx("table",{className:`${gt}-table ${Nt.table}`,children:e}),thead:({children:e})=>c.jsx("thead",{className:`${gt}-thead ${Nt.thead}`,children:e}),tbody:({children:e})=>c.jsx("tbody",{className:`${gt}-tbody`,children:e}),tr:({children:e})=>c.jsx("tr",{className:`${gt}-tr ${Nt.tr}`,children:e}),th:({children:e})=>c.jsx("th",{className:`${gt}-th ${Nt.th}`,children:e}),td:({children:e})=>c.jsx("td",{className:`${gt}-td ${Nt.td}`,children:e}),input:({checked:e,disabled:t})=>c.jsx("input",{type:"checkbox",checked:e,disabled:t,className:`${gt}-checkbox gs-utl-mr-2`,readOnly:!0}),[N7]:({children:e})=>c.jsx("img-refs",{style:{display:"none"},children:e})};function L7(e){return sw.marked.lexer(e,{gfm:!0}).map(n=>n.raw)}const R7=h.memo(function({content:t}){return c.jsx(rw,{components:M7,remarkPlugins:[ow],children:t})},(e,t)=>e.content===t.content),X1=h.memo(function({content:t,id:n,className:s}){const r=h.useMemo(()=>L7(t),[t]);return c.jsx("div",{className:`${Yx} ${s||""}`,children:r.map((o,i)=>c.jsx(R7,{content:o},`${n}-block_${i}`))})});function J1(e){return!!e&&typeof e=="object"&&e.type==="source-url"}function $7(e){return!!e&&typeof e=="object"&&e.type==="source-document"}const Vd="gs-cmp-ai-chat-message",Ui="aiChat.message",k7=h.memo(function({className:t,style:n,message:s,isStreaming:r,editor:o,chatContext:i,layoutBeforeMessage:a,layoutAfterMessage:l,layoutPart:u,layoutPartToolLabel:d,layoutPartToolDetail:f,layoutPartToolResult:p}){const g=s.parts||[],m=g.filter(Ar.isFileUIPart),b=g.filter(_=>!Ar.isFileUIPart(_)),v=m.map(_=>({src:_.url,mediaType:_.mediaType??"image/*"})),x=b.length-1,y=s.role==="user",w=N(Vd,`${Vd}--${s.role}`,t),S=N(`${Vd}__content gs-utl-break-words`,y?N(z.bgA,"gs-utl-inline-block gs-utl-text-left gs-utl-max-w-[90%]",je.xyS,re.rnd):"gs-utl-w-full"),C={editor:o,chatContext:i,message:s},j=a==null?void 0:a(C),E=l==null?void 0:l(C);return c.jsxs(k,{col:!0,gap:"s",className:w,style:n,children:[j&&sn(o,j),c.jsxs(k,{gap:"s",className:N(S,"gs-utl-self-end"),col:!0,nowrap:!0,children:[b.map((_,T)=>c.jsx(V7,{part:_,messageId:s.id,partIndex:T,isStreamingPart:T===x&&r,layoutPart:u,layoutPartToolLabel:d,layoutPartToolDetail:f,layoutPartToolResult:p,layoutProps:C},`${s.id}-part-${T}`)),c.jsx(Kx,{editor:o,assets:v,className:"gs-utl-justify-end"})]}),E&&sn(o,E)]})}),qs="gs-cmp-ai-chat-message-part",V7=h.memo(function({part:t,messageId:n,partIndex:s,isStreamingPart:r,layoutPart:o,layoutPartToolLabel:i,layoutPartToolDetail:a,layoutPartToolResult:l,layoutProps:u}){var d;if(o){const f=o({...u,part:t,partIndex:s});if(f)return sn(u.editor,f)}if(Ar.isReasoningUIPart(t)){const{text:f,state:p}=t,g=f==null?void 0:f.trim(),m=r&&p==="streaming",b=`${qs} ${qs}__reasoning`,v=u.editor.t(`${Ui}.reasoning`);return!!g&&c.jsx(ar,{className:N(b,z.txtLowEmphasis),classNameHandlerContent:"gs-utl-flex-none",handler:c.jsxs(k,{className:N(`${b}-label`,cn.semibold),items:"center",gap:"s",children:[m?c.jsx(Co,{size:"xs",currentColor:!0}):c.jsx(Wi,{path:d2,size:le.s2x}),c.jsx("div",{children:v})]}),children:c.jsx("div",{className:N(`${b}-text`,z.txtLowEmphasis,kn.xs,cn.italic),children:c.jsx(X1,{id:`${n}-${s}`,content:g})})})}if(Ar.isTextUIPart(t)){const f=t.text;if(!f)return null;const p=`${qs} ${qs}__text`;return c.jsx(X1,{content:f,id:`${n}-${s}`,className:p})}if(Ar.isToolUIPart(t)){const{type:f,toolCallId:p,input:g="",output:m="",errorText:b}=t,v=f.replace("tool-","").replace("dynamic-",""),x=typeof g=="string"?g:JSON.stringify(g),y=typeof m=="string"?m:JSON.stringify(m),w=typeof t.state=="string"?t.state:void 0,S=w==="output-available",C=r&&(w==="input-streaming"||w==="input-available"),j=`${qs}__tool`,E=`${qs}__tool-result`,_=`${j}-detail`,T=N(_,"gs-utl-max-w-full"),P="gs-utl-max-w-full gs-utl-whitespace-normal",A=N(`${_}-info gs-utl-max-h-24 gs-utl-overflow-auto`,P,z.txtLowEmphasis,kn.xs),M=N(`${qs}__tool-streaming gs-utl-max-h-10 gs-utl-overflow-hidden`,P,z.txtLowEmphasis,kn.xs),R=`${j}-section-label`,F=x&&x!=="{}",L=y&&y!=="{}",B=!!b,q=F||L||B,H=u.editor.t(`${Ui}.tool.input`),$=u.editor.t(`${Ui}.tool.output`),I=u.editor.t(`${Ui}.tool.error`),V=u.editor.runCommand(Ss.getChatManager).tools[v],G={...u,part:t,partIndex:s,toolName:v},W=i==null?void 0:i(G),K=a==null?void 0:a(G),J=(l==null?void 0:l(G))||((d=V==null?void 0:V.layoutToolResult)==null?void 0:d.call(V,G)),Y=W?sn(u.editor,W):v,U=J?sn(u.editor,J):null,Q=K?sn(u.editor,K):c.jsxs(k,{col:!0,gap:"s",className:"gs-utl-mt-1",children:[F&&c.jsxs(k,{className:N(T,`${_}--input`),gap:"xs",col:!0,nowrap:!0,children:[c.jsx("div",{className:R,children:H}),c.jsx("pre",{className:A,children:x})]}),L&&c.jsxs(k,{className:N(T,`${_}--output`),gap:"xs",col:!0,nowrap:!0,children:[c.jsx("div",{className:R,children:$}),c.jsx("pre",{className:A,children:y})]}),B&&c.jsxs(k,{className:N(T,`${_}--error`),gap:"xs",col:!0,nowrap:!0,children:[c.jsx("div",{className:R,children:I}),c.jsx("pre",{className:A,children:b})]})]});return c.jsxs(k,{className:N(`${qs} ${j}`,z.bgH2,re.rnd,je.xyS),gap:"xs",col:!0,nowrap:!0,children:[c.jsx(ar,{disabled:!q&&!K,handler:c.jsxs(k,{className:N(`${j}-label`),items:"center",gap:"s",children:[c.jsx("div",{className:`${j}-status`,children:S?c.jsx(Wi,{className:`${j}-status-success`,path:gb,size:le.s2x}):C?c.jsx(Co,{className:`${j}-status-processing`,size:"xs",currentColor:!0}):c.jsx(Wi,{className:`${j}-status-error`,path:mb,size:le.s2x})}),c.jsx("div",{className:N(`${j}-name`),children:Y})]}),children:Q}),c.jsx(I7,{toolCallId:p,toolStatusProgress:u.chatContext.toolStatusProgress,isStreaming:r,className:M}),!!U&&c.jsx("div",{className:E,children:U})]})}if(J1(t)||$7(t)){const f=`${qs}__source`,g=J1(t)?t.url:void 0,m=t.title,b=u.editor.t(`${Ui}.source.document`),v=m||g||b,x=g?new URL(g).hostname:"",y=c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:N(`${f}-content`,"gs-utl-flex-1 gs-utl-min-w-0"),children:[c.jsx("div",{className:N(`${f}-title`,cn.semibold,kn.sm,"gs-utl-truncate"),children:v}),x&&c.jsx("div",{className:N(`${f}-url`,z.txtLowEmphasis,kn.xs,"gs-utl-truncate"),children:x})]}),g&&c.jsx(Wi,{className:N(`${f}-icon`,z.txtLowEmphasis),path:bb,size:le.s2x})]}),w=N(f,z.bgH2,re.rnd,je.xyS,"gs-utl-flex gs-utl-items-center gs-utl-gap-2 gs-utl-no-underline",g&&Ee.hoverM);return g?c.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:w,children:y}):c.jsx("div",{className:w,children:y})}return null}),I7=h.memo(function({toolCallId:t,toolStatusProgress:n,isStreaming:s,className:r}){const[o,i]=h.useState(""),a=h.useRef(null);return h.useEffect(()=>{if(!s||!t){i("");return}const l=n.get(t);l!=null&&l.content&&i(l.content);const u=setInterval(()=>{const d=n.get(t);d!=null&&d.content&&i(d.content),d!=null&&d.completed&&(clearInterval(u),i(""))},100);return()=>clearInterval(u)},[t,n,s]),h.useEffect(()=>{a.current&&o&&(a.current.scrollTop=a.current.scrollHeight)},[o]),!o||!s?null:c.jsx("pre",{ref:a,className:r,children:o})}),D7="gs-cmp-ai-chat-messages-status",H7=({className:e,chatContext:t,style:n})=>{const{status:s}=t,r=s==="streaming"||s==="submitted",o=N(z.bgA,Ee.dot,Ee.bounce);return r?c.jsxs(k,{items:"center",gap:"xs",className:N(D7,e),style:n,children:[c.jsx("div",{className:o}),c.jsx("div",{className:o,style:{animationDelay:"0.15s"}}),c.jsx("div",{className:o,style:{animationDelay:"0.3s"}})]}):null},F7="gs-cmp-ai-chat-messages";function B7({editor:e,chatContext:t,messages:n,pluginOptions:s}){const r=h.useRef(null),{status:o}=t,i=o==="streaming"||o==="submitted",a=N(F7,je.s,"gs-utl-flex-1 gs-utl-min-h-0 gs-utl-overflow-y-auto gs-utl-overflow-x-hidden");return h.useEffect(()=>{var l;(l=r.current)==null||l.scrollIntoView({behavior:"smooth"})},[n]),c.jsxs(k,{className:a,gap:"s",col:!0,nowrap:!0,children:[n.length===0?sn(e,{type:"aiChatEmptyState",chatContext:t},s):n.map((l,u)=>c.jsx(h.Fragment,{children:sn(e,{type:"aiChatMessage",chatContext:t,message:l,isStreaming:i&&u===n.length-1},s)},l.id)),sn(e,{type:"aiChatMessagesStatus",chatContext:t},s),c.jsx("div",{ref:r})]})}const Zx=h.createContext(void 0),z7=({chatManager:e,children:t})=>{const n=e.currentChatState,s=h.useMemo(()=>({chatManager:e,chatState:n}),[e,n]);return c.jsx(Zx.Provider,{value:s,children:t})},U7=()=>h.useContext(Zx),W7="gs-cmp-ai-chat-panel";function G7({editor:e,pluginOptions:t,style:n,className:s}){const{chatState:r}=U7(),[,o]=h.useState(0),[i,a]=h.useState(),{toolAbortControllers:l,toolStatusProgress:u,contextComponents:d,isMessagesLoaded:f}=r;h.useEffect(()=>r.onUpdate(()=>o(j=>++j)),[]);const p=Q1.useChat({chat:r.chat}),{messages:g,sendMessage:m,status:b,setMessages:v,error:x}=p,y=x||i,w=h.useMemo(()=>({id:p.id,messages:g,setMessages:v,sendMessage:m,status:b,stop:()=>(l.forEach(C=>C.abort()),l.clear(),p.stop()),addToolApprovalResponse:p.addToolApprovalResponse,addToolOutput:p.addToolOutput,error:y,setError:C=>a(typeof C=="string"?new Error(C):C),clearError:()=>{p.clearError(),a(void 0)},toolStatusProgress:u,contextComponents:d}),[e,b,g,y]),S=N(W7,s,"gs-utl-relative gs-utl-w-full gs-utl-h-full gs-utl-min-h-0 gs-utl-max-h-full gs-utl-overflow-hidden");return c.jsx(k,{className:S,style:n,col:!0,nowrap:!0,children:f?c.jsxs(c.Fragment,{children:[sn(e,{type:"aiChatHeader",chatContext:w},t),c.jsx(B7,{editor:e,chatContext:w,messages:g,pluginOptions:t}),w.error&&sn(e,{type:"aiChatError",chatContext:w},t),sn(e,{type:"aiChatInput",chatContext:w},t)]}):sn(e,{type:"aiChatLoadingState",chatContext:w},t)})}const q7=(e,t,n)=>(e.runCommand(ie.layoutComponentAdd,{type:"aiChatPanel",component:s=>({type:"custom",noWrapper:!0,component:()=>c.jsx(z7,{chatManager:n,children:c.jsx(G7,{...s,editor:e,pluginOptions:t})})})}),e.runCommand(ie.layoutComponentAdd,{type:"aiChatHeader",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:kE})}),e.runCommand(ie.layoutComponentAdd,{type:"aiChatError",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:$E})}),e.runCommand(ie.layoutComponentAdd,{type:"aiChatLoadingState",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:A7})}),e.runCommand(ie.layoutComponentAdd,{type:"aiChatInput",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:T7})}),e.runCommand(ie.layoutComponentAdd,{type:"aiChatEmptyState",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:RE})}),e.runCommand(ie.layoutComponentAdd,{type:"aiChatMessage",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:k7})}),e.runCommand(ie.layoutComponentAdd,{type:"aiChatMessagesStatus",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:H7})}),()=>{["aiChatPanel","aiChatHeader","aiChatError","aiChatLoadingState","aiChatInput","aiChatEmptyState","aiChatMessage","aiChatMessagesStatus"].forEach(s=>{e.runCommand(ie.layoutComponentRemove,{type:s})})}),K7={aiChat:{header:{title:"AI Chat",clear:"Clear"},emptyState:{title:"AI Assistant",subtitle:"How can I help you build your project?",suggestions:{webHero:"Create a hero section with a headline and call-to-action",webFeatures:"Add a features grid with icons",webContact:"Create a contact form",webTestimonials:"Add testimonials section",emailHeader:"Add an email header",emailCta:"Add a call-to-action button",emailFooter:"Add an email footer with links",emailProduct:"Add a product showcase section"}},error:{title:"Error"},panel:{loadError:"Failed to load messages",messagesUpdate:"Error during messages update"},input:{placeholder:"Ask anything...",uploadError:"Failed to upload images",attach:{title:"Attach images",upload:"Upload new image",selectFromAssets:"Select image from Assets",maxAssets:"Maximum {count} assets allowed"},assets:{imageAlt:"Image {num}",pdfTitle:"PDF {num}",remove:"Remove"},context:{multiple:"{count} Components",clear:"Clear"},dictate:{start:"Dictate",stop:"Stop"}},message:{reasoning:"Reasoning",tool:{input:"Input",output:"Output",error:"Error"},source:{document:"Document"}}}},Y7="aiChat",Z7=Ko.startup,X7=function(e,t={}){t.getAccessToken&&(Kt.getAccessToken=t.getAccessToken),ib();const n=new oS(e,t),{Commands:s}=e;s.add(Ss.getChatManager,()=>n),s.add(Ss.getChatState,()=>n.currentChatState),s.add(Ss.getChatApi,()=>n.currentChatState.chatApi),e.I18n.addMessages({en:K7});const r=q7(e,t,n),o=()=>{delete s.commands[Ss.getChatManager],delete s.commands[Ss.getChatState],delete s.commands[Ss.getChatApi],r(),$w()};Lw({editor:e,licenseKey:t.licenseKey,plan:Z7,pluginName:Y7,onLicenseCheckResponse:i=>{i?Kt.license=i:Kt.license=void 0},cleanup:o})},J7=Mw(X7);module.exports=J7;
399
+ `:void 0};r==="tab"&&(a.traits=[{type:"button",label:!1,text:"Style Active",command:c=>{c.select(),c.runCommand(cx),setTimeout(()=>c.Selectors.select(".tab.tab-active"))}}]),t.addType(r,{model:{defaults:a}})}};e.on("component:type:add",n)}const n9=(e,t)=>{const n=t.appStore.store.globalStylesStore;e.on(e.events.projectLoad,({loaded:s})=>s&&n.onLoad())},s9=(e,t)=>{const{assetsStore:n}=t.appStore.store;if(n.onCloudOrCustomUpload){const{Assets:s}=e;s.getConfig().uploadFile=async(...r)=>{const o=r[0],i=await n.handleUpload(o),a=r[1];i&&(a==null||a({data:i}))}}e.on(e.events.destroy,()=>n.setAllProviders([]))},r9=()=>{const{baseApiUrl:e}=Vv();return`${e}/sdk/projects`},lx=e=>`${r9()}/${e}`,o9=async({licenseKey:e,projectId:t,...n})=>{const s=await Os.put(lx(t),{body:JSON.stringify(n),params:{d:window.location.hostname,licenseKey:e}});return s==null?void 0:s.result},i9=async(e,t)=>await Os.put(t,{body:e,headers:{"Content-Type":"application/json"}}),a9=async(e,t,n,s)=>{const r=JSON.stringify(e),o=await o9({licenseKey:t,projectId:n,fileMetadata:{size:new Blob([r]).size},identityId:s,name:e.name,description:e.description});if(!o)throw new Error("Project not found");const{uploadUrl:i}=o;await i9(r,i)},l9=(e,t,n)=>Os.get(lx(t),{params:{d:window.location.hostname,licenseKey:e,identityId:n}}),c9=async e=>await Os.get(e),u9=async(e,t,n,s)=>{const r=await l9(t,n,s),o=r==null?void 0:r.result,i=r==null?void 0:r.errorData;if(!o&&(i!=null&&i.notFoundInDb))return{id:n,project:{}};if(!o)throw new Error("Project not found");const{downloadUrl:a}=o,c=await c9(a);if(!c||c instanceof Error)throw new Error("Project download failed");return{id:n,project:c}},d9=(e,t)=>{const{appEditorStore:n,toastStore:s,i18nStore:r}=t.appStore.store,{isUsingProjectSelfHosted:o,isUsingProjectCloud:i,sdkOptions:a}=n,c=a.storage||{},{project:u,onLoad:d,onSave:p,autosaveChanges:h,autosaveIntervalMs:g}=c;let m,b,v,x;if(o)v=d,x=p,m=h,b=g;else if(i){const j=a.licenseKey,E=n.sdkProjectId,T=n.sdkIdentityId,O=10,P=1e4;x=({project:_})=>a9(_,j,E,T),v=({editor:_})=>u9(_,j,E,T),m=Math.max(O,h??O),g&&(b=Math.max(P,g))}const{Storage:y,events:w}=e,{events:S}=y;let C=!1;if(e.once(w.projectLoad,j=>{C=!!j.loaded}),e.once("change:readyLoad",()=>{var E;const j=(E=a.project)==null?void 0:E.default;!C&&j&&e.loadProjectData(j)}),e.on(S.startStore,()=>n.setIsSaving(!0)),e.on(S.endStore,()=>n.setIsSaving(!1)),(v||u)&&x){const j="remote";y.setCurrent(j),y.add(j,{async load(){return u||(await v({editor:e})).project},async store(E){await x({project:E,editor:e})}}),e.on(S.errorLoad,E=>{s.addError("storage-error-load",{header:r.t("storageManager.errorLoad"),content:E.message})}),e.on(S.errorStore,E=>{s.addError("storage-error-store",{header:r.t("storageManager.errorStore"),content:E.message})}),m&&y.setStepsBeforeSave(m),b&&e.onReady(()=>{const E=setInterval(async()=>{e.getDirtyCount()>0&&!n.isSaving&&await e.store()},b);e.on("destroy",()=>clearInterval(E))})}},hc="select-target",cx="enable-sm";function p9(e,t){var L,F,G,D;const{appStore:n}=t,{appEditorStore:s,blockManagerStore:r,toastStore:o,modalStore:i,layoutStore:a,contextMenu:c,assetsStore:u,fontsStore:d}=n.store,{projectIdToLoad:p,nextProjectData:h,sdkOptions:g}=s,m=()=>r.toggleOpen(),b=()=>s.toggleLeftSidebar(),v=()=>s.toggleRightSidebar(),x=e.getConfig(),{Assets:y,Storage:w,Commands:S}=e,C=S.events,j=e.events,E=(F=(L=g.gjsOptions)==null?void 0:L.assetManager)==null?void 0:F.custom;let T=!1;if(y.all.model.prototype.idAttribute="src",At(E)&&(y.getConfig().custom=E),h&&(x.projectData=h,s.setNextProjectData()),p){const $=w.getConfig().options;$&&($.local.key=p)}e.on(j.projectLoad,({project:$})=>{var I;n.setProjectDataCustom($.custom||{projectType:(I=s.sdkOptions.project)==null?void 0:I.type}),d.loadFonts()}),e.on(j.projectGet,({project:$})=>{$.custom=ii(e)}),e.RichTextEditor.getConfig().custom=!0;const{Canvas:O}=e,P=vr(()=>s.setCanvasPanning(!1),200);e.on(O.events.coords,()=>{s.setCanvasPanning(!0),P()}),e.on(O.events.frameLoad,({el:$})=>{$.tabIndex=-1});const{Parser:_}=e,M=((G=s.sdkOptions.parser)==null?void 0:G.showErrors)!==!1;(D=_.events)!=null&&D.css&&M&&e.on(_.events.css,$=>{const{error:I}=$;if(I){const R=nt(I)?I:I.name&&I.reason?`${I.name}: ${I.reason}`:I.message;o.addError("css-error",{header:"CSS Parser Error",content:R})}}),[{id:"toggle-lsidebar",keys:"alt+ctrl+,",cmd:b},{id:"toggle-lsidebar2",keys:"alt+⌘+,",cmd:b},{id:"toggle-rsidebar",keys:"alt+ctrl+., alt+⌘+.",cmd:v},{id:"show-blocks",keys:"ctrl+b, ⌘+b",cmd:m},{id:"add-symbol",keys:"alt+ctrl+k, alt+⌘+k",cmd:se.symbolAdd},{id:"detach-symbol",keys:"shift+alt+ctrl+k, shift+alt+⌘+k",cmd:se.symbolDetach}].forEach(({id:$,keys:I,cmd:R})=>{e.Keymaps.add(`preset:${$}`,I,R,{prevent:!0})}),e.on(`${C.runCommand}core:preview`,()=>{s.setPreview(!0),r.setOpen(!1),Ng(e,!1)}),e.on(`${C.stopCommand}core:preview`,()=>{s.setPreview(!1),Ng(e,!0),setTimeout(()=>{e.refresh()},s.transitionTime)});const N="target-selection",{Components:H}=e;S.add(hc,{opts:{},init(){this.beforeSelect=this.beforeSelect.bind(this)},onComponentHover($,I){const R={id:N,type:"target",component:I};I?O.addSpot(R):O.removeSpots(R)},beforeSelect($,I={}){I.abort=!0,I.useValid=!1,this.opts.onSelect($),e.stopCommand(hc)},run($,I,R){this.opts=R,e.on("component:select:before",this.beforeSelect),e.on("change:componentHovered",this.onComponentHover)},stop(){e.off("component:select:before",this.beforeSelect),e.off("change:componentHovered",this.onComponentHover),O.removeSpots({id:N}),s.setSelectingTarget(!1)}}),S.add(cx,()=>{s.setSelectedDesignerTab("style")}),S.add(se.toastAdd,($,I,R)=>{o.add(R.id,R)}),S.add(se.toastRemove,($,I,R)=>{o.remove(R.id)}),S.add(se.dialogOpen,($,I,R)=>{i.open(R)}),S.add(se.dialogClose,()=>{i.close()}),S.add(se.dialogExportCode,()=>{i.open({title:e.t("actions.showCode.title"),content:()=>{var $,I;return f.createElement(Z4,{options:(I=($=g.commands)==null?void 0:$.options)==null?void 0:I[Un.showCode]})}})}),S.add(se.sidebarLeftGet,()=>({visible:s.isLeftSidebarOpen})),S.add(se.sidebarLeftSet,($,I,R)=>{s.setLeftSidebarOpen(!!R.visible)}),S.add(se.sidebarLeftToggle,()=>{s.setLeftSidebarOpen(!s.isLeftSidebarOpen)}),S.add(se.sidebarRightGet,()=>({visible:s.isRightSidebarOpen})),S.add(se.sidebarRightSet,($,I,R)=>{s.setRightSidebarOpen(!!R.visible)}),S.add(se.sidebarRightToggle,()=>{s.setRightSidebarOpen(!s.isRightSidebarOpen)}),S.add(se.sidebarTopGet,()=>({visible:s.isTopSidebarOpen})),S.add(se.sidebarTopSet,($,I,R)=>{s.setTopSidebarOpen(!!R.visible)}),S.add(se.sidebarTopToggle,()=>{s.setTopSidebarOpen(!s.isTopSidebarOpen)}),S.add(se.sidebarBottomGet,()=>({visible:s.isBottomSidebarOpen})),S.add(se.sidebarBottomSet,($,I,R)=>{s.setBottomSidebarOpen(!!R.visible)}),S.add(se.sidebarBottomToggle,()=>{s.setBottomSidebarOpen(!s.isBottomSidebarOpen)}),S.add(se.layoutAdd,($,I,R)=>{R.id&&a.add(R.id,R)}),S.add(se.layoutRemove,($,I,R)=>{const{id:z,...Y}=R;a.remove(z,Y)}),S.add(se.layoutToggle,($,I,R)=>{const{id:z,...Y}=R;z&&(a.get(z)?a.remove(z,Y):a.add(z,Y))}),S.add(se.layoutUpdate,($,I,R)=>{const z=R;e.runCommand(se.layoutRemove,{id:z.id,layout:{placer:{...z.placer,skipCleanup:!0}},force:!0}),setTimeout(()=>e.runCommand(se.layoutAdd,{...z}))}),S.add(se.layoutGet,($,I,R)=>[gr(a.get(R.id))]),S.add(se.layoutConfigGet,()=>gr(a.customConfig)),S.add(se.layoutConfigSet,($,I,R)=>{const z=R;a.setCustomConfig(z)}),S.add(se.layoutComponentAdd,($,I,R)=>{const{type:z,component:Y}=R;z&&Y&&a.addCustomLayoutComponent(z,Y)}),S.add(se.layoutComponentGet,($,I,R)=>a.getCustomLayoutComponent(R.type)),S.add(se.layoutComponentRemove,($,I,R)=>{a.removeCustomLayoutComponent(R.type)}),S.add(se.layoutComponentRender,($,I,R)=>f.createElement(BR,{components:R.components})),S.add(se.getStateTheme,()=>s.publicStateTheme),S.add(se.setStateTheme,($,I,R)=>s.setPublicStateTheme(R)),S.add(se.getPagesConfig,()=>s.sdkPagesConfig),S.add(se.setPagesConfig,($,I,R)=>{const{config:z}=R||{};At(z)&&s.setSdkPagesConfig(z)}),S.add(se.getPageSettings,()=>JSON.parse(JSON.stringify(s.panelPageSettings))),S.add(se.setPageSettings,($,I,R)=>{s.setPanelPageSettings(R)}),S.add(se.clearPage,()=>{const $=I=>e.t(`actions.${I}`);i.confirm({title:$("clearCanvas.title"),content:$("clearCanvas.content"),confirmButton:{variant:"danger",children:$("clearCanvas.title")},onConfirm:()=>{x3(e)?e.loadProjectData({pages:[{component:"<mjml><mj-body></mj-body></mjml>"}]}):e.Components.clear()}})}),S.add(se.projectFiles,($,I,R)=>{var J,ee;const z=(J=s.sdkOptions.dataSources)==null?void 0:J.exportConfig,Y=((ee=R.exportConfig)==null?void 0:ee.exportPreset)??z,Z={isMJML:s.isProjectTypeEmail,exportConfig:Y,...R};return qR($,Z)}),S.add(se.validateCode,($,I,R)=>Jv({...R,appStore:n})),S.add(se.getBlocksPanel,()=>({isOpen:r.isOpen})),S.add(se.setBlocksPanel,($,I,R)=>{const z=R||{};At(z.isOpen)&&r.setOpen(z.isOpen)}),S.add(se.canvasReload,()=>{const $=e.getSelected(),I=O.getCanvasView(),{frames:R}=O.canvas;R.once("loaded:all",()=>{const z=$==null?void 0:$.getView();z&&!z.isInViewport()&&z.el.scrollIntoView({block:"center"})}),I.renderFrames()}),S.add(se.contextMenuComponent,($,I,R)=>{const{component:z,...Y}=R;c.showForComponent(z,Y)}),S.add(se.getStateContextMenu,()=>c.publicState),S.add(se.setStateContextMenu,($,I,R)=>{c.setPublicState(R)}),S.add(se.symbolAdd,($,I,R)=>{const z=R.component||e.getSelected();if(z)return H.getSymbolInfo(z).isSymbol?o.add("skip-symbol",{header:"The selected element is already a symbol",variant:Jt.Warning}):H.addSymbol(z)}),S.add(se.symbolDetach,($,I,R)=>{const z=R.component||e.getSelected();z&&H.getSymbolInfo(z).isRoot&&H.detachSymbol(z)}),S.add(se.symbolOverride,($,I,R)=>{const z=R.component||e.getSelected();z&&(z.setSymbolOverride(R.override),e.Layers.updateLayer(z))}),S.add(se.symbolPropagateStyles,($,I,R)=>{const z=R.component||e.getSelected();if(!z)return;const{Css:Y}=e,Z=Y.getComponentRules(z,{current:!0})[0];if(Z){const{state:J,mediaText:ee}=Z.attributes,te=Z.getStyle();H.getSymbolInfo(z).relatives.forEach(q=>{Y.setIdRule(q.getId(),te,{state:J,mediaText:ee})})}R.deep&&z.components().forEach(J=>e.runCommand(se.symbolPropagateStyles,{...R,component:J}))}),S.add(se.assetProviderGet,()=>gr(u.allProviders)),S.add(se.assetProviderAdd,($,I,{provider:R,index:z})=>{u.addProvider(R,z)}),S.add(se.assetProviderRemove,($,I,{id:R})=>{const z=u.allProviders.filter(Y=>Y.id!==R);u.setAllProviders(z)}),S.add(se.fontGet,()=>gr(d.fonts)),S.add(se.fontAdd,($,I,{font:R})=>{d.addFont(R)}),S.add(se.fontRemove,($,I,{family:R})=>{d.removeFont(R)}),S.add(se.fontManagerOpen,($,I,R)=>{zf($,R)}),S.add(se.menuFontLoad,($,I,{font:R})=>vf(R,!1)),S.add(se.toggleStateDataSource,()=>(T=!T,e.trigger(xn.toggleDataSourcesPreview,{showPlaceholder:T}),e.refresh({tools:!0}),{showPlaceholder:T})),S.add(se.getStateDataSource,()=>({showPlaceholder:T})),S.add(se.dataSourceSetGlobalData,($,I,{globalData:R})=>{const z=ny(R);return e.DataSources.get(Po.globalData).setRecords(z)}),S.add(se.setDragAbsolute,($,I,{enabled:R})=>{s.setIsDraggingAbsolute(!!R)}),S.add(se.dataSourceSetImporter,($,I,R)=>{e.on(e.Parser.events.htmlBefore,z=>{z.input=R.import(z.input)})}),S.add(se.dataSourceSetExporter,($,I,R)=>{e.config.optsHtml={...e.config.optsHtml,exporter:R}}),s9(e,t),d9(e,t),n9(e,t),t9(e),KR(e),C4(e),ZR(e,t),e9(e,t)}const f9=/\s(?![^(]*\))/,l1=/^-?[0-9]+[a-zA-Z%]{0,}$/;function c1(e){const t=e.split(f9),n=t.indexOf("inset")>=0,s=t.filter(d=>d!=="inset"),r=s.filter(d=>!l1.test(d))[0]||"currentColor",o=s.filter(d=>l1.test(d)),[i="0",a="0",c="0",u="0"]=o;return{x:i,y:a,blur:c,spread:u,inset:n,color:r}}const Al=["%"],Ml=["s","ms"],Ai=["deg","rad","grad"],ds=["px","%","em","rem","vw","vh"],u1={type:"select",options:["visible","hidden","scroll","auto"].map(e=>({id:e})),default:"visible"},h9=e=>`linear-gradient(${e} 1%, ${e} 100%)`,gc=e=>({id:e,label:e.split("-").map(vs).join(" ")}),ux=e=>({property:t,to:n})=>{if(n.value){const s=t.getOption(),r=t.getParent().getProperty(e),o=r.getUnit(),i={units:s.units||[],min:s.min,max:s.max,unit:""};(!o||(i==null?void 0:i.units.indexOf(o))<0)&&(i.unit=(i==null?void 0:i.units[0])||""),r.up(i)}},g9=e=>{const t=`${e}-name`,n=`${e}-value`;return(s,{separatorLayers:r})=>{const o=s[e]||"";return o?o.split(r).map(i=>{const{name:a,value:c}=lu(i);return{[t]:a,[n]:c}}):[]}},d1=e=>{const t={[Xi]:e};if(e.indexOf("url(")>-1)t[xs]=yr.Image;else if(e.indexOf("gradient(")>-1){const n=Xf(e),s=n.colorStops,r=n.name.indexOf("linear")>=0;s.length===2&&r&&s[0].color===s[1].color?t[xs]=yr.Color:t[xs]=yr.Gradient}else t[xs]=yr.Color,t[Xi]=h9(e);return t},p1=(e="filter")=>{const t=`${e}-name`,n=`${e}-value`;return{property:e,type:"stack",layerSeparator:" ",fromStyle(s,{separatorLayers:r}){const o=s[e]||"";return o?o.split(r).map(i=>{const{name:a,value:c}=lu(i);return{[t]:a,[n]:c}}):[]},toStyle(s,{name:r}){return{[r]:`${s[t]}(${s[n]||"0"})`}},properties:[{property:t,type:"select",default:"blur",options:[{id:"blur",label:"Blur",min:0,units:["px","em","rem","vw","vh"]},{id:"brightness",label:"Brightness",min:0,units:["%"]},{id:"contrast",label:"Contrast",min:0,units:["%"]},{id:"grayscale",label:"Grayscale",min:0,max:100,units:["%"]},{id:"hue-rotate",label:"Hue rotate",min:0,max:360,units:["deg","rad","grad"]},{id:"invert",label:"Invert",min:0,max:100,units:["%"]},{id:"saturate",label:"Saturate",min:0,units:["%"]},{id:"sepia",label:"Sepia",min:0,max:100,units:["%"]}],onChange:ux(n)},{property:n,type:"integer"}]}},Ll=(e,{x:t,y:n,mergable:s}={})=>{const r={property:`${e}-x`,type:"integer",units:ds,...t},o={property:`${e}-y`,type:"integer",units:ds,...n};return{property:e,type:"composite",properties:[r,o],...s&&{fromStyle(i,{name:a,separator:c,property:u}){const[d,p]=u.getProperties(),[h,g]=(i[a]||"").split(c);return{[d.getId()]:i[d.getName()]||h||"",[p.getId()]:i[p.getName()]||g||h||""}},toStyle(i,{name:a,property:c}){const[u,d]=c.getProperties(),p=i[u.getId()],h=i[d.getId()];return{[a]:p===h?p:`${p} ${h}`}}}}},m9=(e,t="")=>{const n=`${e}-name`,s=`${e}-value`;return(r,{name:o})=>({[o]:`${r[n]}(${r[s]||t})`})};["top","middle","bottom"].map(gc),["none","solid","dotted","dashed","double","groove","ridge","inset","outset"].map(gc),["background-position-x","background-position-y"].map(e=>({type:"integer",property:e,fixedValues:e==="background-position-x"?["left","center","right"]:["top","center","bottom"],units:["px"],default:"auto"}));Ll("gap",{x:{property:"row-gap",min:0,default:"0"},y:{property:"column-gap",min:0,default:"0"},mergable:!0}),["baseline","top","middle","bottom"].map(gc),Rx("(?<!\\(.*[^)]),(?![^()]*\\))"),yr.Image,yr.Gradient,yr.Color,["background-position-x","background-position-y"].map(e=>({type:"integer",property:e,units:ds,default:"0px"})),["background-size-x","background-size-y"].map(e=>({type:"integer",property:e,units:ds,default:"auto"})),["border-top-width","border-right-width","border-bottom-width","border-left-width"].map(e=>({type:"integer",property:e,default:"0",units:ds})),["border-top-style","border-right-style","border-bottom-style","border-left-style"].map(e=>({type:"select",property:e,default:"none",options:[{id:"none",label:"None"},{id:"solid",label:"Solid"},{id:"dotted",label:"Dotted"},{id:"dashed",label:"Dashed"},{id:"double",label:"Double"},{id:"groove",label:"Groove"},{id:"ridge",label:"Ridge"},{id:"inset",label:"Inset"},{id:"outset",label:"Outset"}]})),["border-top-color","border-right-color","border-bottom-color","border-left-color"].map(e=>({type:"color",property:e,default:"currentColor"})),Ll("overflow",{x:u1,y:u1,mergable:!0}),p1(),p1("backdrop-filter"),["width","height","min-width","min-height","max-width","max-height","padding","margin","color","font-size","line-height","letter-height","border","border-radius","background","opacity","box-shadow","text-shadow","filter","backdrop-filter","transform","all"].map(gc),Ml[0],Ml[0],g9("transform"),m9("transform","0"),ux("transform-value"),Ll("transform-origin",{x:{default:"50%"},y:{default:"50%"}}),Ll("perspective-origin",{x:{default:"50%"},y:{default:"50%"}});function dx(e,t){return[n=>M4(n,t),...A4[e],n=>p9(n,t),P4(e,t)]}class b9{constructor(t){this.loadCounter=0,this.pendingInstalled=[],this.pendingUninstalled=[],this.selectedShown=!1,this.store=t,tn(this,{},{autoBind:!0})}get hasPending(){return!!this.pendingInstalled.length||!!this.pendingUninstalled.length}*initProjectPlugins(t){this.clearPending();const s=(yield y9()).filter(r=>r.projectType.includes(t));this.setProjectPlugins(s)}setProjectPlugins(t,n={}){this.projectPlugins=[...t],n.clearPending&&this.clearPending()}clearPending(){this.pendingInstalled=[],this.pendingUninstalled=[]}getPluginsToLoad(t,n){const s=[...dx(t,{appStore:n}),...this.projectPlugins||[]],r=n.sdkOptions.plugins||[];return Ke(r)?r({plugins:s}):[...s,...r]}addPendingInstalled(t){const{pendingInstalled:n,pendingUninstalled:s}=this,r=t.id;s.includes(r)?this.pendingUninstalled=s.filter(o=>o!==r):n.includes(r)||n.push(r)}addPendingUninstalled(t){const{pendingInstalled:n,pendingUninstalled:s}=this,r=t.id;n.includes(r)?this.pendingInstalled=n.filter(o=>o!==r):s.push(r)}setSelectedShown(t){this.selectedShown=t}}const v9={db:wv.gjsStudio},y9=()=>new Promise(async e=>{let t=[];try{t=await zO($c.Settings,"plugins",v9)||[]}catch(n){Ts()&&console.error(n)}e(t)}),x9=f.createContext(void 0);class w9{constructor(t){this.blockManagerStore=new q3(this),this.appEditorStore=new _3(this,t==null?void 0:t.appEditorStore),this.localSettingsStore=new J_(t==null?void 0:t.localSettingsStore),this.toastStore=new G3(this),this.modalStore=new Q_(this),this.i18nStore=new D3(this),this.pluginStore=new b9(this),this.pointerBadgeStore=new U3(this),this.contextMenu=new S9(this),this.layoutStore=new B3(this),this.templatesStore=new W3(this),this.assetsStore=new V3(this),this.globalStylesStore=new K_(this),this.fontsStore=new H3(this),this.appEditorStore.init(),xp()&&(window.__gjss=this)}}const pn=()=>{const e=f.useContext(x9);if(!e)throw new Error("useStore must be used inside of StoreProvider");return e},Qf=()=>{throw new Error("Store has not been initialized")};class S9{constructor(t){this.isOpen=!1,this.isEnabled=!0,this.items=[],this.coordinates={x:0,y:0},this.getItemsForComponent=fo(function*(n,s={}){var x;if(!(n!=null&&n.em))return[];const r=n.em.getEditor(),{isSymbol:o,isRoot:i}=r.Components.getSymbolInfo(n),a=!!n.getSymbolOverride(),c=!!n.get("removable"),u=!!n.parent()&&!!n.toolbar.length,d=!!n.get("copyable"),p=[u&&{id:ur.selectParent,icon:U.arrowUp,label:"Select parent",onClick:()=>{r.runCommand("core:component-exit",{force:!0})}},d&&{id:ur.duplicate,icon:U.contentCopy,label:"Duplicate",onClick:()=>{r.runCommand("tlb-clone")}},!o&&c&&{id:ur.symbolCreate,icon:U.rhombusSplit,label:"Create Symbol",onClick:()=>{r.runCommand(se.symbolAdd)}},o&&i&&{id:ur.symbolDetach,icon:U.alertRhombus,label:"Detach instance",onClick:()=>{r.runCommand(se.symbolDetach)}},o&&!a&&{id:ur.symbolOverride,icon:U.rhombusOutline,label:"Make overridable",onClick:()=>{r.runCommand(se.symbolOverride,{override:!0})}},o&&a&&{id:ur.symbolOverrideClear,icon:U.rhombusSplitOutline,label:"Clear overridable",onClick:()=>{r.runCommand(se.symbolOverride)}},c&&{id:ur.delete,icon:U.delete,label:"Delete",onClick:()=>{r.runCommand("core:component-delete")}}].filter(Boolean),h=n.get("contextMenu"),g={...s,items:p,component:n,editor:r,type:n.get("type")||"default",source:s.source||bf.canvas},m=yield f1(h,g),b=(x=this.store.appEditorStore.sdkComponentsConfig)==null?void 0:x.contextMenu;return yield f1(b,{...g,items:m})}),this.store=t,tn(this,{},{autoBind:!0})}get publicState(){return{enabled:this.isEnabled}}setPublicState(t){t.enabled!==void 0&&(this.isEnabled=t.enabled)}*showForComponent(t,n){const s=t==null?void 0:t.em;if(!s)return;n.skipSelect||s.selected.hasComponent(t)||s.setSelected(t);const r=yield this.getItemsForComponent(t,n);r.length&&this.show({...n,items:r})}show({items:t,x:n,y:s,w:r,h:o}){this.isOpen=!0,this.coordinates={x:n,y:s,w:r,h:o},this.items=t}hide(){this.isOpen=!1,setTimeout(this.clear,101)}clear(){this.items=[],this.coordinates={x:0,y:0}}}const f1=async(e,t)=>Ke(e)?(await e(t)).filter(Boolean):t.items,C9=()=>pn().contextMenu,h1=Ts()&&document.body,eh=(e={})=>({...Ef,placement:"right-start",modifiers:[{name:"offset",options:{offset:e.offset||[0,5]}},{name:"flip",options:{boundary:e.boundary??h1}},{name:"preventOverflow",options:{boundary:e.boundary??h1}}]}),j9=eh(),Nl="gs-ctx-menu-list",E9=ae(function({onItemClick:t,open:n,items:s,x:r,y:o,w:i,h:a,className:c}){const u=C9(),[d,p]=f.useState(),[h,g]=f.useState(null),m=f.useMemo(()=>({getBoundingClientRect:()=>new DOMRect(r,o,i,a)}),[r,o,i,a,n]),{styles:b,attributes:v}=$a(m,h,j9),x=A(`${Nl}-wrp gs-utl-z-20`,c),y=A(`${Nl} gs-utl-z-20`),w=A(`${Nl}-body gs-utl-max-w-56`),S=A(`${Nl}-item`),C="gs-utl-max-w-40",j=E=>{const{action:T,onClick:O}=E;if(T||O)return P=>{const _={editor:u.store.appEditorStore.editor,...P};Ke(T)?(T(_),u.hide()):Ke(O)&&(O(_),u.hide())}};return l.jsx("div",{className:x,ref:g,style:b.popper,...v.popper,children:l.jsx(lf,{show:!!n,...kj,unmount:!1,children:l.jsx(Dn,{padding:!1,className:y,classNameBody:w,children:s.map((E,T)=>f.createElement(hi,{onItemClick:t,...E,key:E.id??T,className:S,classNameLabel:C,action:j(E),onActive:()=>p(E),active:d===E}))})})})}),bd="gs-cmp-tooltip";function $t({className:e,classNameWrp:t,classNameContent:n,strategy:s,placement:r="bottom",children:o,title:i,onClick:a,inline:c,size:u}){const[d,p]=f.useState(!1),[h,g]=f.useState(!1),m=At(u),[b,v]=f.useState(null),[x,y]=f.useState(null),w=$a(b,x,{...eh(),placement:r,...s?{strategy:s}:{}});f.useEffect(()=>{var j;d&&((j=w.update)==null||j.call(w))},[d,w.update]),f.useEffect(()=>{const j=setTimeout(()=>p(h),10);return()=>clearTimeout(j)},[h]);const S=A(`${bd}-target`,!c&&"gs-utl-block",e,!a&&"gs-utl-cursor-auto"),C=A(`${bd}-content`,n,"gs-utl-fixed gs-utl-z-30 gs-utl-text-sm",!m&&!n&&"gs-utl-whitespace-nowrap",u==="s"&&"gs-utl-w-60");return l.jsxs("div",{className:A(bd,"gs-utl-relative",t),children:[l.jsx("span",{ref:v,className:S,onMouseEnter:()=>i&&g(!0),onMouseLeave:()=>g(!1),children:l.jsx("div",{className:A(c&&"gs-utl-inline-block"),onClick:()=>{g(!1),a==null||a()},children:o})}),!!h&&l.jsx("div",{className:C,ref:y,style:w.styles.popper,...w.attributes.popper,children:l.jsx(lf,{show:!!d,unmount:!1,...Lb,children:l.jsx(Dn,{className:Mh.txt,bg:Mh.bg,size:"s",border:!1,children:i})})})]})}function ft({children:e,title:t,classNameWrp:n,tooltipProps:s,...r}){return l.jsx($t,{title:t,classNameWrp:n,...s,children:l.jsx(Ge,{...r,children:e})})}const Ro="gs-cmp-ai-chat-assets",P9=e=>{var t;return((t=e.mediaType)==null?void 0:t.startsWith("image/"))||e.mediaType==="image/*"},T9=e=>e.mediaType==="application/pdf",px=({editor:e,assets:t,className:n,onRemove:s,style:r})=>{const o=`${Ro}__asset-item`,i=A(`${Ro}__asset-image`,"gs-utl-object-cover",X.rnd,tl.m),a=A(`${Ro}__asset-pdf`,"gs-utl-overflow-hidden",X.rnd,tl.m),c=A(`${Ro}__asset-file`,"gs-utl-flex gs-utl-items-center gs-utl-justify-center",X.rnd,tl.m,B.bgH2),u=A(`${Ro}__asset-remove`,"gs-utl-absolute gs-utl--top-2 gs-utl--right-1 gs-utl-text-white gs-utl-flex gs-utl-items-center gs-utl-justify-center gs-utl-z-10",tl.s,X.pill,B.bgRed,B.hBgRed),d="aiChat.input.assets";if(t.length<=0)return null;const p=(h,g)=>{const m={params:{num:g+1}},b=e.t(`${d}.imageAlt`,m),v=e.t(`${d}.pdfTitle`,m);return P9(h)?l.jsx("img",{src:h.src,alt:b,className:i}):T9(h)?l.jsx("iframe",{src:h.src,title:v,className:a}):l.jsx("div",{className:c,children:l.jsx(Q,{icon:hS,size:oe.l})})};return l.jsx(k,{className:A(Ro,n),gap:"xs",wrap:"wrap",style:r,children:t.map((h,g)=>l.jsxs("div",{className:A(o,"gs-utl-relative gs-utl-inline-block"),children:[p(h,g),s&&l.jsx(ft,{title:e.t(`${d}.remove`),icon:{icon:U.close,size:oe.s3x},onClick:()=>s(g),size:"x2s",border:!1,className:u})]},h.src))})},Yt="gs-cmp-ai-chat-input",O9=e=>{const{className:t,style:n,editor:s,disabled:r,maxAssets:o,currentAssetsCount:i,acceptAssetType:a,onFilesSelected:c,onAssetSelected:u}=e,d=f.useRef(null);if(o<=0)return null;const p=`${Yt}__attach-btn`,h=`${Yt}__file-input`,g=i>=o,m="aiChat.input.attach",b=s.t(`${m}.upload`),v=s.t(`${m}.selectFromAssets`),x=s.t(`${m}.title`),y=s.t(`${m}.maxAssets`,{params:{count:o}}),w=C=>{const j=Array.from(C.target.files||[]);j.length>0&&c(j),d.current&&(d.current.value="")},S=C=>{if(!s||g)return;const j="btnAttachImages",E=()=>s.runCommand(se.layoutRemove,{id:j});s.runCommand(se.layoutToggle,{id:j,header:!1,placer:{type:"popover",target:C.currentTarget,closeOnClickAway:!0,options:{placement:"top-start"}},layout:{type:"menuList",className:"gs-utl-text-sm",onItemClick:E,items:[{id:"upload",label:b,icon:U.trayArrowDown,onClick:()=>{var T;return(T=d.current)==null?void 0:T.click()}},{id:"assets",label:v,icon:jS,onClick:()=>{s.Assets.open({onSelect:({asset:T})=>{const O=T.getSrc();O&&u(O)}})}}]}})};return l.jsxs(l.Fragment,{children:[l.jsx("input",{ref:d,type:"file",accept:a,multiple:!0,onChange:w,className:h,style:{display:"none"}}),l.jsx(ft,{className:A(p,X.pill,t),style:n,title:g?y:x,icon:U.plus,border:!1,onClick:S,disabled:r||g,size:"s",block:!0})]})},_9=({editor:e,className:t,style:n,contextComponents:s,disabled:r})=>{const[o,i]=f.useState(()=>e.getSelectedAll()),a="aiChat.input.context";f.useEffect(()=>{const y=e.Components.events.select,w=()=>i(e.getSelectedAll());return e.on(y,w),()=>{e.off(y,w)}},[e]),f.useEffect(()=>{s.clear(),o.forEach(y=>s.add(y))},[o,s]);const c=()=>i([]);if(o.length===0)return null;const u=`${Yt}__context`,d=`${Yt}__context-icon`,p=`${Yt}__context-badge`,h=`${Yt}__context-name`,g=`${Yt}__context-divider`,m=o.length===1,b=o[0],v=e.t(`${a}.multiple`,{params:{count:o.length}}),x=m?b.getName():v;return l.jsxs(k,{className:A(u,r&&Se.disabled,t),style:n,gap:"s",items:"center",nowrap:!0,children:[l.jsx(Q,{icon:U.target,size:oe.sx,className:A(d,B.txtLowEmphasis)}),l.jsx(jr,{className:A(p,$b(b).bg,we.xyS2),s:"s",children:l.jsxs(k,{gap:"xs",items:"center",nowrap:!0,children:[m&&Lv(b),l.jsx("div",{className:A(h,Se.txtEllips,"gs-utl-max-w-36"),children:x}),!r&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:A(g,X.br,"gs-utl-h-[18px] gs-utl-opacity-30")}),l.jsx(ft,{title:e.t(`${a}.clear`),icon:{icon:U.close,size:oe.s3x},onClick:c,size:"x2s",border:!1,block:!0})]})]})})]})};function g1(){return typeof window<"u"&&(window.SpeechRecognition||window.webkitSpeechRecognition)}function A9(){const[e,t]=f.useState(""),[n,s]=f.useState(!1),[r,o]=f.useState(!1),i=f.useRef();f.useEffect(()=>o(!!g1()),[]);const a=()=>{const u=g1();if(!u)return;t("");const d=new u;d.lang="en-US",d.continuous=!0,d.interimResults=!0,d.onstart=()=>s(!0),d.onend=c,d.onresult=p=>{const g=Array.from(p.results).map(m=>m[0].transcript).join("");t(g)},d.onerror=p=>{console.error("Speech recognition error",p),c()},i.current=d,d.start()},c=()=>{var u;(u=i.current)==null||u.stop(),s(!1)};return{transcript:e,isSupported:r,isListening:n,start:a,stop:c}}const M9=({editor:e,disabled:t,onTranscript:n,onListeningChange:s,className:r,style:o})=>{const i=`${Yt}__dictate`,{transcript:a,isSupported:c,isListening:u,start:d,stop:p}=A9(),h="aiChat.input.dictate",g=e.t(`${h}.start`),m=e.t(`${h}.stop`),b=u?m:g;return f.useEffect(()=>{a&&n(a)},[a]),f.useEffect(()=>{s==null||s(u)},[u]),c?l.jsx(ft,{block:!0,size:"s",border:!1,className:A(i,X.pill,r),style:o,title:b,disabled:t,icon:u?RS:kS,onClick:u?p:d,variant:u?"danger":"out-clear"}):null},L9=({autoResize:e,autoFocus:t,style:n={},...s})=>{const r=f.useRef(null);return f.useEffect(()=>{!r.current||!e||(r.current.style.height="auto",r.current.style.height=r.current.scrollHeight+"px")},[s.value,e]),f.useEffect(()=>{const o=r.current;if(o&&t){const i=setTimeout(()=>o==null?void 0:o.focus(),150);return()=>clearTimeout(i)}},[r.current,t]),l.jsx("textarea",{ref:r,style:{...n,...e?{resize:"none"}:{}},...s})},m1=e=>{e.forEach(t=>{t.startsWith("blob:")&&URL.revokeObjectURL(t)})},b1=(e,t)=>e?t?!e.endsWith(" ")&&!t.startsWith(" ")?`${e} ${t}`:`${e}${t}`:e:t,N9=({className:e,style:t,chatContext:n,editor:s,maxAssets:r=5,acceptAssetType:o="image/jpeg,image/png,image/gif,image/webp,application/pdf",uploadProjectAssets:i,layoutBefore:a,layoutAfter:c,onSubmit:u,contextSectionProps:d,textareaProps:p,assetsSectionProps:h,attachButtonProps:g,dictateButtonProps:m,submitButtonProps:b,value:v})=>{const[x,y]=f.useState(v||""),[w,S]=f.useState(""),[C,j]=f.useState(!1),[E,T]=f.useState([]),[O,P]=f.useState(!1),_="aiChat.input",M=s.runCommand(ps.getChatApi),N=s.runCommand(ps.getChatState),{status:H,stop:L,sendMessage:F,setError:G}=n||M,D=H==="streaming"||H==="submitted",$=E.length>0,I=w?b1(x,w):x,R=!O&&(D||I.trim()||$),z={input:I,assets:E},Y=be=>{const Ze=r-E.length,Ye=be.slice(0,Ze);if(Ye.length===0)return;const lt=Ye.map(Pe=>({src:URL.createObjectURL(Pe),file:Pe,mediaType:Pe.type}));T(Pe=>[...Pe,...lt])},Z=be=>{E.length>=r||T(Ze=>[...Ze,{src:be,mediaType:"image/*"}])},J=be=>{const Ze=E[be];Ze!=null&&Ze.file&&m1([Ze.src]),T(Ye=>Ye.filter((lt,Pe)=>Pe!==be))},ee=async be=>{if(be.preventDefault(),D||O)return;const Ze=()=>te();if(u){u({event:be,submit:Ze,state:z});return}Ze()},te=async()=>{if(D||O)return;const be=I.trim();if(!be&&!$)return;const Ze=E.filter(Pe=>Pe.file).map(Pe=>Pe.file);let lt=E.filter(Pe=>!Pe.file).map(Pe=>({type:"file",url:Pe.src,mediaType:Pe.mediaType}));if(Ze.length>0){P(!0);try{const st=await async function(Ne){return i?await i({files:Ne}):new Promise((Dt,pe)=>{try{const Me={dataTransfer:{files:Ne}};s.Assets.FileUploader().uploadFile(Me,({data:Le})=>{Dt(Le)})}catch(Me){pe(Me)}})}(Ze),tt=E.filter(Ne=>Ne.file).map(Ne=>Ne.src);lt=[...lt,...st.map(Ne=>({type:"file",url:Ne.src,mediaType:Ne.mimeType}))],m1(tt)}catch(Pe){const st=s.t(`${_}.uploadError`);G(Pe instanceof Error?Pe:new Error(st)),P(!1);return}finally{P(!1)}}F({text:be,files:lt.length>0?lt:void 0,metadata:{createdAt:Date.now()}}),y(""),T([])},q=be=>{be.key==="Enter"&&!be.shiftKey&&(be.preventDefault(),ee(be))};f.useEffect(()=>{C||y(be=>b1(be,w)),S("")},[C]);const ne=`${Yt}__root`,ce=`${Yt}__actions`,ge=`${Yt}__actions-left`,Re=`${Yt}__actions-right`,ve=`${Yt}__submit-btn`,qe=A(`${Yt}__textarea gs-utl-w-full`,B.bgTr,Er.inputText,Se.noFocusOut,Se.noResize),Be=s.t(`${_}.placeholder`),ht=a==null?void 0:a({state:z}),et=c==null?void 0:c({state:z});return l.jsxs("form",{onSubmit:ee,className:A(Yt,we.s,X.bt,B.br,e),style:t,children:[ht&&Qt(s,ht),l.jsxs(k,{className:A(ne,X.b,X.rndLg,B.br,B.bg,we.s,"gs-utl-relative"),col:!0,gap:"s",children:[O&&l.jsx(ho,{abs:!0,full:!0,className:B.bgH25}),l.jsx(_9,{editor:s,disabled:D,contextComponents:N.contextComponents,...d}),l.jsx(L9,{value:I,name:"prompt",onChange:be=>y(be.target.value),onKeyDown:q,placeholder:Be,readOnly:C,disabled:D,className:qe,style:{minHeight:40,maxHeight:100},autoResize:!0,...p}),l.jsx(px,{editor:s,assets:E,onRemove:J,...h}),l.jsxs(k,{className:ce,justify:"between",items:"center",gap:"s",full:!0,children:[l.jsx(k,{className:ge,gap:"s",items:"center",children:l.jsx(O9,{editor:s,disabled:D,maxAssets:r,currentAssetsCount:E.length,acceptAssetType:o,onFilesSelected:Y,onAssetSelected:Z,...g})}),l.jsxs(k,{className:Re,gap:"s",items:"center",children:[l.jsx(M9,{editor:s,disabled:D,onTranscript:S,onListeningChange:j,...m}),l.jsx(Ge,{className:A(ve,X.pill),size:"s",type:D?"button":"submit",onClick:D?L:void 0,icon:D?U.stop:U.arrowUp,variant:D?"out-clear":"pr",disabled:!R,disabledClassName:Se.disabledM,...b})]})]})]}),et&&Qt(s,et)]})},$9="gs-cmp-ai-chat-loading-state",k9=({className:e,chatContext:t,editor:n,...s})=>l.jsx(k,{className:A($9,e),items:"center",justify:"center",full:!0,col:!0,...s,children:l.jsx(ho,{})}),R9="file-refs",fx="gs-cmp-ai-chat-markdown",dt=`${fx}__el`,I9={ul:({children:e})=>l.jsx("ul",{className:`${dt}-ul ${Ot.ul}`,children:e}),ol:({children:e})=>l.jsx("ol",{className:`${dt}-ol ${Ot.ol}`,children:e}),li:({children:e})=>l.jsx("li",{className:`${dt}-li`,children:e}),p:({children:e})=>l.jsx("p",{className:`${dt}-p`,children:e}),h1:({children:e})=>l.jsx("h1",{className:`${dt}-h1 ${Ot.h1}`,children:e}),h2:({children:e})=>l.jsx("h2",{className:`${dt}-h2 ${Ot.h2}`,children:e}),h3:({children:e})=>l.jsx("h3",{className:`${dt}-h3 ${Ot.h3}`,children:e}),h4:({children:e})=>l.jsx("h4",{className:`${dt}-h4 ${Ot.h4}`,children:e}),h5:({children:e})=>l.jsx("h5",{className:`${dt}-h5 ${Ot.h5}`,children:e}),h6:({children:e})=>l.jsx("h6",{className:`${dt}-h6 ${Ot.h6}`,children:e}),a:({href:e,children:t})=>l.jsx("a",{href:e,className:`${dt}-a ${Er.link} gs-utl-underline`,target:"_blank",rel:"noopener noreferrer",children:t}),code:({children:e,className:t})=>!t?l.jsx("code",{className:`${dt}-code-inline ${Ot.codeInline}`,children:e}):l.jsx("code",{className:`${dt}-code-block ${t||""}`,children:e}),pre:({children:e})=>l.jsx("pre",{className:`${dt}-pre ${Ot.pre}`,children:e}),blockquote:({children:e})=>l.jsx("blockquote",{className:`${dt}-blockquote ${Ot.blockquote} ${B.br} [&>p]:gs-utl-my-0`,children:e}),hr:()=>l.jsx("hr",{className:`${dt}-hr ${Ot.hr} ${B.br}`}),strong:({children:e})=>l.jsx("strong",{className:`${dt}-strong ${Ot.strong}`,children:e}),em:({children:e})=>l.jsx("em",{className:`${dt}-em ${Ot.em}`,children:e}),del:({children:e})=>l.jsx("del",{className:`${dt}-del gs-utl-line-through`,children:e}),table:({children:e})=>l.jsx("table",{className:`${dt}-table ${Ot.table}`,children:e}),thead:({children:e})=>l.jsx("thead",{className:`${dt}-thead ${Ot.thead}`,children:e}),tbody:({children:e})=>l.jsx("tbody",{className:`${dt}-tbody`,children:e}),tr:({children:e})=>l.jsx("tr",{className:`${dt}-tr ${Ot.tr}`,children:e}),th:({children:e})=>l.jsx("th",{className:`${dt}-th ${Ot.th}`,children:e}),td:({children:e})=>l.jsx("td",{className:`${dt}-td ${Ot.td}`,children:e}),input:({checked:e,disabled:t})=>l.jsx("input",{type:"checkbox",checked:e,disabled:t,className:`${dt}-checkbox gs-utl-mr-2`,readOnly:!0}),[R9]:({children:e})=>l.jsx("img-refs",{style:{display:"none"},children:e})};function V9(e){return xx.marked.lexer(e,{gfm:!0}).map(n=>n.raw)}const H9=f.memo(function({content:t}){return l.jsx(wx,{components:I9,remarkPlugins:[Sx],children:t})},(e,t)=>e.content===t.content),v1=f.memo(function({content:t,id:n,className:s}){const r=f.useMemo(()=>V9(t),[t]);return l.jsx("div",{className:`${fx} ${s||""}`,children:r.map((o,i)=>l.jsx(H9,{content:o},`${n}-block_${i}`))})});function y1(e){return!!e&&typeof e=="object"&&e.type==="source-url"}function D9(e){return!!e&&typeof e=="object"&&e.type==="source-document"}const vd="gs-cmp-ai-chat-message",Mi="aiChat.message",F9=f.memo(function({className:t,style:n,message:s,isStreaming:r,editor:o,chatContext:i,layoutBeforeMessage:a,layoutAfterMessage:c,layoutPart:u,layoutPartToolLabel:d,layoutPartToolDetail:p,layoutPartToolResult:h}){const g=s.parts||[],m=g.filter(xr.isFileUIPart),b=g.filter(T=>!xr.isFileUIPart(T)),v=m.map(T=>({src:T.url,mediaType:T.mediaType??"image/*"})),x=b.length-1,y=s.role==="user",w=A(vd,`${vd}--${s.role}`,t),S=A(`${vd}__content gs-utl-break-words`,y?A(B.bgA,"gs-utl-inline-block gs-utl-text-left gs-utl-max-w-[90%]",we.xyS,X.rnd):"gs-utl-w-full"),C={editor:o,chatContext:i,message:s},j=a==null?void 0:a(C),E=c==null?void 0:c(C);return l.jsxs(k,{col:!0,gap:"s",className:w,style:n,children:[j&&Qt(o,j),l.jsxs(k,{gap:"s",className:A(S,"gs-utl-self-end"),col:!0,nowrap:!0,children:[b.map((T,O)=>l.jsx(B9,{part:T,messageId:s.id,partIndex:O,isStreamingPart:O===x&&r,layoutPart:u,layoutPartToolLabel:d,layoutPartToolDetail:p,layoutPartToolResult:h,layoutProps:C},`${s.id}-part-${O}`)),l.jsx(px,{editor:o,assets:v,className:"gs-utl-justify-end"})]}),E&&Qt(o,E)]})}),Is="gs-cmp-ai-chat-message-part",B9=f.memo(function({part:t,messageId:n,partIndex:s,isStreamingPart:r,layoutPart:o,layoutPartToolLabel:i,layoutPartToolDetail:a,layoutPartToolResult:c,layoutProps:u}){var d;if(o){const p=o({...u,part:t,partIndex:s});if(p)return Qt(u.editor,p)}if(xr.isReasoningUIPart(t)){const{text:p,state:h}=t,g=p==null?void 0:p.trim(),m=r&&h==="streaming",b=`${Is} ${Is}__reasoning`,v=u.editor.t(`${Mi}.reasoning`);return!!g&&l.jsx(Js,{className:A(b,B.txtLowEmphasis),classNameHandlerContent:"gs-utl-flex-none",handler:l.jsxs(k,{className:A(`${b}-label`,rn.semibold),items:"center",gap:"s",children:[m?l.jsx(ho,{size:"xs",currentColor:!0}):l.jsx(Li,{path:OS,size:oe.s2x}),l.jsx("div",{children:v})]}),children:l.jsx("div",{className:A(`${b}-text`,B.txtLowEmphasis,On.xs,rn.italic),children:l.jsx(v1,{id:`${n}-${s}`,content:g})})})}if(xr.isTextUIPart(t)){const p=t.text;if(!p)return null;const h=`${Is} ${Is}__text`;return l.jsx(v1,{content:p,id:`${n}-${s}`,className:h})}if(xr.isToolUIPart(t)){const{type:p,toolCallId:h,input:g="",output:m="",errorText:b}=t,v=p.replace("tool-","").replace("dynamic-",""),x=typeof g=="string"?g:JSON.stringify(g),y=typeof m=="string"?m:JSON.stringify(m),w=typeof t.state=="string"?t.state:void 0,S=w==="output-available",C=r&&(w==="input-streaming"||w==="input-available"),j=`${Is}__tool`,E=`${Is}__tool-result`,T=`${j}-detail`,O=A(T,"gs-utl-max-w-full"),P="gs-utl-max-w-full gs-utl-whitespace-normal",_=A(`${T}-info gs-utl-max-h-24 gs-utl-overflow-auto`,P,B.txtLowEmphasis,On.xs),M=A(`${Is}__tool-streaming gs-utl-max-h-10 gs-utl-overflow-hidden`,P,B.txtLowEmphasis,On.xs),N=`${j}-section-label`,H=x&&x!=="{}",L=y&&y!=="{}",F=!!b,G=H||L||F,D=u.editor.t(`${Mi}.tool.input`),$=u.editor.t(`${Mi}.tool.output`),I=u.editor.t(`${Mi}.tool.error`),z=u.editor.runCommand(ps.getChatManager).tools[v],Y={...u,part:t,partIndex:s,toolName:v},Z=i==null?void 0:i(Y),J=a==null?void 0:a(Y),ee=(c==null?void 0:c(Y))||((d=z==null?void 0:z.layoutToolResult)==null?void 0:d.call(z,Y)),te=Z?Qt(u.editor,Z):v,q=ee?Qt(u.editor,ee):null,ne=J?Qt(u.editor,J):l.jsxs(k,{col:!0,gap:"s",className:"gs-utl-mt-1",children:[H&&l.jsxs(k,{className:A(O,`${T}--input`),gap:"xs",col:!0,nowrap:!0,children:[l.jsx("div",{className:N,children:D}),l.jsx("pre",{className:_,children:x})]}),L&&l.jsxs(k,{className:A(O,`${T}--output`),gap:"xs",col:!0,nowrap:!0,children:[l.jsx("div",{className:N,children:$}),l.jsx("pre",{className:_,children:y})]}),F&&l.jsxs(k,{className:A(O,`${T}--error`),gap:"xs",col:!0,nowrap:!0,children:[l.jsx("div",{className:N,children:I}),l.jsx("pre",{className:_,children:b})]})]});return l.jsxs(k,{className:A(`${Is} ${j}`,B.bgH2,X.rnd,we.xyS),gap:"xs",col:!0,nowrap:!0,children:[l.jsx(Js,{disabled:!G&&!J,handler:l.jsxs(k,{className:A(`${j}-label`),items:"center",gap:"s",children:[l.jsx("div",{className:`${j}-status`,children:S?l.jsx(Li,{className:`${j}-status-success`,path:R1,size:oe.s2x}):C?l.jsx(ho,{className:`${j}-status-processing`,size:"xs",currentColor:!0}):l.jsx(Li,{className:`${j}-status-error`,path:I1,size:oe.s2x})}),l.jsx("div",{className:A(`${j}-name`),children:te})]}),children:ne}),l.jsx(z9,{toolCallId:h,toolStatusProgress:u.chatContext.toolStatusProgress,isStreaming:r,className:M}),!!q&&l.jsx("div",{className:E,children:q})]})}if(y1(t)||D9(t)){const p=`${Is}__source`,g=y1(t)?t.url:void 0,m=t.title,b=u.editor.t(`${Mi}.source.document`),v=m||g||b,x=g?new URL(g).hostname:"",y=l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:A(`${p}-content`,"gs-utl-flex-1 gs-utl-min-w-0"),children:[l.jsx("div",{className:A(`${p}-title`,rn.semibold,On.sm,"gs-utl-truncate"),children:v}),x&&l.jsx("div",{className:A(`${p}-url`,B.txtLowEmphasis,On.xs,"gs-utl-truncate"),children:x})]}),g&&l.jsx(Li,{className:A(`${p}-icon`,B.txtLowEmphasis),path:V1,size:oe.s2x})]}),w=A(p,B.bgH2,X.rnd,we.xyS,"gs-utl-flex gs-utl-items-center gs-utl-gap-2 gs-utl-no-underline",g&&Se.hoverM);return g?l.jsx("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:w,children:y}):l.jsx("div",{className:w,children:y})}return null}),z9=f.memo(function({toolCallId:t,toolStatusProgress:n,isStreaming:s,className:r}){const[o,i]=f.useState(""),a=f.useRef(null);return f.useEffect(()=>{if(!s||!t){i("");return}const c=n.get(t);c!=null&&c.content&&i(c.content);const u=setInterval(()=>{const d=n.get(t);d!=null&&d.content&&i(d.content),d!=null&&d.completed&&(clearInterval(u),i(""))},100);return()=>clearInterval(u)},[t,n,s]),f.useEffect(()=>{a.current&&o&&(a.current.scrollTop=a.current.scrollHeight)},[o]),!o||!s?null:l.jsx("pre",{ref:a,className:r,children:o})}),U9="gs-cmp-ai-chat-messages-status",W9=({className:e,chatContext:t,style:n})=>{const{status:s}=t,r=s==="streaming"||s==="submitted",o=A(B.bgA,Se.dot,Se.bounce);return r?l.jsxs(k,{items:"center",gap:"xs",className:A(U9,e),style:n,children:[l.jsx("div",{className:o}),l.jsx("div",{className:o,style:{animationDelay:"0.15s"}}),l.jsx("div",{className:o,style:{animationDelay:"0.3s"}})]}):null},G9="gs-cmp-ai-chat-messages";function q9({editor:e,chatContext:t,messages:n,pluginOptions:s}){const r=f.useRef(null),{status:o}=t,i=o==="streaming"||o==="submitted",a=A(G9,we.s,"gs-utl-flex-1 gs-utl-min-h-0 gs-utl-overflow-y-auto gs-utl-overflow-x-hidden");return f.useEffect(()=>{var c;(c=r.current)==null||c.scrollIntoView({behavior:"smooth"})},[n]),l.jsxs(k,{className:a,gap:"s",col:!0,nowrap:!0,children:[n.length===0?Qt(e,{type:"aiChatEmptyState",chatContext:t},s):n.map((c,u)=>l.jsx(f.Fragment,{children:Qt(e,{type:"aiChatMessage",chatContext:t,message:c,isStreaming:i&&u===n.length-1},s)},c.id)),Qt(e,{type:"aiChatMessagesStatus",chatContext:t},s),l.jsx("div",{ref:r})]})}const hx=f.createContext(void 0),K9=({chatManager:e,children:t})=>{const n=e.currentChatState,s=f.useMemo(()=>({chatManager:e,chatState:n}),[e,n]);return l.jsx(hx.Provider,{value:s,children:t})},Z9=()=>f.useContext(hx),Y9="gs-cmp-ai-chat-panel";function X9({editor:e,pluginOptions:t,style:n,className:s}){const{chatState:r}=Z9(),[,o]=f.useState(0),[i,a]=f.useState(),{toolAbortControllers:c,toolStatusProgress:u,contextComponents:d,isMessagesLoaded:p}=r;f.useEffect(()=>r.onUpdate(()=>o(j=>++j)),[]);const h=x1.useChat({chat:r.chat}),{messages:g,sendMessage:m,status:b,setMessages:v,error:x}=h,y=x||i,w=f.useMemo(()=>({id:h.id,messages:g,setMessages:v,sendMessage:m,status:b,stop:()=>(c.forEach(C=>C.abort()),c.clear(),h.stop()),addToolApprovalResponse:h.addToolApprovalResponse,addToolOutput:h.addToolOutput,error:y,setError:C=>a(typeof C=="string"?new Error(C):C),clearError:()=>{h.clearError(),a(void 0)},toolStatusProgress:u,contextComponents:d}),[e,b,g,y]),S=A(Y9,s,"gs-utl-relative gs-utl-w-full gs-utl-h-full gs-utl-min-h-0 gs-utl-max-h-full gs-utl-overflow-hidden");return l.jsx(k,{className:S,style:n,col:!0,nowrap:!0,children:p?l.jsxs(l.Fragment,{children:[Qt(e,{type:"aiChatHeader",chatContext:w},t),l.jsx(q9,{editor:e,chatContext:w,messages:g,pluginOptions:t}),w.error&&Qt(e,{type:"aiChatError",chatContext:w},t),Qt(e,{type:"aiChatInput",chatContext:w},t)]}):Qt(e,{type:"aiChatLoadingState",chatContext:w},t)})}const J9=(e,t,n)=>(e.runCommand(se.layoutComponentAdd,{type:"aiChatPanel",component:s=>({type:"custom",noWrapper:!0,component:()=>l.jsx(K9,{chatManager:n,children:l.jsx(X9,{...s,editor:e,pluginOptions:t})})})}),e.runCommand(se.layoutComponentAdd,{type:"aiChatHeader",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:Fj})}),e.runCommand(se.layoutComponentAdd,{type:"aiChatError",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:Dj})}),e.runCommand(se.layoutComponentAdd,{type:"aiChatLoadingState",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:k9})}),e.runCommand(se.layoutComponentAdd,{type:"aiChatInput",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:N9})}),e.runCommand(se.layoutComponentAdd,{type:"aiChatEmptyState",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:Hj})}),e.runCommand(se.layoutComponentAdd,{type:"aiChatMessage",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:F9})}),e.runCommand(se.layoutComponentAdd,{type:"aiChatMessagesStatus",component:s=>({type:"custom",noWrapper:!0,componentProps:s,component:W9})}),()=>{["aiChatPanel","aiChatHeader","aiChatError","aiChatLoadingState","aiChatInput","aiChatEmptyState","aiChatMessage","aiChatMessagesStatus"].forEach(s=>{e.runCommand(se.layoutComponentRemove,{type:s})})}),Q9={aiChat:{header:{title:"AI Chat",clear:"Clear"},emptyState:{title:"AI Assistant",subtitle:"How can I help you build your project?",suggestions:{webHero:"Create a hero section with a headline and call-to-action",webFeatures:"Add a features grid with icons",webContact:"Create a contact form",webTestimonials:"Add testimonials section",emailHeader:"Add an email header",emailCta:"Add a call-to-action button",emailFooter:"Add an email footer with links",emailProduct:"Add a product showcase section"}},error:{title:"Error"},panel:{loadError:"Failed to load messages",messagesUpdate:"Error during messages update"},input:{placeholder:"Ask anything...",uploadError:"Failed to upload images",attach:{title:"Attach images",upload:"Upload new image",selectFromAssets:"Select image from Assets",maxAssets:"Maximum {count} assets allowed"},assets:{imageAlt:"Image {num}",pdfTitle:"PDF {num}",remove:"Remove"},context:{multiple:"{count} Components",clear:"Clear"},dictate:{start:"Dictate",stop:"Stop"}},message:{reasoning:"Reasoning",tool:{input:"Input",output:"Output",error:"Error"},source:{document:"Document"}}}},e7="aiChat",t7=Vo.startup,n7=function(e,t={}){t.getAccessToken&&(Ut.getAccessToken=t.getAccessToken),T1();const n=new Sw(e,t),{Commands:s}=e;s.add(ps.getChatManager,()=>n),s.add(ps.getChatState,()=>n.currentChatState),s.add(ps.getChatApi,()=>n.currentChatState.chatApi),e.I18n.addMessages({en:Q9});const r=J9(e,t,n),o=()=>{delete s.commands[ps.getChatManager],delete s.commands[ps.getChatState],delete s.commands[ps.getChatApi],r(),Jx()};Yx({editor:e,licenseKey:t.licenseKey,plan:t7,pluginName:e7,onLicenseCheckResponse:i=>{i?Ut.license=i:Ut.license=void 0},cleanup:o})},s7=Zx(n7);module.exports=s7;