import{O as e,j as n,L as o,c as t,M as s,f as r,g as a,d as i,e as l,h as c,k as p,l as d,m as x}from"../../vendor.js";import{useRef as m}from"react";import{a as u}from"../../hooks.js";import{C as f}from"../Catalogue/index.js";import{O as v}from"../Option/index.js";import{E as j}from"../Element/index.js";import{D as h}from"../Droppable/index.js";import{E as k}from"../Editable/index.js";import{s as g}from"./index.settings.js";import{I as N}from"../Icon/index.js";var b=["element","className","onPrepend","onAppend","onRemove"];function C(e,n){var o=p(e);if(d){var t=d(e);n&&(t=x(t).call(t,(function(n){return c(e,n).enumerable}))),o.push.apply(o,t)}return o}function D(e){for(var n=1;n<arguments.length;n++){var o,s=null!=arguments[n]?arguments[n]:{};if(n%2)r(o=C(Object(s),!0)).call(o,(function(n){t(e,n,s[n])}));else if(a)i(e,a(s));else{var p;r(p=C(Object(s))).call(p,(function(n){l(e,n,c(s,n))}))}}return e}var E=function(r){var a,i,l=r.element,c=r.className,p=r.onPrepend,d=r.onAppend,x=r.onRemove,C=e(r,b),E=m(),O=m(),A=m(),z=m(),I=u(),P=I.addElement,R=I.moveElement;return n.exports.jsxs("div",D(D({},C),{},{className:o("oak-col",t({},"oak-col-"+l.size,l.size&&"fluid"!==l.size),c),children:[n.exports.jsxs("div",{className:"oak-col-wrapper",children:[n.exports.jsx("div",{className:"oak-divider oak-prepend",children:n.exports.jsx("a",{href:"#",draggable:!1,onClick:function(e){e.preventDefault(),null==p||p()},children:n.exports.jsx(N,{className:"oak-append-icon",children:"add"})})}),n.exports.jsx(h,{disabled:l.content.length>0,onDrop:function(e){null==R||R(e,l,{parent:l.content,position:"after"})},children:n.exports.jsxs("div",{className:"oak-col-inner",children:[l.content.length>0&&n.exports.jsx(f,{ref:O,onAppend:function(e){var n;null==P||P(e.construct(),{parent:l.content,position:"before"}),null===(n=O.current)||void 0===n||n.close()}}),(null===(a=l.content)||void 0===a?void 0:a.length)>0&&n.exports.jsx("div",{className:"oak-col-content",children:null===(i=l.content)||void 0===i?void 0:s(i).call(i,(function(e,o){return n.exports.jsx(j,{index:o,parent:l.content,element:e},e.id||o)}))}),n.exports.jsx(f,{ref:A,onAppend:function(e){var n;null==P||P(e.construct(),{parent:l.content,position:"after"}),null===(n=A.current)||void 0===n||n.close()}})]})}),n.exports.jsx("div",{className:"oak-divider oak-append",children:n.exports.jsx("a",{href:"#",draggable:!1,onClick:function(e){e.preventDefault(),null==d||d()},children:n.exports.jsx(N,{className:"oak-append-icon",children:"add"})})}),n.exports.jsxs("div",{className:"oak-options",children:[n.exports.jsx(k,{ref:E,element:l,component:{settings:g},container:z,children:n.exports.jsx(v,{className:"oak-edit",option:{icon:"edit"},onClick:function(e){var n;e.preventDefault(),null===(n=E.current)||void 0===n||n.toggle()}})}),n.exports.jsx(v,{option:{icon:"clear"},onClick:function(e){e.preventDefault(),null==x||x()}})]})]}),n.exports.jsx("div",{ref:z})]}))};export{E as C};
//# sourceMappingURL=index.js.map
