@chaibuilder/sdk 1.2.29 → 1.2.31

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 (64) hide show
  1. package/dist/{AddBlocks-YJPdSqcY.cjs → AddBlocks-UxJOFB9M.cjs} +1 -1
  2. package/dist/{AddBlocks-0sW6gkCO.js → AddBlocks-u1FkSHNj.js} +19 -19
  3. package/dist/{BrandingOptions--vgnQvD1.js → BrandingOptions-A3_c_sd7.js} +1 -1
  4. package/dist/{CanvasArea-41QoxuLf.cjs → CanvasArea-AP2VxTme.cjs} +4 -4
  5. package/dist/{CanvasArea-aii0PyU-.js → CanvasArea-AgZG60eK.js} +68 -68
  6. package/dist/{CurrentPage-2W1pdAOG.cjs → CurrentPage-lBwqlXua.cjs} +1 -1
  7. package/dist/{CurrentPage-06Iacwyp.js → CurrentPage-urEDcMfR.js} +4 -4
  8. package/dist/{ListTree-DnA8gj-7.js → ListTree-c9Z0kWbN.js} +1 -1
  9. package/dist/{PagesPanel-_1CDTUdE.js → PagesPanel-C3yfpE0O.js} +5 -5
  10. package/dist/{PagesPanel-PBFzPSNY.cjs → PagesPanel-QAb3JjVO.cjs} +1 -1
  11. package/dist/{ProjectPanel-pUMeIiUW.js → ProjectPanel--8xzmpgT.js} +5 -5
  12. package/dist/{ProjectPanel-755bbzEQ.cjs → ProjectPanel-DJHfHFni.cjs} +1 -1
  13. package/dist/Settings-alHeC0FS.cjs +1 -0
  14. package/dist/{Settings-dnO-s6x0.js → Settings-oMxnykls.js} +560 -532
  15. package/dist/{SidePanels-VxSXXkt_.js → SidePanels-TuKVMKxP.js} +3 -3
  16. package/dist/{SidePanels-Gq2LdVuY.cjs → SidePanels-znlH133C.cjs} +1 -1
  17. package/dist/{Topbar-5zbOSGF6.js → Topbar-VCFW9uNI.js} +1 -1
  18. package/dist/{UnsplashImages-4WAWgA4s.js → UnsplashImages-N9h0avWO.js} +1 -1
  19. package/dist/{UploadImages-PONIHtn6.js → UploadImages-e70AeNGX.js} +1 -1
  20. package/dist/{add-page-modal-jWcp0w-S.cjs → add-page-modal-PhWtC-ZY.cjs} +1 -1
  21. package/dist/{add-page-modal-4VrFvgEm.js → add-page-modal-Q3c1EOw1.js} +5 -5
  22. package/dist/{confirm-alert-j7b88hsW.js → confirm-alert-EDOFRmH8.js} +1 -1
  23. package/dist/core.cjs +1 -1
  24. package/dist/core.js +2 -2
  25. package/dist/defaultTheme-9e2np_iI.cjs +1 -0
  26. package/dist/{defaultTheme-D8B4-wHO.js → defaultTheme-ocvEtKQ3.js} +14 -5
  27. package/dist/{delete-page-modal--xHHdRAq.js → delete-page-modal-9B7603s-.js} +4 -4
  28. package/dist/{delete-page-modal-p6b0upz4.cjs → delete-page-modal-eh0Afqbu.cjs} +1 -1
  29. package/dist/email.cjs +1 -1
  30. package/dist/email.js +2 -2
  31. package/dist/{form-_GJb9YcB.js → form-yw3Uuk6v.js} +1 -1
  32. package/dist/html-to-json-Xhu27KFD.cjs +1 -0
  33. package/dist/{html-to-json-LJyJsnmZ.js → html-to-json-ZV4QjSww.js} +53 -52
  34. package/dist/{index-KArv7pNz.cjs → index-B1EMostm.cjs} +1 -1
  35. package/dist/{index-0QJwevON.js → index-FVtnWx9d.js} +2 -2
  36. package/dist/{index-UHaqEdws.js → index-HiiWSXkE.js} +9 -9
  37. package/dist/{index-Eb5zyh2F.js → index-TXu6kBv9.js} +4 -4
  38. package/dist/{index-mlMvwv2b.cjs → index-tFX6mX_R.cjs} +1 -1
  39. package/dist/lib.cjs +3 -3
  40. package/dist/lib.d.ts +2 -0
  41. package/dist/lib.js +83 -81
  42. package/dist/{page-viewer-00Xx4u8e.js → page-viewer-3UIfb9p1.js} +5 -5
  43. package/dist/{page-viewer-SZNm7b1n.cjs → page-viewer-wVQGkDJd.cjs} +1 -1
  44. package/dist/{project-general-setting-asDxlmhZ.js → project-general-setting-8vqXfr75.js} +5 -5
  45. package/dist/{project-general-setting-C_pHNuZE.cjs → project-general-setting-LrABWutT.cjs} +1 -1
  46. package/dist/{project-seo-setting-DuAaDfDR.js → project-seo-setting-x3peNgla.js} +2 -2
  47. package/dist/render.cjs +1 -1
  48. package/dist/render.d.ts +2 -0
  49. package/dist/render.js +76 -74
  50. package/dist/{single-page-detail-oqj6zsLU.cjs → single-page-detail-76C_iDiS.cjs} +1 -1
  51. package/dist/{single-page-detail-UNxXvhl4.js → single-page-detail-py5_WxGu.js} +12 -12
  52. package/dist/studio.cjs +1 -1
  53. package/dist/studio.js +4 -4
  54. package/dist/tailwind.cjs +1 -1
  55. package/dist/tailwind.d.ts +37 -0
  56. package/dist/tailwind.js +102 -11
  57. package/dist/ui.js +7 -7
  58. package/dist/{useCanvasSettings-R6br4J9i.js → useCanvasSettings-unTQUdlP.js} +1 -1
  59. package/dist/web-blocks.cjs +4 -4
  60. package/dist/web-blocks.js +232 -216
  61. package/package.json +2 -2
  62. package/dist/Settings-G9Xtqr7n.cjs +0 -1
  63. package/dist/defaultTheme-7VqqhOcp.cjs +0 -1
  64. package/dist/html-to-json-vP1ESB_e.cjs +0 -1
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bb as y, be as z, bc as J, bd as K, bu as W, bH as X, A as Y, ai as Z, g as _, b as $, e as N, f as O, c as Q, d as U, a as aa, bv as ea, as as oa, B as ta, bo as ra, br as sa, bq as na, bt as ia, bp as ba, bJ as pa, aZ as ua, cg as ma, b0 as la, b1 as ca, a_ as da, b2 as ga, a$ as Ca, ci as Ma, ch as Sa, bz as Da, cj as Ta, by as xa, co as Aa, bx as ha, cl as Ia, cp as wa, ct as Pa, ck as ka, cm as Fa, cn as Ga, cq as La, cr as va, cs as Ha, bA as Ra, ad as fa, ae as Ba, ah as Va, b3 as Ea, af as ja, ag as qa, ao as ya, aG as za, aL as Ja, aI as Ka, bi as Wa, bj as Xa, aJ as Ya, c9 as Za, cd as _a, c8 as $a, aK as Na, bk as Oa, ca as Qa, cb as Ua, cc as ae, aH as ee, aD as oe, aF as te, aE as re, b7 as se, b8 as ne, bf as ie, aB as be, b9 as pe, bL as ue, bS as me, bO as le, bY as ce, bP as de, bR as ge, bM as Ce, bV as Me, bT as Se, bU as De, bQ as Te, b_ as xe, bZ as Ae, bW as he, bX as Ie, bN as we, aW as Pe, aY as ke, aX as Fe, b6 as Ge, bh as Le, bK as ve, aj as He, am as Re, ay as fe, an as Be, az as Ve, b$ as Ee, ak as je, al as qe, aA as ye, c0 as ze, c2 as Je, c3 as Ke, c7 as We, c5 as Xe, c4 as Ye, c6 as Ze, c1 as _e, S as $e, aC as Ne, au as Oe, ax as Qe, av as Ue, aw as ao, bs as eo, I as oo, bE as to, ap as ro, ar as so, bg as no, T as io, aq as bo, bI as po, bG as uo, ce as mo, cf as lo, bF as co, bm as go } from "./index-UHaqEdws.js";
1
+ import { bb as y, be as z, bc as J, bd as K, bu as W, bH as X, A as Y, ai as Z, g as _, b as $, e as N, f as O, c as Q, d as U, a as aa, bv as ea, as as oa, B as ta, bo as ra, br as sa, bq as na, bt as ia, bp as ba, bJ as pa, aZ as ua, cg as la, b0 as ma, b1 as ca, a_ as da, b2 as ga, a$ as Ca, ci as Ma, ch as Sa, bz as Da, cj as Ta, by as xa, co as Aa, bx as ha, cl as Ia, cp as wa, ct as Pa, ck as ka, cm as Fa, cn as Ga, cq as La, cr as va, cs as Ha, bA as Ra, ad as fa, ae as Ba, ah as Va, b3 as Ea, af as ja, ag as qa, ao as ya, aG as za, aL as Ja, aI as Ka, bj as Wa, bk as Xa, aJ as Ya, c9 as Za, cd as _a, c8 as $a, aK as Na, bl as Oa, ca as Qa, cb as Ua, cc as ae, aH as ee, aD as oe, aF as te, aE as re, b7 as se, b8 as ne, bg as ie, aB as be, b9 as pe, bL as ue, bS as le, bO as me, bY as ce, bP as de, bR as ge, bM as Ce, bV as Me, bT as Se, bU as De, bQ as Te, b_ as xe, bZ as Ae, bW as he, bX as Ie, bN as we, aW as Pe, aY as ke, aX as Fe, b6 as Ge, bi as Le, bK as ve, aj as He, am as Re, ay as fe, an as Be, az as Ve, b$ as Ee, ak as je, al as qe, aA as ye, c0 as ze, c2 as Je, c3 as Ke, c7 as We, c5 as Xe, c4 as Ye, c6 as Ze, c1 as _e, S as $e, aC as Ne, au as Oe, ax as Qe, av as Ue, aw as ao, bs as eo, I as oo, bE as to, ap as ro, ar as so, bh as no, T as io, aq as bo, bI as po, bG as uo, ce as lo, cf as mo, bF as co, bf as go } from "./index-HiiWSXkE.js";
2
2
  import "react";
