!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},8619:e=>{e.exports=require("@mui/material")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return e[o](i,i.exports,t),i.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>m});var n=t(6031),i=t.n(n),a=t(1116),p=t.n(a),d=t(2015),s=t.n(d),u=t(9825),c=t.n(u);const l=require("react-beautiful-dnd");var f=t(8619);function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function y(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?b(Object(t),!0).forEach((function(r){p()(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}const g=({items:e,onReorder:r,renderItem:t,idKey:o,updateOrderKey:n,droppableId:a})=>s().createElement(l.DragDropContext,{onDragEnd:t=>{if(!t.destination)return;const o=((e,r,t,o)=>{const n=Array.from(e),[i]=n.splice(r,1);return n.splice(t,0,i),n.map(((e,r)=>y(y({},e),{},{[o]:r+1})))})(e,t.source.index,t.destination.index,n);r(o,t)}},s().createElement(l.Droppable,{droppableId:a},(r=>s().createElement(f.Box,i()({ref:r.innerRef},r.droppableProps,{sx:{width:"100%"}}),e.map(((e,r)=>s().createElement(l.Draggable,{key:String(e[o]||`new-${r}`),draggableId:String(e[o]||`new-${r}`),index:r},((o,n)=>s().createElement(f.Box,i()({ref:o.innerRef},o.draggableProps,o.dragHandleProps,{sx:{background:n.isDragging?"#f0f0f0":"inherit",transition:"background 0.2s ease"}}),t(e,r,o,n)))))),r.placeholder))));g.propTypes={items:c().array.isRequired,onReorder:c().func.isRequired,renderItem:c().func.isRequired,idKey:c().string,updateOrderKey:c().string,droppableId:c().string},g.defaultProps={idKey:"id",updateOrderKey:"order",droppableId:"droppable"};const m=g;return o})()));
//# sourceMappingURL=dnd-list.js.map