@chaibuilder/sdk 1.2.52 → 1.2.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/{AddBlocks-fozauzIV.cjs → AddBlocks-7OJEZC2D.cjs} +1 -1
  2. package/dist/{AddBlocks-GxEmM16E.js → AddBlocks-kJNH96eQ.js} +1 -1
  3. package/dist/{CanvasArea-rdY6SFYn.js → CanvasArea-ZxrQurg_.js} +3 -3
  4. package/dist/{CanvasArea-NRtblq5d.cjs → CanvasArea-nWHWl6zD.cjs} +2 -2
  5. package/dist/{ChaiBuilderEditor-bNZZWYMh.js → ChaiBuilderEditor-4xhn_QlL.js} +2 -2
  6. package/dist/{ChaiBuilderEditor-Pga_zJgw.cjs → ChaiBuilderEditor-Rqlg194T.cjs} +1 -1
  7. package/dist/{CodeEditor-ye3IXW3i.cjs → CodeEditor-C6p5CZfl.cjs} +1 -1
  8. package/dist/{CodeEditor-tqtgia3I.js → CodeEditor-vTWgHJei.js} +1 -1
  9. package/dist/{CurrentPage-7NM90y76.js → CurrentPage-KPr8MnO0.js} +2 -2
  10. package/dist/{CurrentPage-sx7KVTmt.cjs → CurrentPage-bfY5xyr7.cjs} +1 -1
  11. package/dist/{ListTree-7Pz6H6eE.cjs → ListTree-4J0SUudU.cjs} +1 -1
  12. package/dist/{ListTree-oRbeDNod.js → ListTree-5s7iNbKT.js} +1 -1
  13. package/dist/{PagesPanel-XiTUaiq_.js → PagesPanel-aZBPSLS7.js} +3 -3
  14. package/dist/{PagesPanel-Nr-908vy.cjs → PagesPanel-re4w2009.cjs} +1 -1
  15. package/dist/{ProjectPanel-XfknsGkz.js → ProjectPanel-bWZtA_mw.js} +3 -3
  16. package/dist/{ProjectPanel-SuFYN60H.cjs → ProjectPanel-uo19SCtW.cjs} +1 -1
  17. package/dist/Settings-AcK9rEs3.cjs +1 -0
  18. package/dist/{Settings-dJ72rwnH.js → Settings-SK2ONoi0.js} +795 -805
  19. package/dist/{SidePanels-5dnRAsJh.cjs → SidePanels-YAKKqxIi.cjs} +1 -1
  20. package/dist/{SidePanels-t9oUA51J.js → SidePanels-ezU-hGki.js} +2 -2
  21. package/dist/{ThemeConfiguration-pcHbYiIP.js → ThemeConfiguration-q5rLYmXB.js} +1 -1
  22. package/dist/{ThemeConfiguration-2Sbh29qi.cjs → ThemeConfiguration-qUXsJBBZ.cjs} +1 -1
  23. package/dist/{Topbar-ID6Ipphd.cjs → Topbar-9mJ6dJn-.cjs} +1 -1
  24. package/dist/{Topbar-0DmS6VpB.js → Topbar-YhJ6xVs-.js} +1 -1
  25. package/dist/{UILibrariesPanel-G9J4KUsZ.js → UILibrariesPanel-N7acP7aA.js} +1 -1
  26. package/dist/{UILibrariesPanel-sXY6hozJ.cjs → UILibrariesPanel-uNt8spPr.cjs} +1 -1
  27. package/dist/{UnsplashImages-HK4_1VVL.cjs → UnsplashImages-5IlwWgRv.cjs} +1 -1
  28. package/dist/{UnsplashImages-MeS5Cu7a.js → UnsplashImages-iY__3dsJ.js} +1 -1
  29. package/dist/{UploadImages-AIKATqfP.js → UploadImages-KHk-jx9-.js} +1 -1
  30. package/dist/{UploadImages-LSnxByGV.cjs → UploadImages-UjtFHUqM.cjs} +1 -1
  31. package/dist/{add-page-modal-krxKdX7-.cjs → add-page-modal-8GuYgZa-.cjs} +1 -1
  32. package/dist/{add-page-modal-JkD45moJ.js → add-page-modal-HmfsbbCH.js} +3 -3
  33. package/dist/{confirm-alert-NHxthdRK.js → confirm-alert-AoUx_ZEf.js} +1 -1
  34. package/dist/{confirm-alert--QTC21Z2.cjs → confirm-alert-qdryZAvd.cjs} +1 -1
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.js +1 -1
  37. package/dist/{delete-page-modal-BIe0kYNH.cjs → delete-page-modal-8qEY88SK.cjs} +1 -1
  38. package/dist/{delete-page-modal-8rjPEchH.js → delete-page-modal-KCPx8Ako.js} +2 -2
  39. package/dist/email.cjs +1 -1
  40. package/dist/email.js +1 -1
  41. package/dist/{form-PQYPrD_Q.js → form-LHHE25z8.js} +1 -1
  42. package/dist/{form-6OLp5uEG.cjs → form-zHGQEmOp.cjs} +1 -1
  43. package/dist/{index-seU0_UZX.cjs → index-swYRuZtl.cjs} +1 -1
  44. package/dist/{index-9_b2eou7.js → index-tGVTszX2.js} +2 -2
  45. package/dist/{page-viewer-sKluQ_e1.js → page-viewer-P5yNaWy1.js} +3 -3
  46. package/dist/{page-viewer-WwwMC1Kq.cjs → page-viewer-t9AFrRlP.cjs} +1 -1
  47. package/dist/{project-general-setting-pRO1ikDV.cjs → project-general-setting-Ojhf6Nl6.cjs} +1 -1
  48. package/dist/{project-general-setting-Lc2ByvTt.js → project-general-setting-Qm8odisi.js} +3 -3
  49. package/dist/{project-seo-setting-BzSrXFVv.cjs → project-seo-setting-4E1mqV3j.cjs} +1 -1
  50. package/dist/{project-seo-setting-530_6o9S.js → project-seo-setting-j8EdSO40.js} +2 -2
  51. package/dist/{single-page-detail-_VP4zaCI.cjs → single-page-detail-bv-XFGOD.cjs} +1 -1
  52. package/dist/{single-page-detail-qDxxtedN.js → single-page-detail-mQfFVaou.js} +4 -4
  53. package/dist/studio.cjs +1 -1
  54. package/dist/studio.js +2 -2
  55. package/dist/ui.cjs +1 -1
  56. package/dist/ui.js +1 -1
  57. package/dist/{useCanvasSettings-pURFQG4q.cjs → useCanvasSettings-4WtrDzCu.cjs} +1 -1
  58. package/dist/{useCanvasSettings-5y2fSCpN.js → useCanvasSettings-Rvn5rRB8.js} +1 -1
  59. package/dist/web-blocks.cjs +1 -1
  60. package/dist/web-blocks.js +241 -195
  61. package/package.json +1 -1
  62. package/dist/Settings-22Hy7jUT.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-es"),r=require("./jsx-runtime-Z_BpKhVy.cjs"),b=require("react"),l=require("./controls-rRZhz0vu.cjs"),d=require("@chaibuilder/runtime"),x=require("./empty-slot-Sy930lX6.cjs"),z=require("@radix-ui/react-icons"),p=require("./Functions-N3yhPYKY.cjs"),D=require("./index--mLLy7QQ.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function G(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>c[t]})}}return e.default=c,Object.freeze(e)}const h=G(b),k=h.memo(c=>{const{blockProps:e,inBuilder:t,backgroundImage:s,children:a,tag:i="div",styles:n}=c;let o=a;a||(o=r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:t}));let v={};return s&&(v={backgroundImage:`url(${s})`}),h.createElement(i,{...e,...n,style:v},o)});d.registerChaiBlock(k,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:l.o({default:""}),tag:l.f({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:l.v({title:"Background Image"})},canAcceptBlock:()=>!0});const j=h.memo(c=>{const{blockProps:e,styles:t}=c;return h.createElement("div",{...e,...t})});d.registerChaiBlock(j,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:l.o({default:""})},canAcceptBlock:()=>!1});const E=c=>{const{blockProps:e,styles:t,content:s,level:a="h1",children:i=null}=c;return i?h.createElement(a,{...t,...e},i):h.createElement(a,{...t,...e,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(E,{type:"Heading",label:"Heading",category:"core",icon:z.HeadingIcon,group:"typography",props:{level:l.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:l.o({default:"text-3xl"}),content:l.r({title:"Content",default:"Heading goes here"})},canAcceptBlock:c=>c==="Span"||c==="Text"});const S=c=>{const{blockProps:e,styles:t,content:s}=c;return u.isNull(c.children)?h.createElement("p",{...t,...e,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):h.createElement("p",{...t,...e},c.children)};d.registerChaiBlock(S,{type:"Paragraph",label:"Paragraph",category:"core",icon:z.TextIcon,group:"typography",props:{styles:l.o({default:""}),content:l.r({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:c=>c==="Span"||c==="Link"});const R=c=>{const{blockProps:e,styles:t,content:s,children:a=null,tag:i}=c;return a?h.createElement("span",{...t,...e},a):h.createElement(i||"span",{...t,...e,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(R,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:l.o({default:""}),content:l.r({title:"Content",default:""})},canAcceptBlock:()=>!0});const C=c=>{const{blockProps:e,content:t,styles:s}=c;return r.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:r.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...e,...s,dangerouslySetInnerHTML:{__html:t}})})};d.registerChaiBlock(C,{type:"RichText",label:"Rich Text",category:"core",icon:z.CursorTextIcon,group:"typography",props:{styles:l.o({default:""}),content:l.b({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const T=c=>{const{blockProps:e,iconSize:t,icon:s,content:a,iconPos:i,styles:n,children:o}=c,v=s,M=o||r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:a}),v&&r.jsxRuntimeExports.jsx("div",{style:{width:t+"px"},className:i+" "+(i==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:v}})]});return h.createElement("button",{...e,...n,type:"button"},M)};d.registerChaiBlock(T,{type:"Button",label:"Button",category:"core",icon:z.ButtonIcon,group:"basic",props:{content:l.g({title:"Label",default:"Button"}),styles:l.o({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:l.T({title:"Icon",default:""}),iconSize:l.y({title:"Icon Size",default:24}),iconPos:l.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const L=c=>{const{blockProps:e,link:t,children:s,styles:a,inBuilder:i,content:n}=c;return!s&&u.isEmpty(a==null?void 0:a.className)&&u.isEmpty(n)?r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:i}):i?s?r.jsxRuntimeExports.jsx("span",{...e,...a,children:s}):h.createElement("span",{...e,...a,dangerouslySetInnerHTML:{__html:n}}):s?r.jsxRuntimeExports.jsx("a",{href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...e,...a,children:s}):h.createElement("a",{...e,...a,"data-ai-key":"content",href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self",dangerouslySetInnerHTML:{__html:n}})};d.registerChaiBlock(L,{type:"Link",label:"Link",category:"core",icon:z.Link1Icon,group:"basic",props:{styles:l.o({default:""}),content:l.g({title:"Content",default:""}),link:l.q({title:"Link",default:{type:"page",target:"_self",href:"#"}})},canAcceptBlock:c=>c!=="Link"});const _=c=>{const{blockProps:e,children:t,listType:s,styles:a,tag:i,inBuilder:n}=c,o=p.cn(u.get(a,"className",""),s);return!t&&u.isEmpty(a==null?void 0:a.className)?r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:n}):h.createElement(i||(s==="list-decimal"?"ol":"ul"),{...e,...a,className:o},t)};d.registerChaiBlock(_,{type:"List",label:"List",icon:z.RowsIcon,category:"core",group:"basic",props:{styles:l.o({default:""}),listType:l.f({title:"List type",default:"list-none",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:c=>c==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const P=c=>{const{blockProps:e,content:t,styles:s,children:a,tag:i}=c;return a?h.createElement(i||"li",{...s,...e},a):h.createElement(i||"li",{...s,...e,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:t}})};d.registerChaiBlock(P,{type:"ListItem",label:"List Item",icon:z.ColumnsIcon,category:"core",group:"basic",props:{styles:l.o({default:""}),content:l.r({title:"Content",default:"List item"})},canAcceptBlock:c=>c!=="ListItem",canBeNested:c=>c==="List"});const N=(c,...e)=>({...c,className:p.cn(c.className,...e)}),H=c=>{const{blockProps:e,icon:t,styles:s,width:a,inBuilder:i,height:n}=c,o=N(s,p.cn(a?`w-[${a}px]`:"",n?`h-[${n}px]`:""));if(u.isEmpty(t))return r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:i,className:"h-8 w-14"});const v=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return h.createElement("span",{...e,...o,dangerouslySetInnerHTML:{__html:v}})};d.registerChaiBlock(H,{type:"Icon",label:"Icon",category:"core",icon:z.SketchLogoIcon,group:"media",props:{styles:l.o({default:"text-black"}),icon:l.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:l.y({title:"Width",default:""}),height:l.y({title:"Height",default:""})}});const A=c=>{const{blockProps:e,image:t,styles:s,alt:a,height:i,width:n}=c;return u.isEmpty(t)?r.jsxRuntimeExports.jsx(x.EmptySlot,{className:"h-36"}):h.createElement("img",{...e,...s,src:t,alt:a,loading:"lazy",height:i,width:n})};d.registerChaiBlock(A,{type:"Image",label:"Image",category:"core",icon:z.ImageIcon,group:"media",props:{styles:l.o({default:""}),image:l.v({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.g({title:"Alt",default:""}),width:l.g({title:"Width",default:""}),height:l.g({title:"Height",default:""})}});const q=c=>{var n;const{blockProps:e,inBuilder:t,styles:s,children:a}=c;let i=null;return!a&&t&&(i=r.jsxRuntimeExports.jsx("div",{className:p.cn("flex flex-col items-center justify-center",(n=c.emptyStyles)==null?void 0:n.className),children:r.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:r.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",c.name]})})})),h.createElement("div",{...s,...e,droppable:"yes"},a||i)};d.registerChaiBlock(q,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:l.o({default:""}),emptyStyles:l.o({default:""})},canAcceptBlock:()=>!0});const y=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,I=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,w=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,U=c=>{if(y.test(c)){const e=c.match(y);return e?`https://www.youtube.com/embed/${e[4]}`:c}if(I.test(c)){const e=c.match(I);return e?`https://player.vimeo.com/video/${e[3]}`:c}if(w.test(c)){const e=c.match(w);return e?`https://www.dailymotion.com/embed/video/${e[4]}`:c}return null},F=h.memo(c=>{const{blockProps:e,inBuilder:t,styles:s,url:a,controls:i}=c,n=u.get(i,"autoPlay",!1),o=u.get(i,"controls",!1),v=n||u.get(i,"muted",!0),M=u.get(i,"loop",!1);if(u.isEmpty(a))return r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:t,className:"h-36"});let f=U(a),g=null;if(f){if(!u.isEmpty(f)){const m=[];m.push(`autoplay=${n?1:0}`),m.push(`controls=${i?1:0}`),m.push(`mute=${v?1:0}&muted=${v?1:0}`),m.push(`loop=${M?1:0}`),f=`${f}?${m.join("&")}`}g=h.createElement("iframe",{...e,className:"absolute inset-0 w-full h-full",src:f,allow:t?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=h.createElement("video",{...e,className:"absolute inset-0 w-full h-full",src:a,controls:o,muted:v,autoPlay:t?!1:n,loop:M});return r.jsxRuntimeExports.jsx("div",{...u.pick(s,["className"]),children:r.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[t?r.jsxRuntimeExports.jsx("div",{...e,...u.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(F,{type:"Video",label:"Video",category:"core",icon:z.VideoIcon,group:"media",props:{styles:l.o({default:""}),url:l.g({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:l.h({title:"Controls",properties:{autoPlay:l.c({title:"Autoplay",default:!0}),controls:l.c({title:"Show controls",default:!1}),loop:l.c({title:"Loop",default:!1}),muted:l.c({title:"Muted",default:!0})}})}});const O=c=>{const{blockProps:e,styles:t,htmlCode:s,inBuilder:a}=c;return a?r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[a?r.jsxRuntimeExports.jsx("div",{...e,...t,className:"absolute z-20 h-full w-full"}):null,h.createElement("div",{...t,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):h.createElement("div",{...e,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(O,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:z.CodeIcon,group:"advanced",props:{styles:l.o({default:""}),htmlCode:l.u({title:"HTML Code",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})},canAcceptBlock:()=>!1});function $(c){return D.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(c)}const V=c=>{const{scripts:e,inBuilder:t,blockProps:s}=c;return t?r.jsxRuntimeExports.jsx("div",{...s}):r.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e}})};d.registerChaiBlock(V,{type:"CustomScript",label:"Custom Script",category:"core",icon:$,group:"advanced",props:{scripts:l.u({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})},canAcceptBlock:()=>!1});const J=c=>{const{blockProps:e,styles:t}=c;return h.createElement("hr",{...t,...e})};d.registerChaiBlock(J,{type:"Divider",label:"Divider",category:"core",icon:z.DividerHorizontalIcon,group:"basic",props:{styles:l.o({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const W=c=>c.inBuilder||c.forceWrapper?r.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...c.blockProps,children:c.content}):`${c.content}`;d.registerChaiBlock(W,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:z.SpaceBetweenVerticallyIcon,props:{content:l.r({title:"Content",defaultValue:""})}});const Y=c=>{const{blockProps:e,backgroundImage:t,children:s,styles:a}=c;let i={};return t&&(i={backgroundImage:`url(${t})`}),h.createElement("div",{...e,...a,style:i},s)};d.registerChaiBlock(Y,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:l.o({default:"font-body antialiased"}),backgroundImage:l.v({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const K=c=>{const{blockProps:e,styles:t}=c;return h.createElement("br",{...e,...t})};d.registerChaiBlock(K,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:z.SpaceBetweenVerticallyIcon,props:{styles:l.o({default:""})}});const B=c=>{const e=(i,n)=>({_id:p.generateUUID(),_parent:i,_type:"TableCell",styles:"#styles:,",content:`${c==="TableHead"?"Table Head":"Table Cell "+n}`}),t=i=>{const n=p.generateUUID(),o={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return i&&(o._parent=i),[o,e(n,"1"),e(n,"2"),e(n,"3")]},s=i=>{const n=p.generateUUID(),o={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return i&&(o._parent=i),[o,...t(n)]},a=i=>{const n=p.generateUUID(),o={_id:n,_type:"TableBody",styles:"#styles:,"};return i&&(o._parent=i),[o,...t(n),...t(n)]};if(c==="Table"){const i=p.generateUUID();return[{_id:i,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(i),...a(i)]}return c==="TableRow"?t():c==="TableHead"?s():c==="TableBody"?a():[]},X=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("table",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(X,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:z.TableIcon,props:{styles:l.o({default:""})},blocks:B("Table")});const Z=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("thead",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(Z,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:z.BorderTopIcon,props:{styles:l.o({default:""})},blocks:B("TableHead")});const Q=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("tbody",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(Q,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:z.BorderAllIcon,props:{styles:l.o({default:""})},blocks:B("TableBody")});const c0=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("tr",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(c0,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:z.ViewHorizontalIcon,props:{styles:l.o({default:"w-full"})},blocks:B("TableRow")});const t0=c=>{const{blockProps:e,children:t,content:s,styles:a}=c;return!t&&u.isEmpty(s)?r.jsxRuntimeExports.jsx(x.EmptySlot,{}):t?h.createElement("td",{...e,...a},t):h.createElement("td",{...e,...a,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(t0,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:z.DragHandleHorizontalIcon,props:{styles:l.o({default:""}),content:l.b({title:"Content",default:"Table cell item",ai:{html:!0}})}});const l0=c=>{const{blockProps:e,errorMessage:t,name:s,_type:a,successMessage:i,action:n,styles:o,children:v}=c;let M=v;v||(M=r.jsxRuntimeExports.jsx(x.EmptySlot,{}));const f={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxRuntimeExports.jsxs("form",{...f,"data-error":t,"data-success":i,method:"post",action:n,...e,...o,children:[r.jsxRuntimeExports.jsx("div",{...g}),r.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||a}),M]})};d.registerChaiBlock(l0,{type:"Form",label:"Form",category:"core",icon:z.GroupIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),action:l.g({title:"Submit URL",default:"/api/form/submit"}),errorMessage:l.b({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:l.b({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const e0=c=>{const{blockProps:e,content:t,styles:s,children:a}=c,i={...s,...e};return a?h.createElement("label",i,a):h.createElement("label",{...i,dangerouslySetInnerHTML:{__html:t}})};d.registerChaiBlock(e0,{type:"Label",label:"Label",category:"core",icon:z.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),content:l.g({title:"Content",default:"Label",ai:{html:!1}})}});const s0=c=>{const{blockProps:e,inBuilder:t,label:s,styles:a,inputStyles:i,icon:n,iconPos:o}=c,v=p.generateUUID(),M={"x-bind:disabled":"formLoading"};return r.jsxRuntimeExports.jsxs("button",{id:v,...M,...i,...a,...e||{},type:t?"button":"submit",children:[s,n&&r.jsxRuntimeExports.jsx("span",{className:o,dangerouslySetInnerHTML:{__html:n}})]})};d.registerChaiBlock(s0,{type:"FormButton",label:"Submit Button",category:"core",icon:z.ButtonIcon,group:"form",hidden:!0,props:{label:l.g({title:"Label",default:"Submit"}),styles:l.o({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:l.T({title:"Icon",default:""}),iconPos:l.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const a0=c=>{const{blockProps:e,fieldName:t,label:s,styles:a,inputStyles:i,required:n,checked:o,showLabel:v=!0}=c,M=p.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...a,...e,children:[r.jsxRuntimeExports.jsx("input",{...i,name:t,id:M,type:"checkbox",required:n,defaultChecked:o}),s&&s!=="Label"&&r.jsxRuntimeExports.jsx("label",{htmlFor:M,children:s})]}):r.jsxRuntimeExports.jsx("input",{id:M,...e,...i,...a,type:"checkbox",required:n,name:t})};d.registerChaiBlock(a0,{type:"Checkbox",label:"Checkbox",category:"core",icon:z.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:l.g({title:"Field Name",default:"checkbox"}),styles:l.o({default:"flex items-center gap-x-2"}),label:l.g({title:"Label",default:"Label"}),checked:l.c({title:"Checked",default:!1}),required:l.c({title:"Required",default:!1})}});const i0=c=>{const{blockProps:e,label:t,placeholder:s,styles:a,inputStyles:i,showLabel:n,required:o,inputType:v="text",inBuilder:M,fieldName:f}=c,g=p.generateUUID();return!n||v==="submit"?(v==="submit"&&(e.value=t),r.jsxRuntimeExports.jsx("input",{id:g,name:f,readOnly:M,...e,...i,...a,type:v,placeholder:s,required:o})):r.jsxRuntimeExports.jsxs("div",{...a,...e,children:[n&&r.jsxRuntimeExports.jsx("label",{htmlFor:g,children:t}),r.jsxRuntimeExports.jsx("input",{name:f,readOnly:M,...i,id:g,type:v,placeholder:s,required:o})]})};d.registerChaiBlock(i0,{type:"Input",label:"Input",category:"core",icon:z.InputIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),fieldName:l.g({title:"Field Name",default:"input"}),inputType:l.f({title:"Type",options:u.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],c=>({value:c,title:c})),default:"text"}),value:l.g({title:"Value",default:""}),showLabel:l.c({title:"Show label",default:!0}),inputStyles:l.o({default:"w-full p-1"}),label:l.g({title:"Label",default:"Label"}),placeholder:l.g({title:"Placeholder",default:"Placeholder"}),required:l.c({title:"Required",default:!1})}});const r0=c=>{const{blockProps:e,fieldName:t,label:s,styles:a,inputStyles:i,checked:n,required:o,showLabel:v=!0}=c,M=p.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...a,...e,children:[r.jsxRuntimeExports.jsx("input",{...i,name:t,id:M,type:"radio",required:o,defaultChecked:n}),s&&r.jsxRuntimeExports.jsx("label",{htmlFor:M,children:s})]}):r.jsxRuntimeExports.jsx("input",{id:M,...e,...i,...a,type:"radio",required:o,checked:n,name:t})};d.registerChaiBlock(r0,{type:"Radio",label:"Radio",category:"core",icon:z.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:l.o({default:"flex items-center w-max gap-x-2"}),fieldName:l.g({title:"Field Name",default:"radio"}),label:l.g({title:"Label",default:"Label"}),checked:l.c({title:"Checked",default:!1}),required:l.c({title:"Required",default:!1})}});const n0=c=>{const{blockProps:e,fieldName:t,label:s,placeholder:a,styles:i,inputStyles:n,required:o,showLabel:v,_multiple:M=!1}=c,f=p.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...i,children:[v&&r.jsxRuntimeExports.jsx("label",{htmlFor:f,children:s}),r.jsxRuntimeExports.jsxs("select",{...n,id:f,required:o,multiple:M,name:t,children:[r.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:a}),u.map(c.options,g=>r.jsxRuntimeExports.jsx("option",{selected:u.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):r.jsxRuntimeExports.jsxs("select",{id:f,...i,...e,required:o,multiple:M,name:t,children:[r.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:a}),u.map(c.options,g=>r.jsxRuntimeExports.jsx("option",{selected:u.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(n0,{type:"Select",label:"Select",category:"core",icon:z.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),fieldName:l.g({title:"Field Name",default:"select"}),showLabel:l.c({title:"Show label",default:!0}),inputStyles:l.o({default:"w-full p-1"}),label:l.g({title:"Label",default:"Label"}),placeholder:l.g({title:"Placeholder",default:"Placeholder"}),required:l.c({title:"Required",default:!1}),_multiple:l.c({title:"Multiple Choice",default:!1}),options:l.S({title:"Options",itemProperties:{label:l.g({title:"Label",default:""}),value:l.g({title:"Value",default:""})}})}});const o0=c=>{const{blockProps:e,fieldName:t,label:s,placeholder:a,styles:i,inputStyles:n,_rows:o,showLabel:v}=c,M=p.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...i,...e,children:[v&&r.jsxRuntimeExports.jsx("label",{htmlFor:M,children:s}),r.jsxRuntimeExports.jsx("textarea",{name:t,...n,id:M,placeholder:a,rows:o})]}):r.jsxRuntimeExports.jsx("textarea",{id:M,name:t,...e,...n,...i,placeholder:a,rows:o})};d.registerChaiBlock(o0,{type:"TextArea",label:"TextArea",category:"core",icon:z.InputIcon,group:"form",hidden:!0,props:{fieldName:l.g({title:"Field Name",default:"textarea"}),showLabel:l.c({title:"Show label",default:!0}),styles:l.o({default:""}),inputStyles:l.o({default:"w-full p-1"}),label:l.g({title:"Label",default:"Label"}),placeholder:l.g({title:"Placeholder",default:"Placeholder"}),_rows:l.y({title:"Rows",default:3})}});const h0=u.noop;exports.loadWebBlocks=h0;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-es"),r=require("./jsx-runtime-Z_BpKhVy.cjs"),G=require("react"),l=require("./controls-rRZhz0vu.cjs"),d=require("@chaibuilder/runtime"),x=require("./empty-slot-Sy930lX6.cjs"),z=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),k=require("./index--mLLy7QQ.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");function j(c){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(c){for(const t in c)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(c,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>c[t]})}}return e.default=c,Object.freeze(e)}const h=j(G),E=h.memo(c=>{const{blockProps:e,inBuilder:t,backgroundImage:s,children:a,tag:i="div",styles:n}=c;let o=a;a||(o=r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:t}));let v={};return s&&(v={backgroundImage:`url(${s})`}),h.createElement(i,{...e,...n,style:v},o)});d.registerChaiBlock(E,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:l.o({default:""}),tag:l.f({title:"Tag",default:"div",options:[{value:"div",title:"div"},{value:"header",title:"header"},{value:"footer",title:"footer"},{value:"section",title:"section"},{value:"article",title:"article"},{value:"aside",title:"aside"},{value:"main",title:"main"},{value:"nav",title:"nav"},{value:"figure",title:"figure"},{value:"details",title:"details"},{value:"summary",title:"summary"},{value:"dialog",title:"dialog"},{value:"strike",title:"strike"},{value:"caption",title:"caption"},{value:"legend",title:"legend"},{value:"figcaption",title:"figcaption"},{value:"mark",title:"mark"}]}),backgroundImage:l.v({title:"Background Image"})},canAcceptBlock:()=>!0});const S=h.memo(c=>{const{blockProps:e,styles:t}=c;return h.createElement("div",{...e,...t})});d.registerChaiBlock(S,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:l.o({default:""})},canAcceptBlock:()=>!1});const R=c=>{const{blockProps:e,styles:t,content:s,level:a="h1",children:i=null}=c;return i?h.createElement(a,{...t,...e},i):h.createElement(a,{...t,...e,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(R,{type:"Heading",label:"Heading",category:"core",icon:z.HeadingIcon,group:"typography",props:{level:l.f({title:"Level",default:"h1",binding:!1,options:[{value:"h1",title:"h1"},{value:"h2",title:"h2"},{value:"h3",title:"h3"},{value:"h4",title:"h4"},{value:"h5",title:"h5"},{value:"h6",title:"h6"}]}),styles:l.o({default:"text-3xl"}),content:l.r({title:"Content",default:"Heading goes here"})},canAcceptBlock:c=>c==="Span"||c==="Text"});const C=c=>{const{blockProps:e,styles:t,content:s}=c;return u.isNull(c.children)?h.createElement("p",{...t,...e,"data-ai-key":"content","data-ai-type":"html",dangerouslySetInnerHTML:{__html:s}}):h.createElement("p",{...t,...e},c.children)};d.registerChaiBlock(C,{type:"Paragraph",label:"Paragraph",category:"core",icon:z.TextIcon,group:"typography",props:{styles:l.o({default:""}),content:l.r({title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere."})},canAcceptBlock:c=>c==="Span"||c==="Link"});const L=c=>{const{blockProps:e,styles:t,content:s,children:a=null,tag:i}=c;return a?h.createElement("span",{...t,...e},a):h.createElement(i||"span",{...t,...e,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:l.o({default:""}),content:l.r({title:"Content",default:""})},canAcceptBlock:()=>!0});const T=c=>{const{blockProps:e,content:t,styles:s}=c;return r.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:r.jsxRuntimeExports.jsx("div",{"data-ai-key":"content","data-ai-type":"richtext",...e,...s,dangerouslySetInnerHTML:{__html:t}})})};d.registerChaiBlock(T,{type:"RichText",label:"Rich Text",category:"core",icon:z.CursorTextIcon,group:"typography",props:{styles:l.o({default:""}),content:l.b({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const _=c=>{const{blockProps:e,iconSize:t,icon:s,content:a,iconPos:i,styles:n,children:o}=c,v=s,M=o||r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",children:a}),v&&r.jsxRuntimeExports.jsx("div",{style:{width:t+"px"},className:i+" "+(i==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:v}})]});return h.createElement("button",{...e,...n,type:"button"},M)};d.registerChaiBlock(_,{type:"Button",label:"Button",category:"core",icon:z.ButtonIcon,group:"basic",props:{content:l.g({title:"Label",default:"Button"}),styles:l.o({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:l.T({title:"Icon",default:""}),iconSize:l.y({title:"Icon Size",default:24}),iconPos:l.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const P=c=>{const{blockProps:e,link:t,children:s,styles:a,inBuilder:i,content:n}=c;return!s&&u.isEmpty(a==null?void 0:a.className)&&u.isEmpty(n)?r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:i}):i?s?r.jsxRuntimeExports.jsx("span",{...e,...a,children:s}):h.createElement("span",{...e,...a,dangerouslySetInnerHTML:{__html:n}}):s?r.jsxRuntimeExports.jsx("a",{href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...e,...a,children:s}):h.createElement("a",{...e,...a,"data-ai-key":"content",href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self",dangerouslySetInnerHTML:{__html:n}})};d.registerChaiBlock(P,{type:"Link",label:"Link",category:"core",icon:z.Link1Icon,group:"basic",props:{styles:l.o({default:""}),content:l.g({title:"Content",default:""}),link:l.q({title:"Link",default:{type:"page",target:"_self",href:"#"}})},canAcceptBlock:c=>c!=="Link"});const D=(c,...e)=>({...c,className:f.cn(c.className,...e)}),N=c=>{const{blockProps:e,children:t,styles:s,inBuilder:a,content:i,href:n}=c,{hrefType:o,autoplay:v,maxWidth:M,backdropColor:p,galleryName:g}=c,m=D(s,"cb-lightbox");if(!t&&u.isEmpty(s==null?void 0:s.className)&&u.isEmpty(i))return r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:a});if(a)return t?r.jsxRuntimeExports.jsx("span",{...e,...m,children:t}):h.createElement("span",{...e,...m,dangerouslySetInnerHTML:{__html:i}});const B={};return B["data-vbtype"]=o,v&&(B["data-autoplay"]="true"),M&&(B["data-maxwidth"]=M+"px"),p&&(B["data-overlay"]=p),g&&(B["data-gall"]=g),t?r.jsxRuntimeExports.jsx("a",{...B,href:n||"#/",...e,...m,children:t}):h.createElement("a",{...e,...m,...B,href:n||"#",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"LightBoxLink",label:"LightBox Link",category:"core",icon:z.ImageIcon,group:"basic",props:{styles:l.o({default:""}),content:l.g({title:"Content",default:"Link text or drop blocks inside"}),href:l.g({title:"Href",default:""}),hrefType:l.f({title:"Type",default:"video",options:[{value:"video",title:"video "},{value:"iframe",title:"iframe"},{value:"inline",title:"inline"},{value:"ajax",title:"ajax"}]}),autoplay:l.c({title:"Autoplay video",default:!1}),maxWidth:l.y({title:"Max Width",default:800}),backdropColor:l.g({title:"Backdrop Color",default:"rgba(95,164,255,0.8)"}),galleryName:l.y({title:"Max Width",default:800})},canAcceptBlock:c=>c!=="Link"});const H=c=>{const{blockProps:e,children:t,listType:s,styles:a,tag:i,inBuilder:n}=c,o=f.cn(u.get(a,"className",""),s);return!t&&u.isEmpty(a==null?void 0:a.className)?r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:n}):h.createElement(i||(s==="list-decimal"?"ol":"ul"),{...e,...a,className:o},t)};d.registerChaiBlock(H,{type:"List",label:"List",icon:z.RowsIcon,category:"core",group:"basic",props:{styles:l.o({default:""}),listType:l.f({title:"List type",default:"list-none",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:c=>c==="ListItem",blocks:[{_type:"List",_id:"a",listType:"list-none",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]});const A=c=>{const{blockProps:e,content:t,styles:s,children:a,tag:i}=c;return a?h.createElement(i||"li",{...s,...e},a):h.createElement(i||"li",{...s,...e,"data-ai-key":"content",dangerouslySetInnerHTML:{__html:t}})};d.registerChaiBlock(A,{type:"ListItem",label:"List Item",icon:z.ColumnsIcon,category:"core",group:"basic",props:{styles:l.o({default:""}),content:l.r({title:"Content",default:"List item"})},canAcceptBlock:c=>c!=="ListItem",canBeNested:c=>c==="List"});const q=c=>{const{blockProps:e,icon:t,styles:s,width:a,inBuilder:i,height:n}=c,o=D(s,f.cn(a?`w-[${a}px]`:"",n?`h-[${n}px]`:""));if(u.isEmpty(t))return r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:i,className:"h-8 w-14"});const v=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return h.createElement("span",{...e,...o,dangerouslySetInnerHTML:{__html:v}})};d.registerChaiBlock(q,{type:"Icon",label:"Icon",category:"core",icon:z.SketchLogoIcon,group:"media",props:{styles:l.o({default:"text-black"}),icon:l.T({title:"Icon",default:'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M8 16c4.418 0 8-3.582 8-8s-3.582-8-8-8-8 3.582-8 8 3.582 8 8 8zM8 1.5c3.59 0 6.5 2.91 6.5 6.5s-2.91 6.5-6.5 6.5-6.5-2.91-6.5-6.5 2.91-6.5 6.5-6.5zM8 9.356c1.812 0 3.535-0.481 5-1.327-0.228 2.788-2.393 4.971-5 4.971s-4.772-2.186-5-4.973c1.465 0.845 3.188 1.329 5 1.329zM4 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5zM10 5.5c0-0.828 0.448-1.5 1-1.5s1 0.672 1 1.5c0 0.828-0.448 1.5-1 1.5s-1-0.672-1-1.5z"></path></svg>'}),width:l.y({title:"Width",default:""}),height:l.y({title:"Height",default:""})}});const U=c=>{const{blockProps:e,image:t,styles:s,alt:a,height:i,width:n}=c;return u.isEmpty(t)?r.jsxRuntimeExports.jsx(x.EmptySlot,{className:"h-36"}):h.createElement("img",{...e,...s,src:t,alt:a,loading:"lazy",height:i,width:n})};d.registerChaiBlock(U,{type:"Image",label:"Image",category:"core",icon:z.ImageIcon,group:"media",props:{styles:l.o({default:""}),image:l.v({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:l.g({title:"Alt",default:""}),width:l.g({title:"Width",default:""}),height:l.g({title:"Height",default:""})}});const F=c=>{var n;const{blockProps:e,inBuilder:t,styles:s,children:a}=c;let i=null;return!a&&t&&(i=r.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(n=c.emptyStyles)==null?void 0:n.className),children:r.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:r.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",c.name]})})})),h.createElement("div",{...s,...e,droppable:"yes"},a||i)};d.registerChaiBlock(F,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:l.o({default:""}),emptyStyles:l.o({default:""})},canAcceptBlock:()=>!0});const I=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,b=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,w=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,O=c=>{if(I.test(c)){const e=c.match(I);return e?`https://www.youtube.com/embed/${e[4]}`:c}if(b.test(c)){const e=c.match(b);return e?`https://player.vimeo.com/video/${e[3]}`:c}if(w.test(c)){const e=c.match(w);return e?`https://www.dailymotion.com/embed/video/${e[4]}`:c}return null},$=h.memo(c=>{const{blockProps:e,inBuilder:t,styles:s,url:a,controls:i}=c,n=u.get(i,"autoPlay",!1),o=u.get(i,"controls",!1),v=n||u.get(i,"muted",!0),M=u.get(i,"loop",!1);if(u.isEmpty(a))return r.jsxRuntimeExports.jsx(x.EmptySlot,{inBuilder:t,className:"h-36"});let p=O(a),g=null;if(p){if(!u.isEmpty(p)){const m=[];m.push(`autoplay=${n?1:0}`),m.push(`controls=${i?1:0}`),m.push(`mute=${v?1:0}&muted=${v?1:0}`),m.push(`loop=${M?1:0}`),p=`${p}?${m.join("&")}`}g=h.createElement("iframe",{...e,className:"absolute inset-0 w-full h-full",src:p,allow:t?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=h.createElement("video",{...e,className:"absolute inset-0 w-full h-full",src:a,controls:o,muted:v,autoPlay:t?!1:n,loop:M});return r.jsxRuntimeExports.jsx("div",{...u.pick(s,["className"]),children:r.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[t?r.jsxRuntimeExports.jsx("div",{...e,...u.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock($,{type:"Video",label:"Video",category:"core",icon:z.VideoIcon,group:"media",props:{styles:l.o({default:""}),url:l.g({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:l.h({title:"Controls",properties:{autoPlay:l.c({title:"Autoplay",default:!0}),controls:l.c({title:"Show controls",default:!1}),loop:l.c({title:"Loop",default:!1}),muted:l.c({title:"Muted",default:!0})}})}});const V=c=>{const{blockProps:e,styles:t,htmlCode:s,inBuilder:a}=c;return a?r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[a?r.jsxRuntimeExports.jsx("div",{...e,...t,className:"absolute z-20 h-full w-full"}):null,h.createElement("div",{...t,dangerouslySetInnerHTML:{__html:s.replace(/<script.*?>.*?<\/script>/g,"")}})]}):h.createElement("div",{...e,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(V,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:z.CodeIcon,group:"advanced",props:{styles:l.o({default:""}),htmlCode:l.u({title:"HTML Code",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})},canAcceptBlock:()=>!1});function W(c){return k.GenIcon({tag:"svg",attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M4.698 3.419l2.057 23.073 9.231 2.563 9.256-2.566 2.059-23.069h-22.604zM13.226 9.394l-0.409 4.441 9.671 0.001-0.069 0.76-0.665 7.45-0.042 0.478-5.804 1.609-5.796-1.609-0.396-4.443h2.84l0.202 2.257 3.154 0.85 3.156-0.852 0.328-3.67-9.671-0.001 0.069-0.76 0.665-7.45 0.209-2.086h11.287l0.131 1.598 0.403 4.453h-2.841l-0.262-2.922-2.889-0.174h-0.515v-0.004l-2.755 0.074z"},child:[]}]})(c)}const J=c=>{const{scripts:e,inBuilder:t,blockProps:s}=c;return t?r.jsxRuntimeExports.jsx("div",{...s}):r.jsxRuntimeExports.jsx("div",{dangerouslySetInnerHTML:{__html:e}})};d.registerChaiBlock(J,{type:"CustomScript",label:"Custom Script",category:"core",icon:W,group:"advanced",props:{scripts:l.u({title:"Script",default:"",placeholder:"<script>console.log('Hello, world!');<\/script>"})},canAcceptBlock:()=>!1});const Y=c=>{const{blockProps:e,styles:t}=c;return h.createElement("hr",{...t,...e})};d.registerChaiBlock(Y,{type:"Divider",label:"Divider",category:"core",icon:z.DividerHorizontalIcon,group:"basic",props:{styles:l.o({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const K=c=>c.inBuilder||c.forceWrapper?r.jsxRuntimeExports.jsx("span",{"data-ai-key":"content",...c.blockProps,children:c.content}):`${c.content}`;d.registerChaiBlock(K,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:z.SpaceBetweenVerticallyIcon,props:{content:l.r({title:"Content",defaultValue:""})}});const X=c=>{const{blockProps:e,backgroundImage:t,children:s,styles:a}=c;let i={};return t&&(i={backgroundImage:`url(${t})`}),h.createElement("div",{...e,...a,style:i},s)};d.registerChaiBlock(X,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:l.o({default:"font-body antialiased"}),backgroundImage:l.v({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const Z=c=>{const{blockProps:e,styles:t}=c;return h.createElement("br",{...e,...t})};d.registerChaiBlock(Z,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:z.SpaceBetweenVerticallyIcon,props:{styles:l.o({default:""})}});const y=c=>{const e=(i,n)=>({_id:f.generateUUID(),_parent:i,_type:"TableCell",styles:"#styles:,",content:`${c==="TableHead"?"Table Head":"Table Cell "+n}`}),t=i=>{const n=f.generateUUID(),o={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return i&&(o._parent=i),[o,e(n,"1"),e(n,"2"),e(n,"3")]},s=i=>{const n=f.generateUUID(),o={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return i&&(o._parent=i),[o,...t(n)]},a=i=>{const n=f.generateUUID(),o={_id:n,_type:"TableBody",styles:"#styles:,"};return i&&(o._parent=i),[o,...t(n),...t(n)]};if(c==="Table"){const i=f.generateUUID();return[{_id:i,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(i),...a(i)]}return c==="TableRow"?t():c==="TableHead"?s():c==="TableBody"?a():[]},Q=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("table",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(Q,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:z.TableIcon,props:{styles:l.o({default:""})},blocks:y("Table")});const c0=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("thead",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(c0,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:z.BorderTopIcon,props:{styles:l.o({default:""})},blocks:y("TableHead")});const t0=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("tbody",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(t0,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:z.BorderAllIcon,props:{styles:l.o({default:""})},blocks:y("TableBody")});const l0=c=>{const{blockProps:e,children:t,styles:s}=c;return t?h.createElement("tr",{...e,...s},t):r.jsxRuntimeExports.jsx(x.EmptySlot,{})};d.registerChaiBlock(l0,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:z.ViewHorizontalIcon,props:{styles:l.o({default:"w-full"})},blocks:y("TableRow")});const e0=c=>{const{blockProps:e,children:t,content:s,styles:a}=c;return!t&&u.isEmpty(s)?r.jsxRuntimeExports.jsx(x.EmptySlot,{}):t?h.createElement("td",{...e,...a},t):h.createElement("td",{...e,...a,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(e0,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:z.DragHandleHorizontalIcon,props:{styles:l.o({default:""}),content:l.b({title:"Content",default:"Table cell item",ai:{html:!0}})}});const s0=c=>{const{blockProps:e,errorMessage:t,name:s,_type:a,successMessage:i,action:n,styles:o,children:v}=c;let M=v;v||(M=r.jsxRuntimeExports.jsx(x.EmptySlot,{}));const p={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxRuntimeExports.jsxs("form",{...p,"data-error":t,"data-success":i,method:"post",action:n,...e,...o,children:[r.jsxRuntimeExports.jsx("div",{...g}),r.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||a}),M]})};d.registerChaiBlock(s0,{type:"Form",label:"Form",category:"core",icon:z.GroupIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),action:l.g({title:"Submit URL",default:"/api/form/submit"}),errorMessage:l.b({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:l.b({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const a0=c=>{const{blockProps:e,content:t,styles:s,children:a}=c,i={...s,...e};return a?h.createElement("label",i,a):h.createElement("label",{...i,dangerouslySetInnerHTML:{__html:t}})};d.registerChaiBlock(a0,{type:"Label",label:"Label",category:"core",icon:z.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),content:l.g({title:"Content",default:"Label",ai:{html:!1}})}});const i0=c=>{const{blockProps:e,inBuilder:t,label:s,styles:a,inputStyles:i,icon:n,iconPos:o}=c,v=f.generateUUID(),M={"x-bind:disabled":"formLoading"};return r.jsxRuntimeExports.jsxs("button",{id:v,...M,...i,...a,...e||{},type:t?"button":"submit",children:[s,n&&r.jsxRuntimeExports.jsx("span",{className:o,dangerouslySetInnerHTML:{__html:n}})]})};d.registerChaiBlock(i0,{type:"FormButton",label:"Submit Button",category:"core",icon:z.ButtonIcon,group:"form",hidden:!0,props:{label:l.g({title:"Label",default:"Submit"}),styles:l.o({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:l.T({title:"Icon",default:""}),iconPos:l.f({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const r0=c=>{const{blockProps:e,fieldName:t,label:s,styles:a,inputStyles:i,required:n,checked:o,showLabel:v=!0}=c,M=f.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...a,...e,children:[r.jsxRuntimeExports.jsx("input",{...i,name:t,id:M,type:"checkbox",required:n,defaultChecked:o}),s&&s!=="Label"&&r.jsxRuntimeExports.jsx("label",{htmlFor:M,children:s})]}):r.jsxRuntimeExports.jsx("input",{id:M,...e,...i,...a,type:"checkbox",required:n,name:t})};d.registerChaiBlock(r0,{type:"Checkbox",label:"Checkbox",category:"core",icon:z.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:l.g({title:"Field Name",default:"checkbox"}),styles:l.o({default:"flex items-center gap-x-2"}),label:l.g({title:"Label",default:"Label"}),checked:l.c({title:"Checked",default:!1}),required:l.c({title:"Required",default:!1})}});const n0=c=>{const{blockProps:e,label:t,placeholder:s,styles:a,inputStyles:i,showLabel:n,required:o,inputType:v="text",inBuilder:M,fieldName:p}=c,g=f.generateUUID();return!n||v==="submit"?(v==="submit"&&(e.value=t),r.jsxRuntimeExports.jsx("input",{id:g,name:p,readOnly:M,...e,...i,...a,type:v,placeholder:s,required:o})):r.jsxRuntimeExports.jsxs("div",{...a,...e,children:[n&&r.jsxRuntimeExports.jsx("label",{htmlFor:g,children:t}),r.jsxRuntimeExports.jsx("input",{name:p,readOnly:M,...i,id:g,type:v,placeholder:s,required:o})]})};d.registerChaiBlock(n0,{type:"Input",label:"Input",category:"core",icon:z.InputIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),fieldName:l.g({title:"Field Name",default:"input"}),inputType:l.f({title:"Type",options:u.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],c=>({value:c,title:c})),default:"text"}),value:l.g({title:"Value",default:""}),showLabel:l.c({title:"Show label",default:!0}),inputStyles:l.o({default:"w-full p-1"}),label:l.g({title:"Label",default:"Label"}),placeholder:l.g({title:"Placeholder",default:"Placeholder"}),required:l.c({title:"Required",default:!1})}});const o0=c=>{const{blockProps:e,fieldName:t,label:s,styles:a,inputStyles:i,checked:n,required:o,showLabel:v=!0}=c,M=f.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...a,...e,children:[r.jsxRuntimeExports.jsx("input",{...i,name:t,id:M,type:"radio",required:o,defaultChecked:n}),s&&r.jsxRuntimeExports.jsx("label",{htmlFor:M,children:s})]}):r.jsxRuntimeExports.jsx("input",{id:M,...e,...i,...a,type:"radio",required:o,checked:n,name:t})};d.registerChaiBlock(o0,{type:"Radio",label:"Radio",category:"core",icon:z.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:l.o({default:"flex items-center w-max gap-x-2"}),fieldName:l.g({title:"Field Name",default:"radio"}),label:l.g({title:"Label",default:"Label"}),checked:l.c({title:"Checked",default:!1}),required:l.c({title:"Required",default:!1})}});const h0=c=>{const{blockProps:e,fieldName:t,label:s,placeholder:a,styles:i,inputStyles:n,required:o,showLabel:v,_multiple:M=!1}=c,p=f.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...i,children:[v&&r.jsxRuntimeExports.jsx("label",{htmlFor:p,children:s}),r.jsxRuntimeExports.jsxs("select",{...n,id:p,required:o,multiple:M,name:t,children:[r.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:a}),u.map(c.options,g=>r.jsxRuntimeExports.jsx("option",{selected:u.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):r.jsxRuntimeExports.jsxs("select",{id:p,...i,...e,required:o,multiple:M,name:t,children:[r.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:a}),u.map(c.options,g=>r.jsxRuntimeExports.jsx("option",{selected:u.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(h0,{type:"Select",label:"Select",category:"core",icon:z.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:l.o({default:""}),fieldName:l.g({title:"Field Name",default:"select"}),showLabel:l.c({title:"Show label",default:!0}),inputStyles:l.o({default:"w-full p-1"}),label:l.g({title:"Label",default:"Label"}),placeholder:l.g({title:"Placeholder",default:"Placeholder"}),required:l.c({title:"Required",default:!1}),_multiple:l.c({title:"Multiple Choice",default:!1}),options:l.S({title:"Options",itemProperties:{label:l.g({title:"Label",default:""}),value:l.g({title:"Value",default:""})}})}});const d0=c=>{const{blockProps:e,fieldName:t,label:s,placeholder:a,styles:i,inputStyles:n,_rows:o,showLabel:v}=c,M=f.generateUUID();return v?r.jsxRuntimeExports.jsxs("div",{...i,...e,children:[v&&r.jsxRuntimeExports.jsx("label",{htmlFor:M,children:s}),r.jsxRuntimeExports.jsx("textarea",{name:t,...n,id:M,placeholder:a,rows:o})]}):r.jsxRuntimeExports.jsx("textarea",{id:M,name:t,...e,...n,...i,placeholder:a,rows:o})};d.registerChaiBlock(d0,{type:"TextArea",label:"TextArea",category:"core",icon:z.InputIcon,group:"form",hidden:!0,props:{fieldName:l.g({title:"Field Name",default:"textarea"}),showLabel:l.c({title:"Show label",default:!0}),styles:l.o({default:""}),inputStyles:l.o({default:"w-full p-1"}),label:l.g({title:"Label",default:"Label"}),placeholder:l.g({title:"Placeholder",default:"Placeholder"}),_rows:l.y({title:"Rows",default:3})}});const v0=u.noop;exports.loadWebBlocks=v0;