3
3
  import "lodash-es";
4
4
  import "./Functions-7jnEwJyw.js";
@@ -63,8 +63,8 @@ export {
63
63
  ba as CardHeader,
64
64
  pa as CardTitle,
65
65
  ua as Command,
66
- ma as CommandDialog,
67
- la as CommandEmpty,
66
+ la as CommandDialog,
67
+ ma as CommandEmpty,
68
68
  ca as CommandGroup,
69
69
  da as CommandInput,
70
70
  ga as CommandItem,
@@ -117,8 +117,8 @@ export {
117
117
  be as Label,
118
118
  pe as LinkField,
119
119
  ue as Menubar,
120
- me as MenubarCheckboxItem,
121
- le as MenubarContent,
120
+ le as MenubarCheckboxItem,
121
+ me as MenubarContent,
122
122
  ce as MenubarGroup,
123
123
  de as MenubarItem,
124
124
  ge as MenubarLabel,
@@ -171,8 +171,8 @@ export {
171
171
  bo as TooltipTrigger,
172
172
  po as badgeVariants,
173
173
  uo as buttonVariants,
174
- mo as reducer,
175
- lo as toast,
174
+ lo as reducer,
175
+ mo as toast,
176
176
  co as toggleVariants,
177
177
  go as useToast
178
178
  };
@@ -1,5 +1,5 @@
1
1
  import { useAtom as t } from "jotai";
2
- import { bn as s } from "./index-UHaqEdws.js";
2
+ import { bn as s } from "./index-HiiWSXkE.js";
3
3
  const r = () => t(s);
4
4
  export {
5
5
  r as u
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-KK2oLIa8.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-vP1ESB_e.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const p=R(w),T=p.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:n="div",styles:i}=e;let c=r;r||(c=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let u={};return s&&(u={backgroundImage:`url(${s})`}),p.createElement(n,{...t,...i,style:u},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.s({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:o.o({title:"Background Image"})},canAcceptBlock:()=>!0});const C=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:n=null}=e;return n?p.createElement(r,{...l,...t},n):p.createElement(r,{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(C,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.s({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:o.S({default:"text-3xl"}),content:o.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const L=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?p.createElement("p",{...l,...t,dangerouslySetInnerHTML:{__html:s}}):p.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(L,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.g({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:e=>e==="Span"||e==="Link"});const _=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:n}=e;return r?p.createElement("span",{...l,...t},r):p.createElement(n||"span",{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(_,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const P=e=>{const{blockProps:t,content:l,styles:s}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(P,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const A=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:n,styles:i,children:c}=e,u=s,m=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{children:r}),u&&a.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:u}})]});return p.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(A,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.u({title:"Label",default:"Button",multiLingual:!0}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.T({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const M=e=>{const{blockProps:t,link:l,children:s,styles:r,inBuilder:n,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:n}):n?s?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):p.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?a.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):p.createElement("a",{...t,...r,href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(M,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.u({title:"Content",default:""}),link:o.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const N=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:n,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):p.createElement(n||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(N,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.s({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="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 H=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:n}=e;return r?p.createElement(n||"li",{...s,...t},r):p.createElement(n||"li",{...s,...t,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(H,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),D=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:n,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:n,className:"h-8 w-14"});const u=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return p.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:u}})};d.registerChaiBlock(D,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.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:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const U=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:n,width:i}=e;return y.isEmpty(l)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):p.createElement("img",{...t,...s,src:l,alt:r,height:n,width:i})};d.registerChaiBlock(U,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.u({title:"Alt",default:""}),width:o.u({title:"Width",default:""}),height:o.u({title:"Height",default:""})}});const q=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let n=null;return!r&&l&&(n=a.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:a.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),p.createElement("div",{...s,...t,droppable:"yes"},r||n)};d.registerChaiBlock(q,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:o.S({default:""}),emptyStyles:o.S({default:""})},canAcceptBlock:()=>!0});const j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,F=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},O=p.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:n}=e,i=y.get(n,"autoPlay",!1),c=y.get(n,"controls",!1),u=i||y.get(n,"muted",!0),m=y.get(n,"loop",!1);if(y.isEmpty(r))return a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=F(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${n?1:0}`),v.push(`mute=${u?1:0}&muted=${u?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=p.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=p.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:u,autoPlay:l?!1:i,loop:m});return a.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?a.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(O,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:o.b({title:"Controls",properties:{autoPlay:o.r({title:"Autoplay",default:!0}),controls:o.r({title:"Show controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const z=p.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?a.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,p.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock(z,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",props:{styles:o.S({default:""}),content:o.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const $=e=>{const{blockProps:t,styles:l}=e;return p.createElement("hr",{...l,...t})};d.registerChaiBlock($,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const V=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{className:"inline-block",...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(V,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const G=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return a.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(G,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),a=require("./jsx-runtime-Z_BpKhVy.cjs"),w=require("react"),o=require("./controls-KK2oLIa8.cjs"),d=require("@chaibuilder/runtime"),b=require("./empty-slot-nzYOgZuS.cjs"),h=require("@radix-ui/react-icons"),f=require("./Functions-N3yhPYKY.cjs"),E=require("./html-to-json-Xhu27KFD.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("tailwind-merge");require("himalaya");require("./STRINGS-gPz7CUOk.cjs");function R(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const s=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(t,l,s.get?s:{enumerable:!0,get:()=>e[l]})}}return t.default=e,Object.freeze(t)}const u=R(w),T=u.memo(e=>{const{blockProps:t,inBuilder:l,backgroundImage:s,children:r,tag:n="div",styles:i}=e;let c=r;r||(c=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},styles:{},inBuilder:l}));let p={};return s&&(p={backgroundImage:`url(${s})`}),u.createElement(n,{...t,...i,style:p},c)});d.registerChaiBlock(T,{type:"Box",label:"Box",category:"core",group:"basic",props:{styles:o.S({default:""}),tag:o.s({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:o.o({title:"Background Image"})},canAcceptBlock:()=>!0});const C=u.memo(e=>{const{blockProps:t,styles:l}=e;return u.createElement("div",{...t,...l})});d.registerChaiBlock(C,{type:"EmptyBox",label:"Empty Box",category:"core",group:"basic",props:{styles:o.S({default:""})},canAcceptBlock:()=>!1});const L=e=>{const{blockProps:t,styles:l,content:s,level:r="h1",children:n=null}=e;return n?u.createElement(r,{...l,...t},n):u.createElement(r,{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(L,{type:"Heading",label:"Heading",category:"core",icon:h.HeadingIcon,group:"typography",props:{level:o.s({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:o.S({default:"text-3xl"}),content:o.g({title:"Content",default:"Heading goes here"})},canAcceptBlock:e=>e==="Span"||e==="Text"});const _=e=>{const{blockProps:t,styles:l,content:s}=e;return y.isNull(e.children)?u.createElement("p",{...l,...t,dangerouslySetInnerHTML:{__html:s}}):u.createElement("p",{...l,...t},e.children)};d.registerChaiBlock(_,{type:"Paragraph",label:"Paragraph",category:"core",icon:h.TextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.g({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:e=>e==="Span"||e==="Link"});const P=e=>{const{blockProps:t,styles:l,content:s,children:r=null,tag:n}=e;return r?u.createElement("span",{...l,...t},r):u.createElement(n||"span",{...l,...t,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(P,{type:"Span",label:"Span",category:"core",group:"typography",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"Enter your content"})},canAcceptBlock:()=>!0});const A=e=>{const{blockProps:t,content:l,styles:s}=e;return a.jsxRuntimeExports.jsx("div",{className:"max-w-full",children:a.jsxRuntimeExports.jsx("div",{...t,...s,dangerouslySetInnerHTML:{__html:l}})})};d.registerChaiBlock(A,{type:"RichText",label:"Rich Text",category:"core",icon:h.CursorTextIcon,group:"typography",props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>"})}});const M=e=>{const{blockProps:t,iconSize:l,icon:s,content:r,iconPos:n,styles:i,children:c}=e,p=s,m=c||a.jsxRuntimeExports.jsxs(a.jsxRuntimeExports.Fragment,{children:[a.jsxRuntimeExports.jsx("span",{children:r}),p&&a.jsxRuntimeExports.jsx("div",{style:{width:l+"px"},className:n+" "+(n==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:p}})]});return u.createElement("button",{...t,...i,type:"button"},m)};d.registerChaiBlock(M,{type:"Button",label:"Button",category:"core",icon:h.ButtonIcon,group:"basic",props:{content:o.u({title:"Label",default:"Button",multiLingual:!0}),styles:o.S({default:"text-white bg-primary px-4 py-2 rounded-global flex items-center"}),icon:o.T({title:"Icon",default:""}),iconSize:o.c({title:"Icon Size",default:24}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const N=e=>{const{blockProps:t,link:l,children:s,styles:r,inBuilder:n,content:i}=e;return!s&&y.isEmpty(r==null?void 0:r.className)&&y.isEmpty(i)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,inBuilder:n}):n?s?a.jsxRuntimeExports.jsx("span",{"data-simulate":"a",...t,...r,children:s}):u.createElement("span",{...t,...r,dangerouslySetInnerHTML:{__html:i},"data-simulate":"a"}):s?a.jsxRuntimeExports.jsx("a",{href:l.href||"#/",target:l.target,...t,...r,children:s}):u.createElement("a",{...t,...r,href:l.href||"#",target:l.target||"_self",dangerouslySetInnerHTML:{__html:i}})};d.registerChaiBlock(N,{type:"Link",label:"Link",category:"core",icon:h.Link1Icon,group:"basic",props:{styles:o.S({default:""}),content:o.u({title:"Content",default:""}),link:o.q({title:"Link",default:{type:"page",target:"_self",href:""}})},canAcceptBlock:()=>!0});const H=e=>{const{blockProps:t,children:l,listType:s,styles:r,tag:n,inBuilder:i}=e,c=f.cn(y.get(r,"className",""),s);return!l&&y.isEmpty(r==null?void 0:r.className)?a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:i,blockProps:t,text:"LIST ITEM"}):u.createElement(n||(s==="list-decimal"?"ol":"ul"),{...t,...r,className:c},l)};d.registerChaiBlock(H,{type:"List",label:"List",icon:h.RowsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),listType:o.s({title:"List type",default:"list-disc",options:[{value:"list-none",title:"None"},{value:"list-disc",title:"Disc"},{value:"list-decimal",title:"Number"}]})},canAcceptBlock:e=>e==="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 D=e=>{const{blockProps:t,content:l,styles:s,children:r,tag:n}=e;return r?u.createElement(n||"li",{...s,...t},r):u.createElement(n||"li",{...s,...t,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(D,{type:"ListItem",label:"List Item",icon:h.ColumnsIcon,category:"core",group:"basic",props:{styles:o.S({default:""}),content:o.g({title:"Content",default:"List item"})},canAcceptBlock:()=>!0,canBeNested:e=>e==="List"});const k=(e,...t)=>({...e,className:f.cn(e.className,...t)}),U=e=>{const{blockProps:t,icon:l,styles:s,width:r,inBuilder:n,height:i}=e,c=k(s,f.cn(r?`w-[${r}px]`:"",i?`h-[${i}px]`:""));if(y.isEmpty(l))return a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"",inBuilder:n,className:"h-8 w-14"});const p=l.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return u.createElement("span",{...t,...c,dangerouslySetInnerHTML:{__html:p}})};d.registerChaiBlock(U,{type:"Icon",label:"Icon",category:"core",icon:h.SketchLogoIcon,group:"media",props:{styles:o.S({default:"text-black"}),icon:o.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:o.c({title:"Width",default:""}),height:o.c({title:"Height",default:""})}});const q=e=>{const{blockProps:t,image:l,styles:s,alt:r,height:n,width:i}=e;return y.isEmpty(l)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"IMAGE URL",className:"h-36"}):u.createElement("img",{...t,...s,src:l,alt:r,height:n,width:i})};d.registerChaiBlock(q,{type:"Image",label:"Image",category:"core",icon:h.ImageIcon,group:"media",props:{styles:o.S({default:""}),image:o.o({title:"Image",default:"https://fakeimg.pl/400x200?text=Choose&font=bebas"}),alt:o.u({title:"Alt",default:""}),width:o.u({title:"Width",default:""}),height:o.u({title:"Height",default:""})}});const F=e=>{var i;const{blockProps:t,inBuilder:l,styles:s,children:r}=e;let n=null;return!r&&l&&(n=a.jsxRuntimeExports.jsx("div",{className:f.cn("flex flex-col items-center justify-center",(i=e.emptyStyles)==null?void 0:i.className),children:a.jsxRuntimeExports.jsx("div",{className:"h-full w-full rounded-md border-4 border-dashed",children:a.jsxRuntimeExports.jsxs("p",{className:"truncate p-1 text-left text-xs text-gray-400",children:["Slot: ",e.name]})})})),u.createElement("div",{...s,...t,droppable:"yes"},r||n)};d.registerChaiBlock(F,{type:"Slot",label:"Slot",group:"basic",category:"core",hidden:!0,props:{styles:o.S({default:""}),emptyStyles:o.S({default:""})},canAcceptBlock:()=>!0});const j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,S=/^(https?:\/\/)?(www\.)?player.vimeo\.com/,I=/^(https?:\/\/)?(www\.)?dailymotion\.com\/(video|embed\/video)\/([a-zA-Z0-9_-]+)/,O=e=>{if(j.test(e)){const t=e.match(j);return t?`https://www.youtube.com/embed/${t[4]}`:e}if(S.test(e)){const t=e.match(S);return t?`https://player.vimeo.com/video/${t[3]}`:e}if(I.test(e)){const t=e.match(I);return t?`https://www.dailymotion.com/embed/video/${t[4]}`:e}return null},z=u.memo(e=>{const{blockProps:t,inBuilder:l,styles:s,url:r,controls:n}=e,i=y.get(n,"autoPlay",!1),c=y.get(n,"controls",!1),p=i||y.get(n,"muted",!0),m=y.get(n,"loop",!1);if(y.isEmpty(r))return a.jsxRuntimeExports.jsx(b.EmptySlot,{inBuilder:l,blockProps:t,text:"VIDEO URL",className:"h-36"});let x=O(r),g=null;if(x){if(!y.isEmpty(x)){const v=[];v.push(`autoplay=${i?1:0}`),v.push(`controls=${n?1:0}`),v.push(`mute=${p?1:0}&muted=${p?1:0}`),v.push(`loop=${m?1:0}`),x=`${x}?${v.join("&")}`}g=u.createElement("iframe",{...t,className:"absolute inset-0 w-full h-full",src:x,allow:l?"":"autoplay *; fullscreen *",allowFullScreen:!0,frameBorder:0})}else g=u.createElement("video",{...t,className:"absolute inset-0 w-full h-full",src:r,controls:c,muted:p,autoPlay:l?!1:i,loop:m});return a.jsxRuntimeExports.jsx("div",{...y.pick(s,["className"]),children:a.jsxRuntimeExports.jsxs("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[l?a.jsxRuntimeExports.jsx("div",{...t,...y.omit(s,["className"]),className:"absolute inset-0 z-20 h-full w-full"}):null,g]})})});d.registerChaiBlock(z,{type:"Video",label:"Video",category:"core",icon:h.VideoIcon,group:"media",props:{styles:o.S({default:""}),url:o.u({title:"Video URL",default:"https://www.youtube.com/watch?v=9xwazD5SyVg&ab_channel=MaximilianMustermann"}),controls:o.b({title:"Controls",properties:{autoPlay:o.r({title:"Autoplay",default:!0}),controls:o.r({title:"Show controls",default:!1}),loop:o.r({title:"Loop",default:!1}),muted:o.r({title:"Muted",default:!0})}})}});const $=u.memo(e=>{const{blockProps:t,styles:l,content:s,inBuilder:r}=e;return a.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r?a.jsxRuntimeExports.jsx("div",{...t,...l,className:"absolute z-20 h-full w-full"}):null,u.createElement("div",{...l,dangerouslySetInnerHTML:{__html:s}})]})});d.registerChaiBlock($,{type:"CustomHTML",label:"Custom HTML",category:"core",icon:h.CodeIcon,group:"advanced",props:{styles:o.S({default:""}),content:o.g({title:"HTML Content",default:"<div><p>HTML Snippet goes here...</p></div>",placeholder:"Enter custom HTML code here"})}});const V=e=>{const{blockProps:t,styles:l}=e;return u.createElement("hr",{...l,...t})};d.registerChaiBlock(V,{type:"Divider",label:"Divider",category:"core",icon:h.DividerHorizontalIcon,group:"basic",props:{styles:o.S({default:"bg-gray-900 h-0.5 py-2 my-1"})}});const G=e=>e.inBuilder?a.jsxRuntimeExports.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`;d.registerChaiBlock(G,{type:"Text",label:"Text",hidden:!0,category:"core",group:"typography",icon:h.SpaceBetweenVerticallyIcon,props:{content:o.g({title:"Content",defaultValue:""})}});const W=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-group");return a.jsxRuntimeExports.jsx("div",{...t,...s,children:e})};d.registerChaiBlock(W,{type:"AccordionGroup",label:"Accordion Group",category:"core",group:"advanced",props:{styles:o.S({default:""})},blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`<div class="hs-accordion-group">
2
2
  <div class="hs-accordion active" id="hs-unstyled-heading-one">
3
3
  <button class="hs-accordion-toggle" aria-controls="hs-unstyled-collapse-one">
4
4
  Accordion #1
@@ -16,7 +16,7 @@
16
16
  It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element.
17
17
  </div>
18
18
  </div>
19
- </div>`.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))},canAcceptBlock:e=>e==="Accordion"});const W=({children:e,blockProps:t,styles:l,blockState:s})=>{const r=k(l,"hs-accordion "+(s&&s!=null&&s.active?"active":""));return a.jsxRuntimeExports.jsx("div",{...t,...r,children:e})};d.registerChaiBlock(W,{type:"Accordion",label:"Accordion",category:"core",group:"advanced",props:{styles:o.S({default:""})},customStylingStates:{"hs-accordion-active":"Accordion Active"},blockState:{active:o.r({default:!1,title:"Show content in canvas"})},getBlockStateFrom:e=>[e._id],blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`
19
+ </div>`.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))},canAcceptBlock:e=>e==="Accordion"});const Y=({children:e,blockProps:t,styles:l,blockState:s})=>{const r=k(l,"hs-accordion "+(s&&s!=null&&s.active?"active":""));return a.jsxRuntimeExports.jsx("div",{...t,...r,children:e})};d.registerChaiBlock(Y,{type:"Accordion",label:"Accordion",category:"core",group:"advanced",props:{styles:o.S({default:""})},customStylingStates:{"hs-accordion-active":"Accordion Active"},blockState:{active:o.r({default:!1,title:"Show content in canvas"})},getBlockStateFrom:e=>[e._id],blocks:()=>{const e="dnd-accordion-"+f.generateUUID();return E.getBlocksFromHTML(`
20
20
  <div class="hs-accordion active" id="hs-unstyled-heading-one">
21
21
  <button class="hs-accordion-toggle" aria-controls="hs-unstyled-collapse-one">
22
22
  Accordion #1
@@ -25,9 +25,9 @@
25
25
  It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element.
26
26
  </div>
27
27
  </div>
28
- `.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))}});const Y=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-toggle");return a.jsxRuntimeExports.jsx("button",{...s,...t,children:e})};d.registerChaiBlock(Y,{type:"AccordionToggle",label:"Accordion Toggle",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:"hs-accordion-active:text-blue-600 dark:hs-accordion-active:text-blue-500 inline-flex w-full items-center gap-x-3 rounded-lg px-6 py-3 text-start text-sm font-semibold text-gray-800 hover:text-gray-500 disabled:pointer-events-none disabled:opacity-50 dark:text-neutral-200 dark:hover:text-neutral-400"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const X=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=k(l,"hs-accordion-content",r&&s?s!=null&&s.active?"!block !opacity-100":"!hidden !opacity-0":"");return a.jsxRuntimeExports.jsx("div",{...n,...t,children:e})};d.registerChaiBlock(X,{type:"AccordionContent",label:"Accordion Content",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:"w-full overflow-hidden transition-height hidden duration-300"})},getBlockStateFrom:e=>[e._parent],canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const Z=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=r&&(s!=null&&s.active)?" open":"",i=k(l,"hs-collapse-toggle",n);return a.jsxRuntimeExports.jsx("button",{type:"button",...i,...t,children:e})};d.registerChaiBlock(Z,{type:"CollapseToggle",label:"Collapse Toggle",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:""})},canAcceptBlock:()=>!0,customStylingStates:{"hs-collapse-open":"Collapse Open"},getBlockStateFrom:(e,t)=>{const l=y.get(e,"styles_attrs.data-hs-collapse","").replace("#","");if(!l)return[];const s=y.find(t,r=>y.get(r,"styles_attrs.id")===l);return s?[s==null?void 0:s._id]:[]}});const J=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=r?{"!block !opacity-100 open":s==null?void 0:s.active,"":!(s!=null&&s.active)}:{},i=Object.keys(n).filter(u=>n[u]).join(" "),c=k(l,"hs-collapse",i);return a.jsxRuntimeExports.jsx("div",{...c,...t,children:e})};d.registerChaiBlock(J,{type:"Collapse",label:"Collapse",category:"core",group:"advanced",props:{styles:o.S({default:"transition-opacity transition-margin duration hs-collapse-open:opacity-100 opacity-0 w-56 hidden z-10 mt-2 min-w-60 bg-white"})},canAcceptBlock:()=>!0,blockState:{active:o.r({default:!1,title:"Show collapse in canvas"})},getBlockStateFrom:e=>[e._id],blocks:()=>E.getBlocksFromHTML(`<button type="button" class="hs-collapse-toggle" id="hs-unstyled-collapse" data-hs-collapse="#hs-unstyled-collapse-content">
28
+ `.replace(/hs-unstyled-heading/g,e).replace(/hs-unstyled-collapse/g,e))}});const X=({children:e,blockProps:t,styles:l})=>{const s=k(l,"hs-accordion-toggle");return a.jsxRuntimeExports.jsx("button",{...s,...t,children:e})};d.registerChaiBlock(X,{type:"AccordionToggle",label:"Accordion Toggle",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:"hs-accordion-active:text-blue-600 dark:hs-accordion-active:text-blue-500 inline-flex w-full items-center gap-x-3 rounded-lg px-6 py-3 text-start text-sm font-semibold text-gray-800 hover:text-gray-500 disabled:pointer-events-none disabled:opacity-50 dark:text-neutral-200 dark:hover:text-neutral-400"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const Z=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=k(l,"hs-accordion-content",r&&s?s!=null&&s.active?"!block !opacity-100":"!hidden !opacity-0":"");return a.jsxRuntimeExports.jsx("div",{...n,...t,children:e})};d.registerChaiBlock(Z,{type:"AccordionContent",label:"Accordion Content",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:"w-full overflow-hidden transition-height hidden duration-300"})},getBlockStateFrom:e=>[e._parent],canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const J=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=r&&(s!=null&&s.active)?" open":"",i=k(l,"hs-collapse-toggle",n);return a.jsxRuntimeExports.jsx("button",{type:"button",...i,...t,children:e})};d.registerChaiBlock(J,{type:"CollapseToggle",label:"Collapse Toggle",category:"core",group:"advanced",hidden:!0,props:{styles:o.S({default:""})},canAcceptBlock:()=>!0,customStylingStates:{"hs-collapse-open":"Collapse Open"},getBlockStateFrom:(e,t)=>{const l=y.get(e,"styles_attrs.data-hs-collapse","").replace("#","");if(!l)return[];const s=y.find(t,r=>y.get(r,"styles_attrs.id")===l);return s?[s==null?void 0:s._id]:[]}});const K=({children:e,blockProps:t,styles:l,blockState:s,inBuilder:r})=>{const n=r?{"!block !opacity-100 open":s==null?void 0:s.active,"":!(s!=null&&s.active)}:{},i=Object.keys(n).filter(p=>n[p]).join(" "),c=k(l,"hs-collapse",i);return a.jsxRuntimeExports.jsx("div",{...c,...t,children:e})};d.registerChaiBlock(K,{type:"Collapse",label:"Collapse",category:"core",group:"advanced",props:{styles:o.S({default:"transition-opacity transition-margin duration hs-collapse-open:opacity-100 opacity-0 w-56 hidden z-10 mt-2 min-w-60 bg-white"})},canAcceptBlock:()=>!0,blockState:{active:o.r({default:!1,title:"Show collapse in canvas"})},getBlockStateFrom:e=>[e._id],blocks:()=>E.getBlocksFromHTML(`<button type="button" class="hs-collapse-toggle" id="hs-unstyled-collapse" data-hs-collapse="#hs-unstyled-collapse-content">
29
29
  Collapse
30
30
  </button>
31
31
  <div id="hs-unstyled-collapse-content" class="hs-collapse hidden w-full overflow-hidden transition-[height] duration-300" aria-labelledby="hs-unstyled-collapse">
32
32
  This is a collapse body. It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions.
33
- </div>`.replace(/hs-unstyled-collapse/g,`dnd-collapse-${f.generateUUID()}`))});const K=e=>{const{blockProps:t,backgroundImage:l,children:s,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),p.createElement("div",{...t,...r,style:n},s)};d.registerChaiBlock(K,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:o.S({default:"font-body antialiased"}),backgroundImage:o.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const Q=e=>{const{blockProps:t,styles:l}=e;return p.createElement("br",{...t,...l})};d.registerChaiBlock(Q,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:h.SpaceBetweenVerticallyIcon,props:{styles:o.S({default:""})}});const B=e=>{const t=(n,i)=>({_id:f.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),l=n=>{const i=f.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,t(i,"1"),t(i,"2"),t(i,"3")]},s=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...l(i)]},r=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...l(i),...l(i)]};if(e==="Table"){const n=f.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(n),...r(n)]}return e==="TableRow"?l():e==="TableHead"?s():e==="TableBody"?r():[]},ee=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("table",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(ee,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:h.TableIcon,props:{styles:o.S({default:""})},blocks:B("Table")});const te=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("thead",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(te,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:h.BorderTopIcon,props:{styles:o.S({default:""})},blocks:B("TableHead")});const le=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("tbody",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(le,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:h.BorderAllIcon,props:{styles:o.S({default:""})},blocks:B("TableBody")});const oe=e=>{const{blockProps:t,children:l,styles:s}=e;return l?p.createElement("tr",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(oe,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:h.ViewHorizontalIcon,props:{styles:o.S({default:"w-full"})},blocks:B("TableRow")});const se=e=>{const{blockProps:t,children:l,content:s,styles:r}=e;return!l&&y.isEmpty(s)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t}):l?p.createElement("td",{...t,...r},l):p.createElement("td",{...t,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(se,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:h.DragHandleHorizontalIcon,props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"Table cell item"})}});const re=e=>{const{blockProps:t,errorMessage:l,name:s,_type:r,successMessage:n,action:i,styles:c,children:u}=e;let m=u;u||(m=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const x={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...x,"data-error":l,"data-success":n,method:"post",action:i,...t,...c,children:[a.jsxRuntimeExports.jsx("div",{...g}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};d.registerChaiBlock(re,{type:"Form",label:"Form",category:"core",icon:h.GroupIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),action:o.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:o.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:o.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const ne=e=>{const{blockProps:t,content:l,styles:s,children:r}=e,n={...s,...t};return r?p.createElement("label",n,r):p.createElement("label",{...n,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(ne,{type:"Label",label:"Label",category:"core",icon:h.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),content:o.u({title:"Content",default:"Label"})}});const ae=e=>{const{blockProps:t,inBuilder:l,label:s,placeholder:r,styles:n,inputStyles:i,icon:c,iconPos:u}=e,m=f.generateUUID(),x={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:m,...x,...i,...n,...t||{},type:l?"button":"submit",placeholder:r,children:[s,c&&a.jsxRuntimeExports.jsx("span",{className:u,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(ae,{type:"FormButton",label:"Submit Button",category:"core",icon:h.ButtonIcon,group:"form",hidden:!0,props:{label:o.u({title:"Label",default:"Submit"}),styles:o.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:o.T({title:"Icon",default:""}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ie=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,required:i,checked:c,showLabel:u=!0}=e,m=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"checkbox",required:i,name:l})};d.registerChaiBlock(ie,{type:"Checkbox",label:"Checkbox",category:"core",icon:h.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"checkbox"}),styles:o.S({default:"flex items-center gap-x-2"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const ce=e=>{const{blockProps:t,label:l,placeholder:s,styles:r,inputStyles:n,showLabel:i,required:c,inputType:u="text",inBuilder:m,fieldName:x}=e,g=f.generateUUID();return!i||u==="submit"?(u==="submit"&&(t.value=l),a.jsxRuntimeExports.jsx("input",{id:g,name:x,readOnly:m,...t,...n,...r,type:u,placeholder:s,required:c})):a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),a.jsxRuntimeExports.jsx("input",{name:x,readOnly:m,...n,id:g,type:u,placeholder:s,required:c})]})};d.registerChaiBlock(ce,{type:"Input",label:"Input",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"input"}),inputType:o.s({title:"Type",options:y.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:o.u({title:"Value",default:""}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1})}});const de=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,checked:i,required:c,showLabel:u=!0}=e,m=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"radio",required:c,defaultChecked:i}),s&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"radio",required:c,checked:i,name:l})};d.registerChaiBlock(de,{type:"Radio",label:"Radio",category:"core",icon:h.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:o.S({default:"flex items-center w-max gap-x-2"}),fieldName:o.u({title:"Field Name",default:"radio"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const ue=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,required:c,showLabel:u,_multiple:m=!1}=e,x=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...n,children:[u&&a.jsxRuntimeExports.jsx("label",{htmlFor:x,children:s}),a.jsxRuntimeExports.jsxs("select",{...i,id:x,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:x,...n,...t,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(ue,{type:"Select",label:"Select",category:"core",icon:h.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"select"}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1}),_multiple:o.r({title:"Multiple Choice",default:!1}),options:o.h({title:"Options",itemProperties:{label:o.u({title:"Label",default:""}),value:o.u({title:"Value",default:""})}})}});const pe=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,_rows:c,showLabel:u}=e,m=f.generateUUID();return u?a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[u&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),a.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:m,placeholder:r,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:m,name:l,...t,...i,...n,placeholder:r,rows:c})};d.registerChaiBlock(pe,{type:"TextArea",label:"TextArea",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"textarea"}),showLabel:o.r({title:"Show label",default:!0}),styles:o.S({default:""}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),_rows:o.c({title:"Rows",default:3})}});const me=y.noop;exports.loadWebBlocks=me;
33
+ </div>`.replace(/hs-unstyled-collapse/g,`dnd-collapse-${f.generateUUID()}`))});const Q=e=>{const{blockProps:t,backgroundImage:l,children:s,styles:r}=e;let n={};return l&&(n={backgroundImage:`url(${l})`}),u.createElement("div",{...t,...r,style:n},s)};d.registerChaiBlock(Q,{type:"Body",label:"Body",category:"core",group:"basic",hidden:!0,props:{styles:o.S({default:"font-body antialiased"}),backgroundImage:o.o({title:"Background Image"})},canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1});const ee=e=>{const{blockProps:t,styles:l}=e;return u.createElement("br",{...t,...l})};d.registerChaiBlock(ee,{type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,icon:h.SpaceBetweenVerticallyIcon,props:{styles:o.S({default:""})}});const B=e=>{const t=(n,i)=>({_id:f.generateUUID(),_parent:n,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+i}`}),l=n=>{const i=f.generateUUID(),c={_type:"TableRow",_id:i,styles:"#styles:,border-b"};return n&&(c._parent=n),[c,t(i,"1"),t(i,"2"),t(i,"3")]},s=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableHead",styles:"#styles:,font-medium"};return n&&(c._parent=n),[c,...l(i)]},r=n=>{const i=f.generateUUID(),c={_id:i,_type:"TableBody",styles:"#styles:,"};return n&&(c._parent=n),[c,...l(i),...l(i)]};if(e==="Table"){const n=f.generateUUID();return[{_id:n,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...s(n),...r(n)]}return e==="TableRow"?l():e==="TableHead"?s():e==="TableBody"?r():[]},te=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("table",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE HEAD / BODY"})};d.registerChaiBlock(te,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:h.TableIcon,props:{styles:o.S({default:""})},blocks:B("Table")});const le=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("thead",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(le,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:h.BorderTopIcon,props:{styles:o.S({default:""})},blocks:B("TableHead")});const oe=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tbody",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE ROW"})};d.registerChaiBlock(oe,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:h.BorderAllIcon,props:{styles:o.S({default:""})},blocks:B("TableBody")});const se=e=>{const{blockProps:t,children:l,styles:s}=e;return l?u.createElement("tr",{...t,...s},l):a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t,text:"TABLE CELL"})};d.registerChaiBlock(se,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:h.ViewHorizontalIcon,props:{styles:o.S({default:"w-full"})},blocks:B("TableRow")});const re=e=>{const{blockProps:t,children:l,content:s,styles:r}=e;return!l&&y.isEmpty(s)?a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:t}):l?u.createElement("td",{...t,...r},l):u.createElement("td",{...t,...r,dangerouslySetInnerHTML:{__html:s}})};d.registerChaiBlock(re,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:h.DragHandleHorizontalIcon,props:{styles:o.S({default:""}),content:o.m({title:"Content",default:"Table cell item"})}});const ne=e=>{const{blockProps:t,errorMessage:l,name:s,_type:r,successMessage:n,action:i,styles:c,children:p}=e;let m=p;p||(m=a.jsxRuntimeExports.jsx(b.EmptySlot,{blockProps:{},text:"FORM FIELDS"}));const x={"x-data":"useForm","x-on:submit.prevent":"post"},g={"x-html":"formResponse",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return a.jsxRuntimeExports.jsxs("form",{...x,"data-error":l,"data-success":n,method:"post",action:i,...t,...c,children:[a.jsxRuntimeExports.jsx("div",{...g}),a.jsxRuntimeExports.jsx("input",{name:"formname",type:"hidden",value:s||r}),m]})};d.registerChaiBlock(ne,{type:"Form",label:"Form",category:"core",icon:h.GroupIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),action:o.u({title:"Submit URL",default:"/api/form/submit"}),errorMessage:o.m({title:"Error Message",default:"Something went wrong. Please try again"}),successMessage:o.m({title:"Success Message",default:"Thank you for your submission."})},canAcceptBlock:()=>!0});const ae=e=>{const{blockProps:t,content:l,styles:s,children:r}=e,n={...s,...t};return r?u.createElement("label",n,r):u.createElement("label",{...n,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(ae,{type:"Label",label:"Label",category:"core",icon:h.LetterCaseToggleIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),content:o.u({title:"Content",default:"Label"})}});const ie=e=>{const{blockProps:t,inBuilder:l,label:s,placeholder:r,styles:n,inputStyles:i,icon:c,iconPos:p}=e,m=f.generateUUID(),x={"x-bind:disabled":"formLoading"};return a.jsxRuntimeExports.jsxs("button",{id:m,...x,...i,...n,...t||{},type:l?"button":"submit",placeholder:r,children:[s,c&&a.jsxRuntimeExports.jsx("span",{className:p,dangerouslySetInnerHTML:{__html:c}})]})};d.registerChaiBlock(ie,{type:"FormButton",label:"Submit Button",category:"core",icon:h.ButtonIcon,group:"form",hidden:!0,props:{label:o.u({title:"Label",default:"Submit"}),styles:o.S({default:"text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"}),icon:o.T({title:"Icon",default:""}),iconPos:o.s({title:"Icon Position",default:"order-last",options:[{title:"Start",value:"order-first"},{title:"End",value:"order-last"}]})}});const ce=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,required:i,checked:c,showLabel:p=!0}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"checkbox",required:i,defaultChecked:c}),s&&s!=="Label"&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"checkbox",required:i,name:l})};d.registerChaiBlock(ce,{type:"Checkbox",label:"Checkbox",category:"core",icon:h.CheckboxIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"checkbox"}),styles:o.S({default:"flex items-center gap-x-2"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const de=e=>{const{blockProps:t,label:l,placeholder:s,styles:r,inputStyles:n,showLabel:i,required:c,inputType:p="text",inBuilder:m,fieldName:x}=e,g=f.generateUUID();return!i||p==="submit"?(p==="submit"&&(t.value=l),a.jsxRuntimeExports.jsx("input",{id:g,name:x,readOnly:m,...t,...n,...r,type:p,placeholder:s,required:c})):a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[i&&a.jsxRuntimeExports.jsx("label",{htmlFor:g,children:l}),a.jsxRuntimeExports.jsx("input",{name:x,readOnly:m,...n,id:g,type:p,placeholder:s,required:c})]})};d.registerChaiBlock(de,{type:"Input",label:"Input",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"input"}),inputType:o.s({title:"Type",options:y.map(["text","email","password","number","tel","file","hidden","range","submit","color","date","time"],e=>({value:e,title:e})),default:"text"}),value:o.u({title:"Value",default:""}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1})}});const ue=e=>{const{blockProps:t,fieldName:l,label:s,styles:r,inputStyles:n,checked:i,required:c,showLabel:p=!0}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...r,...t,children:[a.jsxRuntimeExports.jsx("input",{...n,name:l,id:m,type:"radio",required:c,defaultChecked:i}),s&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s})]}):a.jsxRuntimeExports.jsx("input",{id:m,...t,...n,...r,type:"radio",required:c,checked:i,name:l})};d.registerChaiBlock(ue,{type:"Radio",label:"Radio",category:"core",icon:h.RadiobuttonIcon,group:"form",hidden:!0,props:{styles:o.S({default:"flex items-center w-max gap-x-2"}),fieldName:o.u({title:"Field Name",default:"radio"}),label:o.u({title:"Label",default:"Label"}),checked:o.r({title:"Checked",default:!1}),required:o.r({title:"Required",default:!1})}});const pe=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,required:c,showLabel:p,_multiple:m=!1}=e,x=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:x,children:s}),a.jsxRuntimeExports.jsxs("select",{...i,id:x,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})]}):a.jsxRuntimeExports.jsxs("select",{id:x,...n,...t,placeholder:r,required:c,multiple:m,name:l,children:[a.jsxRuntimeExports.jsx("option",{value:"",disabled:!0,selected:!0,hidden:!0,children:r}),y.map(e.options,g=>a.jsxRuntimeExports.jsx("option",{selected:y.get(g,"selected",!1),value:g.value,dangerouslySetInnerHTML:{__html:g.label}},g.value))]})};d.registerChaiBlock(pe,{type:"Select",label:"Select",category:"core",icon:h.DropdownMenuIcon,group:"form",hidden:!0,props:{styles:o.S({default:""}),fieldName:o.u({title:"Field Name",default:"select"}),showLabel:o.r({title:"Show label",default:!0}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),required:o.r({title:"Required",default:!1}),_multiple:o.r({title:"Multiple Choice",default:!1}),options:o.h({title:"Options",itemProperties:{label:o.u({title:"Label",default:""}),value:o.u({title:"Value",default:""})}})}});const me=e=>{const{blockProps:t,fieldName:l,label:s,placeholder:r,styles:n,inputStyles:i,_rows:c,showLabel:p}=e,m=f.generateUUID();return p?a.jsxRuntimeExports.jsxs("div",{...n,...t,children:[p&&a.jsxRuntimeExports.jsx("label",{htmlFor:m,children:s}),a.jsxRuntimeExports.jsx("textarea",{name:l,...i,id:m,placeholder:r,rows:c})]}):a.jsxRuntimeExports.jsx("textarea",{id:m,name:l,...t,...i,...n,placeholder:r,rows:c})};d.registerChaiBlock(me,{type:"TextArea",label:"TextArea",category:"core",icon:h.InputIcon,group:"form",hidden:!0,props:{fieldName:o.u({title:"Field Name",default:"textarea"}),showLabel:o.r({title:"Show label",default:!0}),styles:o.S({default:""}),inputStyles:o.S({default:"w-full p-1"}),label:o.u({title:"Label",default:"Label"}),placeholder:o.u({title:"Placeholder",default:"Placeholder"}),_rows:o.c({title:"Rows",default:3})}});const he=y.noop;exports.loadWebBlocks=he;