diff --git a/composer.json b/composer.json index 240d4a7..7f8e177 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "forum": "https://discuss.flarum.org/d/5791" }, "require": { - "flarum/core": "^0.1.0-beta.15" + "flarum/core": "^0.1.0-beta.16" }, "replace": { "flagrow/masquerade": "*" diff --git a/extend.php b/extend.php index 46f17c8..e83f53d 100644 --- a/extend.php +++ b/extend.php @@ -10,7 +10,8 @@ use Flarum\Api\Controller\UpdateUserController; use Flarum\Api\Serializer\BasicUserSerializer; use Flarum\Api\Serializer\ForumSerializer; -use Flarum\Event\ConfigureUserGambits; +use Flarum\User\Filter\UserFilterer; +use Flarum\User\Search\UserSearcher; use Flarum\User\User; use FoF\Masquerade\Api\Controllers as Api; use Flarum\Extend; @@ -59,7 +60,7 @@ }), (new Extend\ApiSerializer(BasicUserSerializer::class)) ->hasMany('bioFields', AnswerSerializer::class) - ->mutate(function (BasicUserSerializer $serializer, User $user): array { + ->attributes(function (BasicUserSerializer $serializer, User $user): array { if ($serializer->getActor()->cannot('fof.masquerade.view-profile')) { // When the relationships are auto-loaded later, // this one will be skipped because it has already been set to null @@ -70,8 +71,10 @@ }), (new Extend\ApiSerializer(ForumSerializer::class)) - ->mutate(ForumAttributes::class), + ->attributes(ForumAttributes::class), - (new Extend\Event()) - ->listen(ConfigureUserGambits::class, Listeners\AddUserGambits::class), + (new Extend\SimpleFlarumSearch(UserSearcher::class)) + ->addGambit(Gambits\AnswerGambit::class), + (new Extend\Filter(UserFilterer::class)) + ->addFilter(Gambits\AnswerGambit::class), ]; diff --git a/js/dist/admin.js b/js/dist/admin.js index a8b047c..d7a76a2 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=21)}([function(e,t){e.exports=flarum.core.compat.app},function(e,t){e.exports=flarum.core.compat.Model},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return o}))},function(e,t){e.exports=flarum.core.compat["helpers/icon"]},function(e,t){e.exports=flarum.core.compat["components/Button"]},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(2),o=n(4),a=n(3),i=n(1),s=n.n(i),l=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),i=0;i0&&t.matches(e)})).length>0;if(e===t)return!0;if(void 0!==c(e).getConfig("connectWith")&&null!==c(e).getConfig("connectWith"))return c(e).getConfig("connectWith")===c(t).getConfig("connectWith")}return!1},j={items:null,connectWith:null,disableIEFix:null,acceptFrom:null,copy:!1,placeholder:null,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1,dropTargetContainerClass:!1,debounce:0,throttleTime:100,maxItems:0,itemSerializer:void 0,containerSerializer:void 0,customDragImage:null,orientation:"vertical"};var L,_,S,I,M,P,A,D,H,Y=function(e,t){if("string"==typeof c(e).getConfig("hoverClass")){var n=c(e).getConfig("hoverClass").split(" ");!0===t?(f(e,"mousemove",function(e,t){var n=this;if(void 0===t&&(t=250),"function"!=typeof e)throw new Error("You must provide a function as the first argument for throttle.");if("number"!=typeof t)throw new Error("You must provide a number as the second argument for throttle.");var r=null;return function(){for(var o=[],a=0;a=t)&&(r=i,e.apply(n,o))}}((function(t){0===t.buttons&&l(e.children,c(e).getConfig("items")).forEach((function(e){var r,o;e!==t.target?(r=e.classList).remove.apply(r,n):(o=e.classList).add.apply(o,n)}))}),c(e).getConfig("throttleTime"))),f(e,"mouseleave",(function(){l(e.children,c(e).getConfig("items")).forEach((function(e){var t;(t=e.classList).remove.apply(t,n)}))}))):(p(e,"mousemove"),p(e,"mouseleave"))}},B=function(e){p(e,"dragstart"),p(e,"dragend"),p(e,"dragover"),p(e,"dragenter"),p(e,"drop"),p(e,"mouseenter"),p(e,"mouseleave")},N=function(e,t){e&&p(e,"dragleave"),t&&t!==e&&p(t,"dragleave")},k=function(e){var t;(t=e).h5s&&delete t.h5s.data,g(e,"aria-dropeffect")},R=function(e){g(e,"aria-grabbed"),g(e,"aria-copied"),g(e,"draggable"),g(e,"role")};function z(e,t){if(t.composedPath)return t.composedPath().find((function(e){return e.isSortable}));for(;!0!==e.isSortable;)e=e.parentElement;return e}function W(e,t){var n=s(e,"opts"),r=l(e.children,n.items).filter((function(e){return e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t)}));return r.length>0?r[0]:t}var X=function(e){var t=s(e,"opts"),n=l(e.children,t.items),r=T(n,t.handle);(h(e,"aria-dropeffect","move"),s(e,"_disabled","false"),h(r,"draggable","true"),!1===t.disableIEFix)&&("function"==typeof(document||window.document).createElement("span").dragDrop&&f(r,"mousedown",(function(){if(-1!==n.indexOf(this))this.dragDrop();else{for(var e=this.parentElement;-1===n.indexOf(e);)e=e.parentElement;e.dragDrop()}})))};function U(e,t){var n=String(t);return t=t||{},"string"==typeof e&&(e=document.querySelectorAll(e)),e instanceof HTMLElement&&(e=[e]),e=Array.prototype.slice.call(e),/serialize/.test(n)?e.map((function(e){var t=s(e,"opts");return function(e,t,n){if(void 0===t&&(t=function(e,t){return e}),void 0===n&&(n=function(e){return e}),!(e instanceof HTMLElement)||!0==!e.isSortable)throw new Error("You need to provide a sortableContainer to be serialized.");if("function"!=typeof t||"function"!=typeof n)throw new Error("You need to provide a valid serializer for items and the container.");var r=s(e,"opts").items,o=l(e.children,r),a=o.map((function(t){return{parent:e,node:t,html:t.outerHTML,index:b(t,o)}}));return{container:n({node:e,itemCount:a.length}),items:a.map((function(n){return t(n,e)}))}}(e,t.itemSerializer,t.containerSerializer)})):(e.forEach((function(e){if(/enable|disable|destroy/.test(n))return U[n](e);["connectWith","disableIEFix"].forEach((function(e){Object.prototype.hasOwnProperty.call(t,e)&&null!==t[e]&&console.warn('HTML5Sortable: You are using the deprecated configuration "'+e+'". This will be removed in an upcoming version, make sure to migrate to the new options when updating.')})),t=Object.assign({},j,c(e).config,t),c(e).config=t,s(e,"opts",t),e.isSortable=!0,function(e){var t=s(e,"opts"),n=l(e.children,t.items),r=T(n,t.handle);s(e,"_disabled","false"),B(n),N(I,D),p(r,"mousedown"),p(e,"dragover"),p(e,"dragenter"),p(e,"drop")}(e);var r,o=l(e.children,t.items);if(null!==t.placeholder&&void 0!==t.placeholder){var a=document.createElement(e.tagName);t.placeholder instanceof HTMLElement?a.appendChild(t.placeholder):a.innerHTML=t.placeholder,r=a.children[0]}c(e).placeholder=function(e,t,n){var r;if(void 0===n&&(n="sortable-placeholder"),!(e instanceof HTMLElement))throw new Error("You must provide a valid element as a sortable.");if(!(t instanceof HTMLElement)&&void 0!==t)throw new Error("You must provide a valid element as a placeholder or set ot to undefined.");return void 0===t&&(["UL","OL"].includes(e.tagName)?t=document.createElement("li"):["TABLE","TBODY"].includes(e.tagName)?(t=document.createElement("tr")).innerHTML='':t=document.createElement("div")),"string"==typeof n&&(r=t.classList).add.apply(r,n.split(" ")),t}(e,r,t.placeholderClass),s(e,"items",t.items),t.acceptFrom?s(e,"acceptFrom",t.acceptFrom):t.connectWith&&s(e,"connectWith",t.connectWith),X(e),h(o,"role","option"),h(o,"aria-grabbed","false"),Y(e,!0),f(e,"dragstart",(function(e){var n=C(e);if(!0!==n.isSortable&&(e.stopImmediatePropagation(),(!t.handle||n.matches(t.handle))&&"false"!==n.getAttribute("draggable"))){var r=z(n,e),o=W(r,n);A=l(r.children,t.items),M=A.indexOf(o),P=b(o,r.children),I=r,function(e,t,n){if(!(e instanceof Event))throw new Error("setDragImage requires a DragEvent as the first argument.");if(!(t instanceof HTMLElement))throw new Error("setDragImage requires the dragged element as the second argument.");if(n||(n=q),e.dataTransfer&&e.dataTransfer.setDragImage){var r=n(t,v(t),e);if(!(r.element instanceof HTMLElement)||"number"!=typeof r.posX||"number"!=typeof r.posY)throw new Error("The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].");e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setData("text/plain",C(e).id),e.dataTransfer.setDragImage(r.element,r.posX,r.posY)}}(e,o,t.customDragImage),_=x(o),S=O(o),o.classList.add(t.draggingClass),L=function(e,t){var n=e;return!0===c(t).getConfig("copy")&&(h(n=e.cloneNode(!0),"aria-copied","true"),e.parentElement.appendChild(n),n.style.display="none",n.oldDisplay=e.style.display),n}(o,r),h(L,"aria-grabbed","true"),r.dispatchEvent(new CustomEvent("sortstart",{detail:{origin:{elementIndex:P,index:M,container:I},item:L,originalTarget:n}}))}})),f(e,"dragenter",(function(n){var r=C(n),o=z(r,n);o&&o!==D&&(H=l(o.children,s(o,"items")).filter((function(t){return t!==c(e).placeholder})),t.dropTargetContainerClass&&o.classList.add(t.dropTargetContainerClass),o.dispatchEvent(new CustomEvent("sortenter",{detail:{origin:{elementIndex:P,index:M,container:I},destination:{container:o,itemsBeforeUpdate:H},item:L,originalTarget:r}})),f(o,"dragleave",(function(e){var n=e.relatedTarget||e.fromElement;e.currentTarget.contains(n)||(t.dropTargetContainerClass&&o.classList.remove(t.dropTargetContainerClass),o.dispatchEvent(new CustomEvent("sortleave",{detail:{origin:{elementIndex:P,index:M,container:o},item:L,originalTarget:r}})))}))),D=o})),f(e,"dragend",(function(n){if(L){L.classList.remove(t.draggingClass),h(L,"aria-grabbed","false"),"true"===L.getAttribute("aria-copied")&&"true"!==s(L,"dropped")&&L.remove(),L.style.display=L.oldDisplay,delete L.oldDisplay;var r=Array.from(u.values()).map((function(e){return e.placeholder})).filter((function(e){return e instanceof HTMLElement})).filter(y)[0];r&&r.remove(),e.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:P,index:M,container:I},item:L}})),D=null,L=null,_=null,S=null}})),f(e,"drop",(function(n){if(F(e,L.parentElement)){n.preventDefault(),n.stopPropagation(),s(L,"dropped","true");var r=Array.from(u.values()).map((function(e){return e.placeholder})).filter((function(e){return e instanceof HTMLElement})).filter(y)[0];E(r,L),r.remove(),e.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:P,index:M,container:I},item:L}}));var o=c(e).placeholder,a=l(I.children,t.items).filter((function(e){return e!==o})),i=!0===this.isSortable?this:this.parentElement,d=l(i.children,s(i,"items")).filter((function(e){return e!==o})),f=b(L,Array.from(L.parentElement.children).filter((function(e){return e!==o}))),p=b(L,d);t.dropTargetContainerClass&&i.classList.remove(t.dropTargetContainerClass),P===f&&I===i||e.dispatchEvent(new CustomEvent("sortupdate",{detail:{origin:{elementIndex:P,index:M,container:I,itemsBeforeUpdate:A,items:a},destination:{index:p,elementIndex:f,container:i,itemsBeforeUpdate:H,items:d},item:L}}))}}));var i,d,m,g=(i=function(e,n,r,o){if(L)if(t.forcePlaceholderSize&&(c(e).placeholder.style.height=_+"px",c(e).placeholder.style.width=S+"px"),Array.from(e.children).indexOf(n)>-1){var a=x(n),i=O(n),s=b(c(e).placeholder,n.parentElement.children),d=b(n,n.parentElement.children);if(a>_||i>S){var f=a-_,p=i-S,m=v(n).top,h=v(n).left;if(sd&&("vertical"===t.orientation&&o>m+a-f||"horizontal"===t.orientation&&r>h+i-p))return}void 0===L.oldDisplay&&(L.oldDisplay=L.style.display),"none"!==L.style.display&&(L.style.display="none");var g=!1;try{var y=v(n).top+n.offsetHeight/2,T=v(n).left+n.offsetWidth/2;g="vertical"===t.orientation&&o>=y||"horizontal"===t.orientation&&r>=T}catch(e){g=s=parseInt(r.maxItems)&&L.parentElement!==n||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=!0===c(n).getConfig("copy")?"copy":"move",g(n,t,e.pageX,e.pageY))}};f(o.concat(e),"dragover",k),f(o.concat(e),"dragenter",k)})),e)}U.destroy=function(e){!function(e){var t=s(e,"opts")||{},n=l(e.children,t.items),r=T(n,t.handle);p(e,"dragover"),p(e,"dragenter"),p(e,"dragstart"),p(e,"dragend"),p(e,"drop"),k(e),p(r,"mousedown"),B(n),R(n),N(I,D),e.isSortable=!1}(e)},U.enable=function(e){X(e)},U.disable=function(e){!function(e){var t=s(e,"opts"),n=l(e.children,t.items),r=T(n,t.handle);h(e,"aria-dropeffect","none"),s(e,"_disabled","true"),h(r,"draggable","false"),p(r,"mousedown")}(e)},U.__testing={_data:s,_removeItemEvents:B,_removeItemData:R,_removeSortableData:k,_removeContainerEvents:N};var V=U,G=n(5),J=n.n(G),K=n(17),Q=n.n(K),Z=n(9),ee=n.n(Z),te=n(12),ne=n.n(te),re=n(6),oe=n.n(re),ae=n(18),ie=n.n(ae),se=n(10),le=n.n(se),ue=n(19),de=function(e){function t(){return e.apply(this,arguments)||this}Object(i.a)(t,e);var n=t.prototype;return n.oninit=function(t){e.prototype.oninit.call(this,t),this.newOption=""},n.view=function(){var e=this;return m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.options")),m("table",m("tbody",this.options().map((function(t,n){return m("tr",[m("td",m("input[type=text].FormControl",{oninput:function(t){e.updateOption(n,t.target.value)},value:t})),m("td",m("button.Button",{onclick:function(){e.moveOption(n,-1)}},J()("fas fa-chevron-up"))),m("td",m("button.Button",{onclick:function(){e.moveOption(n,1)}},J()("fas fa-chevron-down"))),m("td",m("button.Button.Button--danger",{onclick:function(){e.deleteOption(n)}},J()("fas fa-times")))])})))),m(".helpText",o.a.translator.trans("fof-masquerade.admin.fields.option-comma-warning")),m("table",m("tbody"),m("tr",[m("td",m("input[type=text].FormControl",{onchange:function(t){e.newOption=t.target.value},value:this.newOption,placeholder:o.a.translator.trans("fof-masquerade.admin.fields.option-new")})),m("td",m("button.Button.Button--primary",{onclick:function(){e.addOption()}},J()("fas fa-plus")))]))])},n.updateRules=function(e){this.attrs.onchange("in:"+e.join(","))},n.options=function(){var e=this.attrs.value.split("|"),t=[];return e.forEach((function(e){var n=e.split(":",2);"in"===n[0]&&(t=n[1].split(","))})),t},n.updateOption=function(e,t){var n=this.options();n[e]=t,this.updateRules(n)},n.moveOption=function(e,t){var n=this.options(),r=e+t;if(!(r<0||r>n.length-1)){var o=n.splice(e,1);n.splice(r,0,o[0]),this.updateRules(n)}},n.deleteOption=function(e){var t=this.options();t.splice(e,1),this.updateRules(t)},n.addOption=function(){if(""!==this.newOption){var e=this.options();e.push(this.newOption),this.newOption="",this.updateRules(e)}},t}(n.n(ue).a),ce=function(e){function t(){return e.apply(this,arguments)||this}Object(i.a)(t,e);var n=t.prototype;return n.oninit=function(t){e.prototype.oninit.call(this,t),this.resetNew(),this.loading=!1,this.existing=[],this.loadExisting(),this.enforceProfileCompletion="1"===o.a.data.settings["masquerade.force-profile-completion"]},n.config=function(){var e=this;V(this.element.querySelector(".js-sortable-fields"),{handle:"legend"})[0].addEventListener("sortupdate",(function(){var t=e.$(".js-sortable-fields > .Field").map((function(){return $(this).data("id")})).get();e.updateSort(t)}))},n.oncreate=function(t){e.prototype.oncreate.call(this,t),this.config()},n.onupdate=function(){this.config()},n.content=function(){var e=this;return m(".ExtensionPage-settings.ProfileConfigurePane",m(".container",[m("h2",o.a.translator.trans("fof-masquerade.admin.general-options")),m(".Form-group",ne.a.component({state:this.enforceProfileCompletion,onchange:function(t){var n=t?"1":"0";ie()({"masquerade.force-profile-completion":n}),e.enforceProfileCompletion=n}},o.a.translator.trans("fof-masquerade.admin.fields.force-user-to-completion"))),m("h2",o.a.translator.trans("fof-masquerade.admin.fields.title")),m("form.js-sortable-fields",this.existing.map((function(t){return e.addField(t)}))),this.addField(this.new)]))},n.addField=function(e){var t=this,n=e.id();return m("fieldset.Field",{"data-id":e.id(),key:e.id()},[m("legend",[n?[oe.a.component({className:"Button Button--icon Button--danger",icon:"fas fa-trash",onclick:this.deleteField.bind(this,e)})," "]:null,m("span.Field-toggle",{onclick:function(e){return t.toggleField(e)}},[o.a.translator.trans("fof-masquerade.admin.fields."+(n?"edit":"add"),{field:e.name()})," ",J()("fas fa-caret-down")])]),m(".Field-body",[m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.name")),m("input.FormControl",{value:e.name(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"name",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.name-help"))]),m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.description")),m("input.FormControl",{value:e.description(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"description",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.description-help"))]),m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.icon")),m("input.FormControl",{value:e.icon(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"icon",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.icon-help",{a:m("a",{href:"https://fontawesome.com/icons?m=free",target:"_blank"})}))]),m(".Form-group",ne.a.component({state:e.on_bio(),onchange:this.updateExistingFieldInput.bind(this,"on_bio",e)},o.a.translator.trans("fof-masquerade.admin.fields.on_bio"))),m(".Form-group",ne.a.component({state:e.required(),onchange:this.updateExistingFieldInput.bind(this,"required",e)},o.a.translator.trans("fof-masquerade.admin.fields.required"))),m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.type")),ee.a.component({onchange:function(n){"null"===n&&(n=null),t.updateExistingFieldInput("type",e,n)},options:this.availableTypes(),value:e.type()})]),"select"===e.type()?de.component({onchange:function(n){t.updateExistingFieldInput("validation",e,n)},value:e.validation()}):null,null===e.type()?m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.validation")),m("input.FormControl",{value:e.validation(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"validation",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.validation-help",{a:m("a",{href:"https://laravel.com/docs/5.2/validation#available-validation-rules",target:"_blank"})}))]):null,m(".Form-group",m(".ButtonGroup",[oe.a.component({className:"Button Button--primary",loading:this.loading,disabled:!this.readyToAdd(e),onclick:n?this.updateExistingField.bind(this,e):this.submitAddField.bind(this)},o.a.translator.trans("fof-masquerade.admin.buttons."+(n?"edit":"add")+"-field")),n?oe.a.component({className:"Button Button--danger",loading:this.loading,onclick:this.deleteField.bind(this,e)},o.a.translator.trans("fof-masquerade.admin.buttons.delete-field")):null]))])])},n.updateExistingFieldInput=function(e,t,n){var r;t.pushAttributes(((r={})[e]=n,r))},n.updateSort=function(e){o.a.request({method:"POST",url:o.a.forum.attribute("apiUrl")+"/masquerade/fields/order",body:{sort:e}}).then(this.requestSuccess.bind(this))},n.toggleField=function(e){$(e.target).parents(".Field").toggleClass("active")},n.deleteField=function(e){e.delete().then(this.requestSuccess.bind(this))},n.submitAddField=function(e){var t=this;e.preventDefault(),this.new.save(this.new.data.attributes).then(this.requestSuccess.bind(this)).then((function(){t.resetNew()})),m.redraw()},n.updateExistingField=function(e){e.id()&&e.save(e.data.attributes).then(this.requestSuccess.bind(this))},n.requestSuccess=function(){this.existing=o.a.store.all("masquerade-field"),this.existing.sort((function(e,t){return e.sort()t.sort()?1:0})),this.loading=!1,m.redraw()},n.loadExisting=function(){var e=this;return this.loading=!0,o.a.request({method:"GET",url:o.a.forum.attribute("apiUrl")+"/masquerade/fields"}).then((function(t){o.a.store.pushPayload(t),e.requestSuccess()}))},n.resetNew=function(){this.new=o.a.store.createRecord("masquerade-field",{attributes:{name:"",description:"",prefix:"",icon:"",required:!1,on_bio:!1,type:null,validation:""}})},n.readyToAdd=function(e){return!!e.name()},n.availableTypes=function(){return{url:o.a.translator.trans("fof-masquerade.admin.types.url"),email:o.a.translator.trans("fof-masquerade.admin.types.email"),boolean:o.a.translator.trans("fof-masquerade.admin.types.boolean"),select:o.a.translator.trans("fof-masquerade.admin.types.select"),null:o.a.translator.trans("fof-masquerade.admin.types.advanced")}},t}(Q.a);o.a.initializers.add("fof-masquerade",(function(){o.a.store.models["masquerade-field"]=a.a,o.a.extensionData.for("fof-masquerade").registerPage(ce).registerPermission({icon:"far fa-id-card",label:o.a.translator.trans("fof-masquerade.admin.permissions.view-profile"),permission:"fof.masquerade.view-profile",allowGuest:!0},"view").registerPermission({icon:"far fa-id-card",label:o.a.translator.trans("fof-masquerade.admin.permissions.have-profile"),permission:"fof.masquerade.have-profile"},"start")}))}]); +module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=21)}([function(e,t){e.exports=flarum.core.compat.app},function(e,t){e.exports=flarum.core.compat["common/Model"]},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}n.d(t,"a",(function(){return o}))},function(e,t){e.exports=flarum.core.compat["common/helpers/icon"]},function(e,t){e.exports=flarum.core.compat["common/components/Button"]},,function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(2),o=n(4),a=n(3),i=n(1),s=n.n(i),l=function(e){function t(){for(var t,n=arguments.length,o=new Array(n),i=0;i0&&t.matches(e)})).length>0;if(e===t)return!0;if(void 0!==c(e).getConfig("connectWith")&&null!==c(e).getConfig("connectWith"))return c(e).getConfig("connectWith")===c(t).getConfig("connectWith")}return!1},j={items:null,connectWith:null,disableIEFix:null,acceptFrom:null,copy:!1,placeholder:null,placeholderClass:"sortable-placeholder",draggingClass:"sortable-dragging",hoverClass:!1,dropTargetContainerClass:!1,debounce:0,throttleTime:100,maxItems:0,itemSerializer:void 0,containerSerializer:void 0,customDragImage:null,orientation:"vertical"};var L,_,S,I,M,P,A,D,H,Y=function(e,t){if("string"==typeof c(e).getConfig("hoverClass")){var n=c(e).getConfig("hoverClass").split(" ");!0===t?(f(e,"mousemove",function(e,t){var n=this;if(void 0===t&&(t=250),"function"!=typeof e)throw new Error("You must provide a function as the first argument for throttle.");if("number"!=typeof t)throw new Error("You must provide a number as the second argument for throttle.");var r=null;return function(){for(var o=[],a=0;a=t)&&(r=i,e.apply(n,o))}}((function(t){0===t.buttons&&l(e.children,c(e).getConfig("items")).forEach((function(e){var r,o;e!==t.target?(r=e.classList).remove.apply(r,n):(o=e.classList).add.apply(o,n)}))}),c(e).getConfig("throttleTime"))),f(e,"mouseleave",(function(){l(e.children,c(e).getConfig("items")).forEach((function(e){var t;(t=e.classList).remove.apply(t,n)}))}))):(p(e,"mousemove"),p(e,"mouseleave"))}},B=function(e){p(e,"dragstart"),p(e,"dragend"),p(e,"dragover"),p(e,"dragenter"),p(e,"drop"),p(e,"mouseenter"),p(e,"mouseleave")},N=function(e,t){e&&p(e,"dragleave"),t&&t!==e&&p(t,"dragleave")},k=function(e){var t;(t=e).h5s&&delete t.h5s.data,g(e,"aria-dropeffect")},R=function(e){g(e,"aria-grabbed"),g(e,"aria-copied"),g(e,"draggable"),g(e,"role")};function z(e,t){if(t.composedPath)return t.composedPath().find((function(e){return e.isSortable}));for(;!0!==e.isSortable;)e=e.parentElement;return e}function W(e,t){var n=s(e,"opts"),r=l(e.children,n.items).filter((function(e){return e.contains(t)||e.shadowRoot&&e.shadowRoot.contains(t)}));return r.length>0?r[0]:t}var X=function(e){var t=s(e,"opts"),n=l(e.children,t.items),r=T(n,t.handle);(h(e,"aria-dropeffect","move"),s(e,"_disabled","false"),h(r,"draggable","true"),!1===t.disableIEFix)&&("function"==typeof(document||window.document).createElement("span").dragDrop&&f(r,"mousedown",(function(){if(-1!==n.indexOf(this))this.dragDrop();else{for(var e=this.parentElement;-1===n.indexOf(e);)e=e.parentElement;e.dragDrop()}})))};function U(e,t){var n=String(t);return t=t||{},"string"==typeof e&&(e=document.querySelectorAll(e)),e instanceof HTMLElement&&(e=[e]),e=Array.prototype.slice.call(e),/serialize/.test(n)?e.map((function(e){var t=s(e,"opts");return function(e,t,n){if(void 0===t&&(t=function(e,t){return e}),void 0===n&&(n=function(e){return e}),!(e instanceof HTMLElement)||!0==!e.isSortable)throw new Error("You need to provide a sortableContainer to be serialized.");if("function"!=typeof t||"function"!=typeof n)throw new Error("You need to provide a valid serializer for items and the container.");var r=s(e,"opts").items,o=l(e.children,r),a=o.map((function(t){return{parent:e,node:t,html:t.outerHTML,index:b(t,o)}}));return{container:n({node:e,itemCount:a.length}),items:a.map((function(n){return t(n,e)}))}}(e,t.itemSerializer,t.containerSerializer)})):(e.forEach((function(e){if(/enable|disable|destroy/.test(n))return U[n](e);["connectWith","disableIEFix"].forEach((function(e){Object.prototype.hasOwnProperty.call(t,e)&&null!==t[e]&&console.warn('HTML5Sortable: You are using the deprecated configuration "'+e+'". This will be removed in an upcoming version, make sure to migrate to the new options when updating.')})),t=Object.assign({},j,c(e).config,t),c(e).config=t,s(e,"opts",t),e.isSortable=!0,function(e){var t=s(e,"opts"),n=l(e.children,t.items),r=T(n,t.handle);s(e,"_disabled","false"),B(n),N(I,D),p(r,"mousedown"),p(e,"dragover"),p(e,"dragenter"),p(e,"drop")}(e);var r,o=l(e.children,t.items);if(null!==t.placeholder&&void 0!==t.placeholder){var a=document.createElement(e.tagName);t.placeholder instanceof HTMLElement?a.appendChild(t.placeholder):a.innerHTML=t.placeholder,r=a.children[0]}c(e).placeholder=function(e,t,n){var r;if(void 0===n&&(n="sortable-placeholder"),!(e instanceof HTMLElement))throw new Error("You must provide a valid element as a sortable.");if(!(t instanceof HTMLElement)&&void 0!==t)throw new Error("You must provide a valid element as a placeholder or set ot to undefined.");return void 0===t&&(["UL","OL"].includes(e.tagName)?t=document.createElement("li"):["TABLE","TBODY"].includes(e.tagName)?(t=document.createElement("tr")).innerHTML='':t=document.createElement("div")),"string"==typeof n&&(r=t.classList).add.apply(r,n.split(" ")),t}(e,r,t.placeholderClass),s(e,"items",t.items),t.acceptFrom?s(e,"acceptFrom",t.acceptFrom):t.connectWith&&s(e,"connectWith",t.connectWith),X(e),h(o,"role","option"),h(o,"aria-grabbed","false"),Y(e,!0),f(e,"dragstart",(function(e){var n=C(e);if(!0!==n.isSortable&&(e.stopImmediatePropagation(),(!t.handle||n.matches(t.handle))&&"false"!==n.getAttribute("draggable"))){var r=z(n,e),o=W(r,n);A=l(r.children,t.items),M=A.indexOf(o),P=b(o,r.children),I=r,function(e,t,n){if(!(e instanceof Event))throw new Error("setDragImage requires a DragEvent as the first argument.");if(!(t instanceof HTMLElement))throw new Error("setDragImage requires the dragged element as the second argument.");if(n||(n=q),e.dataTransfer&&e.dataTransfer.setDragImage){var r=n(t,v(t),e);if(!(r.element instanceof HTMLElement)||"number"!=typeof r.posX||"number"!=typeof r.posY)throw new Error("The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].");e.dataTransfer.effectAllowed="copyMove",e.dataTransfer.setData("text/plain",C(e).id),e.dataTransfer.setDragImage(r.element,r.posX,r.posY)}}(e,o,t.customDragImage),_=x(o),S=O(o),o.classList.add(t.draggingClass),L=function(e,t){var n=e;return!0===c(t).getConfig("copy")&&(h(n=e.cloneNode(!0),"aria-copied","true"),e.parentElement.appendChild(n),n.style.display="none",n.oldDisplay=e.style.display),n}(o,r),h(L,"aria-grabbed","true"),r.dispatchEvent(new CustomEvent("sortstart",{detail:{origin:{elementIndex:P,index:M,container:I},item:L,originalTarget:n}}))}})),f(e,"dragenter",(function(n){var r=C(n),o=z(r,n);o&&o!==D&&(H=l(o.children,s(o,"items")).filter((function(t){return t!==c(e).placeholder})),t.dropTargetContainerClass&&o.classList.add(t.dropTargetContainerClass),o.dispatchEvent(new CustomEvent("sortenter",{detail:{origin:{elementIndex:P,index:M,container:I},destination:{container:o,itemsBeforeUpdate:H},item:L,originalTarget:r}})),f(o,"dragleave",(function(e){var n=e.relatedTarget||e.fromElement;e.currentTarget.contains(n)||(t.dropTargetContainerClass&&o.classList.remove(t.dropTargetContainerClass),o.dispatchEvent(new CustomEvent("sortleave",{detail:{origin:{elementIndex:P,index:M,container:o},item:L,originalTarget:r}})))}))),D=o})),f(e,"dragend",(function(n){if(L){L.classList.remove(t.draggingClass),h(L,"aria-grabbed","false"),"true"===L.getAttribute("aria-copied")&&"true"!==s(L,"dropped")&&L.remove(),L.style.display=L.oldDisplay,delete L.oldDisplay;var r=Array.from(u.values()).map((function(e){return e.placeholder})).filter((function(e){return e instanceof HTMLElement})).filter(y)[0];r&&r.remove(),e.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:P,index:M,container:I},item:L}})),D=null,L=null,_=null,S=null}})),f(e,"drop",(function(n){if(F(e,L.parentElement)){n.preventDefault(),n.stopPropagation(),s(L,"dropped","true");var r=Array.from(u.values()).map((function(e){return e.placeholder})).filter((function(e){return e instanceof HTMLElement})).filter(y)[0];E(r,L),r.remove(),e.dispatchEvent(new CustomEvent("sortstop",{detail:{origin:{elementIndex:P,index:M,container:I},item:L}}));var o=c(e).placeholder,a=l(I.children,t.items).filter((function(e){return e!==o})),i=!0===this.isSortable?this:this.parentElement,d=l(i.children,s(i,"items")).filter((function(e){return e!==o})),f=b(L,Array.from(L.parentElement.children).filter((function(e){return e!==o}))),p=b(L,d);t.dropTargetContainerClass&&i.classList.remove(t.dropTargetContainerClass),P===f&&I===i||e.dispatchEvent(new CustomEvent("sortupdate",{detail:{origin:{elementIndex:P,index:M,container:I,itemsBeforeUpdate:A,items:a},destination:{index:p,elementIndex:f,container:i,itemsBeforeUpdate:H,items:d},item:L}}))}}));var i,d,m,g=(i=function(e,n,r,o){if(L)if(t.forcePlaceholderSize&&(c(e).placeholder.style.height=_+"px",c(e).placeholder.style.width=S+"px"),Array.from(e.children).indexOf(n)>-1){var a=x(n),i=O(n),s=b(c(e).placeholder,n.parentElement.children),d=b(n,n.parentElement.children);if(a>_||i>S){var f=a-_,p=i-S,m=v(n).top,h=v(n).left;if(sd&&("vertical"===t.orientation&&o>m+a-f||"horizontal"===t.orientation&&r>h+i-p))return}void 0===L.oldDisplay&&(L.oldDisplay=L.style.display),"none"!==L.style.display&&(L.style.display="none");var g=!1;try{var y=v(n).top+n.offsetHeight/2,T=v(n).left+n.offsetWidth/2;g="vertical"===t.orientation&&o>=y||"horizontal"===t.orientation&&r>=T}catch(e){g=s=parseInt(r.maxItems)&&L.parentElement!==n||(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=!0===c(n).getConfig("copy")?"copy":"move",g(n,t,e.pageX,e.pageY))}};f(o.concat(e),"dragover",k),f(o.concat(e),"dragenter",k)})),e)}U.destroy=function(e){!function(e){var t=s(e,"opts")||{},n=l(e.children,t.items),r=T(n,t.handle);p(e,"dragover"),p(e,"dragenter"),p(e,"dragstart"),p(e,"dragend"),p(e,"drop"),k(e),p(r,"mousedown"),B(n),R(n),N(I,D),e.isSortable=!1}(e)},U.enable=function(e){X(e)},U.disable=function(e){!function(e){var t=s(e,"opts"),n=l(e.children,t.items),r=T(n,t.handle);h(e,"aria-dropeffect","none"),s(e,"_disabled","true"),h(r,"draggable","false"),p(r,"mousedown")}(e)},U.__testing={_data:s,_removeItemEvents:B,_removeItemData:R,_removeSortableData:k,_removeContainerEvents:N};var V=U,G=n(5),J=n.n(G),K=n(17),Q=n.n(K),Z=n(9),ee=n.n(Z),te=n(12),ne=n.n(te),re=n(6),oe=n.n(re),ae=n(18),ie=n.n(ae),se=n(10),le=n.n(se),ue=n(19),de=function(e){function t(){return e.apply(this,arguments)||this}Object(i.a)(t,e);var n=t.prototype;return n.oninit=function(t){e.prototype.oninit.call(this,t),this.newOption=""},n.view=function(){var e=this;return m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.options")),m("table",m("tbody",this.options().map((function(t,n){return m("tr",[m("td",m("input[type=text].FormControl",{oninput:function(t){e.updateOption(n,t.target.value)},value:t})),m("td",m("button.Button",{onclick:function(){e.moveOption(n,-1)}},J()("fas fa-chevron-up"))),m("td",m("button.Button",{onclick:function(){e.moveOption(n,1)}},J()("fas fa-chevron-down"))),m("td",m("button.Button.Button--danger",{onclick:function(){e.deleteOption(n)}},J()("fas fa-times")))])})))),m(".helpText",o.a.translator.trans("fof-masquerade.admin.fields.option-comma-warning")),m("table",m("tbody"),m("tr",[m("td",m("input[type=text].FormControl",{onchange:function(t){e.newOption=t.target.value},value:this.newOption,placeholder:o.a.translator.trans("fof-masquerade.admin.fields.option-new")})),m("td",m("button.Button.Button--primary",{onclick:function(){e.addOption()}},J()("fas fa-plus")))]))])},n.updateRules=function(e){this.attrs.onchange("in:"+e.join(","))},n.options=function(){var e=this.attrs.value.split("|"),t=[];return e.forEach((function(e){var n=e.split(":",2);"in"===n[0]&&(t=n[1].split(","))})),t},n.updateOption=function(e,t){var n=this.options();n[e]=t,this.updateRules(n)},n.moveOption=function(e,t){var n=this.options(),r=e+t;if(!(r<0||r>n.length-1)){var o=n.splice(e,1);n.splice(r,0,o[0]),this.updateRules(n)}},n.deleteOption=function(e){var t=this.options();t.splice(e,1),this.updateRules(t)},n.addOption=function(){if(""!==this.newOption){var e=this.options();e.push(this.newOption),this.newOption="",this.updateRules(e)}},t}(n.n(ue).a),ce=function(e){function t(){return e.apply(this,arguments)||this}Object(i.a)(t,e);var n=t.prototype;return n.oninit=function(t){e.prototype.oninit.call(this,t),this.resetNew(),this.loading=!1,this.existing=[],this.loadExisting(),this.enforceProfileCompletion="1"===o.a.data.settings["masquerade.force-profile-completion"]},n.config=function(){var e=this;V(this.element.querySelector(".js-sortable-fields"),{handle:"legend"})[0].addEventListener("sortupdate",(function(){var t=e.$(".js-sortable-fields > .Field").map((function(){return $(this).data("id")})).get();e.updateSort(t)}))},n.oncreate=function(t){e.prototype.oncreate.call(this,t),this.config()},n.onupdate=function(){this.config()},n.content=function(){var e=this;return m(".ExtensionPage-settings.ProfileConfigurePane",m(".container",[m("h2",o.a.translator.trans("fof-masquerade.admin.general-options")),m(".Form-group",ne.a.component({state:this.enforceProfileCompletion,onchange:function(t){var n=t?"1":"0";ie()({"masquerade.force-profile-completion":n}),e.enforceProfileCompletion=n}},o.a.translator.trans("fof-masquerade.admin.fields.force-user-to-completion"))),m("h2",o.a.translator.trans("fof-masquerade.admin.fields.title")),m("form.js-sortable-fields",this.existing.map((function(t){return e.addField(t)}))),this.addField(this.new)]))},n.addField=function(e){var t=this,n=e.id();return m("fieldset.Field",{"data-id":e.id(),key:e.id()},[m("legend",[n?[oe.a.component({className:"Button Button--icon Button--danger",icon:"fas fa-trash",onclick:this.deleteField.bind(this,e)})," "]:null,m("span.Field-toggle",{onclick:function(e){return t.toggleField(e)}},[o.a.translator.trans("fof-masquerade.admin.fields."+(n?"edit":"add"),{field:e.name()})," ",J()("fas fa-caret-down")])]),m(".Field-body",[m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.name")),m("input.FormControl",{value:e.name(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"name",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.name-help"))]),m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.description")),m("input.FormControl",{value:e.description(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"description",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.description-help"))]),m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.icon")),m("input.FormControl",{value:e.icon(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"icon",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.icon-help",{a:m("a",{href:"https://fontawesome.com/icons?m=free",target:"_blank"})}))]),m(".Form-group",ne.a.component({state:e.on_bio(),onchange:this.updateExistingFieldInput.bind(this,"on_bio",e)},o.a.translator.trans("fof-masquerade.admin.fields.on_bio"))),m(".Form-group",ne.a.component({state:e.required(),onchange:this.updateExistingFieldInput.bind(this,"required",e)},o.a.translator.trans("fof-masquerade.admin.fields.required"))),m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.type")),ee.a.component({onchange:function(n){"null"===n&&(n=null),t.updateExistingFieldInput("type",e,n)},options:this.availableTypes(),value:e.type()})]),"select"===e.type()?de.component({onchange:function(n){t.updateExistingFieldInput("validation",e,n)},value:e.validation()}):null,null===e.type()?m(".Form-group",[m("label",o.a.translator.trans("fof-masquerade.admin.fields.validation")),m("input.FormControl",{value:e.validation(),oninput:le()("value",this.updateExistingFieldInput.bind(this,"validation",e))}),m("span.helpText",o.a.translator.trans("fof-masquerade.admin.fields.validation-help",{a:m("a",{href:"https://laravel.com/docs/5.2/validation#available-validation-rules",target:"_blank"})}))]):null,m(".Form-group",m(".ButtonGroup",[oe.a.component({className:"Button Button--primary",loading:this.loading,disabled:!this.readyToAdd(e),onclick:n?this.updateExistingField.bind(this,e):this.submitAddField.bind(this)},o.a.translator.trans("fof-masquerade.admin.buttons."+(n?"edit":"add")+"-field")),n?oe.a.component({className:"Button Button--danger",loading:this.loading,onclick:this.deleteField.bind(this,e)},o.a.translator.trans("fof-masquerade.admin.buttons.delete-field")):null]))])])},n.updateExistingFieldInput=function(e,t,n){var r;t.pushAttributes(((r={})[e]=n,r))},n.updateSort=function(e){o.a.request({method:"POST",url:o.a.forum.attribute("apiUrl")+"/masquerade/fields/order",body:{sort:e}}).then(this.requestSuccess.bind(this))},n.toggleField=function(e){$(e.target).parents(".Field").toggleClass("active")},n.deleteField=function(e){e.delete().then(this.requestSuccess.bind(this))},n.submitAddField=function(e){var t=this;e.preventDefault(),this.new.save(this.new.data.attributes).then(this.requestSuccess.bind(this)).then((function(){t.resetNew()})),m.redraw()},n.updateExistingField=function(e){e.id()&&e.save(e.data.attributes).then(this.requestSuccess.bind(this))},n.requestSuccess=function(){this.existing=o.a.store.all("masquerade-field"),this.existing.sort((function(e,t){return e.sort()t.sort()?1:0})),this.loading=!1,m.redraw()},n.loadExisting=function(){var e=this;return this.loading=!0,o.a.request({method:"GET",url:o.a.forum.attribute("apiUrl")+"/masquerade/fields"}).then((function(t){o.a.store.pushPayload(t),e.requestSuccess()}))},n.resetNew=function(){this.new=o.a.store.createRecord("masquerade-field",{attributes:{name:"",description:"",prefix:"",icon:"",required:!1,on_bio:!1,type:null,validation:""}})},n.readyToAdd=function(e){return!!e.name()},n.availableTypes=function(){return{url:o.a.translator.trans("fof-masquerade.admin.types.url"),email:o.a.translator.trans("fof-masquerade.admin.types.email"),boolean:o.a.translator.trans("fof-masquerade.admin.types.boolean"),select:o.a.translator.trans("fof-masquerade.admin.types.select"),null:o.a.translator.trans("fof-masquerade.admin.types.advanced")}},t}(Q.a);o.a.initializers.add("fof-masquerade",(function(){o.a.store.models["masquerade-field"]=a.a,o.a.extensionData.for("fof-masquerade").registerPage(ce).registerPermission({icon:"far fa-id-card",label:o.a.translator.trans("fof-masquerade.admin.permissions.view-profile"),permission:"fof.masquerade.view-profile",allowGuest:!0},"view").registerPermission({icon:"far fa-id-card",label:o.a.translator.trans("fof-masquerade.admin.permissions.have-profile"),permission:"fof.masquerade.have-profile"},"start")}))}]); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index c2c2033..7ebe063 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@fof/masquerade/webpack/bootstrap","webpack://@fof/masquerade/external \"flarum.core.compat['app']\"","webpack://@fof/masquerade/external \"flarum.core.compat['Model']\"","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/masquerade/external \"flarum.core.compat['helpers/icon']\"","webpack://@fof/masquerade/external \"flarum.core.compat['components/Button']\"","webpack://@fof/masquerade/./src/lib/models/Field.js","webpack://@fof/masquerade/external \"flarum.core.compat['components/Select']\"","webpack://@fof/masquerade/external \"flarum.core.compat['utils/withAttr']\"","webpack://@fof/masquerade/external \"flarum.core.compat['components/Switch']\"","webpack://@fof/masquerade/external \"flarum.core.compat['components/ExtensionPage']\"","webpack://@fof/masquerade/external \"flarum.core.compat['utils/saveSettings']\"","webpack://@fof/masquerade/external \"flarum.core.compat['Component']\"","webpack://@fof/masquerade/./node_modules/html5sortable/dist/html5sortable.es.js","webpack://@fof/masquerade/./src/admin/components/SelectFieldOptionEditor.js","webpack://@fof/masquerade/./src/admin/components/MasqueradePage.js","webpack://@fof/masquerade/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_assertThisInitialized","self","ReferenceError","_defineProperty","obj","configurable","writable","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","Field","Model","attribute","transformDate","hasOne","apiEndpoint","this","exists","data","id","addData","element","undefined","h5s","_filter","nodes","selector","NodeList","HTMLCollection","Array","Error","from","filter","item","nodeType","matches","stores","Map","Store","_config","_placeholder","_data","config","forEach","set","mergedConfig","assign","entries","setConfig","has","getConfig","placeholder","HTMLElement","setData","getData","deleteData","delete","store","sortableElement","addEventListener","eventName","callback","length","removeEventListener","addAttribute","setAttribute","removeAttribute","_offset","parentElement","getClientRects","rect","left","window","pageXOffset","right","top","pageYOffset","bottom","_index","elementList","indexOf","isInDom","parentNode","insertNode","referenceNode","newElement","position","insertBefore","nextElementSibling","insertAfter","target","_getElementHeight","style","getComputedStyle","getPropertyValue","parseInt","map","int","isNaN","reduce","sum","_getElementWidth","_getHandles","items","querySelector","shadowRoot","getEventTarget","event","composedPath","defaultDragImage","draggedElement","elementOffset","posX","pageX","posY","pageY","_listsConnected","destination","origin","isSortable","acceptFrom","split","sel","defaultConfiguration","connectWith","disableIEFix","copy","placeholderClass","draggingClass","hoverClass","dropTargetContainerClass","debounce","throttleTime","maxItems","itemSerializer","containerSerializer","customDragImage","orientation","dragging","draggingHeight","draggingWidth","originContainer","originIndex","originElementIndex","originItemsBeforeUpdate","previousContainer","destinationItemsBeforeUpdate","enableHoverClass","sortableContainer","enable","hoverClasses_1","fn","threshold","_this","lastEventTimestamp","args","_i","arguments","now","Date","apply","_throttle","buttons","children","_a","_b","classList","remove","add","_removeItemEvents","_removeContainerEvents","_removeSortableData","sortable","_removeItemData","findSortable","find","el","findDragElement","options","itemlist","ele","contains","_enableSortable","opts","handles","handle","document","createElement","dragDrop","parent","sortableElements","method","String","querySelectorAll","slice","test","customItemSerializer","customContainerSerializer","serializedItem","serializedContainer","serializedItems","node","html","outerHTML","index","container","itemCount","_serialize","configKey","console","warn","_reloadSortable","customPlaceholder","listItems","tempContainer","tagName","appendChild","innerHTML","includes","_makePlaceholder","e","stopImmediatePropagation","getAttribute","dragItem","Event","dataTransfer","setDragImage","dragImage","effectAllowed","draggedItem","ditem","cloneNode","display","oldDisplay","_getDragging","dispatchEvent","CustomEvent","detail","elementIndex","originalTarget","itemsBeforeUpdate","outTarget","relatedTarget","fromElement","currentTarget","visiblePlaceholder","values","preventDefault","stopPropagation","originItems","destinationContainer","destinationItems","destinationElementIndex","destinationIndex","func","wait","timeout","debouncedDragOverEnter","forcePlaceholderSize","height","width","thisHeight","thisWidth","placeholderIndex","thisIndex","deadZoneVertical","deadZoneHorizontal","offsetTop","offsetLeft","placeAfter","elementMiddleVertical","offsetHeight","elementMiddleHorizontal","offsetWidth","placeholders","clearTimeout","setTimeout","onDragOverEnter","dropEffect","concat","destroy","_destroySortable","disable","_disableSortable","__testing","SelectFieldOptionEditor","oninit","vnode","newOption","view","app","translator","trans","option","optionIndex","oninput","updateOption","onclick","moveOption","icon","deleteOption","onchange","addOption","updateRules","attrs","join","rules","rule","parts","moveIndex","newIndex","move","splice","push","Component","MasqueradePage","resetNew","loading","existing","loadExisting","enforceProfileCompletion","settings","sorting","$","updateSort","oncreate","onupdate","content","Switch","component","state","saveValue","saveSettings","field","addField","Button","className","deleteField","toggleField","withAttr","updateExistingFieldInput","description","a","href","on_bio","required","Select","availableTypes","type","validation","disabled","readyToAdd","updateExistingField","submitAddField","what","pushAttributes","request","url","forum","body","sort","then","requestSuccess","parents","toggleClass","save","attributes","redraw","all","b","result","pushPayload","createRecord","prefix","email","boolean","select","null","ExtensionPage","initializers","models","extensionData","registerPage","registerPermission","label","permission","allowGuest"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC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SAACS,GACHhF,IAAIzO,MAAM0T,YAAYD,GAEtB,EAAKR,qB,EAOjB9C,SAAA,WACI5S,KAAA,IAAWkR,IAAIzO,MAAM2T,aAAa,mBAAoB,CAClDN,WAAY,CACR9Y,KAAM,GACNqX,YAAa,GACbgC,OAAQ,GACR1E,KAAM,GACN8C,UAAU,EACVD,QAAQ,EACRI,KAAM,KACNC,WAAY,O,EAUxBE,WAAA,SAAWlB,GACP,QAAIA,EAAM7W,Q,EAWd2X,eAAA,WACI,MAAO,CACHU,IAAKnE,IAAIC,WAAWC,MAAM,kCAC1BkF,MAAOpF,IAAIC,WAAWC,MAAM,oCAC5BmF,QAASrF,IAAIC,WAAWC,MAAM,sCAC9BoF,OAAQtF,IAAIC,WAAWC,MAAM,qCAC7BqF,KAAMvF,IAAIC,WAAWC,MAAM,yC,GAlXKsF,KCV5CxF,IAAIyF,aAAanN,IAAI,kBAAkB,WACnC0H,IAAIzO,MAAMmU,OAAO,oBAAsBlX,IAEvCwR,IAAI2F,cAAJ,IACS,kBACJC,aAAanE,IACboE,mBACG,CACIpF,KAAM,iBACNqF,MAAO9F,IAAIC,WAAWC,MAAM,iDAC5B6F,WAAY,8BACZC,YAAY,GAEhB,QAEHH,mBACG,CACIpF,KAAM,iBACNqF,MAAO9F,IAAIC,WAAWC,MAAM,iDAC5B6F,WAAY,+BAEhB","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['Model'];","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _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}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"@babel/runtime/helpers/esm/setPrototypeOf\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","module.exports = flarum.core.compat['helpers/icon'];","module.exports = flarum.core.compat['components/Button'];","import Model from 'flarum/Model';\n\nexport default class Field extends Model {\n name = Model.attribute('name');\n description = Model.attribute('description');\n type = Model.attribute('type');\n validation = Model.attribute('validation');\n required = Model.attribute('required');\n prefix = Model.attribute('prefix');\n icon = Model.attribute('icon');\n sort = Model.attribute('sort');\n deleted_at = Model.attribute('deleted_at', Model.transformDate);\n answer = Model.hasOne('answer');\n on_bio = Model.attribute('on_bio');\n\n apiEndpoint() {\n return '/masquerade/fields' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","module.exports = flarum.core.compat['components/Select'];","module.exports = flarum.core.compat['utils/withAttr'];","module.exports = flarum.core.compat['components/Switch'];","module.exports = flarum.core.compat['components/ExtensionPage'];","module.exports = flarum.core.compat['utils/saveSettings'];","module.exports = flarum.core.compat['Component'];","/*\n * HTML5Sortable package\n * https://github.com/lukasoppermann/html5sortable\n *\n * Maintained by Lukas Oppermann \n *\n * Released under the MIT license.\n */\n/**\n * Get or set data on element\n * @param {HTMLElement} element\n * @param {string} key\n * @param {any} value\n * @return {*}\n */\nfunction addData(element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key];\n }\n else {\n element.h5s = element.h5s || {};\n element.h5s.data = element.h5s.data || {};\n element.h5s.data[key] = value;\n }\n}\n/**\n * Remove data from element\n * @param {HTMLElement} element\n */\nfunction removeData(element) {\n if (element.h5s) {\n delete element.h5s.data;\n }\n}\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {NodeList|HTMLCollection|Array} nodes\n * @param {String} selector\n * @returns {Array}\n */\nvar _filter = (function (nodes, selector) {\n if (!(nodes instanceof NodeList || nodes instanceof HTMLCollection || nodes instanceof Array)) {\n throw new Error('You must provide a nodeList/HTMLCollection/Array of elements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return Array.from(nodes);\n }\n return Array.from(nodes).filter(function (item) { return item.nodeType === 1 && item.matches(selector); });\n});\n\n/* eslint-env browser */\nvar stores = new Map();\n/**\n * Stores data & configurations per Sortable\n * @param {Object} config\n */\nvar Store = /** @class */ (function () {\n function Store() {\n this._config = new Map(); // eslint-disable-line no-undef\n this._placeholder = undefined; // eslint-disable-line no-undef\n this._data = new Map(); // eslint-disable-line no-undef\n }\n Object.defineProperty(Store.prototype, \"config\", {\n /**\n * get the configuration map of a class instance\n * @method config\n * @return {object}\n */\n get: function () {\n // transform Map to object\n var config = {};\n this._config.forEach(function (value, key) {\n config[key] = value;\n });\n // return object\n return config;\n },\n /**\n * set the configuration of a class instance\n * @method config\n * @param {object} config object of configurations\n */\n set: function (config) {\n if (typeof config !== 'object') {\n throw new Error('You must provide a valid configuration object to the config setter.');\n }\n // combine config with default\n var mergedConfig = Object.assign({}, config);\n // add config to map\n this._config = new Map(Object.entries(mergedConfig));\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set individual configuration of a class instance\n * @method setConfig\n * @param key valid configuration key\n * @param value any value\n * @return void\n */\n Store.prototype.setConfig = function (key, value) {\n if (!this._config.has(key)) {\n throw new Error(\"Trying to set invalid configuration item: \" + key);\n }\n // set config\n this._config.set(key, value);\n };\n /**\n * get an individual configuration of a class instance\n * @method getConfig\n * @param key valid configuration key\n * @return any configuration value\n */\n Store.prototype.getConfig = function (key) {\n if (!this._config.has(key)) {\n throw new Error(\"Invalid configuration item requested: \" + key);\n }\n return this._config.get(key);\n };\n Object.defineProperty(Store.prototype, \"placeholder\", {\n /**\n * get the placeholder for a class instance\n * @method placeholder\n * @return {HTMLElement|null}\n */\n get: function () {\n return this._placeholder;\n },\n /**\n * set the placeholder for a class instance\n * @method placeholder\n * @param {HTMLElement} placeholder\n * @return {void}\n */\n set: function (placeholder) {\n if (!(placeholder instanceof HTMLElement) && placeholder !== null) {\n throw new Error('A placeholder must be an html element or null.');\n }\n this._placeholder = placeholder;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set an data entry\n * @method setData\n * @param {string} key\n * @param {any} value\n * @return {void}\n */\n Store.prototype.setData = function (key, value) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n this._data.set(key, value);\n };\n /**\n * get an data entry\n * @method getData\n * @param {string} key an existing key\n * @return {any}\n */\n Store.prototype.getData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.get(key);\n };\n /**\n * delete an data entry\n * @method deleteData\n * @param {string} key an existing key\n * @return {boolean}\n */\n Store.prototype.deleteData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.delete(key);\n };\n return Store;\n}());\n/**\n * @param {HTMLElement} sortableElement\n * @returns {Class: Store}\n */\nvar store = (function (sortableElement) {\n // if sortableElement is wrong type\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('Please provide a sortable to the store function.');\n }\n // create new instance if not avilable\n if (!stores.has(sortableElement)) {\n stores.set(sortableElement, new Store());\n }\n // return instance\n return stores.get(sortableElement);\n});\n\n/**\n * @param {Array|HTMLElement} element\n * @param {Function} callback\n * @param {string} event\n */\nfunction addEventListener(element, eventName, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addEventListener(element[i], eventName, callback);\n }\n return;\n }\n element.addEventListener(eventName, callback);\n store(element).setData(\"event\" + eventName, callback);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} eventName\n */\nfunction removeEventListener(element, eventName) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeEventListener(element[i], eventName);\n }\n return;\n }\n element.removeEventListener(eventName, store(element).getData(\"event\" + eventName));\n store(element).deleteData(\"event\" + eventName);\n}\n\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction addAttribute(element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addAttribute(element[i], attribute, value);\n }\n return;\n }\n element.setAttribute(attribute, value);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n */\nfunction removeAttribute(element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeAttribute(element[i], attribute);\n }\n return;\n }\n element.removeAttribute(attribute);\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {Object}\n */\nvar _offset = (function (element) {\n if (!element.parentElement || element.getClientRects().length === 0) {\n throw new Error('target element must be part of the dom');\n }\n var rect = element.getClientRects()[0];\n return {\n left: rect.left + window.pageXOffset,\n right: rect.right + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n bottom: rect.bottom + window.pageYOffset\n };\n});\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {Function} func to debounce\n * @param {number} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nvar _debounce = (function (func, wait) {\n if (wait === void 0) { wait = 0; }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(void 0, args);\n }, wait);\n };\n});\n\n/* eslint-env browser */\n/**\n * Get position of the element relatively to its sibling elements\n * @param {HTMLElement} element\n * @returns {number}\n */\nvar _index = (function (element, elementList) {\n if (!(element instanceof HTMLElement) || !(elementList instanceof NodeList || elementList instanceof HTMLCollection || elementList instanceof Array)) {\n throw new Error('You must provide an element and a list of elements.');\n }\n return Array.from(elementList).indexOf(element);\n});\n\n/* eslint-env browser */\n/**\n * Test whether element is in DOM\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nvar isInDom = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('Element is not a node element.');\n }\n return element.parentNode !== null;\n});\n\n/* eslint-env browser */\n/**\n * Insert node before or after target\n * @param {HTMLElement} referenceNode - reference element\n * @param {HTMLElement} newElement - element to be inserted\n * @param {String} position - insert before or after reference element\n */\nvar insertNode = function (referenceNode, newElement, position) {\n if (!(referenceNode instanceof HTMLElement) || !(referenceNode.parentElement instanceof HTMLElement)) {\n throw new Error('target and element must be a node');\n }\n referenceNode.parentElement.insertBefore(newElement, (position === 'before' ? referenceNode : referenceNode.nextElementSibling));\n};\n/**\n * Insert before target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertBefore = function (target, element) { return insertNode(target, element, 'before'); };\n/**\n * Insert after target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertAfter = function (target, element) { return insertNode(target, element, 'after'); };\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {HTMLElement} sortableContainer\n * @param {Function} customSerializer\n * @returns {Array}\n */\nvar _serialize = (function (sortableContainer, customItemSerializer, customContainerSerializer) {\n if (customItemSerializer === void 0) { customItemSerializer = function (serializedItem, sortableContainer) { return serializedItem; }; }\n if (customContainerSerializer === void 0) { customContainerSerializer = function (serializedContainer) { return serializedContainer; }; }\n // check for valid sortableContainer\n if (!(sortableContainer instanceof HTMLElement) || !sortableContainer.isSortable === true) {\n throw new Error('You need to provide a sortableContainer to be serialized.');\n }\n // check for valid serializers\n if (typeof customItemSerializer !== 'function' || typeof customContainerSerializer !== 'function') {\n throw new Error('You need to provide a valid serializer for items and the container.');\n }\n // get options\n var options = addData(sortableContainer, 'opts');\n var item = options.items;\n // serialize container\n var items = _filter(sortableContainer.children, item);\n var serializedItems = items.map(function (item) {\n return {\n parent: sortableContainer,\n node: item,\n html: item.outerHTML,\n index: _index(item, items)\n };\n });\n // serialize container\n var container = {\n node: sortableContainer,\n itemCount: serializedItems.length\n };\n return {\n container: customContainerSerializer(container),\n items: serializedItems.map(function (item) { return customItemSerializer(item, sortableContainer); })\n };\n});\n\n/* eslint-env browser */\n/**\n * create a placeholder element\n * @param {HTMLElement} sortableElement a single sortable\n * @param {string|undefined} placeholder a string representing an html element\n * @param {string} placeholderClasses a string representing the classes that should be added to the placeholder\n */\nvar _makePlaceholder = (function (sortableElement, placeholder, placeholderClass) {\n var _a;\n if (placeholderClass === void 0) { placeholderClass = 'sortable-placeholder'; }\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('You must provide a valid element as a sortable.');\n }\n // if placeholder is not an element\n if (!(placeholder instanceof HTMLElement) && placeholder !== undefined) {\n throw new Error('You must provide a valid element as a placeholder or set ot to undefined.');\n }\n // if no placeholder element is given\n if (placeholder === undefined) {\n if (['UL', 'OL'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('li');\n }\n else if (['TABLE', 'TBODY'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('tr');\n // set colspan to always all rows, otherwise the item can only be dropped in first column\n placeholder.innerHTML = '';\n }\n else {\n placeholder = document.createElement('div');\n }\n }\n // add classes to placeholder\n if (typeof placeholderClass === 'string') {\n (_a = placeholder.classList).add.apply(_a, placeholderClass.split(' '));\n }\n return placeholder;\n});\n\n/* eslint-env browser */\n/**\n * Get height of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementHeight = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // get only height if element has box-sizing: border-box specified\n if (style.getPropertyValue('box-sizing') === 'border-box') {\n return parseInt(style.getPropertyValue('height'), 10);\n }\n // pick applicable properties, convert to int and reduce by adding\n return ['height', 'padding-top', 'padding-bottom']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * Get width of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementWidth = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // pick applicable properties, convert to int and reduce by adding\n return ['width', 'padding-left', 'padding-right']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * get handle or return item\n * @param {Array} items\n * @param {string} selector\n */\nvar _getHandles = (function (items, selector) {\n if (!(items instanceof Array)) {\n throw new Error('You must provide a Array of HTMLElements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return items;\n }\n return items\n // remove items without handle from array\n .filter(function (item) {\n return item.querySelector(selector) instanceof HTMLElement ||\n (item.shadowRoot && item.shadowRoot.querySelector(selector) instanceof HTMLElement);\n })\n // replace item with handle in array\n .map(function (item) {\n return item.querySelector(selector) || (item.shadowRoot && item.shadowRoot.querySelector(selector));\n });\n});\n\n/**\n * @param {Event} event\n * @returns {HTMLElement}\n */\nvar getEventTarget = (function (event) {\n return (event.composedPath && event.composedPath()[0]) || event.target;\n});\n\n/* eslint-env browser */\n/**\n * defaultDragImage returns the current item as dragged image\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {object} elementOffset - an object with the offsets top, left, right & bottom\n * @param {Event} event - the original drag event object\n * @return {object} with element, posX and posY properties\n */\nvar defaultDragImage = function (draggedElement, elementOffset, event) {\n return {\n element: draggedElement,\n posX: event.pageX - elementOffset.left,\n posY: event.pageY - elementOffset.top\n };\n};\n/**\n * attaches an element as the drag image to an event\n * @param {Event} event - the original drag event object\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {Function} customDragImage - function to create a custom dragImage\n * @return void\n */\nvar setDragImage = (function (event, draggedElement, customDragImage) {\n // check if event is provided\n if (!(event instanceof Event)) {\n throw new Error('setDragImage requires a DragEvent as the first argument.');\n }\n // check if draggedElement is provided\n if (!(draggedElement instanceof HTMLElement)) {\n throw new Error('setDragImage requires the dragged element as the second argument.');\n }\n // set default function of none provided\n if (!customDragImage) {\n customDragImage = defaultDragImage;\n }\n // check if setDragImage method is available\n if (event.dataTransfer && event.dataTransfer.setDragImage) {\n // get the elements offset\n var elementOffset = _offset(draggedElement);\n // get the dragImage\n var dragImage = customDragImage(draggedElement, elementOffset, event);\n // check if custom function returns correct values\n if (!(dragImage.element instanceof HTMLElement) || typeof dragImage.posX !== 'number' || typeof dragImage.posY !== 'number') {\n throw new Error('The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].');\n }\n // needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'copyMove';\n // Firefox requires it to use the event target's id for the data\n event.dataTransfer.setData('text/plain', getEventTarget(event).id);\n // set the drag image on the event\n event.dataTransfer.setDragImage(dragImage.element, dragImage.posX, dragImage.posY);\n }\n});\n\n/**\n * Check if curList accepts items from destList\n * @param {sortable} destination the container an item is move to\n * @param {sortable} origin the container an item comes from\n */\nvar _listsConnected = (function (destination, origin) {\n // check if valid sortable\n if (destination.isSortable === true) {\n var acceptFrom = store(destination).getConfig('acceptFrom');\n // check if acceptFrom is valid\n if (acceptFrom !== null && acceptFrom !== false && typeof acceptFrom !== 'string') {\n throw new Error('HTML5Sortable: Wrong argument, \"acceptFrom\" must be \"null\", \"false\", or a valid selector string.');\n }\n if (acceptFrom !== null) {\n return acceptFrom !== false && acceptFrom.split(',').filter(function (sel) {\n return sel.length > 0 && origin.matches(sel);\n }).length > 0;\n }\n // drop in same list\n if (destination === origin) {\n return true;\n }\n // check if lists are connected with connectWith\n if (store(destination).getConfig('connectWith') !== undefined && store(destination).getConfig('connectWith') !== null) {\n return store(destination).getConfig('connectWith') === store(origin).getConfig('connectWith');\n }\n }\n return false;\n});\n\n/**\n * default configurations\n */\nvar defaultConfiguration = {\n items: null,\n // deprecated\n connectWith: null,\n // deprecated\n disableIEFix: null,\n acceptFrom: null,\n copy: false,\n placeholder: null,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n dropTargetContainerClass: false,\n debounce: 0,\n throttleTime: 100,\n maxItems: 0,\n itemSerializer: undefined,\n containerSerializer: undefined,\n customDragImage: null,\n orientation: 'vertical'\n};\n\n/**\n * make sure a function is only called once within the given amount of time\n * @param {Function} fn the function to throttle\n * @param {number} threshold time limit for throttling\n */\n// must use function to keep this context\nfunction _throttle (fn, threshold) {\n var _this = this;\n if (threshold === void 0) { threshold = 250; }\n // check function\n if (typeof fn !== 'function') {\n throw new Error('You must provide a function as the first argument for throttle.');\n }\n // check threshold\n if (typeof threshold !== 'number') {\n throw new Error('You must provide a number as the second argument for throttle.');\n }\n var lastEventTimestamp = null;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var now = Date.now();\n if (lastEventTimestamp === null || now - lastEventTimestamp >= threshold) {\n lastEventTimestamp = now;\n fn.apply(_this, args);\n }\n };\n}\n\n/* eslint-env browser */\n/**\n * enable or disable hoverClass on mouseenter/leave if container Items\n * @param {sortable} sortableContainer a valid sortableContainer\n * @param {boolean} enable enable or disable event\n */\n// export default (sortableContainer: sortable, enable: boolean) => {\nvar enableHoverClass = (function (sortableContainer, enable) {\n if (typeof store(sortableContainer).getConfig('hoverClass') === 'string') {\n var hoverClasses_1 = store(sortableContainer).getConfig('hoverClass').split(' ');\n // add class on hover\n if (enable === true) {\n addEventListener(sortableContainer, 'mousemove', _throttle(function (event) {\n // check of no mouse button was pressed when mousemove started == no drag\n if (event.buttons === 0) {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a, _b;\n if (item !== event.target) {\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n }\n else {\n (_b = item.classList).add.apply(_b, hoverClasses_1);\n }\n });\n }\n }, store(sortableContainer).getConfig('throttleTime')));\n // remove class on leave\n addEventListener(sortableContainer, 'mouseleave', function () {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a;\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n });\n });\n // remove events\n }\n else {\n removeEventListener(sortableContainer, 'mousemove');\n removeEventListener(sortableContainer, 'mouseleave');\n }\n }\n});\n\n/* eslint-env browser */\n/*\n * variables global to the plugin\n */\nvar dragging;\nvar draggingHeight;\nvar draggingWidth;\n/*\n * Keeps track of the initialy selected list, where 'dragstart' event was triggered\n * It allows us to move the data in between individual Sortable List instances\n */\n// Origin List - data from before any item was changed\nvar originContainer;\nvar originIndex;\nvar originElementIndex;\nvar originItemsBeforeUpdate;\n// Previous Sortable Container - we dispatch as sortenter event when a\n// dragged item enters a sortableContainer for the first time\nvar previousContainer;\n// Destination List - data from before any item was changed\nvar destinationItemsBeforeUpdate;\n/**\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n removeEventListener(items, 'dragstart');\n removeEventListener(items, 'dragend');\n removeEventListener(items, 'dragover');\n removeEventListener(items, 'dragenter');\n removeEventListener(items, 'drop');\n removeEventListener(items, 'mouseenter');\n removeEventListener(items, 'mouseleave');\n};\n// Remove container events\nvar _removeContainerEvents = function (originContainer, previousContainer) {\n if (originContainer) {\n removeEventListener(originContainer, 'dragleave');\n }\n if (previousContainer && (previousContainer !== originContainer)) {\n removeEventListener(previousContainer, 'dragleave');\n }\n};\n/**\n * _getDragging returns the current element to drag or\n * a copy of the element.\n * Is Copy Active for sortable\n * @param {HTMLElement} draggedItem - the item that the user drags\n * @param {HTMLElement} sortable a single sortable\n */\nvar _getDragging = function (draggedItem, sortable) {\n var ditem = draggedItem;\n if (store(sortable).getConfig('copy') === true) {\n ditem = draggedItem.cloneNode(true);\n addAttribute(ditem, 'aria-copied', 'true');\n draggedItem.parentElement.appendChild(ditem);\n ditem.style.display = 'none';\n ditem.oldDisplay = draggedItem.style.display;\n }\n return ditem;\n};\n/**\n * Remove data from sortable\n * @param {HTMLElement} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n removeData(sortable);\n removeAttribute(sortable, 'aria-dropeffect');\n};\n/**\n * Remove data from items\n * @param {Array|HTMLElement} items\n */\nvar _removeItemData = function (items) {\n removeAttribute(items, 'aria-grabbed');\n removeAttribute(items, 'aria-copied');\n removeAttribute(items, 'draggable');\n removeAttribute(items, 'role');\n};\n/**\n * find sortable from element. travels up parent element until found or null.\n * @param {HTMLElement} element a single sortable\n * @param {Event} event - the current event. We need to pass it to be able to\n * find Sortable whith shadowRoot (document fragment has no parent)\n */\nfunction findSortable(element, event) {\n if (event.composedPath) {\n return event.composedPath().find(function (el) { return el.isSortable; });\n }\n while (element.isSortable !== true) {\n element = element.parentElement;\n }\n return element;\n}\n/**\n * Dragging event is on the sortable element. finds the top child that\n * contains the element.\n * @param {HTMLElement} sortableElement a single sortable\n * @param {HTMLElement} element is that being dragged\n */\nfunction findDragElement(sortableElement, element) {\n var options = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, options.items);\n var itemlist = items.filter(function (ele) {\n return ele.contains(element) || (ele.shadowRoot && ele.shadowRoot.contains(element));\n });\n return itemlist.length > 0 ? itemlist[0] : element;\n}\n/**\n * Destroy the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts') || {};\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n // remove event handlers & data from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'dragstart');\n removeEventListener(sortableElement, 'dragend');\n removeEventListener(sortableElement, 'drop');\n // remove event data from sortable\n _removeSortableData(sortableElement);\n // remove event handlers & data from items\n removeEventListener(handles, 'mousedown');\n _removeItemEvents(items);\n _removeItemData(items);\n _removeContainerEvents(originContainer, previousContainer);\n // clear sortable flag\n sortableElement.isSortable = false;\n};\n/**\n * Enable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'move');\n addData(sortableElement, '_disabled', 'false');\n addAttribute(handles, 'draggable', 'true');\n // @todo: remove this fix\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n if (opts.disableIEFix === false) {\n var spanEl = (document || window.document).createElement('span');\n if (typeof spanEl.dragDrop === 'function') {\n addEventListener(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop();\n }\n else {\n var parent = this.parentElement;\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement;\n }\n parent.dragDrop();\n }\n });\n }\n }\n};\n/**\n * Disable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'none');\n addData(sortableElement, '_disabled', 'true');\n addAttribute(handles, 'draggable', 'false');\n removeEventListener(handles, 'mousedown');\n};\n/**\n * Reload the sortable\n * @param {HTMLElement} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addData(sortableElement, '_disabled', 'false');\n // remove event handlers from items\n _removeItemEvents(items);\n _removeContainerEvents(originContainer, previousContainer);\n removeEventListener(handles, 'mousedown');\n // remove event handlers from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'drop');\n};\n/**\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nfunction sortable(sortableElements, options) {\n // get method string to see if a method is called\n var method = String(options);\n options = options || {};\n // check if the user provided a selector instead of an element\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements);\n }\n // if the user provided an element, return it in an array to keep the return value consistant\n if (sortableElements instanceof HTMLElement) {\n sortableElements = [sortableElements];\n }\n sortableElements = Array.prototype.slice.call(sortableElements);\n if (/serialize/.test(method)) {\n return sortableElements.map(function (sortableContainer) {\n var opts = addData(sortableContainer, 'opts');\n return _serialize(sortableContainer, opts.itemSerializer, opts.containerSerializer);\n });\n }\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n return sortable[method](sortableElement);\n }\n // log deprecation\n ['connectWith', 'disableIEFix'].forEach(function (configKey) {\n if (Object.prototype.hasOwnProperty.call(options, configKey) && options[configKey] !== null) {\n console.warn(\"HTML5Sortable: You are using the deprecated configuration \\\"\" + configKey + \"\\\". This will be removed in an upcoming version, make sure to migrate to the new options when updating.\");\n }\n });\n // merge options with default options\n options = Object.assign({}, defaultConfiguration, store(sortableElement).config, options);\n // init data store for sortable\n store(sortableElement).config = options;\n // set options on sortable\n addData(sortableElement, 'opts', options);\n // property to define as sortable\n sortableElement.isSortable = true;\n // reset sortable\n _reloadSortable(sortableElement);\n // initialize\n var listItems = _filter(sortableElement.children, options.items);\n // create element if user defined a placeholder element as a string\n var customPlaceholder;\n if (options.placeholder !== null && options.placeholder !== undefined) {\n var tempContainer = document.createElement(sortableElement.tagName);\n if (options.placeholder instanceof HTMLElement) {\n tempContainer.appendChild(options.placeholder);\n }\n else {\n tempContainer.innerHTML = options.placeholder;\n }\n customPlaceholder = tempContainer.children[0];\n }\n // add placeholder\n store(sortableElement).placeholder = _makePlaceholder(sortableElement, customPlaceholder, options.placeholderClass);\n addData(sortableElement, 'items', options.items);\n if (options.acceptFrom) {\n addData(sortableElement, 'acceptFrom', options.acceptFrom);\n }\n else if (options.connectWith) {\n addData(sortableElement, 'connectWith', options.connectWith);\n }\n _enableSortable(sortableElement);\n addAttribute(listItems, 'role', 'option');\n addAttribute(listItems, 'aria-grabbed', 'false');\n // enable hover class\n enableHoverClass(sortableElement, true);\n /*\n Handle drag events on draggable items\n Handle is set at the sortableElement level as it will bubble up\n from the item\n */\n addEventListener(sortableElement, 'dragstart', function (e) {\n // ignore dragstart events\n var target = getEventTarget(e);\n if (target.isSortable === true) {\n return;\n }\n e.stopImmediatePropagation();\n if ((options.handle && !target.matches(options.handle)) || target.getAttribute('draggable') === 'false') {\n return;\n }\n var sortableContainer = findSortable(target, e);\n var dragItem = findDragElement(sortableContainer, target);\n // grab values\n originItemsBeforeUpdate = _filter(sortableContainer.children, options.items);\n originIndex = originItemsBeforeUpdate.indexOf(dragItem);\n originElementIndex = _index(dragItem, sortableContainer.children);\n originContainer = sortableContainer;\n // add transparent clone or other ghost to cursor\n setDragImage(e, dragItem, options.customDragImage);\n // cache selsection & add attr for dragging\n draggingHeight = _getElementHeight(dragItem);\n draggingWidth = _getElementWidth(dragItem);\n dragItem.classList.add(options.draggingClass);\n dragging = _getDragging(dragItem, sortableContainer);\n addAttribute(dragging, 'aria-grabbed', 'true');\n // dispatch sortstart event on each element in group\n sortableContainer.dispatchEvent(new CustomEvent('sortstart', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n });\n /*\n We are capturing targetSortable before modifications with 'dragenter' event\n */\n addEventListener(sortableElement, 'dragenter', function (e) {\n var target = getEventTarget(e);\n var sortableContainer = findSortable(target, e);\n if (sortableContainer && sortableContainer !== previousContainer) {\n destinationItemsBeforeUpdate = _filter(sortableContainer.children, addData(sortableContainer, 'items'))\n .filter(function (item) { return item !== store(sortableElement).placeholder; });\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.add(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortenter', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n destination: {\n container: sortableContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate\n },\n item: dragging,\n originalTarget: target\n }\n }));\n addEventListener(sortableContainer, 'dragleave', function (e) {\n // TODO: rename outTarget to be more self-explanatory\n // e.fromElement for very old browsers, similar to relatedTarget\n var outTarget = e.relatedTarget || e.fromElement;\n if (!e.currentTarget.contains(outTarget)) {\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.remove(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortleave', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: sortableContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n }\n });\n }\n previousContainer = sortableContainer;\n });\n /*\n * Dragend Event - https://developer.mozilla.org/en-US/docs/Web/Events/dragend\n * Fires each time dragEvent end, or ESC pressed\n * We are using it to clean up any draggable elements and placeholders\n */\n addEventListener(sortableElement, 'dragend', function (e) {\n if (!dragging) {\n return;\n }\n dragging.classList.remove(options.draggingClass);\n addAttribute(dragging, 'aria-grabbed', 'false');\n if (dragging.getAttribute('aria-copied') === 'true' && addData(dragging, 'dropped') !== 'true') {\n dragging.remove();\n }\n dragging.style.display = dragging.oldDisplay;\n delete dragging.oldDisplay;\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) { return data.placeholder; })\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n .filter(isInDom)[0];\n if (visiblePlaceholder) {\n visiblePlaceholder.remove();\n }\n // dispatch sortstart event on each element in group\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n previousContainer = null;\n dragging = null;\n draggingHeight = null;\n draggingWidth = null;\n });\n /*\n * Drop Event - https://developer.mozilla.org/en-US/docs/Web/Events/drop\n * Fires when valid drop target area is hit\n */\n addEventListener(sortableElement, 'drop', function (e) {\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n addData(dragging, 'dropped', 'true');\n // get the one placeholder that is currently visible\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) {\n return data.placeholder;\n })\n // filter only HTMLElements\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n // filter only elements in DOM\n .filter(isInDom)[0];\n // attach element after placeholder\n insertAfter(visiblePlaceholder, dragging);\n // remove placeholder from dom\n visiblePlaceholder.remove();\n /*\n * Fires Custom Event - 'sortstop'\n */\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n var placeholder = store(sortableElement).placeholder;\n var originItems = _filter(originContainer.children, options.items)\n .filter(function (item) { return item !== placeholder; });\n var destinationContainer = this.isSortable === true ? this : this.parentElement;\n var destinationItems = _filter(destinationContainer.children, addData(destinationContainer, 'items'))\n .filter(function (item) { return item !== placeholder; });\n var destinationElementIndex = _index(dragging, Array.from(dragging.parentElement.children)\n .filter(function (item) { return item !== placeholder; }));\n var destinationIndex = _index(dragging, destinationItems);\n if (options.dropTargetContainerClass) {\n destinationContainer.classList.remove(options.dropTargetContainerClass);\n }\n /*\n * When a list item changed container lists or index within a list\n * Fires Custom Event - 'sortupdate'\n */\n if (originElementIndex !== destinationElementIndex || originContainer !== destinationContainer) {\n sortableElement.dispatchEvent(new CustomEvent('sortupdate', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer,\n itemsBeforeUpdate: originItemsBeforeUpdate,\n items: originItems\n },\n destination: {\n index: destinationIndex,\n elementIndex: destinationElementIndex,\n container: destinationContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate,\n items: destinationItems\n },\n item: dragging\n }\n }));\n }\n });\n var debouncedDragOverEnter = _debounce(function (sortableElement, element, pageX, pageY) {\n if (!dragging) {\n return;\n }\n // set placeholder height if forcePlaceholderSize option is set\n if (options.forcePlaceholderSize) {\n store(sortableElement).placeholder.style.height = draggingHeight + 'px';\n store(sortableElement).placeholder.style.width = draggingWidth + 'px';\n }\n // if element the draggedItem is dragged onto is within the array of all elements in list\n // (not only items, but also disabled, etc.)\n if (Array.from(sortableElement.children).indexOf(element) > -1) {\n var thisHeight = _getElementHeight(element);\n var thisWidth = _getElementWidth(element);\n var placeholderIndex = _index(store(sortableElement).placeholder, element.parentElement.children);\n var thisIndex = _index(element, element.parentElement.children);\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight || thisWidth > draggingWidth) {\n // Dead zone?\n var deadZoneVertical = thisHeight - draggingHeight;\n var deadZoneHorizontal = thisWidth - draggingWidth;\n var offsetTop = _offset(element).top;\n var offsetLeft = _offset(element).left;\n if (placeholderIndex < thisIndex &&\n ((options.orientation === 'vertical' && pageY < offsetTop) ||\n (options.orientation === 'horizontal' && pageX < offsetLeft))) {\n return;\n }\n if (placeholderIndex > thisIndex &&\n ((options.orientation === 'vertical' && pageY > offsetTop + thisHeight - deadZoneVertical) ||\n (options.orientation === 'horizontal' && pageX > offsetLeft + thisWidth - deadZoneHorizontal))) {\n return;\n }\n }\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display;\n }\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none';\n }\n // To avoid flicker, determine where to position the placeholder\n // based on where the mouse pointer is relative to the elements\n // vertical center.\n var placeAfter = false;\n try {\n var elementMiddleVertical = _offset(element).top + element.offsetHeight / 2;\n var elementMiddleHorizontal = _offset(element).left + element.offsetWidth / 2;\n placeAfter = (options.orientation === 'vertical' && (pageY >= elementMiddleVertical)) ||\n (options.orientation === 'horizontal' && (pageX >= elementMiddleHorizontal));\n }\n catch (e) {\n placeAfter = placeholderIndex < thisIndex;\n }\n if (placeAfter) {\n insertAfter(element, store(sortableElement).placeholder);\n }\n else {\n insertBefore(element, store(sortableElement).placeholder);\n }\n // get placeholders from all stores & remove all but current one\n Array.from(stores.values())\n // remove empty values\n .filter(function (data) { return data.placeholder !== undefined; })\n // foreach placeholder in array if outside of current sorableContainer -> remove from DOM\n .forEach(function (data) {\n if (data.placeholder !== store(sortableElement).placeholder) {\n data.placeholder.remove();\n }\n });\n }\n else {\n // get all placeholders from store\n var placeholders = Array.from(stores.values())\n .filter(function (data) { return data.placeholder !== undefined; })\n .map(function (data) {\n return data.placeholder;\n });\n // check if element is not in placeholders\n if (placeholders.indexOf(element) === -1 && sortableElement === element && !_filter(element.children, options.items).length) {\n placeholders.forEach(function (element) { return element.remove(); });\n element.appendChild(store(sortableElement).placeholder);\n }\n }\n }, options.debounce);\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n var element = e.target;\n var sortableElement = element.isSortable === true ? element : findSortable(element, e);\n element = findDragElement(sortableElement, element);\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || addData(sortableElement, '_disabled') === 'true') {\n return;\n }\n var options = addData(sortableElement, 'opts');\n if (parseInt(options.maxItems) && _filter(sortableElement.children, addData(sortableElement, 'items')).length >= parseInt(options.maxItems) && dragging.parentElement !== sortableElement) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = store(sortableElement).getConfig('copy') === true ? 'copy' : 'move';\n debouncedDragOverEnter(sortableElement, element, e.pageX, e.pageY);\n };\n addEventListener(listItems.concat(sortableElement), 'dragover', onDragOverEnter);\n addEventListener(listItems.concat(sortableElement), 'dragenter', onDragOverEnter);\n });\n return sortableElements;\n}\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement);\n};\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement);\n};\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement);\n};\n/* START.TESTS_ONLY */\nsortable.__testing = {\n // add internal methods here for testing purposes\n _data: addData,\n _removeItemEvents: _removeItemEvents,\n _removeItemData: _removeItemData,\n _removeSortableData: _removeSortableData,\n _removeContainerEvents: _removeContainerEvents\n};\n\nexport default sortable;\n","import app from 'flarum/app';\nimport Component from 'flarum/Component';\nimport icon from 'flarum/helpers/icon';\n\n/* global m */\n\nexport default class SelectFieldOptionEditor extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.newOption = '';\n }\n\n view() {\n return m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.options')),\n m(\n 'table',\n m(\n 'tbody',\n this.options().map((option, optionIndex) =>\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n oninput: (event) => {\n this.updateOption(optionIndex, event.target.value);\n },\n value: option,\n })\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, -1);\n },\n },\n icon('fas fa-chevron-up')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, 1);\n },\n },\n icon('fas fa-chevron-down')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--danger',\n {\n onclick: () => {\n this.deleteOption(optionIndex);\n },\n },\n icon('fas fa-times')\n )\n ),\n ])\n )\n )\n ),\n m('.helpText', app.translator.trans('fof-masquerade.admin.fields.option-comma-warning')),\n m(\n 'table',\n m('tbody'),\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n onchange: (event) => {\n this.newOption = event.target.value;\n },\n value: this.newOption,\n placeholder: app.translator.trans('fof-masquerade.admin.fields.option-new'),\n })\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--primary',\n {\n onclick: () => {\n this.addOption();\n },\n },\n icon('fas fa-plus')\n )\n ),\n ])\n ),\n ]);\n }\n\n updateRules(options) {\n // We ignore other existing rules, they would probably be leftovers from another field type when changing types\n this.attrs.onchange('in:' + options.join(','));\n }\n\n options() {\n const rules = this.attrs.value.split('|');\n\n let options = [];\n\n rules.forEach((rule) => {\n const parts = rule.split(':', 2);\n\n if (parts[0] === 'in') {\n options = parts[1].split(',');\n }\n });\n\n return options;\n }\n\n updateOption(index, value) {\n let options = this.options();\n\n options[index] = value;\n\n this.updateRules(options);\n }\n\n moveOption(index, moveIndex) {\n let options = this.options();\n\n const newIndex = index + moveIndex;\n\n if (newIndex < 0 || newIndex > options.length - 1) {\n return;\n }\n\n const move = options.splice(index, 1);\n\n options.splice(newIndex, 0, move[0]);\n\n this.updateRules(options);\n }\n\n deleteOption(index) {\n let options = this.options();\n\n options.splice(index, 1);\n\n this.updateRules(options);\n }\n\n addOption() {\n if (this.newOption === '') {\n return;\n }\n\n let options = this.options();\n\n options.push(this.newOption);\n\n this.newOption = '';\n\n this.updateRules(options);\n }\n}\n","import sortable from 'html5sortable/dist/html5sortable.es.js';\n\nimport app from 'flarum/app';\nimport icon from 'flarum/helpers/icon';\nimport ExtensionPage from 'flarum/components/ExtensionPage';\nimport Select from 'flarum/components/Select';\nimport Switch from 'flarum/components/Switch';\nimport Button from 'flarum/components/Button';\nimport saveSettings from 'flarum/utils/saveSettings';\nimport withAttr from 'flarum/utils/withAttr';\nimport SelectFieldOptionEditor from './SelectFieldOptionEditor';\n\n/* global m, $ */\n\nexport default class MasqueradePage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.resetNew();\n this.loading = false;\n this.existing = [];\n this.loadExisting();\n this.enforceProfileCompletion = app.data.settings['masquerade.force-profile-completion'] === '1';\n }\n\n config() {\n sortable(this.element.querySelector('.js-sortable-fields'), {\n handle: 'legend',\n })[0].addEventListener('sortupdate', () => {\n const sorting = this.$('.js-sortable-fields > .Field')\n .map(function () {\n return $(this).data('id');\n })\n .get();\n\n this.updateSort(sorting);\n });\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.config();\n }\n\n onupdate() {\n this.config();\n }\n\n content() {\n return m(\n '.ExtensionPage-settings.ProfileConfigurePane',\n m('.container', [\n m('h2', app.translator.trans('fof-masquerade.admin.general-options')),\n m(\n '.Form-group',\n Switch.component(\n {\n state: this.enforceProfileCompletion,\n onchange: (value) => {\n const saveValue = value ? '1' : '0';\n saveSettings({\n 'masquerade.force-profile-completion': saveValue,\n });\n this.enforceProfileCompletion = saveValue;\n },\n },\n app.translator.trans('fof-masquerade.admin.fields.force-user-to-completion')\n )\n ),\n m('h2', app.translator.trans('fof-masquerade.admin.fields.title')),\n m(\n 'form.js-sortable-fields',\n this.existing.map((field) => {\n // Build array of fields to show.\n return this.addField(field);\n })\n ),\n this.addField(this.new),\n ])\n );\n }\n\n /**\n * Creates a field in the DOM.\n *\n * @param field\n * @returns {*}\n */\n addField(field) {\n let exists = field.id();\n\n return m(\n 'fieldset.Field',\n {\n 'data-id': field.id(),\n key: field.id(),\n },\n [\n m('legend', [\n exists\n ? [\n Button.component({\n className: 'Button Button--icon Button--danger',\n icon: 'fas fa-trash',\n onclick: this.deleteField.bind(this, field),\n }),\n ' ',\n ]\n : null,\n m(\n 'span.Field-toggle',\n {\n onclick: (e) => this.toggleField(e),\n },\n [\n app.translator.trans('fof-masquerade.admin.fields.' + (exists ? 'edit' : 'add'), {\n field: field.name(),\n }),\n ' ',\n icon('fas fa-caret-down'),\n ]\n ),\n ]),\n m('.Field-body', [\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.name')),\n m('input.FormControl', {\n value: field.name(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'name', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.name-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.description')),\n m('input.FormControl', {\n value: field.description(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'description', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.description-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.icon')),\n m('input.FormControl', {\n value: field.icon(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'icon', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.icon-help', {\n a: ,\n })\n ),\n ]),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.on_bio(),\n onchange: this.updateExistingFieldInput.bind(this, 'on_bio', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.on_bio')\n )\n ),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.required(),\n onchange: this.updateExistingFieldInput.bind(this, 'required', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.required')\n )\n ),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.type')),\n Select.component({\n onchange: (value) => {\n if (value === 'null') {\n value = null;\n }\n\n this.updateExistingFieldInput('type', field, value);\n },\n options: this.availableTypes(),\n value: field.type(),\n }),\n ]),\n field.type() === 'select'\n ? SelectFieldOptionEditor.component({\n onchange: (value) => {\n this.updateExistingFieldInput('validation', field, value);\n },\n value: field.validation(),\n })\n : null,\n field.type() === null\n ? m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.validation')),\n m('input.FormControl', {\n value: field.validation(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'validation', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.validation-help', {\n a: ,\n })\n ),\n ])\n : null,\n m(\n '.Form-group',\n m('.ButtonGroup', [\n Button.component(\n {\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.readyToAdd(field),\n onclick: exists ? this.updateExistingField.bind(this, field) : this.submitAddField.bind(this),\n },\n app.translator.trans('fof-masquerade.admin.buttons.' + (exists ? 'edit' : 'add') + '-field')\n ),\n exists\n ? Button.component(\n {\n className: 'Button Button--danger',\n loading: this.loading,\n onclick: this.deleteField.bind(this, field),\n },\n app.translator.trans('fof-masquerade.admin.buttons.delete-field')\n )\n : null,\n ])\n ),\n ]),\n ]\n );\n }\n\n updateExistingFieldInput(what, field, value) {\n field.pushAttributes({\n [what]: value,\n });\n }\n\n /**\n * Sorts the fields.\n *\n * @param {Array} sorting\n */\n updateSort(sorting) {\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields/order',\n body: {\n sort: sorting,\n },\n }).then(this.requestSuccess.bind(this));\n }\n\n /**\n * Opens and closes field configuration sets.\n *\n * @param e\n */\n toggleField(e) {\n $(e.target).parents('.Field').toggleClass('active');\n }\n\n /**\n * Deletes a field configuration set.\n *\n * @param field\n */\n deleteField(field) {\n field.delete().then(this.requestSuccess.bind(this));\n }\n\n /**\n * Saves the settings to the database and redraw the page\n *\n * @param e\n */\n submitAddField(e) {\n e.preventDefault();\n\n this.new\n .save(this.new.data.attributes)\n .then(this.requestSuccess.bind(this))\n .then(() => {\n this.resetNew();\n });\n\n m.redraw();\n }\n\n /**\n * Updates the value of one field.\n *\n * @param field\n */\n updateExistingField(field) {\n if (!field.id()) return;\n\n field.save(field.data.attributes).then(this.requestSuccess.bind(this));\n }\n\n /**\n * Parses result to update DOM.\n */\n requestSuccess() {\n this.existing = app.store.all('masquerade-field');\n\n // Update order in case the store order doesn't reflect the true ordering\n this.existing.sort((a, b) => {\n if (a.sort() < b.sort()) return -1;\n if (a.sort() > b.sort()) return 1;\n return 0;\n });\n\n this.loading = false;\n m.redraw();\n }\n\n /**\n * Retrieves list of fields.\n */\n loadExisting() {\n this.loading = true;\n\n return app\n .request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields',\n })\n .then((result) => {\n app.store.pushPayload(result);\n\n this.requestSuccess();\n });\n }\n\n /**\n * Resets the new field.\n */\n resetNew() {\n this.new = app.store.createRecord('masquerade-field', {\n attributes: {\n name: '',\n description: '',\n prefix: '',\n icon: '',\n required: false,\n on_bio: false,\n type: null,\n validation: '',\n },\n });\n }\n\n /**\n * Checks whether creation field is completed.\n *\n * @returns boolean\n */\n readyToAdd(field) {\n if (field.name()) {\n return true;\n }\n\n return false;\n }\n\n /**\n * List of field types availables\n * @returns {Array}\n */\n availableTypes() {\n return {\n url: app.translator.trans('fof-masquerade.admin.types.url'),\n email: app.translator.trans('fof-masquerade.admin.types.email'),\n boolean: app.translator.trans('fof-masquerade.admin.types.boolean'),\n select: app.translator.trans('fof-masquerade.admin.types.select'),\n null: app.translator.trans('fof-masquerade.admin.types.advanced'),\n };\n }\n}\n","import app from 'flarum/app';\nimport Field from './../lib/models/Field';\nimport MasqueradePage from './components/MasqueradePage';\n\napp.initializers.add('fof-masquerade', () => {\n app.store.models['masquerade-field'] = Field;\n\n app.extensionData\n .for('fof-masquerade')\n .registerPage(MasqueradePage)\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.view-profile'),\n permission: 'fof.masquerade.view-profile',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.have-profile'),\n permission: 'fof.masquerade.have-profile',\n },\n 'start'\n );\n});\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@fof/masquerade/webpack/bootstrap","webpack://@fof/masquerade/external \"flarum.core.compat['app']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/Model']\"","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/masquerade/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/components/Button']\"","webpack://@fof/masquerade/./src/lib/models/Field.js","webpack://@fof/masquerade/external \"flarum.core.compat['common/components/Select']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/utils/withAttr']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/masquerade/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/masquerade/external \"flarum.core.compat['admin/utils/saveSettings']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/Component']\"","webpack://@fof/masquerade/./node_modules/html5sortable/dist/html5sortable.es.js","webpack://@fof/masquerade/./src/admin/components/SelectFieldOptionEditor.js","webpack://@fof/masquerade/./src/admin/components/MasqueradePage.js","webpack://@fof/masquerade/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_assertThisInitialized","self","ReferenceError","_defineProperty","obj","configurable","writable","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","Field","Model","attribute","transformDate","hasOne","apiEndpoint","this","exists","data","id","addData","element","undefined","h5s","_filter","nodes","selector","NodeList","HTMLCollection","Array","Error","from","filter","item","nodeType","matches","stores","Map","Store","_config","_placeholder","_data","config","forEach","set","mergedConfig","assign","entries","setConfig","has","getConfig","placeholder","HTMLElement","setData","getData","deleteData","delete","store","sortableElement","addEventListener","eventName","callback","length","removeEventListener","addAttribute","setAttribute","removeAttribute","_offset","parentElement","getClientRects","rect","left","window","pageXOffset","right","top","pageYOffset","bottom","_index","elementList","indexOf","isInDom","parentNode","insertNode","referenceNode","newElement","position","insertBefore","nextElementSibling","insertAfter","target","_getElementHeight","style","getComputedStyle","getPropertyValue","parseInt","map","int","isNaN","reduce","sum","_getElementWidth","_getHandles","items","querySelector","shadowRoot","getEventTarget","event","composedPath","defaultDragImage","draggedElement","elementOffset","posX","pageX","posY","pageY","_listsConnected","destination","origin","isSortable","acceptFrom","split","sel","defaultConfiguration","connectWith","disableIEFix","copy","placeholderClass","draggingClass","hoverClass","dropTargetContainerClass","debounce","throttleTime","maxItems","itemSerializer","containerSerializer","customDragImage","orientation","dragging","draggingHeight","draggingWidth","originContainer","originIndex","originElementIndex","originItemsBeforeUpdate","previousContainer","destinationItemsBeforeUpdate","enableHoverClass","sortableContainer","enable","hoverClasses_1","fn","threshold","_this","lastEventTimestamp","args","_i","arguments","now","Date","apply","_throttle","buttons","children","_a","_b","classList","remove","add","_removeItemEvents","_removeContainerEvents","_removeSortableData","sortable","_removeItemData","findSortable","find","el","findDragElement","options","itemlist","ele","contains","_enableSortable","opts","handles","handle","document","createElement","dragDrop","parent","sortableElements","method","String","querySelectorAll","slice","test","customItemSerializer","customContainerSerializer","serializedItem","serializedContainer","serializedItems","node","html","outerHTML","index","container","itemCount","_serialize","configKey","console","warn","_reloadSortable","customPlaceholder","listItems","tempContainer","tagName","appendChild","innerHTML","includes","_makePlaceholder","e","stopImmediatePropagation","getAttribute","dragItem","Event","dataTransfer","setDragImage","dragImage","effectAllowed","draggedItem","ditem","cloneNode","display","oldDisplay","_getDragging","dispatchEvent","CustomEvent","detail","elementIndex","originalTarget","itemsBeforeUpdate","outTarget","relatedTarget","fromElement","currentTarget","visiblePlaceholder","values","preventDefault","stopPropagation","originItems","destinationContainer","destinationItems","destinationElementIndex","destinationIndex","func","wait","timeout","debouncedDragOverEnter","forcePlaceholderSize","height","width","thisHeight","thisWidth","placeholderIndex","thisIndex","deadZoneVertical","deadZoneHorizontal","offsetTop","offsetLeft","placeAfter","elementMiddleVertical","offsetHeight","elementMiddleHorizontal","offsetWidth","placeholders","clearTimeout","setTimeout","onDragOverEnter","dropEffect","concat","destroy","_destroySortable","disable","_disableSortable","__testing","SelectFieldOptionEditor","oninit","vnode","newOption","view","app","translator","trans","option","optionIndex","oninput","updateOption","onclick","moveOption","icon","deleteOption","onchange","addOption","updateRules","attrs","join","rules","rule","parts","moveIndex","newIndex","move","splice","push","Component","MasqueradePage","resetNew","loading","existing","loadExisting","enforceProfileCompletion","settings","sorting","$","updateSort","oncreate","onupdate","content","Switch","component","state","saveValue","saveSettings","field","addField","Button","className","deleteField","toggleField","withAttr","updateExistingFieldInput","description","a","href","on_bio","required","Select","availableTypes","type","validation","disabled","readyToAdd","updateExistingField","submitAddField","what","pushAttributes","request","url","forum","body","sort","then","requestSuccess","parents","toggleClass","save","attributes","redraw","all","b","result","pushPayload","createRecord","prefix","email","boolean","select","null","ExtensionPage","initializers","models","extensionData","registerPage","registerPermission","label","permission","allowGuest"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,M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e,WAGX,OAFA/S,KAAK6S,SAAU,EAER3B,IACFkE,QAAQ,CACLrK,OAAQ,MACRsK,IAAKnE,IAAIoE,MAAM1V,UAAU,UAAY,uBAExC6V,MAAK,SAACS,GACHhF,IAAIzO,MAAM0T,YAAYD,GAEtB,EAAKR,qB,EAOjB9C,SAAA,WACI5S,KAAA,IAAWkR,IAAIzO,MAAM2T,aAAa,mBAAoB,CAClDN,WAAY,CACR9Y,KAAM,GACNqX,YAAa,GACbgC,OAAQ,GACR1E,KAAM,GACN8C,UAAU,EACVD,QAAQ,EACRI,KAAM,KACNC,WAAY,O,EAUxBE,WAAA,SAAWlB,GACP,QAAIA,EAAM7W,Q,EAWd2X,eAAA,WACI,MAAO,CACHU,IAAKnE,IAAIC,WAAWC,MAAM,kCAC1BkF,MAAOpF,IAAIC,WAAWC,MAAM,oCAC5BmF,QAASrF,IAAIC,WAAWC,MAAM,sCAC9BoF,OAAQtF,IAAIC,WAAWC,MAAM,qCAC7BqF,KAAMvF,IAAIC,WAAWC,MAAM,yC,GAlXKsF,KCV5CxF,IAAIyF,aAAanN,IAAI,kBAAkB,WACnC0H,IAAIzO,MAAMmU,OAAO,oBAAsBlX,IAEvCwR,IAAI2F,cAAJ,IACS,kBACJC,aAAanE,IACboE,mBACG,CACIpF,KAAM,iBACNqF,MAAO9F,IAAIC,WAAWC,MAAM,iDAC5B6F,WAAY,8BACZC,YAAY,GAEhB,QAEHH,mBACG,CACIpF,KAAM,iBACNqF,MAAO9F,IAAIC,WAAWC,MAAM,iDAC5B6F,WAAY,+BAEhB","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['common/Model'];","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _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}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/components/Button'];","import Model from 'flarum/common/Model';\n\nexport default class Field extends Model {\n name = Model.attribute('name');\n description = Model.attribute('description');\n type = Model.attribute('type');\n validation = Model.attribute('validation');\n required = Model.attribute('required');\n prefix = Model.attribute('prefix');\n icon = Model.attribute('icon');\n sort = Model.attribute('sort');\n deleted_at = Model.attribute('deleted_at', Model.transformDate);\n answer = Model.hasOne('answer');\n on_bio = Model.attribute('on_bio');\n\n apiEndpoint() {\n return '/masquerade/fields' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","module.exports = flarum.core.compat['common/components/Select'];","module.exports = flarum.core.compat['common/utils/withAttr'];","module.exports = flarum.core.compat['common/components/Switch'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['admin/utils/saveSettings'];","module.exports = flarum.core.compat['common/Component'];","/*\n * HTML5Sortable package\n * https://github.com/lukasoppermann/html5sortable\n *\n * Maintained by Lukas Oppermann \n *\n * Released under the MIT license.\n */\n/**\n * Get or set data on element\n * @param {HTMLElement} element\n * @param {string} key\n * @param {any} value\n * @return {*}\n */\nfunction addData(element, key, value) {\n if (value === undefined) {\n return element && element.h5s && element.h5s.data && element.h5s.data[key];\n }\n else {\n element.h5s = element.h5s || {};\n element.h5s.data = element.h5s.data || {};\n element.h5s.data[key] = value;\n }\n}\n/**\n * Remove data from element\n * @param {HTMLElement} element\n */\nfunction removeData(element) {\n if (element.h5s) {\n delete element.h5s.data;\n }\n}\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {NodeList|HTMLCollection|Array} nodes\n * @param {String} selector\n * @returns {Array}\n */\nvar _filter = (function (nodes, selector) {\n if (!(nodes instanceof NodeList || nodes instanceof HTMLCollection || nodes instanceof Array)) {\n throw new Error('You must provide a nodeList/HTMLCollection/Array of elements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return Array.from(nodes);\n }\n return Array.from(nodes).filter(function (item) { return item.nodeType === 1 && item.matches(selector); });\n});\n\n/* eslint-env browser */\nvar stores = new Map();\n/**\n * Stores data & configurations per Sortable\n * @param {Object} config\n */\nvar Store = /** @class */ (function () {\n function Store() {\n this._config = new Map(); // eslint-disable-line no-undef\n this._placeholder = undefined; // eslint-disable-line no-undef\n this._data = new Map(); // eslint-disable-line no-undef\n }\n Object.defineProperty(Store.prototype, \"config\", {\n /**\n * get the configuration map of a class instance\n * @method config\n * @return {object}\n */\n get: function () {\n // transform Map to object\n var config = {};\n this._config.forEach(function (value, key) {\n config[key] = value;\n });\n // return object\n return config;\n },\n /**\n * set the configuration of a class instance\n * @method config\n * @param {object} config object of configurations\n */\n set: function (config) {\n if (typeof config !== 'object') {\n throw new Error('You must provide a valid configuration object to the config setter.');\n }\n // combine config with default\n var mergedConfig = Object.assign({}, config);\n // add config to map\n this._config = new Map(Object.entries(mergedConfig));\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set individual configuration of a class instance\n * @method setConfig\n * @param key valid configuration key\n * @param value any value\n * @return void\n */\n Store.prototype.setConfig = function (key, value) {\n if (!this._config.has(key)) {\n throw new Error(\"Trying to set invalid configuration item: \" + key);\n }\n // set config\n this._config.set(key, value);\n };\n /**\n * get an individual configuration of a class instance\n * @method getConfig\n * @param key valid configuration key\n * @return any configuration value\n */\n Store.prototype.getConfig = function (key) {\n if (!this._config.has(key)) {\n throw new Error(\"Invalid configuration item requested: \" + key);\n }\n return this._config.get(key);\n };\n Object.defineProperty(Store.prototype, \"placeholder\", {\n /**\n * get the placeholder for a class instance\n * @method placeholder\n * @return {HTMLElement|null}\n */\n get: function () {\n return this._placeholder;\n },\n /**\n * set the placeholder for a class instance\n * @method placeholder\n * @param {HTMLElement} placeholder\n * @return {void}\n */\n set: function (placeholder) {\n if (!(placeholder instanceof HTMLElement) && placeholder !== null) {\n throw new Error('A placeholder must be an html element or null.');\n }\n this._placeholder = placeholder;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * set an data entry\n * @method setData\n * @param {string} key\n * @param {any} value\n * @return {void}\n */\n Store.prototype.setData = function (key, value) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n this._data.set(key, value);\n };\n /**\n * get an data entry\n * @method getData\n * @param {string} key an existing key\n * @return {any}\n */\n Store.prototype.getData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.get(key);\n };\n /**\n * delete an data entry\n * @method deleteData\n * @param {string} key an existing key\n * @return {boolean}\n */\n Store.prototype.deleteData = function (key) {\n if (typeof key !== 'string') {\n throw new Error('The key must be a string.');\n }\n return this._data.delete(key);\n };\n return Store;\n}());\n/**\n * @param {HTMLElement} sortableElement\n * @returns {Class: Store}\n */\nvar store = (function (sortableElement) {\n // if sortableElement is wrong type\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('Please provide a sortable to the store function.');\n }\n // create new instance if not avilable\n if (!stores.has(sortableElement)) {\n stores.set(sortableElement, new Store());\n }\n // return instance\n return stores.get(sortableElement);\n});\n\n/**\n * @param {Array|HTMLElement} element\n * @param {Function} callback\n * @param {string} event\n */\nfunction addEventListener(element, eventName, callback) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addEventListener(element[i], eventName, callback);\n }\n return;\n }\n element.addEventListener(eventName, callback);\n store(element).setData(\"event\" + eventName, callback);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} eventName\n */\nfunction removeEventListener(element, eventName) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeEventListener(element[i], eventName);\n }\n return;\n }\n element.removeEventListener(eventName, store(element).getData(\"event\" + eventName));\n store(element).deleteData(\"event\" + eventName);\n}\n\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n * @param {string} value\n */\nfunction addAttribute(element, attribute, value) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n addAttribute(element[i], attribute, value);\n }\n return;\n }\n element.setAttribute(attribute, value);\n}\n/**\n * @param {Array|HTMLElement} element\n * @param {string} attribute\n */\nfunction removeAttribute(element, attribute) {\n if (element instanceof Array) {\n for (var i = 0; i < element.length; ++i) {\n removeAttribute(element[i], attribute);\n }\n return;\n }\n element.removeAttribute(attribute);\n}\n\n/**\n * @param {HTMLElement} element\n * @returns {Object}\n */\nvar _offset = (function (element) {\n if (!element.parentElement || element.getClientRects().length === 0) {\n throw new Error('target element must be part of the dom');\n }\n var rect = element.getClientRects()[0];\n return {\n left: rect.left + window.pageXOffset,\n right: rect.right + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n bottom: rect.bottom + window.pageYOffset\n };\n});\n\n/**\n * Creates and returns a new debounced version of the passed function which will postpone its execution until after wait milliseconds have elapsed\n * @param {Function} func to debounce\n * @param {number} time to wait before calling function with latest arguments, 0 - no debounce\n * @returns {function} - debounced function\n */\nvar _debounce = (function (func, wait) {\n if (wait === void 0) { wait = 0; }\n var timeout;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n func.apply(void 0, args);\n }, wait);\n };\n});\n\n/* eslint-env browser */\n/**\n * Get position of the element relatively to its sibling elements\n * @param {HTMLElement} element\n * @returns {number}\n */\nvar _index = (function (element, elementList) {\n if (!(element instanceof HTMLElement) || !(elementList instanceof NodeList || elementList instanceof HTMLCollection || elementList instanceof Array)) {\n throw new Error('You must provide an element and a list of elements.');\n }\n return Array.from(elementList).indexOf(element);\n});\n\n/* eslint-env browser */\n/**\n * Test whether element is in DOM\n * @param {HTMLElement} element\n * @returns {boolean}\n */\nvar isInDom = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('Element is not a node element.');\n }\n return element.parentNode !== null;\n});\n\n/* eslint-env browser */\n/**\n * Insert node before or after target\n * @param {HTMLElement} referenceNode - reference element\n * @param {HTMLElement} newElement - element to be inserted\n * @param {String} position - insert before or after reference element\n */\nvar insertNode = function (referenceNode, newElement, position) {\n if (!(referenceNode instanceof HTMLElement) || !(referenceNode.parentElement instanceof HTMLElement)) {\n throw new Error('target and element must be a node');\n }\n referenceNode.parentElement.insertBefore(newElement, (position === 'before' ? referenceNode : referenceNode.nextElementSibling));\n};\n/**\n * Insert before target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertBefore = function (target, element) { return insertNode(target, element, 'before'); };\n/**\n * Insert after target\n * @param {HTMLElement} target\n * @param {HTMLElement} element\n */\nvar insertAfter = function (target, element) { return insertNode(target, element, 'after'); };\n\n/* eslint-env browser */\n/**\n * Filter only wanted nodes\n * @param {HTMLElement} sortableContainer\n * @param {Function} customSerializer\n * @returns {Array}\n */\nvar _serialize = (function (sortableContainer, customItemSerializer, customContainerSerializer) {\n if (customItemSerializer === void 0) { customItemSerializer = function (serializedItem, sortableContainer) { return serializedItem; }; }\n if (customContainerSerializer === void 0) { customContainerSerializer = function (serializedContainer) { return serializedContainer; }; }\n // check for valid sortableContainer\n if (!(sortableContainer instanceof HTMLElement) || !sortableContainer.isSortable === true) {\n throw new Error('You need to provide a sortableContainer to be serialized.');\n }\n // check for valid serializers\n if (typeof customItemSerializer !== 'function' || typeof customContainerSerializer !== 'function') {\n throw new Error('You need to provide a valid serializer for items and the container.');\n }\n // get options\n var options = addData(sortableContainer, 'opts');\n var item = options.items;\n // serialize container\n var items = _filter(sortableContainer.children, item);\n var serializedItems = items.map(function (item) {\n return {\n parent: sortableContainer,\n node: item,\n html: item.outerHTML,\n index: _index(item, items)\n };\n });\n // serialize container\n var container = {\n node: sortableContainer,\n itemCount: serializedItems.length\n };\n return {\n container: customContainerSerializer(container),\n items: serializedItems.map(function (item) { return customItemSerializer(item, sortableContainer); })\n };\n});\n\n/* eslint-env browser */\n/**\n * create a placeholder element\n * @param {HTMLElement} sortableElement a single sortable\n * @param {string|undefined} placeholder a string representing an html element\n * @param {string} placeholderClasses a string representing the classes that should be added to the placeholder\n */\nvar _makePlaceholder = (function (sortableElement, placeholder, placeholderClass) {\n var _a;\n if (placeholderClass === void 0) { placeholderClass = 'sortable-placeholder'; }\n if (!(sortableElement instanceof HTMLElement)) {\n throw new Error('You must provide a valid element as a sortable.');\n }\n // if placeholder is not an element\n if (!(placeholder instanceof HTMLElement) && placeholder !== undefined) {\n throw new Error('You must provide a valid element as a placeholder or set ot to undefined.');\n }\n // if no placeholder element is given\n if (placeholder === undefined) {\n if (['UL', 'OL'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('li');\n }\n else if (['TABLE', 'TBODY'].includes(sortableElement.tagName)) {\n placeholder = document.createElement('tr');\n // set colspan to always all rows, otherwise the item can only be dropped in first column\n placeholder.innerHTML = '';\n }\n else {\n placeholder = document.createElement('div');\n }\n }\n // add classes to placeholder\n if (typeof placeholderClass === 'string') {\n (_a = placeholder.classList).add.apply(_a, placeholderClass.split(' '));\n }\n return placeholder;\n});\n\n/* eslint-env browser */\n/**\n * Get height of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementHeight = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // get only height if element has box-sizing: border-box specified\n if (style.getPropertyValue('box-sizing') === 'border-box') {\n return parseInt(style.getPropertyValue('height'), 10);\n }\n // pick applicable properties, convert to int and reduce by adding\n return ['height', 'padding-top', 'padding-bottom']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * Get width of an element including padding\n * @param {HTMLElement} element an dom element\n */\nvar _getElementWidth = (function (element) {\n if (!(element instanceof HTMLElement)) {\n throw new Error('You must provide a valid dom element');\n }\n // get calculated style of element\n var style = window.getComputedStyle(element);\n // pick applicable properties, convert to int and reduce by adding\n return ['width', 'padding-left', 'padding-right']\n .map(function (key) {\n var int = parseInt(style.getPropertyValue(key), 10);\n return isNaN(int) ? 0 : int;\n })\n .reduce(function (sum, value) { return sum + value; });\n});\n\n/* eslint-env browser */\n/**\n * get handle or return item\n * @param {Array} items\n * @param {string} selector\n */\nvar _getHandles = (function (items, selector) {\n if (!(items instanceof Array)) {\n throw new Error('You must provide a Array of HTMLElements to be filtered.');\n }\n if (typeof selector !== 'string') {\n return items;\n }\n return items\n // remove items without handle from array\n .filter(function (item) {\n return item.querySelector(selector) instanceof HTMLElement ||\n (item.shadowRoot && item.shadowRoot.querySelector(selector) instanceof HTMLElement);\n })\n // replace item with handle in array\n .map(function (item) {\n return item.querySelector(selector) || (item.shadowRoot && item.shadowRoot.querySelector(selector));\n });\n});\n\n/**\n * @param {Event} event\n * @returns {HTMLElement}\n */\nvar getEventTarget = (function (event) {\n return (event.composedPath && event.composedPath()[0]) || event.target;\n});\n\n/* eslint-env browser */\n/**\n * defaultDragImage returns the current item as dragged image\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {object} elementOffset - an object with the offsets top, left, right & bottom\n * @param {Event} event - the original drag event object\n * @return {object} with element, posX and posY properties\n */\nvar defaultDragImage = function (draggedElement, elementOffset, event) {\n return {\n element: draggedElement,\n posX: event.pageX - elementOffset.left,\n posY: event.pageY - elementOffset.top\n };\n};\n/**\n * attaches an element as the drag image to an event\n * @param {Event} event - the original drag event object\n * @param {HTMLElement} draggedElement - the item that the user drags\n * @param {Function} customDragImage - function to create a custom dragImage\n * @return void\n */\nvar setDragImage = (function (event, draggedElement, customDragImage) {\n // check if event is provided\n if (!(event instanceof Event)) {\n throw new Error('setDragImage requires a DragEvent as the first argument.');\n }\n // check if draggedElement is provided\n if (!(draggedElement instanceof HTMLElement)) {\n throw new Error('setDragImage requires the dragged element as the second argument.');\n }\n // set default function of none provided\n if (!customDragImage) {\n customDragImage = defaultDragImage;\n }\n // check if setDragImage method is available\n if (event.dataTransfer && event.dataTransfer.setDragImage) {\n // get the elements offset\n var elementOffset = _offset(draggedElement);\n // get the dragImage\n var dragImage = customDragImage(draggedElement, elementOffset, event);\n // check if custom function returns correct values\n if (!(dragImage.element instanceof HTMLElement) || typeof dragImage.posX !== 'number' || typeof dragImage.posY !== 'number') {\n throw new Error('The customDragImage function you provided must return and object with the properties element[string], posX[integer], posY[integer].');\n }\n // needs to be set for HTML5 drag & drop to work\n event.dataTransfer.effectAllowed = 'copyMove';\n // Firefox requires it to use the event target's id for the data\n event.dataTransfer.setData('text/plain', getEventTarget(event).id);\n // set the drag image on the event\n event.dataTransfer.setDragImage(dragImage.element, dragImage.posX, dragImage.posY);\n }\n});\n\n/**\n * Check if curList accepts items from destList\n * @param {sortable} destination the container an item is move to\n * @param {sortable} origin the container an item comes from\n */\nvar _listsConnected = (function (destination, origin) {\n // check if valid sortable\n if (destination.isSortable === true) {\n var acceptFrom = store(destination).getConfig('acceptFrom');\n // check if acceptFrom is valid\n if (acceptFrom !== null && acceptFrom !== false && typeof acceptFrom !== 'string') {\n throw new Error('HTML5Sortable: Wrong argument, \"acceptFrom\" must be \"null\", \"false\", or a valid selector string.');\n }\n if (acceptFrom !== null) {\n return acceptFrom !== false && acceptFrom.split(',').filter(function (sel) {\n return sel.length > 0 && origin.matches(sel);\n }).length > 0;\n }\n // drop in same list\n if (destination === origin) {\n return true;\n }\n // check if lists are connected with connectWith\n if (store(destination).getConfig('connectWith') !== undefined && store(destination).getConfig('connectWith') !== null) {\n return store(destination).getConfig('connectWith') === store(origin).getConfig('connectWith');\n }\n }\n return false;\n});\n\n/**\n * default configurations\n */\nvar defaultConfiguration = {\n items: null,\n // deprecated\n connectWith: null,\n // deprecated\n disableIEFix: null,\n acceptFrom: null,\n copy: false,\n placeholder: null,\n placeholderClass: 'sortable-placeholder',\n draggingClass: 'sortable-dragging',\n hoverClass: false,\n dropTargetContainerClass: false,\n debounce: 0,\n throttleTime: 100,\n maxItems: 0,\n itemSerializer: undefined,\n containerSerializer: undefined,\n customDragImage: null,\n orientation: 'vertical'\n};\n\n/**\n * make sure a function is only called once within the given amount of time\n * @param {Function} fn the function to throttle\n * @param {number} threshold time limit for throttling\n */\n// must use function to keep this context\nfunction _throttle (fn, threshold) {\n var _this = this;\n if (threshold === void 0) { threshold = 250; }\n // check function\n if (typeof fn !== 'function') {\n throw new Error('You must provide a function as the first argument for throttle.');\n }\n // check threshold\n if (typeof threshold !== 'number') {\n throw new Error('You must provide a number as the second argument for throttle.');\n }\n var lastEventTimestamp = null;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var now = Date.now();\n if (lastEventTimestamp === null || now - lastEventTimestamp >= threshold) {\n lastEventTimestamp = now;\n fn.apply(_this, args);\n }\n };\n}\n\n/* eslint-env browser */\n/**\n * enable or disable hoverClass on mouseenter/leave if container Items\n * @param {sortable} sortableContainer a valid sortableContainer\n * @param {boolean} enable enable or disable event\n */\n// export default (sortableContainer: sortable, enable: boolean) => {\nvar enableHoverClass = (function (sortableContainer, enable) {\n if (typeof store(sortableContainer).getConfig('hoverClass') === 'string') {\n var hoverClasses_1 = store(sortableContainer).getConfig('hoverClass').split(' ');\n // add class on hover\n if (enable === true) {\n addEventListener(sortableContainer, 'mousemove', _throttle(function (event) {\n // check of no mouse button was pressed when mousemove started == no drag\n if (event.buttons === 0) {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a, _b;\n if (item !== event.target) {\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n }\n else {\n (_b = item.classList).add.apply(_b, hoverClasses_1);\n }\n });\n }\n }, store(sortableContainer).getConfig('throttleTime')));\n // remove class on leave\n addEventListener(sortableContainer, 'mouseleave', function () {\n _filter(sortableContainer.children, store(sortableContainer).getConfig('items')).forEach(function (item) {\n var _a;\n (_a = item.classList).remove.apply(_a, hoverClasses_1);\n });\n });\n // remove events\n }\n else {\n removeEventListener(sortableContainer, 'mousemove');\n removeEventListener(sortableContainer, 'mouseleave');\n }\n }\n});\n\n/* eslint-env browser */\n/*\n * variables global to the plugin\n */\nvar dragging;\nvar draggingHeight;\nvar draggingWidth;\n/*\n * Keeps track of the initialy selected list, where 'dragstart' event was triggered\n * It allows us to move the data in between individual Sortable List instances\n */\n// Origin List - data from before any item was changed\nvar originContainer;\nvar originIndex;\nvar originElementIndex;\nvar originItemsBeforeUpdate;\n// Previous Sortable Container - we dispatch as sortenter event when a\n// dragged item enters a sortableContainer for the first time\nvar previousContainer;\n// Destination List - data from before any item was changed\nvar destinationItemsBeforeUpdate;\n/**\n * remove event handlers from items\n * @param {Array|NodeList} items\n */\nvar _removeItemEvents = function (items) {\n removeEventListener(items, 'dragstart');\n removeEventListener(items, 'dragend');\n removeEventListener(items, 'dragover');\n removeEventListener(items, 'dragenter');\n removeEventListener(items, 'drop');\n removeEventListener(items, 'mouseenter');\n removeEventListener(items, 'mouseleave');\n};\n// Remove container events\nvar _removeContainerEvents = function (originContainer, previousContainer) {\n if (originContainer) {\n removeEventListener(originContainer, 'dragleave');\n }\n if (previousContainer && (previousContainer !== originContainer)) {\n removeEventListener(previousContainer, 'dragleave');\n }\n};\n/**\n * _getDragging returns the current element to drag or\n * a copy of the element.\n * Is Copy Active for sortable\n * @param {HTMLElement} draggedItem - the item that the user drags\n * @param {HTMLElement} sortable a single sortable\n */\nvar _getDragging = function (draggedItem, sortable) {\n var ditem = draggedItem;\n if (store(sortable).getConfig('copy') === true) {\n ditem = draggedItem.cloneNode(true);\n addAttribute(ditem, 'aria-copied', 'true');\n draggedItem.parentElement.appendChild(ditem);\n ditem.style.display = 'none';\n ditem.oldDisplay = draggedItem.style.display;\n }\n return ditem;\n};\n/**\n * Remove data from sortable\n * @param {HTMLElement} sortable a single sortable\n */\nvar _removeSortableData = function (sortable) {\n removeData(sortable);\n removeAttribute(sortable, 'aria-dropeffect');\n};\n/**\n * Remove data from items\n * @param {Array|HTMLElement} items\n */\nvar _removeItemData = function (items) {\n removeAttribute(items, 'aria-grabbed');\n removeAttribute(items, 'aria-copied');\n removeAttribute(items, 'draggable');\n removeAttribute(items, 'role');\n};\n/**\n * find sortable from element. travels up parent element until found or null.\n * @param {HTMLElement} element a single sortable\n * @param {Event} event - the current event. We need to pass it to be able to\n * find Sortable whith shadowRoot (document fragment has no parent)\n */\nfunction findSortable(element, event) {\n if (event.composedPath) {\n return event.composedPath().find(function (el) { return el.isSortable; });\n }\n while (element.isSortable !== true) {\n element = element.parentElement;\n }\n return element;\n}\n/**\n * Dragging event is on the sortable element. finds the top child that\n * contains the element.\n * @param {HTMLElement} sortableElement a single sortable\n * @param {HTMLElement} element is that being dragged\n */\nfunction findDragElement(sortableElement, element) {\n var options = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, options.items);\n var itemlist = items.filter(function (ele) {\n return ele.contains(element) || (ele.shadowRoot && ele.shadowRoot.contains(element));\n });\n return itemlist.length > 0 ? itemlist[0] : element;\n}\n/**\n * Destroy the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _destroySortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts') || {};\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n // remove event handlers & data from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'dragstart');\n removeEventListener(sortableElement, 'dragend');\n removeEventListener(sortableElement, 'drop');\n // remove event data from sortable\n _removeSortableData(sortableElement);\n // remove event handlers & data from items\n removeEventListener(handles, 'mousedown');\n _removeItemEvents(items);\n _removeItemData(items);\n _removeContainerEvents(originContainer, previousContainer);\n // clear sortable flag\n sortableElement.isSortable = false;\n};\n/**\n * Enable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _enableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'move');\n addData(sortableElement, '_disabled', 'false');\n addAttribute(handles, 'draggable', 'true');\n // @todo: remove this fix\n // IE FIX for ghost\n // can be disabled as it has the side effect that other events\n // (e.g. click) will be ignored\n if (opts.disableIEFix === false) {\n var spanEl = (document || window.document).createElement('span');\n if (typeof spanEl.dragDrop === 'function') {\n addEventListener(handles, 'mousedown', function () {\n if (items.indexOf(this) !== -1) {\n this.dragDrop();\n }\n else {\n var parent = this.parentElement;\n while (items.indexOf(parent) === -1) {\n parent = parent.parentElement;\n }\n parent.dragDrop();\n }\n });\n }\n }\n};\n/**\n * Disable the sortable\n * @param {HTMLElement} sortableElement a single sortable\n */\nvar _disableSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addAttribute(sortableElement, 'aria-dropeffect', 'none');\n addData(sortableElement, '_disabled', 'true');\n addAttribute(handles, 'draggable', 'false');\n removeEventListener(handles, 'mousedown');\n};\n/**\n * Reload the sortable\n * @param {HTMLElement} sortableElement a single sortable\n * @description events need to be removed to not be double bound\n */\nvar _reloadSortable = function (sortableElement) {\n var opts = addData(sortableElement, 'opts');\n var items = _filter(sortableElement.children, opts.items);\n var handles = _getHandles(items, opts.handle);\n addData(sortableElement, '_disabled', 'false');\n // remove event handlers from items\n _removeItemEvents(items);\n _removeContainerEvents(originContainer, previousContainer);\n removeEventListener(handles, 'mousedown');\n // remove event handlers from sortable\n removeEventListener(sortableElement, 'dragover');\n removeEventListener(sortableElement, 'dragenter');\n removeEventListener(sortableElement, 'drop');\n};\n/**\n * Public sortable object\n * @param {Array|NodeList} sortableElements\n * @param {object|string} options|method\n */\nfunction sortable(sortableElements, options) {\n // get method string to see if a method is called\n var method = String(options);\n options = options || {};\n // check if the user provided a selector instead of an element\n if (typeof sortableElements === 'string') {\n sortableElements = document.querySelectorAll(sortableElements);\n }\n // if the user provided an element, return it in an array to keep the return value consistant\n if (sortableElements instanceof HTMLElement) {\n sortableElements = [sortableElements];\n }\n sortableElements = Array.prototype.slice.call(sortableElements);\n if (/serialize/.test(method)) {\n return sortableElements.map(function (sortableContainer) {\n var opts = addData(sortableContainer, 'opts');\n return _serialize(sortableContainer, opts.itemSerializer, opts.containerSerializer);\n });\n }\n sortableElements.forEach(function (sortableElement) {\n if (/enable|disable|destroy/.test(method)) {\n return sortable[method](sortableElement);\n }\n // log deprecation\n ['connectWith', 'disableIEFix'].forEach(function (configKey) {\n if (Object.prototype.hasOwnProperty.call(options, configKey) && options[configKey] !== null) {\n console.warn(\"HTML5Sortable: You are using the deprecated configuration \\\"\" + configKey + \"\\\". This will be removed in an upcoming version, make sure to migrate to the new options when updating.\");\n }\n });\n // merge options with default options\n options = Object.assign({}, defaultConfiguration, store(sortableElement).config, options);\n // init data store for sortable\n store(sortableElement).config = options;\n // set options on sortable\n addData(sortableElement, 'opts', options);\n // property to define as sortable\n sortableElement.isSortable = true;\n // reset sortable\n _reloadSortable(sortableElement);\n // initialize\n var listItems = _filter(sortableElement.children, options.items);\n // create element if user defined a placeholder element as a string\n var customPlaceholder;\n if (options.placeholder !== null && options.placeholder !== undefined) {\n var tempContainer = document.createElement(sortableElement.tagName);\n if (options.placeholder instanceof HTMLElement) {\n tempContainer.appendChild(options.placeholder);\n }\n else {\n tempContainer.innerHTML = options.placeholder;\n }\n customPlaceholder = tempContainer.children[0];\n }\n // add placeholder\n store(sortableElement).placeholder = _makePlaceholder(sortableElement, customPlaceholder, options.placeholderClass);\n addData(sortableElement, 'items', options.items);\n if (options.acceptFrom) {\n addData(sortableElement, 'acceptFrom', options.acceptFrom);\n }\n else if (options.connectWith) {\n addData(sortableElement, 'connectWith', options.connectWith);\n }\n _enableSortable(sortableElement);\n addAttribute(listItems, 'role', 'option');\n addAttribute(listItems, 'aria-grabbed', 'false');\n // enable hover class\n enableHoverClass(sortableElement, true);\n /*\n Handle drag events on draggable items\n Handle is set at the sortableElement level as it will bubble up\n from the item\n */\n addEventListener(sortableElement, 'dragstart', function (e) {\n // ignore dragstart events\n var target = getEventTarget(e);\n if (target.isSortable === true) {\n return;\n }\n e.stopImmediatePropagation();\n if ((options.handle && !target.matches(options.handle)) || target.getAttribute('draggable') === 'false') {\n return;\n }\n var sortableContainer = findSortable(target, e);\n var dragItem = findDragElement(sortableContainer, target);\n // grab values\n originItemsBeforeUpdate = _filter(sortableContainer.children, options.items);\n originIndex = originItemsBeforeUpdate.indexOf(dragItem);\n originElementIndex = _index(dragItem, sortableContainer.children);\n originContainer = sortableContainer;\n // add transparent clone or other ghost to cursor\n setDragImage(e, dragItem, options.customDragImage);\n // cache selsection & add attr for dragging\n draggingHeight = _getElementHeight(dragItem);\n draggingWidth = _getElementWidth(dragItem);\n dragItem.classList.add(options.draggingClass);\n dragging = _getDragging(dragItem, sortableContainer);\n addAttribute(dragging, 'aria-grabbed', 'true');\n // dispatch sortstart event on each element in group\n sortableContainer.dispatchEvent(new CustomEvent('sortstart', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n });\n /*\n We are capturing targetSortable before modifications with 'dragenter' event\n */\n addEventListener(sortableElement, 'dragenter', function (e) {\n var target = getEventTarget(e);\n var sortableContainer = findSortable(target, e);\n if (sortableContainer && sortableContainer !== previousContainer) {\n destinationItemsBeforeUpdate = _filter(sortableContainer.children, addData(sortableContainer, 'items'))\n .filter(function (item) { return item !== store(sortableElement).placeholder; });\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.add(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortenter', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n destination: {\n container: sortableContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate\n },\n item: dragging,\n originalTarget: target\n }\n }));\n addEventListener(sortableContainer, 'dragleave', function (e) {\n // TODO: rename outTarget to be more self-explanatory\n // e.fromElement for very old browsers, similar to relatedTarget\n var outTarget = e.relatedTarget || e.fromElement;\n if (!e.currentTarget.contains(outTarget)) {\n if (options.dropTargetContainerClass) {\n sortableContainer.classList.remove(options.dropTargetContainerClass);\n }\n sortableContainer.dispatchEvent(new CustomEvent('sortleave', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: sortableContainer\n },\n item: dragging,\n originalTarget: target\n }\n }));\n }\n });\n }\n previousContainer = sortableContainer;\n });\n /*\n * Dragend Event - https://developer.mozilla.org/en-US/docs/Web/Events/dragend\n * Fires each time dragEvent end, or ESC pressed\n * We are using it to clean up any draggable elements and placeholders\n */\n addEventListener(sortableElement, 'dragend', function (e) {\n if (!dragging) {\n return;\n }\n dragging.classList.remove(options.draggingClass);\n addAttribute(dragging, 'aria-grabbed', 'false');\n if (dragging.getAttribute('aria-copied') === 'true' && addData(dragging, 'dropped') !== 'true') {\n dragging.remove();\n }\n dragging.style.display = dragging.oldDisplay;\n delete dragging.oldDisplay;\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) { return data.placeholder; })\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n .filter(isInDom)[0];\n if (visiblePlaceholder) {\n visiblePlaceholder.remove();\n }\n // dispatch sortstart event on each element in group\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n previousContainer = null;\n dragging = null;\n draggingHeight = null;\n draggingWidth = null;\n });\n /*\n * Drop Event - https://developer.mozilla.org/en-US/docs/Web/Events/drop\n * Fires when valid drop target area is hit\n */\n addEventListener(sortableElement, 'drop', function (e) {\n if (!_listsConnected(sortableElement, dragging.parentElement)) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n addData(dragging, 'dropped', 'true');\n // get the one placeholder that is currently visible\n var visiblePlaceholder = Array.from(stores.values()).map(function (data) {\n return data.placeholder;\n })\n // filter only HTMLElements\n .filter(function (placeholder) { return placeholder instanceof HTMLElement; })\n // filter only elements in DOM\n .filter(isInDom)[0];\n // attach element after placeholder\n insertAfter(visiblePlaceholder, dragging);\n // remove placeholder from dom\n visiblePlaceholder.remove();\n /*\n * Fires Custom Event - 'sortstop'\n */\n sortableElement.dispatchEvent(new CustomEvent('sortstop', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer\n },\n item: dragging\n }\n }));\n var placeholder = store(sortableElement).placeholder;\n var originItems = _filter(originContainer.children, options.items)\n .filter(function (item) { return item !== placeholder; });\n var destinationContainer = this.isSortable === true ? this : this.parentElement;\n var destinationItems = _filter(destinationContainer.children, addData(destinationContainer, 'items'))\n .filter(function (item) { return item !== placeholder; });\n var destinationElementIndex = _index(dragging, Array.from(dragging.parentElement.children)\n .filter(function (item) { return item !== placeholder; }));\n var destinationIndex = _index(dragging, destinationItems);\n if (options.dropTargetContainerClass) {\n destinationContainer.classList.remove(options.dropTargetContainerClass);\n }\n /*\n * When a list item changed container lists or index within a list\n * Fires Custom Event - 'sortupdate'\n */\n if (originElementIndex !== destinationElementIndex || originContainer !== destinationContainer) {\n sortableElement.dispatchEvent(new CustomEvent('sortupdate', {\n detail: {\n origin: {\n elementIndex: originElementIndex,\n index: originIndex,\n container: originContainer,\n itemsBeforeUpdate: originItemsBeforeUpdate,\n items: originItems\n },\n destination: {\n index: destinationIndex,\n elementIndex: destinationElementIndex,\n container: destinationContainer,\n itemsBeforeUpdate: destinationItemsBeforeUpdate,\n items: destinationItems\n },\n item: dragging\n }\n }));\n }\n });\n var debouncedDragOverEnter = _debounce(function (sortableElement, element, pageX, pageY) {\n if (!dragging) {\n return;\n }\n // set placeholder height if forcePlaceholderSize option is set\n if (options.forcePlaceholderSize) {\n store(sortableElement).placeholder.style.height = draggingHeight + 'px';\n store(sortableElement).placeholder.style.width = draggingWidth + 'px';\n }\n // if element the draggedItem is dragged onto is within the array of all elements in list\n // (not only items, but also disabled, etc.)\n if (Array.from(sortableElement.children).indexOf(element) > -1) {\n var thisHeight = _getElementHeight(element);\n var thisWidth = _getElementWidth(element);\n var placeholderIndex = _index(store(sortableElement).placeholder, element.parentElement.children);\n var thisIndex = _index(element, element.parentElement.children);\n // Check if `element` is bigger than the draggable. If it is, we have to define a dead zone to prevent flickering\n if (thisHeight > draggingHeight || thisWidth > draggingWidth) {\n // Dead zone?\n var deadZoneVertical = thisHeight - draggingHeight;\n var deadZoneHorizontal = thisWidth - draggingWidth;\n var offsetTop = _offset(element).top;\n var offsetLeft = _offset(element).left;\n if (placeholderIndex < thisIndex &&\n ((options.orientation === 'vertical' && pageY < offsetTop) ||\n (options.orientation === 'horizontal' && pageX < offsetLeft))) {\n return;\n }\n if (placeholderIndex > thisIndex &&\n ((options.orientation === 'vertical' && pageY > offsetTop + thisHeight - deadZoneVertical) ||\n (options.orientation === 'horizontal' && pageX > offsetLeft + thisWidth - deadZoneHorizontal))) {\n return;\n }\n }\n if (dragging.oldDisplay === undefined) {\n dragging.oldDisplay = dragging.style.display;\n }\n if (dragging.style.display !== 'none') {\n dragging.style.display = 'none';\n }\n // To avoid flicker, determine where to position the placeholder\n // based on where the mouse pointer is relative to the elements\n // vertical center.\n var placeAfter = false;\n try {\n var elementMiddleVertical = _offset(element).top + element.offsetHeight / 2;\n var elementMiddleHorizontal = _offset(element).left + element.offsetWidth / 2;\n placeAfter = (options.orientation === 'vertical' && (pageY >= elementMiddleVertical)) ||\n (options.orientation === 'horizontal' && (pageX >= elementMiddleHorizontal));\n }\n catch (e) {\n placeAfter = placeholderIndex < thisIndex;\n }\n if (placeAfter) {\n insertAfter(element, store(sortableElement).placeholder);\n }\n else {\n insertBefore(element, store(sortableElement).placeholder);\n }\n // get placeholders from all stores & remove all but current one\n Array.from(stores.values())\n // remove empty values\n .filter(function (data) { return data.placeholder !== undefined; })\n // foreach placeholder in array if outside of current sorableContainer -> remove from DOM\n .forEach(function (data) {\n if (data.placeholder !== store(sortableElement).placeholder) {\n data.placeholder.remove();\n }\n });\n }\n else {\n // get all placeholders from store\n var placeholders = Array.from(stores.values())\n .filter(function (data) { return data.placeholder !== undefined; })\n .map(function (data) {\n return data.placeholder;\n });\n // check if element is not in placeholders\n if (placeholders.indexOf(element) === -1 && sortableElement === element && !_filter(element.children, options.items).length) {\n placeholders.forEach(function (element) { return element.remove(); });\n element.appendChild(store(sortableElement).placeholder);\n }\n }\n }, options.debounce);\n // Handle dragover and dragenter events on draggable items\n var onDragOverEnter = function (e) {\n var element = e.target;\n var sortableElement = element.isSortable === true ? element : findSortable(element, e);\n element = findDragElement(sortableElement, element);\n if (!dragging || !_listsConnected(sortableElement, dragging.parentElement) || addData(sortableElement, '_disabled') === 'true') {\n return;\n }\n var options = addData(sortableElement, 'opts');\n if (parseInt(options.maxItems) && _filter(sortableElement.children, addData(sortableElement, 'items')).length >= parseInt(options.maxItems) && dragging.parentElement !== sortableElement) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n e.dataTransfer.dropEffect = store(sortableElement).getConfig('copy') === true ? 'copy' : 'move';\n debouncedDragOverEnter(sortableElement, element, e.pageX, e.pageY);\n };\n addEventListener(listItems.concat(sortableElement), 'dragover', onDragOverEnter);\n addEventListener(listItems.concat(sortableElement), 'dragenter', onDragOverEnter);\n });\n return sortableElements;\n}\nsortable.destroy = function (sortableElement) {\n _destroySortable(sortableElement);\n};\nsortable.enable = function (sortableElement) {\n _enableSortable(sortableElement);\n};\nsortable.disable = function (sortableElement) {\n _disableSortable(sortableElement);\n};\n/* START.TESTS_ONLY */\nsortable.__testing = {\n // add internal methods here for testing purposes\n _data: addData,\n _removeItemEvents: _removeItemEvents,\n _removeItemData: _removeItemData,\n _removeSortableData: _removeSortableData,\n _removeContainerEvents: _removeContainerEvents\n};\n\nexport default sortable;\n","import app from 'flarum/app';\nimport Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\n/* global m */\n\nexport default class SelectFieldOptionEditor extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.newOption = '';\n }\n\n view() {\n return m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.options')),\n m(\n 'table',\n m(\n 'tbody',\n this.options().map((option, optionIndex) =>\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n oninput: (event) => {\n this.updateOption(optionIndex, event.target.value);\n },\n value: option,\n })\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, -1);\n },\n },\n icon('fas fa-chevron-up')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button',\n {\n onclick: () => {\n this.moveOption(optionIndex, 1);\n },\n },\n icon('fas fa-chevron-down')\n )\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--danger',\n {\n onclick: () => {\n this.deleteOption(optionIndex);\n },\n },\n icon('fas fa-times')\n )\n ),\n ])\n )\n )\n ),\n m('.helpText', app.translator.trans('fof-masquerade.admin.fields.option-comma-warning')),\n m(\n 'table',\n m('tbody'),\n m('tr', [\n m(\n 'td',\n m('input[type=text].FormControl', {\n onchange: (event) => {\n this.newOption = event.target.value;\n },\n value: this.newOption,\n placeholder: app.translator.trans('fof-masquerade.admin.fields.option-new'),\n })\n ),\n m(\n 'td',\n m(\n 'button.Button.Button--primary',\n {\n onclick: () => {\n this.addOption();\n },\n },\n icon('fas fa-plus')\n )\n ),\n ])\n ),\n ]);\n }\n\n updateRules(options) {\n // We ignore other existing rules, they would probably be leftovers from another field type when changing types\n this.attrs.onchange('in:' + options.join(','));\n }\n\n options() {\n const rules = this.attrs.value.split('|');\n\n let options = [];\n\n rules.forEach((rule) => {\n const parts = rule.split(':', 2);\n\n if (parts[0] === 'in') {\n options = parts[1].split(',');\n }\n });\n\n return options;\n }\n\n updateOption(index, value) {\n let options = this.options();\n\n options[index] = value;\n\n this.updateRules(options);\n }\n\n moveOption(index, moveIndex) {\n let options = this.options();\n\n const newIndex = index + moveIndex;\n\n if (newIndex < 0 || newIndex > options.length - 1) {\n return;\n }\n\n const move = options.splice(index, 1);\n\n options.splice(newIndex, 0, move[0]);\n\n this.updateRules(options);\n }\n\n deleteOption(index) {\n let options = this.options();\n\n options.splice(index, 1);\n\n this.updateRules(options);\n }\n\n addOption() {\n if (this.newOption === '') {\n return;\n }\n\n let options = this.options();\n\n options.push(this.newOption);\n\n this.newOption = '';\n\n this.updateRules(options);\n }\n}\n","import sortable from 'html5sortable/dist/html5sortable.es.js';\n\nimport app from 'flarum/app';\nimport icon from 'flarum/common/helpers/icon';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Select from 'flarum/common/components/Select';\nimport Switch from 'flarum/common/components/Switch';\nimport Button from 'flarum/common/components/Button';\nimport saveSettings from 'flarum/admin/utils/saveSettings';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport SelectFieldOptionEditor from './SelectFieldOptionEditor';\n\n/* global m, $ */\n\nexport default class MasqueradePage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.resetNew();\n this.loading = false;\n this.existing = [];\n this.loadExisting();\n this.enforceProfileCompletion = app.data.settings['masquerade.force-profile-completion'] === '1';\n }\n\n config() {\n sortable(this.element.querySelector('.js-sortable-fields'), {\n handle: 'legend',\n })[0].addEventListener('sortupdate', () => {\n const sorting = this.$('.js-sortable-fields > .Field')\n .map(function () {\n return $(this).data('id');\n })\n .get();\n\n this.updateSort(sorting);\n });\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n this.config();\n }\n\n onupdate() {\n this.config();\n }\n\n content() {\n return m(\n '.ExtensionPage-settings.ProfileConfigurePane',\n m('.container', [\n m('h2', app.translator.trans('fof-masquerade.admin.general-options')),\n m(\n '.Form-group',\n Switch.component(\n {\n state: this.enforceProfileCompletion,\n onchange: (value) => {\n const saveValue = value ? '1' : '0';\n saveSettings({\n 'masquerade.force-profile-completion': saveValue,\n });\n this.enforceProfileCompletion = saveValue;\n },\n },\n app.translator.trans('fof-masquerade.admin.fields.force-user-to-completion')\n )\n ),\n m('h2', app.translator.trans('fof-masquerade.admin.fields.title')),\n m(\n 'form.js-sortable-fields',\n this.existing.map((field) => {\n // Build array of fields to show.\n return this.addField(field);\n })\n ),\n this.addField(this.new),\n ])\n );\n }\n\n /**\n * Creates a field in the DOM.\n *\n * @param field\n * @returns {*}\n */\n addField(field) {\n let exists = field.id();\n\n return m(\n 'fieldset.Field',\n {\n 'data-id': field.id(),\n key: field.id(),\n },\n [\n m('legend', [\n exists\n ? [\n Button.component({\n className: 'Button Button--icon Button--danger',\n icon: 'fas fa-trash',\n onclick: this.deleteField.bind(this, field),\n }),\n ' ',\n ]\n : null,\n m(\n 'span.Field-toggle',\n {\n onclick: (e) => this.toggleField(e),\n },\n [\n app.translator.trans('fof-masquerade.admin.fields.' + (exists ? 'edit' : 'add'), {\n field: field.name(),\n }),\n ' ',\n icon('fas fa-caret-down'),\n ]\n ),\n ]),\n m('.Field-body', [\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.name')),\n m('input.FormControl', {\n value: field.name(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'name', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.name-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.description')),\n m('input.FormControl', {\n value: field.description(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'description', field)),\n }),\n m('span.helpText', app.translator.trans('fof-masquerade.admin.fields.description-help')),\n ]),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.icon')),\n m('input.FormControl', {\n value: field.icon(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'icon', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.icon-help', {\n a: ,\n })\n ),\n ]),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.on_bio(),\n onchange: this.updateExistingFieldInput.bind(this, 'on_bio', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.on_bio')\n )\n ),\n m(\n '.Form-group',\n Switch.component(\n {\n state: field.required(),\n onchange: this.updateExistingFieldInput.bind(this, 'required', field),\n },\n app.translator.trans('fof-masquerade.admin.fields.required')\n )\n ),\n m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.type')),\n Select.component({\n onchange: (value) => {\n if (value === 'null') {\n value = null;\n }\n\n this.updateExistingFieldInput('type', field, value);\n },\n options: this.availableTypes(),\n value: field.type(),\n }),\n ]),\n field.type() === 'select'\n ? SelectFieldOptionEditor.component({\n onchange: (value) => {\n this.updateExistingFieldInput('validation', field, value);\n },\n value: field.validation(),\n })\n : null,\n field.type() === null\n ? m('.Form-group', [\n m('label', app.translator.trans('fof-masquerade.admin.fields.validation')),\n m('input.FormControl', {\n value: field.validation(),\n oninput: withAttr('value', this.updateExistingFieldInput.bind(this, 'validation', field)),\n }),\n m(\n 'span.helpText',\n app.translator.trans('fof-masquerade.admin.fields.validation-help', {\n a: ,\n })\n ),\n ])\n : null,\n m(\n '.Form-group',\n m('.ButtonGroup', [\n Button.component(\n {\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.readyToAdd(field),\n onclick: exists ? this.updateExistingField.bind(this, field) : this.submitAddField.bind(this),\n },\n app.translator.trans('fof-masquerade.admin.buttons.' + (exists ? 'edit' : 'add') + '-field')\n ),\n exists\n ? Button.component(\n {\n className: 'Button Button--danger',\n loading: this.loading,\n onclick: this.deleteField.bind(this, field),\n },\n app.translator.trans('fof-masquerade.admin.buttons.delete-field')\n )\n : null,\n ])\n ),\n ]),\n ]\n );\n }\n\n updateExistingFieldInput(what, field, value) {\n field.pushAttributes({\n [what]: value,\n });\n }\n\n /**\n * Sorts the fields.\n *\n * @param {Array} sorting\n */\n updateSort(sorting) {\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields/order',\n body: {\n sort: sorting,\n },\n }).then(this.requestSuccess.bind(this));\n }\n\n /**\n * Opens and closes field configuration sets.\n *\n * @param e\n */\n toggleField(e) {\n $(e.target).parents('.Field').toggleClass('active');\n }\n\n /**\n * Deletes a field configuration set.\n *\n * @param field\n */\n deleteField(field) {\n field.delete().then(this.requestSuccess.bind(this));\n }\n\n /**\n * Saves the settings to the database and redraw the page\n *\n * @param e\n */\n submitAddField(e) {\n e.preventDefault();\n\n this.new\n .save(this.new.data.attributes)\n .then(this.requestSuccess.bind(this))\n .then(() => {\n this.resetNew();\n });\n\n m.redraw();\n }\n\n /**\n * Updates the value of one field.\n *\n * @param field\n */\n updateExistingField(field) {\n if (!field.id()) return;\n\n field.save(field.data.attributes).then(this.requestSuccess.bind(this));\n }\n\n /**\n * Parses result to update DOM.\n */\n requestSuccess() {\n this.existing = app.store.all('masquerade-field');\n\n // Update order in case the store order doesn't reflect the true ordering\n this.existing.sort((a, b) => {\n if (a.sort() < b.sort()) return -1;\n if (a.sort() > b.sort()) return 1;\n return 0;\n });\n\n this.loading = false;\n m.redraw();\n }\n\n /**\n * Retrieves list of fields.\n */\n loadExisting() {\n this.loading = true;\n\n return app\n .request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/fields',\n })\n .then((result) => {\n app.store.pushPayload(result);\n\n this.requestSuccess();\n });\n }\n\n /**\n * Resets the new field.\n */\n resetNew() {\n this.new = app.store.createRecord('masquerade-field', {\n attributes: {\n name: '',\n description: '',\n prefix: '',\n icon: '',\n required: false,\n on_bio: false,\n type: null,\n validation: '',\n },\n });\n }\n\n /**\n * Checks whether creation field is completed.\n *\n * @returns boolean\n */\n readyToAdd(field) {\n if (field.name()) {\n return true;\n }\n\n return false;\n }\n\n /**\n * List of field types availables\n * @returns {Array}\n */\n availableTypes() {\n return {\n url: app.translator.trans('fof-masquerade.admin.types.url'),\n email: app.translator.trans('fof-masquerade.admin.types.email'),\n boolean: app.translator.trans('fof-masquerade.admin.types.boolean'),\n select: app.translator.trans('fof-masquerade.admin.types.select'),\n null: app.translator.trans('fof-masquerade.admin.types.advanced'),\n };\n }\n}\n","import app from 'flarum/app';\nimport Field from './../lib/models/Field';\nimport MasqueradePage from './components/MasqueradePage';\n\napp.initializers.add('fof-masquerade', () => {\n app.store.models['masquerade-field'] = Field;\n\n app.extensionData\n .for('fof-masquerade')\n .registerPage(MasqueradePage)\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.view-profile'),\n permission: 'fof.masquerade.view-profile',\n allowGuest: true,\n },\n 'view'\n )\n .registerPermission(\n {\n icon: 'far fa-id-card',\n label: app.translator.trans('fof-masquerade.admin.permissions.have-profile'),\n permission: 'fof.masquerade.have-profile',\n },\n 'start'\n );\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 386e9be..3adbefa 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=20)}([function(t,e){t.exports=flarum.core.compat.app},function(t,e){t.exports=flarum.core.compat.Model},function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,r(t,e)}n.d(e,"a",(function(){return i}))},function(t,e){t.exports=flarum.core.compat["helpers/icon"]},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["components/UserPage"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(2),i=n(4),o=n(3),a=n(1),u=n.n(a),s=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),a=0;a {\n const split = rule.split(':', 2);\n\n if (split[0] === ruleName) {\n ruleContent = split[1];\n }\n });\n\n return ruleContent;\n }\n\n editorField() {\n return m('.Form-group.Field', [\n m('label', [this.field.icon() ? [icon(this.field.icon()), ' '] : null, this.field.name(), this.field.required() ? ' *' : null]),\n m('.FormField', [\n this.field.prefix() ? m('.prefix', this.field.prefix()) : null,\n this.editorInput(),\n this.field.description() ? m('.helpText', this.field.description()) : null,\n ]),\n ]);\n }\n\n editorInput() {\n return m('input', this.editorInputAttrs());\n }\n\n editorInputAttrs() {\n return {\n className: 'FormControl',\n oninput: (event) => {\n this.set(event.target.value);\n },\n value: this.value,\n required: this.field.required(),\n };\n }\n\n answerField() {\n const iconName = this.readAttribute(this.field, 'icon');\n\n return m('.Masquerade-Bio-Set', [\n m('span.Masquerade-Bio-Field', [iconName ? [icon(iconName), ' '] : null, this.readAttribute(this.field, 'name') + ': ']),\n m('span.Masquerade-Bio-Answer', this.answerContent()),\n ]);\n }\n\n answerContent() {\n return this.value;\n }\n\n static isNoOptionSelectedValue(value) {\n // The value can be null when coming from the API\n // The value can be '' when the field does not exist on the user (the empty string is set in ProfileConfigurePane)\n return value === null || value === '';\n }\n}\n","import icon from 'flarum/helpers/icon';\nimport BaseField from './BaseField';\n\nexport default class BooleanField extends BaseField {\n editorInput() {\n return this.options().map((option) =>\n m(\n 'div',\n m('label', [\n m('input[type=radio]', {\n checked: option.selected(this.value),\n onclick: () => {\n this.set(option.key);\n },\n }),\n ' ' + option.label,\n ])\n )\n );\n }\n\n options() {\n let options = [];\n\n if (!this.readAttribute(this.field, 'required')) {\n options.push({\n selected: (value) => BaseField.isNoOptionSelectedValue(value),\n key: null,\n label: app.translator.trans('fof-masquerade.forum.fields.select.none-optional'),\n });\n }\n\n options.push({\n selected: (value) => ['true', '1', 1, true, 'yes'].indexOf(value) !== -1,\n key: 'true',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.yes'),\n });\n\n options.push({\n selected: (value) => ['false', '0', 0, false, 'no'].indexOf(value) !== -1,\n key: 'false',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.no'),\n });\n\n // This is probably overkill because it looks like the backend casts the value anyway\n if (\n !BaseField.isNoOptionSelectedValue(this.value) &&\n ['true', '1', 1, true, 'yes', 'false', '0', 0, false, 'no'].indexOf(this.value) === -1\n ) {\n options.push({\n selected: () => true,\n key: this.value,\n label: '(invalid) ' + this.value,\n });\n }\n\n return options;\n }\n\n answerContent() {\n if (BaseField.isNoOptionSelectedValue(this.value)) {\n return '';\n }\n\n return [1, '1', true, 'true', 'yes'].indexOf(this.value) !== -1\n ? [icon('far fa-check-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.yes')]\n : [icon('far fa-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.no')];\n }\n}\n","import Button from 'flarum/components/Button';\nimport BaseField from './BaseField';\n\nexport default class EmailField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'email';\n attrs.placeholder = 'you@example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n const email = value\n .split(/@|\\./)\n .map((segment) => {\n return segment.replace(/(.{2})./g, '$1*');\n })\n .join('*');\n\n return Button.component(\n {\n onclick: () => this.mailTo(),\n className: 'Button Button--text',\n icon: 'far fa-envelope',\n },\n email\n );\n }\n\n mailTo() {\n window.location = 'mailto:' + this.value;\n }\n}\n","import Select from 'flarum/components/Select';\nimport BaseField from './BaseField';\n\nconst NO_OPTION_SELECTED_KEY = 'fof_masquerade_no_option_selected';\n\nexport default class EmailField extends BaseField {\n editorInput() {\n return Select.component({\n onchange: (value) => {\n if (value === NO_OPTION_SELECTED_KEY) {\n value = null;\n }\n\n this.set(value);\n },\n value: BaseField.isNoOptionSelectedValue(this.value) ? NO_OPTION_SELECTED_KEY : this.value,\n options: this.options(),\n });\n }\n\n options() {\n let options = {};\n\n if (!this.readAttribute(this.field, 'required')) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-optional');\n } else if (BaseField.isNoOptionSelectedValue(this.value)) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-required');\n }\n\n const validationIn = this.validationRule('in');\n\n if (validationIn) {\n validationIn.split(',').forEach((value) => {\n options[value] = value;\n });\n }\n\n if (!BaseField.isNoOptionSelectedValue(this.value) && typeof options[this.value] === 'undefined') {\n options[this.value] = '(invalid) ' + this.value;\n }\n\n return options;\n }\n}\n","import Button from 'flarum/components/Button';\nimport BaseField from './BaseField';\n\nexport default class UrlField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'url';\n attrs.placeholder = 'https://example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n return Button.component(\n {\n onclick: () => this.to(),\n className: 'Button Button--text',\n icon: 'fas fa-link',\n },\n value.replace(/^https?:\\/\\//, '')\n );\n }\n\n to() {\n const popup = window.open();\n popup.location = this.value;\n }\n}\n","import BaseField from './BaseField';\nimport BooleanField from './BooleanField';\nimport EmailField from './EmailField';\nimport SelectField from './SelectField';\nimport UrlField from './UrlField';\n\nexport default class TypeFactory {\n static typeForField({ field, set, value }) {\n let className = BaseField;\n\n const type = this.identify(field);\n\n if (type) {\n className = this.types()[type];\n }\n\n return new className({\n field,\n set,\n value,\n });\n }\n\n static fieldAttribute(field, attribute) {\n if (typeof field[attribute] === 'function') {\n return field[attribute]();\n }\n\n return field[attribute];\n }\n\n static types() {\n return {\n boolean: BooleanField,\n email: EmailField,\n select: SelectField,\n url: UrlField,\n };\n }\n\n /**\n * Identifies how to parse the field answer.\n * @returns {null|string}\n */\n static identify(field) {\n const validation = (this.fieldAttribute(field, 'validation') || '').split(',');\n let identified = null;\n\n // If the field has a type we use it\n const fieldType = this.fieldAttribute(field, 'type');\n if (typeof this.types()[fieldType] !== 'undefined') {\n return fieldType;\n }\n\n // If it's an advanced field with no type we then guess the best type\n validation.forEach((rule) => {\n rule = rule.trim();\n\n if (typeof this.types()[rule] !== 'undefined') {\n identified = rule;\n }\n });\n\n return identified;\n }\n}\n","import app from 'flarum/app';\nimport UserPage from 'flarum/components/UserPage';\nimport Button from 'flarum/components/Button';\nimport Link from 'flarum/components/Link';\nimport TypeFactory from './../types/TypeFactory';\n\n/* global m */\n\nexport default class ProfileConfigurePane extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.loadUser(app.session.user.username());\n this.enforceProfileCompletion = app.forum.attribute('masquerade.force-profile-completion') || false;\n this.profileCompleted = app.forum.attribute('masquerade.profile-completed') || false;\n this.profileNowCompleted = false; // Show \"after required\" text\n this.fields = [];\n this.answers = {};\n this.load();\n\n // Show disabled state if everything is saved\n // Unless the profile isn't complete, in which case show enabled button so it's obvious you will need to save\n this.dirty = !this.profileCompleted;\n }\n\n content() {\n return m(\n 'form.ProfileConfigurePane',\n {\n onsubmit: this.update.bind(this),\n },\n [\n this.enforceProfileCompletion && !this.profileCompleted\n ? m('.Alert.Alert--Error', app.translator.trans('fof-masquerade.forum.alerts.profile-completion-required'))\n : null,\n m(\n '.Fields',\n this.fields\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n if (!this.answers.hasOwnProperty(field.id())) {\n this.answers[field.id()] = field.answer() ? field.answer().content() : '';\n }\n\n return this.field(field);\n })\n ),\n Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.dirty,\n },\n app.translator.trans('fof-masquerade.forum.buttons.save-profile')\n ),\n this.profileNowCompleted\n ? m(\n 'span.Masquerade-NowCompleted',\n app.translator.trans('fof-masquerade.forum.alerts.profile-completed', {\n a: m(Link, {\n href: app.route('index'),\n }),\n })\n )\n : null,\n ]\n );\n }\n\n field(field) {\n const type = TypeFactory.typeForField({\n field,\n set: this.set.bind(this, field),\n value: this.answers[field.id()],\n });\n\n return type.editorField();\n }\n\n load() {\n app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/configure',\n }).then(this.parseResponse.bind(this));\n }\n\n set(field, value) {\n this.answers[field.id()] = value;\n this.dirty = true;\n }\n\n update(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/configure',\n body: this.answers,\n })\n .then((response) => {\n this.dirty = false;\n if (!this.profileCompleted) {\n this.profileCompleted = true;\n this.profileNowCompleted = true;\n }\n\n this.parseResponse(response);\n })\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n\n parseResponse(response) {\n this.fields = app.store.pushPayload(response);\n this.loading = false;\n m.redraw();\n }\n}\n","import UserPage from 'flarum/components/UserPage';\nimport TypeFactory from './../types/TypeFactory';\n\n/* global m */\n\nexport default class ProfileConfigurePane extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.fields = [];\n this.answers = {};\n\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return m('.Masquerade-Bio', [\n m(\n '.Fields',\n this.fields\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n // UserID check must be done with == because userId() is number while id() is string\n this.answers[field.id()] = field.answer() && field.answer().userId() == this.user.id() ? field.answer().content() : null;\n\n return this.field(field);\n })\n ),\n ]);\n }\n\n field(field) {\n const type = TypeFactory.typeForField({\n field,\n value: this.answers[field.id()],\n });\n\n return type.answerField();\n }\n\n load(user) {\n app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/profile/' + user.id(),\n }).then(this.parseResponse.bind(this));\n }\n\n show(user) {\n this.load(user);\n\n super.show(user);\n }\n\n parseResponse(response) {\n this.answers = {};\n this.fields = app.store.pushPayload(response);\n\n this.loading = false;\n m.redraw();\n }\n}\n","import { extend } from 'flarum/extend';\nimport UserCard from 'flarum/components/UserCard';\nimport TypeFactory from './types/TypeFactory';\n\nexport default function () {\n extend(UserCard.prototype, 'infoItems', function (items) {\n let answers = app.forum.attribute('canViewMasquerade') ? this.attrs.user.bioFields() || [] : [];\n\n items.add(\n 'masquerade-bio',\n m(\n 'div',\n answers.map((answer) => {\n const field = answer.attribute('field');\n const type = TypeFactory.typeForField({\n field,\n value: answer.content(),\n });\n\n return type.answerField();\n })\n )\n );\n });\n}\n","import app from 'flarum/app';\nimport User from 'flarum/models/User';\nimport Field from './../lib/models/Field';\nimport Answer from './../lib/models/Answer';\nimport Model from 'flarum/Model';\n\nimport addProfilePane from './addProfilePane';\nimport mutateUserHero from './mutateUserHero';\n\napp.initializers.add('fof-masquerade', (app) => {\n app.store.models['masquerade-field'] = Field;\n app.store.models['masquerade-answer'] = Answer;\n\n User.prototype.bioFields = Model.hasMany('bioFields');\n\n addProfilePane();\n\n mutateUserHero();\n});\n","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport LinkButton from 'flarum/components/LinkButton';\nimport UserPage from 'flarum/components/UserPage';\nimport ProfileConfigurePane from './panes/ProfileConfigurePane';\nimport ProfilePane from './panes/ProfilePane';\n\nexport default function () {\n // The configure route must be registered first because otherwise there's a conflict between the two routes\n app.routes['fof-masquerade-configure-profile'] = {\n path: '/masquerade/configure',\n component: ProfileConfigurePane,\n };\n app.routes['fof-masquerade-view-profile'] = {\n path: '/masquerade/:username',\n component: ProfilePane,\n };\n\n extend(UserPage.prototype, 'navItems', function (items) {\n const isOwnProfileAndCanHaveMasquerade = app.forum.attribute('canHaveMasquerade') && app.session.user.id() === this.user.id();\n\n if (app.forum.attribute('canViewMasquerade') || isOwnProfileAndCanHaveMasquerade) {\n const href = isOwnProfileAndCanHaveMasquerade\n ? app.route('fof-masquerade-configure-profile')\n : app.route('fof-masquerade-view-profile', { username: this.user.username() });\n items.add(\n 'masquerade',\n LinkButton.component(\n {\n href,\n icon: 'far fa-id-card',\n },\n app.translator.trans('fof-masquerade.forum.buttons.view-profile')\n ),\n 200\n );\n }\n });\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@fof/masquerade/webpack/bootstrap","webpack://@fof/masquerade/external \"flarum.core.compat['app']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/Model']\"","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/masquerade/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/masquerade/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/components/Button']\"","webpack://@fof/masquerade/external \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/masquerade/./src/lib/models/Field.js","webpack://@fof/masquerade/external \"flarum.core.compat['common/components/Select']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/extend']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/models/User']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/masquerade/external \"flarum.core.compat['common/components/Link']\"","webpack://@fof/masquerade/external \"flarum.core.compat['forum/components/UserCard']\"","webpack://@fof/masquerade/./src/lib/models/Answer.js","webpack://@fof/masquerade/./src/forum/types/BaseField.js","webpack://@fof/masquerade/./src/forum/types/BooleanField.js","webpack://@fof/masquerade/./src/forum/types/EmailField.js","webpack://@fof/masquerade/./src/forum/types/SelectField.js","webpack://@fof/masquerade/./src/forum/types/UrlField.js","webpack://@fof/masquerade/./src/forum/types/TypeFactory.js","webpack://@fof/masquerade/./src/forum/panes/ProfileConfigurePane.js","webpack://@fof/masquerade/./src/forum/panes/ProfilePane.js","webpack://@fof/masquerade/./src/forum/mutateUserHero.js","webpack://@fof/masquerade/./src/forum/index.js","webpack://@fof/masquerade/./src/forum/addProfilePane.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_assertThisInitialized","self","ReferenceError","_defineProperty","obj","configurable","writable","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","Field","Model","attribute","transformDate","hasOne","apiEndpoint","this","exists","data","id","Answer","BaseField","field","set","readAttribute","validationRules","split","validationRule","ruleName","ruleContent","forEach","rule","editorField","icon","required","prefix","editorInput","description","editorInputAttrs","className","oninput","event","target","answerField","iconName","answerContent","isNoOptionSelectedValue","BooleanField","options","map","option","checked","selected","onclick","label","push","app","translator","trans","indexOf","EmailField","attrs","type","placeholder","email","segment","replace","join","Button","component","mailTo","window","location","Select","onchange","validationIn","UrlField","to","open","TypeFactory","typeForField","identify","types","fieldAttribute","boolean","select","SelectField","url","validation","identified","fieldType","trim","ProfileConfigurePane","oninit","vnode","loading","loadUser","session","user","username","enforceProfileCompletion","forum","profileCompleted","profileNowCompleted","fields","answers","load","dirty","content","onsubmit","update","sort","a","b","answer","disabled","Link","href","route","request","method","then","parseResponse","e","preventDefault","body","response","redraw","store","pushPayload","UserPage","param","userId","show","extend","UserCard","items","bioFields","add","initializers","models","User","hasMany","routes","path","ProfilePane","isOwnProfileAndCanHaveMasquerade","LinkButton","mutateUserHero"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAE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UnF,KAAKkF,KAAKC,aACrEqC,EAAME,IACF,aACAS,IAAW9E,UACP,CACIgD,OACApF,KAAM,kBAEVuB,IAAIC,WAAWC,MAAM,8CAEzB,SDjBZ0F","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 20);\n","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['common/Model'];","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _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}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['forum/components/UserPage'];","import Model from 'flarum/common/Model';\n\nexport default class Field extends Model {\n name = Model.attribute('name');\n description = Model.attribute('description');\n type = Model.attribute('type');\n validation = Model.attribute('validation');\n required = Model.attribute('required');\n prefix = Model.attribute('prefix');\n icon = Model.attribute('icon');\n sort = Model.attribute('sort');\n deleted_at = Model.attribute('deleted_at', Model.transformDate);\n answer = Model.hasOne('answer');\n on_bio = Model.attribute('on_bio');\n\n apiEndpoint() {\n return '/masquerade/fields' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","module.exports = flarum.core.compat['common/components/Select'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/models/User'];","module.exports = flarum.core.compat['common/components/LinkButton'];","module.exports = flarum.core.compat['common/components/Link'];","module.exports = flarum.core.compat['forum/components/UserCard'];","import Model from 'flarum/common/Model';\n\nexport default class Answer extends Model {\n content = Model.attribute('content');\n field = Model.hasOne('field');\n userId = Model.attribute('user_id');\n\n apiEndpoint() {\n return '/masquerade/configure' + (this.exists ? '/' + this.data.id : '');\n }\n}\n","import icon from 'flarum/common/helpers/icon';\n\n/* global m */\n\nexport default class BaseField {\n constructor({ field, set, value }) {\n this.field = field;\n this.set = set;\n this.value = value;\n }\n\n readAttribute(object, attribute) {\n if (typeof object[attribute] === 'function') {\n return object[attribute]();\n }\n\n return object[attribute];\n }\n\n /**\n * Gets all Laravel validation rules split by rule\n * @returns {Array}\n */\n validationRules() {\n return this.readAttribute(this.field, 'validation').split('|');\n }\n\n /**\n * Gets a Laravel validation rule by name\n * @param {string} ruleName\n * @returns {string|null}\n */\n validationRule(ruleName) {\n let ruleContent = null;\n\n this.validationRules().forEach((rule) => {\n const split = rule.split(':', 2);\n\n if (split[0] === ruleName) {\n ruleContent = split[1];\n }\n });\n\n return ruleContent;\n }\n\n editorField() {\n return m('.Form-group.Field', [\n m('label', [this.field.icon() ? [icon(this.field.icon()), ' '] : null, this.field.name(), this.field.required() ? ' *' : null]),\n m('.FormField', [\n this.field.prefix() ? m('.prefix', this.field.prefix()) : null,\n this.editorInput(),\n this.field.description() ? m('.helpText', this.field.description()) : null,\n ]),\n ]);\n }\n\n editorInput() {\n return m('input', this.editorInputAttrs());\n }\n\n editorInputAttrs() {\n return {\n className: 'FormControl',\n oninput: (event) => {\n this.set(event.target.value);\n },\n value: this.value,\n required: this.field.required(),\n };\n }\n\n answerField() {\n const iconName = this.readAttribute(this.field, 'icon');\n\n return m('.Masquerade-Bio-Set', [\n m('span.Masquerade-Bio-Field', [iconName ? [icon(iconName), ' '] : null, this.readAttribute(this.field, 'name') + ': ']),\n m('span.Masquerade-Bio-Answer', this.answerContent()),\n ]);\n }\n\n answerContent() {\n return this.value;\n }\n\n static isNoOptionSelectedValue(value) {\n // The value can be null when coming from the API\n // The value can be '' when the field does not exist on the user (the empty string is set in ProfileConfigurePane)\n return value === null || value === '';\n }\n}\n","import icon from 'flarum/common/helpers/icon';\nimport BaseField from './BaseField';\n\nexport default class BooleanField extends BaseField {\n editorInput() {\n return this.options().map((option) =>\n m(\n 'div',\n m('label', [\n m('input[type=radio]', {\n checked: option.selected(this.value),\n onclick: () => {\n this.set(option.key);\n },\n }),\n ' ' + option.label,\n ])\n )\n );\n }\n\n options() {\n let options = [];\n\n if (!this.readAttribute(this.field, 'required')) {\n options.push({\n selected: (value) => BaseField.isNoOptionSelectedValue(value),\n key: null,\n label: app.translator.trans('fof-masquerade.forum.fields.select.none-optional'),\n });\n }\n\n options.push({\n selected: (value) => ['true', '1', 1, true, 'yes'].indexOf(value) !== -1,\n key: 'true',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.yes'),\n });\n\n options.push({\n selected: (value) => ['false', '0', 0, false, 'no'].indexOf(value) !== -1,\n key: 'false',\n label: app.translator.trans('fof-masquerade.forum.fields.boolean.no'),\n });\n\n // This is probably overkill because it looks like the backend casts the value anyway\n if (\n !BaseField.isNoOptionSelectedValue(this.value) &&\n ['true', '1', 1, true, 'yes', 'false', '0', 0, false, 'no'].indexOf(this.value) === -1\n ) {\n options.push({\n selected: () => true,\n key: this.value,\n label: '(invalid) ' + this.value,\n });\n }\n\n return options;\n }\n\n answerContent() {\n if (BaseField.isNoOptionSelectedValue(this.value)) {\n return '';\n }\n\n return [1, '1', true, 'true', 'yes'].indexOf(this.value) !== -1\n ? [icon('far fa-check-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.yes')]\n : [icon('far fa-square'), ' ', app.translator.trans('fof-masquerade.forum.fields.boolean.no')];\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport BaseField from './BaseField';\n\nexport default class EmailField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'email';\n attrs.placeholder = 'you@example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n const email = value\n .split(/@|\\./)\n .map((segment) => {\n return segment.replace(/(.{2})./g, '$1*');\n })\n .join('*');\n\n return Button.component(\n {\n onclick: () => this.mailTo(),\n className: 'Button Button--text',\n icon: 'far fa-envelope',\n },\n email\n );\n }\n\n mailTo() {\n window.location = 'mailto:' + this.value;\n }\n}\n","import Select from 'flarum/common/components/Select';\nimport BaseField from './BaseField';\n\nconst NO_OPTION_SELECTED_KEY = 'fof_masquerade_no_option_selected';\n\nexport default class EmailField extends BaseField {\n editorInput() {\n return Select.component({\n onchange: (value) => {\n if (value === NO_OPTION_SELECTED_KEY) {\n value = null;\n }\n\n this.set(value);\n },\n value: BaseField.isNoOptionSelectedValue(this.value) ? NO_OPTION_SELECTED_KEY : this.value,\n options: this.options(),\n });\n }\n\n options() {\n let options = {};\n\n if (!this.readAttribute(this.field, 'required')) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-optional');\n } else if (BaseField.isNoOptionSelectedValue(this.value)) {\n options[NO_OPTION_SELECTED_KEY] = app.translator.trans('fof-masquerade.forum.fields.select.none-required');\n }\n\n const validationIn = this.validationRule('in');\n\n if (validationIn) {\n validationIn.split(',').forEach((value) => {\n options[value] = value;\n });\n }\n\n if (!BaseField.isNoOptionSelectedValue(this.value) && typeof options[this.value] === 'undefined') {\n options[this.value] = '(invalid) ' + this.value;\n }\n\n return options;\n }\n}\n","import Button from 'flarum/common/components/Button';\nimport BaseField from './BaseField';\n\nexport default class UrlField extends BaseField {\n editorInputAttrs() {\n let attrs = super.editorInputAttrs();\n\n attrs.type = 'url';\n attrs.placeholder = 'https://example.com';\n\n return attrs;\n }\n\n answerContent() {\n const value = this.value;\n\n if (!value) {\n return null;\n }\n\n return Button.component(\n {\n onclick: () => this.to(),\n className: 'Button Button--text',\n icon: 'fas fa-link',\n },\n value.replace(/^https?:\\/\\//, '')\n );\n }\n\n to() {\n const popup = window.open();\n popup.location = this.value;\n }\n}\n","import BaseField from './BaseField';\nimport BooleanField from './BooleanField';\nimport EmailField from './EmailField';\nimport SelectField from './SelectField';\nimport UrlField from './UrlField';\n\nexport default class TypeFactory {\n static typeForField({ field, set, value }) {\n let className = BaseField;\n\n const type = this.identify(field);\n\n if (type) {\n className = this.types()[type];\n }\n\n return new className({\n field,\n set,\n value,\n });\n }\n\n static fieldAttribute(field, attribute) {\n if (typeof field[attribute] === 'function') {\n return field[attribute]();\n }\n\n return field[attribute];\n }\n\n static types() {\n return {\n boolean: BooleanField,\n email: EmailField,\n select: SelectField,\n url: UrlField,\n };\n }\n\n /**\n * Identifies how to parse the field answer.\n * @returns {null|string}\n */\n static identify(field) {\n const validation = (this.fieldAttribute(field, 'validation') || '').split(',');\n let identified = null;\n\n // If the field has a type we use it\n const fieldType = this.fieldAttribute(field, 'type');\n if (typeof this.types()[fieldType] !== 'undefined') {\n return fieldType;\n }\n\n // If it's an advanced field with no type we then guess the best type\n validation.forEach((rule) => {\n rule = rule.trim();\n\n if (typeof this.types()[rule] !== 'undefined') {\n identified = rule;\n }\n });\n\n return identified;\n }\n}\n","import app from 'flarum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport Button from 'flarum/common/components/Button';\nimport Link from 'flarum/common/components/Link';\nimport TypeFactory from './../types/TypeFactory';\n\n/* global m */\n\nexport default class ProfileConfigurePane extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.loadUser(app.session.user.username());\n this.enforceProfileCompletion = app.forum.attribute('masquerade.force-profile-completion') || false;\n this.profileCompleted = app.forum.attribute('masquerade.profile-completed') || false;\n this.profileNowCompleted = false; // Show \"after required\" text\n this.fields = [];\n this.answers = {};\n this.load();\n\n // Show disabled state if everything is saved\n // Unless the profile isn't complete, in which case show enabled button so it's obvious you will need to save\n this.dirty = !this.profileCompleted;\n }\n\n content() {\n return m(\n 'form.ProfileConfigurePane',\n {\n onsubmit: this.update.bind(this),\n },\n [\n this.enforceProfileCompletion && !this.profileCompleted\n ? m('.Alert.Alert--Error', app.translator.trans('fof-masquerade.forum.alerts.profile-completion-required'))\n : null,\n m(\n '.Fields',\n this.fields\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n if (!this.answers.hasOwnProperty(field.id())) {\n this.answers[field.id()] = field.answer() ? field.answer().content() : '';\n }\n\n return this.field(field);\n })\n ),\n Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n loading: this.loading,\n disabled: !this.dirty,\n },\n app.translator.trans('fof-masquerade.forum.buttons.save-profile')\n ),\n this.profileNowCompleted\n ? m(\n 'span.Masquerade-NowCompleted',\n app.translator.trans('fof-masquerade.forum.alerts.profile-completed', {\n a: m(Link, {\n href: app.route('index'),\n }),\n })\n )\n : null,\n ]\n );\n }\n\n field(field) {\n const type = TypeFactory.typeForField({\n field,\n set: this.set.bind(this, field),\n value: this.answers[field.id()],\n });\n\n return type.editorField();\n }\n\n load() {\n app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/configure',\n }).then(this.parseResponse.bind(this));\n }\n\n set(field, value) {\n this.answers[field.id()] = value;\n this.dirty = true;\n }\n\n update(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/masquerade/configure',\n body: this.answers,\n })\n .then((response) => {\n this.dirty = false;\n if (!this.profileCompleted) {\n this.profileCompleted = true;\n this.profileNowCompleted = true;\n }\n\n this.parseResponse(response);\n })\n .catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n\n parseResponse(response) {\n this.fields = app.store.pushPayload(response);\n this.loading = false;\n m.redraw();\n }\n}\n","import UserPage from 'flarum/forum/components/UserPage';\nimport TypeFactory from './../types/TypeFactory';\n\n/* global m */\n\nexport default class ProfileConfigurePane extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n this.loading = true;\n\n this.fields = [];\n this.answers = {};\n\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return m('.Masquerade-Bio', [\n m(\n '.Fields',\n this.fields\n .sort((a, b) => a.sort() - b.sort())\n .map((field) => {\n // UserID check must be done with == because userId() is number while id() is string\n this.answers[field.id()] = field.answer() && field.answer().userId() == this.user.id() ? field.answer().content() : null;\n\n return this.field(field);\n })\n ),\n ]);\n }\n\n field(field) {\n const type = TypeFactory.typeForField({\n field,\n value: this.answers[field.id()],\n });\n\n return type.answerField();\n }\n\n load(user) {\n app.request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + '/masquerade/profile/' + user.id(),\n }).then(this.parseResponse.bind(this));\n }\n\n show(user) {\n this.load(user);\n\n super.show(user);\n }\n\n parseResponse(response) {\n this.answers = {};\n this.fields = app.store.pushPayload(response);\n\n this.loading = false;\n m.redraw();\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport UserCard from 'flarum/forum/components/UserCard';\nimport TypeFactory from './types/TypeFactory';\n\nexport default function () {\n extend(UserCard.prototype, 'infoItems', function (items) {\n let answers = app.forum.attribute('canViewMasquerade') ? this.attrs.user.bioFields() || [] : [];\n\n items.add(\n 'masquerade-bio',\n m(\n 'div',\n answers.map((answer) => {\n const field = answer.attribute('field');\n const type = TypeFactory.typeForField({\n field,\n value: answer.content(),\n });\n\n return type.answerField();\n })\n )\n );\n });\n}\n","import app from 'flarum/app';\nimport User from 'flarum/common/models/User';\nimport Field from './../lib/models/Field';\nimport Answer from './../lib/models/Answer';\nimport Model from 'flarum/common/Model';\n\nimport addProfilePane from './addProfilePane';\nimport mutateUserHero from './mutateUserHero';\n\napp.initializers.add('fof-masquerade', (app) => {\n app.store.models['masquerade-field'] = Field;\n app.store.models['masquerade-answer'] = Answer;\n\n User.prototype.bioFields = Model.hasMany('bioFields');\n\n addProfilePane();\n\n mutateUserHero();\n});\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/app';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport ProfileConfigurePane from './panes/ProfileConfigurePane';\nimport ProfilePane from './panes/ProfilePane';\n\nexport default function () {\n // The configure route must be registered first because otherwise there's a conflict between the two routes\n app.routes['fof-masquerade-configure-profile'] = {\n path: '/masquerade/configure',\n component: ProfileConfigurePane,\n };\n app.routes['fof-masquerade-view-profile'] = {\n path: '/masquerade/:username',\n component: ProfilePane,\n };\n\n extend(UserPage.prototype, 'navItems', function (items) {\n const isOwnProfileAndCanHaveMasquerade = app.forum.attribute('canHaveMasquerade') && app.session.user.id() === this.user.id();\n\n if (app.forum.attribute('canViewMasquerade') || isOwnProfileAndCanHaveMasquerade) {\n const href = isOwnProfileAndCanHaveMasquerade\n ? app.route('fof-masquerade-configure-profile')\n : app.route('fof-masquerade-view-profile', { username: this.user.username() });\n items.add(\n 'masquerade',\n LinkButton.component(\n {\n href,\n icon: 'far fa-id-card',\n },\n app.translator.trans('fof-masquerade.forum.buttons.view-profile')\n ),\n 200\n );\n }\n });\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/package-lock.json b/js/package-lock.json index 47939ba..53e8d2c 100644 --- a/js/package-lock.json +++ b/js/package-lock.json @@ -12,38 +12,38 @@ } }, "@babel/compat-data": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.12.13.tgz", - "integrity": "sha512-U/hshG5R+SIoW7HVWIdmy1cB7s3ki+r3FpyEZiCgpi4tFgPnX/vynY80ZGSASOIrUM6O7VxOgCZgdt7h97bUGg==" + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.12.tgz", + "integrity": "sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==" }, "@babel/core": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.16.tgz", - "integrity": "sha512-t/hHIB504wWceOeaOoONOhu+gX+hpjfeN6YRBT209X/4sibZQfSF1I0HFRRlBe97UZZosGx5XwUg1ZgNbelmNw==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.14.tgz", + "integrity": "sha512-wZso/vyF4ki0l0znlgM4inxbdrUvCb+cVz8grxDq+6C9k6qbqoIJteQOKicaKjCipU3ISV+XedCqpL2RJJVehA==", "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.12.15", - "@babel/helper-module-transforms": "^7.12.13", - "@babel/helpers": "^7.12.13", - "@babel/parser": "^7.12.16", + "@babel/generator": "^7.13.9", + "@babel/helper-compilation-targets": "^7.13.13", + "@babel/helper-module-transforms": "^7.13.14", + "@babel/helpers": "^7.13.10", + "@babel/parser": "^7.13.13", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13", + "@babel/traverse": "^7.13.13", + "@babel/types": "^7.13.14", "convert-source-map": "^1.7.0", "debug": "^4.1.0", - "gensync": "^1.0.0-beta.1", + "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "lodash": "^4.17.19", - "semver": "^5.4.1", + "semver": "^6.3.0", "source-map": "^0.5.0" } }, "@babel/generator": { - "version": "7.12.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.15.tgz", - "integrity": "sha512-6F2xHxBiFXWNSGb7vyCUTBF8RCLY66rS0zEPcP8t/nQyXjha5EuK4z7H5o7fWG8B4M7y6mqVWq1J+1PuwRhecQ==", + "version": "7.13.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.9.tgz", + "integrity": "sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw==", "requires": { - "@babel/types": "^7.12.13", + "@babel/types": "^7.13.0", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -66,43 +66,58 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.12.16.tgz", - "integrity": "sha512-dBHNEEaZx7F3KoUYqagIhRIeqyyuI65xMndMZ3WwGwEBI609I4TleYQHcrS627vbKyNTXqShoN+fvYD9HuQxAg==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz", + "integrity": "sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==", "requires": { - "@babel/compat-data": "^7.12.13", - "@babel/helper-validator-option": "^7.12.16", + "@babel/compat-data": "^7.13.12", + "@babel/helper-validator-option": "^7.12.17", "browserslist": "^4.14.5", - "semver": "^5.5.0" + "semver": "^6.3.0" } }, "@babel/helper-create-class-features-plugin": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.12.16.tgz", - "integrity": "sha512-KbSEj8l9zYkMVHpQqM3wJNxS1d9h3U9vm/uE5tpjMbaj3lTp+0noe3KPsV5dSD9jxKnf9jO9Ip9FX5PKNZCKow==", + "version": "7.13.11", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.13.11.tgz", + "integrity": "sha512-ays0I7XYq9xbjCSvT+EvysLgfc3tOkwCULHjrnscGT3A9qD4sk3wXnJ3of0MAWsWGjdinFvajHU2smYuqXKMrw==", "requires": { "@babel/helper-function-name": "^7.12.13", - "@babel/helper-member-expression-to-functions": "^7.12.16", + "@babel/helper-member-expression-to-functions": "^7.13.0", "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-replace-supers": "^7.12.13", + "@babel/helper-replace-supers": "^7.13.0", "@babel/helper-split-export-declaration": "^7.12.13" } }, "@babel/helper-create-regexp-features-plugin": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.16.tgz", - "integrity": "sha512-jAcQ1biDYZBdaAxB4yg46/XirgX7jBDiMHDbwYQOgtViLBXGxJpZQ24jutmBqAIB/q+AwB6j+NbBXjKxEY8vqg==", + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz", + "integrity": "sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg==", "requires": { "@babel/helper-annotate-as-pure": "^7.12.13", "regexpu-core": "^4.7.1" } }, + "@babel/helper-define-polyfill-provider": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.1.5.tgz", + "integrity": "sha512-nXuzCSwlJ/WKr8qxzW816gwyT6VZgiJG17zR40fou70yfAcqjoNyTLl/DQ+FExw5Hx5KNqshmN8Ldl/r2N7cTg==", + "requires": { + "@babel/helper-compilation-targets": "^7.13.0", + "@babel/helper-module-imports": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/traverse": "^7.13.0", + "debug": "^4.1.1", + "lodash.debounce": "^4.0.8", + "resolve": "^1.14.2", + "semver": "^6.1.2" + } + }, "@babel/helper-explode-assignable-expression": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.12.13.tgz", - "integrity": "sha512-5loeRNvMo9mx1dA/d6yNi+YiKziJZFylZnCo1nmFF4qPU4yJ14abhWESuSMQSlQxWdxdOFzxXjk/PpfudTtYyw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.13.0.tgz", + "integrity": "sha512-qS0peLTDP8kOisG1blKbaoBg/o9OSa1qoumMjTK5pM+KDTtpxpsiubnCGP34vK8BXGcb2M9eigwgvoJryrzwWA==", "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.0" } }, "@babel/helper-function-name": { @@ -124,43 +139,43 @@ } }, "@babel/helper-hoist-variables": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.12.13.tgz", - "integrity": "sha512-KSC5XSj5HreRhYQtZ3cnSnQwDzgnbdUDEFsxkN0m6Q3WrCRt72xrnZ8+h+pX7YxM7hr87zIO3a/v5p/H3TrnVw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.13.0.tgz", + "integrity": "sha512-0kBzvXiIKfsCA0y6cFEIJf4OdzfpRuNk4+YTeHZpGGc666SATFKTz6sRncwFnQk7/ugJ4dSrCj6iJuvW4Qwr2g==", "requires": { - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.0" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.16.tgz", - "integrity": "sha512-zYoZC1uvebBFmj1wFAlXwt35JLEgecefATtKp20xalwEK8vHAixLBXTGxNrVGEmTT+gzOThUgr8UEdgtalc1BQ==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-imports": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.13.tgz", - "integrity": "sha512-NGmfvRp9Rqxy0uHSSVP+SRIW1q31a7Ji10cLBcqSDUngGentY4FRiHOFZFE1CLU5eiL0oE8reH7Tg1y99TDM/g==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/helper-module-transforms": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.13.tgz", - "integrity": "sha512-acKF7EjqOR67ASIlDTupwkKM1eUisNAjaSduo5Cz+793ikfnpe7p4Q7B7EWU2PCoSTPWsQkR7hRUWEIZPiVLGA==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz", + "integrity": "sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==", "requires": { - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-replace-supers": "^7.12.13", - "@babel/helper-simple-access": "^7.12.13", + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", "@babel/helper-split-export-declaration": "^7.12.13", "@babel/helper-validator-identifier": "^7.12.11", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13", - "lodash": "^4.17.19" + "@babel/traverse": "^7.13.13", + "@babel/types": "^7.13.14" } }, "@babel/helper-optimise-call-expression": { @@ -172,37 +187,37 @@ } }, "@babel/helper-plugin-utils": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.12.13.tgz", - "integrity": "sha512-C+10MXCXJLiR6IeG9+Wiejt9jmtFpxUc3MQqCmPY8hfCjyUGl9kT+B2okzEZrtykiwrc4dbCPdDoz0A/HQbDaA==" + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.13.0.tgz", + "integrity": "sha512-ZPafIPSwzUlAoWT8DKs1W2VyF2gOWthGd5NGFMsBcMMol+ZhK+EQY/e6V96poa6PA/Bh+C9plWN0hXO1uB8AfQ==" }, "@babel/helper-remap-async-to-generator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.12.13.tgz", - "integrity": "sha512-Qa6PU9vNcj1NZacZZI1Mvwt+gXDH6CTfgAkSjeRMLE8HxtDK76+YDId6NQR+z7Rgd5arhD2cIbS74r0SxD6PDA==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.13.0.tgz", + "integrity": "sha512-pUQpFBE9JvC9lrQbpX0TmeNIy5s7GnZjna2lhhcHC7DzgBs6fWn722Y5cfwgrtrqc7NAJwMvOa0mKhq6XaE4jg==", "requires": { "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-wrap-function": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/helper-wrap-function": "^7.13.0", + "@babel/types": "^7.13.0" } }, "@babel/helper-replace-supers": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.13.tgz", - "integrity": "sha512-pctAOIAMVStI2TMLhozPKbf5yTEXc0OJa0eENheb4w09SrgOWEs+P4nTOZYJQCqs8JlErGLDPDJTiGIp3ygbLg==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", "requires": { - "@babel/helper-member-expression-to-functions": "^7.12.13", + "@babel/helper-member-expression-to-functions": "^7.13.12", "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" } }, "@babel/helper-simple-access": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.13.tgz", - "integrity": "sha512-0ski5dyYIHEfwpWGx5GPWhH35j342JaflmCeQmsPWcrOQDtCN6C1zKAVRFVbK53lPW2c9TsuLLSUDf0tIGJ5hA==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", "requires": { - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -227,35 +242,35 @@ "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==" }, "@babel/helper-validator-option": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.16.tgz", - "integrity": "sha512-uCgsDBPUQDvzr11ePPo4TVEocxj8RXjUVSC/Y8N1YpVAI/XDdUwGJu78xmlGhTxj2ntaWM7n9LQdRtyhOzT2YQ==" + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz", + "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==" }, "@babel/helper-wrap-function": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.12.13.tgz", - "integrity": "sha512-t0aZFEmBJ1LojdtJnhOaQEVejnzYhyjWHSsNSNo8vOYRbAJNh6r6GQF7pd36SqG7OKGbn+AewVQ/0IfYfIuGdw==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.13.0.tgz", + "integrity": "sha512-1UX9F7K3BS42fI6qd2A4BjKzgGjToscyZTdp1DjknHLCIvpgne6918io+aL5LXFcER/8QWiwpoY902pVEqgTXA==", "requires": { "@babel/helper-function-name": "^7.12.13", "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.0" } }, "@babel/helpers": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.13.tgz", - "integrity": "sha512-oohVzLRZ3GQEk4Cjhfs9YkJA4TdIDTObdBEZGrd6F/T0GPSnuV6l22eMcxlvcvzVIPH3VTtxbseudM1zIE+rPQ==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.10.tgz", + "integrity": "sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ==", "requires": { "@babel/template": "^7.12.13", - "@babel/traverse": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.0" } }, "@babel/highlight": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.12.13.tgz", - "integrity": "sha512-kocDQvIbgMKlWxXe9fof3TQ+gkIPOUSEYhJjqUjvKMez3krV7vbzYCDq39Oj11UAVK7JqPVGQPlgE85dPNlQww==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", + "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", "requires": { "@babel/helper-validator-identifier": "^7.12.11", "chalk": "^2.0.0", @@ -263,36 +278,46 @@ } }, "@babel/parser": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.16.tgz", - "integrity": "sha512-c/+u9cqV6F0+4Hpq01jnJO+GLp2DdT63ppz9Xa+6cHaajM9VFzK/iDXiKK65YtpeVwu+ctfS6iqlMqRgQRzeCw==" + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.13.tgz", + "integrity": "sha512-OhsyMrqygfk5v8HmWwOzlYjJrtLaFhF34MrfG/Z73DgYCI6ojNUTUp2TYbtnjo8PegeJp12eamsNettCQjKjVw==" + }, + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.13.12.tgz", + "integrity": "sha512-d0u3zWKcoZf379fOeJdr1a5WPDny4aOFZ6hlfKivgK0LY7ZxNfoaHL2fWwdGtHyVvra38FC+HVYkO+byfSA8AQ==", + "requires": { + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", + "@babel/plugin-proposal-optional-chaining": "^7.13.12" + } }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.12.13.tgz", - "integrity": "sha512-1KH46Hx4WqP77f978+5Ye/VUbuwQld2hph70yaw2hXS2v7ER2f3nlpNMu909HO2rbvP0NKLlMVDPh9KXklVMhA==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.13.8.tgz", + "integrity": "sha512-rPBnhj+WgoSmgq+4gQUtXx/vOcU+UYtjy1AA/aeD61Hwj410fwYyqfUcRP3lR8ucgliVJL/G7sXcNUecC75IXA==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/helper-remap-async-to-generator": "^7.12.13", - "@babel/plugin-syntax-async-generators": "^7.8.0" + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-remap-async-to-generator": "^7.13.0", + "@babel/plugin-syntax-async-generators": "^7.8.4" } }, "@babel/plugin-proposal-class-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.12.13.tgz", - "integrity": "sha512-8SCJ0Ddrpwv4T7Gwb33EmW1V9PY5lggTO+A8WjyIwxrSHDUyBw4MtF96ifn1n8H806YlxbVCoKXbbmzD6RD+cA==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.13.0.tgz", + "integrity": "sha512-KnTDjFNC1g+45ka0myZNvSBFLhNCLN+GeGYLDEA8Oq7MZ6yMgfLoIRh86GRT0FjtJhZw8JyUskP9uvj5pHM9Zg==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-create-class-features-plugin": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-proposal-dynamic-import": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.12.16.tgz", - "integrity": "sha512-yiDkYFapVxNOCcBfLnsb/qdsliroM+vc3LHiZwS4gh7pFjo5Xq3BDhYBNn3H3ao+hWPvqeeTdU+s+FIvokov+w==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.13.8.tgz", + "integrity": "sha512-ONWKj0H6+wIRCkZi9zSbZtE/r73uOhMVHh256ys0UzfM7I3d4n+spZNWjOnJv2gzopumP2Wxi186vI8N0Y2JyQ==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-dynamic-import": "^7.8.0" + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.3" } }, "@babel/plugin-proposal-export-namespace-from": { @@ -305,30 +330,30 @@ } }, "@babel/plugin-proposal-json-strings": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.12.13.tgz", - "integrity": "sha512-v9eEi4GiORDg8x+Dmi5r8ibOe0VXoKDeNPYcTTxdGN4eOWikrJfDJCJrr1l5gKGvsNyGJbrfMftC2dTL6oz7pg==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.13.8.tgz", + "integrity": "sha512-w4zOPKUFPX1mgvTmL/fcEqy34hrQ1CRcGxdphBc6snDnnqJ47EZDIyop6IwXzAC8G916hsIuXB2ZMBCExC5k7Q==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-json-strings": "^7.8.0" + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-json-strings": "^7.8.3" } }, "@babel/plugin-proposal-logical-assignment-operators": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.12.13.tgz", - "integrity": "sha512-fqmiD3Lz7jVdK6kabeSr1PZlWSUVqSitmHEe3Z00dtGTKieWnX9beafvavc32kjORa5Bai4QNHgFDwWJP+WtSQ==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.13.8.tgz", + "integrity": "sha512-aul6znYB4N4HGweImqKn59Su9RS8lbUIqxtXTOcAGtNIDczoEFv+l1EhmX8rUBp3G1jMjKJm8m0jXVp63ZpS4A==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" } }, "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.12.13.tgz", - "integrity": "sha512-Qoxpy+OxhDBI5kRqliJFAl4uWXk3Bn24WeFstPH0iLymFehSAUR8MHpqU7njyXv/qbo7oN6yTy5bfCmXdKpo1Q==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.13.8.tgz", + "integrity": "sha512-iePlDPBn//UhxExyS9KyeYU7RM9WScAG+D3Hhno0PLJebAEpDZMocbDe64eqynhNAnwz/vZoL/q/QB2T1OH39A==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" } }, "@babel/plugin-proposal-numeric-separator": { @@ -341,41 +366,43 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.12.13.tgz", - "integrity": "sha512-WvA1okB/0OS/N3Ldb3sziSrXg6sRphsBgqiccfcQq7woEn5wQLNX82Oc4PlaFcdwcWHuQXAtb8ftbS8Fbsg/sg==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.13.8.tgz", + "integrity": "sha512-DhB2EuB1Ih7S3/IRX5AFVgZ16k3EzfRbq97CxAVI1KSYcW+lexV8VZb7G7L8zuPVSdQMRn0kiBpf/Yzu9ZKH0g==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-transform-parameters": "^7.12.13" + "@babel/compat-data": "^7.13.8", + "@babel/helper-compilation-targets": "^7.13.8", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-transform-parameters": "^7.13.0" } }, "@babel/plugin-proposal-optional-catch-binding": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.12.13.tgz", - "integrity": "sha512-9+MIm6msl9sHWg58NvqpNpLtuFbmpFYk37x8kgnGzAHvX35E1FyAwSUt5hIkSoWJFSAH+iwU8bJ4fcD1zKXOzg==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.13.8.tgz", + "integrity": "sha512-0wS/4DUF1CuTmGo+NiaHfHcVSeSLj5S3e6RivPTg/2k3wOv3jO35tZ6/ZWsQhQMvdgI7CwphjQa/ccarLymHVA==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" } }, "@babel/plugin-proposal-optional-chaining": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.12.16.tgz", - "integrity": "sha512-O3ohPwOhkwji5Mckb7F/PJpJVJY3DpPsrt/F0Bk40+QMk9QpAIqeGusHWqu/mYqsM8oBa6TziL/2mbERWsUZjg==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.13.12.tgz", + "integrity": "sha512-fcEdKOkIB7Tf4IxrgEVeFC4zeJSTr78no9wTdBuZZbqF64kzllU0ybo2zrzm7gUQfxGhBgq4E39oRs8Zx/RMYQ==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1", - "@babel/plugin-syntax-optional-chaining": "^7.8.0" + "@babel/plugin-syntax-optional-chaining": "^7.8.3" } }, "@babel/plugin-proposal-private-methods": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.12.13.tgz", - "integrity": "sha512-sV0V57uUwpauixvR7s2o75LmwJI6JECwm5oPUY5beZB1nBl2i37hc7CJGqB5G+58fur5Y6ugvl3LRONk5x34rg==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.13.0.tgz", + "integrity": "sha512-MXyyKQd9inhx1kDYPkFRVOBXQ20ES8Pto3T7UZ92xj2mY0EVD8oAVzeyYuVfy/mxAdTSIayOvg+aVzcHV2bn6Q==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-create-class-features-plugin": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-proposal-unicode-property-regex": { @@ -492,21 +519,21 @@ } }, "@babel/plugin-transform-arrow-functions": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.12.13.tgz", - "integrity": "sha512-tBtuN6qtCTd+iHzVZVOMNp+L04iIJBpqkdY42tWbmjIT5wvR2kx7gxMBsyhQtFzHwBbyGi9h8J8r9HgnOpQHxg==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.13.0.tgz", + "integrity": "sha512-96lgJagobeVmazXFaDrbmCLQxBysKu7U6Do3mLsx27gf5Dk85ezysrs2BZUpXD703U/Su1xTBDxxar2oa4jAGg==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-async-to-generator": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.12.13.tgz", - "integrity": "sha512-psM9QHcHaDr+HZpRuJcE1PXESuGWSCcbiGFFhhwfzdbTxaGDVzuVtdNYliAwcRo3GFg0Bc8MmI+AvIGYIJG04A==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.13.0.tgz", + "integrity": "sha512-3j6E004Dx0K3eGmhxVJxwwI89CTJrce7lg3UrtFuDAVQ/2+SJ/h/aSFOeE6/n0WB1GsOffsJp6MnPQNQ8nmwhg==", "requires": { "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/helper-remap-async-to-generator": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-remap-async-to-generator": "^7.13.0" } }, "@babel/plugin-transform-block-scoped-functions": { @@ -526,33 +553,33 @@ } }, "@babel/plugin-transform-classes": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.12.13.tgz", - "integrity": "sha512-cqZlMlhCC1rVnxE5ZGMtIb896ijL90xppMiuWXcwcOAuFczynpd3KYemb91XFFPi3wJSe/OcrX9lXoowatkkxA==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.13.0.tgz", + "integrity": "sha512-9BtHCPUARyVH1oXGcSJD3YpsqRLROJx5ZNP6tN5vnk17N0SVf9WCtf8Nuh1CFmgByKKAIMstitKduoCmsaDK5g==", "requires": { "@babel/helper-annotate-as-pure": "^7.12.13", "@babel/helper-function-name": "^7.12.13", "@babel/helper-optimise-call-expression": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/helper-replace-supers": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-replace-supers": "^7.13.0", "@babel/helper-split-export-declaration": "^7.12.13", "globals": "^11.1.0" } }, "@babel/plugin-transform-computed-properties": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.12.13.tgz", - "integrity": "sha512-dDfuROUPGK1mTtLKyDPUavmj2b6kFu82SmgpztBFEO974KMjJT+Ytj3/oWsTUMBmgPcp9J5Pc1SlcAYRpJ2hRA==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.13.0.tgz", + "integrity": "sha512-RRqTYTeZkZAz8WbieLTvKUEUxZlUTdmL5KGMyZj7FnMfLNKV4+r5549aORG/mgojRmFlQMJDUupwAMiF2Q7OUg==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-destructuring": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.12.13.tgz", - "integrity": "sha512-Dn83KykIFzjhA3FDPA1z4N+yfF3btDGhjnJwxIj0T43tP0flCujnU8fKgEkf0C1biIpSv9NZegPBQ1J6jYkwvQ==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.0.tgz", + "integrity": "sha512-zym5em7tePoNT9s964c0/KU3JPPnuq7VhIxPRefJ4/s82cD+q1mgKfuGRDMCPL0HTyKz4dISuQlCusfgCJ86HA==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-dotall-regex": { @@ -582,11 +609,11 @@ } }, "@babel/plugin-transform-for-of": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.12.13.tgz", - "integrity": "sha512-xCbdgSzXYmHGyVX3+BsQjcd4hv4vA/FDy7Kc8eOpzKmBBPEOTurt0w5fCRQaGl+GSBORKgJdstQ1rHl4jbNseQ==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.13.0.tgz", + "integrity": "sha512-IHKT00mwUVYE0zzbkDgNRP6SRzvfGCYsOxIRz8KsiaaHCcT9BWIkO+H9QRJseHBLOGBZkHUdHiqj6r0POsdytg==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-function-name": { @@ -615,45 +642,45 @@ } }, "@babel/plugin-transform-modules-amd": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.12.13.tgz", - "integrity": "sha512-JHLOU0o81m5UqG0Ulz/fPC68/v+UTuGTWaZBUwpEk1fYQ1D9LfKV6MPn4ttJKqRo5Lm460fkzjLTL4EHvCprvA==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.13.0.tgz", + "integrity": "sha512-EKy/E2NHhY/6Vw5d1k3rgoobftcNUmp9fGjb9XZwQLtTctsRBOTRO7RHHxfIky1ogMN5BxN7p9uMA3SzPfotMQ==", "requires": { - "@babel/helper-module-transforms": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0", "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.12.13.tgz", - "integrity": "sha512-OGQoeVXVi1259HjuoDnsQMlMkT9UkZT9TpXAsqWplS/M0N1g3TJAn/ByOCeQu7mfjc5WpSsRU+jV1Hd89ts0kQ==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.13.8.tgz", + "integrity": "sha512-9QiOx4MEGglfYZ4XOnU79OHr6vIWUakIj9b4mioN8eQIoEh+pf5p/zEB36JpDFWA12nNMiRf7bfoRvl9Rn79Bw==", "requires": { - "@babel/helper-module-transforms": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-simple-access": "^7.12.13", "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.12.13.tgz", - "integrity": "sha512-aHfVjhZ8QekaNF/5aNdStCGzwTbU7SI5hUybBKlMzqIMC7w7Ho8hx5a4R/DkTHfRfLwHGGxSpFt9BfxKCoXKoA==", + "version": "7.13.8", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.13.8.tgz", + "integrity": "sha512-hwqctPYjhM6cWvVIlOIe27jCIBgHCsdH2xCJVAYQm7V5yTMoilbVMi9f6wKg0rpQAOn6ZG4AOyvCqFF/hUh6+A==", "requires": { - "@babel/helper-hoist-variables": "^7.12.13", - "@babel/helper-module-transforms": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-hoist-variables": "^7.13.0", + "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-validator-identifier": "^7.12.11", "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-umd": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.12.13.tgz", - "integrity": "sha512-BgZndyABRML4z6ibpi7Z98m4EVLFI9tVsZDADC14AElFaNHHBcJIovflJ6wtCqFxwy2YJ1tJhGRsr0yLPKoN+w==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.13.0.tgz", + "integrity": "sha512-D/ILzAh6uyvkWjKKyFE/W0FzWwasv6vPTSqPcjxFqn6QpX3u8DjRVliq4F2BamO2Wee/om06Vyy+vPkNrd4wxw==", "requires": { - "@babel/helper-module-transforms": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-module-transforms": "^7.13.0", + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-named-capturing-groups-regex": { @@ -690,11 +717,11 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.12.13.tgz", - "integrity": "sha512-e7QqwZalNiBRHCpJg/P8s/VJeSRYgmtWySs1JwvfwPqhBbiWfOcHDKdeAi6oAyIimoKWBlwc8oTgbZHdhCoVZA==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.13.0.tgz", + "integrity": "sha512-Jt8k/h/mIwE2JFEOb3lURoY5C85ETcYPnbuAJ96zRBzh1XHtQZfs62ChZ6EP22QlC8c7Xqr9q+e1SU5qttwwjw==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-property-literals": { @@ -714,23 +741,23 @@ } }, "@babel/plugin-transform-react-jsx": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.12.16.tgz", - "integrity": "sha512-dNu0vAbIk8OkqJfGtYF6ADk6jagoyAl+Ks5aoltbAlfoKv8d6yooi3j+kObeSQaCj9PgN6KMZPB90wWyek5TmQ==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.13.12.tgz", + "integrity": "sha512-jcEI2UqIcpCqB5U5DRxIl0tQEProI2gcu+g8VTIqxLO5Iidojb4d77q+fwGseCvd8af/lJ9masp4QWzBXFE2xA==", "requires": { "@babel/helper-annotate-as-pure": "^7.12.13", - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/plugin-syntax-jsx": "^7.12.13", - "@babel/types": "^7.12.13" + "@babel/types": "^7.13.12" } }, "@babel/plugin-transform-react-jsx-development": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.12.16.tgz", - "integrity": "sha512-GOp5SkMC4zhHwLbOSYhF+WpIZSf5bGzaKQTT9jWkemJRDM/CE6FtPydXjEYO3pHcna2Zjvg4mQ1lfjOR/4jsaQ==", + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.12.17.tgz", + "integrity": "sha512-BPjYV86SVuOaudFhsJR1zjgxxOhJDt6JHNoD48DxWEIxUCAMjV1ys6DYw4SDYZh0b1QsS2vfIA9t/ZsQGsDOUQ==", "requires": { - "@babel/plugin-transform-react-jsx": "^7.12.16" + "@babel/plugin-transform-react-jsx": "^7.12.17" } }, "@babel/plugin-transform-react-pure-annotations": { @@ -759,13 +786,16 @@ } }, "@babel/plugin-transform-runtime": { - "version": "7.12.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.12.15.tgz", - "integrity": "sha512-OwptMSRnRWJo+tJ9v9wgAf72ydXWfYSXWhnQjZing8nGZSDFqU1MBleKM3+DriKkcbv7RagA8gVeB0A1PNlNow==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.13.10.tgz", + "integrity": "sha512-Y5k8ipgfvz5d/76tx7JYbKQTcgFSU6VgJ3kKQv4zGTKr+a9T/KBvfRvGtSFgKDQGt/DBykQixV0vNWKIdzWErA==", "requires": { "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", - "semver": "^5.5.1" + "@babel/helper-plugin-utils": "^7.13.0", + "babel-plugin-polyfill-corejs2": "^0.1.4", + "babel-plugin-polyfill-corejs3": "^0.1.3", + "babel-plugin-polyfill-regenerator": "^0.1.2", + "semver": "^6.3.0" } }, "@babel/plugin-transform-shorthand-properties": { @@ -777,11 +807,11 @@ } }, "@babel/plugin-transform-spread": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.12.13.tgz", - "integrity": "sha512-dUCrqPIowjqk5pXsx1zPftSq4sT0aCeZVAxhdgs3AMgyaDmoUT0G+5h3Dzja27t76aUEIJWlFgPJqJ/d4dbTtg==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.13.0.tgz", + "integrity": "sha512-V6vkiXijjzYeFmQTr3dBxPtZYLPcUfY34DebOU27jIl2M/Y8Egm52Hw82CSjjPqd54GTlJs5x+CR7HeNr24ckg==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", "@babel/helper-skip-transparent-expression-wrappers": "^7.12.1" } }, @@ -794,11 +824,11 @@ } }, "@babel/plugin-transform-template-literals": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.12.13.tgz", - "integrity": "sha512-arIKlWYUgmNsF28EyfmiQHJLJFlAJNYkuQO10jL46ggjBpeb2re1P9K9YGxNJB45BqTbaslVysXDYm/g3sN/Qg==", + "version": "7.13.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.13.0.tgz", + "integrity": "sha512-d67umW6nlfmr1iehCcBv69eSUSySk1EsIS8aTDX4Xo9qajAh6mYtcl4kJrBkGXuxZPEgVr7RVfAvNW6YQkd4Mw==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13" + "@babel/helper-plugin-utils": "^7.13.0" } }, "@babel/plugin-transform-typeof-symbol": { @@ -827,76 +857,79 @@ } }, "@babel/preset-env": { - "version": "7.12.16", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.12.16.tgz", - "integrity": "sha512-BXCAXy8RE/TzX416pD2hsVdkWo0G+tYd16pwnRV4Sc0fRwTLRS/Ssv8G5RLXUGQv7g4FG7TXkdDJxCjQ5I+Zjg==", - "requires": { - "@babel/compat-data": "^7.12.13", - "@babel/helper-compilation-targets": "^7.12.16", - "@babel/helper-module-imports": "^7.12.13", - "@babel/helper-plugin-utils": "^7.12.13", - "@babel/helper-validator-option": "^7.12.16", - "@babel/plugin-proposal-async-generator-functions": "^7.12.13", - "@babel/plugin-proposal-class-properties": "^7.12.13", - "@babel/plugin-proposal-dynamic-import": "^7.12.16", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.13.12.tgz", + "integrity": "sha512-JzElc6jk3Ko6zuZgBtjOd01pf9yYDEIH8BcqVuYIuOkzOwDesoa/Nz4gIo4lBG6K861KTV9TvIgmFuT6ytOaAA==", + "requires": { + "@babel/compat-data": "^7.13.12", + "@babel/helper-compilation-targets": "^7.13.10", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-validator-option": "^7.12.17", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12", + "@babel/plugin-proposal-async-generator-functions": "^7.13.8", + "@babel/plugin-proposal-class-properties": "^7.13.0", + "@babel/plugin-proposal-dynamic-import": "^7.13.8", "@babel/plugin-proposal-export-namespace-from": "^7.12.13", - "@babel/plugin-proposal-json-strings": "^7.12.13", - "@babel/plugin-proposal-logical-assignment-operators": "^7.12.13", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.12.13", + "@babel/plugin-proposal-json-strings": "^7.13.8", + "@babel/plugin-proposal-logical-assignment-operators": "^7.13.8", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.13.8", "@babel/plugin-proposal-numeric-separator": "^7.12.13", - "@babel/plugin-proposal-object-rest-spread": "^7.12.13", - "@babel/plugin-proposal-optional-catch-binding": "^7.12.13", - "@babel/plugin-proposal-optional-chaining": "^7.12.16", - "@babel/plugin-proposal-private-methods": "^7.12.13", + "@babel/plugin-proposal-object-rest-spread": "^7.13.8", + "@babel/plugin-proposal-optional-catch-binding": "^7.13.8", + "@babel/plugin-proposal-optional-chaining": "^7.13.12", + "@babel/plugin-proposal-private-methods": "^7.13.0", "@babel/plugin-proposal-unicode-property-regex": "^7.12.13", - "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", "@babel/plugin-syntax-numeric-separator": "^7.10.4", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", "@babel/plugin-syntax-top-level-await": "^7.12.13", - "@babel/plugin-transform-arrow-functions": "^7.12.13", - "@babel/plugin-transform-async-to-generator": "^7.12.13", + "@babel/plugin-transform-arrow-functions": "^7.13.0", + "@babel/plugin-transform-async-to-generator": "^7.13.0", "@babel/plugin-transform-block-scoped-functions": "^7.12.13", "@babel/plugin-transform-block-scoping": "^7.12.13", - "@babel/plugin-transform-classes": "^7.12.13", - "@babel/plugin-transform-computed-properties": "^7.12.13", - "@babel/plugin-transform-destructuring": "^7.12.13", + "@babel/plugin-transform-classes": "^7.13.0", + "@babel/plugin-transform-computed-properties": "^7.13.0", + "@babel/plugin-transform-destructuring": "^7.13.0", "@babel/plugin-transform-dotall-regex": "^7.12.13", "@babel/plugin-transform-duplicate-keys": "^7.12.13", "@babel/plugin-transform-exponentiation-operator": "^7.12.13", - "@babel/plugin-transform-for-of": "^7.12.13", + "@babel/plugin-transform-for-of": "^7.13.0", "@babel/plugin-transform-function-name": "^7.12.13", "@babel/plugin-transform-literals": "^7.12.13", "@babel/plugin-transform-member-expression-literals": "^7.12.13", - "@babel/plugin-transform-modules-amd": "^7.12.13", - "@babel/plugin-transform-modules-commonjs": "^7.12.13", - "@babel/plugin-transform-modules-systemjs": "^7.12.13", - "@babel/plugin-transform-modules-umd": "^7.12.13", + "@babel/plugin-transform-modules-amd": "^7.13.0", + "@babel/plugin-transform-modules-commonjs": "^7.13.8", + "@babel/plugin-transform-modules-systemjs": "^7.13.8", + "@babel/plugin-transform-modules-umd": "^7.13.0", "@babel/plugin-transform-named-capturing-groups-regex": "^7.12.13", "@babel/plugin-transform-new-target": "^7.12.13", "@babel/plugin-transform-object-super": "^7.12.13", - "@babel/plugin-transform-parameters": "^7.12.13", + "@babel/plugin-transform-parameters": "^7.13.0", "@babel/plugin-transform-property-literals": "^7.12.13", "@babel/plugin-transform-regenerator": "^7.12.13", "@babel/plugin-transform-reserved-words": "^7.12.13", "@babel/plugin-transform-shorthand-properties": "^7.12.13", - "@babel/plugin-transform-spread": "^7.12.13", + "@babel/plugin-transform-spread": "^7.13.0", "@babel/plugin-transform-sticky-regex": "^7.12.13", - "@babel/plugin-transform-template-literals": "^7.12.13", + "@babel/plugin-transform-template-literals": "^7.13.0", "@babel/plugin-transform-typeof-symbol": "^7.12.13", "@babel/plugin-transform-unicode-escapes": "^7.12.13", "@babel/plugin-transform-unicode-regex": "^7.12.13", - "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.12.13", - "core-js-compat": "^3.8.0", - "semver": "^5.5.0" + "@babel/preset-modules": "^0.1.4", + "@babel/types": "^7.13.12", + "babel-plugin-polyfill-corejs2": "^0.1.4", + "babel-plugin-polyfill-corejs3": "^0.1.3", + "babel-plugin-polyfill-regenerator": "^0.1.2", + "core-js-compat": "^3.9.0", + "semver": "^6.3.0" } }, "@babel/preset-modules": { @@ -912,21 +945,22 @@ } }, "@babel/preset-react": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.12.13.tgz", - "integrity": "sha512-TYM0V9z6Abb6dj1K7i5NrEhA13oS5ujUYQYDfqIBXYHOc2c2VkFgc+q9kyssIyUfy4/hEwqrgSlJ/Qgv8zJLsA==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.13.13.tgz", + "integrity": "sha512-gx+tDLIE06sRjKJkVtpZ/t3mzCDOnPG+ggHZG9lffUbX8+wC739x20YQc9V35Do6ZAxaUc/HhVHIiOzz5MvDmA==", "requires": { - "@babel/helper-plugin-utils": "^7.12.13", + "@babel/helper-plugin-utils": "^7.13.0", + "@babel/helper-validator-option": "^7.12.17", "@babel/plugin-transform-react-display-name": "^7.12.13", - "@babel/plugin-transform-react-jsx": "^7.12.13", - "@babel/plugin-transform-react-jsx-development": "^7.12.12", + "@babel/plugin-transform-react-jsx": "^7.13.12", + "@babel/plugin-transform-react-jsx-development": "^7.12.17", "@babel/plugin-transform-react-pure-annotations": "^7.12.1" } }, "@babel/runtime": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.13.tgz", - "integrity": "sha512-8+3UMPBrjFa/6TtKi/7sehPKqfAm4g6K+YQjyyFOLUTxzOngcRZTlAVY8sc2CORJYqdHQY8gRPHmn+qo15rCBw==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.10.tgz", + "integrity": "sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw==", "requires": { "regenerator-runtime": "^0.13.4" } @@ -942,25 +976,24 @@ } }, "@babel/traverse": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.13.tgz", - "integrity": "sha512-3Zb4w7eE/OslI0fTp8c7b286/cQps3+vdLW3UcwC8VSJC6GbKn55aeVVu2QJNuCDoeKyptLOFrPq8WqZZBodyA==", + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.13.tgz", + "integrity": "sha512-CblEcwmXKR6eP43oQGG++0QMTtCjAsa3frUuzHoiIJWpaIIi8dwMyEFUJoXRLxagGqCK+jALRwIO+o3R9p/uUg==", "requires": { "@babel/code-frame": "^7.12.13", - "@babel/generator": "^7.12.13", + "@babel/generator": "^7.13.9", "@babel/helper-function-name": "^7.12.13", "@babel/helper-split-export-declaration": "^7.12.13", - "@babel/parser": "^7.12.13", - "@babel/types": "^7.12.13", + "@babel/parser": "^7.13.13", + "@babel/types": "^7.13.13", "debug": "^4.1.0", - "globals": "^11.1.0", - "lodash": "^4.17.19" + "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.13.tgz", - "integrity": "sha512-oKrdZTld2im1z8bDwTOQvUbxKwE+854zc16qWZQlcTqMN00pWxHQ4ZeOq0yDMnisOpRykH2/5Qqcrk/OlbAjiQ==", + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", + "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", "requires": { "@babel/helper-validator-identifier": "^7.12.11", "lodash": "^4.17.19", @@ -1225,9 +1258,9 @@ }, "dependencies": { "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" } } }, @@ -1290,6 +1323,33 @@ "object.assign": "^4.1.0" } }, + "babel-plugin-polyfill-corejs2": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.1.10.tgz", + "integrity": "sha512-DO95wD4g0A8KRaHKi0D51NdGXzvpqVLnLu5BTvDlpqUEpTmeEtypgC1xqesORaWmiUOQI14UHKlzNd9iZ2G3ZA==", + "requires": { + "@babel/compat-data": "^7.13.0", + "@babel/helper-define-polyfill-provider": "^0.1.5", + "semver": "^6.1.1" + } + }, + "babel-plugin-polyfill-corejs3": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.1.7.tgz", + "integrity": "sha512-u+gbS9bbPhZWEeyy1oR/YaaSpod/KDT07arZHb80aTpl8H5ZBq+uN1nN9/xtX7jQyfLdPfoqI4Rue/MQSWJquw==", + "requires": { + "@babel/helper-define-polyfill-provider": "^0.1.5", + "core-js-compat": "^3.8.1" + } + }, + "babel-plugin-polyfill-regenerator": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.1.6.tgz", + "integrity": "sha512-OUrYG9iKPKz8NxswXbRAdSwF0GhRdIEMTloQATJi4bDuFqrXaXcCUT/VGNrr8pBcjMh1RxZ7Xt9cytVJTJfvMg==", + "requires": { + "@babel/helper-define-polyfill-provider": "^0.1.5" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -1367,9 +1427,9 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "bn.js": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", - "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, "brace-expansion": { "version": "1.1.11", @@ -1586,9 +1646,9 @@ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "caniuse-lite": { - "version": "1.0.30001187", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001187.tgz", - "integrity": "sha512-w7/EP1JRZ9552CyrThUnay2RkZ1DXxKe/Q2swTC4+LElLh9RRYrL1Z+27LlakB8kzY0fSmHw9mc7XYDUKAKWMA==" + "version": "1.0.30001207", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001207.tgz", + "integrity": "sha512-UPQZdmAsyp2qfCTiMU/zqGSWOYaY9F9LL61V8f+8MrubsaDGpaHD9HRV/EWZGULZn0Hxu48SKzI5DgFwTvHuYw==" }, "chalk": { "version": "2.4.2", @@ -1727,9 +1787,9 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "colorette": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz", - "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==" + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" }, "commander": { "version": "2.20.3", @@ -1799,11 +1859,11 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" }, "core-js-compat": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.8.3.tgz", - "integrity": "sha512-1sCb0wBXnBIL16pfFG1Gkvei6UzvKyTNYpiC41yrdjEv0UoJoq9E/abTMzyYJ6JpTkAj15dLjbqifIzEBDVvog==", + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.10.0.tgz", + "integrity": "sha512-9yVewub2MXNYyGvuLnMHcN1k9RkvB7/ofktpeKTIaASyB88YYqGzUnu0ywMMhJrDHOMiTjSHWGzR+i7Wb9Z1kQ==", "requires": { - "browserslist": "^4.16.1", + "browserslist": "^4.16.3", "semver": "7.0.0" }, "dependencies": { @@ -1829,9 +1889,9 @@ }, "dependencies": { "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" } } }, @@ -1870,6 +1930,13 @@ "semver": "^5.5.0", "shebang-command": "^1.2.0", "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } } }, "crypto-browserify": { @@ -1983,9 +2050,9 @@ }, "dependencies": { "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" } } }, @@ -2006,9 +2073,9 @@ } }, "electron-to-chromium": { - "version": "1.3.664", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.664.tgz", - "integrity": "sha512-yb8LrTQXQnh9yhnaIHLk6CYugF/An50T20+X0h++hjjhVfgSp1DGoMSYycF8/aD5eiqS4QwaNhiduFvK8rifRg==" + "version": "1.3.707", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.707.tgz", + "integrity": "sha512-BqddgxNPrcWnbDdJw7SzXVzPmp+oiyjVrc7tkQVaznPGSS9SKZatw6qxoP857M+HbOyyqJQwYQtsuFIMSTNSZA==" }, "elliptic": { "version": "6.5.4", @@ -2025,9 +2092,9 @@ }, "dependencies": { "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" } } }, @@ -2123,9 +2190,9 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "events": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", - "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==" }, "evp_bytestokey": { "version": "1.0.3", @@ -2333,6 +2400,12 @@ "resolve-dir": "^1.0.1" } }, + "flarum": { + "version": "0.1.0-beta.16", + "resolved": "https://registry.npmjs.org/flarum/-/flarum-0.1.0-beta.16.tgz", + "integrity": "sha512-uovm+6J8TO35dfbTSRtHRH6tz71W4dnEDfB63NOKHIhOz8oRh65qyWpXtlBOjv9f1cFMkMcjGHbWetb5lAIEnQ==", + "dev": true + }, "flarum-webpack-config": { "version": "0.1.0-beta.10", "resolved": "https://registry.npmjs.org/flarum-webpack-config/-/flarum-webpack-config-0.1.0-beta.10.tgz", @@ -2446,9 +2519,9 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "optional": true, "requires": { "is-glob": "^4.0.1" @@ -2510,9 +2583,9 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-symbols": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" }, "has-value": { "version": "1.0.0", @@ -2732,6 +2805,14 @@ "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, + "is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "requires": { + "has": "^1.0.3" + } + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -2908,9 +2989,14 @@ } }, "lodash": { - "version": "4.17.20", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" }, "lru-cache": { "version": "5.1.1", @@ -2926,13 +3012,6 @@ "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "requires": { "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } } }, "map-cache": { @@ -2997,9 +3076,9 @@ }, "dependencies": { "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" } } }, @@ -3154,9 +3233,9 @@ } }, "node-releases": { - "version": "1.1.70", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.70.tgz", - "integrity": "sha512-Slf2s69+2/uAD79pVVQo8uSiC34+g8GWY8UH2Qtqv34ZfhYrxpYpfzs9Js9d6O0mbDmALuxaTlplnBTnSELcrw==" + "version": "1.1.71", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz", + "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==" }, "normalize-path": { "version": "3.0.0", @@ -3326,6 +3405,11 @@ "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + }, "pbkdf2": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", @@ -3402,9 +3486,9 @@ }, "dependencies": { "bn.js": { - "version": "4.11.9", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", - "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" } } }, @@ -3547,9 +3631,9 @@ "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==" }, "regjsparser": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.7.tgz", - "integrity": "sha512-ib77G0uxsA2ovgiYbCVGx4Pv3PSttAx2vIwidqQzbL2U5S4Q+j00HdSAneSBuyVcMvEnTXMjiGgB+DlXozVhpQ==", + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", "requires": { "jsesc": "~0.5.0" }, @@ -3587,6 +3671,15 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, + "resolve": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, "resolve-cwd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", @@ -3685,9 +3778,9 @@ } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "serialize-javascript": { "version": "4.0.0", @@ -4112,6 +4205,11 @@ "ajv-keywords": "^3.1.0" } }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -4347,9 +4445,9 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" }, "vm-browserify": { "version": "1.1.2", diff --git a/js/package.json b/js/package.json index feaeab7..f296312 100644 --- a/js/package.json +++ b/js/package.json @@ -1,18 +1,19 @@ { - "private": true, "name": "@fof/masquerade", + "private": true, "dependencies": { - "flarum-webpack-config": "0.1.0-beta.10", + "flarum-webpack-config": "^0.1.0-beta.10", "html5sortable": "^0.9.17", - "webpack": "^4.0.0", - "webpack-cli": "^3.0.7" + "webpack": "^4.43.0", + "webpack-cli": "^3.3.12" }, "scripts": { "dev": "webpack --mode development --watch", "build": "webpack --mode production", - "format": "prettier --single-quote --trailing-comma es5 --print-width 150 --tab-width 4 --write src" + "lint": "prettier --single-quote --trailing-comma es5 --print-width 150 --tab-width 4 --write src" }, "devDependencies": { - "prettier": "^2.1.2" + "flarum": "0.1.0-beta.16", + "prettier": "^2.2.1" } } diff --git a/js/src/admin/components/MasqueradePage.js b/js/src/admin/components/MasqueradePage.js index 3baab66..382b5d9 100644 --- a/js/src/admin/components/MasqueradePage.js +++ b/js/src/admin/components/MasqueradePage.js @@ -1,13 +1,13 @@ import sortable from 'html5sortable/dist/html5sortable.es.js'; import app from 'flarum/app'; -import icon from 'flarum/helpers/icon'; -import ExtensionPage from 'flarum/components/ExtensionPage'; -import Select from 'flarum/components/Select'; -import Switch from 'flarum/components/Switch'; -import Button from 'flarum/components/Button'; -import saveSettings from 'flarum/utils/saveSettings'; -import withAttr from 'flarum/utils/withAttr'; +import icon from 'flarum/common/helpers/icon'; +import ExtensionPage from 'flarum/admin/components/ExtensionPage'; +import Select from 'flarum/common/components/Select'; +import Switch from 'flarum/common/components/Switch'; +import Button from 'flarum/common/components/Button'; +import saveSettings from 'flarum/admin/utils/saveSettings'; +import withAttr from 'flarum/common/utils/withAttr'; import SelectFieldOptionEditor from './SelectFieldOptionEditor'; /* global m, $ */ diff --git a/js/src/admin/components/SelectFieldOptionEditor.js b/js/src/admin/components/SelectFieldOptionEditor.js index 209ec5e..bf9ad69 100644 --- a/js/src/admin/components/SelectFieldOptionEditor.js +++ b/js/src/admin/components/SelectFieldOptionEditor.js @@ -1,6 +1,6 @@ import app from 'flarum/app'; -import Component from 'flarum/Component'; -import icon from 'flarum/helpers/icon'; +import Component from 'flarum/common/Component'; +import icon from 'flarum/common/helpers/icon'; /* global m */ diff --git a/js/src/forum/addProfilePane.js b/js/src/forum/addProfilePane.js index dd0af8c..810d6a6 100644 --- a/js/src/forum/addProfilePane.js +++ b/js/src/forum/addProfilePane.js @@ -1,7 +1,7 @@ -import { extend } from 'flarum/extend'; +import { extend } from 'flarum/common/extend'; import app from 'flarum/app'; -import LinkButton from 'flarum/components/LinkButton'; -import UserPage from 'flarum/components/UserPage'; +import LinkButton from 'flarum/common/components/LinkButton'; +import UserPage from 'flarum/forum/components/UserPage'; import ProfileConfigurePane from './panes/ProfileConfigurePane'; import ProfilePane from './panes/ProfilePane'; diff --git a/js/src/forum/index.js b/js/src/forum/index.js index 5346f2c..2a64d0a 100644 --- a/js/src/forum/index.js +++ b/js/src/forum/index.js @@ -1,8 +1,8 @@ import app from 'flarum/app'; -import User from 'flarum/models/User'; +import User from 'flarum/common/models/User'; import Field from './../lib/models/Field'; import Answer from './../lib/models/Answer'; -import Model from 'flarum/Model'; +import Model from 'flarum/common/Model'; import addProfilePane from './addProfilePane'; import mutateUserHero from './mutateUserHero'; diff --git a/js/src/forum/mutateUserHero.js b/js/src/forum/mutateUserHero.js index 50e8232..55ee1e7 100644 --- a/js/src/forum/mutateUserHero.js +++ b/js/src/forum/mutateUserHero.js @@ -1,5 +1,5 @@ -import { extend } from 'flarum/extend'; -import UserCard from 'flarum/components/UserCard'; +import { extend } from 'flarum/common/extend'; +import UserCard from 'flarum/forum/components/UserCard'; import TypeFactory from './types/TypeFactory'; export default function () { diff --git a/js/src/forum/panes/ProfileConfigurePane.js b/js/src/forum/panes/ProfileConfigurePane.js index f9e6f89..6ee6362 100644 --- a/js/src/forum/panes/ProfileConfigurePane.js +++ b/js/src/forum/panes/ProfileConfigurePane.js @@ -1,7 +1,7 @@ import app from 'flarum/app'; -import UserPage from 'flarum/components/UserPage'; -import Button from 'flarum/components/Button'; -import Link from 'flarum/components/Link'; +import UserPage from 'flarum/forum/components/UserPage'; +import Button from 'flarum/common/components/Button'; +import Link from 'flarum/common/components/Link'; import TypeFactory from './../types/TypeFactory'; /* global m */ diff --git a/js/src/forum/panes/ProfilePane.js b/js/src/forum/panes/ProfilePane.js index c0ff386..bbd5ab1 100644 --- a/js/src/forum/panes/ProfilePane.js +++ b/js/src/forum/panes/ProfilePane.js @@ -1,4 +1,4 @@ -import UserPage from 'flarum/components/UserPage'; +import UserPage from 'flarum/forum/components/UserPage'; import TypeFactory from './../types/TypeFactory'; /* global m */ diff --git a/js/src/forum/types/BaseField.js b/js/src/forum/types/BaseField.js index 0a8b103..7d3b644 100644 --- a/js/src/forum/types/BaseField.js +++ b/js/src/forum/types/BaseField.js @@ -1,4 +1,4 @@ -import icon from 'flarum/helpers/icon'; +import icon from 'flarum/common/helpers/icon'; /* global m */ diff --git a/js/src/forum/types/BooleanField.js b/js/src/forum/types/BooleanField.js index cf86102..1ebc0c3 100644 --- a/js/src/forum/types/BooleanField.js +++ b/js/src/forum/types/BooleanField.js @@ -1,4 +1,4 @@ -import icon from 'flarum/helpers/icon'; +import icon from 'flarum/common/helpers/icon'; import BaseField from './BaseField'; export default class BooleanField extends BaseField { diff --git a/js/src/forum/types/EmailField.js b/js/src/forum/types/EmailField.js index 85456cc..c87991f 100644 --- a/js/src/forum/types/EmailField.js +++ b/js/src/forum/types/EmailField.js @@ -1,4 +1,4 @@ -import Button from 'flarum/components/Button'; +import Button from 'flarum/common/components/Button'; import BaseField from './BaseField'; export default class EmailField extends BaseField { diff --git a/js/src/forum/types/SelectField.js b/js/src/forum/types/SelectField.js index 7b84a7b..4ad1599 100644 --- a/js/src/forum/types/SelectField.js +++ b/js/src/forum/types/SelectField.js @@ -1,4 +1,4 @@ -import Select from 'flarum/components/Select'; +import Select from 'flarum/common/components/Select'; import BaseField from './BaseField'; const NO_OPTION_SELECTED_KEY = 'fof_masquerade_no_option_selected'; diff --git a/js/src/forum/types/UrlField.js b/js/src/forum/types/UrlField.js index 30b04d5..9554648 100644 --- a/js/src/forum/types/UrlField.js +++ b/js/src/forum/types/UrlField.js @@ -1,4 +1,4 @@ -import Button from 'flarum/components/Button'; +import Button from 'flarum/common/components/Button'; import BaseField from './BaseField'; export default class UrlField extends BaseField { diff --git a/js/src/lib/models/Answer.js b/js/src/lib/models/Answer.js index 3e723cc..ca213c3 100644 --- a/js/src/lib/models/Answer.js +++ b/js/src/lib/models/Answer.js @@ -1,4 +1,4 @@ -import Model from 'flarum/Model'; +import Model from 'flarum/common/Model'; export default class Answer extends Model { content = Model.attribute('content'); diff --git a/js/src/lib/models/Field.js b/js/src/lib/models/Field.js index 84147ce..01a3e81 100644 --- a/js/src/lib/models/Field.js +++ b/js/src/lib/models/Field.js @@ -1,4 +1,4 @@ -import Model from 'flarum/Model'; +import Model from 'flarum/common/Model'; export default class Field extends Model { name = Model.attribute('name'); diff --git a/src/Content/ConfigureProfile.php b/src/Content/ConfigureProfile.php index 7828f49..26fc766 100644 --- a/src/Content/ConfigureProfile.php +++ b/src/Content/ConfigureProfile.php @@ -3,17 +3,12 @@ namespace FoF\Masquerade\Content; use Flarum\Frontend\Document; -use Flarum\User\Exception\PermissionDeniedException; use Psr\Http\Message\ServerRequestInterface; class ConfigureProfile { public function __invoke(Document $document, ServerRequestInterface $request) { - if (!$request->getAttribute('session')->get('user_id')) { - throw new PermissionDeniedException; - } - $request->getAttribute('actor')->assertCan('fof.masquerade.have-profile'); } } diff --git a/src/FieldType/TypeFactory.php b/src/FieldType/TypeFactory.php index 2be01b3..177946e 100644 --- a/src/FieldType/TypeFactory.php +++ b/src/FieldType/TypeFactory.php @@ -42,7 +42,7 @@ public static function typeForField(array $attributes) $class = self::classForType($type); - return app($class); + return resolve($class); } /** diff --git a/src/Gambits/AnswerGambit.php b/src/Gambits/AnswerGambit.php index 730c201..c2af6c1 100644 --- a/src/Gambits/AnswerGambit.php +++ b/src/Gambits/AnswerGambit.php @@ -2,15 +2,21 @@ namespace FoF\Masquerade\Gambits; +use Flarum\Filter\FilterInterface; +use Flarum\Filter\FilterState; use Flarum\Search\AbstractRegexGambit; -use Flarum\Search\AbstractSearch; +use Flarum\Search\SearchState; +use Illuminate\Database\Query\Builder; use Illuminate\Database\Query\Expression; -class AnswerGambit extends AbstractRegexGambit +class AnswerGambit extends AbstractRegexGambit implements FilterInterface { - protected $pattern = 'answer:(.+)'; + protected function getGambitPattern() + { + return 'answer:(.+)'; + } - public function apply(AbstractSearch $search, $bit) + public function apply(SearchState $search, $bit) { if (!$search->getActor()->hasPermission('fof.masquerade.view-profile')) { return false; @@ -19,15 +25,30 @@ public function apply(AbstractSearch $search, $bit) return parent::apply($search, $bit); } - protected function conditions(AbstractSearch $search, array $matches, $negate) + protected function conditions(SearchState $search, array $matches, $negate) { $bit = $matches[1]; - $search->getQuery()->whereExists(function ($query) use ($bit) { - $query->select(app('flarum.db')->raw(1)) + $this->constrain($search->getQuery(), $bit, $negate); + } + + public function getFilterKey(): string + { + return 'answer'; + } + + public function filter(FilterState $filterState, string $filterValue, bool $negate) + { + $this->constrain($filterState->getQuery(), $filterValue, $negate); + } + + protected function constrain(Builder $query, string $bit, bool $negate) + { + $query->whereExists(function (Builder $query) use ($bit) { + $query->select($query->raw(1)) ->from('fof_masquerade_answers') ->where('users.id', new Expression('user_id')) ->where('content', 'like', "%$bit%"); - }); + }, 'and', $negate); } } diff --git a/src/Listeners/AddUserGambits.php b/src/Listeners/AddUserGambits.php deleted file mode 100644 index dd719b1..0000000 --- a/src/Listeners/AddUserGambits.php +++ /dev/null @@ -1,14 +0,0 @@ -gambits->add(AnswerGambit::class); - } -}