import*as t from"lit";import*as e from"lit/decorators.js";import*as o from"sortablejs";var s,r,a={8306(t,e,o){o.d(e,{s:()=>s});var s,r=o(7704),a=o(2050),i=o(4084),n=o(2927),l=o(8899),p=o(6933),h=o(9431),d=function(t,e,o,s){var r,a=arguments.length,i=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,o):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,o,s);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(i=(a<3?r(i):a>3?r(e,o,i):r(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i};!function(t){let e=class extends((0,r.TS)(n.LitElement)){constructor(){super(...arguments),this.delay=0,this.animation=0,this.handle="",this.filter="",this.easing="",this.direction="vertical",this.group=null,this.draggableItems="md-draggable-item",this.ghostClass="",this.chosenClass="",this.dragClass="",this.fallbackClass="",this.swapThreshold=1,this.touchStartThreshold=0,this.forceFallback=!1,this.sort=!1,this.disabled=!1,this.editable=!1,this.sortableInstance=null,this.handleOnChange=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-change",t)},this.handleOnClone=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-clone",t)},this.handleOnUnchoose=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-unchoose",t)},this.handleOnRemove=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-remove",t)},this.handleOnAdd=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-add",t)},this.handleOnChoose=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-choose",t)},this.handleOnEnd=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-end",t)},this.handleOnMove=(0,a.sg)(t=>{t.stopPropagation(),this.dispatchDragEvent("drag-move",t)},100),this.handleOnStart=t=>{t.stopPropagation(),this.dispatchDragEvent("drag-start",t)}}static get styles(){return[i.A,h.A]}get slotElement(){return this.draggableSlot}generateOptions(){return Object.assign(Object.assign({},this.group&&{group:this.group}),{disabled:this.disabled,animation:this.animation,sort:this.sort,delay:this.delay,handle:this.handle,easing:this.easing,filter:this.filter,swapThreshold:this.swapThreshold,touchStartThreshold:this.touchStartThreshold,draggable:this.draggableItems,direction:this.direction,ghostClass:this.ghostClass,chosenClass:this.chosenClass,dragClass:this.dragClass,fallbackClass:this.fallbackClass,forceFallback:this.forceFallback,onStart:this.handleOnStart,onMove:this.handleOnMove,onEnd:this.handleOnEnd,onChoose:this.handleOnChoose,onAdd:this.handleOnAdd,onRemove:this.handleOnRemove,onUnchoose:this.handleOnUnchoose,onClone:this.handleOnClone,onChange:this.handleOnChange})}initializeSortable(){this.sortableInstance||(this.sortableInstance=p.default.create(this,this.generateOptions()))}dispatchDragEvent(t,e){this.dispatchEvent(new CustomEvent(t,{composed:!0,bubbles:!0,detail:{srcEvent:e}}))}cleanupSortable(){this.sortableInstance&&(this.sortableInstance.destroy(),this.sortableInstance=null)}connectedCallback(){super.connectedCallback(),this.initializeSortable()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupSortable()}setSortableOption(t,e){this.sortableInstance&&void 0!==this.sortableInstance.option(t)&&this.sortableInstance.option(t,e)}updateSortableInstance(t){for(const e of t.keys()){const t=this[e];this.setSortableOption(e,t)}}updated(t){super.updated(t),this.updateSortableInstance(t)}slottedChanged(){this.initializeSortable()}render(){return n.html`
        <div class="md-draggable" part="draggable" aria-disabled=${this.disabled}>
          <slot name="draggable-item"></slot>
        </div>
      `}};d([(0,l.property)({type:Number})],e.prototype,"delay",void 0),d([(0,l.property)({type:Number})],e.prototype,"animation",void 0),d([(0,l.property)({type:String})],e.prototype,"handle",void 0),d([(0,l.property)({type:String})],e.prototype,"filter",void 0),d([(0,l.property)({type:String})],e.prototype,"easing",void 0),d([(0,l.property)({type:String})],e.prototype,"direction",void 0),d([(0,l.property)({type:Object})],e.prototype,"group",void 0),d([(0,l.property)({type:String,attribute:"draggable-items"})],e.prototype,"draggableItems",void 0),d([(0,l.property)({type:String,attribute:"ghost-class"})],e.prototype,"ghostClass",void 0),d([(0,l.property)({type:String,attribute:"chosen-class"})],e.prototype,"chosenClass",void 0),d([(0,l.property)({type:String,attribute:"drag-class"})],e.prototype,"dragClass",void 0),d([(0,l.property)({type:String,attribute:"fallback-class"})],e.prototype,"fallbackClass",void 0),d([(0,l.property)({type:Number,attribute:"swap-threshold"})],e.prototype,"swapThreshold",void 0),d([(0,l.property)({type:Number,attribute:"touch-start-threshold"})],e.prototype,"touchStartThreshold",void 0),d([(0,l.property)({type:Boolean,attribute:"force-fallback"})],e.prototype,"forceFallback",void 0),d([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"sort",void 0),d([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"disabled",void 0),d([(0,l.property)({type:Boolean,reflect:!0})],e.prototype,"editable",void 0),d([(0,l.query)("slot[name='draggable-item']")],e.prototype,"draggableSlot",void 0),e=d([(0,r.wW)("md-draggable")],e),t.ELEMENT=e}(s||(s={}))},2927(e,o,s){var r,a;e.exports=(r={LitElement:()=>t.LitElement,css:()=>t.css,html:()=>t.html},a={},s.d(a,r),a)},8899(t,o,s){var r,a;t.exports=(r={property:()=>e.property,query:()=>e.query},a={},s.d(a,r),a)},6933(t,e,s){var r,a;t.exports=(r={default:()=>o.default},a={},s.d(a,r),a)}},i={};function n(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return a[t](o,o.exports,n),o.exports}n.m=a,s=[],n.O=(t,e,o,r)=>{if(!e){var a=1/0;for(h=0;h<s.length;h++){for(var[e,o,r]=s[h],i=!0,l=0;l<e.length;l++)(!1&r||a>=r)&&Object.keys(n.O).every(t=>n.O[t](e[l]))?e.splice(l--,1):(i=!1,r<a&&(a=r));if(i){s.splice(h--,1);var p=o();void 0!==p&&(t=p)}}return t}r=r||0;for(var h=s.length;h>0&&s[h-1][2]>r;h--)s[h]=s[h-1];s[h]=[e,o,r]},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{n as __webpack_require__};r={4259:0},n.C=t=>{var e,o,{__webpack_esm_ids__:s,__webpack_esm_modules__:a,__webpack_esm_runtime__:i}=t,l=0;for(e in a)n.o(a,e)&&(n.m[e]=a[e]);for(i&&i(n);l<s.length;l++)o=s[l],n.o(r,o)&&r[o]&&r[o][0](),r[s[l]]=0;n.O()},n.O.j=t=>0===r[t];import*as l from"../9609.js";n.C(l);import*as p from"../4084.js";n.C(p);import*as h from"../2364.js";n.C(h);import*as d from"../9938.js";n.C(d);import*as c from"../4781.js";n.C(c);import*as g from"../5201.js";n.C(g);import*as b from"../2050.js";n.C(b);import*as y from"../608.js";n.C(y);import*as m from"../3203.js";n.C(m);import*as v from"../5757.js";n.C(v);import*as u from"../9431.js";n.C(u);import*as f from"../8180.js";n.C(f);var C=n.O(void 0,[9609,4084,2364,9938,4781,5201,2050,608,3203,5757,9431,8180],()=>n(8306));const O=(C=n.O(C)).s;export{O as Draggable};