@chaibuilder/sdk 4.0.0-beta.32 → 4.0.0-beta.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/{2SSKDMRQ-DfXKDvXk.cjs → 2SSKDMRQ-BM-tJzJS.cjs} +1 -1
  2. package/dist/{2SSKDMRQ-pPung-JB.js → 2SSKDMRQ-hkjhJNfh.js} +5 -5
  3. package/dist/{AP7HFJJL-PvPBwV6T.cjs → AP7HFJJL-MEqeM2Ns.cjs} +1 -1
  4. package/dist/{AP7HFJJL-CEJuc_Ox.js → AP7HFJJL-XRxLnRog.js} +1 -1
  5. package/dist/{IconPicker-BJHUCDn4.cjs → IconPicker-Bl4iY4Cu.cjs} +1 -1
  6. package/dist/{IconPicker-D_GRfhwS.js → IconPicker-D5wIkgWK.js} +1 -1
  7. package/dist/{WDYDFRGG-B3FrCE_j.js → WDYDFRGG-8UgG1Mx8.js} +4 -4
  8. package/dist/{WDYDFRGG-BPHlcLi5.cjs → WDYDFRGG-BitFxd1K.cjs} +1 -1
  9. package/dist/{actions-registery-Cy1lqUVI.cjs → actions-registery-Byid-s6S.cjs} +28 -28
  10. package/dist/{actions-registery-Bj-j1k5i.js → actions-registery-CKEzH855.js} +2245 -2067
  11. package/dist/actions.cjs +1 -1
  12. package/dist/actions.js +2 -2
  13. package/dist/{active-in-another-tab-C_Ma7oFU.js → active-in-another-tab-BBrqPDfn.js} +2 -2
  14. package/dist/{active-in-another-tab-WVYf-z5w.cjs → active-in-another-tab-BsdNjSxr.cjs} +1 -1
  15. package/dist/{add-new-language-page-CxW2Vuyr.cjs → add-new-language-page-BJUHnI7Z.cjs} +1 -1
  16. package/dist/{add-new-language-page-DtsBO739.js → add-new-language-page-DvSZenkC.js} +3 -3
  17. package/dist/{add-new-page-BfKt72NF.cjs → add-new-page-BI7qCsmh.cjs} +1 -1
  18. package/dist/add-new-page-Dd16d2mC.js +31 -0
  19. package/dist/{ai-panel-content-dktE9CIO.js → ai-panel-content-CLNgM3Td.js} +5 -5
  20. package/dist/{ai-panel-content-Dfo4jOVB.cjs → ai-panel-content-CcqF0I9F.cjs} +1 -1
  21. package/dist/{ai-panel-default-lang-BbUTXMbm.js → ai-panel-default-lang-BooHb2pz.js} +7 -7
  22. package/dist/{ai-panel-default-lang-GQCtwlPs.cjs → ai-panel-default-lang-XPtfrifL.cjs} +2 -2
  23. package/dist/{ai-panel-other-lang-nCUxwpLX.cjs → ai-panel-other-lang-BwnRUTSF.cjs} +1 -1
  24. package/dist/{ai-panel-other-lang-DIDS-mTi.js → ai-panel-other-lang-CcgIMR3N.js} +13 -13
  25. package/dist/{ai-prompt-input-B2q30bhR.js → ai-prompt-input-AUdUYGNa.js} +13 -13
  26. package/dist/{ai-prompt-input-Dws5BHhQ.cjs → ai-prompt-input-CQ5SJPkx.cjs} +1 -1
  27. package/dist/{ai-translation-prompt-CJVcuWrs.cjs → ai-translation-prompt-BTNGNtbf.cjs} +1 -1
  28. package/dist/{ai-translation-prompt-D87qk3C1.js → ai-translation-prompt-BYUh4Mnb.js} +1 -1
  29. package/dist/apply-binding-Bu5W9YFY.js +940 -0
  30. package/dist/apply-binding-C0xIYKCN.cjs +41 -0
  31. package/dist/{change-password-modal-CVUa60pC.cjs → change-password-modal-CYkUXUa5.cjs} +1 -1
  32. package/dist/{change-password-modal-PahNYs8x.js → change-password-modal-DCd1gdCm.js} +5 -5
  33. package/dist/{code-editor-Cim6jQVF.cjs → code-editor-BC6Z10dU.cjs} +1 -1
  34. package/dist/{code-editor-CWOmKcUc.js → code-editor-DWrVXxeA.js} +1 -1
  35. package/dist/{continue-editing-in-this-client-BYFOU3hH.js → continue-editing-in-this-client-Bdd5Ls6t.js} +2 -2
  36. package/dist/{continue-editing-in-this-client-CW0f2LRk.cjs → continue-editing-in-this-client-D6Wc8hEK.cjs} +1 -1
  37. package/dist/{core-BWQrViOY.cjs → core-czmLeR0h.cjs} +1 -1
  38. package/dist/{core-QlWEXm1d.js → core-nSRy3D7z.js} +16 -15
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.d.ts +14 -2
  41. package/dist/core.js +19 -19
  42. package/dist/{css-import-modal-6bMTRlCg.js → css-import-modal-Cpwll5L-.js} +1 -1
  43. package/dist/{css-import-modal-CXulmaB4.cjs → css-import-modal-FHeYoxo2.cjs} +1 -1
  44. package/dist/default-theme-options-DN-3gIjM.cjs +22 -0
  45. package/dist/{plugin-BSjgGgwo.js → default-theme-options-saBIkWGT.js} +114 -114
  46. package/dist/{delete-page-BDViv7Xm.js → delete-page-DyP68v_N.js} +15 -15
  47. package/dist/delete-page-PQGa6Am5.cjs +1 -0
  48. package/dist/{design-token-usage-D-hrcKz1.cjs → design-token-usage-CoaLw6EJ.cjs} +1 -1
  49. package/dist/{design-token-usage-lf7N_uOk.js → design-token-usage-dR3UlfIC.js} +14 -14
  50. package/dist/{digital-asset-manager-PcYficIX.js → digital-asset-manager-BNj96Pnh.js} +3 -3
  51. package/dist/{digital-asset-manager-CxxhsToc.cjs → digital-asset-manager-Bxkm-jdI.cjs} +1 -1
  52. package/dist/{duplicate-page-DfEA148D.js → duplicate-page-Cg6WnFeY.js} +6 -6
  53. package/dist/{duplicate-page-D2f3HvWX.cjs → duplicate-page-DV_lZ8jF.cjs} +1 -1
  54. package/dist/{dynamic-page-selector-Dz7D1Wdr.cjs → dynamic-page-selector-C8ax7W_D.cjs} +1 -1
  55. package/dist/{dynamic-page-selector-DB__KD2y.js → dynamic-page-selector-DcQiWgiL.js} +12 -12
  56. package/dist/get-chai-builder-theme-C_qofMh_.cjs +1 -0
  57. package/dist/{get-chai-builder-theme-BpuwSLeS.js → get-chai-builder-theme-CyOkIlte.js} +1 -1
  58. package/dist/{image-editor-BdW476J8.cjs → image-editor-C5rYU8Ic.cjs} +1 -1
  59. package/dist/{image-editor-CilPMtAC.js → image-editor-DGp2-ImI.js} +1 -1
  60. package/dist/{index-DsQXiNA_.js → index-94oA-Cgl.js} +3994 -3943
  61. package/dist/index-Bg3Prrc_.cjs +5 -0
  62. package/dist/index-BsloTOgy.cjs +160 -0
  63. package/dist/{index-IQefjAA0.js → index-CDUCqK5V.js} +1912 -1931
  64. package/dist/{json-diff-viewer-BPqY25PU.cjs → json-diff-viewer-CdU-gKRr.cjs} +1 -1
  65. package/dist/{json-diff-viewer-Ci2IbgDn.js → json-diff-viewer-CniMcSHL.js} +34 -34
  66. package/dist/lang-panel-Dg7eZqIm.cjs +1 -0
  67. package/dist/{lang-panel-DlAQr-y9.js → lang-panel-YLNZisL2.js} +13 -13
  68. package/dist/manage-design-tokens-Bct88PT-.js +446 -0
  69. package/dist/manage-design-tokens-CMf-Vk72.cjs +1 -0
  70. package/dist/{manage-design-tokens-modal-9qpcb-EC.js → manage-design-tokens-modal-CeSW9VV_.js} +9 -9
  71. package/dist/manage-design-tokens-modal-YPEBybz3.cjs +1 -0
  72. package/dist/{mark-as-template-DS-tMllK.cjs → mark-as-template-C5rPp_PV.cjs} +1 -1
  73. package/dist/{mark-as-template-DOZL3umP.js → mark-as-template-WJ4kUyZK.js} +7 -7
  74. package/dist/{nested-path-selector-content-CWmPgU-L.cjs → nested-path-selector-content-COErdW8f.cjs} +1 -1
  75. package/dist/{nested-path-selector-content-Be-pbnVl.js → nested-path-selector-content-D0hfMLC6.js} +1 -1
  76. package/dist/{no-language-page-content-C8W0M_Fj.js → no-language-page-content-BLnpbzwT.js} +2 -2
  77. package/dist/{no-language-page-content-DWtEo657.cjs → no-language-page-content-CK_K6fh9.cjs} +1 -1
  78. package/dist/{no-language-page-dialog-FVXkSnfT.cjs → no-language-page-dialog-BI55QXS_.cjs} +1 -1
  79. package/dist/{no-language-page-dialog-cpCZ9vES.js → no-language-page-dialog-gZGw3Uzp.js} +2 -2
  80. package/dist/page-creator-C2ZwuF6M.cjs +1 -0
  81. package/dist/{page-creator-CFtxeW_t.js → page-creator-hHpEaVpS.js} +183 -183
  82. package/dist/{page-lock-BS_ErOIW.cjs → page-lock-BN8BI4J8.cjs} +1 -1
  83. package/dist/{page-lock-Cthbk6Pg.js → page-lock-DMzAREda.js} +2 -2
  84. package/dist/{page-locked-dialog-BWXifuQ8.cjs → page-locked-dialog-B_2Hy4PJ.cjs} +1 -1
  85. package/dist/{page-locked-dialog-D5hmaWqw.js → page-locked-dialog-CZiVFSGf.js} +13 -13
  86. package/dist/page-manager-new-74gQK_vK.js +408 -0
  87. package/dist/page-manager-new-DLVIuTY7.cjs +1 -0
  88. package/dist/{page-manager-search-and-filter-jDoLrCB7.cjs → page-manager-search-and-filter-C6XNDRT7.cjs} +1 -1
  89. package/dist/{page-manager-search-and-filter-iFsFJhn4.js → page-manager-search-and-filter-DYXCod2G.js} +9 -9
  90. package/dist/page-revisions-content-44SecMak.cjs +1 -0
  91. package/dist/{page-revisions-content-C1IGUurW.js → page-revisions-content-BWLkqXrw.js} +40 -40
  92. package/dist/pages.cjs +1 -1
  93. package/dist/pages.d.ts +35 -4
  94. package/dist/pages.js +15 -14
  95. package/dist/{publish-pages-content-BpEoA1T6.js → publish-pages-content-COHFXR-v.js} +68 -75
  96. package/dist/publish-pages-content-msfUAXJy.cjs +1 -0
  97. package/dist/render.cjs +1 -1
  98. package/dist/render.js +5 -5
  99. package/dist/{rte-widget-modal-CC1KcrAT.cjs → rte-widget-modal-ck2hWBPv.cjs} +1 -1
  100. package/dist/{rte-widget-modal-c3T09VeO.js → rte-widget-modal-muaFxwH1.js} +1 -1
  101. package/dist/runtime.cjs +6 -6
  102. package/dist/runtime.d.ts +2 -0
  103. package/dist/runtime.js +36 -35
  104. package/dist/{save-to-lib-BERYhyxq.js → save-to-lib-JBs4ml12.js} +25 -25
  105. package/dist/{save-to-lib-Bk59qO1r.cjs → save-to-lib-NHLFZR6b.cjs} +1 -1
  106. package/dist/sdk.css +1 -1
  107. package/dist/{selected-block-display-C6NxfC0N.js → selected-block-display-0rlYn5jN.js} +20 -20
  108. package/dist/{selected-block-display-vFSCOnw8.cjs → selected-block-display-BhnCoV28.cjs} +1 -1
  109. package/dist/seo-panel-BLTekCWH.cjs +2 -0
  110. package/dist/{seo-panel-COrEJZLA.js → seo-panel-D8QdAKVh.js} +25 -25
  111. package/dist/shared-json-ld-CDYobqPW.cjs +1 -0
  112. package/dist/{shared-json-ld-DnTuCBc3.js → shared-json-ld-DclZXKU6.js} +33 -33
  113. package/dist/{slug-input-CAqkFZBq.js → slug-input-BOaNz0te.js} +1 -1
  114. package/dist/{slug-input-Curnt2n3.cjs → slug-input-D3pjtp5_.cjs} +1 -1
  115. package/dist/supabase-actions.cjs +1 -1
  116. package/dist/supabase-actions.d.ts +6 -0
  117. package/dist/supabase-actions.js +223 -155
  118. package/dist/{take-over-request-6fliSr8w.cjs → take-over-request-CF3ubryV.cjs} +1 -1
  119. package/dist/{take-over-request-DvmM5qTu.js → take-over-request-CbQfdDOW.js} +13 -13
  120. package/dist/{translation-warning-modal-kRcfrPgo.js → translation-warning-modal-Bs5qTh3p.js} +9 -9
  121. package/dist/{translation-warning-modal-B876S5yp.cjs → translation-warning-modal-Bseflnj4.cjs} +1 -1
  122. package/dist/types.d.ts +14 -2
  123. package/dist/{unmark-as-template-q1GblG-u.cjs → unmark-as-template-CtiOyF4c.cjs} +1 -1
  124. package/dist/{unmark-as-template-Dn3klZKq.js → unmark-as-template-rGzNVgFR.js} +13 -13
  125. package/dist/{unpublish-page-DMbcHmUV.cjs → unpublish-page-CNR43LxM.cjs} +1 -1
  126. package/dist/unpublish-page-DhtGUDXp.js +28 -0
  127. package/dist/{unpublished-partials-modal-CEFXp1D1.cjs → unpublished-partials-modal-BmKRB4Tl.cjs} +1 -1
  128. package/dist/{unpublished-partials-modal-Ts5ZhAK9.js → unpublished-partials-modal-j0zuOxDo.js} +3 -3
  129. package/dist/utils.cjs +1 -1
  130. package/dist/utils.js +1 -1
  131. package/dist/web-blocks.cjs +1 -1
  132. package/dist/web-blocks.js +1 -1
  133. package/dist/{web-preview-B2YGL26D.js → web-preview-BCWqRDBW.js} +1 -1
  134. package/dist/{web-preview-C6SLwtqv.cjs → web-preview-DYyGglxW.cjs} +1 -1
  135. package/package.json +2 -1
  136. package/dist/add-new-page-DG38rI6S.js +0 -31
  137. package/dist/apply-binding-9XSrYzAE.cjs +0 -1
  138. package/dist/apply-binding-chfbBKi2.js +0 -846
  139. package/dist/delete-page-CdByrw3j.cjs +0 -1
  140. package/dist/get-chai-builder-theme-B5RkBTsB.cjs +0 -1
  141. package/dist/index-Bzyv7mAh.cjs +0 -5
  142. package/dist/index-mPCp0j2h.cjs +0 -160
  143. package/dist/lang-panel-jebYHYGD.cjs +0 -1
  144. package/dist/manage-design-tokens-BknGNAKE.cjs +0 -1
  145. package/dist/manage-design-tokens-Co5677WS.js +0 -428
  146. package/dist/manage-design-tokens-modal-BcgdwEXE.cjs +0 -1
  147. package/dist/page-creator-o6yRzsVf.cjs +0 -1
  148. package/dist/page-manager-new-Dl5YwsMm.js +0 -418
  149. package/dist/page-manager-new-DpSqBzeh.cjs +0 -1
  150. package/dist/page-revisions-content-CeBepZEw.cjs +0 -1
  151. package/dist/plugin-DHpuZZXz.cjs +0 -22
  152. package/dist/publish-pages-content-PNsiaGI-.cjs +0 -1
  153. package/dist/seo-panel-0vlr_dBq.cjs +0 -2
  154. package/dist/shared-json-ld-C46hURIr.cjs +0 -1
  155. package/dist/theme-panel-footer-3ixmq107.cjs +0 -1
  156. package/dist/theme-panel-footer-BlsXRcEY.js +0 -26
  157. package/dist/unpublish-page-BbFZw0so.js +0 -28
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./register-chai-top-bar-DyW9GPzV.cjs"),r=require("./index-mPCp0j2h.cjs"),t=require("./index-Bzyv7mAh.cjs"),l=require("lucide-react"),j=require("react"),p=require("react-i18next"),T=()=>{const i=t.useSendRealtimeEvent(),{pageLockMeta:n}=t.usePageLockMeta(),{setPageStatus:d}=t.usePageLockStatus(),{savePageAsync:x}=r.useSavePage(),h=n==null?void 0:n.requestingUserId,{data:s,isFetching:g}=t.useChaiUserInfo(h||""),o=g?"Fetching user...":(s==null?void 0:s.name)||"Current editor",[u,c]=j.useState(!1),N=async()=>{c(!0),await x(),i(t.EVENT.CONTINUE_EDITING_IN_THIS_CLIENT,n),d(t.PAGE_STATUS.CHECKING),setTimeout(()=>c(!1),2e3)},f=()=>{c(!0),i(t.EVENT.TAKE_OVER_REJECTED,n),d(t.PAGE_STATUS.EDITING),setTimeout(()=>c(!1),2e3)},{t:a}=p.useTranslation();return e.jsx(t.BlurContainer,{children:e.jsxs(r.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(r.CardHeader,{className:"space-y-1",children:e.jsxs(r.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(l.AlertCircle,{className:"h-8 w-8 rounded-md bg-amber-500/20 p-1.5 text-amber-500"}),a("Take Over Requested")]})}),e.jsxs(r.CardContent,{className:"space-y-4",children:[e.jsxs("div",{className:"relative rounded-md border border-green-500 px-2 pb-2 pt-4",children:[e.jsx("div",{className:"absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white",children:"Requested by"}),e.jsxs("div",{className:"flex items-center space-x-4 p-1",children:[s!=null&&s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"h-12 w-12 flex-shrink-0 rounded-full bg-black text-white"}):e.jsx(l.UserIcon,{className:"h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white"}),e.jsxs("div",{className:"flex-1 space-y-0",children:[e.jsx("div",{className:"truncate font-medium leading-tight text-black",children:o}),(s==null?void 0:s.email)&&e.jsx("p",{className:"truncate text-sm leading-tight text-muted-foreground",children:s.email})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-gray-700",children:o})," ",a("has requested to")," ",e.jsx("span",{className:"font-medium text-gray-500",children:"take over"})," ",a("editing this page."),"."," ",a("Do you want to allow them to continue?")]})]}),e.jsxs(r.CardFooter,{className:"flex gap-2",children:[e.jsxs(m.Button,{disabled:u,variant:"default",onClick:N,className:"flex-1 gap-2",children:[e.jsx(l.Check,{className:"h-4 w-4"}),a("Accept")]}),e.jsxs(m.Button,{disabled:u,variant:"outline",onClick:f,className:"flex-1 gap-2",children:[e.jsx(l.X,{className:"h-4 w-4"}),a("Reject")]})]})]})})};exports.default=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("./register-chai-top-bar-DyW9GPzV.cjs"),r=require("./index-BsloTOgy.cjs"),t=require("./index-Bg3Prrc_.cjs"),l=require("lucide-react"),j=require("react"),p=require("react-i18next"),T=()=>{const i=t.useSendRealtimeEvent(),{pageLockMeta:n}=t.usePageLockMeta(),{setPageStatus:d}=t.usePageLockStatus(),{savePageAsync:x}=r.useSavePage(),h=n==null?void 0:n.requestingUserId,{data:s,isFetching:g}=t.useChaiUserInfo(h||""),o=g?"Fetching user...":(s==null?void 0:s.name)||"Current editor",[u,c]=j.useState(!1),N=async()=>{c(!0),await x(),i(t.EVENT.CONTINUE_EDITING_IN_THIS_CLIENT,n),d(t.PAGE_STATUS.CHECKING),setTimeout(()=>c(!1),2e3)},f=()=>{c(!0),i(t.EVENT.TAKE_OVER_REJECTED,n),d(t.PAGE_STATUS.EDITING),setTimeout(()=>c(!1),2e3)},{t:a}=p.useTranslation();return e.jsx(t.BlurContainer,{children:e.jsxs(r.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(r.CardHeader,{className:"space-y-1",children:e.jsxs(r.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(l.AlertCircle,{className:"h-8 w-8 rounded-md bg-amber-500/20 p-1.5 text-amber-500"}),a("Take Over Requested")]})}),e.jsxs(r.CardContent,{className:"space-y-4",children:[e.jsxs("div",{className:"relative rounded-md border border-green-500 px-2 pb-2 pt-4",children:[e.jsx("div",{className:"absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white",children:"Requested by"}),e.jsxs("div",{className:"flex items-center space-x-4 p-1",children:[s!=null&&s.avatar?e.jsx("img",{src:s.avatar,alt:s.name,className:"h-12 w-12 flex-shrink-0 rounded-full bg-black text-white"}):e.jsx(l.UserIcon,{className:"h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white"}),e.jsxs("div",{className:"flex-1 space-y-0",children:[e.jsx("div",{className:"truncate font-medium leading-tight text-black",children:o}),(s==null?void 0:s.email)&&e.jsx("p",{className:"truncate text-sm leading-tight text-muted-foreground",children:s.email})]})]})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"font-medium text-gray-700",children:o})," ",a("has requested to")," ",e.jsx("span",{className:"font-medium text-gray-500",children:"take over"})," ",a("editing this page."),"."," ",a("Do you want to allow them to continue?")]})]}),e.jsxs(r.CardFooter,{className:"flex gap-2",children:[e.jsxs(m.Button,{disabled:u,variant:"default",onClick:N,className:"flex-1 gap-2",children:[e.jsx(l.Check,{className:"h-4 w-4"}),a("Accept")]}),e.jsxs(m.Button,{disabled:u,variant:"outline",onClick:f,className:"flex-1 gap-2",children:[e.jsx(l.X,{className:"h-4 w-4"}),a("Reject")]})]})]})})};exports.default=T;
@@ -1,22 +1,22 @@
1
1
  import { jsx as a, jsxs as t } from "react/jsx-runtime";
