(window.webpackJsonp_stax=window.webpackJsonp_stax||[]).push([[6],{42:function(e,t,a){"use strict";a.r(t);var l=a(17),i=a(6),n=a.n(i),o=a(0),s=a.n(o),c=a(2),r=a(3),u=function(){return React.createElement(r.Tooltip,{text:Object(c.__)("Drag to Reorder","stax")},React.createElement("button",{"aria-label":Object(c.__)("Drag to Reorder","stax"),className:"handle",onClick:function(e){e.preventDefault()}},React.createElement(r.Icon,{icon:"menu"})))},m=function(e){var t=e.item,a=e.onToggle,l=e.components,i=e.allowsToggle,o=void 0===i||i,s=l[t.id];return React.createElement("div",{className:n()({"stax-sortable-item":!0,"no-toggle":!o,visible:t.visible,disabled:!t.visible})},o&&React.createElement(r.Tooltip,{text:Object(c.__)("Toggle Visibility","stax")},React.createElement("button",{"aria-label":Object(c.__)("Toggle Visibility","stax"),className:"toggle",onClick:function(e){e.preventDefault(),e.stopPropagation(),a(t.id)}},React.createElement(r.Icon,{icon:"visibility"}))),React.createElement("span",{className:"label"},s),t.visible&&React.createElement(u,null))};m.propTypes={item:s.a.object.isRequired,onToggle:s.a.func.isRequired,allowsToggle:s.a.bool.isRequired,className:s.a.string,disabled:s.a.bool};var b=function(e){var t=e.label,a=e.onUpdate,i=e.value,n=e.components,o=e.allowsToggle,s=void 0===o||o,c=function(e){var t=i.map((function(t){return t.id===e&&(t.visible=!t.visible),t}));r(t)},r=function(e){var t=e.sort((function(e,t){return e.visible===t.visible?0:e.visible?-1:1}));a(t)};return React.createElement(React.Fragment,null,t&&React.createElement("label",{className:"customize-control-title"},t),React.createElement(l.ReactSortable,{className:"items-list",list:i,setList:r,animation:300,handle:".handle"},i.map((function(e,t){return React.createElement(m,{key:"ordering-element-"+t,item:e,onToggle:c,allowsToggle:s,components:n})}))))};b.propTypes={label:s.a.string.isRequired,onUpdate:s.a.func.isRequired,value:s.a.array.isRequired,allowsToggle:s.a.bool,components:s.a.object.isRequired},t.default=b}}]);