@chaibuilder/sdk 1.2.26 → 1.2.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddBlocks-l1JENNvq.js → AddBlocks-0sW6gkCO.js} +5 -5
- package/dist/AddBlocks-YJPdSqcY.cjs +1 -0
- package/dist/{BrandingOptions-udtH5yJs.js → BrandingOptions--vgnQvD1.js} +8 -8
- package/dist/{BrandingOptions-DkpqGARR.cjs → BrandingOptions-RDn_Nhcq.cjs} +1 -1
- package/dist/CanvasArea-41QoxuLf.cjs +55 -0
- package/dist/CanvasArea-aii0PyU-.js +1179 -0
- package/dist/{Class-lGzsNBOK.js → Class-6Hz2KzYb.js} +1 -1
- package/dist/{Class-PoYusiA5.cjs → Class-Zc8hpE7f.cjs} +1 -1
- package/dist/{CurrentPage-tJUjXWdb.js → CurrentPage-06Iacwyp.js} +6 -6
- package/dist/{CurrentPage-Hl52iub_.cjs → CurrentPage-2W1pdAOG.cjs} +1 -1
- package/dist/ListTree-DnA8gj-7.js +314 -0
- package/dist/ListTree-pdQ14QJC.cjs +1 -0
- package/dist/MODIFIERS-YPHRtwrM.cjs +1 -0
- package/dist/{MODIFIERS-dytZ-osO.js → MODIFIERS-cBT31iqE.js} +3 -11
- package/dist/{PagesPanel-WzCocl6u.cjs → PagesPanel-PBFzPSNY.cjs} +1 -1
- package/dist/{PagesPanel-6rrLXEO-.js → PagesPanel-_1CDTUdE.js} +7 -7
- package/dist/{ProjectPanel-o7gdcwPn.cjs → ProjectPanel-755bbzEQ.cjs} +1 -1
- package/dist/{ProjectPanel-tz3bjdXy.js → ProjectPanel-pUMeIiUW.js} +7 -7
- package/dist/Settings-G9Xtqr7n.cjs +1 -0
- package/dist/{Settings-4s2LUVmC.js → Settings-dnO-s6x0.js} +596 -560
- package/dist/{SidePanels-3o6Okmvu.cjs → SidePanels-Gq2LdVuY.cjs} +1 -1
- package/dist/{SidePanels-bugFfInz.js → SidePanels-VxSXXkt_.js} +56 -56
- package/dist/{Topbar-pWzBEOed.js → Topbar-5zbOSGF6.js} +3 -3
- package/dist/{Topbar-CqW7G360.cjs → Topbar-J2tb4SA1.cjs} +1 -1
- package/dist/{UnsplashImages-qvwFbV-E.js → UnsplashImages-4WAWgA4s.js} +9 -9
- package/dist/{UnsplashImages-NGskB93R.cjs → UnsplashImages-XwjKheek.cjs} +1 -1
- package/dist/{UploadImages-9NapgXBq.js → UploadImages-PONIHtn6.js} +3 -3
- package/dist/{UploadImages-Oh7Glr9A.cjs → UploadImages-y7LAQVrT.cjs} +1 -1
- package/dist/{add-page-modal-k2Kb92HS.js → add-page-modal-4VrFvgEm.js} +7 -7
- package/dist/{add-page-modal--6TTBRYa.cjs → add-page-modal-jWcp0w-S.cjs} +1 -1
- package/dist/{confirm-alert-C4M9eF-o.cjs → confirm-alert-4OQlXZTJ.cjs} +1 -1
- package/dist/{confirm-alert-GUhZ_G8w.js → confirm-alert-j7b88hsW.js} +3 -3
- package/dist/core.cjs +1 -1
- package/dist/core.js +4 -4
- package/dist/{delete-page-modal-zONvdebd.js → delete-page-modal--xHHdRAq.js} +6 -6
- package/dist/{delete-page-modal-cFoL-wdo.cjs → delete-page-modal-p6b0upz4.cjs} +1 -1
- package/dist/email-blocks.cjs +1 -1
- package/dist/email-blocks.js +1 -1
- package/dist/email.cjs +1 -1
- package/dist/email.js +4 -4
- package/dist/{form-STUz-6nE.js → form-_GJb9YcB.js} +1 -1
- package/dist/{form-lBQ_76Uw.cjs → form-jQj7E-hS.cjs} +1 -1
- package/dist/html-to-json-LJyJsnmZ.js +228 -0
- package/dist/html-to-json-vP1ESB_e.cjs +1 -0
- package/dist/{index-SkyM3d6Q.js → index-0QJwevON.js} +2 -2
- package/dist/index-12HbDLon.cjs +1 -0
- package/dist/{index-llTXLDGE.js → index-Eb5zyh2F.js} +4 -4
- package/dist/{index-mbyqq81O.cjs → index-KArv7pNz.cjs} +1 -1
- package/dist/{index-Gk6sASBd.js → index-UHaqEdws.js} +993 -957
- package/dist/{index-OB199Izc.cjs → index-mlMvwv2b.cjs} +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.js +4 -4
- package/dist/{page-viewer-Pdg9F5Hv.js → page-viewer-00Xx4u8e.js} +7 -7
- package/dist/{page-viewer-2kwnKM6v.cjs → page-viewer-SZNm7b1n.cjs} +1 -1
- package/dist/{project-general-setting-CnNL98NM.cjs → project-general-setting-C_pHNuZE.cjs} +1 -1
- package/dist/{project-general-setting-f8Ebsn6K.js → project-general-setting-asDxlmhZ.js} +7 -7
- package/dist/{project-seo-setting-pX34Qsym.js → project-seo-setting-DuAaDfDR.js} +4 -4
- package/dist/{project-seo-setting-mlxL_e2_.cjs → project-seo-setting-q2953ybQ.cjs} +1 -1
- package/dist/render.cjs +1 -1
- package/dist/render.js +1 -1
- package/dist/{single-page-detail-dpe5LT0M.js → single-page-detail-UNxXvhl4.js} +14 -14
- package/dist/{single-page-detail-XfzrGlzA.cjs → single-page-detail-oqj6zsLU.cjs} +1 -1
- package/dist/studio.cjs +1 -1
- package/dist/studio.js +6 -6
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +9 -9
- package/dist/useCanvasSettings-MR0Glu1b.cjs +1 -0
- package/dist/useCanvasSettings-R6br4J9i.js +6 -0
- package/dist/web-blocks.cjs +33 -6
- package/dist/web-blocks.js +461 -388
- package/package.json +1 -1
- package/dist/AddBlocks-zPPKkeKs.cjs +0 -1
- package/dist/CanvasArea-h0W-Tyha.js +0 -951
- package/dist/CanvasArea-zme1r3Zi.cjs +0 -55
- package/dist/ListTree-WvTjY5rr.cjs +0 -1
- package/dist/ListTree-cZ-Ihlt3.js +0 -309
- package/dist/MODIFIERS-0g14w5RS.cjs +0 -1
- package/dist/Settings-AqoKwR92.cjs +0 -1
- package/dist/html-to-json-efmv1pCj.cjs +0 -1
- package/dist/html-to-json-ngX9ef2u.js +0 -185
- package/dist/index-h-hd6EvN.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),g=require("react"),X=require("@react-hookz/web"),t=require("lodash-es"),_=require("react-i18next"),x=require("@radix-ui/react-icons"),o=require("./index-h-hd6EvN.cjs"),ae=require("./controls-KK2oLIa8.cjs"),M=require("lucide-react"),$=require("@chaibuilder/runtime"),W=require("./index-OB199Izc.cjs"),z=require("./index-gi1LIOCw.cjs"),pe=require("@rjsf/core"),ue=require("@rjsf/validator-ajv8"),de=require("react-autosuggest"),xe=require("fuse.js"),A=require("./Class-PoYusiA5.cjs"),ce=require("./STRINGS-gPz7CUOk.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("./Functions-N3yhPYKY.cjs");require("clsx");require("tailwind-merge");require("jotai");require("./MODIFIERS-0g14w5RS.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-scroll-area");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-dom");require("react-quill");require("i18next");require("@floating-ui/react-dom");require("flagged");require("react-hotkeys-hook");function me(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const r in s)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}return n.default=s,Object.freeze(n)}const O=me(g);function ge(s){const n=[],r={};function a(i,u){t.forEach(u,(l,m)=>{const d=i?`${i}.${m}`:m,c=t.isArray(l)?"list":typeof l;n.push(d),r[d]=c==="string"?"text":c==="object"?"model":c,c==="object"&&!t.isArray(l)&&a(d,l)})}return a("",t.omit(s,["styles","_type","_id","_name","_bindings"])),{paths:n,pathsType:r}}const Z=({data:s,fullView:n})=>{if(!s)return null;const r=typeof s;return n?typeof s=="object"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:"h-3"}),e.jsxRuntimeExports.jsx(W.ErrorBoundary,{children:e.jsxRuntimeExports.jsx(z.JsonView,{data:s,shouldExpandNode:z.allExpanded,style:{...z.defaultStyles,container:"max-h-[40vh] overflow-y-auto text-[12px] leading-[1.5] tracking-wide font-mono",stringValue:"text-orange-600",label:"text-green-900 font-semibold pr-1 tracking-wider"}})})]}):e.jsxRuntimeExports.jsxs("div",{className:"max-h-36 w-full overflow-y-auto overflow-x-hidden text-[12px] leading-4 text-gray-800/50",children:[e.jsxRuntimeExports.jsx("span",{className:"font-medium text-gray-800/80",children:"Content: "}),s]}):e.jsxRuntimeExports.jsx("div",{className:"w-full overflow-hidden whitespace-nowrap text-[10px] leading-3 text-gray-800/50",children:t.truncate(r==="object"?JSON.stringify(s):s,{length:40})})},K=({type:s,value:n="",setValue:r,data:a,onChange:i,dataType:u,appliedBindings:l})=>{const{paths:m,pathsType:d}=ge(a),c=s==="PROP"?$.getBlockComponent(a==null?void 0:a._type):{},j=s==="PROP",[p,y]=g.useState(!1),b=g.useMemo(()=>s==="PROP"?m.filter(h=>!t.includes(l,h)&&t.get(c,`props.${t.first(t.split(h,"."))}.binding`)):m.filter(h=>u===t.get(d,h,"")),[s,m,l,u,c]);return g.useEffect(()=>{n&&i(n)},[n,s]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:t.startCase(t.toLower(s))}),e.jsxRuntimeExports.jsxs(o.Popover,{open:p,onOpenChange:y,children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",size:"sm",className:` ${t.isEmpty(n)?"w-44 justify-center bg-blue-500 text-gray-100 hover:bg-blue-400 hover:text-white":"min-w-[350px] items-center justify-between"}`,children:n?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("span",{className:"pr-8 text-sm",children:[j&&e.jsxRuntimeExports.jsx("span",{className:"mr-2 rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(u)}),n]}),e.jsxRuntimeExports.jsx("span",{className:"cursor-pointer text-[9px] text-blue-400 underline hover:text-blue-700",children:"Change"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:["+ Set ",t.startCase(t.toLower(s))]})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{className:"z-[999] min-w-[300px] p-0",side:"right",align:"start",children:e.jsxRuntimeExports.jsxs(o.Command,{children:[e.jsxRuntimeExports.jsx(o.CommandInput,{placeholder:`Choose ${t.toLower(s)}...`}),e.jsxRuntimeExports.jsxs(o.CommandList,{children:[e.jsxRuntimeExports.jsx(o.CommandEmpty,{children:"No results found."}),e.jsxRuntimeExports.jsx(o.CommandGroup,{children:t.map(b,h=>e.jsxRuntimeExports.jsxs(o.CommandItem,{value:h,className:`cursor-pointer ${j?"flex items-center justify-between":"flex flex-col items-start justify-start"}`,onSelect:v=>{r(t.find(b,E=>E===v)||null),y(!1)},children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx(M.Check,{className:`h-4 w-4 text-green-500 ${n===h?"":"opacity-0"}`}),h]}),j?e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx("span",{className:"rounded-full bg-purple-100 px-2 py-0.5 text-[10px] text-purple-500",children:t.startCase(t.get(d,h,""))})}):e.jsxRuntimeExports.jsx("div",{className:"pl-6",children:e.jsxRuntimeExports.jsx(Z,{data:t.get(a,h)})})]},h))})]})]})})]})]}),!j&&!t.isEmpty(n)&&e.jsxRuntimeExports.jsx("div",{className:"pt-2",children:e.jsxRuntimeExports.jsx(Z,{data:t.get(a,n,""),fullView:!0})})]})},he=({appliedBindings:s=[],onAddBinding:n,editMode:r,item:a})=>{const[i,u]=g.useState(r?a.key:""),[l,m]=g.useState(r?a.value:""),d=o.useSelectedBlock(),[c]=W.useChaiExternalData(),j=g.useCallback((b,h)=>{if(t.isEmpty(b))return"";{const v=t.get(h==="PROP"?d:c,b,"");if(t.isArray(v))return"list";const E=typeof v;return E==="string"?"text":E==="object"?"model":E}},[d,c]),[p,y]=g.useState(r?j(a.key,"PROP"):"");return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DialogHeader,{children:[e.jsxRuntimeExports.jsx(o.DialogTitle,{children:"Add Data Binding"}),e.jsxRuntimeExports.jsx(o.DialogDescription,{className:"text-xs",children:"Add prop and path of binding. Click save when you're done."})]}),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col gap-1",children:[e.jsxRuntimeExports.jsx(K,{type:"PROP",isDisabled:!1,placeholder:"Enter prop key",value:i,setValue:u,onChange:b=>{const h=j(b,"PROP");u(b),p!==h&&m(""),y(h)},data:d,dataType:p,appliedBindings:s}),e.jsxRuntimeExports.jsx("div",{className:"h-2"}),e.jsxRuntimeExports.jsx(K,{type:"PATH",isDisabled:t.isEmpty(i),placeholder:"Enter data path",value:l,setValue:m,onChange:b=>{const h=j(b,"PATH");m(p===h?b:"")},data:c,dataType:p,appliedBindings:s})]}),e.jsxRuntimeExports.jsx(o.DialogFooter,{children:e.jsxRuntimeExports.jsx(o.Button,{type:"submit",className:"mt-4",disabled:t.isEmpty(i)&&t.isEmpty(l),onClick:()=>n({key:i,value:l}),children:"Save"})})]})},se=({disabled:s,children:n,onAddBinding:r,appliedBindings:a,editMode:i=!0,item:u={}})=>{const[l,m]=g.useState(!1);return e.jsxRuntimeExports.jsxs(o.Dialog,{children:[e.jsxRuntimeExports.jsx(o.DialogTrigger,{disabled:s,asChild:!0,onClick:()=>m(!0),children:n}),l&&e.jsxRuntimeExports.jsx(o.DialogContent,{children:e.jsxRuntimeExports.jsx(he,{item:u,editMode:i,appliedBindings:a,onAddBinding:d=>{r(d),m(!1)}})})]})},ye=({item:s,onAddBinding:n,onRemove:r,selectedBlock:a,dataProvider:i,appliedBindings:u})=>{const[l,m]=g.useState("string"),d=(c,j)=>{if(t.isEmpty(c))return"";{const p=t.get(j==="PROP"?a:i,c,"");if(t.isArray(p))return"list";const y=typeof p;return y==="string"?"text":y==="object"?"model":y}};return g.useEffect(()=>m(()=>d(s.key,"PROP")),[s.key]),e.jsxRuntimeExports.jsxs("div",{className:"relative flex flex-col rounded-md border border-gray-200 p-2",children:[e.jsxRuntimeExports.jsx("div",{className:"text-sm font-normal text-gray-500",children:s.key}),e.jsxRuntimeExports.jsx("div",{className:"font-medium leading-5",children:s.value}),e.jsxRuntimeExports.jsx(Z,{data:t.get(i,s.value,"")}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-2",children:[e.jsxRuntimeExports.jsx(se,{editMode:!0,onAddBinding:n,appliedBindings:u,item:s,children:e.jsxRuntimeExports.jsx(M.EditIcon,{className:"mt-1 h-6 w-6 cursor-pointer rounded border border-blue-400 p-1 text-blue-400 duration-200 hover:scale-105 hover:bg-blue-400 hover:text-white"})}),e.jsxRuntimeExports.jsx(M.TrashIcon,{onClick:()=>r(),className:"mt-1 h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 duration-200 hover:scale-105 hover:bg-red-400 hover:text-white"})]}),!t.isEmpty(l)&&!t.isEmpty(s.key)&&e.jsxRuntimeExports.jsx("div",{className:"absolute right-0 top-1 mt-px flex h-4 items-center rounded-full px-2 text-[10px] font-medium text-purple-600",children:t.startCase(l)})]})},je=({bindingData:s,onChange:n})=>{const r=o.useSelectedBlock(),[a]=W.useChaiExternalData(),i=$.getChaiDataProviders(),[u,l]=g.useState(t.map(s,(p,y)=>({key:y,value:p})));g.useEffect(()=>{l(t.map(s,(p,y)=>({key:y,value:p})))},[r==null?void 0:r._id,s]);const m=g.useMemo(()=>{if(t.isEmpty(a))return!0;if(t.isEmpty(u))return!1;const p=t.last(u);return t.isEmpty(p==null?void 0:p.key)||t.isEmpty(p==null?void 0:p.value)},[a,u]),d=p=>{const y=t.filter(u,b=>b.key!==p.key);l([...y,p]),j([...y,p])},c=p=>{const y=t.filter(u,(b,h)=>p!==h);j([...y])},j=g.useCallback((p=[])=>{if(l(p),t.isEmpty(p)){n({});return}const y={};t.forEach(p,b=>{!t.isEmpty(b==null?void 0:b.key)&&!t.isEmpty(b==null?void 0:b.value)&&t.set(y,b.key,b.value)}),n(y)},[n]);return t.isEmpty(i)?e.jsxRuntimeExports.jsx("div",{className:"flex w-full items-center justify-center",children:e.jsxRuntimeExports.jsxs("p",{className:"mb-1.5 text-xs text-gray-500",children:["You have no data providers registered. Please add a data provider to your project. ",e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsx("a",{className:"text-blue-500",href:"https://chaibuilder.com/docs/registering-data-providers",target:"_blank",children:"Learn more"})]})}):e.jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[t.map(u,(p,y)=>e.jsxRuntimeExports.jsx(ye,{item:p,onAddBinding:d,onRemove:()=>c(y),selectedBlock:r,dataProvider:a,appliedBindings:t.map(u,"key")},p.key)),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:200,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{disabled:t.isEmpty(a),className:"w-full",children:e.jsxRuntimeExports.jsx(se,{disabled:m,appliedBindings:t.map(u,"key"),onAddBinding:d,children:e.jsxRuntimeExports.jsx("span",{className:`w-full rounded-md px-5 py-1.5 text-xs font-medium duration-200 ${m?"cursor-not-allowed bg-gray-200 text-gray-400":"bg-blue-700/20 text-blue-800 hover:bg-blue-700/30"}`,children:t.isEmpty(a)?e.jsxRuntimeExports.jsx("small",{className:"text-[9.5px] text-gray-500",children:"No data provider has been set up for this page"}):"+ Add Data Binding"})})}),m&&e.jsxRuntimeExports.jsx(o.TooltipContent,{sideOffset:-55,className:"text-[11px]",children:t.isEmpty(a)?"No data provider has been set up for this page.":"Complete last added data binding to add more"})]})]})},be=()=>e.jsxRuntimeExports.jsx("div",{className:"text-xs border rounded-sm p-1 mt-1 border-orange-500 text-orange-500 bg-orange-100",children:"Data binding is set for this field"}),F=g.memo(({id:s,properties:n,formData:r,onChange:a})=>{const[i,u]=g.useState(r),l={type:"object",properties:{}},m={};return Object.keys(n).forEach(d=>{const c=n[d];if(t.includes(["slot","styles"],c.type))return;const j=d;l.properties[j]=o.getBlockJSONFromSchemas(c),m[j]=o.getBlockJSONFromUISchemas(c)}),g.useEffect(()=>{u(r)},[s]),e.jsxRuntimeExports.jsx(pe,{widgets:{binding:be,richtext:o.RichTextEditorField,icon:o.IconPickerField,image:o.ImagePickerField},fields:{link:o.LinkField},idSeparator:".",autoComplete:"off",omitExtraData:!1,liveOmit:!1,liveValidate:!1,validator:ue,uiSchema:m,schema:l,formData:i,onChange:({formData:d},c)=>{c&&(u(d),a({formData:d},c))}})});function fe(){const s=o.useSelectedBlock(),n=o.useUpdateBlocksPropsRealtime(),r=o.useUpdateBlocksProps(),a=$.getBlockComponent(s._type),i={...s},[u,l]=g.useState(i),m=o.useBuilderProp("dataBindingSupport",!1),d=({formData:h},v,E)=>{if(v&&(u==null?void 0:u._id)===s._id){const S=v.replace("root.","");r([s._id],{[S]:t.get(h,S)},E)}},c=g.useCallback(t.debounce(({formData:h},v,E)=>{d({formData:h},v,E),l(h)},1500),[s==null?void 0:s._id]),j=({formData:h},v)=>{if(v){const E=v.replace("root.","");n([s._id],{[E]:t.get(h,E)}),c({formData:h},v,{[E]:t.get(u,E)})}},p={_name:ae.u({title:"Name",default:t.get(s,"_name",s._type)})},y=t.keys(t.get(i,"_bindings",{})),b=g.useMemo(()=>{const h=t.cloneDeep(t.get(a,"props",{}));return m&&t.each(y,v=>delete h[v]),h},[a,y,m]);return e.jsxRuntimeExports.jsxs("div",{className:"overflow-x-hidden",children:[e.jsxRuntimeExports.jsx(F,{id:s==null?void 0:s._id,onChange:j,formData:i,properties:p}),e.jsxRuntimeExports.jsx("hr",{className:"mt-4"}),m?e.jsxRuntimeExports.jsxs(o.Accordion,{type:"multiple",defaultValue:["STATIC","BINDING"],className:"h-full w-full",children:[e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"BINDING",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${t.isEmpty(t.get(s,"_bindings",{}))?"bg-gray-300":"bg-blue-500"}`}),"Data Binding"]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"px-4 pt-4",children:e.jsxRuntimeExports.jsx(je,{bindingData:t.get(s,"_bindings",{}),onChange:h=>{d({formData:{_bindings:h}},"root._bindings")}})})]}),e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:"STATIC",children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"bg-gray-100 px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:"h-[8px] w-[8px] rounded-full bg-blue-500"}),"Static Content"]})}),e.jsxRuntimeExports.jsxs(o.AccordionContent,{className:"pt-4",children:[t.isEmpty(y)?null:e.jsxRuntimeExports.jsxs("div",{className:"mx-4 mb-1 mt-0 rounded-sm border border-orange-500 bg-orange-100 p-1 text-xs text-orange-500",children:["Data binding is set for ",e.jsxRuntimeExports.jsx("b",{children:t.map(y,t.capitalize).join(", ")})," ",y.length===1?"property":"properties",". Remove data binding to edit static content."]}),e.jsxRuntimeExports.jsx(F,{id:s==null?void 0:s._id,onChange:j,formData:i,properties:b})]})]})]}):e.jsxRuntimeExports.jsx(F,{id:s==null?void 0:s._id,onChange:j,formData:i,properties:b}),e.jsxRuntimeExports.jsx("div",{className:"pb-60"})]})}const J=new xe(A.ALL_TW_CLASSES,{isCaseSensitive:!1,threshold:.2,minMatchCharLength:2,keys:["name"]});function ve(){var S;const[s]=o.useSelectedStylingBlocks(),n=o.useSelectedBlock(),r=o.useAddClassesToBlocks(),a=o.useRemoveClassesFromBlocks(),[i]=o.useSelectedBlockIds(),[u,l]=g.useState(""),m=(S=t.first(s))==null?void 0:S.prop,d=t.reject((t.get(n,m,"").replace(ce.STYLES_KEY,"").split(",").pop()||"").split(" "),t.isEmpty),c=()=>{const w=u.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");r(i,w,!0),l("")},[j,p]=g.useState([]),y=({value:w})=>{const I=w.trim().toLowerCase(),H=I.match(/.+:/g);let C=[];if(H&&H.length>0){const[T]=H,V=I.replace(T,"");C=J.search(V).map(f=>({...f,item:{...f.item,name:T+f.item.name}}))}else C=J.search(I);p(t.map(C,"item"))},b=()=>{p([])},h=w=>w.name,v=w=>e.jsxRuntimeExports.jsx("div",{className:"rounded-md p-1",children:w.name}),E={autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Enter class name",value:u,onKeyDown:w=>{w.key==="Enter"&&u.trim()!==""&&c()},onChange:(w,{newValue:I})=>l(I),className:"w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"};return e.jsxRuntimeExports.jsxs("div",{className:`no-scrollbar flex ${j.length>0?"min-h-[300px]":"min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,children:[e.jsxRuntimeExports.jsx(o.Label,{className:"mt-2",children:"Add Tailwind classes"}),e.jsxRuntimeExports.jsxs("div",{className:"relative -mt-4 flex items-center gap-x-3",children:[e.jsxRuntimeExports.jsx("div",{className:"relative flex w-full items-center gap-x-3",children:e.jsxRuntimeExports.jsx(de,{suggestions:j,onSuggestionsFetchRequested:y,onSuggestionsClearRequested:b,getSuggestionValue:h,renderSuggestion:v,inputProps:E,containerProps:{className:"relative h-8 w-full gap-y-1 py-1 border-gray-600"},theme:{suggestion:"bg-transparent",suggestionHighlighted:"bg-gray-700 ",suggestionsContainerOpen:"absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"}})}),e.jsxRuntimeExports.jsx(o.Button,{variant:"outline",className:"h-6 border-gray-700",onClick:c,disabled:u.trim()==="",size:"sm",children:e.jsxRuntimeExports.jsx(x.PlusIcon,{})})]}),e.jsxRuntimeExports.jsxs("div",{className:"flex w-full flex-wrap gap-2",children:[t.isEmpty(d)&&e.jsxRuntimeExports.jsx("div",{className:"flex h-10 w-full items-center justify-center text-center text-sm text-gray-400",children:"No class added"}),O.Children.toArray(d.map(w=>e.jsxRuntimeExports.jsxs("div",{className:"group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",children:[w,e.jsxRuntimeExports.jsx(x.Cross2Icon,{onClick:()=>a(i,[w]),className:"invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"})]},w)))]})]})}const N=["px","%","em","rem","ch","vh","vw"],Re={heading:"flex.heading",items:[{type:"arbitrary",label:"flex.basis",units:N,property:"flexBasis"},{type:"range",label:"flex.order",property:"order"},{type:"dropdown",label:"flex.flex",property:"flexGrowShrink"},{type:"dropdown",label:"flex.grow",property:"flexGrow"},{type:"dropdown",label:"flex.shrink",property:"flexShrink"}]},Ee={heading:"grid.heading",items:[{type:"range",label:"grid.col_span",property:"gridColSpan"},{type:"range",label:"grid.col_start",property:"gridColStart"},{type:"range",label:"grid.col_end",property:"gridColEnd"},{type:"range",label:"grid.row_span",property:"gridRowSpan"},{type:"range",label:"grid.row_start",property:"gridRowStart"},{type:"range",label:"grid.row_end",property:"gridRowEnd"},{type:"range",label:"grid.order",property:"order"}]},we=[{heading:"layout.heading",items:[{type:"arbitrary",label:"layout.width",units:N.concat("auto"),property:"width"},{type:"arbitrary",label:"layout.height",units:N.concat("auto"),property:"height"},{styleType:"multiple",label:"layout.margin",negative:!0,units:[...N,"auto"],options:[{key:"margin",label:"layout.margin_all"},{key:"marginX",label:"layout.margin_lr"},{key:"marginY",label:"layout.margin_tb"},{key:"marginTop",label:"layout.margin_top"},{key:"marginRight",label:"layout.margin_right"},{key:"marginBottom",label:"layout.margin_bottom"},{key:"marginLeft",label:"layout.margin_left"}]},{styleType:"multiple",label:"layout.padding",options:[{key:"padding",label:"layout.padding_all"},{key:"paddingX",label:"layout.padding_lr"},{key:"paddingY",label:"layout.padding_tb"},{key:"paddingTop",label:"layout.padding_top"},{key:"paddingRight",label:"layout.padding_right"},{key:"paddingBottom",label:"layout.padding_bottom"},{key:"paddingLeft",label:"layout.padding_left"}]},{styleType:"multiple",label:"layout.space_bt",options:[{key:"spaceX",label:"layout.space_lr"},{key:"spaceY",label:"layout.space_tb"}]}]},{heading:"size.heading",items:[{styleType:"accordion",heading:"size.min_width_height",items:[{type:"arbitrary",label:"size.min_width",units:N.concat("auto"),property:"minWidth"},{type:"arbitrary",label:"size.min_height",units:N.concat("auto"),property:"minHeight"}]},{styleType:"accordion",heading:"size.max_width_height",items:[{type:"arbitrary",label:"size.max_width",units:N.concat("auto"),property:"maxWidth"},{type:"arbitrary",label:"size.max_height",units:N.concat("auto"),property:"maxHeight"}]},{styleType:"accordion",heading:"size.object_options_aspect_ratio",items:[{type:"dropdown",label:"size.aspect",property:"aspectRatio"},{type:"dropdown",label:"size.fit",property:"objectFit"},{type:"dropdown",label:"size.position",property:"objectPosition"}]}]},{heading:"display.heading",items:[{type:"dropdown",label:"display.display",property:"display",units:N},{styleType:"accordion",heading:"display.flex_options",items:[{type:"dropdown",label:"display.flex_direction",property:"flexDirection"},{type:"dropdown",label:"display.flex_wrap",property:"flexWrap"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"flex"}},{styleType:"accordion",heading:"display.grid_options",items:[{type:"range",label:"display.grid_columns",property:"gridColumns"},{type:"range",label:"display.grid_rows",property:"gridRows"},{type:"dropdown",label:"display.grid_auto_flow",property:"gridAutoFlow"},{type:"dropdown",label:"display.grid_auto_cols",property:"gridAutoColumns"},{type:"dropdown",label:"display.grid_auto_rows",property:"gridAutoRows"},{type:"dropdown",label:"display.justify_content",property:"justifyContent"},{type:"dropdown",label:"display.align_content",property:"alignContent"},{type:"dropdown",label:"display.align_items",property:"alignItems"},{styleType:"multiple",label:"display.gap",units:["px","rem"],options:[{key:"gap",label:"display.gap_all"},{key:"gapX",label:"display.gap_lr"},{key:"gapY",label:"display.gap_tb"}]}],conditions:{display:"grid"}},{styleType:"accordion",heading:"display.visibility_opacity",items:[{type:"dropdown",label:"display.visibility",property:"visibility",units:N},{type:"arbitrary",label:"display.opacity",property:"opacity",units:["-"]}]}]},{heading:"position.heading",items:[{type:"icons",label:"position.position",property:"position"},{styleType:"accordion",heading:"position.options",items:[{styleType:"multiple",label:"position.direction",options:[{key:"top",label:"position.top"},{key:"right",label:"position.right"},{key:"bottom",label:"position.bottom"},{key:"left",label:"position.left"}]},{styleType:"multiple",label:"position.inset",options:[{key:"inset",label:"position.all"},{key:"insetX",label:"position.lr"},{key:"insetY",label:"position.tb"}]},{type:"arbitrary",label:"position.z_index",units:["-","auto"],property:"zIndex"}]},{styleType:"accordion",heading:"position.float_clear",items:[{type:"icons",label:"position.float",property:"float"},{type:"dropdown",label:"position.clear",property:"clear"}]},{styleType:"accordion",heading:"position.overflow_overscroll",items:[{styleType:"multiple",type:"dropdown",label:"position.overflow",options:[{key:"overflow",label:"position.all"},{key:"overflowX",label:"position.lr"},{key:"overflowY",label:"position.tb"}]},{styleType:"multiple",type:"dropdown",label:"position.overscroll",options:[{key:"overscroll",label:"position.all"},{key:"overscrollX",label:"position.lr"},{key:"overscrollY",label:"position.tb"}]}]}]},{heading:"typography.heading",items:[{type:"dropdown",property:"fontFamily",label:"typography.font"},{type:"arbitrary",property:"fontSize",label:"typography.size",units:N},{type:"arbitrary",property:"lineHeight",label:"typography.height",units:N.concat("-")},{type:"range",property:"fontWeight",label:"typography.weight"},{type:"color",property:"textColor",label:"typography.color"},{styleType:"accordion",heading:"typography.alignments",items:[{type:"dropdown",property:"textAlign",label:"typography.align"},{type:"dropdown",property:"verticalAlign",label:"typography.valign"}]},{styleType:"accordion",heading:"typography.spacing_decoration_more",items:[{type:"dropdown",property:"letterSpacing",label:"typography.spacing"},{type:"dropdown",property:"textDecoration",label:"typography.decoration"},{type:"range",property:"textDecorationThickness",label:"typography.thickness"},{type:"dropdown",property:"textTransform",label:"typography.transform"}]},{styleType:"accordion",heading:"typography.whitespace_breaks",items:[{type:"dropdown",property:"whitespace",label:"typography.whitespace"},{type:"dropdown",property:"wordbreak",label:"typography.wordbreak"}]}]},{heading:"background.heading",items:[{type:"color",label:"background.bgcolor",property:"backgroundColor"},{styleType:"accordion",heading:"background.position_size_more",items:[{type:"dropdown",label:"background.attachment",property:"backgroundAttachment"},{type:"dropdown",label:"background.clipping",property:"backgroundClip"},{type:"dropdown",label:"background.origin",property:"backgroundOrigin"},{type:"dropdown",label:"background.position",property:"backgroundPosition"},{type:"dropdown",label:"background.repeat",property:"backgroundRepeat"},{type:"dropdown",label:"background.size",property:"backgroundSize"}]},{type:"dropdown",label:"background.gradient",property:"backgroundGradient"},{styleType:"accordion",heading:"background.gradient_colors",items:[{type:"color",label:"background.from_color",property:"fromColor"},{type:"color",label:"background.via_color",property:"viaColor"},{type:"color",label:"background.to_color",property:"toColor"}]}]},{heading:"border.heading",items:[{styleType:"multiple",type:"dropdown",label:"border.width",options:[{key:"border",label:"border.all"},{key:"borderX",label:"border.lr"},{key:"borderY",label:"border.tb"},{key:"borderTop",label:"border.top"},{key:"borderRight",label:"border.right"},{key:"borderBottom",label:"border.bottom"},{key:"borderLeft",label:"border.left"}]},{styleType:"multiple",type:"dropdown",label:"border.corners",options:[{key:"borderRadius",label:"border.all"},{key:"borderRadiusTop",label:"border.top"},{key:"borderRadiusRight",label:"border.right"},{key:"borderRadiusBottom",label:"border.bottom"},{key:"borderRadiusLeft",label:"border.left"},{key:"borderRadiusTopLeft",label:"border.top_left"},{key:"borderRadiusTopRight",label:"border.top_right"},{key:"borderRadiusBottomRight",label:"border.bottom_right"},{key:"borderRadiusBottomLeft",label:"border.bottom_left"}]},{type:"color",label:"border.color",property:"borderColor"},{type:"dropdown",label:"border.style",property:"borderStyle"},{styleType:"accordion",heading:"border.divide_options",items:[{styleType:"multiple",type:"range",label:"border.width",options:[{key:"divideXWidth",label:"border.lr"},{key:"divideYWidth",label:"border.tb"}]},{type:"color",label:"border.divide_color",property:"divideColor"},{type:"dropdown",label:"border.divide_style",property:"divideStyle"}]},{styleType:"accordion",heading:"border.outline_styling",items:[{type:"range",label:"border.outline_width",property:"outlineWidth"},{type:"range",label:"border.outline_offset",property:"outlineOffset"},{type:"dropdown",label:"border.outline_style",property:"outlineStyle"}]},{styleType:"accordion",heading:"border.ring_options",items:[{type:"range",label:"border.ring_width",property:"ringWidth"},{type:"color",label:"border.ring_color",property:"ringColor"},{type:"range",label:"border.ring_offset_width",property:"ringOffsetWidth"},{type:"color",label:"border.ring_offset_color",property:"ringOffsetColor"}]}]},{heading:"effect.heading",items:[{type:"range",label:"effect.shadow",property:"boxShadow"},{type:"color",label:"effect.color",property:"boxShadowColor"},{type:"dropdown",label:"effect.cursor",property:"cursor"},{styleType:"accordion",heading:"effect.blend_cursor",items:[{type:"dropdown",label:"effect.mix_blend",property:"mixBlendMode"},{type:"dropdown",label:"effect.bg_blend",property:"bgBlendMode"}]},{styleType:"accordion",heading:"effect.transform",items:[{type:"dropdown",label:"effect.origin",property:"transformOrigin"},{styleType:"multiple",label:"effect.scale",units:["-"],options:[{key:"scale",label:"effect.all"},{key:"scaleX",label:"effect.lr"},{key:"scaleY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.skew",units:["deg"],options:[{key:"skewX",label:"effect.lr"},{key:"skewY",label:"effect.tb"}]},{styleType:"multiple",label:"effect.translate",negative:!0,options:[{key:"translateX",label:"effect.lr"},{key:"translateY",label:"effect.tb"}]},{type:"arbitrary",units:["deg"],negative:!0,label:"effect.rotate",property:"rotate"}]},{styleType:"accordion",heading:"effect.animation",items:[{type:"dropdown",label:"effect.animation",property:"animation"},{type:"dropdown",label:"effect.transition",property:"transition"},{type:"dropdown",label:"effect.easing",property:"transitionEase"},{type:"arbitrary",units:["ms"],label:"effect.duration",property:"duration"},{type:"arbitrary",units:["ms"],label:"effect.delay",property:"delay"}]}]},{heading:"classes.heading",items:[{component:ve}]}],re={"not-italic":()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z",fill:"white"})}),visible:x.EyeOpenIcon,invisible:x.EyeClosedIcon,hidden:x.EyeClosedIcon,gap:x.BorderAllIcon,gapX:x.WidthIcon,gapY:x.HeightIcon,spaceX:x.WidthIcon,spaceY:x.HeightIcon,overscroll:x.BorderAllIcon,overscrollX:x.WidthIcon,overscrollY:x.HeightIcon,overflow:x.BorderAllIcon,overflowX:x.WidthIcon,overflowY:x.HeightIcon,top:x.ArrowUpIcon,right:x.ArrowRightIcon,bottom:x.ArrowDownIcon,left:x.ArrowLeftIcon,inset:x.BorderAllIcon,insetX:x.WidthIcon,insetY:x.HeightIcon,border:x.BorderAllIcon,borderX:x.WidthIcon,borderY:x.HeightIcon,borderTop:x.ArrowUpIcon,borderRight:x.ArrowRightIcon,borderBottom:x.ArrowDownIcon,borderLeft:x.ArrowLeftIcon,borderRadius:x.BorderAllIcon,borderRadiusX:x.WidthIcon,borderRadiusY:x.HeightIcon,borderRadiusTop:x.ArrowUpIcon,borderRadiusRight:x.ArrowRightIcon,borderRadiusBottom:x.ArrowDownIcon,borderRadiusLeft:x.ArrowLeftIcon,borderRadiusTopLeft:x.ArrowTopLeftIcon,borderRadiusTopRight:x.ArrowTopRightIcon,borderRadiusBottomRight:x.ArrowBottomRightIcon,borderRadiusBottomLeft:x.ArrowBottomLeftIcon,divideXWidth:x.WidthIcon,divideYWidth:x.HeightIcon,scale:x.BorderAllIcon,scaleX:x.WidthIcon,scaleY:x.HeightIcon,skewX:x.WidthIcon,skewY:x.HeightIcon,translateX:x.WidthIcon,translateY:x.HeightIcon,padding:x.BorderAllIcon,paddingX:x.WidthIcon,paddingY:x.HeightIcon,paddingTop:x.ArrowUpIcon,paddingRight:x.ArrowRightIcon,paddingBottom:x.ArrowDownIcon,paddingLeft:x.ArrowLeftIcon,margin:x.BorderAllIcon,marginX:x.WidthIcon,marginY:x.HeightIcon,marginTop:x.ArrowUpIcon,marginRight:x.ArrowRightIcon,marginBottom:x.ArrowDownIcon,marginLeft:x.ArrowLeftIcon,textLeft:x.AlignLeftIcon,textCenter:x.AlignCenterHorizontallyIcon,textRight:x.AlignRightIcon,textJustify:x.StretchHorizontallyIcon,italic:x.FontItalicIcon,underline:x.UnderlineIcon,overline:x.OverlineIcon,uppercase:x.LetterCaseUppercaseIcon,block:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M2 2H14V14H2V2ZM1 1H15V15H1V1Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4H4V12H7V4ZM9 4H12V12H9V4Z",fill:"currentColor"})]}),"float-right":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M8 4H16V12H8V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",fill:"currentColor"})]}),"float-left":()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M0 4H8V12H0V4Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",fill:"currentColor"})]}),"float-none":x.Cross2Icon,fixed:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),absolute:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",fill:"currentColor"})]}),relative:()=>e.jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",fill:"currentColor"})}),sticky:()=>e.jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{d:"M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",fill:"currentColor"}),e.jsxRuntimeExports.jsx("path",{opacity:"0.6",fillRule:"evenodd",clipRule:"evenodd",d:"M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",fill:"currentColor"})]}),static:x.Cross1Icon},L=g.createContext({canReset:!1,canChange:!0}),Ce=({children:s,canReset:n=!1,canChange:r=!0})=>e.jsxRuntimeExports.jsx(L.Provider,{value:{canReset:n,canChange:r},children:s}),oe=({label:s,property:n,onChange:r})=>{const a=g.useMemo(()=>t.get(A.CLASSES_LIST,`${n}.classes`,[""]),[n]),i=q(n),u=g.useMemo(()=>t.get(i,"cls",""),[i]),{canChange:l}=g.useContext(L),m=/\[.*\]/g.test(u);return e.jsxRuntimeExports.jsx("div",{className:s?"w-full rounded":"grow",children:m?e.jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[e.jsxRuntimeExports.jsx(o.Input,{className:"w-[70%] rounded py-1",readOnly:!0,value:u}),e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(x.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind arbitrary value."})]})]}):e.jsxRuntimeExports.jsx(U,{rounded:s,onChange:d=>r(d,n),selected:u,options:a,disabled:!l})})};function U({selected:s,onChange:n,rounded:r=!1,options:a,disabled:i=!1}){const u=s.replace(/.*:/g,"").trim(),{undo:l,redo:m}=o.useUndoManager();return e.jsxRuntimeExports.jsxs("select",{disabled:!a.length||i,className:`${r?"rounded-md border border-border":"border-0"} disable:bg-gray-500 h-full w-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,onChange:d=>n(d.target.value),onKeyDown:d=>{d.ctrlKey&&(d.key==="z"&&l(),d.key==="y"&&m())},value:u,children:[e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:""}),g.Children.toArray(a.map(d=>e.jsxRuntimeExports.jsx("option",{className:"bg-transparent",value:d,children:d})))]})}const ke=({property:s,onChange:n})=>{const{canReset:r,canChange:a}=g.useContext(L),i=q(s),u=g.useMemo(()=>t.get(i,"cls",""),[i]),l=g.useMemo(()=>t.get(A.CLASSES_LIST,`${s}.classes`,[""]),[s]),m=l.indexOf(u)>-1?l.indexOf(u):0,d=/\[.*\]/g.test(u);return e.jsxRuntimeExports.jsx("div",{className:"flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs",children:d?e.jsxRuntimeExports.jsx("div",{className:"py-[5px] px-2",children:u}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("button",{type:"button",className:"box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!a&&(!r||m-1<0),onClick:()=>n(t.nth(l,m-1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(x.MinusIcon,{className:!a&&(!r||m-1<0)?"text-gray-500":"text-black/60 dark:text-white/60"})})}),e.jsxRuntimeExports.jsx("div",{className:"w-8/12 text-center",children:e.jsxRuntimeExports.jsx(oe,{label:!1,property:s,onChange:n})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",disabled:!a&&(!r||m+1>=l.length),onClick:()=>n(t.nth(l,m+1),s),children:e.jsxRuntimeExports.jsx("span",{className:"flex items-center justify-center",children:e.jsxRuntimeExports.jsx(x.PlusIcon,{className:!a&&(!r||m+1>=l.length)?"text-gray-500":"text-black/60 dark:text-white/60"})})})]})})},Ne=({property:s,onChange:n})=>{const r=g.useMemo(()=>t.get(A.CLASSES_LIST,`${s}.classes`,[""]),[s]),{canChange:a}=g.useContext(L),i=q(s),u=g.useMemo(()=>t.get(i,"cls",""),[i]);return e.jsxRuntimeExports.jsx("div",{className:"flex grow flex-wrap gap-1",children:t.map(r,l=>e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",disabled:!a,onClick:()=>n(l,s),className:`cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${u===l?" bg-blue-500 text-white":"disabled:bg-gray-600 disabled:text-gray-400"}`,children:g.createElement(t.get(re,l,x.BoxIcon))})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(l))})]}))})},Se={backgroundColor:"bg",textColor:"text",borderColor:"border",boxShadowColor:"shadow",outlineColor:"outline",divideColor:"divide",fromColor:"from",viaColor:"via",toColor:"to",ringColor:"ring",ringOffsetColor:"ring-offset"},Te=({property:s,onChange:n})=>{const r=q(s),a=g.useMemo(()=>t.get(r,"cls",""),[r]),{canChange:i}=g.useContext(L),[u,l]=g.useState([]),[m,d]=g.useState({color:"",shade:""}),c=a.split("-"),j=t.get(c,"1",""),p=t.get(c,"2",""),y=g.useCallback(h=>{["current","inherit","transparent","black","white"].includes(h)?(l([]),d({color:h})):(l(["50","100","200","300","400","500","600","700","800","900"]),d(v=>({...v,color:h,shade:v.shade?v.shade:"500"})))},[l,d]);g.useEffect(()=>{if(["current","inherit","transparent","black","white"].includes(j))return l([]);l(["50","100","200","300","400","500","600","700","800","900"])},[j]);const b=g.useCallback(h=>{d({color:j,shade:h})},[j]);return g.useEffect(()=>{d({color:"",shade:""})},[r]),g.useEffect(()=>{const v=`${t.get(Se,s,"")}-${m.color}${m.shade?`-${m.shade}`:""}`;v.match(new RegExp(t.get(A.CLASSES_LIST,`${s}.regExp`,"")))&&n(v,s)},[m,n,s]),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs",children:[e.jsxRuntimeExports.jsx("div",{className:"grow text-center",children:e.jsxRuntimeExports.jsx(U,{disabled:!i,rounded:!0,selected:j,onChange:y,options:["current","transparent","primary","secondary","black","white","slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"]})}),e.jsxRuntimeExports.jsx("button",{type:"button",className:"grow text-center",children:e.jsxRuntimeExports.jsx(U,{rounded:!0,selected:p,disabled:!j||!i,onChange:b,options:u})})]})},Q=(s,n)=>{s=s.toLowerCase();let r=s.trim().replace(/ |\+/g,"");if((r==="auto"||r==="none")&&n.includes(r))return{value:"",unit:r};const a=n.length?new RegExp(n.join("|"),"g"):/XXXXXX/g;r=r.replace(a,"");const i=s.match(a),u=i&&i.length>1,l=!t.isEmpty(r)&&Number.isNaN(Number(r));return u||l?{error:"Invalid value"}:i&&(i[0]==="auto"||i[0]==="none")?{value:i[0],unit:""}:{value:r,unit:i?i[0]:""}};const Ie=s=>{const n=s.startsWith("-")?"-":"",r=s.split("-").pop();if(["auto","none"].includes(r))return{value:"",unit:r};if(r==="px")return{value:"1",unit:"px"};if(r==="screen")return{value:"100",unit:s.indexOf("w-")!==-1?"vw":"vh"};if(r==="full")return{value:"100",unit:"%"};if(t.includes(s,"skew-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"rotate-"))return{value:`${n}${r}`,unit:"deg"};if(t.includes(s,"opacity-"))return{value:`${r/100}`,unit:"-"};if(t.includes(s,"duration-")||t.includes(s,"delay-"))return{value:`${r}`,unit:"ms"};if(t.includes(s,"translate-")&&!r.includes("/"))return{value:`${n}${`${r/4}`}`,unit:"rem"};if(t.includes(s,"scale-"))return{value:`${n}${`${r/100}`}`,unit:"-"};if(t.startsWith(s,"border")){const a=s.match(/border-?(x|y|t|r|b|l)?\d+/g);if(a)return{value:a[0].split("-").pop(),unit:"px"};if(s.match(/border-?(x|y|t|r|b|l)?/g))return{value:"1",unit:"px"}}if(t.startsWith(s,"max-w-")){if(s==="max-w-screen-sm")return{value:"640",unit:"px"};if(s==="max-w-screen-md")return{value:"768",unit:"px"};if(s==="max-w-screen-lg")return{value:"1024",unit:"px"};if(s==="max-w-screen-xl")return{value:"1280",unit:"px"};if(s==="max-w-screen-2xl")return{value:"1536",unit:"px"};if(r==="xs")return{value:"320",unit:"px"};if(r==="sm")return{value:"384",unit:"px"};if(r==="md")return{value:"448",unit:"px"};if(r==="lg")return{value:"512",unit:"px"};if(r==="xl")return{value:"576",unit:"px"};if(r==="2xl")return{value:"672",unit:"px"};if(r==="3xl")return{value:"768",unit:"px"};if(r==="4xl")return{value:"896",unit:"px"};if(r==="5xl")return{value:"1024",unit:"px"};if(r==="6xl")return{value:"1152",unit:"px"};if(r==="7xl")return{value:"1280",unit:"px"};if(r==="prose")return{value:"65",unit:"ch"}}if(t.startsWith(s,"text-")){if(r==="xs")return{value:"12",unit:"px"};if(r==="sm")return{value:"14",unit:"px"};if(r==="base")return{value:"16",unit:"px"};if(r==="lg")return{value:"18",unit:"px"};if(r==="xl")return{value:"20",unit:"px"};if(r==="2xl")return{value:"24",unit:"px"};if(r==="3xl")return{value:"30",unit:"px"};if(r==="4xl")return{value:"36",unit:"px"};if(r==="5xl")return{value:"48",unit:"px"};if(r==="6xl")return{value:"60",unit:"px"};if(r==="7xl")return{value:"72",unit:"px"};if(r==="8xl")return{value:"96",unit:"px"};if(r==="9xl")return{value:"128",unit:"px"}}if(t.startsWith(s,"leading-")){if(r==="none")return{value:"1",unit:"-"};if(r==="tight")return{value:"1.25",unit:"-"};if(r==="snug")return{value:"1.375",unit:"-"};if(r==="normal")return{value:"1.5",unit:"-"};if(r==="relaxed")return{value:"1.625",unit:"-"};if(r==="loose")return{value:"2",unit:"-"}}if(t.startsWith(s,"tracking-")){if(r==="tighter")return{value:"-0.05",unit:"em"};if(r==="tight")return{value:"-0.025",unit:"em"};if(r==="normal")return{value:"0",unit:"em"};if(r==="wide")return{value:"0.025",unit:"em"};if(r==="wider")return{value:"0.05",unit:"em"};if(r==="widest")return{value:"0.1",unit:"em"}}if(["max","min","fit"].includes(r))return{value:s,unit:"class"};if(r.includes("/")){const[a,i]=t.map(r.split("/"),u=>parseInt(u,10));return{value:n+(a/i*100).toFixed(2).replace(".00",""),unit:"%"}}return t.isNumber(parseFloat(r))?{value:`${n+parseFloat(r)*4}`,unit:"px"}:{value:r,unit:"class"}};const _e=s=>{if(t.isEmpty(s))return{value:"",unit:""};const n=s.match(/\[.*\]/g);if(n===null)return He(s);const r=t.get(n,"0","").replace(/\[|\]/g,""),a=s.startsWith("-")?"-":"",i=t.first(r.match(/\d+.\d+|\d+/g));return{value:`${a}${i}`,unit:r.replace(i,"")}},He=s=>t.isEmpty(s)?{value:"",unit:""}:Ie(s),ne=g.createContext({setDragData:()=>{}}),Be=({unit:s,currentValue:n,onDrag:r,onDragEnd:a,onDragStart:i,negative:u,cssProperty:l})=>{const{setDragData:m}=g.useContext(ne);return e.jsxRuntimeExports.jsx("button",{type:"button",onMouseDown:d=>{const c={onDrag:r,onDragEnd:a,dragging:!0,dragStartY:d.pageY,dragStartValue:`${n}`,dragUnit:s,negative:u,cssProperty:l};i(c),m(c)},color:void 0,className:"relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",children:e.jsxRuntimeExports.jsx(x.RowSpacingIcon,{})})},Ve=({onSelect:s,current:n,units:r})=>e.jsxRuntimeExports.jsx("div",{"data-theme":"light",className:"-m-[7px] -mx-[13px] flex w-9 flex-col",children:r.map(a=>e.jsxRuntimeExports.jsx(o.Button,{className:"h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",color:n===a?"primary":void 0,size:"sm",onClick:i=>{i.stopPropagation(),s(a)},children:a},a))}),ee=50,Ae=s=>{const[n,r]=g.useState(!1),[a,i]=g.useState(""),{currentClass:u,onChange:l,classPrefix:m,cssProperty:d,units:c,negative:j}=s,[p,y]=g.useState(d!=null&&d.toLowerCase().includes("width")?"%":c[0]),[b,h]=g.useState(!1),[v,E]=g.useState(""),[S,w]=g.useState(!1),[I,H]=g.useState(!1);g.useEffect(()=>{const{value:f,unit:R}=_e(u);if(R===""){i(f),y(d!=null&&d.toLowerCase().includes("width")?"%":t.first(c));return}y(R),i(R==="class"||t.isEmpty(f)?"":f)},[u,d,c]);const C=X.useThrottledCallback(f=>l(f),[l],ee),T=X.useThrottledCallback(f=>l(f,!1),[l],ee),V=g.useCallback((f=!1)=>{const R=Q(`${a}`,c);if(t.get(R,"error",!1)){h(!0);return}const k=t.get(R,"unit")!==""?t.get(R,"unit"):p;if(k==="auto"||k==="none"){C(`${m}${k}`);return}if(t.get(R,"value")==="")return;const P=`${t.get(R,"value","").startsWith("-")?"-":""}${m}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;f?T(P):C(P)},[C,T,a,p,m,c]),D=g.useCallback(f=>{const R=Q(`${a}`,c);if(t.get(R,"error",!1)){h(!0);return}if(f==="auto"||f==="none"){C(`${m}${f}`);return}if(t.get(R,"value")==="")return;const k=t.get(R,"unit")!==""?t.get(R,"unit"):f,P=`${t.get(R,"value","").startsWith("-")?"-":""}${m}[${t.get(R,"value","").replace("-","")}${k==="-"?"":k}]`;C(P)},[C,a,m,c]);return e.jsxRuntimeExports.jsx("div",{className:"flex w-full flex-col",children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-start",children:p==="class"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("input",{className:"w-20 rounded py-1",readOnly:!0,value:u}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 text-blue-600 group-hover:visible",children:e.jsxRuntimeExports.jsx(x.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:"Current value is using a Tailwind preset class."})]})]}):e.jsxRuntimeExports.jsxs("div",{className:`group relative flex items-center ${S?"z-auto":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center rounded-md border border-border",children:[["none","auto"].indexOf(p)!==-1?null:e.jsxRuntimeExports.jsx("input",{readOnly:p==="class",onKeyPress:f=>{f.key==="Enter"&&V()},onKeyDown:f=>{if(f.keyCode!==38&&f.keyCode!==40)return;f.preventDefault(),H(!0);const R=t.parseInt(f.target.value);let k=t.isNaN(R)?0:R;f.keyCode===38&&(k+=1),f.keyCode===40&&(k-=1);const B=`${k}`,le=`${B.startsWith("-")?"-":""}${m}[${B.replace("-","")}${p==="-"?"":p}]`;T(le)},onKeyUp:f=>{I&&(f.preventDefault(),H(!1))},onBlur:()=>V(),onChange:f=>{h(!1),i(f.target.value)},onClick:f=>{var R;(R=f==null?void 0:f.target)==null||R.select(),r(!1)},value:S?v:a,className:"h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(" ",b?"border-red-500 text-red-500":"border-foreground/20")}),e.jsxRuntimeExports.jsxs(o.Tooltip,{open:n,delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",children:[e.jsxRuntimeExports.jsx("span",{className:`inline-block ${c.length===1?"px-2 font-semibold":""}`,children:p}),c.length>1?e.jsxRuntimeExports.jsx(x.TriangleDownIcon,{}):null]})}),e.jsxRuntimeExports.jsx(o.TooltipPortal,{children:e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"bg-background",children:e.jsxRuntimeExports.jsx(Ve,{units:c,current:p,onSelect:f=>{r(!1),y(f),D(f)}})})})]})]}),["none","auto"].indexOf(p)!==-1||S?null:e.jsxRuntimeExports.jsx(Be,{onDragStart:()=>w(!0),onDragEnd:f=>{if(E(()=>""),w(!1),t.isEmpty(f))return;const R=`${f}`,B=`${R.startsWith("-")?"-":""}${m}[${R.replace("-","")}${p==="-"?"":p}]`;C(B)},onDrag:f=>{if(t.isEmpty(f))return;E(f);const R=`${f}`,B=`${R.startsWith("-")?"-":""}${m}[${R.replace("-","")}${p==="-"?"":p}]`;T(B)},currentValue:a,unit:p,negative:j,cssProperty:d})]})})})},q=s=>{const n=o.useSelectedBlockCurrentClasses();return t.findLast(n,{property:s})},De=(s,n)=>{const r={xs:0,sm:1,md:2,lg:3,xl:4,"2xl":5};return r[t.get(s,"mq","xs")]<=r[n]},Pe={width:"w-",height:"h-",minWidth:"min-w-",minHeight:"min-h-",maxWidth:"max-w-",maxHeight:"max-h-",zIndex:"z-",gap:"gap-",gapX:"gap-x-",gapY:"gap-y-",margin:"m-",marginX:"mx-",marginY:"my-",marginTop:"mt-",marginBottom:"mb-",marginLeft:"ml-",marginRight:"mr-",padding:"p-",paddingX:"px-",paddingY:"py-",paddingTop:"pt-",paddingBottom:"pb-",paddingLeft:"pl-",paddingRight:"pr-",spaceX:"space-x-",spaceY:"space-y-",border:"border-",borderTop:"border-t-",borderBottom:"border-b-",borderLeft:"border-l-",borderRight:"border-r-",borderX:"border-x-",borderY:"border-y-",borderRadius:"rounded-",borderRadiusTop:"rounded-t-",borderRadiusRight:"rounded-r-",borderRadiusBottom:"rounded-b-",borderRadiusLeft:"rounded-l-",borderRadiusTopLeft:"rounded-tl-",borderRadiusTopRight:"rounded-tr-",borderRadiusBottomRight:"rounded-br-",borderRadiusBottomLeft:"rounded-bl-",fontSize:"text-",lineHeight:"leading-",letterSpacing:"tracking-",textIndent:"indent-",rotate:"rotate-",duration:"duration-",transitionDelay:"delay-",scale:"scale-",scaleX:"scale-x-",scaleY:"scale-y-",translateX:"translate-x-",translateY:"translate-y-",skewX:"skew-x-",skewY:"skew-y-",top:"top-",bottom:"bottom-",left:"left-",right:"right-",inset:"inset-",insetX:"inset-x-",insetY:"inset-y-",opacity:"opacity-",flexBasis:"basis-"},te={xs:"",sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Me=s=>`${s.toUpperCase()} ${te[s]?`(${te[s]} & up)`:""}`,G=s=>{const{t:n}=_.useTranslation(),{type:r="icons",label:a,property:i,onEmitChange:u=()=>{},units:l,negative:m=!1}=s,[d]=o.useDarkMode(),[c]=o.useStylingState(),[,j]=o.useCanvasWidth(),p=q(i),y=o.useAddClassesToBlocks(),b=o.useRemoveClassesFromBlocks(),[h]=o.useSelectedBlockIds(),v=g.useMemo(()=>t.get(p,"fullCls",""),[p]),E=g.useCallback((T,V=!0)=>{const D={dark:d,mq:j,mod:c,cls:T,property:i,fullCls:""};(d||c!=="")&&(D.mq="xs");const f=A.generateFullClsName(D);y(h,[f],V)},[h,d,j,c,i,y]),S=g.useCallback(()=>{b(h,[v])},[h,v,b]),w=g.useMemo(()=>De(p,j),[p,j]);g.useEffect(()=>{u(w,p)},[w,u,p]);const[,,I]=o.useCanvasWidth(),H=g.useCallback(T=>{I({xs:400,sm:640,md:800,lg:1024,xl:1420,"2xl":1920}[T])},[I]),C=t.get(p,"dark",null)===d&&t.get(p,"mod",null)===c&&t.get(p,"mq",null)===j;return e.jsxRuntimeExports.jsx(Ce,{canChange:w,canReset:p&&C,children:e.jsxRuntimeExports.jsxs("div",{className:"group flex flex-row items-center py-2 first:pt-0 last:pb-0",children:[e.jsxRuntimeExports.jsx("div",{className:"relative w-[70px] truncate text-xs text-foreground",children:e.jsxRuntimeExports.jsx("span",{className:`text-[11px] ${p&&!C?"text-foreground":""}`,children:n(a)})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row items-center",children:[e.jsxRuntimeExports.jsxs("div",{className:"w-[150px]",children:[r==="arbitrary"?e.jsxRuntimeExports.jsx(Ae,{currentClass:t.get(p,"cls",""),classPrefix:t.get(Pe,i,""),units:l||[],onChange:E,negative:m,cssProperty:i}):null,r==="icons"&&e.jsxRuntimeExports.jsx(Ne,{property:i,onChange:E}),r==="range"&&e.jsxRuntimeExports.jsx(ke,{property:i,onChange:E}),r==="color"&&e.jsxRuntimeExports.jsx(Te,{property:i,onChange:E}),r==="dropdown"&&e.jsxRuntimeExports.jsx(oe,{label:a,property:i,onChange:E})]}),e.jsxRuntimeExports.jsx("div",{className:`w-[30px] cursor-pointer ${v?"visible":"invisible"}`,children:C?e.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>S(),title:"Reset",className:"flex px-1.5 text-xs",children:e.jsxRuntimeExports.jsx(x.CrossCircledIcon,{className:"h-5 w-5 text-blue-500 hover:opacity-80"})}):w&&p?e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:100,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{type:"button",className:"invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",children:e.jsxRuntimeExports.jsx(x.InfoCircledIcon,{})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:e.jsxRuntimeExports.jsx("div",{className:"text-right",children:e.jsxRuntimeExports.jsxs("div",{children:["Current style is set at ",e.jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[Me(t.get(p,"mq")),d&&!p.dark?"(Light mode)":""]}),e.jsxRuntimeExports.jsx("br",{}),e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>H(t.get(p,"mq")),className:"block w-full cursor-default text-right font-semibold text-blue-500",children:["Switch to ",t.get(p,"mq").toUpperCase()]})]})})})]}):null})]})]})})},$e=["px","%","em","rem","ch","vh","vw"],ie=({label:s,options:n,borderB:r=!1,borderT:a=!1,type:i="arbitrary",units:u=$e,negative:l=!1})=>{const{t:m}=_.useTranslation(),[d,c]=g.useState(n[0].key),j=o.useSelectedBlockCurrentClasses(),p=g.useCallback(y=>t.map(j,"property").includes(y),[j]);return e.jsxRuntimeExports.jsxs("div",{className:`mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${r?"border-b":""} ${a?"border-t":""}`,children:[e.jsxRuntimeExports.jsxs("div",{className:"flex flex-row text-xs",children:[s&&e.jsxRuntimeExports.jsx("span",{className:"relative w-[70px] flex-none text-xs text-foreground",children:m(s)}),e.jsxRuntimeExports.jsx("div",{className:"mb-3 flex grow flex-row flex-wrap gap-x-px",children:g.Children.toArray(n.map(({label:y,key:b})=>e.jsxRuntimeExports.jsx("div",{className:"first:rounded-l last:rounded-r",children:e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("button",{type:"button",onClick:()=>c(b),className:`relative cursor-pointer rounded-full p-1 text-[8px] ${b===d?" bg-[#3E57F0] text-white":"text-gray-600 dark:text-gray-300"}`,children:[g.createElement("div",{className:p(b)?"-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full":""}),g.createElement(t.get(re,b,x.BoxIcon),{className:"text-inherit w-3 h-3"})]})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{children:t.startCase(t.toLower(y))})]})})))})]}),e.jsxRuntimeExports.jsx("div",{className:"mt-0 flex items-center",children:e.jsxRuntimeExports.jsx(G,{type:i,units:[...u],label:"",property:d,negative:l})})]})},Le=({heading:s,items:n})=>{const{t:r}=_.useTranslation(),a=o.useSelectedBlockCurrentClasses(),i=g.useMemo(()=>{const u=d=>t.flatten(d.map(c=>c.styleType==="multiple"?t.map(c.options,"key"):c.property)),l=t.flatten(n.map(d=>d.styleType==="accordion"?u(d.items):d.styleType==="multiple"?t.map(d.options,"key"):d.property)),m=t.map(a,"property");return t.intersection(l,m).length>0},[a,n]);return e.jsxRuntimeExports.jsxs("details",{children:[e.jsxRuntimeExports.jsx("summary",{className:"my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground",children:e.jsxRuntimeExports.jsxs("div",{className:"inline",children:[r(s),i?e.jsxRuntimeExports.jsx("span",{className:`ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}):null]})}),e.jsxRuntimeExports.jsx("div",{className:"p-2",children:n.map(u=>u.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...u},u.label):e.jsxRuntimeExports.jsx(G,{...u},u.label))})]})},qe=g.createContext({}),Y=({section:s})=>{const{t:n}=_.useTranslation(),r=o.useSelectedBlockCurrentClasses(),a=g.useCallback((l=[])=>{const m={};for(let c=0;c<r.length;c++)m[r[c].property]=r[c].cls;let d=!0;for(const c in l)if(!t.has(m,c)||m[c]!==l[c]){d=!1;break}return d},[r]),i=g.useMemo(()=>{if(r.length>0&&s.heading==="classes.heading")return!0;const l=c=>t.flatten(c.map(j=>j.styleType==="multiple"?t.flatten(t.map(j.options,"key")):j.property)),m=t.flatten(s.items.map(c=>c.styleType==="accordion"?l(c.items):c.styleType==="multiple"?t.flatten(t.map(c.options,"key")):c.property)),d=t.map(r,"property");return t.intersection(m,d).length>0},[r,s.heading,s.items]),u=g.useMemo(()=>({}),[]);return e.jsxRuntimeExports.jsx(qe.Provider,{value:u,children:e.jsxRuntimeExports.jsxs(o.AccordionItem,{value:s.heading,children:[e.jsxRuntimeExports.jsx(o.AccordionTrigger,{className:"px-3 py-2 text-xs hover:no-underline",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsx("div",{className:`h-[8px] w-[8px] rounded-full ${i?"bg-blue-500":"bg-gray-300"}`}),n(s.heading)]})}),e.jsxRuntimeExports.jsx(o.AccordionContent,{className:"bg-gray-100 px-3.5 py-2",children:g.Children.toArray(s.items.map(l=>t.has(l,"component")?g.createElement(l.component,{key:l.label}):t.has(l,"styleType")?l.styleType==="multiple"?e.jsxRuntimeExports.jsx(ie,{...l},l.label):l.styleType==="accordion"&&a(l==null?void 0:l.conditions)?e.jsxRuntimeExports.jsx(Le,{...l},l.label):null:e.jsxRuntimeExports.jsx(G,{...l},l.label)))})]})})},Oe=()=>{const s=o.useSelectedBlock(),[n]=o.useSelectedStylingBlocks(),{t:r}=_.useTranslation(),a=$.useGlobalStylingPresets(),i=o.useAddClassesToBlocks(),u=$.getBlockComponent(s._type),l=t.get(t.first(n),"prop"),m=t.get(u.props,`${l}.presets`,{});if(t.isEmpty(a)&&(!t.has(u,"props")||t.isEmpty(m)))return null;const d=c=>{const j=c.trim().toLowerCase().replace(/ +(?= )/g,"").split(" ");i([s._id],j,!0)};return e.jsxRuntimeExports.jsx("div",{className:"h-10",children:e.jsxRuntimeExports.jsxs(o.DropdownMenu,{children:[e.jsxRuntimeExports.jsx(o.DropdownMenuTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("div",{className:"px-4",children:e.jsxRuntimeExports.jsxs(o.Button,{variant:"default",className:"w-full",size:"sm",children:[r("Apply Presets"),e.jsxRuntimeExports.jsx(x.CaretDownIcon,{})]})})}),e.jsxRuntimeExports.jsx(o.DropdownMenuContent,{className:"max-h-80 w-56",children:e.jsxRuntimeExports.jsxs(o.ScrollArea,{className:"no-scrollbar h-full",children:[t.isEmpty(m)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs(o.DropdownMenuLabel,{children:[u.type," ",r("presets")]}),e.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),e.jsxRuntimeExports.jsx(o.DropdownMenuGroup,{children:t.keys(m).map(c=>e.jsxRuntimeExports.jsxs(o.DropdownMenuItem,{className:"group text-xs",onClick:()=>d(m[c]),children:[t.capitalize(t.startCase(r(c))),e.jsxRuntimeExports.jsx(o.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:r("apply")})]}))})]}),t.isEmpty(a)?null:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(o.DropdownMenuLabel,{children:r("Global presets")}),e.jsxRuntimeExports.jsx(o.DropdownMenuSeparator,{}),e.jsxRuntimeExports.jsx(o.DropdownMenuGroup,{children:t.keys(a).map(c=>e.jsxRuntimeExports.jsxs(o.DropdownMenuItem,{className:"group text-xs",onClick:()=>d(a[c]),children:[t.capitalize(t.startCase(r(c))),e.jsxRuntimeExports.jsx(o.DropdownMenuShortcut,{className:"invisible hover:font-bold hover:text-blue-600 group-hover:visible",children:r("apply")})]}))})]})]})})]})})};function We(){const[s,n]=o.useStylingState(),{flexChild:r,gridChild:a}=o.useSelectedBlocksDisplayChild(),{t:i}=_.useTranslation(),[u]=o.useSelectedStylingBlocks();return t.isEmpty(u)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(x.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:i("no_styling_block_selected")})]})}):e.jsxRuntimeExports.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxRuntimeExports.jsx(Oe,{}),e.jsxRuntimeExports.jsx("div",{className:"flex h-12 flex-col space-x-4 px-4 py-1",children:e.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-end gap-x-1.5",children:[e.jsxRuntimeExports.jsx(o.Label,{htmlFor:"",className:"flex gap-x-1.5 text-xs italic",children:"State"}),e.jsxRuntimeExports.jsxs(o.Select,{defaultValue:s,onValueChange:l=>n(l),children:[e.jsxRuntimeExports.jsx(o.SelectTrigger,{className:"h-auto w-fit p-1 px-3",children:e.jsxRuntimeExports.jsx(o.SelectValue,{placeholder:"State"})}),e.jsxRuntimeExports.jsxs(o.SelectContent,{children:[e.jsxRuntimeExports.jsx(o.SelectItem,{value:"",children:"Normal"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"hover",children:"Hover"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"active",children:"Active"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"focus",children:"Focus"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"before",children:"Before"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"after",children:"After"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"only",children:"Only"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first",children:"First"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"last",children:"Last"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-letter",children:"First Letter"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"first-line",children:"First Line"}),e.jsxRuntimeExports.jsx(o.SelectItem,{value:"disabled",children:"Disabled"})]})]})]})}),s!==""?e.jsxRuntimeExports.jsxs("div",{className:"m-1 flex items-center space-x-1 rounded border border-orange-500 bg-orange-200 p-px px-2 text-xs text-orange-900",children:[e.jsxRuntimeExports.jsx(M.BrushIcon,{className:"w-3"}),e.jsxRuntimeExports.jsx("span",{children:i(`Styles will be applied for (:${s}) state`)})]}):null,e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar -mx-1 max-h-full flex-1 overflow-x-hidden overflow-y-hidden border-t border-border",children:e.jsxRuntimeExports.jsxs(o.Accordion,{defaultValue:["Layout"],type:"multiple",className:"w-full",children:[r&&e.jsxRuntimeExports.jsx(Y,{section:Re}),a?e.jsxRuntimeExports.jsx(Y,{section:Ee}):null,we.map(l=>e.jsxRuntimeExports.jsx(Y,{section:l},l.heading))]})})]})}const ze=({onAdd:s})=>{const{t:n}=_.useTranslation(),[r,a]=g.useState({key:"",value:""}),i=()=>{t.isEmpty(r.key)||(s({...r,key:t.kebabCase(r.key)}),a({key:"",value:""}))};return e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-1 border-gray-200 px-1",children:[e.jsxRuntimeExports.jsx(o.Input,{name:"key",onChange:u=>a({...r,key:u.target.value}),value:r.key,placeholder:n("Name"),autoComplete:"off",autoCapitalize:"off",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),t.isEmpty(r.key)||i())}}),e.jsxRuntimeExports.jsx("div",{className:"flex items-center gap-x-1.5",children:e.jsxRuntimeExports.jsx(o.Input,{name:"value",onChange:u=>a({...r,value:u.target.value}),value:r.value,placeholder:n("Value"),autoComplete:"off",autoCapitalize:"off",onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),t.isEmpty(r.key)||i())}})}),e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2",children:[e.jsxRuntimeExports.jsxs(o.Button,{disabled:t.isEmpty(r.key),onClick:i,size:"sm",className:"flex items-center",children:[e.jsxRuntimeExports.jsxs("span",{children:[n("Add")," "]}),e.jsxRuntimeExports.jsx(x.PlusIcon,{})]}),t.isEmpty(r.key)?null:e.jsxRuntimeExports.jsx(o.Button,{variant:"ghost",onClick:()=>a({key:"",value:""}),children:n("Cancel")})]})]})},Fe=()=>{const s=o.useSelectedBlock(),[n,r]=g.useState([]),[a]=o.useSelectedStylingBlocks(),i=o.useUpdateBlocksPropsRealtime(),u=o.useUpdateBlocksProps(),{t:l}=_.useTranslation(),m=`${t.get(a,"0.prop")}_attrs`;O.useEffect(()=>{const p=t.map(t.get(s,m),(y,b)=>({key:b,value:y}));t.isEmpty(p)?r([]):r(p)},[t.get(s,m)]);const d=p=>{const y=t.filter(n,(b,h)=>p!==h);j(y)},c=p=>{const y=[...n,p];j(y)},j=O.useCallback((p=[])=>{const y={};t.forEach(p,b=>{t.isEmpty(b.key)||t.set(y,b.key,b.value)}),u([t.get(s,"_id")],{[m]:y})},[s,i,m]);return e.jsxRuntimeExports.jsx("div",{className:"px-2",children:e.jsxRuntimeExports.jsx("div",{className:"no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto",children:e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("ul",{className:"overflow-hidden rounded-md bg-gray-100 p-2 text-xs text-gray-700",children:[t.isEmpty(n)?e.jsxRuntimeExports.jsx("li",{className:"flex h-16 items-center justify-center",children:e.jsxRuntimeExports.jsx("p",{children:l("No custom attributes added yet")})}):e.jsxRuntimeExports.jsx("li",{children:e.jsxRuntimeExports.jsx("span",{className:"font-bold",children:l("Custom attributes")})}),O.Children.toArray(t.map(n,p=>e.jsxRuntimeExports.jsxs("li",{className:"group flex max-w-full items-center justify-between",children:[e.jsxRuntimeExports.jsxs(o.Tooltip,{delayDuration:1e3,children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"w-[90%] cursor-default truncate px-1 hover:bg-gray-200",children:[p.key," ",e.jsxRuntimeExports.jsx("span",{className:"font-bold text-orange-500",children:"="})," ",p.value]})}),e.jsxRuntimeExports.jsxs(o.TooltipContent,{className:"max-w-[200px]",children:[e.jsxRuntimeExports.jsxs("div",{children:[l("Name"),": ",p.key]}),e.jsxRuntimeExports.jsxs("div",{children:[l("Value"),": ",p.value]})]})]}),e.jsxRuntimeExports.jsxs(o.Tooltip,{children:[e.jsxRuntimeExports.jsx(o.TooltipTrigger,{asChild:!0,children:e.jsxRuntimeExports.jsx("button",{className:"invisible group-hover:visible",onClick:()=>d(n.indexOf(p)),children:e.jsxRuntimeExports.jsx(M.DeleteIcon,{className:"w-4 text-gray-500"})})}),e.jsxRuntimeExports.jsx(o.TooltipContent,{className:"max-w-[200px]",children:l("Remove attribute")})]})]})))]})}),e.jsxRuntimeExports.jsx("div",{className:"py-2"}),e.jsxRuntimeExports.jsx(ze,{onAdd:p=>c(p)})]})})})},Ye={px:1,"%":1,em:100,rem:100,ch:1,vw:1,vh:1,"-":1,deg:1,ms:.1},Xe=()=>{const s=o.useSelectedBlock(),{t:n}=_.useTranslation(),[r,a]=g.useState(""),[i,u]=g.useState({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""}),l=X.useThrottledCallback(d=>{const c=!t.get(i,"negative",!1),j=t.get(i,"cssProperty","");let p=parseFloat(i.dragStartValue);p=t.isNaN(p)?0:p;let y=Ye[i.dragUnit];(t.startsWith(j,"scale")||j==="opacity")&&(y=10);let h=(i.dragStartY-d.pageY)/y+p;c&&h<0&&(h=0),j==="opacity"&&h>1&&(h=1),i.onDrag(`${h}`),a(`${h}`)},[i],50),m=g.useCallback(()=>{setTimeout(()=>i.onDragEnd(`${r}`),100),u({onDrag:d=>d,onDragEnd:d=>d,dragStartY:0,dragging:!1,dragStartValue:0,dragUnit:"",negative:!1,cssProperty:""})},[i,r,u]);return t.isNull(s)?e.jsxRuntimeExports.jsx("div",{className:"p-4 text-center",children:e.jsxRuntimeExports.jsxs("div",{className:"space-y-4 rounded-xl p-4",children:[e.jsxRuntimeExports.jsx(x.MixerHorizontalIcon,{className:"mx-auto text-3xl"}),e.jsxRuntimeExports.jsx("h1",{children:n("no_block_selected_for_styling")})]})}):e.jsxRuntimeExports.jsx(W.ErrorBoundary,{children:e.jsxRuntimeExports.jsxs(ne.Provider,{value:{setDragData:u},children:[i.dragging?e.jsxRuntimeExports.jsx("div",{onMouseMove:l,onMouseUp:()=>m(),className:"absolute inset-0 z-30 cursor-row-resize bg-gray-300/10"}):null,e.jsxRuntimeExports.jsxs(o.Tabs,{defaultValue:"settings",className:"flex h-full w-full flex-col py-1 text-xs",children:[e.jsxRuntimeExports.jsxs(o.TabsList,{className:"mx-1 grid grid-cols-3",children:[e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"settings",children:n("settings")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"styling",children:n("styling")}),e.jsxRuntimeExports.jsx(o.TabsTrigger,{value:"attrs",children:n("Attributes")})]}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"settings",className:"no-scrollbar h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(o.ScrollArea,{className:"no-scrollbar max-h-full flex-1 overflow-x-hidden overflow-y-hidden pb-5",children:e.jsxRuntimeExports.jsx(fe,{})})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"styling",className:"h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(We,{})}),e.jsxRuntimeExports.jsx(o.TabsContent,{value:"attrs",className:"h-full flex-1 overflow-y-auto overflow-x-hidden",children:e.jsxRuntimeExports.jsx(Fe,{})})]})]})})};exports.default=Xe;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const u=require("himalaya"),p=require("./Functions-N3yhPYKY.cjs"),e=require("lodash-es"),o=require("./STRINGS-gPz7CUOk.cjs"),T=t=>{const s=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,r=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return s.test(t)||r.test(t)},v=t=>{if(e.isEmpty(t))return t;const s=/<video[^>]+src=['"]([^'">]+)['"]/,r=/<iframe[^>]+src=['"]([^'">]+)['"]/,a=t.match(s),l=t.match(r),i=a?a[1]:l?l[1]:null,c=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,n=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return i&&(c.test(i)||n.test(i))?i:t},w={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"}},x=(t,s)=>t.children.length===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link"],s._type),m=t=>t.map(s=>s.type==="text"?e.get(s,"content",""):e.isEmpty(s.children)?"":m(s.children)).join(""),g=t=>t===null?!0:t,y=t=>{if(t.tagName==="svg")return{};const s={},r=w[t.tagName]||{},a=t.attributes;return e.forEach(a,({key:l,value:i})=>{if(r[l]){if(t.tagName==="img"&&l==="src"&&!i.startsWith("http")){const c=e.find(t.attributes,{key:"width"}),n=e.find(t.attributes,{key:"height"});c&&n?i=`https://via.placeholder.com/${c==null?void 0:c.value}x${n==null?void 0:n.value}`:i="https://via.placeholder.com/150x150"}e.set(s,r[l],g(i))}else e.includes(["style","class","srcset"],l)||e.set(s,`styles_attrs.${l}`,g(i))}),delete s.class,s},S=(t,s="styles")=>{if(!t.attributes)return{[s]:`${o.STYLES_KEY},`};const r=e.find(t.attributes,{key:"class"});if(r){const a=r.value;return{[s]:`${o.STYLES_KEY},${a}`}}return{[s]:`${o.STYLES_KEY},`}},L=t=>{switch(t.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:return{_type:"Box",tag:t.tagName,_name:t.tagName==="div"?"Box":e.capitalize(t.tagName)}}},h=(t,s=null)=>e.flatMapDeep(t,r=>{var i;if(r.type==="comment")return[];let a={_id:p.generateUUID()};if(s&&(a._parent=s.block._id),r.type==="text")return e.isEmpty(e.get(r,"content",""))?[]:s&&x(s.node,s.block)?(e.set(s,"block.content",e.get(r,"content","")),[]):{...a,_type:"Text",content:e.get(r,"content","")};if(a={...a,...L(r),...y(r),...S(r)},a._type==="Input"){const c=a.inputType||"text";c==="checkbox"?e.set(a,"_type","Checkbox"):c==="radio"&&e.set(a,"_type","Radio")}else if(r.tagName==="video"||r.tagName==="iframe"){const c=u.stringify([r]);return T(c)&&(e.set(a,"_type","Video"),e.set(a,"url",v(c)),e.set(a,"styles",`${o.STYLES_KEY},absolute top-0 left-0 w-full h-full`),e.set(a,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),a.content=c,[a]}else if(r.tagName==="svg"){const c=e.find(r.attributes,{key:"height"}),n=e.find(r.attributes,{key:"width"}),f=e.get(c,"value")?`[${e.get(c,"value")}px]`:"24px",d=e.get(n,"value")?`[${e.get(n,"value")}px]`:"24px",b=e.get(e.find(r.attributes,{key:"class"}),"value","w-full h-full");return a.styles=`${o.STYLES_KEY}, ${p.cn(`w-${d} h-${f}`,b)}`.trim(),r.attributes=e.filter(r.attributes,_=>!e.includes(["style","width","height","class"],_.key)),a.icon=u.stringify([r]),[a]}else if(r.tagName=="option"&&s&&((i=s.block)==null?void 0:i._type)==="Select")return s.block.options.push({label:m(r.children),...y(r)}),[];const l=h(r.children,{block:a,node:r});return[a,...l]}),N=t=>{const s=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(s&&s.length>0?s[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},k=t=>{const s=u.parse(N(t));return e.isEmpty(t)?[]:e.flatten(h(s))};exports.getBlocksFromHTML=k;
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { stringify as m, parse as w } from "himalaya";
|
|
2
|
-
import { g as N, c as k } from "./Functions-7jnEwJyw.js";
|
|
3
|
-
import { isEmpty as g, includes as y, get as n, forEach as L, find as u, set as o, capitalize as S, flatMapDeep as $, filter as C, flatten as A } from "lodash-es";
|
|
4
|
-
import { a as p } from "./STRINGS--j49GZJP.js";
|
|
5
|
-
const R = (t) => {
|
|
6
|
-
const e = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, a = /(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;
|
|
7
|
-
return e.test(t) || a.test(t);
|
|
8
|
-
}, B = (t) => {
|
|
9
|
-
if (g(t))
|
|
10
|
-
return t;
|
|
11
|
-
const e = /<video[^>]+src=['"]([^'">]+)['"]/, a = /<iframe[^>]+src=['"]([^'">]+)['"]/, r = t.match(e), i = t.match(a), c = r ? r[1] : i ? i[1] : null, s = /(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/, l = /(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;
|
|
12
|
-
return c && (s.test(c) || l.test(c)) ? c : t;
|
|
13
|
-
}, H = {
|
|
14
|
-
img: { alt: "alt", width: "width", height: "height", src: "image" },
|
|
15
|
-
video: {
|
|
16
|
-
src: "url",
|
|
17
|
-
autoplay: "controls.autoPlay",
|
|
18
|
-
muted: "controls.muted",
|
|
19
|
-
loop: "controls.loop",
|
|
20
|
-
controls: "controls.widgets"
|
|
21
|
-
},
|
|
22
|
-
a: {
|
|
23
|
-
href: "link.href",
|
|
24
|
-
target: "link.target",
|
|
25
|
-
type: ""
|
|
26
|
-
// @TODO: Detect here what to url, email, phone, elementId
|
|
27
|
-
},
|
|
28
|
-
input: {
|
|
29
|
-
placeholder: "placeholder",
|
|
30
|
-
required: "required",
|
|
31
|
-
type: "inputType",
|
|
32
|
-
name: "fieldName"
|
|
33
|
-
},
|
|
34
|
-
textarea: {
|
|
35
|
-
placeholder: "placeholder",
|
|
36
|
-
required: "required",
|
|
37
|
-
type: "inputType",
|
|
38
|
-
name: "fieldName"
|
|
39
|
-
},
|
|
40
|
-
select: {
|
|
41
|
-
placeholder: "placeholder",
|
|
42
|
-
required: "required",
|
|
43
|
-
multiple: "multiple",
|
|
44
|
-
name: "fieldName"
|
|
45
|
-
}
|
|
46
|
-
}, M = (t, e) => t.children.length === 1 && y(["Heading", "Paragraph", "Span", "ListItem", "Button", "Label", "TableCell", "Link"], e._type), b = (t) => t.map((e) => e.type === "text" ? n(e, "content", "") : g(e.children) ? "" : b(e.children)).join(""), h = (t) => t === null ? !0 : t, f = (t) => {
|
|
47
|
-
if (t.tagName === "svg")
|
|
48
|
-
return {};
|
|
49
|
-
const e = {}, a = H[t.tagName] || {}, r = t.attributes;
|
|
50
|
-
return L(r, ({ key: i, value: c }) => {
|
|
51
|
-
if (a[i]) {
|
|
52
|
-
if (t.tagName === "img" && i === "src" && !c.startsWith("http")) {
|
|
53
|
-
const s = u(t.attributes, { key: "width" }), l = u(t.attributes, { key: "height" });
|
|
54
|
-
s && l ? c = `https://via.placeholder.com/${s == null ? void 0 : s.value}x${l == null ? void 0 : l.value}` : c = "https://via.placeholder.com/150x150";
|
|
55
|
-
}
|
|
56
|
-
o(e, a[i], h(c));
|
|
57
|
-
} else
|
|
58
|
-
y(["style", "class", "srcset"], i) || o(e, `styles_attrs.${i}`, h(c));
|
|
59
|
-
}), delete e.class, e;
|
|
60
|
-
}, I = (t, e = "styles") => {
|
|
61
|
-
if (!t.attributes)
|
|
62
|
-
return { [e]: `${p},` };
|
|
63
|
-
const a = u(t.attributes, { key: "class" });
|
|
64
|
-
if (a) {
|
|
65
|
-
const r = a.value;
|
|
66
|
-
return { [e]: `${p},${r}` };
|
|
67
|
-
}
|
|
68
|
-
return { [e]: `${p},` };
|
|
69
|
-
}, q = (t) => {
|
|
70
|
-
switch (t.tagName) {
|
|
71
|
-
case "img":
|
|
72
|
-
return { _type: "Image" };
|
|
73
|
-
case "input":
|
|
74
|
-
return { _type: "Input", showLabel: !1 };
|
|
75
|
-
case "hr":
|
|
76
|
-
return { _type: "Divider" };
|
|
77
|
-
case "br":
|
|
78
|
-
return { _type: "LineBreak" };
|
|
79
|
-
case "textarea":
|
|
80
|
-
return { _type: "TextArea", showLabel: !1 };
|
|
81
|
-
case "audio":
|
|
82
|
-
return { _type: "Audio" };
|
|
83
|
-
case "canvas":
|
|
84
|
-
return { _type: "Canvas" };
|
|
85
|
-
case "video":
|
|
86
|
-
case "iframe":
|
|
87
|
-
return { _type: "CustomHTML" };
|
|
88
|
-
case "svg":
|
|
89
|
-
return { _type: "Icon" };
|
|
90
|
-
case "select":
|
|
91
|
-
return { _type: "Select", options: [] };
|
|
92
|
-
case "option":
|
|
93
|
-
return { _type: "Option" };
|
|
94
|
-
case "ul":
|
|
95
|
-
case "ol":
|
|
96
|
-
case "dl":
|
|
97
|
-
return {
|
|
98
|
-
_type: "List",
|
|
99
|
-
tag: t.tagName,
|
|
100
|
-
_listType: t.tagName === "ol" ? "list-decimal" : "list-none"
|
|
101
|
-
};
|
|
102
|
-
case "li":
|
|
103
|
-
case "dt":
|
|
104
|
-
return { _type: "ListItem", tag: t.tagName };
|
|
105
|
-
case "span":
|
|
106
|
-
case "figcaption":
|
|
107
|
-
case "legend":
|
|
108
|
-
return { _type: "Span", tag: t.tagName };
|
|
109
|
-
case "p":
|
|
110
|
-
return { _type: "Paragraph", content: "" };
|
|
111
|
-
case "a":
|
|
112
|
-
return { _type: "Link" };
|
|
113
|
-
case "form":
|
|
114
|
-
return { _type: "Form" };
|
|
115
|
-
case "label":
|
|
116
|
-
return { _type: "Label" };
|
|
117
|
-
case "button":
|
|
118
|
-
return { _type: "Button" };
|
|
119
|
-
case "code":
|
|
120
|
-
return { _type: "Code" };
|
|
121
|
-
case "h1":
|
|
122
|
-
case "h2":
|
|
123
|
-
case "h3":
|
|
124
|
-
case "h4":
|
|
125
|
-
case "h5":
|
|
126
|
-
case "h6":
|
|
127
|
-
return { _type: "Heading", tag: t.tagName };
|
|
128
|
-
case "table":
|
|
129
|
-
return { _type: "Table" };
|
|
130
|
-
case "tr":
|
|
131
|
-
return { _type: "TableRow" };
|
|
132
|
-
case "td":
|
|
133
|
-
case "th":
|
|
134
|
-
return { _type: "TableCell", tag: t.tagName };
|
|
135
|
-
case "thead":
|
|
136
|
-
return { _type: "TableHead" };
|
|
137
|
-
case "tbody":
|
|
138
|
-
return { _type: "TableBody" };
|
|
139
|
-
case "tfoot":
|
|
140
|
-
return { _type: "TableFooter" };
|
|
141
|
-
default:
|
|
142
|
-
return {
|
|
143
|
-
_type: "Box",
|
|
144
|
-
tag: t.tagName,
|
|
145
|
-
_name: t.tagName === "div" ? "Box" : S(t.tagName)
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
}, d = (t, e = null) => $(t, (a) => {
|
|
149
|
-
var c;
|
|
150
|
-
if (a.type === "comment")
|
|
151
|
-
return [];
|
|
152
|
-
let r = { _id: N() };
|
|
153
|
-
if (e && (r._parent = e.block._id), a.type === "text")
|
|
154
|
-
return g(n(a, "content", "")) ? [] : e && M(e.node, e.block) ? (o(e, "block.content", n(a, "content", "")), []) : { ...r, _type: "Text", content: n(a, "content", "") };
|
|
155
|
-
if (r = {
|
|
156
|
-
...r,
|
|
157
|
-
...q(a),
|
|
158
|
-
...f(a),
|
|
159
|
-
...I(a)
|
|
160
|
-
}, r._type === "Input") {
|
|
161
|
-
const s = r.inputType || "text";
|
|
162
|
-
s === "checkbox" ? o(r, "_type", "Checkbox") : s === "radio" && o(r, "_type", "Radio");
|
|
163
|
-
} else if (a.tagName === "video" || a.tagName === "iframe") {
|
|
164
|
-
const s = m([a]);
|
|
165
|
-
return R(s) && (o(r, "_type", "Video"), o(r, "url", B(s)), o(r, "styles", `${p},absolute top-0 left-0 w-full h-full`), o(r, "controls", { autoPlay: !1, muted: !0, loop: !1, controls: !1 })), r.content = s, [r];
|
|
166
|
-
} else if (a.tagName === "svg") {
|
|
167
|
-
const s = u(a.attributes, { key: "height" }), l = u(a.attributes, { key: "width" }), _ = n(s, "value") ? `[${n(s, "value")}px]` : "24px", v = n(l, "value") ? `[${n(l, "value")}px]` : "24px", T = n(u(a.attributes, { key: "class" }), "value", "w-full h-full");
|
|
168
|
-
return r.styles = `${p}, ${k(`w-${v} h-${_}`, T)}`.trim(), a.attributes = C(a.attributes, (x) => !y(["style", "width", "height", "class"], x.key)), r.icon = m([a]), [r];
|
|
169
|
-
} else if (a.tagName == "option" && e && ((c = e.block) == null ? void 0 : c._type) === "Select")
|
|
170
|
-
return e.block.options.push({
|
|
171
|
-
label: b(a.children),
|
|
172
|
-
...f(a)
|
|
173
|
-
}), [];
|
|
174
|
-
const i = d(a.children, { block: r, node: a });
|
|
175
|
-
return [r, ...i];
|
|
176
|
-
}), E = (t) => {
|
|
177
|
-
const e = t.match(/<body[^>]*>[\s\S]*?<\/body>/);
|
|
178
|
-
return (e && e.length > 0 ? e[0].replace(/<body/, "<div").replace(/<\/body>/, "</div>") : t).replace(/\s+/g, " ").replaceAll("> <", "><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").trim();
|
|
179
|
-
}, V = (t) => {
|
|
180
|
-
const e = w(E(t));
|
|
181
|
-
return g(t) ? [] : A(d(e));
|
|
182
|
-
};
|
|
183
|
-
export {
|
|
184
|
-
V as g
|
|
185
|
-
};
|