import{O as e,m as n,P as o,T as t,n as s,o as l,q as r,r as a,s as i,y as c,z as d,g as p}from"../../vendor.js";import{useRef as u}from"react";import{u as f}from"../../hooks.js";import{T as m}from"../Text/index.js";import{S as b}from"./Section.js";import{o as j}from"./index.options.js";import{s as v}from"./index.settings.js";var x=["element","parent"];function h(e,n){var o=c(e);if(d){var t=d(e);n&&(t=p(t).call(t,(function(n){return i(e,n).enumerable}))),o.push.apply(o,t)}return o}function E(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?h(Object(o),!0).forEach((function(n){s(e,n,o[n])})):l?r(e,l(o)):h(Object(o)).forEach((function(n){a(e,n,i(o,n))}))}return e}var L=function(s){var l=s.element,r=s.parent,a=e(s,x),i=f(),c=i.moveElement,d=i.addElement,p=i.getText,j=u(),v=function(e,n,o){var t,s,l=(null===(t=o.construct)||void 0===t?void 0:t.call(o))||{};null==d||d(E(E({},l),{},{content:"function"==typeof l.content?l.content(p):l.content}),{parent:e,position:n}),null===(s=j.current)||void 0===s||s.close()},h=function(e,n,o){var t;d(o,{parent:e,position:n,normalizeOptions:{resetIds:!0}}),null===(t=j.current)||void 0===t||t.close()},L=function(e,n){c(n,l,{parent:e,position:"before"})},T=function(e,n){c(n,l,{parent:r,position:e})};return n.jsxs("div",E(E({},t(a,["builder","component"])),{},{children:[n.jsx(o,{onDrop:T.bind(null,"before"),children:n.jsx("div",{className:"oak-drop-zone oak-before"})}),n.jsxs("div",{className:"oak-foldable-content",children:[n.jsx(b,{title:n.jsx(m,{name:"core.components.foldable.sectionsTitle.seeMore",default:"Label when collapsed"}),content:l.seeMore,onDropElement:L.bind(null,l.seeMore),onAppend:v.bind(null,l.seeMore),onPaste:h.bind(null,l.seeMore)}),n.jsx(b,{title:n.jsx(m,{name:"core.components.foldable.sectionsTitle.seeLess",default:"Label when expanded"}),content:l.seeLess,onDropElement:L.bind(null,l.seeLess),onAppend:v.bind(null,l.seeLess),onPaste:h.bind(null,l.seeLess)}),n.jsx(b,{title:n.jsx(m,{name:"core.components.foldable.sectionsTitle.content",default:"Content"}),content:l.content,onDropElement:L.bind(null,l.content),onAppend:v.bind(null,l.content),onPaste:h.bind(null,l.content)})]}),n.jsx(o,{onDrop:T.bind(null,"after"),children:n.jsx("div",{className:"oak-drop-zone oak-after"})})]}))};L.options=j,L.settings=v;var T=L;export{T as F};
//# sourceMappingURL=index.js.map
