text: /*! UIkit 3.0.0-rc.2 | http://www.getuikit.com | (c) 2014 - 2017 YOOtheme | MIT License */
  
  !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("uikit-util")):"function"==typeof define&&define.amd?define("uikitsortable",["uikit-util"],e):t.UIkitSortable=e(t.UIkit.util)}(this,function(h){"use strict";var e,t,l="uk-animation-target";function c(t,e){var i=h.css(t,"zIndex");return!!h.isVisible(t)&&h.assign({display:"",opacity:e?h.css(t,"opacity"):"0",pointerEvents:"none",position:"absolute",zIndex:"auto"===i?h.index(t):i},p(t))}function d(t){h.css(t.children,{height:"",left:"",opacity:"",pointerEvents:"",position:"",top:"",width:""}),h.removeClass(t,l),h.css(t,"height","")}function p(t){var e=t.getBoundingClientRect(),i=e.height,s=e.width,o=h.position(t),n=o.top,r=o.left;return{top:n+=h.toFloat(h.css(t,"marginTop")),left:r,height:i,width:s}}return{mixins:[{connected:function(){h.addClass(this.$el,this.$name)}},{props:{animation:Number},data:{animation:150},computed:{target:function(){return this.$el}},methods:{animate:function(t){var s=this;e||(e=h.append(document.head,"<style>").sheet).insertRule("."+l+" > * {\n                    margin-top: 0 !important;\n                    transform: none !important;\n                }");var o=h.toNodes(this.target.children),n=o.map(function(t){return c(t,!0)}),r=h.height(this.target),a=window.pageYOffset;return t(),h.Transition.cancel(this.target),o.forEach(h.Transition.cancel),d(this.target),this.$update(this.target),new h.Promise(function(e){cancelAnimationFrame(s._raf),s._raf=requestAnimationFrame(function(){var t=h.height(s.target),i=(o=o.concat(h.toNodes(s.target.children).filter(function(t){return!h.includes(o,t)}))).map(function(t,e){return!!(t.parentNode&&e in n)&&(n[e]?h.isVisible(t)?p(t):{opacity:0}:{opacity:h.isVisible(t)?1:0})});n=i.map(function(t,e){var i=o[e].parentNode===s.target&&(n[e]||c(o[e]));if(i)if(t){if(!("opacity"in t)){i.opacity%1?t.opacity=1:delete i.opacity}}else delete i.opacity;return i}),h.addClass(s.target,l),o.forEach(function(t,e){return n[e]&&h.css(t,n[e])}),h.css(s.target,"height",r),window.scroll(window.pageXOffset,a),h.Promise.all(o.map(function(t,e){return n[e]&&i[e]?h.Transition.start(t,i[e],s.animation,"ease"):h.Promise.resolve()}).concat(h.Transition.start(s.target,{height:t},s.animation,"ease"))).then(function(){o.forEach(function(t,e){return h.css(t,{display:0===i[e].opacity?"none":"",zIndex:""})}),d(s.target),s.$update(s.target),e()},h.noop)})})}}}],props:{group:String,threshold:Number,clsItem:String,clsPlaceholder:String,clsDrag:String,clsDragState:String,clsBase:String,clsNoDrag:String,clsEmpty:String,clsCustom:String,handle:String},data:{group:!1,threshold:5,clsItem:"uk-sortable-item",clsPlaceholder:"uk-sortable-placeholder",clsDrag:"uk-sortable-drag",clsDragState:"uk-drag",clsBase:"uk-sortable",clsNoDrag:"uk-sortable-nodrag",clsEmpty:"uk-sortable-empty",clsCustom:"",handle:!1},init:function(){var n=this;["init","start","move","end"].forEach(function(t){var o=n[t];n[t]=function(t){n.scrollY=window.pageYOffset;var e=h.getPos(t),i=e.x,s=e.y;n.pos={x:i,y:s},o(t)}})},events:(t={},t[h.pointerDown]="init",t),update:{write:function(){if(this.clsEmpty&&h.toggleClass(this.$el,this.clsEmpty,!this.$el.children.length),this.drag){h.offset(this.drag,{top:this.pos.y+this.origin.top,left:this.pos.x+this.origin.left});var t,e=h.offset(this.drag).top,i=e+this.drag.offsetHeight;0<e&&e<this.scrollY?t=this.scrollY-5:i<h.height(document)&&i>h.height(window)+this.scrollY&&(t=this.scrollY+5),t&&setTimeout(function(){return window.scroll(window.pageXOffset,t)},5)}}},methods:{init:function(t){var e=t.target,i=t.button,s=t.defaultPrevented,o=h.toNodes(this.$el.children).filter(function(t){return h.within(e,t)})[0];!o||h.isInput(t.target)||this.handle&&!h.within(e,this.handle)||0<i||h.within(e,"."+this.clsNoDrag)||s||(t.preventDefault(),this.touched=[this],this.placeholder=o,this.origin=h.assign({target:e,index:h.index(o)},this.pos),h.on(document,h.pointerMove,this.move),h.on(document,h.pointerUp,this.end),h.on(window,"scroll",this.scroll),this.threshold||this.start(t))},start:function(t){this.drag=h.append(this.$container,this.placeholder.outerHTML.replace(/^<li/i,"<div").replace(/li>$/i,"div>")),h.css(this.drag,h.assign({boxSizing:"border-box",width:this.placeholder.offsetWidth,height:this.placeholder.offsetHeight},h.css(this.placeholder,["paddingLeft","paddingRight","paddingTop","paddingBottom"]))),h.attr(this.drag,"uk-no-boot",""),h.addClass(this.drag,this.clsDrag,this.clsCustom),h.height(this.drag.firstElementChild,h.height(this.placeholder.firstElementChild));var e=h.offset(this.placeholder),i=e.left,s=e.top;h.assign(this.origin,{left:i-this.pos.x,top:s-this.pos.y}),h.addClass(this.placeholder,this.clsPlaceholder),h.addClass(this.$el.children,this.clsItem),h.addClass(document.documentElement,this.clsDragState),h.trigger(this.$el,"start",[this,this.placeholder]),this.move(t)},move:function(t){if(this.drag){this.$emit();var e="mousemove"===t.type?t.target:document.elementFromPoint(this.pos.x-document.body.scrollLeft,this.pos.y-document.body.scrollTop),i=this.getSortable(e),s=this.getSortable(this.placeholder),o=i!==s;if(i&&!h.within(e,this.placeholder)&&(!o||i.group&&i.group===s.group)){if(e=i.$el===e.parentNode&&e||h.toNodes(i.$el.children).filter(function(t){return h.within(e,t)})[0],o)s.remove(this.placeholder);else if(!e)return;i.insert(this.placeholder,e),h.includes(this.touched,i)||this.touched.push(i)}}else(Math.abs(this.pos.x-this.origin.x)>this.threshold||Math.abs(this.pos.y-this.origin.y)>this.threshold)&&this.start(t)},scroll:function(){var t=window.pageYOffset;t!==this.scrollY&&(this.pos.y+=t-this.scrollY,this.scrollY=t,this.$emit())},end:function(t){if(h.off(document,h.pointerMove,this.move),h.off(document,h.pointerUp,this.end),h.off(window,"scroll",this.scroll),this.drag){h.preventClick();var e=this.getSortable(this.placeholder);this===e?this.origin.index!==h.index(this.placeholder)&&h.trigger(this.$el,"moved",[this,this.placeholder]):(h.trigger(e.$el,"added",[e,this.placeholder]),h.trigger(this.$el,"removed",[this,this.placeholder])),h.trigger(this.$el,"stop",[this,this.placeholder]),h.remove(this.drag),this.drag=null;var i=this.touched.map(function(t){return t.clsPlaceholder+" "+t.clsItem}).join(" ");this.touched.forEach(function(t){return h.removeClass(t.$el.children,i)}),h.removeClass(document.documentElement,this.clsDragState)}else"mouseup"!==t.type&&h.within(t.target,"a[href]")&&(location.href=h.closest(t.target,"a[href]").href)},insert:function(i,s){var o=this;h.addClass(this.$el.children,this.clsItem);var t=function(){var t,e;s?!h.within(i,o.$el)||(e=s,(t=i).parentNode===e.parentNode&&h.index(t)>h.index(e))?h.before(s,i):h.after(s,i):h.append(o.$el,i)};this.animation?this.animate(t):t()},remove:function(t){h.within(t,this.$el)&&(this.animation?this.animate(function(){return h.remove(t)}):h.remove(t))},getSortable:function(t){return t&&(this.$getComponent(t,"sortable")||this.getSortable(t.parentNode))}}}});