From 9dc5f1572c105dda04de65d785a74aa5669eb489 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Wed, 11 Sep 2024 10:33:19 +0000 Subject: [PATCH] Bundled output for commit b9037df05c456cec78fa4509dd06c45dc75befc4 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- extensions/tags/js/dist/admin.js | 2 +- extensions/tags/js/dist/admin.js.map | 2 +- framework/core/js/dist/admin.js | 2 +- framework/core/js/dist/admin.js.map | 2 +- framework/core/js/dist/forum.js | 2 +- framework/core/js/dist/forum.js.map | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/tags/js/dist/admin.js b/extensions/tags/js/dist/admin.js index a195e7ccc..4bdb22bd8 100644 --- a/extensions/tags/js/dist/admin.js +++ b/extensions/tags/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={396:(t,e,n)=>{"use strict";n.d(e,{l:()=>_n});const o=flarum.reg.get("core","admin/app");var a=n.n(o);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),g=n(645),h=n.n(g),p=n(149),f=n.n(p),v=n(924),b=n(974),y=n(648);function w(){app.extensionData.for("flarum-tags").registerPermission({icon:"fas fa-tag",label:app.translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"},"moderate",95).registerPermission({icon:"fas fa-tags",label:app.translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"},"start",89)}const _=flarum.reg.get("core","admin/components/BasicsPage");var T=n.n(_);function S(){(0,r.extend)(T().prototype,"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const E=flarum.reg.get("core","admin/components/SettingDropdown");var D=n.n(E),C=n(905),x=n(433),N=n.n(x),P=(n(780),n(836)),O=n.n(P);function I(t,e){void 0===e&&(e={});const n=[],{link:o,...a}=e;return a.className=O()("TagsLabel",a.className),t?(0,y.Z)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.Z)(e,{link:o}))})):n.push((0,v.Z)()),m("span",a,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",I);class M extends(N()){constructor(){super(...arguments),(0,C.Z)(this,"tags",[]),(0,C.Z)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||a().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(h(),{className:"Button Button--text",onclick:()=>a().modal.show((()=>n.e(162).then(n.bind(n,610))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?I(this.tags):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",M),flarum.reg.addChunkModule("162","610","flarum-tags","common/components/TagSelectionModal");const k=flarum.reg.get("core","common/components/FormGroup");var A=n.n(k);function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function L(t){for(var e=1;e=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}function j(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var H=j(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Z=j(/Edge/i),G=j(/firefox/i),W=j(/safari/i)&&!j(/chrome/i)&&!j(/android/i),q=j(/iP(ad|od|hone)/i),z=j(/chrome/i)&&j(/android/i),V={capture:!1,passive:!1};function U(t,e,n){t.addEventListener(e,n,!H&&V)}function K(t,e,n){t.removeEventListener(e,n,!H&&V)}function J(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Q(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function tt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&J(t,e):J(t,e))||o&&t===n)return t;if(t===n)break}while(t=Q(t))}return null}var et,nt=/\s+/g;function ot(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(nt," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(nt," ")}}function at(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function rt(t,e){var n="";if("string"==typeof t)n=t;else do{var o=at(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function it(t,e,n){if(t){var o=t.getElementsByTagName(e),a=0,r=o.length;if(n)for(;a=r:a<=r))return o;if(o===st())break;o=ht(o,!1)}return!1}function ut(t,e,n,o){for(var a=0,r=0,i=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,a=Y(n,St);Tt.pluginEvent.bind(fe)(t,e,L({dragEl:Ct,parentEl:xt,ghostEl:Nt,rootEl:Pt,nextEl:Ot,lastDownEl:It,cloneEl:Mt,cloneHidden:kt,dragStarted:qt,putSortable:Xt,activeSortable:fe.active,originalEvent:o,oldIndex:At,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt,hideGhostForTarget:me,unhideGhostForTarget:ge,cloneNowHidden:function(){kt=!0},cloneNowShown:function(){kt=!1},dispatchSortableEvent:function(t){Dt({sortable:e,name:t,originalEvent:o})}},a))};function Dt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,r=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,g=t.putSortable,h=t.extraEventProperties;if(e=e||n&&n[yt]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||H||Z?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=a||n,p.clone=r,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=g?g.lastPutMode:void 0;var b=L(L({},h),Tt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(L({putSortable:Xt,cloneEl:Mt,targetEl:Ct,rootEl:Pt,oldIndex:At,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt},t))}var Ct,xt,Nt,Pt,Ot,It,Mt,kt,At,Ft,Lt,Bt,Rt,Xt,Yt,jt,Ht,Zt,Gt,Wt,qt,zt,Vt,Ut,$t,Kt=!1,Jt=!1,Qt=[],te=!1,ee=!1,ne=[],oe=!1,ae=[],re="undefined"!=typeof document,ie=q,se=Z||H?"cssFloat":"float",le=re&&!z&&!q&&"draggable"in document.createElement("div"),ce=function(){if(re){if(H)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),ue=function(t,e){var n=at(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=ut(t,0,e),r=ut(t,1,e),i=a&&at(a),s=r&&at(r),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+lt(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+lt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[se]||r&&"none"===n[se]&&l+c>o)?"vertical":"horizontal"},de=function(t){function e(t,n){return function(o,a,r,i){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,a,r,i),n)(o,a,r,i);var l=(n?o:a).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==B(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},me=function(){!ce&&Nt&&at(Nt,"display","none")},ge=function(){!ce&&Nt&&at(Nt,"display","")};re&&!z&&document.addEventListener("click",(function(t){if(Jt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Jt=!1,!1}),!0);var he=function(t){if(Ct){t=t.touches?t.touches[0]:t;var e=(a=t.clientX,r=t.clientY,Qt.some((function(t){var e=t[yt].options.emptyInsertThreshold;if(e&&!dt(t)){var n=lt(t),o=a>=n.left-e&&a<=n.right+e,s=r>=n.top-e&&r<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[yt]._onDragOver(n)}}var a,r,i},pe=function(t){Ct&&Ct.parentNode[yt]._isOutsideThisEl(t.target)};function fe(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=X({},e),t[yt]=this;var n,o,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ue(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==fe.supportPointer&&"PointerEvent"in window&&!W,emptyInsertThreshold:5};for(var r in Tt.initializePlugins(this,t,a),a)!(r in e)&&(e[r]=a[r]);for(var i in de(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&le,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?U(t,"pointerdown",this._onTapStart):(U(t,"mousedown",this._onTapStart),U(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(U(t,"dragover",this),U(t,"dragenter",this)),Qt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),X(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==at(t,"display")&&t!==fe.ghost){o.push({target:t,rect:lt(t)});var e=L({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=rt(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var a=!1,r=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=lt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=rt(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&pt(l,s)&&!pt(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),pt(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(a=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),a?n=setTimeout((function(){"function"==typeof t&&t()}),r):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){at(t,"transition",""),at(t,"transform","");var a=rt(this.el),r=a&&a.a,i=a&&a.d,s=(e.left-n.left)/(r||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,at(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),at(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),at(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){at(t,"transition",""),at(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function ve(t,e,n,o,a,r,i,s){var l,c,u=t[yt],d=u.options.onMove;return!window.CustomEvent||H||Z?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=a||e,l.relatedRect=r||lt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function be(t){t.draggable=!1}function ye(){oe=!1}function we(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function _e(t){return setTimeout(t,0)}function Te(t){return clearTimeout(t)}fe.prototype={constructor:fe,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(zt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Ct):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,a=o.preventOnFilter,r=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){ae.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&ae.push(o)}}(n),!Ct&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!W||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=tt(s,o.draggable,n,!1))&&s.animated||It===s)){if(At=mt(s),Lt=mt(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Dt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Et("filter",e,{evt:t}),void(a&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=tt(l,o.trim(),n,!1))return Dt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Et("filter",e,{evt:t}),!0}))))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!tt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,a=this,r=a.el,i=a.options,s=r.ownerDocument;if(n&&!Ct&&n.parentNode===r){var l=lt(n);if(Pt=r,xt=(Ct=n).parentNode,Ot=Ct.nextSibling,It=n,Rt=i.group,fe.dragged=Ct,Yt={target:Ct,clientX:(e||t).clientX,clientY:(e||t).clientY},Gt=Yt.clientX-l.left,Wt=Yt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Ct.style["will-change"]="all",o=function(){Et("delayEnded",a,{evt:t}),fe.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!G&&a.nativeDraggable&&(Ct.draggable=!0),a._triggerDragStart(t,e),Dt({sortable:a,name:"choose",originalEvent:t}),ot(Ct,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){it(Ct,t.trim(),be)})),U(s,"dragover",he),U(s,"mousemove",he),U(s,"touchmove",he),U(s,"mouseup",a._onDrop),U(s,"touchend",a._onDrop),U(s,"touchcancel",a._onDrop),G&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ct.draggable=!0),Et("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(Z||H))o();else{if(fe.eventCanceled)return void this._onDrop();U(s,"mouseup",a._disableDelayedDrag),U(s,"touchend",a._disableDelayedDrag),U(s,"touchcancel",a._disableDelayedDrag),U(s,"mousemove",a._delayedDragTouchMoveHandler),U(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&U(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ct&&be(Ct),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._disableDelayedDrag),K(t,"touchend",this._disableDelayedDrag),K(t,"touchcancel",this._disableDelayedDrag),K(t,"mousemove",this._delayedDragTouchMoveHandler),K(t,"touchmove",this._delayedDragTouchMoveHandler),K(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?U(document,"pointermove",this._onTouchMove):U(document,e?"touchmove":"mousemove",this._onTouchMove):(U(Ct,"dragend",this),U(Pt,"dragstart",this._onDragStart));try{document.selection?_e((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Kt=!1,Pt&&Ct){Et("dragStarted",this,{evt:e}),this.nativeDraggable&&U(document,"dragover",pe);var n=this.options;!t&&ot(Ct,n.dragClass,!1),ot(Ct,n.ghostClass,!0),fe.active=this,t&&this._appendGhost(),Dt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(jt){this._lastX=jt.clientX,this._lastY=jt.clientY,me();for(var t=document.elementFromPoint(jt.clientX,jt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(jt.clientX,jt.clientY))!==e;)e=t;if(Ct.parentNode[yt]._isOutsideThisEl(t),e)do{if(e[yt]&&e[yt]._onDragOver({clientX:jt.clientX,clientY:jt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=e.parentNode);ge()}},_onTouchMove:function(t){if(Yt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,a=t.touches?t.touches[0]:t,r=Nt&&rt(Nt,!0),i=Nt&&r&&r.a,s=Nt&&r&&r.d,l=ie&&$t&>($t),c=(a.clientX-Yt.clientX+o.x)/(i||1)+(l?l[0]-ne[0]:0)/(i||1),u=(a.clientY-Yt.clientY+o.y)/(s||1)+(l?l[1]-ne[1]:0)/(s||1);if(!fe.active&&!Kt){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(t,a,this)&&!p.animated){if(p===Ct)return I(!1);if(p&&r===t.target&&(i=p),i&&(n=lt(i)),!1!==ve(Pt,r,Ct,e,i,n,t,!!i))return O(),p&&p.nextSibling?r.insertBefore(Ct,p.nextSibling):r.appendChild(Ct),xt=r,M(),I(!0)}else if(p&&function(t,e,n){var o=lt(ut(n.el,0,n.options,!0));return e?t.clientXu+c*r/2:ld-Ut)return-Vt}else if(l>u+c*(1-a)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}(t,i,n,a,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,ee,zt===i),0!==v){var D=mt(Ct);do{D-=v,y=xt.children[D]}while(y&&("none"===at(y,"display")||y===Nt))}if(0===v||y===i)return I(!1);zt=i,Vt=v;var C=i.nextElementSibling,x=!1,N=ve(Pt,r,Ct,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),oe=!0,setTimeout(ye,30),O(),x&&!C?r.appendChild(Ct):i.parentNode.insertBefore(Ct,x?C:i),S&&vt(S,0,E-S.scrollTop),xt=Ct.parentNode,void 0===b||ee||(Ut=Math.abs(b-lt(i)[T])),M(),I(!0)}if(r.contains(Ct))return I(!1)}return!1}function P(s,l){Et(s,g,L({evt:t,isOwner:u,axis:a?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:I,onMove:function(n,o){return ve(Pt,r,Ct,e,n,lt(n),t,o)},changed:M},l))}function O(){P("dragOverAnimationCapture"),g.captureAnimationState(),g!==m&&m.captureAnimationState()}function I(e){return P("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(g),g!==m&&(ot(Ct,Xt?Xt.options.ghostClass:c.options.ghostClass,!1),ot(Ct,s.ghostClass,!0)),Xt!==g&&g!==fe.active?Xt=g:g===fe.active&&Xt&&(Xt=null),m===g&&(g._ignoreWhileAnimating=i),g.animateAll((function(){P("dragOverAnimationComplete"),g._ignoreWhileAnimating=null})),g!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Ct&&!Ct.animated||i===r&&!i.animated)&&(zt=null),s.dragoverBubble||t.rootEl||i===document||(Ct.parentNode[yt]._isOutsideThisEl(t.target),!e&&he(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function M(){Ft=mt(Ct),Bt=mt(Ct,s.draggable),Dt({sortable:g,name:"change",toEl:r,newIndex:Ft,newDraggableIndex:Bt,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){K(document,"mousemove",this._onTouchMove),K(document,"touchmove",this._onTouchMove),K(document,"pointermove",this._onTouchMove),K(document,"dragover",he),K(document,"mousemove",he),K(document,"touchmove",he)},_offUpEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._onDrop),K(t,"touchend",this._onDrop),K(t,"pointerup",this._onDrop),K(t,"touchcancel",this._onDrop),K(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Ft=mt(Ct),Bt=mt(Ct,n.draggable),Et("drop",this,{evt:t}),xt=Ct&&Ct.parentNode,Ft=mt(Ct),Bt=mt(Ct,n.draggable),fe.eventCanceled||(Kt=!1,ee=!1,te=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Te(this.cloneId),Te(this._dragStartId),this.nativeDraggable&&(K(document,"drop",this),K(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),W&&at(document.body,"user-select",""),at(Ct,"transform",""),t&&(qt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Nt&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),(Pt===xt||Xt&&"clone"!==Xt.lastPutMode)&&Mt&&Mt.parentNode&&Mt.parentNode.removeChild(Mt),Ct&&(this.nativeDraggable&&K(Ct,"dragend",this),be(Ct),Ct.style["will-change"]="",qt&&!Kt&&ot(Ct,Xt?Xt.options.ghostClass:this.options.ghostClass,!1),ot(Ct,this.options.chosenClass,!1),Dt({sortable:this,name:"unchoose",toEl:xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Pt!==xt?(Ft>=0&&(Dt({rootEl:xt,name:"add",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"remove",toEl:xt,originalEvent:t}),Dt({rootEl:xt,name:"sort",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),Xt&&Xt.save()):Ft!==At&&Ft>=0&&(Dt({sortable:this,name:"update",toEl:xt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),fe.active&&(null!=Ft&&-1!==Ft||(Ft=At,Bt=Lt),Dt({sortable:this,name:"end",toEl:xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Et("nulling",this),Pt=Ct=xt=Nt=Ot=Mt=It=kt=Yt=jt=qt=Ft=Bt=At=Lt=zt=Vt=Xt=Rt=fe.dragged=fe.ghost=fe.clone=fe.active=null,ae.forEach((function(t){t.checked=!0})),ae.length=Ht=Zt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Ct&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,a=n.length,r=this.options;o{const e=t.target;this.name(e.value),this.slug((0,tn.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(Ke(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),a().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(h(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},a().translator.trans("flarum-tags.admin.edit_tag.submit_button")),this.tag.exists&&m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(an()(a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=a().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}function sn(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},(0,b.Z)(t),m("span",{className:"TagListItem-name"},t.name()),m(h(),{className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:()=>a().modal.show(rn,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.Z)(a().store.all("tags")).filter((e=>e.parent()===t)).map(sn)))}flarum.reg.add("flarum-tags","admin/components/EditTagModal",rn);class ln extends(Xe()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,a().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),o=this.setting("flarum-tags.max_secondary_tags",0),r=(0,y.Z)(a().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(We(),null,m(ze(),{className:"TagGroup",label:a().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},r.filter((t=>null!==t.position()&&!t.isChild())).map(sn)),m(h(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(rn,{primary:!0})},a().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(ze(),{className:"TagGroup TagGroup--secondary",label:a().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},r.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(sn)),m(h(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(rn,{primary:!1})},a().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(ze(),{label:a().translator.trans("flarum-tags.admin.tags.settings_heading")},m(Ze(),null,m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:je()("value",this.setMinTags.bind(this,t,e))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:je()("value",this.setMinTags.bind(this,n,o))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,a().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{Be.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&a().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=a().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{a().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),a().request({url:a().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",ln);var cn=n(351),un=n.n(cn);class dn{constructor(){(0,C.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(un().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),un().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",dn);const mn=flarum.reg.get("core","common/extenders");var gn=n.n(mn);const hn=flarum.reg.get("core","common/utils/computed");var pn=n.n(hn);const fn=flarum.reg.get("core","common/Model");var vn=n.n(fn);class bn extends(vn()){name(){return vn().attribute("name").call(this)}slug(){return vn().attribute("slug").call(this)}description(){return vn().attribute("description").call(this)}color(){return vn().attribute("color").call(this)}backgroundUrl(){return vn().attribute("backgroundUrl").call(this)}backgroundMode(){return vn().attribute("backgroundMode").call(this)}icon(){return vn().attribute("icon").call(this)}position(){return vn().attribute("position").call(this)}parent(){return vn().hasOne("parent").call(this)}children(){return vn().hasMany("children").call(this)}defaultSort(){return vn().attribute("defaultSort").call(this)}isChild(){return vn().attribute("isChild").call(this)}isHidden(){return vn().attribute("isHidden").call(this)}isPrimary(){return vn().attribute("isPrimary").call(this)}discussionCount(){return vn().attribute("discussionCount").call(this)}lastPostedAt(){return vn().attribute("lastPostedAt",vn().transformDate).call(this)}lastPostedDiscussion(){return vn().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vn().attribute("isRestricted").call(this)}canStartDiscussion(){return vn().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vn().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return pn()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",bn);const yn=flarum.reg.get("core","common/query/IGambit");class wn extends yn.KeyValueGambit{constructor(){super(...arguments),(0,C.Z)(this,"predicates",!0)}key(){return un().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return un().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",wn);const _n=[(new(gn().Store)).add("tags",bn),(new(gn().Search)).gambit("discussions",wn)];a().initializers.add("flarum-tags",(t=>{t.tagList=new dn,t.extensionData.for("flarum-tags").registerPage(ln),(0,r.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,r.extend)(s().prototype,"oncreate",(function(){a().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,r.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,r.override)(a(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,r.extend)(s().prototype,"scopeItems",(t=>{(0,y.Z)(a().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.Z)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||t.permission.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:"tag".concat(e.id(),".").concat(t.permission),allowGuest:t.allowGuest}):null})))})),(0,r.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.Z)(a().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:a().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(h(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.Z)(t,{className:"Button-icon"})," ",t.name()])))))})),w(),S(),(0,r.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(a().data.settings.allow_tag_change,10);return m(D(),{defaultLabel:t?a().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:a().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:a().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,r.extend)(A().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(M,Object.assign({},t,{settingValue:t.bidi}))))}))}))},974:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var o=n(836),a=n.n(o);function r(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:r=!0}=n;return e.className=a()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&r?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",r)},924:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var o=n(780),a=n.n(o),r=n(678),i=n.n(r),s=n(836),l=n.n(s),c=n(679),u=n.n(c),d=n(974);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=a()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},270:()=>{},648:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const a=t.parent(),r=e.parent();return a===r?n-o:a&&r?a.position()-r.position():a?a===e?1:a.position()-o:r?r===t?-1:n-r.position():0}))}n.d(e,{Z:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},905:(t,e,n)=>{"use strict";function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e);if("object"!==o(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===o(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{Z:()=>a})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>"common/components/TagSelectionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(n,o,r,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(g);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((t=>t(o))),e)return e(o)},g=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const n=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={328:0};a.f.j=(e,n)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,a)=>o=t[e]=[n,a]));n.push(o[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(n=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,r,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);l&&l(a)}for(e&&e(n);c{"use strict";a.r(r),a.d(r,{extend:()=>n.l});var t=a(270),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);a.d(r,e);var n=a(396)})(),module.exports=r})(); +(()=>{var t,e,n={396:(t,e,n)=>{"use strict";n.d(e,{l:()=>_n});const o=flarum.reg.get("core","admin/app");var a=n.n(o);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","admin/components/PermissionGrid");var s=n.n(i);const l=flarum.reg.get("core","admin/components/PermissionDropdown");var c=n.n(l);const u=flarum.reg.get("core","common/components/Dropdown");var d=n.n(u),g=n(645),h=n.n(g),p=n(149),f=n.n(p),v=n(924),b=n(974),y=n(648);function w(){app.extensionData.for("flarum-tags").registerPermission({icon:"fas fa-tag",label:app.translator.trans("flarum-tags.admin.permissions.tag_discussions_label"),permission:"discussion.tag"},"moderate",95).registerPermission({icon:"fas fa-tags",label:app.translator.trans("flarum-tags.admin.permissions.bypass_tag_counts_label"),permission:"bypassTagCounts"},"start",89)}const _=flarum.reg.get("core","admin/components/BasicsPage");var T=n.n(_);function S(){(0,r.extend)(T().prototype,"homePageItems",(t=>{t.add("tags",{path:"/tags",label:app.translator.trans("flarum-tags.admin.basics.tags_label")})}))}const E=flarum.reg.get("core","admin/components/SettingDropdown");var D=n.n(E),C=n(905),x=n(433),N=n.n(x),P=(n(780),n(836)),O=n.n(P);function I(t,e){void 0===e&&(e={});const n=[],{link:o,...a}=e;return a.className=O()("TagsLabel",a.className),t?(0,y.Z)(t).forEach((e=>{(e||1===t.length)&&n.push((0,v.Z)(e,{link:o}))})):n.push((0,v.Z)()),m("span",a,n)}flarum.reg.add("flarum-tags","common/helpers/tagsLabel",I);class M extends(N()){constructor(){super(...arguments),(0,C.Z)(this,"tags",[]),(0,C.Z)(this,"loaded",!1)}view(){const t=JSON.parse(this.attrs.settingValue()||"[]");return this.loaded||a().tagList.load(["parent"]).then((e=>{this.tags=e.filter((e=>t.includes(e.id()))),this.loaded=!0,m.redraw()})),m("div",{className:"Form-group SelectTagsSettingComponent"},m("label",null,this.attrs.label),this.attrs.help&&m("p",{className:"helpText"},this.attrs.help),this.loaded?m(h(),{className:"Button Button--text",onclick:()=>a().modal.show((()=>n.e(162).then(n.bind(n,610))),{selectedTags:this.tags,onsubmit:t=>{this.tags=t,this.attrs.settingValue(JSON.stringify(t.map((t=>t.id()))))},...this.attrs.options})},this.tags.length?I(this.tags):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.admin.settings.button_text"))):m(f(),{size:"small",display:"inline"}))}}flarum.reg.add("flarum-tags","admin/components/SelectTagsSettingComponent",M),flarum.reg.addChunkModule("162","610","flarum-tags","common/components/TagSelectionModal"),flarum.reg.addChunkModule("162","610","flarum-tags","forum/components/ToggleButton");const k=flarum.reg.get("core","common/components/FormGroup");var A=n.n(k);function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function L(t){for(var e=1;e=0||(a[n]=t[n]);return a}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}function j(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var H=j(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Z=j(/Edge/i),G=j(/firefox/i),W=j(/safari/i)&&!j(/chrome/i)&&!j(/android/i),q=j(/iP(ad|od|hone)/i),z=j(/chrome/i)&&j(/android/i),V={capture:!1,passive:!1};function U(t,e,n){t.addEventListener(e,n,!H&&V)}function K(t,e,n){t.removeEventListener(e,n,!H&&V)}function J(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function Q(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function tt(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&J(t,e):J(t,e))||o&&t===n)return t;if(t===n)break}while(t=Q(t))}return null}var et,nt=/\s+/g;function ot(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(nt," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(nt," ")}}function at(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function rt(t,e){var n="";if("string"==typeof t)n=t;else do{var o=at(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function it(t,e,n){if(t){var o=t.getElementsByTagName(e),a=0,r=o.length;if(n)for(;a=r:a<=r))return o;if(o===st())break;o=ht(o,!1)}return!1}function ut(t,e,n,o){for(var a=0,r=0,i=t.children;r2&&void 0!==arguments[2]?arguments[2]:{},o=n.evt,a=Y(n,St);Tt.pluginEvent.bind(fe)(t,e,L({dragEl:Ct,parentEl:xt,ghostEl:Nt,rootEl:Pt,nextEl:Ot,lastDownEl:It,cloneEl:Mt,cloneHidden:kt,dragStarted:qt,putSortable:Xt,activeSortable:fe.active,originalEvent:o,oldIndex:At,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt,hideGhostForTarget:me,unhideGhostForTarget:ge,cloneNowHidden:function(){kt=!0},cloneNowShown:function(){kt=!1},dispatchSortableEvent:function(t){Dt({sortable:e,name:t,originalEvent:o})}},a))};function Dt(t){!function(t){var e=t.sortable,n=t.rootEl,o=t.name,a=t.targetEl,r=t.cloneEl,i=t.toEl,s=t.fromEl,l=t.oldIndex,c=t.newIndex,u=t.oldDraggableIndex,d=t.newDraggableIndex,m=t.originalEvent,g=t.putSortable,h=t.extraEventProperties;if(e=e||n&&n[yt]){var p,f=e.options,v="on"+o.charAt(0).toUpperCase()+o.substr(1);!window.CustomEvent||H||Z?(p=document.createEvent("Event")).initEvent(o,!0,!0):p=new CustomEvent(o,{bubbles:!0,cancelable:!0}),p.to=i||n,p.from=s||n,p.item=a||n,p.clone=r,p.oldIndex=l,p.newIndex=c,p.oldDraggableIndex=u,p.newDraggableIndex=d,p.originalEvent=m,p.pullMode=g?g.lastPutMode:void 0;var b=L(L({},h),Tt.getEventProperties(o,e));for(var y in b)p[y]=b[y];n&&n.dispatchEvent(p),f[v]&&f[v].call(e,p)}}(L({putSortable:Xt,cloneEl:Mt,targetEl:Ct,rootEl:Pt,oldIndex:At,oldDraggableIndex:Lt,newIndex:Ft,newDraggableIndex:Bt},t))}var Ct,xt,Nt,Pt,Ot,It,Mt,kt,At,Ft,Lt,Bt,Rt,Xt,Yt,jt,Ht,Zt,Gt,Wt,qt,zt,Vt,Ut,$t,Kt=!1,Jt=!1,Qt=[],te=!1,ee=!1,ne=[],oe=!1,ae=[],re="undefined"!=typeof document,ie=q,se=Z||H?"cssFloat":"float",le=re&&!z&&!q&&"draggable"in document.createElement("div"),ce=function(){if(re){if(H)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),ue=function(t,e){var n=at(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=ut(t,0,e),r=ut(t,1,e),i=a&&at(a),s=r&&at(r),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+lt(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+lt(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!r||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=o&&"none"===n[se]||r&&"none"===n[se]&&l+c>o)?"vertical":"horizontal"},de=function(t){function e(t,n){return function(o,a,r,i){var s=o.options.group.name&&a.options.group.name&&o.options.group.name===a.options.group.name;if(null==t&&(n||s))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,a,r,i),n)(o,a,r,i);var l=(n?o:a).options.group.name;return!0===t||"string"==typeof t&&t===l||t.join&&t.indexOf(l)>-1}}var n={},o=t.group;o&&"object"==B(o)||(o={name:o}),n.name=o.name,n.checkPull=e(o.pull,!0),n.checkPut=e(o.put),n.revertClone=o.revertClone,t.group=n},me=function(){!ce&&Nt&&at(Nt,"display","none")},ge=function(){!ce&&Nt&&at(Nt,"display","")};re&&!z&&document.addEventListener("click",(function(t){if(Jt)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Jt=!1,!1}),!0);var he=function(t){if(Ct){t=t.touches?t.touches[0]:t;var e=(a=t.clientX,r=t.clientY,Qt.some((function(t){var e=t[yt].options.emptyInsertThreshold;if(e&&!dt(t)){var n=lt(t),o=a>=n.left-e&&a<=n.right+e,s=r>=n.top-e&&r<=n.bottom+e;return o&&s?i=t:void 0}})),i);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[yt]._onDragOver(n)}}var a,r,i},pe=function(t){Ct&&Ct.parentNode[yt]._isOutsideThisEl(t.target)};function fe(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=X({},e),t[yt]=this;var n,o,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return ue(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==fe.supportPointer&&"PointerEvent"in window&&!W,emptyInsertThreshold:5};for(var r in Tt.initializePlugins(this,t,a),a)!(r in e)&&(e[r]=a[r]);for(var i in de(e),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!e.forceFallback&&le,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?U(t,"pointerdown",this._onTapStart):(U(t,"mousedown",this._onTapStart),U(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(U(t,"dragover",this),U(t,"dragenter",this)),Qt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),X(this,(o=[],{captureAnimationState:function(){o=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(t){if("none"!==at(t,"display")&&t!==fe.ghost){o.push({target:t,rect:lt(t)});var e=L({},o[o.length-1].rect);if(t.thisAnimationDuration){var n=rt(t,!0);n&&(e.top-=n.f,e.left-=n.e)}t.fromRect=e}}))},addAnimationState:function(t){o.push(t)},removeAnimationState:function(t){o.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(o,{target:t}),1)},animateAll:function(t){var e=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof t&&t());var a=!1,r=0;o.forEach((function(t){var n=0,o=t.target,i=o.fromRect,s=lt(o),l=o.prevFromRect,c=o.prevToRect,u=t.rect,d=rt(o,!0);d&&(s.top-=d.f,s.left-=d.e),o.toRect=s,o.thisAnimationDuration&&pt(l,s)&&!pt(i,s)&&(u.top-s.top)/(u.left-s.left)==(i.top-s.top)/(i.left-s.left)&&(n=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,l,c,e.options)),pt(s,i)||(o.prevFromRect=i,o.prevToRect=s,n||(n=e.options.animation),e.animate(o,u,s,n)),n&&(a=!0,r=Math.max(r,n),clearTimeout(o.animationResetTimer),o.animationResetTimer=setTimeout((function(){o.animationTime=0,o.prevFromRect=null,o.fromRect=null,o.prevToRect=null,o.thisAnimationDuration=null}),n),o.thisAnimationDuration=n)})),clearTimeout(n),a?n=setTimeout((function(){"function"==typeof t&&t()}),r):"function"==typeof t&&t(),o=[]},animate:function(t,e,n,o){if(o){at(t,"transition",""),at(t,"transform","");var a=rt(this.el),r=a&&a.a,i=a&&a.d,s=(e.left-n.left)/(r||1),l=(e.top-n.top)/(i||1);t.animatingX=!!s,t.animatingY=!!l,at(t,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),at(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),at(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){at(t,"transition",""),at(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}))}function ve(t,e,n,o,a,r,i,s){var l,c,u=t[yt],d=u.options.onMove;return!window.CustomEvent||H||Z?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=e,l.from=t,l.dragged=n,l.draggedRect=o,l.related=a||e,l.relatedRect=r||lt(e),l.willInsertAfter=s,l.originalEvent=i,t.dispatchEvent(l),d&&(c=d.call(u,l,i)),c}function be(t){t.draggable=!1}function ye(){oe=!1}function we(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function _e(t){return setTimeout(t,0)}function Te(t){return clearTimeout(t)}fe.prototype={constructor:fe,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(zt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Ct):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,a=o.preventOnFilter,r=t.type,i=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,s=(i||t).target,l=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||s,c=o.filter;if(function(t){ae.length=0;for(var e=t.getElementsByTagName("input"),n=e.length;n--;){var o=e[n];o.checked&&ae.push(o)}}(n),!Ct&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!W||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=tt(s,o.draggable,n,!1))&&s.animated||It===s)){if(At=mt(s),Lt=mt(s,o.draggable),"function"==typeof c){if(c.call(this,t,s,this))return Dt({sortable:e,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Et("filter",e,{evt:t}),void(a&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=tt(l,o.trim(),n,!1))return Dt({sortable:e,rootEl:o,name:"filter",targetEl:s,fromEl:n,toEl:n}),Et("filter",e,{evt:t}),!0}))))return void(a&&t.cancelable&&t.preventDefault());o.handle&&!tt(l,o.handle,n,!1)||this._prepareDragStart(t,i,s)}}},_prepareDragStart:function(t,e,n){var o,a=this,r=a.el,i=a.options,s=r.ownerDocument;if(n&&!Ct&&n.parentNode===r){var l=lt(n);if(Pt=r,xt=(Ct=n).parentNode,Ot=Ct.nextSibling,It=n,Rt=i.group,fe.dragged=Ct,Yt={target:Ct,clientX:(e||t).clientX,clientY:(e||t).clientY},Gt=Yt.clientX-l.left,Wt=Yt.clientY-l.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Ct.style["will-change"]="all",o=function(){Et("delayEnded",a,{evt:t}),fe.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!G&&a.nativeDraggable&&(Ct.draggable=!0),a._triggerDragStart(t,e),Dt({sortable:a,name:"choose",originalEvent:t}),ot(Ct,i.chosenClass,!0))},i.ignore.split(",").forEach((function(t){it(Ct,t.trim(),be)})),U(s,"dragover",he),U(s,"mousemove",he),U(s,"touchmove",he),U(s,"mouseup",a._onDrop),U(s,"touchend",a._onDrop),U(s,"touchcancel",a._onDrop),G&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ct.draggable=!0),Et("delayStart",this,{evt:t}),!i.delay||i.delayOnTouchOnly&&!e||this.nativeDraggable&&(Z||H))o();else{if(fe.eventCanceled)return void this._onDrop();U(s,"mouseup",a._disableDelayedDrag),U(s,"touchend",a._disableDelayedDrag),U(s,"touchcancel",a._disableDelayedDrag),U(s,"mousemove",a._delayedDragTouchMoveHandler),U(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&U(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(o,i.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ct&&be(Ct),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._disableDelayedDrag),K(t,"touchend",this._disableDelayedDrag),K(t,"touchcancel",this._disableDelayedDrag),K(t,"mousemove",this._delayedDragTouchMoveHandler),K(t,"touchmove",this._delayedDragTouchMoveHandler),K(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?U(document,"pointermove",this._onTouchMove):U(document,e?"touchmove":"mousemove",this._onTouchMove):(U(Ct,"dragend",this),U(Pt,"dragstart",this._onDragStart));try{document.selection?_e((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Kt=!1,Pt&&Ct){Et("dragStarted",this,{evt:e}),this.nativeDraggable&&U(document,"dragover",pe);var n=this.options;!t&&ot(Ct,n.dragClass,!1),ot(Ct,n.ghostClass,!0),fe.active=this,t&&this._appendGhost(),Dt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(jt){this._lastX=jt.clientX,this._lastY=jt.clientY,me();for(var t=document.elementFromPoint(jt.clientX,jt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(jt.clientX,jt.clientY))!==e;)e=t;if(Ct.parentNode[yt]._isOutsideThisEl(t),e)do{if(e[yt]&&e[yt]._onDragOver({clientX:jt.clientX,clientY:jt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break;t=e}while(e=e.parentNode);ge()}},_onTouchMove:function(t){if(Yt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,a=t.touches?t.touches[0]:t,r=Nt&&rt(Nt,!0),i=Nt&&r&&r.a,s=Nt&&r&&r.d,l=ie&&$t&>($t),c=(a.clientX-Yt.clientX+o.x)/(i||1)+(l?l[0]-ne[0]:0)/(i||1),u=(a.clientY-Yt.clientY+o.y)/(s||1)+(l?l[1]-ne[1]:0)/(s||1);if(!fe.active&&!Kt){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))o.right+10||t.clientX<=o.right&&t.clientY>o.bottom&&t.clientX>=o.left:t.clientX>o.right&&t.clientY>o.top||t.clientX<=o.right&&t.clientY>o.bottom+10}(t,a,this)&&!p.animated){if(p===Ct)return I(!1);if(p&&r===t.target&&(i=p),i&&(n=lt(i)),!1!==ve(Pt,r,Ct,e,i,n,t,!!i))return O(),p&&p.nextSibling?r.insertBefore(Ct,p.nextSibling):r.appendChild(Ct),xt=r,M(),I(!0)}else if(p&&function(t,e,n){var o=lt(ut(n.el,0,n.options,!0));return e?t.clientXu+c*r/2:ld-Ut)return-Vt}else if(l>u+c*(1-a)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}(t,i,n,a,_?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,ee,zt===i),0!==v){var D=mt(Ct);do{D-=v,y=xt.children[D]}while(y&&("none"===at(y,"display")||y===Nt))}if(0===v||y===i)return I(!1);zt=i,Vt=v;var C=i.nextElementSibling,x=!1,N=ve(Pt,r,Ct,e,i,n,t,x=1===v);if(!1!==N)return 1!==N&&-1!==N||(x=1===N),oe=!0,setTimeout(ye,30),O(),x&&!C?r.appendChild(Ct):i.parentNode.insertBefore(Ct,x?C:i),S&&vt(S,0,E-S.scrollTop),xt=Ct.parentNode,void 0===b||ee||(Ut=Math.abs(b-lt(i)[T])),M(),I(!0)}if(r.contains(Ct))return I(!1)}return!1}function P(s,l){Et(s,g,L({evt:t,isOwner:u,axis:a?"vertical":"horizontal",revert:o,dragRect:e,targetRect:n,canSort:d,fromSortable:m,target:i,completed:I,onMove:function(n,o){return ve(Pt,r,Ct,e,n,lt(n),t,o)},changed:M},l))}function O(){P("dragOverAnimationCapture"),g.captureAnimationState(),g!==m&&m.captureAnimationState()}function I(e){return P("dragOverCompleted",{insertion:e}),e&&(u?c._hideClone():c._showClone(g),g!==m&&(ot(Ct,Xt?Xt.options.ghostClass:c.options.ghostClass,!1),ot(Ct,s.ghostClass,!0)),Xt!==g&&g!==fe.active?Xt=g:g===fe.active&&Xt&&(Xt=null),m===g&&(g._ignoreWhileAnimating=i),g.animateAll((function(){P("dragOverAnimationComplete"),g._ignoreWhileAnimating=null})),g!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(i===Ct&&!Ct.animated||i===r&&!i.animated)&&(zt=null),s.dragoverBubble||t.rootEl||i===document||(Ct.parentNode[yt]._isOutsideThisEl(t.target),!e&&he(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),h=!0}function M(){Ft=mt(Ct),Bt=mt(Ct,s.draggable),Dt({sortable:g,name:"change",toEl:r,newIndex:Ft,newDraggableIndex:Bt,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){K(document,"mousemove",this._onTouchMove),K(document,"touchmove",this._onTouchMove),K(document,"pointermove",this._onTouchMove),K(document,"dragover",he),K(document,"mousemove",he),K(document,"touchmove",he)},_offUpEvents:function(){var t=this.el.ownerDocument;K(t,"mouseup",this._onDrop),K(t,"touchend",this._onDrop),K(t,"pointerup",this._onDrop),K(t,"touchcancel",this._onDrop),K(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;Ft=mt(Ct),Bt=mt(Ct,n.draggable),Et("drop",this,{evt:t}),xt=Ct&&Ct.parentNode,Ft=mt(Ct),Bt=mt(Ct,n.draggable),fe.eventCanceled||(Kt=!1,ee=!1,te=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Te(this.cloneId),Te(this._dragStartId),this.nativeDraggable&&(K(document,"drop",this),K(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),W&&at(document.body,"user-select",""),at(Ct,"transform",""),t&&(qt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),Nt&&Nt.parentNode&&Nt.parentNode.removeChild(Nt),(Pt===xt||Xt&&"clone"!==Xt.lastPutMode)&&Mt&&Mt.parentNode&&Mt.parentNode.removeChild(Mt),Ct&&(this.nativeDraggable&&K(Ct,"dragend",this),be(Ct),Ct.style["will-change"]="",qt&&!Kt&&ot(Ct,Xt?Xt.options.ghostClass:this.options.ghostClass,!1),ot(Ct,this.options.chosenClass,!1),Dt({sortable:this,name:"unchoose",toEl:xt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Pt!==xt?(Ft>=0&&(Dt({rootEl:xt,name:"add",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"remove",toEl:xt,originalEvent:t}),Dt({rootEl:xt,name:"sort",toEl:xt,fromEl:Pt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),Xt&&Xt.save()):Ft!==At&&Ft>=0&&(Dt({sortable:this,name:"update",toEl:xt,originalEvent:t}),Dt({sortable:this,name:"sort",toEl:xt,originalEvent:t})),fe.active&&(null!=Ft&&-1!==Ft||(Ft=At,Bt=Lt),Dt({sortable:this,name:"end",toEl:xt,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){Et("nulling",this),Pt=Ct=xt=Nt=Ot=Mt=It=kt=Yt=jt=qt=Ft=Bt=At=Lt=zt=Vt=Xt=Rt=fe.dragged=fe.ghost=fe.clone=fe.active=null,ae.forEach((function(t){t.checked=!0})),ae.length=Ht=Zt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":Ct&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,a=n.length,r=this.options;o{const e=t.target;this.name(e.value),this.slug((0,tn.slug)(e.value))}})),50),t.add("slug",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.slug_label")),m("input",{className:"FormControl",bidi:this.slug})),40),t.add("description",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.description_label")),m("textarea",{className:"FormControl",bidi:this.description})),30),t.add("color",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.color_label")),m(Ke(),{className:"FormControl",placeholder:"#aaaaaa",bidi:this.color})),20),t.add("icon",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.edit_tag.icon_label")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})})),m("input",{className:"FormControl",placeholder:"fas fa-bolt",bidi:this.icon})),10),t.add("hidden",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.isHidden}),a().translator.trans("flarum-tags.admin.edit_tag.hide_label")))),10),t.add("submit",m("div",{className:"Form-group Form-controls"},m(h(),{type:"submit",className:"Button Button--primary EditTagModal-save",loading:this.loading},a().translator.trans("flarum-tags.admin.edit_tag.submit_button")),this.tag.exists&&m("button",{type:"button",className:"Button EditTagModal-delete",onclick:this.delete.bind(this)},a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_button"))),-10),t}submitData(){return{name:this.name(),slug:this.slug(),description:this.description(),color:this.color(),icon:this.icon(),isHidden:this.isHidden(),isPrimary:this.isPrimary()}}onsubmit(t){t.preventDefault(),this.loading=!0,this.tag.save(this.submitData()).then((()=>this.hide()),(()=>this.loading=!1))}delete(){if(confirm(an()(a().translator.trans("flarum-tags.admin.edit_tag.delete_tag_confirmation")))){const t=a().store.all("tags").filter((t=>t.parent()===this.tag));this.tag.delete().then((()=>{t.forEach((t=>t.pushData({attributes:{isChild:!1}}))),m.redraw()})),this.hide()}}}function sn(t){return m("li",{"data-id":t.id(),style:{color:t.color()}},m("div",{className:"TagListItem-info"},(0,b.Z)(t),m("span",{className:"TagListItem-name"},t.name()),m(h(),{className:"Button Button--link",icon:"fas fa-pencil-alt",onclick:()=>a().modal.show(rn,{model:t})})),!t.isChild()&&null!==t.position()&&m("ol",{className:"TagListItem-children TagList"},(0,y.Z)(a().store.all("tags")).filter((e=>e.parent()===t)).map(sn)))}flarum.reg.add("flarum-tags","admin/components/EditTagModal",rn);class ln extends(Xe()){oninit(t){super.oninit(t),this.forcedRefreshKey=0,this.loading=!0,a().tagList.load(["parent"]).then((()=>{this.loading=!1,m.redraw()}))}content(){if(this.loading)return m(f(),null);const t=this.setting("flarum-tags.min_primary_tags",0),e=this.setting("flarum-tags.max_primary_tags",0),n=this.setting("flarum-tags.min_secondary_tags",0),o=this.setting("flarum-tags.max_secondary_tags",0),r=(0,y.Z)(a().store.all("tags").filter((t=>!t.parent())));return m("div",{className:"TagsContent"},m("div",{className:"TagsContent-list"},m("div",{className:"container",key:this.forcedRefreshKey,oncreate:this.onListOnCreate.bind(this)},m(We(),null,m(ze(),{className:"TagGroup",label:a().translator.trans("flarum-tags.admin.tags.primary_heading")},m("ol",{className:"TagList TagList--primary"},r.filter((t=>null!==t.position()&&!t.isChild())).map(sn)),m(h(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(rn,{primary:!0})},a().translator.trans("flarum-tags.admin.tags.create_primary_tag_button"))),m(ze(),{className:"TagGroup TagGroup--secondary",label:a().translator.trans("flarum-tags.admin.tags.secondary_heading")},m("ul",{className:"TagList"},r.filter((t=>null===t.position())).sort(((t,e)=>t.name().localeCompare(e.name()))).map(sn)),m(h(),{className:"Button TagList-button",icon:"fas fa-plus",onclick:()=>a().modal.show(rn,{primary:!1})},a().translator.trans("flarum-tags.admin.tags.create_secondary_tag_button"))),m(ze(),{label:a().translator.trans("flarum-tags.admin.tags.settings_heading")},m(Ze(),null,m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_primary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_primary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:t(),oninput:je()("value",this.setMinTags.bind(this,t,e))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:t(),bidi:e}))),m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_heading")),m("div",{className:"helpText"},a().translator.trans("flarum-tags.admin.tag_settings.required_secondary_text")),m("div",{className:"TagSettings-rangeInput"},m("input",{className:"FormControl",type:"number",min:"0",value:n(),oninput:je()("value",this.setMinTags.bind(this,n,o))}),a().translator.trans("flarum-tags.admin.tag_settings.range_separator_text"),m("input",{className:"FormControl",type:"number",min:n(),bidi:o}))),m("div",{className:"Form-group Form-controls"},this.submitButton())))),m("div",{className:"TagsContent-footer"},m("p",null,a().translator.trans("flarum-tags.admin.tags.about_tags_text"))))))}onListOnCreate(t){this.$(".TagList").get().map((t=>{Be.create(t,{group:"tags",delay:50,delayOnTouchOnly:!0,touchStartThreshold:5,animation:150,swapThreshold:.65,dragClass:"sortable-dragging",ghostClass:"sortable-placeholder",onSort:t=>this.onSortUpdate(t)})}))}setMinTags(t,e,n){t(n),e(Math.max(n,e()))}onSortUpdate(t){t.from instanceof HTMLOListElement&&t.to instanceof HTMLUListElement&&a().store.getById("tags",t.item.getAttribute("data-id")).pushData({attributes:{position:null,isChild:!1},relationships:{parent:null}});const e=this.$(".TagList--primary > li").map((function(){return{id:$(this).data("id"),children:$(this).find("li").map((function(){return $(this).data("id")})).get()}})).get();e.forEach(((t,e)=>{const n=a().store.getById("tags",t.id);n.pushData({attributes:{position:e,isChild:!1},relationships:{parent:null}}),t.children.forEach(((t,e)=>{a().store.getById("tags",t).pushData({attributes:{position:e,isChild:!0},relationships:{parent:n}})}))})),a().request({url:a().forum.attribute("apiUrl")+"/tags/order",method:"POST",body:{order:e}}),this.forcedRefreshKey++,m.redraw()}}flarum.reg.add("flarum-tags","admin/components/TagsPage",ln);var cn=n(351),un=n.n(cn);class dn{constructor(){(0,C.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(un().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),un().store.find("tags",{include:t.join(",")}).then((e=>{const n=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),n}))}}flarum.reg.add("flarum-tags","common/states/TagListState",dn);const mn=flarum.reg.get("core","common/extenders");var gn=n.n(mn);const hn=flarum.reg.get("core","common/utils/computed");var pn=n.n(hn);const fn=flarum.reg.get("core","common/Model");var vn=n.n(fn);class bn extends(vn()){name(){return vn().attribute("name").call(this)}slug(){return vn().attribute("slug").call(this)}description(){return vn().attribute("description").call(this)}color(){return vn().attribute("color").call(this)}backgroundUrl(){return vn().attribute("backgroundUrl").call(this)}backgroundMode(){return vn().attribute("backgroundMode").call(this)}icon(){return vn().attribute("icon").call(this)}position(){return vn().attribute("position").call(this)}parent(){return vn().hasOne("parent").call(this)}children(){return vn().hasMany("children").call(this)}defaultSort(){return vn().attribute("defaultSort").call(this)}isChild(){return vn().attribute("isChild").call(this)}isHidden(){return vn().attribute("isHidden").call(this)}isPrimary(){return vn().attribute("isPrimary").call(this)}discussionCount(){return vn().attribute("discussionCount").call(this)}lastPostedAt(){return vn().attribute("lastPostedAt",vn().transformDate).call(this)}lastPostedDiscussion(){return vn().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vn().attribute("isRestricted").call(this)}canStartDiscussion(){return vn().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vn().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return pn()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",bn);const yn=flarum.reg.get("core","common/query/IGambit");class wn extends yn.KeyValueGambit{constructor(){super(...arguments),(0,C.Z)(this,"predicates",!0)}key(){return un().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return un().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let n=[];return Array.isArray(t)?(n=t.map((t=>this.fromFilter(t.toString(),e))),n.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",wn);const _n=[(new(gn().Store)).add("tags",bn),(new(gn().Search)).gambit("discussions",wn)];a().initializers.add("flarum-tags",(t=>{t.tagList=new dn,t.extensionData.for("flarum-tags").registerPage(ln),(0,r.extend)(s().prototype,"oninit",(function(){this.loading=!0})),(0,r.extend)(s().prototype,"oncreate",(function(){a().tagList.load().then((()=>{this.loading=!1,m.redraw()}))})),(0,r.override)(s().prototype,"view",(function(t,e){return this.loading?m(f(),null):t(e)})),(0,r.override)(a(),"getRequiredPermissions",((t,e)=>{const n=e.match(/^tag\d+\./);return n?t(e.substr(n[0].length)).map((t=>n[0]+t)):t(e)})),(0,r.extend)(s().prototype,"scopeItems",(t=>{(0,y.Z)(a().store.all("tags")).filter((t=>t.isRestricted())).forEach((e=>t.add("tag"+e.id(),{label:(0,v.Z)(e),onremove:()=>e.save({isRestricted:!1}),render:t=>"setting"in t?null:"viewForum"===t.permission||"startDiscussion"===t.permission||t.permission.startsWith("discussion.")&&!1!==t.tagScoped||t.tagScoped?m(c(),{permission:"tag".concat(e.id(),".").concat(t.permission),allowGuest:t.allowGuest}):null})))})),(0,r.extend)(s().prototype,"scopeControlItems",(t=>{const e=(0,y.Z)(a().store.all("tags").filter((t=>!t.isRestricted())));e.length&&t.add("tag",m(d(),{className:"Dropdown--restrictByTag",buttonClassName:"Button Button--text",label:a().translator.trans("flarum-tags.admin.permissions.restrict_by_tag_heading"),icon:"fas fa-plus",caretIcon:null},e.map((t=>m(h(),{icon:!0,onclick:()=>t.save({isRestricted:!0})},[(0,b.Z)(t,{className:"Button-icon"})," ",t.name()])))))})),w(),S(),(0,r.extend)(s().prototype,"startItems",(t=>{t.add("allowTagChange",{icon:"fas fa-tag",label:a().translator.trans("flarum-tags.admin.permissions.allow_edit_tags_label"),setting:()=>{const t=parseInt(a().data.settings.allow_tag_change,10);return m(D(),{defaultLabel:t?a().translator.trans("core.admin.permissions_controls.allow_some_minutes_button",{count:t}):a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button"),key:"allow_tag_change",options:[{value:"-1",label:a().translator.trans("core.admin.permissions_controls.allow_indefinitely_button")},{value:"10",label:a().translator.trans("core.admin.permissions_controls.allow_ten_minutes_button")},{value:"reply",label:a().translator.trans("core.admin.permissions_controls.allow_until_reply_button")}]})}},90)})),(0,r.extend)(A().prototype,"customFieldComponents",(function(t){t.add("flarum-tags.select-tags",(t=>m(M,Object.assign({},t,{settingValue:t.bidi}))))}))}))},974:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var o=n(836),a=n.n(o);function r(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});const o=t&&t.icon(),{useColor:r=!0}=n;return e.className=a()([e.className,"icon text-colored",o?t.icon():"TagIcon"]),t&&r?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),o?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",r)},924:(t,e,n)=>{"use strict";n.d(e,{Z:()=>g});var o=n(780),a=n.n(o),r=n(678),i=n.n(r),s=n(836),l=n.n(s),c=n(679),u=n.n(c),d=n(974);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const n=a()(e,"link"),o=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const o=t.color();o&&(e.style["--tag-bg"]=o,e.className=l()(e.className,"colored",u()(o))),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?i():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},o)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},270:()=>{},648:(t,e,n)=>{"use strict";function o(t){return t.slice(0).sort(((t,e)=>{const n=t.position(),o=e.position();if(null===n&&null===o)return e.discussionCount()-t.discussionCount();if(null===o)return-1;if(null===n)return 1;const a=t.parent(),r=e.parent();return a===r?n-o:a&&r?a.position()-r.position():a?a===e?1:a.position()-o:r?r===t?-1:n-r.position():0}))}n.d(e,{Z:()=>o}),flarum.reg.add("flarum-tags","common/utils/sortTags",o)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},905:(t,e,n)=>{"use strict";function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function a(t,e,n){return(e=function(t){var e=function(t,e){if("object"!==o(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,e);if("object"!==o(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===o(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,{Z:()=>a})}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var r=o[t]={exports:{}};return n[t](r,r.exports,a),r.exports}a.m=n,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>"common/components/TagSelectionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(n,o,r,i)=>{if(t[n])t[n].push(o);else{var s,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),u=0;u{s.onerror=s.onload=null,clearTimeout(g);var a=t[n];if(delete t[n],s.parentNode&&s.parentNode.removeChild(s),a&&a.forEach((t=>t(o))),e)return e(o)},g=setTimeout(m.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=m.bind(null,s.onerror),s.onload=m.bind(null,s.onload),l&&document.head.appendChild(s)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");n.length&&(t=n[n.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const n=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,n)},(()=>{var t={328:0};a.f.j=(e,n)=>{var o=a.o(t,e)?t[e]:void 0;if(0!==o)if(o)n.push(o[2]);else{var r=new Promise(((n,a)=>o=t[e]=[n,a]));n.push(o[2]=r);var i=a.p+a.u(e),s=new Error;a.l(i,(n=>{if(a.o(t,e)&&(0!==(o=t[e])&&(t[e]=void 0),o)){var r=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;s.message="Loading chunk "+e+" failed.\n("+r+": "+i+")",s.name="ChunkLoadError",s.type=r,s.request=i,o[1](s)}}),"chunk-"+e,e)}};var e=(e,n)=>{var o,r,[i,s,l]=n,c=0;if(i.some((e=>0!==t[e]))){for(o in s)a.o(s,o)&&(a.m[o]=s[o]);l&&l(a)}for(e&&e(n);c{"use strict";a.r(r),a.d(r,{extend:()=>n.l});var t=a(270),e={};for(const n in t)"default"!==n&&(e[n]=()=>t[n]);a.d(r,e);var n=a(396)})(),module.exports=r})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/tags/js/dist/admin.js.map b/extensions/tags/js/dist/admin.js.map index 592d05f37..98af02fcb 100644 --- a/extensions/tags/js/dist/admin.js.map +++ b/extensions/tags/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":";UAAIA,EACAC,kDCDJ,MAAM,EAA+BC,OAAOC,IAAIC,IAAI,OAAQ,0BCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,iBCAtD,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,gDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,oDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,0GCA7C,SAAS,IACtBC,IAAIC,cAAcC,IAAI,eAAeC,mBAAmB,CACtDC,KAAM,aACNC,MAAOL,IAAIM,WAAWC,MAAM,uDAC5BC,WAAY,kBACX,WAAY,IAAIL,mBAAmB,CACpCC,KAAM,cACNC,MAAOL,IAAIM,WAAWC,MAAM,yDAC5BC,WAAY,mBACX,QAAS,GACd,CCVA,MAAM,EAA+BX,OAAOC,IAAIC,IAAI,OAAQ,4CCE7C,SAAS,KACtB,IAAAU,QAAO,cAAsB,iBAAiBC,IAC5CA,EAAMC,IAAI,OAAQ,CAChBC,KAAM,QACNP,MAAOL,IAAIM,WAAWC,MAAM,wCAC5B,GAEN,CCTA,MAAM,EAA+BV,OAAOC,IAAIC,IAAI,OAAQ,uGCI7C,SAASc,EAAUC,EAAMC,QACxB,IAAVA,IACFA,EAAQ,CAAC,GAEX,MAAMC,EAAW,IACX,KACJC,KACGC,GACDH,EAaJ,OAZAG,EAAWC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,EAAgBlC,GAAS,KAE1BkC,EAAgBlC,GAAW,CAC5B,EAIGgD,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBn0B,QAAQ8zB,EAAqBnkB,KAAK,KAAM,IAC3DwkB,EAAmBh0B,KAAO2zB,EAAqBnkB,KAAK,KAAMwkB,EAAmBh0B,KAAKwP,KAAKwkB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/./src/admin/addTagPermission.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSectionGroup')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSection')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","export default function () {\n app.extensionData.for('flarum-tags').registerPermission({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n }, 'moderate', 95).registerPermission({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n }, 'start', 89);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage.prototype, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('162', '610', 'flarum-tags', 'common/components/TagSelectionModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","/**!\n * Sortable 1.15.0\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // if there is a last element, it is the target\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n\n if (firstChild === dragEl) {\n return completed(false);\n }\n\n target = firstChild;\n targetRect = getRect(target);\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var spacer = 10;\n return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n folding = false; // Do not \"unfold\" after around dragEl if reverted\n\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSectionGroup');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSection');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\n/**\n * The `EditTagModal` component shows a modal dialog which allows the user\n * to create or edit a tag.\n */\nexport default class EditTagModal extends FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: \"https://fontawesome.com/icons?m=free\",\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import sortable from 'sortablejs';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Form from 'flarum/common/components/Form';\nimport FormSectionGroup from 'flarum/admin/components/FormSectionGroup';\nimport FormSection from 'flarum/admin/components/FormSection';\nimport EditTagModal from './EditTagModal';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\nfunction tagItem(tag) {\n return m(\"li\", {\n \"data-id\": tag.id(),\n style: {\n color: tag.color()\n }\n }, m(\"div\", {\n className: \"TagListItem-info\"\n }, tagIcon(tag), m(\"span\", {\n className: \"TagListItem-name\"\n }, tag.name()), m(Button, {\n className: \"Button Button--link\",\n icon: \"fas fa-pencil-alt\",\n onclick: () => app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagPermission from './addTagPermission';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagsPage from './components/TagsPage';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from '../common/extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n app.extensionData.for('flarum-tags').registerPage(TagsPage);\n addTagsPermissionScope();\n addTagPermission();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || item.permission.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: \"tag\".concat(tag.id(), \".\").concat(item.permission),\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\n className: \"Dropdown--restrictByTag\",\n buttonClassName: \"Button Button--text\",\n label: app.translator.trans('flarum-tags.admin.permissions.restrict_by_tag_heading'),\n icon: \"fas fa-plus\",\n caretIcon: null\n }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t328: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","app","extensionData","for","registerPermission","icon","label","translator","trans","permission","extend","items","add","path","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","then","filter","includes","id","redraw","help","onclick","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","call","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","name","state","classList","replace","css","prop","val","style","defaultView","getComputedStyle","currentStyle","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","find","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","parent","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","_this","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","concat","pluginEvent","eventName","sortable","evt","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","bind","dragEl","parentEl","ghostEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","from","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","join","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","rect","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","toString","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","child","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","max","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","animated","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","_ghostIsLast","changed","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","Array","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","slug","description","color","isHidden","isPrimary","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","tabindex","loading","exists","delete","hide","confirm","pushData","isChild","tagItem","tagIcon","position","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","oncreate","onListOnCreate","localeCompare","min","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","relationships","j","url","method","TagListState","async","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","Set","isArray","Tag","backgroundUrl","backgroundMode","defaultSort","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","filterValueToGambitValue","gambit","tagList","registerPage","override","original","tagPrefix","required","onremove","render","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagPermission","addTagsHomePageOption","minutes","defaultLabel","count","settings","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","chunkId","all","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","r","toStringTag","scriptUrl","importScripts","location","currentScript","Error","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":";UAAIA,EACAC,kDCDJ,MAAM,EAA+BC,OAAOC,IAAIC,IAAI,OAAQ,0BCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,iBCAtD,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,gDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,oDCA5D,MAAM,EAA+BF,OAAOC,IAAIC,IAAI,OAAQ,0GCA7C,SAAS,IACtBC,IAAIC,cAAcC,IAAI,eAAeC,mBAAmB,CACtDC,KAAM,aACNC,MAAOL,IAAIM,WAAWC,MAAM,uDAC5BC,WAAY,kBACX,WAAY,IAAIL,mBAAmB,CACpCC,KAAM,cACNC,MAAOL,IAAIM,WAAWC,MAAM,yDAC5BC,WAAY,mBACX,QAAS,GACd,CCVA,MAAM,EAA+BX,OAAOC,IAAIC,IAAI,OAAQ,4CCE7C,SAAS,KACtB,IAAAU,QAAO,cAAsB,iBAAiBC,IAC5CA,EAAMC,IAAI,OAAQ,CAChBC,KAAM,QACNP,MAAOL,IAAIM,WAAWC,MAAM,wCAC5B,GAEN,CCTA,MAAM,EAA+BV,OAAOC,IAAIC,IAAI,OAAQ,uGCI7C,SAASc,EAAUC,EAAMC,QACxB,IAAVA,IACFA,EAAQ,CAAC,GAEX,MAAMC,EAAW,IACX,KACJC,KACGC,GACDH,EAaJ,OAZAG,EAAWC,UAAY,IAAU,YAAaD,EAAWC,WACrDL,GACF,EAAAM,EAAA,GAASN,GAAMO,SAAQC,KACjBA,GAAuB,IAAhBR,EAAKS,SACdP,EAASQ,MAAK,EAAAC,EAAA,GAASH,EAAK,CAC1BL,SAEJ,IAGFD,EAASQ,MAAK,EAAAC,EAAA,MAETC,EAAE,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AAmBh0B,KAAO2zB,EAAqBnkB,KAAK,KAAMwkB,EAAmBh0B,KAAKwP,KAAKwkB","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionGrid')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/PermissionDropdown')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/tags/./src/admin/addTagPermission.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/tags/./src/admin/addTagsHomePageOption.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/SettingDropdown')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/./src/admin/components/SelectTagsSettingComponent.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/tags/../../../node_modules/sortablejs/modular/sortable.esm.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/withAttr')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSectionGroup')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'admin/components/FormSection')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/ColorPreviewInput')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/tags/./src/admin/components/EditTagModal.tsx","webpack://@flarum/tags/./src/admin/components/TagsPage.js","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/admin/index.ts","webpack://@flarum/tags/./src/admin/addTagsPermissionScope.tsx","webpack://@flarum/tags/./src/admin/addTagChangePermission.js","webpack://@flarum/tags/./src/admin/addTagSelectionSettingComponent.tsx","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionGrid');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/PermissionDropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","export default function () {\n app.extensionData.for('flarum-tags').registerPermission({\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.tag_discussions_label'),\n permission: 'discussion.tag'\n }, 'moderate', 95).registerPermission({\n icon: 'fas fa-tags',\n label: app.translator.trans('flarum-tags.admin.permissions.bypass_tag_counts_label'),\n permission: 'bypassTagCounts'\n }, 'start', 89);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","import { extend } from 'flarum/common/extend';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nexport default function () {\n extend(BasicsPage.prototype, 'homePageItems', items => {\n items.add('tags', {\n path: '/tags',\n label: app.translator.trans('flarum-tags.admin.basics.tags_label')\n });\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/SettingDropdown');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class SelectTagsSettingComponent extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", []);\n _defineProperty(this, \"loaded\", false);\n }\n view() {\n const value = JSON.parse(this.attrs.settingValue() || '[]');\n if (!this.loaded) {\n app.tagList.load(['parent']).then(tags => {\n this.tags = tags.filter(tag => value.includes(tag.id()));\n this.loaded = true;\n m.redraw();\n });\n }\n return m(\"div\", {\n className: \"Form-group SelectTagsSettingComponent\"\n }, m(\"label\", null, this.attrs.label), this.attrs.help && m(\"p\", {\n className: \"helpText\"\n }, this.attrs.help), !this.loaded ? m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }) : m(Button, {\n className: \"Button Button--text\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'common/components/TagSelectionModal', webpackMode: 'lazy-once' */ '../../common/components/TagSelectionModal'), {\n selectedTags: this.tags,\n onsubmit: tags => {\n this.tags = tags;\n this.attrs.settingValue(JSON.stringify(tags.map(tag => tag.id())));\n },\n ...this.attrs.options\n })\n }, !!this.tags.length ? tagsLabel(this.tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.admin.settings.button_text'))));\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/SelectTagsSettingComponent', SelectTagsSettingComponent);flarum.reg.addChunkModule('162', '610', 'flarum-tags', 'common/components/TagSelectionModal');\nflarum.reg.addChunkModule('162', '610', 'flarum-tags', 'forum/components/ToggleButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","/**!\n * Sortable 1.15.0\n * @author\tRubaXa \n * @author\towenm \n * @license MIT\n */\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar version = \"1.15.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !! /*@__PURE__*/navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options, includeDragEl) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread2({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar _excluded = [\"evt\"];\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, _excluded);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread2({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\r\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\r\n * @param {Number} x X position\r\n * @param {Number} y Y position\r\n * @return {HTMLElement} Element of the first found nearest Sortable\r\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n var threshold = sortable[expando].options.emptyInsertThreshold;\n if (!threshold || lastChild(sortable)) return;\n var rect = getRect(sortable),\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists && !ChromeForAndroid) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\r\n * @class Sortable\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.removeAttribute(\"id\");\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread2({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // Insert to end of list\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // if there is a last element, it is the target\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n\n if (elLastChild && elLastChild.nextSibling) {\n // the last draggable element is not the last node\n el.insertBefore(dragEl, elLastChild.nextSibling);\n } else {\n el.appendChild(dragEl);\n }\n\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {\n // Insert to start of list\n var firstChild = getChild(el, 0, options, true);\n\n if (firstChild === dragEl) {\n return completed(false);\n }\n\n target = firstChild;\n targetRect = getRect(target);\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {\n capture();\n el.insertBefore(dragEl, firstChild);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\r\n * Serializes the item into an array of string.\r\n * @returns {String[]}\r\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\r\n * Sorts the elements according to the array.\r\n * @param {String[]} order order of the items\r\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\r\n * Save the current sorting\r\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\r\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\r\n * @param {HTMLElement} el\r\n * @param {String} [selector] default: `options.draggable`\r\n * @returns {HTMLElement|null}\r\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\r\n * Set/get option\r\n * @param {string} name\r\n * @param {*} [value]\r\n * @returns {*}\r\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\r\n * Destroy\r\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsFirst(evt, vertical, sortable) {\n var rect = getRect(getChild(sortable.el, 0, sortable.options, true));\n var spacer = 10;\n return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\r\n * Gets the direction dragEl must be swapped relative to target in order to make it\r\n * seem that dragEl has been \"inserted\" into that element's position\r\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\r\n * @return {Number} Direction dragEl must be swapped\r\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\r\n * Generate id\r\n * @param {HTMLElement} el\r\n * @returns {String}\r\n * @private\r\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\r\n * Get the Sortable instance of an element\r\n * @param {HTMLElement} element The element\r\n * @return {Sortable|undefined} The instance of Sortable\r\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\r\n * Mount a plugin to Sortable\r\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\r\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\r\n * Create sortable instance\r\n * @param {HTMLElement} el\r\n * @param {Object} [options]\r\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n forceAutoScrollFallback: false,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (!sortable.options.avoidImplicitDeselect) {\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n avoidImplicitDeselect: false,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvent: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvent: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvent: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n folding = false; // Do not \"unfold\" after around dragEl if reverted\n\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvent: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/withAttr');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSectionGroup');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/FormSection');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/ColorPreviewInput');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport ColorPreviewInput from 'flarum/common/components/ColorPreviewInput';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport { slug } from 'flarum/common/utils/string';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nimport tagLabel from '../../common/helpers/tagLabel';\n/**\n * The `EditTagModal` component shows a modal dialog which allows the user\n * to create or edit a tag.\n */\nexport default class EditTagModal extends FormModal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tag\", void 0);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"slug\", void 0);\n _defineProperty(this, \"description\", void 0);\n _defineProperty(this, \"color\", void 0);\n _defineProperty(this, \"icon\", void 0);\n _defineProperty(this, \"isHidden\", void 0);\n _defineProperty(this, \"isPrimary\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.tag = this.attrs.model || app.store.createRecord('tags');\n this.name = Stream(this.tag.name() || '');\n this.slug = Stream(this.tag.slug() || '');\n this.description = Stream(this.tag.description() || '');\n this.color = Stream(this.tag.color() || '');\n this.icon = Stream(this.tag.icon() || '');\n this.isHidden = Stream(this.tag.isHidden() || false);\n this.isPrimary = Stream(this.attrs.primary || false);\n }\n className() {\n return 'EditTagModal Modal--small';\n }\n title() {\n return this.name() ? tagLabel(app.store.createRecord('tags', {\n attributes: this.submitData()\n })) : app.translator.trans('flarum-tags.admin.edit_tag.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, this.fields().toArray()));\n }\n fields() {\n const items = new ItemList();\n items.add('name', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.name_label')), m(\"input\", {\n className: \"FormControl\",\n placeholder: app.translator.trans('flarum-tags.admin.edit_tag.name_placeholder'),\n value: this.name(),\n oninput: e => {\n const target = e.target;\n this.name(target.value);\n this.slug(slug(target.value));\n }\n })), 50);\n items.add('slug', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.slug_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.slug\n })), 40);\n items.add('description', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.description_label')), m(\"textarea\", {\n className: \"FormControl\",\n bidi: this.description\n })), 30);\n items.add('color', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.color_label')), m(ColorPreviewInput, {\n className: \"FormControl\",\n placeholder: \"#aaaaaa\",\n bidi: this.color\n })), 20);\n items.add('icon', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.edit_tag.icon_label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: m(\"a\", {\n href: \"https://fontawesome.com/icons?m=free\",\n tabindex: \"-1\"\n })\n })), m(\"input\", {\n className: \"FormControl\",\n placeholder: \"fas fa-bolt\",\n bidi: this.icon\n })), 10);\n items.add('hidden', m(\"div\", {\n className: \"Form-group\"\n }, m(\"div\", null, m(\"label\", {\n className: \"checkbox\"\n }, m(\"input\", {\n type: \"checkbox\",\n bidi: this.isHidden\n }), app.translator.trans('flarum-tags.admin.edit_tag.hide_label')))), 10);\n items.add('submit', m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n type: \"submit\",\n className: \"Button Button--primary EditTagModal-save\",\n loading: this.loading\n }, app.translator.trans('flarum-tags.admin.edit_tag.submit_button')), this.tag.exists && m(\"button\", {\n type: \"button\",\n className: \"Button EditTagModal-delete\",\n onclick: this.delete.bind(this)\n }, app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_button'))), -10);\n return items;\n }\n submitData() {\n return {\n name: this.name(),\n slug: this.slug(),\n description: this.description(),\n color: this.color(),\n icon: this.icon(),\n isHidden: this.isHidden(),\n isPrimary: this.isPrimary()\n };\n }\n onsubmit(e) {\n e.preventDefault();\n this.loading = true;\n\n // Errors aren't passed to the modal onerror handler here.\n // This is done for better error visibility on smaller screen heights.\n this.tag.save(this.submitData()).then(() => this.hide(), () => this.loading = false);\n }\n delete() {\n if (confirm(extractText(app.translator.trans('flarum-tags.admin.edit_tag.delete_tag_confirmation')))) {\n const children = app.store.all('tags').filter(tag => tag.parent() === this.tag);\n this.tag.delete().then(() => {\n children.forEach(tag => tag.pushData({\n attributes: {\n isChild: false\n }\n }));\n m.redraw();\n });\n this.hide();\n }\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/EditTagModal', EditTagModal);","import sortable from 'sortablejs';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport Form from 'flarum/common/components/Form';\nimport FormSectionGroup from 'flarum/admin/components/FormSectionGroup';\nimport FormSection from 'flarum/admin/components/FormSection';\nimport EditTagModal from './EditTagModal';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\nfunction tagItem(tag) {\n return m(\"li\", {\n \"data-id\": tag.id(),\n style: {\n color: tag.color()\n }\n }, m(\"div\", {\n className: \"TagListItem-info\"\n }, tagIcon(tag), m(\"span\", {\n className: \"TagListItem-name\"\n }, tag.name()), m(Button, {\n className: \"Button Button--link\",\n icon: \"fas fa-pencil-alt\",\n onclick: () => app.modal.show(EditTagModal, {\n model: tag\n })\n })), !tag.isChild() && tag.position() !== null && m(\"ol\", {\n className: \"TagListItem-children TagList\"\n }, sortTags(app.store.all('tags')).filter(child => child.parent() === tag).map(tagItem)));\n}\nexport default class TagsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n // A regular redraw won't work here, because sortable has mucked around\n // with the DOM which will confuse Mithril's diffing algorithm. Instead\n // we force a full reconstruction of the DOM by changing the key, which\n // makes mithril completely re-render the component on redraw.\n this.forcedRefreshKey = 0;\n this.loading = true;\n app.tagList.load(['parent']).then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n content() {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n const minPrimaryTags = this.setting('flarum-tags.min_primary_tags', 0);\n const maxPrimaryTags = this.setting('flarum-tags.max_primary_tags', 0);\n const minSecondaryTags = this.setting('flarum-tags.min_secondary_tags', 0);\n const maxSecondaryTags = this.setting('flarum-tags.max_secondary_tags', 0);\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n return m(\"div\", {\n className: \"TagsContent\"\n }, m(\"div\", {\n className: \"TagsContent-list\"\n }, m(\"div\", {\n className: \"container\",\n key: this.forcedRefreshKey,\n oncreate: this.onListOnCreate.bind(this)\n }, m(FormSectionGroup, null, m(FormSection, {\n className: \"TagGroup\",\n label: app.translator.trans('flarum-tags.admin.tags.primary_heading')\n }, m(\"ol\", {\n className: \"TagList TagList--primary\"\n }, tags.filter(tag => tag.position() !== null && !tag.isChild()).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: true\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_primary_tag_button'))), m(FormSection, {\n className: \"TagGroup TagGroup--secondary\",\n label: app.translator.trans('flarum-tags.admin.tags.secondary_heading')\n }, m(\"ul\", {\n className: \"TagList\"\n }, tags.filter(tag => tag.position() === null).sort((a, b) => a.name().localeCompare(b.name())).map(tagItem)), m(Button, {\n className: \"Button TagList-button\",\n icon: \"fas fa-plus\",\n onclick: () => app.modal.show(EditTagModal, {\n primary: false\n })\n }, app.translator.trans('flarum-tags.admin.tags.create_secondary_tag_button'))), m(FormSection, {\n label: app.translator.trans('flarum-tags.admin.tags.settings_heading')\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_primary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minPrimaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minPrimaryTags, maxPrimaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minPrimaryTags(),\n bidi: maxPrimaryTags\n }))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_heading')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-tags.admin.tag_settings.required_secondary_text')), m(\"div\", {\n className: \"TagSettings-rangeInput\"\n }, m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: \"0\",\n value: minSecondaryTags(),\n oninput: withAttr('value', this.setMinTags.bind(this, minSecondaryTags, maxSecondaryTags))\n }), app.translator.trans('flarum-tags.admin.tag_settings.range_separator_text'), m(\"input\", {\n className: \"FormControl\",\n type: \"number\",\n min: minSecondaryTags(),\n bidi: maxSecondaryTags\n }))), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton())))), m(\"div\", {\n className: \"TagsContent-footer\"\n }, m(\"p\", null, app.translator.trans('flarum-tags.admin.tags.about_tags_text'))))));\n }\n onListOnCreate(vnode) {\n this.$('.TagList').get().map(e => {\n sortable.create(e, {\n group: 'tags',\n delay: 50,\n delayOnTouchOnly: true,\n touchStartThreshold: 5,\n animation: 150,\n swapThreshold: 0.65,\n dragClass: 'sortable-dragging',\n ghostClass: 'sortable-placeholder',\n onSort: e => this.onSortUpdate(e)\n });\n });\n }\n setMinTags(minTags, maxTags, value) {\n minTags(value);\n maxTags(Math.max(value, maxTags()));\n }\n onSortUpdate(e) {\n // If we've moved a tag from 'primary' to 'secondary', then we'll update\n // its attributes in our local store so that when we redraw the change\n // will be made.\n if (e.from instanceof HTMLOListElement && e.to instanceof HTMLUListElement) {\n app.store.getById('tags', e.item.getAttribute('data-id')).pushData({\n attributes: {\n position: null,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n }\n\n // Construct an array of primary tag IDs and their children, in the same\n // order that they have been arranged in.\n const order = this.$('.TagList--primary > li').map(function () {\n return {\n id: $(this).data('id'),\n children: $(this).find('li').map(function () {\n return $(this).data('id');\n }).get()\n };\n }).get();\n\n // Now that we have an accurate representation of the order which the\n // primary tags are in, we will update the tag attributes in our local\n // store to reflect this order.\n order.forEach((tag, i) => {\n const parent = app.store.getById('tags', tag.id);\n parent.pushData({\n attributes: {\n position: i,\n isChild: false\n },\n relationships: {\n parent: null\n }\n });\n tag.children.forEach((child, j) => {\n app.store.getById('tags', child).pushData({\n attributes: {\n position: j,\n isChild: true\n },\n relationships: {\n parent\n }\n });\n });\n });\n app.request({\n url: app.forum.attribute('apiUrl') + '/tags/order',\n method: 'POST',\n body: {\n order\n }\n });\n this.forcedRefreshKey++;\n m.redraw();\n }\n}\nflarum.reg.add('flarum-tags', 'admin/components/TagsPage', TagsPage);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/admin/app';\nimport addTagsPermissionScope from './addTagsPermissionScope';\nimport addTagPermission from './addTagPermission';\nimport addTagsHomePageOption from './addTagsHomePageOption';\nimport addTagChangePermission from './addTagChangePermission';\nimport addTagSelectionSettingComponent from './addTagSelectionSettingComponent';\nimport TagsPage from './components/TagsPage';\nimport TagListState from '../common/states/TagListState';\nexport { default as extend } from '../common/extend';\napp.initializers.add('flarum-tags', app => {\n app.tagList = new TagListState();\n app.extensionData.for('flarum-tags').registerPage(TagsPage);\n addTagsPermissionScope();\n addTagPermission();\n addTagsHomePageOption();\n addTagChangePermission();\n addTagSelectionSettingComponent();\n});\nimport './admin';","import app from 'flarum/admin/app';\nimport { extend, override } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport PermissionDropdown from 'flarum/admin/components/PermissionDropdown';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport tagLabel from '../common/helpers/tagLabel';\nimport tagIcon from '../common/helpers/tagIcon';\nimport sortTags from '../common/utils/sortTags';\nexport default function () {\n extend(PermissionGrid.prototype, 'oninit', function () {\n this.loading = true;\n });\n extend(PermissionGrid.prototype, 'oncreate', function () {\n app.tagList.load().then(() => {\n this.loading = false;\n m.redraw();\n });\n });\n override(PermissionGrid.prototype, 'view', function (original, vnode) {\n if (this.loading) {\n return m(LoadingIndicator, null);\n }\n return original(vnode);\n });\n override(app, 'getRequiredPermissions', (original, permission) => {\n const tagPrefix = permission.match(/^tag\\d+\\./);\n if (tagPrefix) {\n const globalPermission = permission.substr(tagPrefix[0].length);\n const required = original(globalPermission);\n return required.map(required => tagPrefix[0] + required);\n }\n return original(permission);\n });\n extend(PermissionGrid.prototype, 'scopeItems', items => {\n sortTags(app.store.all('tags')).filter(tag => tag.isRestricted()).forEach(tag => items.add('tag' + tag.id(), {\n label: tagLabel(tag),\n onremove: () => tag.save({\n isRestricted: false\n }),\n render: item => {\n if ('setting' in item) return null;\n if (item.permission === 'viewForum' || item.permission === 'startDiscussion' || item.permission.startsWith('discussion.') && item.tagScoped !== false || item.tagScoped) {\n return m(PermissionDropdown, {\n permission: \"tag\".concat(tag.id(), \".\").concat(item.permission),\n allowGuest: item.allowGuest\n });\n }\n return null;\n }\n }));\n });\n extend(PermissionGrid.prototype, 'scopeControlItems', items => {\n const tags = sortTags(app.store.all('tags').filter(tag => !tag.isRestricted()));\n if (tags.length) {\n items.add('tag', m(Dropdown, {\n className: \"Dropdown--restrictByTag\",\n buttonClassName: \"Button Button--text\",\n label: app.translator.trans('flarum-tags.admin.permissions.restrict_by_tag_heading'),\n icon: \"fas fa-plus\",\n caretIcon: null\n }, tags.map(tag => m(Button, {\n icon: true,\n onclick: () => tag.save({\n isRestricted: true\n })\n }, [tagIcon(tag, {\n className: 'Button-icon'\n }), ' ', tag.name()]))));\n }\n });\n}","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport PermissionGrid from 'flarum/admin/components/PermissionGrid';\nimport SettingDropdown from 'flarum/admin/components/SettingDropdown';\nexport default function () {\n extend(PermissionGrid.prototype, 'startItems', items => {\n items.add('allowTagChange', {\n icon: 'fas fa-tag',\n label: app.translator.trans('flarum-tags.admin.permissions.allow_edit_tags_label'),\n setting: () => {\n const minutes = parseInt(app.data.settings.allow_tag_change, 10);\n return m(SettingDropdown, {\n defaultLabel: minutes ? app.translator.trans('core.admin.permissions_controls.allow_some_minutes_button', {\n count: minutes\n }) : app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button'),\n key: \"allow_tag_change\",\n options: [{\n value: '-1',\n label: app.translator.trans('core.admin.permissions_controls.allow_indefinitely_button')\n }, {\n value: '10',\n label: app.translator.trans('core.admin.permissions_controls.allow_ten_minutes_button')\n }, {\n value: 'reply',\n label: app.translator.trans('core.admin.permissions_controls.allow_until_reply_button')\n }]\n });\n }\n }, 90);\n });\n}","import { extend } from 'flarum/common/extend';\nimport SelectTagsSettingComponent from './components/SelectTagsSettingComponent';\nimport FormGroup from 'flarum/common/components/FormGroup';\nexport default function () {\n extend(FormGroup.prototype, 'customFieldComponents', function (items) {\n items.add('flarum-tags.select-tags', attrs => {\n return m(SelectTagsSettingComponent, Object.assign({}, attrs, {\n settingValue: attrs.bidi\n }));\n });\n });\n}","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"common/components/TagSelectionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t328: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","flarum","reg","get","app","extensionData","for","registerPermission","icon","label","translator","trans","permission","extend","items","add","path","tagsLabel","tags","attrs","children","link","otherAttrs","className","sortTags","forEach","tag","length","push","tagLabel","m","SelectTagsSettingComponent","constructor","super","arguments","this","view","value","JSON","parse","settingValue","loaded","then","filter","includes","id","redraw","help","onclick","selectedTags","onsubmit","stringify","map","options","size","display","addChunkModule","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","source","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_typeof","obj","Symbol","iterator","prototype","configurable","writable","_extends","assign","hasOwnProperty","call","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","userAgent","pattern","window","navigator","match","IE11OrLess","Edge","FireFox","Safari","IOS","ChromeForAndroid","captureMode","capture","passive","on","el","event","fn","addEventListener","off","removeEventListener","matches","selector","substring","msMatchesSelector","webkitMatchesSelector","_","getParentOrHost","host","document","nodeType","parentNode","closest","ctx","includeCTX","_throttleTimeout","R_SPACE","toggleClass","name","state","classList","replace","css","prop","val","style","defaultView","getComputedStyle","currentStyle","matrix","selfOnly","appliedTransforms","transform","matrixFn","DOMMatrix","WebKitCSSMatrix","CSSMatrix","MSCSSMatrix","find","tagName","list","getElementsByTagName","n","getWindowScrollingElement","scrollingElement","documentElement","getRect","relativeToContainingBlock","relativeToNonStaticParent","undoScale","container","getBoundingClientRect","elRect","top","left","bottom","right","height","width","innerHeight","innerWidth","containerRect","parseInt","elMatrix","scaleX","a","scaleY","d","isScrolledPast","elSide","parentSide","parent","getParentAutoScrollElement","elSideVal","parentSideVal","getChild","childNum","includeDragEl","currentChild","Sortable","ghost","dragged","draggable","lastChild","last","lastElementChild","previousElementSibling","index","nodeName","toUpperCase","clone","getRelativeScrollOffset","offsetLeft","offsetTop","winScroller","scrollLeft","scrollTop","includeSelf","elem","gotSelf","clientWidth","scrollWidth","clientHeight","scrollHeight","elemCSS","overflowX","overflowY","body","isRectEqual","rect1","rect2","Math","round","throttle","callback","ms","args","_this","setTimeout","scrollBy","x","y","Polymer","$","jQuery","Zepto","dom","cloneNode","expando","Date","getTime","plugins","defaults","initializeByDefault","PluginManager","mount","plugin","option","p","pluginName","concat","pluginEvent","eventName","sortable","evt","eventCanceled","cancel","eventNameGlobal","initializePlugins","initialized","modified","modifyOption","getEventProperties","eventProperties","modifiedValue","optionListeners","_excluded","_ref","undefined","originalEvent","data","bind","dragEl","parentEl","ghostEl","rootEl","nextEl","lastDownEl","cloneEl","cloneHidden","dragStarted","moved","putSortable","activeSortable","active","oldIndex","oldDraggableIndex","newIndex","newDraggableIndex","hideGhostForTarget","_hideGhostForTarget","unhideGhostForTarget","_unhideGhostForTarget","cloneNowHidden","cloneNowShown","dispatchSortableEvent","_dispatchEvent","info","targetEl","toEl","fromEl","extraEventProperties","onName","charAt","substr","CustomEvent","createEvent","initEvent","bubbles","cancelable","to","from","item","pullMode","lastPutMode","allEventProperties","dispatchEvent","activeGroup","tapEvt","touchEvt","lastDx","lastDy","tapDistanceLeft","tapDistanceTop","lastTarget","lastDirection","targetMoveDistance","ghostRelativeParent","awaitingDragStarted","ignoreNextClick","sortables","pastFirstInvertThresh","isCircumstantialInvert","ghostRelativeParentInitialScroll","_silent","savedInputChecked","documentExists","PositionGhostAbsolutely","CSSFloatProperty","supportDraggable","createElement","supportCssPointerEvents","cssText","pointerEvents","_detectDirection","elCSS","elWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","child1","child2","firstChildCSS","secondChildCSS","firstChildWidth","marginLeft","marginRight","secondChildWidth","flexDirection","gridTemplateColumns","split","touchingSideChild2","clear","_prepareGroup","toFn","pull","sameGroup","group","otherGroup","join","originalGroup","checkPull","checkPut","put","revertClone","preventDefault","stopPropagation","stopImmediatePropagation","nearestEmptyInsertDetectEvent","touches","nearest","clientX","clientY","some","threshold","emptyInsertThreshold","rect","insideHorizontally","insideVertically","ret","_onDragOver","_checkOutsideTargetEl","_isOutsideThisEl","toString","animationCallbackId","animationStates","sort","disabled","store","handle","test","swapThreshold","invertSwap","invertedSwapThreshold","removeCloneOnHide","direction","ghostClass","chosenClass","dragClass","ignore","preventOnFilter","animation","easing","setData","dataTransfer","textContent","dropBubble","dragoverBubble","dataIdAttr","delay","delayOnTouchOnly","touchStartThreshold","Number","devicePixelRatio","forceFallback","fallbackClass","fallbackOnBody","fallbackTolerance","fallbackOffset","supportPointer","nativeDraggable","_onTapStart","captureAnimationState","slice","child","fromRect","thisAnimationDuration","childMatrix","f","e","addAnimationState","removeAnimationState","splice","arr","indexOfObject","animateAll","clearTimeout","animating","animationTime","time","toRect","prevFromRect","prevToRect","animatingRect","targetMatrix","sqrt","pow","calculateRealTime","animate","max","animationResetTimer","currentRect","duration","translateX","translateY","animatingX","animatingY","forRepaintDummy","offsetWidth","repaint","animated","_onMove","dragRect","targetRect","willInsertAfter","retVal","onMoveFn","onMove","draggedRect","related","relatedRect","_disableDraggable","_unsilent","_generateId","str","src","href","sum","charCodeAt","_nextTick","_cancelNextTick","contains","_getDirection","type","touch","pointerType","originalTarget","shadowRoot","composedPath","root","inputs","idx","checked","_saveInputCheckedState","button","isContentEditable","criteria","trim","_prepareDragStart","dragStartFn","ownerDocument","nextSibling","_lastX","_lastY","_onDrop","_disableDelayedDragEvents","_triggerDragStart","_disableDelayedDrag","_delayedDragTouchMoveHandler","_dragStartTimer","abs","floor","_onTouchMove","_onDragStart","selection","empty","getSelection","removeAllRanges","err","_dragStarted","fallback","_appendGhost","_nulling","_emulateDragOver","elementFromPoint","ghostMatrix","relativeScrollOffset","dx","dy","b","c","cssMatrix","appendChild","removeAttribute","_hideClone","cloneId","insertBefore","_loopId","setInterval","effectAllowed","_dragStartId","revert","vertical","isOwner","canSort","fromSortable","completedFired","dragOverEvent","_ignoreWhileAnimating","completed","elLastChild","_ghostIsLast","changed","_ghostIsFirst","firstChild","targetBeforeFirstSwap","sibling","differentLevel","differentRowCol","dragElS1Opp","dragElS2Opp","dragElOppLength","targetS1Opp","targetS2Opp","targetOppLength","_dragElInRowColumn","side1","scrolledPastTop","scrollBefore","isLastTarget","mouseOnAxis","targetLength","targetS1","targetS2","invert","_getInsertDirection","_getSwapDirection","dragIndex","nextElementSibling","after","moveVector","extra","axis","insertion","_showClone","_offMoveEvents","_offUpEvents","clearInterval","removeChild","save","handleEvent","dropEffect","_globalDragOver","toArray","order","getAttribute","useAnimation","set","destroy","Array","querySelectorAll","utils","is","dst","nextTick","cancelNextTick","detectDirection","element","_len","_key","create","version","scrollEl","scrollRootEl","lastAutoScrollX","lastAutoScrollY","touchEvt$1","pointerElemChangedInterval","autoScrolls","scrolling","clearAutoScrolls","autoScroll","pid","clearPointerElemChangedInterval","isFallback","scroll","scrollCustomFn","sens","scrollSensitivity","speed","scrollSpeed","scrollThisInstance","scrollFn","layersOut","currentParent","canScrollX","canScrollY","scrollPosX","scrollPosY","vx","vy","layer","scrollOffsetY","scrollOffsetX","bubbleScroll","drop","toSortable","changedTouches","onSpill","Revert","Remove","startIndex","dragStart","_ref2","_ref3","_ref4","parentSortable","AutoScroll","forceAutoScrollFallback","_handleAutoScroll","_handleFallbackAutoScroll","dragOverCompleted","dragOverBubble","nulling","ogElemScroller","newElem","EditTagModal","oninit","vnode","model","slug","description","color","isHidden","isPrimary","primary","title","attributes","submitData","content","fields","placeholder","oninput","bidi","tabindex","loading","exists","delete","hide","confirm","pushData","isChild","tagItem","tagIcon","position","TagsPage","forcedRefreshKey","minPrimaryTags","setting","maxPrimaryTags","minSecondaryTags","maxSecondaryTags","oncreate","onListOnCreate","localeCompare","min","setMinTags","submitButton","onSort","onSortUpdate","minTags","maxTags","HTMLOListElement","HTMLUListElement","relationships","j","url","method","TagListState","async","loadedIncludes","query","unloadedIncludes","include","has","Promise","resolve","Set","isArray","Tag","backgroundUrl","backgroundMode","defaultSort","discussionCount","lastPostedAt","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","hint","filterKey","gambitValueToFilterValue","fromFilter","negate","gambits","filterValueToGambitValue","gambit","tagList","registerPage","override","original","tagPrefix","required","onremove","render","startsWith","tagScoped","allowGuest","buttonClassName","caretIcon","addTagPermission","addTagsHomePageOption","minutes","defaultLabel","count","settings","hasIcon","useColor","tagText","route","aPos","bPos","aParent","bParent","module","exports","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","chunkId","all","reduce","promises","u","g","globalThis","Function","l","done","script","needAttach","scripts","s","charset","timeout","nc","setAttribute","onScriptComplete","prev","onerror","onload","doneFns","head","r","toStringTag","scriptUrl","importScripts","location","currentScript","Error","compat","originalLoadChunk","loadChunk","installedChunks","installedChunkData","promise","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","chunkLoadingGlobal","self"],"sourceRoot":""} \ No newline at end of file diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index 38d7f0b0b..2be0c4906 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={1207:(t,e,n)=>{"use strict";n.d(e,{J:()=>B,Z:()=>R});var s=n(7905),r=n(7465),o=n(4041),i=n(8312),a=n(7224),l=n(8588),c=n(406),u=n(4153);function d(t){return Array.isArray(t.data)}class h{constructor(t){(0,s.Z)(this,"data",{}),(0,s.Z)(this,"models",void 0),this.models=t}pushPayload(t){t.included&&t.included.map(this.pushObject.bind(this));const e=t.data instanceof Array?t.data.map((t=>this.pushObject(t))):this.pushObject(t.data);return e.payload=t,e}pushObject(t){if(!this.models[t.type])return setTimeout((()=>{throw new Error("Pushing object of type `".concat(t.type,"` not allowed, as type not yet registered in the store."))})),null;const e=this.data[t.type]=this.data[t.type]||{},n=e[t.id],s=n?n.pushData(t):this.createRecord(t.type,t);return e[t.id]=s,s.exists=!0,s}async find(t,e,n,s){var o,i;void 0===n&&(n={}),void 0===s&&(s={});let a=n,l=r.Z.forum.attribute("apiUrl")+"/"+t;return e instanceof Array?l+="?filter[id]="+e.join(","):"object"==typeof e?a=e:e&&(l+="/"+e),"filter"in a&&null!=(o=a)&&null!=(i=o.filter)&&i.q&&(a.filter=r.Z.search.gambits.apply(t,a.filter)),r.Z.request({method:"GET",url:l,params:a,...s}).then((t=>(d(t),this.pushPayload(t))))}getById(t,e){var n,s;return null==(n=this.data)||null==(s=n[t])?void 0:s[e]}getBy(t,e,n){return this.all(t).filter((t=>t[e]()===n))[0]}all(t){const e=this.data[t];return e?Object.values(e):[]}remove(t){delete this.data[t.data.type][t.id()]}createRecord(t,e){return void 0===e&&(e={}),e.type=e.type||t,new this.models[t](e,this)}}flarum.reg.add("core","common/Store",h);class p{constructor(t,e){(0,s.Z)(this,"user",void 0),(0,s.Z)(this,"csrfToken",void 0),this.user=t,this.csrfToken=e}login(t,e){return void 0===e&&(e={}),r.Z.request({method:"POST",url:"".concat(r.Z.forum.attribute("baseUrl"),"/login"),body:t,...e})}logout(){window.location.href="".concat(r.Z.forum.attribute("baseUrl"),"/logout?token=").concat(this.csrfToken)}}flarum.reg.add("core","common/Session",p);var f=n(6786),g=n(1552),v=n(7569),b=n(4430),y=n(6386),w=n(4718),Z=n(9423);function x(){$("[data-humantime]").each((function(){const t=$(this),e=(0,Z.Z)(t.attr("datetime"));t.html(e)}))}function N(){setInterval(x,1e4)}flarum.reg.add("core","common/utils/liveHumanTimes",N);var _=n(8134),C=n(3813),k=n(7498),E=n(6322),S=n(4125),T=n(7645),A=n(5788),P=n(5013),D=n(5123),I=n(5278);function M(t,e,n){var s,o;console.group("%c".concat(e),"background-color: #d83e3e; color: #ffffff; font-weight: bold;"),console.error(n),console.groupEnd(),null!=(s=r.Z.session)&&null!=(o=s.user)&&o.isAdmin()&&r.Z.alerts.show({type:"error"},"".concat(t))}flarum.reg.add("core","common/helpers/fireApplicationError",M);var L=n(9175);class O extends L.Z{token(){return L.Z.attribute("token").call(this)}userId(){return L.Z.attribute("userId").call(this)}title(){return L.Z.attribute("title").call(this)}type(){return L.Z.attribute("type").call(this)}createdAt(){return L.Z.attribute("createdAt",L.Z.transformDate).call(this)}lastActivityAt(){return L.Z.attribute("lastActivityAt",L.Z.transformDate).call(this)}lastIpAddress(){return L.Z.attribute("lastIpAddress").call(this)}device(){return L.Z.attribute("device").call(this)}isCurrent(){return L.Z.attribute("isCurrent").call(this)}isSessionToken(){return L.Z.attribute("isSessionToken").call(this)}}flarum.reg.add("core","common/models/AccessToken",O);var j=n(8394);let B=function(t){return t.NO_MAINTENANCE="none",t.HIGH_MAINTENANCE="high",t.LOW_MAINTENANCE="low",t.SAFE_MODE="safe",t}({});class R{constructor(){(0,s.Z)(this,"forum",void 0),(0,s.Z)(this,"routes",{}),(0,s.Z)(this,"initializers",new o.Z),(0,s.Z)(this,"session",void 0),(0,s.Z)(this,"translator",new u.Z),(0,s.Z)(this,"store",new h({"access-tokens":O,forums:C.Z,users:k.Z,discussions:E.Z,posts:S.Z,groups:T.Z,notifications:A.Z})),(0,s.Z)(this,"search",void 0),(0,s.Z)(this,"cache",{}),(0,s.Z)(this,"booted",!1),(0,s.Z)(this,"current",new P.Z(null)),(0,s.Z)(this,"previous",new P.Z(null)),(0,s.Z)(this,"modal",new D.Z),(0,s.Z)(this,"alerts",new I.Z),(0,s.Z)(this,"drawer",void 0),(0,s.Z)(this,"history",null),(0,s.Z)(this,"pane",null),(0,s.Z)(this,"data",void 0),(0,s.Z)(this,"allowUserColorScheme",void 0),(0,s.Z)(this,"_title",""),(0,s.Z)(this,"_titleCount",0),(0,s.Z)(this,"requestErrorAlert",null),(0,s.Z)(this,"initialRoute",void 0)}set title(t){this._title=t}get title(){return this._title}set titleCount(t){this._titleCount=t}get titleCount(){return this._titleCount}load(t){this.data=t,this.translator.setLocale(t.locale)}boot(){var t;const e=[];this.initializers.toArray().forEach((t=>{try{t(this)}catch(n){const s=t.itemName.includes("/")?t.itemName.replace(/(\/flarum-ext-)|(\/flarum-)/g,"-"):t.itemName;e.push((()=>M((0,g.Z)(r.Z.translator.trans("core.lib.error.extension_initialiation_failed_message",{extension:s})),"".concat(s," failed to initialize"),n)))}})),this.store.pushPayload({data:this.data.resources}),this.forum=this.store.getById("forums","1"),this.session=new p(null!=(t=this.store.getById("users",String(this.data.session.userId)))?t:null,this.data.session.csrfToken),this.mount(),this.initialRoute=window.location.href,e.forEach((t=>t()))}bootExtensions(t){Object.keys(t).forEach((e=>{const n=t[e];if(!n.extend)return;const s=n.extend.flat(1/0);for(const t of s)t.extend(this,{name:e,exports:n})}))}mount(t){void 0===t&&(t=""),m.mount(document.getElementById("modal"),{view:()=>m(a.Z,{state:this.modal})}),m.mount(document.getElementById("alerts"),{view:()=>m(l.Z,{state:this.alerts})}),this.drawer=new v.Z,m.route(document.getElementById("content"),t+"/",(0,b.Z)(this.routes,t));const e=document.getElementById("app"),n=document.querySelector(".App-header"),s=new w.Z((t=>{const s=e.getBoundingClientRect().top+document.body.scrollTop;e.classList.toggle("affix",t>=s),e.classList.toggle("scrolled",t>s),n.classList.toggle("navbar-fixed-top",t>=s)}));s.start(),s.update(),document.body.classList.add("ontouchstart"in window?"touch":"no-touch"),this.initColorScheme(),N()}initColorScheme(t){var e,n,s;void 0===t&&(t=null),null!=t||(t=null!=(e=document.documentElement.getAttribute("data-theme"))?e:"auto"),this.allowUserColorScheme="auto"===t;const r=null==(n=this.session.user)||null==(s=n.preferences())?void 0:s.colorScheme;let o;this.allowUserColorScheme&&(o=r),o||(o=t),this.setColorScheme(o),this.allowUserColorScheme&&this.watchSystemColorSchemePreference((()=>{this.initColorScheme(t)}))}getSystemColorSchemePreference(){let t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return window.matchMedia("(prefers-contrast: more)").matches&&(t+="-hc"),t}watchSystemColorSchemePreference(t){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),window.matchMedia("(prefers-contrast: more)").addEventListener("change",t)}setColorScheme(t){t===j.e.Auto&&(t=this.getSystemColorSchemePreference()),document.documentElement.setAttribute("data-theme",t)}setColoredHeader(t){document.documentElement.setAttribute("data-colored-header",t?"true":"false")}preloadedApiDocument(){if(this.data.apiDocument&&window.location.href===this.initialRoute){const t=(d(this.data.apiDocument),this.store.pushPayload(this.data.apiDocument));return this.data.apiDocument=null,t}return null}screen(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")}setTitle(t){this.title=t,this.updateTitle()}setTitleCount(t){this.titleCount=t,this.updateTitle()}updateTitle(){const t=this.titleCount?"(".concat(this.titleCount,") "):"",e=m.route.get()===this.forum.attribute("basePath")+"/",n={pageTitle:this.title,forumName:this.forum.attribute("title"),pageNumber:1};let s=e||!this.title?(0,g.Z)(r.Z.translator.trans("core.lib.meta_titles.without_page_title",n)):(0,g.Z)(r.Z.translator.trans("core.lib.meta_titles.with_page_title",n));s=t+s;const o=new DOMParser;document.title=o.parseFromString(s,"text/html").body.innerText}transformRequestOptions(t){const{background:e,deserialize:n,modifyText:s,...o}={...t},i={background:null==e||e,deserialize:null!=n?n:t=>t,...o};if((0,_.l)(i,"config",((t,e)=>{e.setRequestHeader("X-CSRF-Token",this.session.csrfToken)})),i.method&&!["GET","POST"].includes(i.method)){const t=i.method;(0,_.l)(i,"config",((e,n)=>{n.setRequestHeader("X-HTTP-Method-Override",t)})),i.method="POST"}return i.extract=t=>{let e;e=s?s(t.responseText):t.responseText;const n=t.status;if(n<200||n>299)throw new y.Z(n,"".concat(e),i,t);if(t.getResponseHeader){const e=t.getResponseHeader("X-CSRF-Token");e&&(r.Z.session.csrfToken=e)}try{return""===e?null:JSON.parse(e)}catch(n){throw new y.Z(500,"".concat(e),i,t)}},i}request(t){const e=this.transformRequestOptions(t);return this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(e).catch((e=>this.requestErrorCatch(e,t.errorHandler)))}requestErrorCatch(t,e){var n,s,o,a,l,c,u;const d=null!=(n=null==(s=t.response)||null==(o=s.errors)?void 0:o.map((t=>{var e;return decodeURI(null!=(e=t.detail)?e:"")})))?n:[];let h;switch(t.status){case 422:h=d.map((t=>[t,m("br",null)])).flat().slice(0,-1);break;case 401:case 403:h=r.Z.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:h=r.Z.translator.trans("core.lib.error.not_found_message");break;case 413:h=r.Z.translator.trans("core.lib.error.payload_too_large_message");break;case 429:h=r.Z.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:h="db_error"===(null==(a=t.response)||null==(l=a.errors)||null==(c=l[0])?void 0:c.code)&&null!=(u=r.Z.session.user)&&u.isAdmin()?r.Z.translator.trans("core.lib.error.db_error_message"):this.requestWasCrossOrigin(t)?r.Z.translator.trans("core.lib.error.generic_cross_origin_message"):r.Z.translator.trans("core.lib.error.generic_message")}const p=r.Z.forum.attribute("debug");return t.alert={type:"error",content:h,controls:p&&[m(i.Z,{className:"Button Button--link",onclick:this.showDebug.bind(this,t,d)},r.Z.translator.trans("core.lib.debug_button"))]},e?e(t):this.requestErrorDefaultHandler(t,p,d),Promise.reject(t)}requestWasCrossOrigin(t){return new URL(t.options.url,document.baseURI).origin!==window.location.origin}requestErrorDefaultHandler(t,e,n){if(!(t instanceof y.Z))throw t;if(e&&t.xhr){const{method:e,url:s}=t.options,{status:r=""}=t.xhr;console.group("".concat(e," ").concat(s," ").concat(r)),n.length?console.error(...n):console.error(t),console.groupEnd()}500===t.status&&e?r.Z.modal.show(c.Z,{error:t,formattedError:n}):t.alert&&(this.requestErrorAlert=this.alerts.show(t.alert,t.alert.content))}showDebug(t,e){null!==this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),this.modal.show(c.Z,{error:t,formattedError:e})}route(t,e){void 0===e&&(e={});const n=this.routes[t];if(!n)throw new Error("Route '".concat(t,"' does not exist"));const s=n.path.replace(/:([^\/]+)/g,((t,n)=>"".concat((0,f.Z)(e,n))));for(const t in e)e.hasOwnProperty(t)&&!e[t]&&delete e[t];const r=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+s+(r?"?"+r:"")}}flarum.reg.add("core","common/Application",R)},2190:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var s=n(7905);class r{constructor(){(0,s.Z)(this,"element",void 0),(0,s.Z)(this,"attrs",void 0),(0,s.Z)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in t)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",r)},9175:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var s=n(7905),r=n(7465);class o{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=r.Z.store),(0,s.Z)(this,"data",{}),(0,s.Z)(this,"freshness",new Date),(0,s.Z)(this,"exists",!1),(0,s.Z)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){var e,n;return null==(e=this.data)||null==(n=e.attributes)?void 0:n[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){var e;(e=this.data).attributes||(e.attributes={});for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof o&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){var n;const e=null!=(n=this.data.relationships)?n:{};for(const n in t.relationships){const s=t.relationships[n];if(null===s){delete e[n],delete t.relationships[n];continue}let r;r=s instanceof o?{data:o.getIdentifier(s)}:s instanceof Array?{data:s.map(o.getIdentifier)}:s,t.relationships[n]=r,e[n]=r}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships){n.relationships={};for(const e in t.relationships){const s=t.relationships[e];null!==s&&(n.relationships[e]={data:s instanceof Array?s.map(o.getIdentifier):o.getIdentifier(s)})}delete t.relationships}const s=this.copyData();this.pushData(n);const i={data:n,meta:e.meta||void 0};return r.Z.request({method:this.exists?"PATCH":"POST",url:r.Z.forum.attribute("apiUrl")+this.apiEndpoint(),body:i,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(s),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?r.Z.request({method:"DELETE",url:r.Z.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){var e,n;return null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){var e,n;const s=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(s&&s instanceof Array)throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is plural, so the hasOne method cannot be used to access it."));return!!s&&this.store.getById(s.type,s.id)}}static hasMany(t){return function(){var e,n;const s=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(s&&!(s instanceof Array))throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is singular, so the hasMany method cannot be used to access it."));return!!s&&s.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&t.data&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",o)},8740:(t,e,n)=>{"use strict";n.d(e,{Z:()=>h});var s=n(7905),r=n(7465),o=n(1586);class i extends o.y3{key(){return r.Z.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return r.Z.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",i);class a extends o.y3{key(){return r.Z.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return r.Z.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",a);class l extends o.gD{key(){return r.Z.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!r.Z.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends o.gD{key(){return r.Z.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!r.Z.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends o.y3{key(){return r.Z.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return r.Z.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!r.Z.session.user||!r.Z.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends o.y3{key(){return r.Z.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return r.Z.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class m{constructor(){(0,s.Z)(this,"gambits",{discussions:[i,a,l,c],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,s)=>{const r=t.toFilter(n,s);Object.keys(r).forEach((n=>{n in e&&t.predicates&&Array.isArray(r[n])?e[n]=e[n].concat(r[n]):e[n]=r[n]}))})),e}match(t,e,n){const s=this.for(t).filter((t=>t.enabled()));if(0===s.length)return e;const r=e.split(" ");for(const t of s)for(const s of r){const r="^(-?)".concat(t.pattern(),"$");let o=s.match(r);if(o){const r="-"===o[1];o.splice(1,1),n(t,o,r,s),e=e.replace(s,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const s=this.for(t);return 0===s.length||Object.keys(n).forEach((t=>{for(const r of s){const s="-"===t[0];s&&(t=t.substring(1)),r.filterKey()===t&&(e+=" ".concat(r.fromFilter(n[t],s)))}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",m);class h{constructor(t){(0,s.Z)(this,"state",void 0),(0,s.Z)(this,"gambits",new m),this.state=t}}(0,s.Z)(h,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",h)},4153:(t,e,n)=>{"use strict";n.d(e,{Z:()=>V});var s,r=n(7905),o=n(6880),i=n.n(o),a=n(6353),l=n.n(a),c=n(2512),u=n.n(c),d=n(8328),h=n.n(d),p=n(9939),f=n.n(p),g=n(1627),v=n.n(g),b=n(871),y=n.n(b);function w(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?w(e):e)}),[])}function Z(t){var e={};return function(){for(var n=arguments.length,s=new Array(n),r=0;r3&&void 0!==arguments[3]?arguments[3]:[];if(!t)return s;if(1===n)return s.push(t),s;var r=t.indexOf(e);if(-1===r)return s.push(t),s;var o=t.substring(0,r).trim(),i=t.substring(r+e.length+1).trim();return s.push(o),C(i,e,n-1,s)}function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,s)}return n}function E(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,i=x(e),a=i.args,l=i.cases,c=parseInt(t);a.forEach((function(t){t.startsWith("offset:")&&(c-=parseInt(t.slice("offset:".length)))}));var u=[];if("PluralRules"in Intl){void 0!==s&&s.resolvedOptions().locale===n||(s=new Intl.PluralRules(n));var d=s.select(c);d!==T&&u.push(d)}1===c&&u.push("one"),u.push("=".concat(c),T);for(var m=0;m1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0,r=x(e),o=r.cases;return t in o?s(o[t],n):D in o?s(o.other,n):t}function M(t,e,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=[],o=function(s,o,i,a,l,c){if(o)return{break:!0};var u=L(t,i,a,l);if(!u)return r;var d=u.segmentIndex===a,m=t[u.segmentIndex],h=[];if(d)h.push(s.slice(l+1,u.segmentStart));else{h.push(s.slice(l+1));for(var p=a+1;p"===a[m]){var h=a.slice(c+1+l,m),p=r(a,l,h,i,m,c);if(p.exit)return;if(p.newSegmentIndex&&(i=p.newSegmentIndex),p.processedSegment&&(d=!0),p.break)break;l=!1,c=null,u=!1}else u&&(o=a[m],!/[a-zA-Z-_]/.test(o))&&(l=!1,c=null,u=!1);else c=m,u=!0,"/"===a[m+1]&&(l=!0,m++);d||s.push(a)}else s.push(a)}}function j(t){return Object.keys(t).reduce((function(e,n){return e[n]=R(t[n]),e}),{})}function B(t){return"string"!=typeof t?t:t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function R(t){return"string"==typeof t||t instanceof String?t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):Array.isArray(t)?t.map(R):t}function $(t,e,n){return"<".concat(t,">").concat(B(n),"")}var H=function(t){h()(r,t);var e,n,s=(e=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,s=v()(e);if(n){var r=v()(this).constructor;t=Reflect.construct(s,arguments,r)}else t=s.apply(this,arguments);return f()(this,t)});function r(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return l()(this,r),(e=s.call(this,t,n)).richHandler=o||$,e}return u()(r,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=j(e),s=w(this.process(t,n)),r=Math.random().toString(36)+Math.random().toString(36)+Math.random().toString(36),o=Object.fromEntries(Object.entries(e).map((function(t){var e=i()(t,2),n=e[0];return e[1],[n,r]}))),a=w(this.process(t,o)),l=M(a,o,(function(){return r})),c=l.map((function(t,e){return t===r?null:e})).filter((function(t){return null!==t}));return M(s,n,this.richHandler,c)}}]),r}(function(){function t(e){var n=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,t),y()(this,"format",Z((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=s}return u()(t,[{key:"process",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return[];var n=t.indexOf("{");if(-1!==n){var s=N(t,n);if(-1===s)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var r=t.substring(n,s+1);if(r){var o=[],a=t.substring(0,n);a&&o.push(a);var l=_(r),c=i()(l,3),u=c[0],d=c[1],m=c[2],h=e[u];null==h&&(h="");var p=d&&this.typeHandlers[d];o.push(p?p(h,m,this.locale,e,this.process.bind(this)):h);var f=t.substring(s+1);return f&&o.push(this.process(f,e)),o}}return[t]}}]),t}());function U(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,s)}return n}function F(t){for(var e=1;e{"use strict";n.d(e,{Z:()=>o});const s=window,r=new Proxy({},{get:(t,e)=>Reflect.get(s.app,e,s.app),set:(t,e,n)=>Reflect.set(s.app,e,n,s.app)}),o=r;flarum.reg.add("core","common/app",r)},3817:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var s=n(2190),r=n(8312),o=n(1268),i=n(6786),a=n(3344),l=n(7465),c=n(9133);class u extends s.Z{view(t){const e=Object.assign({},this.attrs),n=(0,i.Z)(e,"type");e.className=(0,a.Z)("Alert","Alert--".concat(n),e.className);const s=(0,i.Z)(e,"title"),u=(0,i.Z)(e,"icon"),d=(0,i.Z)(e,"content")||t.children,h=(0,i.Z)(e,"controls")||[],p=(0,i.Z)(e,"dismissible"),f=(0,i.Z)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(r.Z,{"aria-label":l.Z.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,a.Z)("Alert-container",e.containerClassName)},!!s&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.Z,{name:u})),m("span",{className:"Alert-title-text"},s)),m("span",{className:"Alert-body"},d),m("ul",{className:"Alert-controls"},(0,o.Z)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},8588:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var s=n(2190);class r extends s.Z{oninit(t){super.oninit(t),this.state=this.attrs.state}view(){const t=this.state.getActiveAlerts();return m("div",{className:"AlertManager"},Object.keys(t).map(Number).map((e=>{const n=t[e],s="error"===n.attrs.type;return m("div",{className:"AlertManager-alert",role:"alert","aria-live":s?"assertive":"polite"},m(n.componentClass,Object.assign({},n.attrs,{ondismiss:this.state.dismiss.bind(this.state,e)}),n.children))})))}}flarum.reg.add("core","common/components/AlertManager",r)},7323:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var s=n(3344),r=n(2190);class o extends r.Z{view(t){const{user:e,...n}=t.attrs;n.className=(0,s.Z)("Avatar",n.className),null!=n.loading||(n.loading="lazy");let r="";const o="undefined"===n.title||n.title;if(o||delete n.title,e){const t=e.displayName()||"?",s=e.avatarUrl();if(o&&(n.title=n.title||t),s)return m("img",Object.assign({},n,{src:s,alt:""}));r=t.charAt(0).toUpperCase(),n.style={"--avatar-bg":e.color()}}return m("span",n,r)}}flarum.reg.add("core","common/components/Avatar",o)},3804:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var s=n(6439),r=n(2190),o=n(3344),i=n(9215),a=n(9133);class l extends r.Z{view(){const{type:t,icon:e,label:n,color:r,style:l={},...c}=this.attrs,u=(0,o.Z)("Badge",[t&&"Badge--".concat(t)],c.className,(0,i.Z)(r)),d=e?m(a.Z,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l,"--badge-bg":r},p={...c,className:u,style:h},f=m("div",p,d);return n?m(s.Z,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},8312:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var s=n(2190),r=n(7465);function o(){r.Z.forum.attribute("debug")&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",o);var i=n(3344),a=n(1552),l=n(5226),c=n(9133);class u extends s.Z{view(t){let{type:e,"aria-label":n,icon:s,disabled:r,loading:o,className:l,class:c,...u}=this.attrs;e||(e="button"),"object"==typeof n&&(n=(0,a.Z)(n)),(r||o)&&delete u.onclick,l=(0,i.Z)(c,l,{hasIcon:s,disabled:r||o,loading:o});const d={disabled:r,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){var e,n;super.oncreate(t);const{"aria-label":s}=this.attrs;this.view!==u.prototype.view||s||(0,a.Z)(t.children)||null!=(e=this.element)&&null!=(n=e.getAttribute)&&n.call(e,"aria-label")||o('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(c.Z,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.Z,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",u)},7298:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var s=n(2190),r=n(5226),o=n(3344),i=n(7669),a=n(9133);class l extends s.Z{view(t){const e=(0,o.Z)(["Checkbox",this.attrs.state?"on":"off",this.attrs.className,this.attrs.loading&&"loading",this.attrs.disabled&&"disabled"]);return m("label",{className:e},m("input",{type:"checkbox",checked:this.attrs.state,disabled:this.attrs.disabled,onchange:(0,i.Z)("checked",this.onchange.bind(this))}),m("div",{className:"Checkbox-display","aria-hidden":"true"},this.getDisplay()),t.children)}getDisplay(){return this.attrs.loading?m(r.Z,{display:"unset",size:"small"}):m(a.Z,{name:this.attrs.state?"fas fa-check":"fas fa-times"})}onchange(t){this.attrs.onchange&&this.attrs.onchange(t,this)}}flarum.reg.add("core","common/components/Checkbox",l)},344:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var s=n(7905),r=n(7465),o=n(2190),i=n(1268),a=n(1552),l=n(6439),c=n(9133);class u extends o.Z{constructor(){super(...arguments),(0,s.Z)(this,"showing",!1)}static initAttrs(t){t.className||(t.className=""),t.buttonClassName||(t.buttonClassName=""),t.menuClassName||(t.menuClassName=""),t.label||(t.label=""),null!=t.caretIcon||(t.caretIcon="fas fa-caret-down"),t.accessibleToggleLabel||(t.accessibleToggleLabel=(0,a.Z)(r.Z.translator.trans("core.lib.dropdown.toggle_dropdown_accessible_label")))}view(t){const e=t.children?(0,i.Z)(t.children):[],n=!this.attrs.lazyDraw||this.showing;return m("div",{className:"ButtonGroup Dropdown dropdown "+this.attrs.className+" itemCount"+e.length+(this.showing?" open":"")},this.getButton(t.children),n&&this.getMenu(e))}oncreate(t){super.oncreate(t),this.$().on("shown.bs.dropdown",(()=>{var t,e,n,s,r,o,i,a,l,c,u;const{lazyDraw:d,onshow:h}=this.attrs;this.showing=!0,d&&m.redraw.sync(),"function"==typeof h&&h(),d||m.redraw();const p=this.$(".Dropdown-menu"),f=p.hasClass("Dropdown-menu--right"),g=null!=(t=null==(e=p.offset())?void 0:e.top)?t:0,v=null!=(n=p.height())?n:0,b=null!=(s=$(window).scrollTop())?s:0,y=null!=(r=$(window).height())?r:0;p.removeClass("Dropdown-menu--top Dropdown-menu--right"),p.toggleClass("Dropdown-menu--top",g+v>b+y),((null==(o=p.offset())?void 0:o.top)||0)<0&&p.removeClass("Dropdown-menu--top");const w=null!=(i=null==(a=p.offset())?void 0:a.left)?i:0,Z=null!=(l=p.width())?l:0,x=null!=(c=$(window).scrollLeft())?c:0,N=null!=(u=$(window).width())?u:0;p.toggleClass("Dropdown-menu--right",f||w+Z>x+N)})),this.$().on("hidden.bs.dropdown",(()=>{this.showing=!1,this.attrs.onhide&&this.attrs.onhide(),m.redraw()}))}getButton(t){let e=m("button",Object.assign({className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.attrs.buttonAttrs),this.getButtonContent(t));return this.attrs.tooltip&&(e=m(l.Z,{text:this.attrs.tooltip,position:"bottom"},e)),e}getButtonContent(t){return[this.attrs.icon?m(c.Z,{name:this.attrs.icon,className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?m(c.Z,{name:this.attrs.caretIcon,className:"Button-caret"}):""]}getMenu(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)}}flarum.reg.add("core","common/components/Dropdown",u)},8034:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var s=n(2190),r=n(3344);class o extends s.Z{view(t){return m("div",{className:(0,r.Z)("FieldSet",this.attrs.className),role:"group","aria-label":this.attrs.label,"aria-disabled":!1},m("label",{className:"FieldSet-label","aria-hidden":"true"},this.attrs.label),this.attrs.description?m("div",{className:"FieldSet-description helpText"},this.attrs.description):null,m("div",{className:"FieldSet-items"},t.children))}}flarum.reg.add("core","common/components/FieldSet",o)},6352:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var s=n(2190),r=n(3344);class o extends s.Z{view(t){const{label:e,description:n,className:s,...o}=t.attrs;return m("div",Object.assign({className:(0,r.Z)("Form",s)},o),m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",o)},899:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var s=n(7108);class r extends s.Z{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){var e;this.alertAttrs=t.alert,m.redraw(),422===t.status&&null!=(e=t.response)&&e.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",r)},6697:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var s=n(3804);class r extends s.Z{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",r)},9133:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var s=n(3344),r=n(2190);class o extends r.Z{view(t){const{name:e,...n}=t.attrs;return n.className=(0,s.Z)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",o)},3986:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var s=n(2190),r=n(9133),o=n(3344);class i extends s.Z{view(t){const{icon:e,className:n,...s}=t.attrs;return m("div",Object.assign({className:(0,o.Z)("InfoTile",n)},s),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(r.Z,{name:(0,o.Z)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",i)},9908:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var s=n(6789),r=n(2190),o=n(9133),i=n(5226),a=n(3344),l=n(8312);class c extends r.Z{oninit(t){super.oninit(t)}view(t){var e,n;const{className:r,...c}=this.attrs.inputAttrs||{},u=this.attrs.value||(null==(e=(n=this.attrs).stream)?void 0:e.call(n))||"";return m("div",{className:(0,a.Z)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(o.Z,{name:(0,a.Z)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:r,value:u,inputAttrs:c}),this.attrs.loading&&m(i.Z,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&u&&!this.attrs.loading&&m(l.Z,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||s.Z.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:s}=t;const r={className:(0,a.Z)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>{var e;return null==(e=this.onchange)?void 0:e.call(this,t.target.value)},"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...s};return this.attrs.renderInput?this.attrs.renderInput(r):m("input",r)}onchange(t){var e,n;this.attrs.stream?this.attrs.stream(t):null==(e=(n=this.attrs).onchange)||e.call(n,t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},5226:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var s=n(7465),r=n(2190),o=n(3344);class i extends r.Z{view(){const{display:t="block",size:e="medium",containerClassName:n,className:r,...i}=this.attrs,a=(0,o.Z)("LoadingIndicator",r),l=(0,o.Z)("LoadingIndicator-container","unset"!==t&&"LoadingIndicator-container--".concat(t),e&&"LoadingIndicator-container--".concat(e),n);return m("div",Object.assign({"aria-label":s.Z.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},i.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:a},i)))}}flarum.reg.add("core","common/components/LoadingIndicator",i)},7108:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var s=n(7905),r=n(7465),o=n(2190),i=n(3817),a=n(8312),l=n(3344);class c extends o.Z{constructor(){super(...arguments),(0,s.Z)(this,"loading",!1),(0,s.Z)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.Z)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(a.Z,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":r.Z.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(i.Z,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,s.Z)(c,"isDismissibleViaCloseButton",!0),(0,s.Z)(c,"isDismissibleViaEscKey",!0),(0,s.Z)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},7224:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var s=n(7905),r=n(2190),o=n(7835),i=!1;if("undefined"!=typeof window){var a={get passive(){i=!0}};window.addEventListener("testPassive",null,a),window.removeEventListener("testPassive",null,a)}var l="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),c=[],u=!1,d=-1,h=void 0,p=void 0,f=void 0,g=function(t){return c.some((function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))}))},v=function(t){var e=t||window.event;return!!g(e.target)||e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1)},b=function(){l&&(c.forEach((function(t){t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null})),u&&(document.removeEventListener("touchmove",v,i?{passive:!1}:void 0),u=!1),d=-1),l?function(){if(void 0!==p){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=p.position,document.body.style.top=p.top,document.body.style.left=p.left,window.scrollTo(e,t),p=void 0}}():(void 0!==f&&(document.body.style.paddingRight=f,f=void 0),void 0!==h&&(document.body.style.overflow=h,h=void 0)),c=[]},y=n(5226);class w extends r.Z{constructor(){super(...arguments),(0,s.Z)(this,"focusTrap",void 0),(0,s.Z)(this,"lastSetFocusTrap",void 0),(0,s.Z)(this,"modalClosing",!1),(0,s.Z)(this,"keyUpListener",null)}view(t){return m("[",null,this.attrs.state.modalList.map(((t,e)=>{const n=null==t?void 0:t.componentClass;return m("div",{key:t.key,className:"ModalManager modal","data-modal-key":t.key,"data-modal-number":e,role:"dialog","aria-modal":"true",style:{"--modal-number":e},"aria-hidden":this.attrs.state.modal!==t&&"true"},!!n&&[m(n,Object.assign({key:t.key},t.attrs,{animateShow:this.animateShow.bind(this),animateHide:this.animateHide.bind(this),state:this.attrs.state})),m("div",{key:t.key,className:"ModalManager-invisibleBackdrop",onclick:this.handlePossibleBackdropClick.bind(this)})])})),(this.attrs.state.backdropShown||this.attrs.state.loadingModal)&&m("div",{className:"Modal-backdrop backdrop",ontransitionend:this.onBackdropTransitionEnd.bind(this),"data-showing":!!this.attrs.state.modalList.length||this.attrs.state.loadingModal,style:{"--modal-count":this.attrs.state.modalList.length+Number(this.attrs.state.loadingModal)}},this.attrs.state.loadingModal&&m(y.Z,null)))}oncreate(t){super.oncreate(t),this.keyUpListener=this.handleEscPress.bind(this),document.body.addEventListener("keyup",this.keyUpListener)}onbeforeremove(t){super.onbeforeremove(t),this.keyUpListener&&document.body.removeEventListener("keyup",this.keyUpListener),this.keyUpListener=null}onupdate(t){super.onupdate(t),requestAnimationFrame((()=>{try{var t,e,n,s;if(!this.attrs.state.isModalOpen())return null==(e=document.getElementById("app"))||e.setAttribute("aria-hidden","false"),null==(n=(s=this.focusTrap).deactivate)||n.call(s),void b();null==(t=document.getElementById("app"))||t.setAttribute("aria-hidden","true");const w=this.attrs.state.modal.key;var r,a,m,y;this.focusTrap&&this.lastSetFocusTrap!==w&&(null==(r=(a=this.focusTrap).deactivate)||r.call(a),b()),this.activeDialogElement&&this.lastSetFocusTrap!==w&&(this.focusTrap=(0,o.v)(this.activeDialogElement,{allowOutsideClick:!0}),null==(m=(y=this.focusTrap).activate)||m.call(y),function(t,e){if(t){if(!c.some((function(e){return e.targetElement===t}))){var n={targetElement:t,options:e||{}};c=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=s&&(document.body.style.top=-(e+t))}))}),300)}})):function(t){if(void 0===f){var e=!!t&&!0===t.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;if(e&&n>0){var s=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);f=document.body.style.paddingRight,document.body.style.paddingRight=s+n+"px"}}void 0===h&&(h=document.body.style.overflow,document.body.style.overflow="hidden")}(e),l&&(t.ontouchstart=function(t){1===t.targetTouches.length&&(d=t.targetTouches[0].clientY)},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){var n=t.targetTouches[0].clientY-d;!g(t.target)&&(e&&0===e.scrollTop&&n>0||function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight}(e)&&n<0?v(t):t.stopPropagation())}(e,t)},u||(document.addEventListener("touchmove",v,i?{passive:!1}:void 0),u=!0))}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")}(this.activeDialogManagerElement,{reserveScrollBarGap:!0})),this.lastSetFocusTrap=w}catch{}}))}get activeDialogElement(){var t;return document.body.querySelector('.ModalManager[data-modal-key="'.concat(null==(t=this.attrs.state.modal)?void 0:t.key,'"] .Modal'))}get activeDialogManagerElement(){var t;return document.body.querySelector('.ModalManager[data-modal-key="'.concat(null==(t=this.attrs.state.modal)?void 0:t.key,'"]'))}animateShow(t){void 0===t&&(t=()=>{}),this.attrs.state.modal&&(this.activeDialogElement.addEventListener("transitionend",(()=>{t()}),{once:!0}),requestAnimationFrame((()=>{this.activeDialogElement.classList.add("in")})))}animateHide(t){void 0===t&&(t=()=>{}),this.modalClosing||(this.modalClosing=!0,this.activeDialogElement.addEventListener("transitionend",(()=>{this.modalClosing=!1,this.attrs.state.close(),t()}),{once:!0}),this.activeDialogElement.classList.remove("in"),this.activeDialogElement.classList.add("out"))}handleEscPress(t){if(!this.attrs.state.modal)return;const e=this.attrs.state.modal.componentClass.dismissibleOptions;"Escape"===t.key&&e.viaEscKey&&(t.preventDefault(),this.animateHide())}handlePossibleBackdropClick(t){this.attrs.state.modal&&this.attrs.state.modal.componentClass.dismissibleOptions.viaBackdropClick&&this.animateHide()}onBackdropTransitionEnd(t){"opacity"===t.propertyName&&null===t.currentTarget.getAttribute("data-showing")&&(this.attrs.state.backdropShown=!1,m.redraw())}}flarum.reg.add("core","common/components/ModalManager",w)},5386:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var s=n(7465),r=n(2190),o=n(8312),i=n(2360),a=n(3344);class l extends r.Z{view(){const{history:t,pane:e}=s.Z;return m("div",{className:(0,a.Z)("Navigation ButtonGroup",this.attrs.className),onmouseenter:e&&e.show.bind(e),onmouseleave:e&&e.onmouseleave.bind(e)},null!=t&&t.canGoBack()?[this.getBackButton(),this.getPaneButton()]:this.getDrawerButton())}getBackButton(){const{history:t}=s.Z,e=null==t?void 0:t.getPrevious();return m(i.Z,{className:"Button Navigation-back Button--icon",href:null==t?void 0:t.backUrl(),icon:"fas fa-chevron-left","aria-label":null==e?void 0:e.title,onclick:e=>{e.shiftKey||e.ctrlKey||e.metaKey||2===e.which||(e.preventDefault(),null==t||t.back())}})}getPaneButton(){const{pane:t}=s.Z;return t&&t.active?m(o.Z,{className:(0,a.Z)("Button Button--icon Navigation-pin",{active:t.pinned}),onclick:t.togglePinned.bind(t),icon:"fas fa-thumbtack"}):null}getDrawerButton(){if(!this.attrs.drawer)return null;const{drawer:t}=s.Z,e=s.Z.session.user;return m(o.Z,{className:(0,a.Z)("Button Button--icon Navigation-drawer",{new:null==e?void 0:e.newNotificationCount()}),onclick:e=>{e.stopPropagation(),t.show()},icon:"fas fa-bars","aria-label":s.Z.translator.trans("core.lib.nav.drawer_button")})}}flarum.reg.add("core","common/components/Navigation",l)},4661:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var s=n(7905),r=n(7465),o=n(2190),i=n(5013);class a extends o.Z{constructor(){super(...arguments),(0,s.Z)(this,"bodyClass",""),(0,s.Z)(this,"scrollTopOnCreate",!0),(0,s.Z)(this,"useBrowserScrollRestoration",!0)}oninit(t){super.oninit(t),r.Z.previous=r.Z.current,r.Z.current=new i.Z(this.constructor,{routeName:this.attrs.routeName}),r.Z.drawer.hide(),r.Z.modal.close()}oncreate(t){super.oncreate(t),this.bodyClass&&$("#app").addClass(this.bodyClass),this.scrollTopOnCreate&&$(window).scrollTop(0),"scrollRestoration"in history&&(history.scrollRestoration=this.useBrowserScrollRestoration?"auto":"manual")}onremove(t){super.onremove(t),this.bodyClass&&$("#app").removeClass(this.bodyClass)}}flarum.reg.add("core","common/components/Page",a)},406:(t,e,n)=>{"use strict";n.d(e,{Z:()=>r});var s=n(7108);class r extends s.Z{className(){return"RequestErrorModal Modal--large"}title(){return!!this.attrs.error.xhr&&"".concat(this.attrs.error.xhr.status," ").concat(this.attrs.error.xhr.statusText)}content(){var t;const{error:e,formattedError:n}=this.attrs;let s;return s=n.length?n.join("\n\n"):e.response?JSON.stringify(e.response,null,2):e.responseText,null!=(t=s)&&t.includes("