2
2
  import { B as m } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { F as N, G as C, H as b, I as v, J as E, K as T } from "./index-DsQXiNA_.js";
4
- import { ao as w, b as I, a as k, ap as y, B as R, E as d, P as u } from "./index-IQefjAA0.js";
5
- import { AlertCircle as S, UserIcon as A, Check as P, X as _ } from "lucide-react";
6
- import { useState as q } from "react";
3
+ import { E as N, F as C, G as E, H as b, I as v, J as T } from "./index-94oA-Cgl.js";
4
+ import { aq as w, b as I, a as k, w as y, B as R, E as d, P as u } from "./index-CDUCqK5V.js";
5
+ import { AlertCircle as S, UserIcon as q, Check as A, X as P } from "lucide-react";
6
+ import { useState as _ } from "react";
7
7
  import { useTranslation as U } from "react-i18next";
8
- const K = () => {
9
- const l = w(), { pageLockMeta: r } = I(), { setPageStatus: c } = k(), { savePageAsync: h } = N(), f = r == null ? void 0 : r.requestingUserId, { data: e, isFetching: p } = y(f || ""), i = p ? "Fetching user..." : (e == null ? void 0 : e.name) || "Current editor", [o, n] = q(!1), x = async () => {
8
+ const J = () => {
9
+ const l = w(), { pageLockMeta: r } = I(), { setPageStatus: c } = k(), { savePageAsync: h } = N(), f = r == null ? void 0 : r.requestingUserId, { data: e, isFetching: x } = y(f || ""), i = x ? "Fetching user..." : (e == null ? void 0 : e.name) || "Current editor", [o, n] = _(!1), p = async () => {
10
10
  n(!0), await h(), l(d.CONTINUE_EDITING_IN_THIS_CLIENT, r), c(u.CHECKING), setTimeout(() => n(!1), 2e3);
11
11
  }, g = () => {
12
12
  n(!0), l(d.TAKE_OVER_REJECTED, r), c(u.EDITING), setTimeout(() => n(!1), 2e3);
13
13
  }, { t: s } = U();
14
14
  return /* @__PURE__ */ a(R, { children: /* @__PURE__ */ t(C, { className: "mx-auto w-full max-w-md", children: [
15
- /* @__PURE__ */ a(b, { className: "space-y-1", children: /* @__PURE__ */ t(v, { className: "flex items-center gap-2 text-xl", children: [
15
+ /* @__PURE__ */ a(E, { className: "space-y-1", children: /* @__PURE__ */ t(b, { className: "flex items-center gap-2 text-xl", children: [
16
16
  /* @__PURE__ */ a(S, { className: "h-8 w-8 rounded-md bg-amber-500/20 p-1.5 text-amber-500" }),
17
17
  s("Take Over Requested")
18
18
  ] }) }),
19
- /* @__PURE__ */ t(E, { className: "space-y-4", children: [
19
+ /* @__PURE__ */ t(v, { className: "space-y-4", children: [
20
20
  /* @__PURE__ */ t("div", { className: "relative rounded-md border border-green-500 px-2 pb-2 pt-4", children: [
21
21
  /* @__PURE__ */ a("div", { className: "absolute -top-2.5 left-3 w-max rounded-full bg-green-500 px-3 py-1 text-xs font-medium leading-3 text-white", children: "Requested by" }),
22
22
  /* @__PURE__ */ t("div", { className: "flex items-center space-x-4 p-1", children: [
@@ -27,7 +27,7 @@ const K = () => {
27
27
  alt: e.name,
28
28
  className: "h-12 w-12 flex-shrink-0 rounded-full bg-black text-white"
29
29
  }
30
- ) : /* @__PURE__ */ a(A, { className: "h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white" }),
30
+ ) : /* @__PURE__ */ a(q, { className: "h-12 w-12 flex-shrink-0 rounded-full bg-black p-3 text-white" }),
31
31
  /* @__PURE__ */ t("div", { className: "flex-1 space-y-0", children: [
32
32
  /* @__PURE__ */ a("div", { className: "truncate font-medium leading-tight text-black", children: i }),
33
33
  (e == null ? void 0 : e.email) && /* @__PURE__ */ a("p", { className: "truncate text-sm leading-tight text-muted-foreground", children: e.email })
@@ -48,17 +48,17 @@ const K = () => {
48
48
  ] })
49
49
  ] }),
50
50
  /* @__PURE__ */ t(T, { className: "flex gap-2", children: [
51
- /* @__PURE__ */ t(m, { disabled: o, variant: "default", onClick: x, className: "flex-1 gap-2", children: [
52
- /* @__PURE__ */ a(P, { className: "h-4 w-4" }),
51
+ /* @__PURE__ */ t(m, { disabled: o, variant: "default", onClick: p, className: "flex-1 gap-2", children: [
52
+ /* @__PURE__ */ a(A, { className: "h-4 w-4" }),
53
53
  s("Accept")
54
54
  ] }),
55
55
  /* @__PURE__ */ t(m, { disabled: o, variant: "outline", onClick: g, className: "flex-1 gap-2", children: [
56
- /* @__PURE__ */ a(_, { className: "h-4 w-4" }),
56
+ /* @__PURE__ */ a(P, { className: "h-4 w-4" }),
57
57
  s("Reject")
58
58
  ] })
59
59
  ] })
60
60
  ] }) });
61
61
  };
62
62
  export {
63
- K as default
63
+ J as default
64
64
  };
@@ -1,24 +1,24 @@
1
1
  import { jsx as n, jsxs as e } from "react/jsx-runtime";
2
2
  import { B as i } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { D as c, e as d, f as h, g, p as m, r as u } from "./index-DsQXiNA_.js";
3
+ import { D as c, e as d, f as h, g, o as m, q as u } from "./index-94oA-Cgl.js";
4
4
  const x = ({
5
- isOpen: l,
6
- onClose: o,
7
- onContinue: r,
5
+ isOpen: o,
6
+ onClose: l,
7
+ onContinue: t,
8
8
  isPending: a = !1,
9
- title: t = "Translation Warning",
9
+ title: r = "Translation Warning",
10
10
  description: s = "Some blocks need translations before publishing. Do you want to continue anyway?"
11
- }) => /* @__PURE__ */ n(c, { open: l, onOpenChange: o, children: l && /* @__PURE__ */ e(d, { className: "sm:max-w-[425px]", children: [
11
+ }) => /* @__PURE__ */ n(c, { open: o, onOpenChange: l, children: o && /* @__PURE__ */ e(d, { className: "sm:max-w-[425px]", children: [
12
12
  /* @__PURE__ */ e(h, { children: [
13
- /* @__PURE__ */ n(g, { children: t }),
13
+ /* @__PURE__ */ n(g, { children: r }),
14
14
  /* @__PURE__ */ n(m, { children: s })
15
15
  ] }),
16
16
  /* @__PURE__ */ e(u, { className: "flex gap-2", children: [
17
17
  /* @__PURE__ */ n(i, { variant: "outline", onClick: () => {
18
- o();
18
+ l();
19
19
  }, disabled: a, children: "Cancel" }),
20
20
  /* @__PURE__ */ n(i, { onClick: () => {
21
- r();
21
+ t();
22
22
  }, disabled: a, children: a ? "Publishing..." : "Continue Anyway" })
23
23
  ] })
24
24
  ] }) });
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-mPCp0j2h.cjs"),u=({isOpen:o,onClose:i,onContinue:t,isPending:a=!1,title:r="Translation Warning",description:s="Some blocks need translations before publishing. Do you want to continue anyway?"})=>{const c=()=>{i()},d=()=>{t()};return e.jsx(n.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxs(n.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(n.DialogHeader,{children:[e.jsx(n.DialogTitle,{children:r}),e.jsx(n.DialogDescription,{children:s})]}),e.jsxs(n.DialogFooter,{className:"flex gap-2",children:[e.jsx(l.Button,{variant:"outline",onClick:c,disabled:a,children:"Cancel"}),e.jsx(l.Button,{onClick:d,disabled:a,children:a?"Publishing...":"Continue Anyway"})]})]})})};exports.default=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-BsloTOgy.cjs"),u=({isOpen:o,onClose:i,onContinue:t,isPending:a=!1,title:r="Translation Warning",description:s="Some blocks need translations before publishing. Do you want to continue anyway?"})=>{const c=()=>{i()},d=()=>{t()};return e.jsx(n.Dialog,{open:o,onOpenChange:i,children:o&&e.jsxs(n.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(n.DialogHeader,{children:[e.jsx(n.DialogTitle,{children:r}),e.jsx(n.DialogDescription,{children:s})]}),e.jsxs(n.DialogFooter,{className:"flex gap-2",children:[e.jsx(l.Button,{variant:"outline",onClick:c,disabled:a,children:"Cancel"}),e.jsx(l.Button,{onClick:d,disabled:a,children:a?"Publishing...":"Continue Anyway"})]})]})})};exports.default=u;
package/dist/types.d.ts CHANGED
@@ -246,7 +246,12 @@ export declare interface ChaiBuilderEditorProps {
246
246
  * onSave callback function
247
247
  * @param saveData
248
248
  */
249
- onSave?: ({ blocks, theme, autoSave }: ChaiSavePageData) => Promise<boolean | Error>;
249
+ onSave?: ({ blocks, autoSave }: ChaiSavePageData) => Promise<boolean | Error>;
250
+ /**
251
+ * onSaveWebsiteData callback function for theme and design tokens
252
+ * @param saveData
253
+ */
254
+ onSaveWebsiteData?: (data: ChaiSaveWebsiteData) => Promise<boolean | Error>;
250
255
  /**
251
256
  * onSaveStateChange callback function
252
257
  * @param syncStatus
@@ -498,7 +503,6 @@ export declare type ChaiRenderBlockProps<T> = {
498
503
  declare type ChaiSavePageData = {
499
504
  autoSave: boolean;
500
505
  blocks: ChaiBlock[];
501
- theme?: ChaiTheme;
502
506
  needTranslations?: boolean;
503
507
  designTokens: ChaiDesignTokens;
504
508
  partialIds?: string[];
@@ -507,6 +511,14 @@ declare type ChaiSavePageData = {
507
511
  export { ChaiSavePageData }
508
512
  export { ChaiSavePageData as SavePageData }
509
513
 
514
+ export declare type ChaiSaveWebsiteData = {
515
+ type: "THEME";
516
+ data: ChaiTheme;
517
+ } | {
518
+ type: "DESIGN_TOKENS";
519
+ data: ChaiDesignTokens;
520
+ };
521
+
510
522
  export declare interface ChaiServerBlockConfig {
511
523
  component: default_2.ComponentType<ChaiBlockComponentProps>;
512
524
  type: string;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-mPCp0j2h.cjs"),p=require("./index-Bzyv7mAh.cjs"),d=require("react"),m=require("react-i18next"),g=({page:i,onClose:n})=>{const{t:a}=m.useTranslation(),[r,s]=d.useState(!1),l=p.useUnmarkAsTemplate(),c=()=>{s(!0),l.mutate(i,{onSuccess:()=>{s(!1),n()},onError:()=>{s(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:n,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:a("Unmark as template")}),e.jsx(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:a("Are you sure you want to unmark this page as a template?")})]}),e.jsxs(t.DialogFooter,{className:r?"pointer-events-none opacity-75":"",children:[e.jsx(o.Button,{variant:"outline",onClick:u=>{u.stopPropagation(),n()},children:a("Cancel")}),e.jsx(o.Button,{variant:"default",disabled:r,onClick:c,children:a("Unmark as template")})]})]})})};exports.default=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-BsloTOgy.cjs"),p=require("./index-Bg3Prrc_.cjs"),d=require("react"),m=require("react-i18next"),g=({page:i,onClose:n})=>{const{t:a}=m.useTranslation(),[r,s]=d.useState(!1),l=p.useUnmarkAsTemplate(),c=()=>{s(!0),l.mutate(i,{onSuccess:()=>{s(!1),n()},onError:()=>{s(!1)}})};return e.jsx(t.Dialog,{open:!0,onOpenChange:n,children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:a("Unmark as template")}),e.jsx(t.DialogDescription,{className:"space-y-1 py-4 text-xs text-slate-500",children:a("Are you sure you want to unmark this page as a template?")})]}),e.jsxs(t.DialogFooter,{className:r?"pointer-events-none opacity-75":"",children:[e.jsx(o.Button,{variant:"outline",onClick:u=>{u.stopPropagation(),n()},children:a("Cancel")}),e.jsx(o.Button,{variant:"default",disabled:r,onClick:c,children:a("Unmark as template")})]})]})})};exports.default=g;
@@ -1,28 +1,28 @@
1
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
- import { B as s } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { D as p, e as u, f as d, g as f, p as g, r as h } from "./index-DsQXiNA_.js";
4
- import { r as k } from "./index-IQefjAA0.js";
1
+ import { jsx as a, jsxs as n } from "react/jsx-runtime";
2
+ import { B as r } from "./register-chai-top-bar-D6GjnauV.js";
3
+ import { D as p, e as u, f as d, g as f, o as g, q as h } from "./index-94oA-Cgl.js";
4
+ import { o as k } from "./index-CDUCqK5V.js";
5
5
  import { useState as D } from "react";
6
6
  import { useTranslation as x } from "react-i18next";
7
7
  const j = ({ page: i, onClose: t }) => {
8
- const { t: e } = x(), [r, n] = D(!1), l = k(), m = () => {
9
- n(!0), l.mutate(i, {
8
+ const { t: e } = x(), [s, o] = D(!1), l = k(), m = () => {
9
+ o(!0), l.mutate(i, {
10
10
  onSuccess: () => {
11
- n(!1), t();
11
+ o(!1), t();
12
12
  },
13
13
  onError: () => {
14
- n(!1);
14
+ o(!1);
15
15
  }
16
16
  });
17
17
  };
18
- return /* @__PURE__ */ a(p, { open: !0, onOpenChange: t, children: /* @__PURE__ */ o(u, { children: [
19
- /* @__PURE__ */ o(d, { children: [
18
+ return /* @__PURE__ */ a(p, { open: !0, onOpenChange: t, children: /* @__PURE__ */ n(u, { children: [
19
+ /* @__PURE__ */ n(d, { children: [
20
20
  /* @__PURE__ */ a(f, { children: e("Unmark as template") }),
21
21
  /* @__PURE__ */ a(g, { className: "space-y-1 py-4 text-xs text-slate-500", children: e("Are you sure you want to unmark this page as a template?") })
22
22
  ] }),
23
- /* @__PURE__ */ o(h, { className: r ? "pointer-events-none opacity-75" : "", children: [
23
+ /* @__PURE__ */ n(h, { className: s ? "pointer-events-none opacity-75" : "", children: [
24
24
  /* @__PURE__ */ a(
25
- s,
25
+ r,
26
26
  {
27
27
  variant: "outline",
28
28
  onClick: (c) => {
@@ -31,7 +31,7 @@ const j = ({ page: i, onClose: t }) => {
31
31
  children: e("Cancel")
32
32
  }
33
33
  ),
34
- /* @__PURE__ */ a(s, { variant: "default", disabled: r, onClick: m, children: e("Unmark as template") })
34
+ /* @__PURE__ */ a(r, { variant: "default", disabled: s, onClick: m, children: e("Unmark as template") })
35
35
  ] })
36
36
  ] }) });
37
37
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),e=require("./index-mPCp0j2h.cjs"),c=require("./index-Bzyv7mAh.cjs"),a=require("react-i18next"),d=({page:i,onClose:t})=>{const{t:s}=a.useTranslation(),{mutate:l,isPending:r}=c.useUnpublishPage(),u=async()=>{l(i,{onSuccess:t})};return n.jsx(e.Dialog,{open:!!i,onOpenChange:t,children:n.jsxs(e.DialogContent,{children:[n.jsxs(e.DialogHeader,{children:[n.jsx(e.DialogTitle,{children:s("Confirm action")}),n.jsxs(e.DialogDescription,{children:[s("Are you sure you want to unpublish")," ",n.jsx("b",{children:(i==null?void 0:i.name)??(i==null?void 0:i.slug)}),"?"]})]}),n.jsxs(e.DialogFooter,{children:[n.jsx(o.Button,{variant:"outline",onClick:t,children:s("Cancel")}),n.jsx(o.Button,{variant:"destructive",disabled:r,onClick:u,children:s(r?"Updating...":"Unpublish")})]})]})})};exports.default=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("./register-chai-top-bar-DyW9GPzV.cjs"),e=require("./index-BsloTOgy.cjs"),c=require("./index-Bg3Prrc_.cjs"),a=require("react-i18next"),d=({page:i,onClose:t})=>{const{t:s}=a.useTranslation(),{mutate:l,isPending:r}=c.useUnpublishPage(),u=async()=>{l(i,{onSuccess:t})};return n.jsx(e.Dialog,{open:!!i,onOpenChange:t,children:n.jsxs(e.DialogContent,{children:[n.jsxs(e.DialogHeader,{children:[n.jsx(e.DialogTitle,{children:s("Confirm action")}),n.jsxs(e.DialogDescription,{children:[s("Are you sure you want to unpublish")," ",n.jsx("b",{children:(i==null?void 0:i.name)??(i==null?void 0:i.slug)}),"?"]})]}),n.jsxs(e.DialogFooter,{children:[n.jsx(o.Button,{variant:"outline",onClick:t,children:s("Cancel")}),n.jsx(o.Button,{variant:"destructive",disabled:r,onClick:u,children:s(r?"Updating...":"Unpublish")})]})]})})};exports.default=d;
@@ -0,0 +1,28 @@
1
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
2
+ import { B as l } from "./register-chai-top-bar-D6GjnauV.js";
3
+ import { D as c, e as u, f as h, g as d, o as m, q as b } from "./index-94oA-Cgl.js";
4
+ import { q as f } from "./index-CDUCqK5V.js";
5
+ import { useTranslation as D } from "react-i18next";
6
+ const v = ({ page: n, onClose: r }) => {
7
+ const { t: i } = D(), { mutate: e, isPending: t } = f(), a = async () => {
8
+ e(n, { onSuccess: r });
9
+ };
10
+ return /* @__PURE__ */ o(c, { open: !!n, onOpenChange: r, children: /* @__PURE__ */ s(u, { children: [
11
+ /* @__PURE__ */ s(h, { children: [
12
+ /* @__PURE__ */ o(d, { children: i("Confirm action") }),
13
+ /* @__PURE__ */ s(m, { children: [
14
+ i("Are you sure you want to unpublish"),
15
+ " ",
16
+ /* @__PURE__ */ o("b", { children: (n == null ? void 0 : n.name) ?? (n == null ? void 0 : n.slug) }),
17
+ "?"
18
+ ] })
19
+ ] }),
20
+ /* @__PURE__ */ s(b, { children: [
21
+ /* @__PURE__ */ o(l, { variant: "outline", onClick: r, children: i("Cancel") }),
22
+ /* @__PURE__ */ o(l, { variant: "destructive", disabled: t, onClick: a, children: i(t ? "Updating..." : "Unpublish") })
23
+ ] })
24
+ ] }) });
25
+ };
26
+ export {
27
+ v as default
28
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-mPCp0j2h.cjs"),i=require("react-i18next"),n=({isOpen:u,onClose:d,onContinue:c,isPending:r=!1,partialBlocksInfo:a=[]})=>{const{t:l}=i.useTranslation();return e.jsx(t.Dialog,{open:u,onOpenChange:d,children:u&&e.jsxs(t.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:l("Publish Page with Unpublished Blocks?")}),e.jsx(t.DialogDescription,{children:l("You have unpublished changes in the following blocks. They will be published together with the page.")})]}),(a==null?void 0:a.length)>0&&e.jsx("div",{className:"max-h-32 overflow-y-auto rounded-md border bg-muted/50 p-2",children:e.jsx("ul",{className:"space-y-1 text-sm",children:a.map(s=>e.jsxs("li",{className:"flex items-center justify-between text-muted-foreground",children:[e.jsxs("span",{children:["• ",s==null?void 0:s.name]}),e.jsx("span",{className:`ml-2 rounded px-1.5 pb-0.5 text-[10px] ${(s==null?void 0:s.status)==="unpublished"?"text-orange-700":"text-blue-700"}`,children:(s==null?void 0:s.status)==="unpublished"?l("Unpublished page"):l("Unpublished changes")})]},s==null?void 0:s.id))})}),e.jsxs(t.DialogFooter,{className:"flex gap-2",children:[e.jsx(h.Button,{variant:"outline",onClick:d,disabled:r,children:l("Cancel")}),e.jsx(h.Button,{onClick:c,disabled:r,children:l(r?"Publishing...":"Publish Page & Blocks")})]})]})})};exports.default=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),h=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("./index-BsloTOgy.cjs"),i=require("react-i18next"),n=({isOpen:u,onClose:d,onContinue:c,isPending:r=!1,partialBlocksInfo:a=[]})=>{const{t:l}=i.useTranslation();return e.jsx(t.Dialog,{open:u,onOpenChange:d,children:u&&e.jsxs(t.DialogContent,{className:"sm:max-w-[425px]",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:l("Publish Page with Unpublished Blocks?")}),e.jsx(t.DialogDescription,{children:l("You have unpublished changes in the following blocks. They will be published together with the page.")})]}),(a==null?void 0:a.length)>0&&e.jsx("div",{className:"max-h-32 overflow-y-auto rounded-md border bg-muted/50 p-2",children:e.jsx("ul",{className:"space-y-1 text-sm",children:a.map(s=>e.jsxs("li",{className:"flex items-center justify-between text-muted-foreground",children:[e.jsxs("span",{children:["• ",s==null?void 0:s.name]}),e.jsx("span",{className:`ml-2 rounded px-1.5 pb-0.5 text-[10px] ${(s==null?void 0:s.status)==="unpublished"?"text-orange-700":"text-blue-700"}`,children:(s==null?void 0:s.status)==="unpublished"?l("Unpublished page"):l("Unpublished changes")})]},s==null?void 0:s.id))})}),e.jsxs(t.DialogFooter,{className:"flex gap-2",children:[e.jsx(h.Button,{variant:"outline",onClick:d,disabled:r,children:l("Cancel")}),e.jsx(h.Button,{onClick:c,disabled:r,children:l(r?"Publishing...":"Publish Page & Blocks")})]})]})})};exports.default=n;
@@ -1,7 +1,7 @@
1
1
  import { jsx as l, jsxs as a } from "react/jsx-runtime";
2
2
  import { B as u } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { D as i, e as m, f as n, g as p, p as b, r as g } from "./index-DsQXiNA_.js";
4
- import { useTranslation as x } from "react-i18next";
3
+ import { D as i, e as m, f as n, g as p, o as b, q as g } from "./index-94oA-Cgl.js";
4
+ import { useTranslation as o } from "react-i18next";
5
5
  const v = ({
6
6
  isOpen: h,
7
7
  onClose: r,
@@ -9,7 +9,7 @@ const v = ({
9
9
  isPending: d = !1,
10
10
  partialBlocksInfo: t = []
11
11
  }) => {
12
- const { t: s } = x();
12
+ const { t: s } = o();
13
13
  return /* @__PURE__ */ l(i, { open: h, onOpenChange: r, children: h && /* @__PURE__ */ a(m, { className: "sm:max-w-[425px]", children: [
14
14
  /* @__PURE__ */ a(n, { children: [
15
15
  /* @__PURE__ */ l(p, { children: s("Publish Page with Unpublished Blocks?") }),
package/dist/utils.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./get-chai-builder-theme-B5RkBTsB.cjs"),e=require("./get-chai-builder-tailwind-config-7CxFxEYL.cjs");exports.chaiBuilderPlugin=i.chaiBuilderPlugin;exports.getChaiBuilderTheme=i.getChaiBuilderTheme;exports.getChaiBuilderTailwindConfig=e.getChaiBuilderTailwindConfig;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./get-chai-builder-theme-C_qofMh_.cjs"),e=require("./get-chai-builder-tailwind-config-7CxFxEYL.cjs");exports.chaiBuilderPlugin=i.chaiBuilderPlugin;exports.getChaiBuilderTheme=i.getChaiBuilderTheme;exports.getChaiBuilderTailwindConfig=e.getChaiBuilderTailwindConfig;
package/dist/utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as a, g as r } from "./get-chai-builder-theme-BpuwSLeS.js";
1
+ import { c as a, g as r } from "./get-chai-builder-theme-CyOkIlte.js";
2
2
  import { g as l } from "./get-chai-builder-tailwind-config-DC4sDOYK.js";
3
3
  export {
4
4
  a as chaiBuilderPlugin,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-es"),r=require("react/jsx-runtime"),a=require("./runtime.cjs"),P=require("./common-functions-B3a4xKt_.cjs"),x=require("react"),m=require("@radix-ui/react-icons"),d=require("./core-BWQrViOY.cjs");function S(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=S(x),k=({className:e="",inBuilder:o})=>o?r.jsx("div",{className:P.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:r.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,_=e=>{const{blockProps:o,inBuilder:t,backgroundImage:l,children:s,tag:i="div",styles:n}=e;let c=s;s||(c=r.jsx(k,{inBuilder:t}));let p={};return l&&(p={backgroundImage:`url(${l})`}),b.createElement(i,{...o,...n,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]},backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}}),canAcceptBlock:()=>!0},T=e=>{const{blockProps:o,iconSize:t,icon:l,content:s,styles:i,children:n,iconPos:c,link:p,inBuilder:g}=e,y=l,C=n||r.jsxs(r.Fragment,{children:[s&&r.jsx("span",{children:s}),y&&r.jsx("div",{style:{width:t+"px"},className:c+" "+(s?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:y}})]}),f=x.createElement("button",{...o,...i,type:"button","aria-label":s},C);return u.isEmpty(u.get(p,"href"))?f:g?r.jsx("span",{children:f}):r.jsx("a",{"aria-label":s,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:f})},E={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"],enumNames:["Left","Right"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!0,title:"Prefetch Link"}}}),i18nProps:["content","link"],aiProps:["content"]},R=e=>{const{blockProps:o,styles:t,htmlCode:l,inBuilder:s}=e;return s?r.jsxs("div",{className:"relative",...o,children:[s?r.jsx("div",{...t,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...t,dangerouslySetInnerHTML:{__html:l.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:l}})},A={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},M=e=>{const{scripts:o,inBuilder:t,blockProps:l}=e;return t?r.jsx("div",{...l,children:r.jsx("div",{className:P.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:r.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):r.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:m.CodeIcon,hidden:!0,group:"advanced",props:a.registerChaiBlockProps({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},$=e=>{const{blockProps:o,inBuilder:t,children:l,globalBlock:s}=e;return t&&!s?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Global Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},D={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:a.registerChaiBlockProps({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},I=(e,...o)=>({...e,className:P.cn(e.className,...o)}),V=e=>{const{blockProps:o,icon:t,styles:l,width:s,inBuilder:i,height:n}=e,c=I(l,"");if(u.isEmpty(t))return r.jsx(k,{inBuilder:i,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...c,style:{width:s?`${s}px`:"auto",height:n?`${n}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},z={type:"Icon",label:"web_blocks.icon",category:"core",description:"Icon block is used to display an icon/svg.",icon:m.SketchLogoIcon,group:"media",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),icon:{type:"string",title:"Icon",default:'<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},F=e=>{const{blockProps:o,inBuilder:t,children:l,partialBlockId:s}=e;return t&&!s?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Partial Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},U={type:"PartialBlock",description:"A partial block component. Partial blocks are global blocks that can be used in multiple pages.",label:"Partial Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:a.registerChaiBlockProps({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},w={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},q=e=>{const{blockProps:o,children:t,styles:l,colSpan:s,tabletColSpan:i,desktopColSpan:n}=e,p={className:[u.get(l,"className",""),u.get(w,["SMALL",isNaN(s)||!s?6:s],""),i?u.get(w,["MEDIUM",i||s],""):"",n?u.get(w,["LARGE",i||s],""):""].join(" ")};return r.jsx("div",{...o,...l,...p,children:t||r.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},O={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:m.LayoutIcon,wrapper:!0,hidden:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Z=e=>{const{blockProps:o,children:t,styles:l,gutter:s}=e,n={className:[u.get(l,"className","")," grid grid-cols-12"].join()};return typeof(l==null?void 0:l.style)=="object"&&l.style!==null?n.style={...l.style,gap:`${s}px`}:n.style={gap:`${s}px`},r.jsx("div",{...o,...l,...n,children:t})},G={type:"Row",description:"A row component",label:"Row",group:"basic",icon:m.RowsIcon,hidden:!0,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},W=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},Y={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},Q=e=>{const{blockProps:o,styles:t,backgroundImage:l}=e;let s={};return l&&(s={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...t,style:s})},J={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}})},X=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"checkbox",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"checkbox",required:n,defaultChecked:c})},K={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("flex items-center gap-x-2"),inputStyles:a.stylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},ee=e=>{const{children:o,blockProps:t,errorMessage:l,successMessage:s,action:i,styles:n,inBuilder:c}=e;let p=o;o||(p=r.jsx(k,{inBuilder:c}));const g={"x-data":"{}","x-on:submit.prevent":"post"},y={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxs("form",{...g,"data-error":l,"data-success":s,method:"post",action:i,...t,...n,children:[r.jsx("div",{...y}),p]})},te={type:"Form",label:"Form",category:"core",icon:m.FileTextIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},oe=e=>{const{blockProps:o,inBuilder:t,label:l,styles:s,icon:i,iconSize:n,iconPos:c}=e;return r.jsxs("button",{...s,...o||{},type:t?"button":"submit","aria-label":l,children:[l,i&&r.jsx("div",{style:{width:n+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:i}})]})},le={type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},re=e=>{const o={type:"text",autoComplete:"on"};return e?["text","password","number","hidden","range","color","date","time"].includes(e)?{type:e,autoComplete:"on"}:e==="email"?{type:"email",autoComplete:"email"}:e==="tel"?{type:"tel",autoComplete:"tel"}:e==="url"?{type:"url",autoComplete:"url"}:{off:{type:"text",autoComplete:"off"},on:{type:"text",autoComplete:"on"},name:{type:"text",autoComplete:"name"},"honorific-prefix":{type:"text",autoComplete:"honorific-prefix"},"given-name":{type:"text",autoComplete:"given-name"},"additional-name":{type:"text",autoComplete:"additional-name"},"family-name":{type:"text",autoComplete:"family-name"},"honorific-suffix":{type:"text",autoComplete:"honorific-suffix"},nickname:{type:"text",autoComplete:"nickname"},firstName:{type:"text",autoComplete:"given-name"},lastName:{type:"text",autoComplete:"family-name"},email:{type:"email",autoComplete:"email"},tel:{type:"tel",autoComplete:"tel"},"tel-country-code":{type:"tel",autoComplete:"tel-country-code"},"tel-national":{type:"tel",autoComplete:"tel-national"},"tel-area-code":{type:"tel",autoComplete:"tel-area-code"},"tel-local":{type:"tel",autoComplete:"tel-local"},"tel-extension":{type:"tel",autoComplete:"tel-extension"},"street-address":{type:"text",autoComplete:"street-address"},"address-line1":{type:"text",autoComplete:"address-line1"},"address-line2":{type:"text",autoComplete:"address-line2"},"address-line3":{type:"text",autoComplete:"address-line3"},"address-level1":{type:"text",autoComplete:"address-level1"},"address-level2":{type:"text",autoComplete:"address-level2"},"address-level3":{type:"text",autoComplete:"address-level3"},"address-level4":{type:"text",autoComplete:"address-level4"},country:{type:"text",autoComplete:"country"},"country-name":{type:"text",autoComplete:"country-name"},"postal-code":{type:"text",autoComplete:"postal-code"},"cc-name":{type:"text",autoComplete:"cc-name"},"cc-given-name":{type:"text",autoComplete:"cc-given-name"},"cc-additional-name":{type:"text",autoComplete:"cc-additional-name"},"cc-family-name":{type:"text",autoComplete:"cc-family-name"},"cc-number":{type:"text",autoComplete:"cc-number"},"cc-exp":{type:"text",autoComplete:"cc-exp"},"cc-exp-month":{type:"number",autoComplete:"cc-exp-month"},"cc-exp-year":{type:"number",autoComplete:"cc-exp-year"},"cc-csc":{type:"text",autoComplete:"cc-csc"},"cc-type":{type:"text",autoComplete:"cc-type"},bday:{type:"date",autoComplete:"bday"},"bday-day":{type:"number",autoComplete:"bday-day"},"bday-month":{type:"number",autoComplete:"bday-month"},"bday-year":{type:"number",autoComplete:"bday-year"},username:{type:"text",autoComplete:"username"},"new-password":{type:"password",autoComplete:"new-password"},"current-password":{type:"password",autoComplete:"current-password"},"one-time-code":{type:"text",autoComplete:"one-time-code"},"transaction-currency":{type:"text",autoComplete:"transaction-currency"},"transaction-amount":{type:"number",autoComplete:"transaction-amount"},url:{type:"url",autoComplete:"url"},photo:{type:"url",autoComplete:"photo"},sex:{type:"text",autoComplete:"sex"},"organization-title":{type:"text",autoComplete:"organization-title"},organization:{type:"text",autoComplete:"organization"},language:{type:"text",autoComplete:"language"}}[e]||o:o},se=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:n,showLabel:c,required:p,inputType:g,defaultValue:y}=e,{type:C,autoComplete:f}=re(g);return c?r.jsxs("div",{...i,...o,children:[c&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("input",{name:t,defaultValue:y,...n,type:C,placeholder:s,required:p,autoComplete:f,...C==="hidden"&&y?{value:y}:{}})]}):r.jsx("input",{name:t,...o,...n,...i,type:C,placeholder:s,required:p,autoComplete:f,defaultValue:y,...C==="hidden"&&y?{value:y}:{}})},ie={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),inputStyles:a.stylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"firstName",title:"First Name"},{const:"lastName",title:"Last Name"},{const:"tel-country-code",title:"Telephone Country Code"},{const:"tel-national",title:"Telephone National"},{const:"tel-area-code",title:"Telephone Area Code"},{const:"tel-local",title:"Telephone Local"},{const:"tel-extension",title:"Telephone Extension"},{const:"street-address",title:"Street Address"},{const:"address-line1",title:"Address Line 1"},{const:"address-line2",title:"Address Line 2"},{const:"address-line3",title:"Address Line 3"},{const:"address-level1",title:"Address Level 1"},{const:"address-level2",title:"Address Level 2"},{const:"address-level3",title:"Address Level 3"},{const:"address-level4",title:"Address Level 4"},{const:"country",title:"Country"},{const:"country-name",title:"Country Name"},{const:"postal-code",title:"Postal Code"},{const:"cc-name",title:"Credit Card Name"},{const:"cc-number",title:"Credit Card Number"},{const:"cc-exp",title:"Credit Card Expiry"},{const:"cc-exp-month",title:"Credit Card Expiry Month"},{const:"cc-exp-year",title:"Credit Card Expiry Year"},{const:"cc-csc",title:"Credit Card CSC"},{const:"cc-type",title:"Credit Card Type"},{const:"bday",title:"Birthday"},{const:"bday-day",title:"Birthday Day"},{const:"bday-month",title:"Birthday Month"},{const:"bday-year",title:"Birthday Year"},{const:"username",title:"Username"},{const:"new-password",title:"New Password"},{const:"current-password",title:"Current Password"},{const:"one-time-code",title:"One Time Code"},{const:"transaction-currency",title:"Transaction Currency"},{const:"transaction-amount",title:"Transaction Amount"},{const:"url",title:"URL"},{const:"photo",title:"Photo"},{const:"sex",title:"Sex"},{const:"organization-title",title:"Organization Title"},{const:"organization",title:"Organization"},{const:"language",title:"Language"}]},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ae=e=>{const{blockProps:o,content:t,styles:l,children:s}=e,i={...l,...o};return s?b.createElement("label",i,s):b.createElement("label",{...i,dangerouslySetInnerHTML:{__html:t}})},ne={type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},ce=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"radio",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"radio",required:n,checked:c})},pe={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("flex items-center gap-x-2"),inputStyles:a.stylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},de=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:n,required:c,showLabel:p,_multiple:g,options:y,defaultValue:C}=e,f=g&&C?C.split(",").map(h=>h.trim()):C||"";return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsxs("select",{...n,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,h=>r.jsx("option",{value:h==null?void 0:h.value,children:h==null?void 0:h.label},h==null?void 0:h.value))]})]}):r.jsxs("select",{...i,...o,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,h=>r.jsx("option",{value:h==null?void 0:h.value,children:h==null?void 0:h.label},h==null?void 0:h.value))]})},ue={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),inputStyles:a.stylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},me=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:n,rows:c,showLabel:p,required:g,defaultValue:y}=e;return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("textarea",{name:t,...n,placeholder:s,rows:c,required:g,defaultValue:y})]}):r.jsx("textarea",{name:t,...o,...n,...i,placeholder:s,rows:c,required:g,defaultValue:y})},ye={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:a.registerChaiBlockProps({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:a.stylesProp(""),inputStyles:a.stylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ge=e=>{const{blockProps:o,styles:t,content:l,tag:s="h1",children:i=null}=e;return i?b.createElement(s,{...t,...o},i):b.createElement(s,{...t,...o,dangerouslySetInnerHTML:{__html:l}})},he={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",props:a.registerChaiBlockProps({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:a.stylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea","ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},be=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("table",{...o,...l},t):r.jsx(k,{})},Ce=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("thead",{...o,...l},t):r.jsx(k,{})},ke=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tbody",{...o,...l},t):r.jsx(k,{})},Pe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tr",{...o,...l},t):r.jsx(k,{})},Be=e=>{const{blockProps:o,children:t,content:l,styles:s}=e;return!t&&u.isEmpty(l)?r.jsx(k,{}):t?x.createElement("td",{...o,...s},t):x.createElement("td",{...o,...s,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(xe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("Table")});d.registerChaiBlock(Ce,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("TableHead")});d.registerChaiBlock(ke,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("TableBody")});d.registerChaiBlock(Pe,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("TableRow")});d.registerChaiBlock(Be,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:B("TableCell"),i18nProps:["content"],aiProps:["content"]});function B(e){const o=(i,n)=>({_id:P.generateUUID(),_parent:i,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+n}`}),t=i=>{const n=P.generateUUID(),c={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return i&&(c._parent=i),[c,o(n,"1"),o(n,"2"),o(n,"3")]},l=i=>{const n=P.generateUUID(),c={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return i&&(c._parent=i),[c,...t(n)]},s=i=>{const n=P.generateUUID(),c={_id:n,_type:"TableBody",styles:"#styles:,"};return i&&(c._parent=i),[c,...t(n),...t(n)]};if(e==="Table"){const i=P.generateUUID();return[{_id:i,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...l(i),...s(i)]}return e==="TableRow"?t():e==="TableHead"?l():e==="TableBody"?s():[]}const we="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",ve=e=>{const{blockProps:o,image:t,mobileImage:l,styles:s,alt:i,height:n,width:c,lazyLoading:p,mobileWidth:g,mobileHeight:y}=e;return u.isEmpty(t)?r.jsx(k,{className:"h-36"}):r.jsxs("picture",{children:[l&&r.jsx("source",{srcSet:l,media:"(max-width: 480px)",width:g,height:y}),r.jsx("img",{...o,...s,src:t,alt:i,loading:p?"lazy":"eager",width:c,height:n})]})},Ie={type:"Image",description:"A image component",label:"Image",category:"core",icon:m.ImageIcon,group:"media",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("w-full h-full object-cover"),image:{type:"string",title:"Image",default:we,ui:{"ui:widget":"image"}},width:{type:"string",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"string",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},mobileWidth:{type:"string",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"string",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0}}}),aiProps:["alt"],i18nProps:["alt","image","_imageId","mobileImage","_mobileImageId"]},je=e=>{const{blockProps:o,link:t,children:l,styles:s,inBuilder:i,content:n}=e;let c={};return!l&&u.isEmpty(n)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),i?l?r.jsx("span",{role:"link",...o,style:c,...s,children:l}):x.createElement("span",{...o,...s,style:c,role:"link"},n):l?r.jsx("a",{"aria-label":n,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...s,children:l}):x.createElement("a",{...o,...s,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":n},n)},Le={type:"Link",description:"A link component",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("block"),content:{type:"string",default:"Link text goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content","link"],canAcceptBlock:e=>e!=="Link"},Se=e=>{const{blockProps:o,children:t,styles:l,tag:s,inBuilder:i}=e;return!t&&u.isEmpty(l==null?void 0:l.className)?r.jsx(k,{inBuilder:i}):b.createElement(s||"ul",{...o,...l},t)},_e={type:"List",description:"A list component",label:"List",icon:m.RowsIcon,category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",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"}]},Ne=e=>{const{blockProps:o,content:t,styles:l,children:s,tag:i}=e;return s?b.createElement(i||"li",{...l,...o},s):b.createElement(i||"li",{...l,...o,dangerouslySetInnerHTML:{__html:t}})},Te={type:"ListItem",description:"A list item component",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},Ee=e=>{const{blockProps:o,styles:t,content:l}=e;if(!u.isNull(e.children))return b.createElement("p",{...t,...o},e.children);const s=I(t,"rte");return b.createElement("div",{...s,...o,dangerouslySetInnerHTML:{__html:l}})},Re={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",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.",ui:{"ui:widget":"richtext","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},Ae=e=>{const{blockProps:o,content:t,styles:l}=e,s=I(l,"rte");return r.jsx("div",{...o,...s,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",hidden:!0,category:"core",icon:m.CursorTextIcon,group:"typography",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},He=e=>{const{blockProps:o,styles:t,content:l,children:s=null,tag:i}=e;return s?b.createElement("span",{...t,...o},s):b.createElement(i||"span",{...t,...o,dangerouslySetInnerHTML:{__html:l||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},De=e=>e.inBuilder||e.forceWrapper?r.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ve={type:"Text",description:"A text component with no styling",label:"Text",category:"core",group:"typography",blocks:()=>[{_id:"a",_type:"Text",_name:"Text",content:""}],icon:m.SpaceBetweenVerticallyIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},v={type:"object",title:"Controls",default:{autoplay:!0,controls:!1,loop:!0,muted:!0},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}},j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,L=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=u.get(o,"autoplay",!1),l=u.get(o,"controls",!1),s=u.get(o,"loop",!1),i=t||u.get(o,"muted",!0);if(j.test(e)){const n=e.match(j);if(n){const c=n[4],p=`https://www.youtube.com/embed/${c}`,g=[];return t&&g.push("autoplay=1"),s&&g.push("loop=1",`playlist=${c}`),i&&g.push("mute=1","muted=1"),g.push(l?"controls=1":"controls=0"),`${p}?${g.join("&")}`}}if(L.test(e)){const n=e.match(L);if(n){const c=n[1],p=[];return t&&p.push("autoplay=1"),p.push(l?"controls=1":"controls=0"),i&&p.push("muted=1"),s&&p.push("loop=1"),`https://player.vimeo.com/video/${c}?${p.join("&")}`}}return null},Fe=e=>{const{url:o,blockProps:t,styles:l,controls:s,videoSource:i,inBuilder:n,title:c}=e,p=ze(o,s);return r.jsxs("div",{...u.omit(l,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!p&&n?r.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${i} video link in settings Video URL.`:`Provided ${i} video link is invalid.`}):r.jsx("iframe",{className:`absolute left-0 top-0 h-full w-full ${u.pick(l,"className").className||""}`,src:p??"",title:c||"Video player",loading:"lazy",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),n&&r.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Ue=e=>{const{url:o,styles:t,controls:l,sources:s,poster:i,blockProps:n,title:c}=e;let p=i;const g=[...u.get(s,"srcsets",[])||[]];o&&typeof o=="string"&&g.push({url:o,width:9999});const y=g.sort((f,h)=>f.width-h.width).filter(f=>!u.isEmpty(f.url)&&!u.isEmpty(f.width));y.length===0&&!p&&(p="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const C=u.get(l,"autoplay",!1)||u.get(l,"muted",!0);return(p||!u.isEmpty(y))&&r.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...n,title:c||"Video player",key:JSON.stringify(y),controls:u.get(l,"controls",!1),autoPlay:u.get(l,"autoplay",!1),loop:u.get(l,"loop",!1),poster:p,...C?{muted:!0}:{}},y.map(f=>{if(!f.url||f.url.length<4||isNaN(f.width))return null;const h=`(max-width: ${f.width}px)`;return r.jsx("source",{src:f.url,media:h,type:f.type},f.url)}),"Your browser does not support the video tag.")})},qe=e=>{const{videoSource:o}=e;return o==="Custom"?r.jsx(Ue,{...e}):o==="Youtube"||o==="Vimeo"?r.jsx(Fe,{...e}):r.jsxs("div",{children:["Invalid video source : ",o]})},Oe={type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"},title:{type:"string",title:"Video Title",default:"Video player"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...v}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...v}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...v}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url","title"]},Ze=e=>{const{paginationStyles:o}=e,t=d.getRegisteredChaiBlock("Pagination");return r.jsx("div",{...o,children:t?b.createElement(t.component,{...u.omit(e,["paginationStyles"]),blockProps:{}}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:!0,children:r.jsx(m.ChevronLeftIcon,{className:"h-4 w-4"})}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white",children:"1"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"2"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"3"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"4"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"5"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50",children:r.jsx(m.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ge=e=>{const{children:o,tag:t,styles:l,blockProps:s,$loading:i}=e,{pagination:n,inBuilder:c}=e;let p=o;return u.isEmpty(p)&&c&&(p=r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?i&&c?Array.from({length:2}).map((g,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p:r.jsxs(r.Fragment,{children:[b.createElement(t,{...s,...l},i&&c?Array.from({length:2}).map((g,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p),n&&r.jsx(Ze,{...u.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},We={type:"Repeater",label:"Repeater",icon:m.LoopIcon,group:"basic",description:"Repeater block is used to display a list of items based on data binding in repeaterItems",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:a.stylesProp("flex items-center justify-center gap-2 p-4"),repeaterItems:{title:"Collection",type:"string",binding:"array",default:"",ui:{"ui:widget":"repeaterBinding","ui:readonly":!0}},tag:{title:"Tag",type:"string",default:"ul",enum:["none","div","ul","ol"]},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},pagination:{title:"Pagination",type:"boolean",default:!1}},allOf:[{if:{properties:{pagination:{const:!0}}},then:{properties:{paginationStrategy:{type:"string",title:"Pagination Strategy",default:"segment",enum:["query","segment"]},limit:{type:"number",title:"Items Per Page",default:10,minimum:1}}}},{if:{properties:{pagination:{const:!1}}},then:{properties:{limit:{type:"number",title:"Max items",default:10,minimum:1}}}}]}),canAcceptBlock:e=>e==="Pagination"},Ye=({children:e,blockProps:o,styles:t,parentTag:l,inBuilder:s})=>{let i="li";switch(l){case"ul":i="li";break;case"ol":i="li";break;default:i="div"}return!e&&s?b.createElement(i,{...o,...t},r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Add children to repeater item"})):b.createElement(i,{...o,...t},e)},Qe={type:"RepeaterItem",label:"Repeater Item",icon:m.LoopIcon,hidden:!0,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),parentTag:d.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>b.createElement("div",{...o,...t},e),Xe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ke=()=>{d.registerChaiBlock(_,N),d.registerChaiBlock(Q,J),d.registerChaiBlock(T,E),d.registerChaiBlock(ge,he),d.registerChaiBlock(Ee,Re),d.registerChaiBlock(He,$e),d.registerChaiBlock(Ae,Me),d.registerChaiBlock(je,Le),d.registerChaiBlock(Se,_e),d.registerChaiBlock(Ne,Te),d.registerChaiBlock(V,z),d.registerChaiBlock(ve,Ie),d.registerChaiBlock(qe,Oe),d.registerChaiBlock(R,A),d.registerChaiBlock(M,H),d.registerChaiBlock(De,Ve),d.registerChaiBlock(ee,te),d.registerChaiBlock(oe,le),d.registerChaiBlock(se,ie),d.registerChaiBlock(X,K),d.registerChaiBlock(ce,pe),d.registerChaiBlock(de,ue),d.registerChaiBlock(me,ye),d.registerChaiBlock(ae,ne),d.registerChaiBlock(be,fe),d.registerChaiBlock(W,Y),d.registerChaiBlock($,D),d.registerChaiBlock(F,U),d.registerChaiBlock(Z,G),d.registerChaiBlock(q,O),d.registerChaiBlock(Ge,We),d.registerChaiBlock(Ye,Qe),d.registerChaiBlock(Je,Xe)};exports.loadWebBlocks=Ke;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("lodash-es"),r=require("react/jsx-runtime"),a=require("./runtime.cjs"),P=require("./common-functions-B3a4xKt_.cjs"),x=require("react"),m=require("@radix-ui/react-icons"),d=require("./core-czmLeR0h.cjs");function S(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=S(x),k=({className:e="",inBuilder:o})=>o?r.jsx("div",{className:P.cn("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:r.jsx("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,_=e=>{const{blockProps:o,inBuilder:t,backgroundImage:l,children:s,tag:i="div",styles:n}=e;let c=s;s||(c=r.jsx(k,{inBuilder:t}));let p={};return l&&(p={backgroundImage:`url(${l})`}),b.createElement(i,{...o,...n,style:p},c)},N={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]},backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}}),canAcceptBlock:()=>!0},T=e=>{const{blockProps:o,iconSize:t,icon:l,content:s,styles:i,children:n,iconPos:c,link:p,inBuilder:g}=e,y=l,C=n||r.jsxs(r.Fragment,{children:[s&&r.jsx("span",{children:s}),y&&r.jsx("div",{style:{width:t+"px"},className:c+" "+(s?c==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:y}})]}),f=x.createElement("button",{...o,...i,type:"button","aria-label":s},C);return u.isEmpty(u.get(p,"href"))?f:g?r.jsx("span",{children:f}):r.jsx("a",{"aria-label":s,href:u.get(p,"href")||"/",target:u.get(p,"target","_self"),children:f})},E={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:m.ButtonIcon,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("text-primary-foreground bg-primary px-4 py-2 rounded-lg flex items-center"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"],enumNames:["Left","Right"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!0,title:"Prefetch Link"}}}),i18nProps:["content","link"],aiProps:["content"]},R=e=>{const{blockProps:o,styles:t,htmlCode:l,inBuilder:s}=e;return s?r.jsxs("div",{className:"relative",...o,children:[s?r.jsx("div",{...t,className:"absolute z-20 h-full w-full"}):null,b.createElement("div",{...t,dangerouslySetInnerHTML:{__html:l.replace(/<script.*?>.*?<\/script>/g,"")}})]}):b.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:l}})},A={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:m.CodeIcon,group:"advanced",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]},M=e=>{const{scripts:o,inBuilder:t,blockProps:l}=e;return t?r.jsx("div",{...l,children:r.jsx("div",{className:P.cn("pointer-events-none flex flex-col items-center justify-center p-2",""),children:r.jsx("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:r.jsx("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):r.jsx("div",{dangerouslySetInnerHTML:{__html:o}})},H={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:m.CodeIcon,hidden:!0,group:"advanced",props:a.registerChaiBlockProps({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');<\/script>"}}})},$=e=>{const{blockProps:o,inBuilder:t,children:l,globalBlock:s}=e;return t&&!s?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Global Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},D={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:a.registerChaiBlockProps({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})},I=(e,...o)=>({...e,className:P.cn(e.className,...o)}),V=e=>{const{blockProps:o,icon:t,styles:l,width:s,inBuilder:i,height:n}=e,c=I(l,"");if(u.isEmpty(t))return r.jsx(k,{inBuilder:i,className:"h-8 w-14"});const p=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return b.createElement("span",{...o,...c,style:{width:s?`${s}px`:"auto",height:n?`${n}px`:"auto"},dangerouslySetInnerHTML:{__html:p}})},z={type:"Icon",label:"web_blocks.icon",category:"core",description:"Icon block is used to display an icon/svg.",icon:m.SketchLogoIcon,group:"media",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),icon:{type:"string",title:"Icon",default:'<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})},F=e=>{const{blockProps:o,inBuilder:t,children:l,partialBlockId:s}=e;return t&&!s?r.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[r.jsxs("h1",{children:["Partial Block - ",s]}),r.jsx("p",{children:"Choose a block from the sidebar to add it to this page."})]}):b.createElement("span",{...o},l)},U={type:"PartialBlock",description:"A partial block component. Partial blocks are global blocks that can be used in multiple pages.",label:"Partial Block",icon:m.FrameIcon,category:"core",group:"basic",hidden:!0,props:a.registerChaiBlockProps({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})},w={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},q=e=>{const{blockProps:o,children:t,styles:l,colSpan:s,tabletColSpan:i,desktopColSpan:n}=e,p={className:[u.get(l,"className",""),u.get(w,["SMALL",isNaN(s)||!s?6:s],""),i?u.get(w,["MEDIUM",i||s],""):"",n?u.get(w,["LARGE",i||s],""):""].join(" ")};return r.jsx("div",{...o,...l,...p,children:t||r.jsx("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},O={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:m.LayoutIcon,wrapper:!0,hidden:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Z=e=>{const{blockProps:o,children:t,styles:l,gutter:s}=e,n={className:[u.get(l,"className","")," grid grid-cols-12"].join()};return typeof(l==null?void 0:l.style)=="object"&&l.style!==null?n.style={...l.style,gap:`${s}px`}:n.style={gap:`${s}px`},r.jsx("div",{...o,...l,...n,children:t})},G={type:"Row",description:"A row component",label:"Row",group:"basic",icon:m.RowsIcon,hidden:!0,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})},W=e=>{const{blockProps:o,styles:t}=e;return x.createElement("hr",{...t,...o})},Y={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:m.DividerHorizontalIcon,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("bg-gray-900 h-0.5 py-2 my-1")}})},Q=e=>{const{blockProps:o,styles:t,backgroundImage:l}=e;let s={};return l&&(s={backgroundImage:`url(${l})`}),b.createElement("div",{...o,...t,style:s})},J={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}})},X=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"checkbox",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"checkbox",required:n,defaultChecked:c})},K={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:m.CheckboxIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("flex items-center gap-x-2"),inputStyles:a.stylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},ee=e=>{const{children:o,blockProps:t,errorMessage:l,successMessage:s,action:i,styles:n,inBuilder:c}=e;let p=o;o||(p=r.jsx(k,{inBuilder:c}));const g={"x-data":"{}","x-on:submit.prevent":"post"},y={"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"};return r.jsxs("form",{...g,"data-error":l,"data-success":s,method:"post",action:i,...t,...n,children:[r.jsx("div",{...y}),p]})},te={type:"Form",label:"Form",category:"core",icon:m.FileTextIcon,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0},oe=e=>{const{blockProps:o,inBuilder:t,label:l,styles:s,icon:i,iconSize:n,iconPos:c}=e;return r.jsxs("button",{...s,...o||{},type:t?"button":"submit","aria-label":l,children:[l,i&&r.jsx("div",{style:{width:n+"px"},className:c+" "+(c==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:i}})]})},le={type:"FormButton",label:"Submit Button",category:"core",icon:m.ButtonIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("text-white bg-primary disabled:bg-gray-400 px-4 py-2 rounded-global flex items-center gap-x-2"),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]},re=e=>{const o={type:"text",autoComplete:"on"};return e?["text","password","number","hidden","range","color","date","time"].includes(e)?{type:e,autoComplete:"on"}:e==="email"?{type:"email",autoComplete:"email"}:e==="tel"?{type:"tel",autoComplete:"tel"}:e==="url"?{type:"url",autoComplete:"url"}:{off:{type:"text",autoComplete:"off"},on:{type:"text",autoComplete:"on"},name:{type:"text",autoComplete:"name"},"honorific-prefix":{type:"text",autoComplete:"honorific-prefix"},"given-name":{type:"text",autoComplete:"given-name"},"additional-name":{type:"text",autoComplete:"additional-name"},"family-name":{type:"text",autoComplete:"family-name"},"honorific-suffix":{type:"text",autoComplete:"honorific-suffix"},nickname:{type:"text",autoComplete:"nickname"},firstName:{type:"text",autoComplete:"given-name"},lastName:{type:"text",autoComplete:"family-name"},email:{type:"email",autoComplete:"email"},tel:{type:"tel",autoComplete:"tel"},"tel-country-code":{type:"tel",autoComplete:"tel-country-code"},"tel-national":{type:"tel",autoComplete:"tel-national"},"tel-area-code":{type:"tel",autoComplete:"tel-area-code"},"tel-local":{type:"tel",autoComplete:"tel-local"},"tel-extension":{type:"tel",autoComplete:"tel-extension"},"street-address":{type:"text",autoComplete:"street-address"},"address-line1":{type:"text",autoComplete:"address-line1"},"address-line2":{type:"text",autoComplete:"address-line2"},"address-line3":{type:"text",autoComplete:"address-line3"},"address-level1":{type:"text",autoComplete:"address-level1"},"address-level2":{type:"text",autoComplete:"address-level2"},"address-level3":{type:"text",autoComplete:"address-level3"},"address-level4":{type:"text",autoComplete:"address-level4"},country:{type:"text",autoComplete:"country"},"country-name":{type:"text",autoComplete:"country-name"},"postal-code":{type:"text",autoComplete:"postal-code"},"cc-name":{type:"text",autoComplete:"cc-name"},"cc-given-name":{type:"text",autoComplete:"cc-given-name"},"cc-additional-name":{type:"text",autoComplete:"cc-additional-name"},"cc-family-name":{type:"text",autoComplete:"cc-family-name"},"cc-number":{type:"text",autoComplete:"cc-number"},"cc-exp":{type:"text",autoComplete:"cc-exp"},"cc-exp-month":{type:"number",autoComplete:"cc-exp-month"},"cc-exp-year":{type:"number",autoComplete:"cc-exp-year"},"cc-csc":{type:"text",autoComplete:"cc-csc"},"cc-type":{type:"text",autoComplete:"cc-type"},bday:{type:"date",autoComplete:"bday"},"bday-day":{type:"number",autoComplete:"bday-day"},"bday-month":{type:"number",autoComplete:"bday-month"},"bday-year":{type:"number",autoComplete:"bday-year"},username:{type:"text",autoComplete:"username"},"new-password":{type:"password",autoComplete:"new-password"},"current-password":{type:"password",autoComplete:"current-password"},"one-time-code":{type:"text",autoComplete:"one-time-code"},"transaction-currency":{type:"text",autoComplete:"transaction-currency"},"transaction-amount":{type:"number",autoComplete:"transaction-amount"},url:{type:"url",autoComplete:"url"},photo:{type:"url",autoComplete:"photo"},sex:{type:"text",autoComplete:"sex"},"organization-title":{type:"text",autoComplete:"organization-title"},organization:{type:"text",autoComplete:"organization"},language:{type:"text",autoComplete:"language"}}[e]||o:o},se=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:n,showLabel:c,required:p,inputType:g,defaultValue:y}=e,{type:C,autoComplete:f}=re(g);return c?r.jsxs("div",{...i,...o,children:[c&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("input",{name:t,defaultValue:y,...n,type:C,placeholder:s,required:p,autoComplete:f,...C==="hidden"&&y?{value:y}:{}})]}):r.jsx("input",{name:t,...o,...n,...i,type:C,placeholder:s,required:p,autoComplete:f,defaultValue:y,...C==="hidden"&&y?{value:y}:{}})},ie={type:"Input",label:"web_blocks.input",category:"core",icon:m.InputIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),inputStyles:a.stylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"firstName",title:"First Name"},{const:"lastName",title:"Last Name"},{const:"tel-country-code",title:"Telephone Country Code"},{const:"tel-national",title:"Telephone National"},{const:"tel-area-code",title:"Telephone Area Code"},{const:"tel-local",title:"Telephone Local"},{const:"tel-extension",title:"Telephone Extension"},{const:"street-address",title:"Street Address"},{const:"address-line1",title:"Address Line 1"},{const:"address-line2",title:"Address Line 2"},{const:"address-line3",title:"Address Line 3"},{const:"address-level1",title:"Address Level 1"},{const:"address-level2",title:"Address Level 2"},{const:"address-level3",title:"Address Level 3"},{const:"address-level4",title:"Address Level 4"},{const:"country",title:"Country"},{const:"country-name",title:"Country Name"},{const:"postal-code",title:"Postal Code"},{const:"cc-name",title:"Credit Card Name"},{const:"cc-number",title:"Credit Card Number"},{const:"cc-exp",title:"Credit Card Expiry"},{const:"cc-exp-month",title:"Credit Card Expiry Month"},{const:"cc-exp-year",title:"Credit Card Expiry Year"},{const:"cc-csc",title:"Credit Card CSC"},{const:"cc-type",title:"Credit Card Type"},{const:"bday",title:"Birthday"},{const:"bday-day",title:"Birthday Day"},{const:"bday-month",title:"Birthday Month"},{const:"bday-year",title:"Birthday Year"},{const:"username",title:"Username"},{const:"new-password",title:"New Password"},{const:"current-password",title:"Current Password"},{const:"one-time-code",title:"One Time Code"},{const:"transaction-currency",title:"Transaction Currency"},{const:"transaction-amount",title:"Transaction Amount"},{const:"url",title:"URL"},{const:"photo",title:"Photo"},{const:"sex",title:"Sex"},{const:"organization-title",title:"Organization Title"},{const:"organization",title:"Organization"},{const:"language",title:"Language"}]},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ae=e=>{const{blockProps:o,content:t,styles:l,children:s}=e,i={...l,...o};return s?b.createElement("label",i,s):b.createElement("label",{...i,dangerouslySetInnerHTML:{__html:t}})},ne={type:"Label",label:"Label",category:"core",icon:m.LetterCaseToggleIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]},ce=e=>{const{blockProps:o,fieldName:t,label:l,styles:s,inputStyles:i,required:n,checked:c,showLabel:p=!0}=e;return p?r.jsxs("div",{...s,...o,children:[r.jsx("input",{...i,name:t,type:"radio",required:n,defaultChecked:c}),l&&r.jsx("label",{htmlFor:t,children:l})]}):r.jsx("input",{name:t,...o,...i,...s,type:"radio",required:n,checked:c})},pe={type:"Radio",label:"web_blocks.radio",category:"core",icon:m.RadiobuttonIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("flex items-center gap-x-2"),inputStyles:a.stylesProp(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]},de=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:n,required:c,showLabel:p,_multiple:g,options:y,defaultValue:C}=e,f=g&&C?C.split(",").map(h=>h.trim()):C||"";return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsxs("select",{...n,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,h=>r.jsx("option",{value:h==null?void 0:h.value,children:h==null?void 0:h.label},h==null?void 0:h.value))]})]}):r.jsxs("select",{...i,...o,required:c,multiple:g,name:t,defaultValue:f,children:[r.jsx("option",{value:"",disabled:!0,hidden:!0,children:s}),u.map(y,h=>r.jsx("option",{value:h==null?void 0:h.value,children:h==null?void 0:h.label},h==null?void 0:h.value))]})},ue={type:"Select",label:"web_blocks.select",category:"core",icon:m.DropdownMenuIcon,group:"form",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),inputStyles:a.stylesProp("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},me=e=>{const{blockProps:o,fieldName:t,label:l,placeholder:s,styles:i,inputStyles:n,rows:c,showLabel:p,required:g,defaultValue:y}=e;return p?r.jsxs("div",{...i,...o,children:[p&&r.jsx("label",{htmlFor:t,children:l}),r.jsx("textarea",{name:t,...n,placeholder:s,rows:c,required:g,defaultValue:y})]}):r.jsx("textarea",{name:t,...o,...n,...i,placeholder:s,rows:c,required:g,defaultValue:y})},ye={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:m.InputIcon,group:"form",props:a.registerChaiBlockProps({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:a.stylesProp(""),inputStyles:a.stylesProp("w-full p-1"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]},ge=e=>{const{blockProps:o,styles:t,content:l,tag:s="h1",children:i=null}=e;return i?b.createElement(s,{...t,...o},i):b.createElement(s,{...t,...o,dangerouslySetInnerHTML:{__html:l}})},he={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:m.HeadingIcon,group:"typography",props:a.registerChaiBlockProps({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:a.stylesProp("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea","ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},be=e=>{const{blockProps:o,styles:t}=e;return x.createElement("br",{...o,...t})},fe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},xe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("table",{...o,...l},t):r.jsx(k,{})},Ce=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("thead",{...o,...l},t):r.jsx(k,{})},ke=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tbody",{...o,...l},t):r.jsx(k,{})},Pe=e=>{const{blockProps:o,children:t,styles:l}=e;return t?x.createElement("tr",{...o,...l},t):r.jsx(k,{})},Be=e=>{const{blockProps:o,children:t,content:l,styles:s}=e;return!t&&u.isEmpty(l)?r.jsx(k,{}):t?x.createElement("td",{...o,...s},t):x.createElement("td",{...o,...s,dangerouslySetInnerHTML:{__html:l}})};d.registerChaiBlock(xe,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:m.TableIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("Table")});d.registerChaiBlock(Ce,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:m.BorderTopIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("TableHead")});d.registerChaiBlock(ke,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:m.BorderAllIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("TableBody")});d.registerChaiBlock(Pe,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:m.ViewHorizontalIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),blocks:B("TableRow")});d.registerChaiBlock(Be,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:m.DragHandleHorizontalIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:B("TableCell"),i18nProps:["content"],aiProps:["content"]});function B(e){const o=(i,n)=>({_id:P.generateUUID(),_parent:i,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+n}`}),t=i=>{const n=P.generateUUID(),c={_type:"TableRow",_id:n,styles:"#styles:,border-b"};return i&&(c._parent=i),[c,o(n,"1"),o(n,"2"),o(n,"3")]},l=i=>{const n=P.generateUUID(),c={_id:n,_type:"TableHead",styles:"#styles:,font-medium"};return i&&(c._parent=i),[c,...t(n)]},s=i=>{const n=P.generateUUID(),c={_id:n,_type:"TableBody",styles:"#styles:,"};return i&&(c._parent=i),[c,...t(n),...t(n)]};if(e==="Table"){const i=P.generateUUID();return[{_id:i,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...l(i),...s(i)]}return e==="TableRow"?t():e==="TableHead"?l():e==="TableBody"?s():[]}const we="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",ve=e=>{const{blockProps:o,image:t,mobileImage:l,styles:s,alt:i,height:n,width:c,lazyLoading:p,mobileWidth:g,mobileHeight:y}=e;return u.isEmpty(t)?r.jsx(k,{className:"h-36"}):r.jsxs("picture",{children:[l&&r.jsx("source",{srcSet:l,media:"(max-width: 480px)",width:g,height:y}),r.jsx("img",{...o,...s,src:t,alt:i,loading:p?"lazy":"eager",width:c,height:n})]})},Ie={type:"Image",description:"A image component",label:"Image",category:"core",icon:m.ImageIcon,group:"media",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("w-full h-full object-cover"),image:{type:"string",title:"Image",default:we,ui:{"ui:widget":"image"}},width:{type:"string",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"string",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},mobileWidth:{type:"string",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"string",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0}}}),aiProps:["alt"],i18nProps:["alt","image","_imageId","mobileImage","_mobileImageId"]},je=e=>{const{blockProps:o,link:t,children:l,styles:s,inBuilder:i,content:n}=e;let c={};return!l&&u.isEmpty(n)&&(c={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),i?l?r.jsx("span",{role:"link",...o,style:c,...s,children:l}):x.createElement("span",{...o,...s,style:c,role:"link"},n):l?r.jsx("a",{"aria-label":n,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...s,children:l}):x.createElement("a",{...o,...s,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":n},n)},Le={type:"Link",description:"A link component",label:"Link",category:"core",icon:m.Link1Icon,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("block"),content:{type:"string",default:"Link text goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content","link"],canAcceptBlock:e=>e!=="Link"},Se=e=>{const{blockProps:o,children:t,styles:l,tag:s,inBuilder:i}=e;return!t&&u.isEmpty(l==null?void 0:l.className)?r.jsx(k,{inBuilder:i}):b.createElement(s||"ul",{...o,...l},t)},_e={type:"List",description:"A list component",label:"List",icon:m.RowsIcon,category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("")}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",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"}]},Ne=e=>{const{blockProps:o,content:t,styles:l,children:s,tag:i}=e;return s?b.createElement(i||"li",{...l,...o},s):b.createElement(i||"li",{...l,...o,dangerouslySetInnerHTML:{__html:t}})},Te={type:"ListItem",description:"A list item component",label:"List Item",icon:m.ColumnsIcon,category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"},Ee=e=>{const{blockProps:o,styles:t,content:l}=e;if(!u.isNull(e.children))return b.createElement("p",{...t,...o},e.children);const s=I(t,"rte");return b.createElement("div",{...s,...o,dangerouslySetInnerHTML:{__html:l}})},Re={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:m.TextIcon,group:"typography",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",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.",ui:{"ui:widget":"richtext","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"},Ae=e=>{const{blockProps:o,content:t,styles:l}=e,s=I(l,"rte");return r.jsx("div",{...o,...s,dangerouslySetInnerHTML:{__html:t}})},Me={type:"RichText",description:"A rich text block",label:"Rich Text",hidden:!0,category:"core",icon:m.CursorTextIcon,group:"typography",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]},He=e=>{const{blockProps:o,styles:t,content:l,children:s=null,tag:i}=e;return s?b.createElement("span",{...t,...o},s):b.createElement(i||"span",{...t,...o,dangerouslySetInnerHTML:{__html:l||""}})},$e={type:"Span",description:"A span component",label:"Span",category:"core",group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0},De=e=>e.inBuilder||e.forceWrapper?r.jsx("span",{...e.blockProps,children:e.content}):`${e.content}`,Ve={type:"Text",description:"A text component with no styling",label:"Text",category:"core",group:"typography",blocks:()=>[{_id:"a",_type:"Text",_name:"Text",content:""}],icon:m.SpaceBetweenVerticallyIcon,props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]},v={type:"object",title:"Controls",default:{autoplay:!0,controls:!1,loop:!0,muted:!0},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}},j=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,L=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,ze=(e,o)=>{const t=u.get(o,"autoplay",!1),l=u.get(o,"controls",!1),s=u.get(o,"loop",!1),i=t||u.get(o,"muted",!0);if(j.test(e)){const n=e.match(j);if(n){const c=n[4],p=`https://www.youtube.com/embed/${c}`,g=[];return t&&g.push("autoplay=1"),s&&g.push("loop=1",`playlist=${c}`),i&&g.push("mute=1","muted=1"),g.push(l?"controls=1":"controls=0"),`${p}?${g.join("&")}`}}if(L.test(e)){const n=e.match(L);if(n){const c=n[1],p=[];return t&&p.push("autoplay=1"),p.push(l?"controls=1":"controls=0"),i&&p.push("muted=1"),s&&p.push("loop=1"),`https://player.vimeo.com/video/${c}?${p.join("&")}`}}return null},Fe=e=>{const{url:o,blockProps:t,styles:l,controls:s,videoSource:i,inBuilder:n,title:c}=e,p=ze(o,s);return r.jsxs("div",{...u.omit(l,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!p&&n?r.jsx("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:u.isEmpty(o)?`Provided ${i} video link in settings Video URL.`:`Provided ${i} video link is invalid.`}):r.jsx("iframe",{className:`absolute left-0 top-0 h-full w-full ${u.pick(l,"className").className||""}`,src:p??"",title:c||"Video player",loading:"lazy",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),n&&r.jsx("div",{...t,className:"absolute top-0 h-full w-full"})]})},Ue=e=>{const{url:o,styles:t,controls:l,sources:s,poster:i,blockProps:n,title:c}=e;let p=i;const g=[...u.get(s,"srcsets",[])||[]];o&&typeof o=="string"&&g.push({url:o,width:9999});const y=g.sort((f,h)=>f.width-h.width).filter(f=>!u.isEmpty(f.url)&&!u.isEmpty(f.width));y.length===0&&!p&&(p="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");const C=u.get(l,"autoplay",!1)||u.get(l,"muted",!0);return(p||!u.isEmpty(y))&&r.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:x.createElement("video",{...t,...n,title:c||"Video player",key:JSON.stringify(y),controls:u.get(l,"controls",!1),autoPlay:u.get(l,"autoplay",!1),loop:u.get(l,"loop",!1),poster:p,...C?{muted:!0}:{}},y.map(f=>{if(!f.url||f.url.length<4||isNaN(f.width))return null;const h=`(max-width: ${f.width}px)`;return r.jsx("source",{src:f.url,media:h,type:f.type},f.url)}),"Your browser does not support the video tag.")})},qe=e=>{const{videoSource:o}=e;return o==="Custom"?r.jsx(Ue,{...e}):o==="Youtube"||o==="Vimeo"?r.jsx(Fe,{...e}):r.jsxs("div",{children:["Invalid video source : ",o]})},Oe={type:"Video",label:"Video",category:"core",icon:m.VideoIcon,group:"media",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"},title:{type:"string",title:"Video Title",default:"Video player"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...v}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...v}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...v}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url","title"]},Ze=e=>{const{paginationStyles:o}=e,t=d.getRegisteredChaiBlock("Pagination");return r.jsx("div",{...o,children:t?b.createElement(t.component,{...u.omit(e,["paginationStyles"]),blockProps:{}}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:!0,children:r.jsx(m.ChevronLeftIcon,{className:"h-4 w-4"})}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white",children:"1"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"2"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"3"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"4"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"5"}),r.jsx("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50",children:r.jsx(m.ChevronRightIcon,{className:"h-4 w-4"})})]})})},Ge=e=>{const{children:o,tag:t,styles:l,blockProps:s,$loading:i}=e,{pagination:n,inBuilder:c}=e;let p=o;return u.isEmpty(p)&&c&&(p=r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?i&&c?Array.from({length:2}).map((g,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p:r.jsxs(r.Fragment,{children:[b.createElement(t,{...s,...l},i&&c?Array.from({length:2}).map((g,y)=>r.jsxs("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[r.jsx("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),r.jsx("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},y)):p),n&&r.jsx(Ze,{...u.pick(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},We={type:"Repeater",label:"Repeater",icon:m.LoopIcon,group:"basic",description:"Repeater block is used to display a list of items based on data binding in repeaterItems",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:a.stylesProp("flex items-center justify-center gap-2 p-4"),repeaterItems:{title:"Collection",type:"string",binding:"array",default:"",ui:{"ui:widget":"repeaterBinding","ui:readonly":!0}},tag:{title:"Tag",type:"string",default:"ul",enum:["none","div","ul","ol"]},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},pagination:{title:"Pagination",type:"boolean",default:!1}},allOf:[{if:{properties:{pagination:{const:!0}}},then:{properties:{paginationStrategy:{type:"string",title:"Pagination Strategy",default:"segment",enum:["query","segment"]},limit:{type:"number",title:"Items Per Page",default:10,minimum:1}}}},{if:{properties:{pagination:{const:!1}}},then:{properties:{limit:{type:"number",title:"Max items",default:10,minimum:1}}}}]}),canAcceptBlock:e=>e==="Pagination"},Ye=({children:e,blockProps:o,styles:t,parentTag:l,inBuilder:s})=>{let i="li";switch(l){case"ul":i="li";break;case"ol":i="li";break;default:i="div"}return!e&&s?b.createElement(i,{...o,...t},r.jsx("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Add children to repeater item"})):b.createElement(i,{...o,...t},e)},Qe={type:"RepeaterItem",label:"Repeater Item",icon:m.LoopIcon,hidden:!0,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp(""),parentTag:d.closestBlockProp("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Je=({children:e,blockProps:o,styles:t})=>b.createElement("div",{...o,...t},e),Xe={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",props:a.registerChaiBlockProps({properties:{styles:a.stylesProp("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Ke=()=>{d.registerChaiBlock(_,N),d.registerChaiBlock(Q,J),d.registerChaiBlock(T,E),d.registerChaiBlock(ge,he),d.registerChaiBlock(Ee,Re),d.registerChaiBlock(He,$e),d.registerChaiBlock(Ae,Me),d.registerChaiBlock(je,Le),d.registerChaiBlock(Se,_e),d.registerChaiBlock(Ne,Te),d.registerChaiBlock(V,z),d.registerChaiBlock(ve,Ie),d.registerChaiBlock(qe,Oe),d.registerChaiBlock(R,A),d.registerChaiBlock(M,H),d.registerChaiBlock(De,Ve),d.registerChaiBlock(ee,te),d.registerChaiBlock(oe,le),d.registerChaiBlock(se,ie),d.registerChaiBlock(X,K),d.registerChaiBlock(ce,pe),d.registerChaiBlock(de,ue),d.registerChaiBlock(me,ye),d.registerChaiBlock(ae,ne),d.registerChaiBlock(be,fe),d.registerChaiBlock(W,Y),d.registerChaiBlock($,D),d.registerChaiBlock(F,U),d.registerChaiBlock(Z,G),d.registerChaiBlock(q,O),d.registerChaiBlock(Ge,We),d.registerChaiBlock(Ye,Qe),d.registerChaiBlock(Je,Xe)};exports.loadWebBlocks=Ke;
@@ -5,7 +5,7 @@ import { c as N, g as I } from "./common-functions-D2lMFR6K.js";
5
5
  import * as b from "react";
6
6
  import { createElement as x } from "react";
7
7
  import { ButtonIcon as H, CodeIcon as $, FrameIcon as j, SketchLogoIcon as U, RowsIcon as D, LayoutIcon as Z, DividerHorizontalIcon as q, CheckboxIcon as G, FileTextIcon as W, InputIcon as V, LetterCaseToggleIcon as O, RadiobuttonIcon as Y, DropdownMenuIcon as Q, HeadingIcon as J, TableIcon as X, BorderTopIcon as K, BorderAllIcon as ee, ViewHorizontalIcon as te, DragHandleHorizontalIcon as oe, ImageIcon as le, Link1Icon as re, ColumnsIcon as ne, TextIcon as ie, CursorTextIcon as ae, SpaceBetweenVerticallyIcon as se, VideoIcon as ce, ChevronLeftIcon as pe, ChevronRightIcon as de, LoopIcon as z } from "@radix-ui/react-icons";
8
- import { r as d, e as ue, c as me } from "./core-QlWEXm1d.js";
8
+ import { r as d, f as ue, c as me } from "./core-nSRy3D7z.js";
9
9
  const v = ({ className: e = "", inBuilder: o }) => o ? /* @__PURE__ */ i("div", { className: N("pointer-events-none flex h-20 flex-col items-center justify-center p-2", e), children: /* @__PURE__ */ i("div", { className: "h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800", children: /* @__PURE__ */ i("div", { className: "flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700" }) }) }) : null, ye = (e) => {
10
10
  const { blockProps: o, inBuilder: t, backgroundImage: l, children: r, tag: n = "div", styles: a } = e;
11
11
  let s = r;
@@ -4,7 +4,7 @@ import { B as s } from "./register-chai-top-bar-D6GjnauV.js";
4
4
  import { useAtom as h } from "jotai";
5
5
  import { map as p } from "lodash-es";
6
6
  import { Smartphone as w, Tablet as f, Laptop as u, LaptopMinimal as x } from "lucide-react";
7
- import { p as v, T as _ } from "./index-IQefjAA0.js";
7
+ import { p as v, T as _ } from "./index-CDUCqK5V.js";
8
8
  const b = [
9
9
  {
10
10
  title: "mobile_xs_title",