diff --git a/js/dist/forum.js b/js/dist/forum.js index ac495bb9..ae4ea41f 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t={24:(t,o,e)=>{var n=e(735).default;function r(){"use strict";t.exports=r=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var o,e={},a=Object.prototype,l=a.hasOwnProperty,s=Object.defineProperty||function(t,o,e){t[o]=e.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",p=i.toStringTag||"@@toStringTag";function m(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{m({},"")}catch(o){m=function(t,o,e){return t[o]=e}}function d(t,o,e,n){var r=o&&o.prototype instanceof w?o:w,a=Object.create(r.prototype),l=new M(n||[]);return s(a,"_invoke",{value:S(t,e,l)}),a}function f(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function P(){}function N(){}var x={};m(x,u,(function(){return this}));var _=Object.getPrototypeOf,V=_&&_(_(U([])));V&&V!==a&&l.call(V,u)&&(x=V);var I=N.prototype=w.prototype=Object.create(x);function A(t){["next","throw","return"].forEach((function(o){m(t,o,(function(t){return this._invoke(o,t)}))}))}function C(t,o){function e(r,a,s,i){var u=f(t[r],t,a);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==n(p)&&l.call(p,"__await")?o.resolve(p.__await).then((function(t){e("next",t,s,i)}),(function(t){e("throw",t,s,i)})):o.resolve(p).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,i)}))}i(u.arg)}var r;s(this,"_invoke",{value:function(t,n){function a(){return new o((function(o,r){e(t,n,o,r)}))}return r=r?r.then(a,a):a()}})}function S(t,e,n){var r=h;return function(a,l){if(r===g)throw new Error("Generator is already running");if(r===b){if("throw"===a)throw l;return{value:o,done:!0}}for(n.method=a,n.arg=l;;){var s=n.delegate;if(s){var i=O(s,n);if(i){if(i===y)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=f(t,e,n);if("normal"===u.type){if(r=n.done?b:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=b,n.method="throw",n.arg=u.arg)}}}function O(t,e){var n=e.method,r=t.iterator[n];if(r===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=o,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(r,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,y;var l=a.arg;return l?l.done?(e[t.resultName]=l.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=o),e.delegate=null,y):l:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function k(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function E(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function U(t){if(t||""===t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=l.call(a,"catchLoc"),u=l.call(a,"finallyLoc");if(i&&u){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),E(e),y}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var e=this.tryEntries[o];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var r=n.arg;E(e)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:U(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=o),y}},e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function o(e){return t.exports=o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,o(e)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,o,e)=>{var n=e(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},o={};function e(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return t[n](a,a.exports,e),a.exports}e.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},e.d=(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{components:()=>_o,extend:()=>qo,models:()=>Eo,states:()=>Mo,utils:()=>Uo});const t=flarum.core.compat["forum/app"];var o=e.n(t);const r=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/Badge"];var l=e.n(a);const s=flarum.core.compat["forum/components/DiscussionList"];var i=e.n(s);const u=flarum.core.compat["common/models/Discussion"];var c=e.n(u);const p=flarum.core.compat["common/utils/classList"];var d=e.n(p);const f=flarum.core.compat["forum/components/DiscussionComposer"];var h=e.n(f);const v=flarum.core.compat["forum/components/ReplyComposer"];var g=e.n(v);function b(t,o,e,n,r,a,l){try{var s=t[a](l),i=s.value}catch(t){return void e(t)}s.done?o(i):Promise.resolve(i).then(n,r)}function y(t){return function(){var o=this,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function l(t){b(a,n,r,l,s,"next",t)}function s(t){b(a,n,r,l,s,"throw",t)}l(void 0)}))}}function w(t,o){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(t,o)}function P(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o)}var N=e(183),x=e.n(N);const _=flarum.core.compat["common/components/Modal"];var V=e.n(_);const I=flarum.core.compat["common/Component"];var A=e.n(I);const C=flarum.core.compat["common/components/Button"];var S=e.n(C);const O=flarum.core.compat["common/components/Switch"];var k=e.n(O);const E=flarum.core.compat["common/utils/ItemList"];var M=e.n(E);const U=flarum.core.compat["common/utils/Stream"];var L=e.n(U);const D=flarum.core.compat["common/utils/extractText"];var B=e.n(D);function T(t){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(t)}function j(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(j=function(){return!!t})()}function F(t){var o="function"==typeof Map?new Map:void 0;return F=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(o){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,e)}function e(){return function(t,o,e){if(j())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,o);var r=new(t.bind.apply(t,n));return e&&w(r,e.prototype),r}(t,arguments,T(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),w(e,t)},F(t)}var q=function(t){function o(o){return t.call(this,o+"")||this}return P(o,t),o}(F(Error)),R=function(){function t(o){this.poll=void 0,this.loading=void 0,this.deleting=void 0,this.expandedGroup=void 0,o||(o=t.createNewPoll()),this.loading=!1,this.deleting=!1,this.poll=o,this.expandedGroup="setup"}t.createNewPoll=function(){var t=o().store.createRecord("polls");return t.pushAttributes({question:"",endDate:"",publicPoll:!1,allowMultipleVotes:!1,hideVotes:!1,allowChangeVote:!1,maxVotes:0}),t.tempOptions=[o().store.createRecord("poll_options"),o().store.createRecord("poll_options")],t};var e=t.prototype;return e.isExpanded=function(t){return this.expandedGroup===t},e.expand=function(t){this.expandedGroup=t,m.redraw()},e.save=function(){var t=y(x().mark((function t(o){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.save(o);case 5:this.poll=t.sent,delete this.poll.data.attributes.options;case 7:return t.prev=7,this.loading=!1,m.redraw(),t.finish(7);case 11:case"end":return t.stop()}}),t,this,[[2,,7,11]])})));return function(o){return t.apply(this,arguments)}}(),e.delete=function(){var t=y(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.delete();case 5:this.deleting=!0;case 6:return t.prev=6,this.loading=!1,m.redraw(),t.finish(6);case 10:case"end":return t.stop()}}),t,this,[[2,,6,10]])})));return function(){return t.apply(this,arguments)}}(),t}();const H=flarum.core.compat["common/components/Page"];var G=e.n(H);const z=flarum.core.compat["common/components/LoadingIndicator"];var Y=e.n(z);const J=flarum.core.compat["common/components/LinkButton"];var W=e.n(J),K=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r0?Math.round(this.votes/this.totalVotes*100):0},n.view=function(){var t;this.hasVoted=this.state.hasVoted(),this.totalVotes=this.state.overallVoteCount(),this.votes=this.option.voteCount(),this.voted=this.state.hasVotedFor(this.option);var e=this.state.loadingOptions||this.hasVoted&&!this.poll.canChangeVote(),n=this.canSeeVoteCount?this.percent():Number(this.voted)/((null==(t=this.poll.myVotes())?void 0:t.length)||1)*100,r=m("label",{className:"PollBar","data-selected":!!this.voted,style:"--poll-option-width: "+n+"%"},this.state.showCheckMarks&&m("div",{className:"PollAnswer-checkbox"},m("input",{className:"PollAnswer-input sr-only",type:"checkbox",id:this.option.id(),name:this.name,value:this.answer,checked:this.voted,disabled:e,"aria-labelledby":this.name+"-"+this.option.id()+"-label",onchange:this.state.changeVote.bind(this.state,this.option)}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},this.optionDisplayItems().toArray()),this.option.imageUrl()?m("img",{className:"PollAnswer-image",src:this.option.imageUrl(),alt:this.option.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",this.hasVoted&&"PollVoted",this.option.imageUrl()&&"PollOption-hasImage"),"data-id":this.option.id()},this.canSeeVoteCount?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:this.votes}),onremove:this.hideOptionTooltip},r):r)},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.optionDisplayItems=function(){var t=new(M());return t.add("answer",m("span",{className:"PollAnswer-text-answer",id:this.name+"-"+this.option.id()+"-label"},this.answer)),this.voted&&!this.state.showCheckMarks&&t.add("check",ht()("fas fa-check-circle",{className:"PollAnswer-check"})),this.canSeeVoteCount&&t.add("percent",m("span",{className:d()("PollPercent",100!==this.percent()&&"PollPercent--option")},this.percent(),"%")),t},e}(A()),Pt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-options list-layout"},this.pollOptions().toArray())},e.pollOptions=function(){var t=this,o=new(M());return this.attrs.options.forEach((function(e){o.add("option"+e.id(),t.createOptionView(e))})),o},e.createOptionView=function(t){return m(wt,{name:this.attrs.name,option:t,state:this.attrs.state})},o}(A()),Nt=function(t){function o(){for(var o,e=arguments.length,n=new Array(e),r=0;r0},e.overallVoteCount=function(){return this.poll.voteCount()},e.hasVotedFor=function(t){return this.pendingOptions?this.pendingOptions.has(t.id()):this.poll.myVotes().some((function(o){return o.option()===t}))},e.getMaxVotes=function(){var t=this.poll,o=t.allowMultipleVotes()?t.maxVotes():1;return 0===o&&(o=t.options().length),o},e.showButton=function(){return this.useSubmitUI&&this.pendingSubmit},e.changeVote=function(t,e){var n=e.target;if(!o().session.user)return o().modal.show(_t()),void(n.checked=!1);var r=this.pendingOptions||new Set(this.poll.myVotes().map((function(t){return t.option().id()}))),a=r.delete(t.id());if(this.poll.allowMultipleVotes()||r.clear(),a||r.add(t.id()),this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,this.useSubmitUI)return this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,void m.redraw();this.submit(r,null,(function(){return n.checked=a}))},e.hasSelectedOptions=function(){return this.pendingSubmit},e.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},e.submit=function(t,e,n){var r=this;return void 0===n&&(n=null),this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,r.canSeeVoteCount="number"==typeof r.poll.voteCount(),m.redraw()}))},t}(),kt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.state;return m(S(),{className:"Button Button--primary Poll-submit",loading:e.loadingOptions,onclick:function(o){return t.pollButtonSubmit(e,o)},disabled:!e.hasSelectedOptions()},o().translator.trans("fof-polls.forum.poll.submit_button"))},n.pollButtonSubmit=function(t,o){t.onsubmit()},e}(A());const Et=flarum.core.compat["common/utils/string"];var Mt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-title-component"},this.pollTitleItems().toArray())},e.pollTitleItems=function(){var t=new(M());return t.add("title",m("h3",{className:"Poll-title"},this.attrs.poll.question())),t},o}(A()),Ut=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){if(this.attrs.poll.subtitle())return m("div",{className:"Poll-subtitle-component"},this.pollSubtitleItems().toArray())},e.pollSubtitleItems=function(){var t=new(M());return t.add("subtitle",m("p",{className:"Poll-subtitle"},this.attrs.poll.subtitle())),t},o}(A()),Lt=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;rt.length)&&(o=t.length);for(var e=0,n=new Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.pages);!(o=e()).done;){var n=o.value,r=n.items.indexOf(t);if(-1!==r){n.items.splice(r,1);break}}var a=this.extraPolls.indexOf(t);-1!==a&&this.extraPolls.splice(a),m.redraw()},n.addPoll=function(t){this.removePoll(t),this.extraPolls.unshift(t),m.redraw()},n.getAllItems=function(){return this.extraPolls.concat(t.prototype.getAllItems.call(this))},n.getPages=function(){var o=t.prototype.getPages.call(this);return this.extraPolls.length?[{number:-1,items:this.extraPolls}].concat(o):o},jt(e,[{key:"type",get:function(){return"fof/polls"}}]),e}(Jt()),Zt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),o().forum.attribute("globalPollsEnabled")?(this.state=new Xt({sort:m.route.param("sort"),filter:m.route.param("filter")}),this.state.refresh(),o().setTitle(B()(o().translator.trans("fof-polls.forum.page.nav")))):m.route.set("/")},n.view=function(){return this.loading?m(Y(),null):this.poll?m("div",{className:"PollsListPage"},m("div",{className:"container"},m(Lt,{poll:this.poll}))):m("div",{className:"PollsListPage"},t.prototype.hero.call(this),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"PollsListPage-nav sideNav"},m("ul",null,X()(this.sidebarItems().toArray()))),m("div",{className:"PollsPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},X()(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},X()(this.actionItems().toArray()))),m(zt,{state:this.state})))))},n.sidebarItems=function(){var t=this,e=new(M()),n=o().forum.attribute("canStartGlobalPolls");return e.add("newGlobalPoll",m(S(),{icon:"fas fa-edit",className:"Button Button--primary App-primaryControl PollsPage-newPoll",itemClassName:"App-primaryControl",onclick:function(){t.newPollAction()},disabled:!n},o().translator.trans("fof-polls.forum.poll."+(n?"start_poll_button":"cannot_start_poll_button")))),e.add("nav",m(tt(),{buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:o().translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems().toArray())),e},n.actionItems=function(){var t=this,e=new(M());return e.add("refresh",S().component({title:o().translator.trans("fof-polls.forum.page.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){t.state.refresh()}})),e},n.viewItems=function(){return et().prototype.viewItems()},n.navItems=function(){return et().prototype.navItems()},n.newPollAction=function(){o().session.user?m.route.set(o().route("fof.polls.compose")):o().modal.show(_t())},e}(qt);const to=flarum.core.compat["common/components/Separator"];var oo=e.n(to);const eo={controls:function(t,o){var e=this,n=new(M());return["poll","moderation","destructive"].forEach((function(r){var a=e[r+"Controls"](t,o).toArray();a.length&&(a.forEach((function(t){return n.add(t.itemName,t)})),n.add(r+"Separator",m(oo(),null)))})),n},pollControls:function(t,o){return new(M())},moderationControls:function(t,e){var n=new(M());return t.canEdit()&&n.add("edit",m(S(),{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.edit_label"))),n},destructiveControls:function(t,e){var n=new(M());return t.canDelete()&&n.add("delete",m(S(),{icon:"far fa-trash-alt",onclick:this.deleteAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.delete_label"))),n},deleteAction:function(t){var e=this;return y(x().mark((function n(){return x().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(confirm(o().translator.trans("fof-polls.forum.poll_controls.delete_confirmation"))){n.next=2;break}return n.abrupt("return");case 2:return n.abrupt("return",t.delete().then((function(){e.showDeletionAlert(t,"success"),o().current.matches(nt,{id:t.id()})||o().current.matches(Zt,{id:t.id()})?o().history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")})));case 3:case"end":return n.stop()}}),n)})))()},showDeletionAlert:function(t,e){var n={success:"fof-polls.forum.poll_controls.delete_success_message",error:"fof-polls.forum.poll_controls.delete_error_message"}[e];o().alerts.show({type:e},o().translator.trans(n,{poll:t}))},editAction:function(t){m.route.set(o().route("fof.polls.compose",{id:t.id()}))}};function no(){return no=Object.assign?Object.assign.bind():function(t){for(var o=1;o'),this.$input.appendTo("body").hide().trigger("click").on("change",(function(e){var n=new FormData;n.append(t.attrs.name,$(e.target)[0].files[0]),t.loading=!0,m.redraw(),o().request({method:"POST",url:t.resourceUrl(),serialize:function(t){return t},body:n}).then(t.success.bind(t),t.failure.bind(t))})))},n.remove=function(){var t,e,n=this;this.loading=!0,m.redraw();var r=void 0;null!=(t=this.attrs.poll)&&t.exists||null!=(e=this.attrs.option)&&e.exists||(r=this.fileName),o().request({method:"DELETE",url:this.resourceUrl(r)}).then((function(t){var o,e;return null!=(o=n.attrs.poll)&&o.exists&&n.attrs.poll.pushAttributes({image:null,imageUrl:null,isImageUpload:!1}),null!=(e=n.attrs.option)&&e.exists&&n.attrs.option.pushAttributes({imageUrl:!1}),t})).then(this.success.bind(this),this.failure.bind(this))},n.resourceUrl=function(t){void 0===t&&(t=void 0);var e=o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.name,n=this.attrs.poll,r=this.attrs.option;return t?e+="/name/"+t:(null!=n&&n.exists&&(e+="/"+(null==n?void 0:n.id())),null!=r&&r.exists&&(e+="/"+(null==r?void 0:r.id()))),e},n.getImageUrl=function(){var t,o;return!1!==this.uploadedImageUrl?this.uploadedImageUrl:(null==(t=this.attrs.poll)?void 0:t.imageUrl())||(null==(o=this.attrs.option)?void 0:o.imageUrl())},n.success=function(t){var o,e,n;this.loading=!1,this.uploadedImageUrl=null==t?void 0:t.fileUrl,this.fileName=null==t?void 0:t.fileName,null==(o=(e=this.attrs).onUpload)||o.call(e,null==t?void 0:t.fileName),m.redraw(),null==(n=this.$input)||n.remove()},n.failure=function(t){var o;this.loading=!1,m.redraw(),null==(o=this.$input)||o.remove()},e}(S());const ao=flarum.core.compat["common/utils/RequestError"];var lo=e.n(ao),so=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r=2?S().component({type:"button",className:"Button PollModal--button Button--icon",icon:"fas fa-minus",onclick:r>=2?t.removeOption.bind(t,r):""}):""))})),e},n.addOption=function(){var t=Math.max(o().forum.attribute("pollMaxOptions"),2);this.options.length0;return!o().session.user||r.canVote()||r.hasEnded()||n.add("no-permission",m("span",null,m("i",{className:"icon fas fa-times-circle fa-fw"}),o().translator.trans("fof-polls.forum.no_permission"))),r.endDate()&&n.add("end-date",m("span",null,m("i",{class:"icon fas fa-clock fa-fw"}),r.hasEnded()?o().translator.trans("fof-polls.forum.poll_ended"):o().translator.trans("fof-polls.forum.days_remaining",{time:dayjs(r.endDate()).fromNow()}))),r.canVote()&&(n.add("max-votes",m("span",null,m("i",{className:"icon fas fa-poll fa-fw"}),o().translator.trans("fof-polls.forum.max_votes_allowed",{max:t}))),r.canChangeVote()||n.add("cannot-change-vote",m("span",null,m("i",{className:"icon fas fa-"+(a?"times":"exclamation")+"-circle fa-fw"}),o().translator.trans("fof-polls.forum.poll.cannot_change_vote")))),n},n.viewOption=function(t){var e,n,r,a=this.attrs.poll,l=(null==(e=a.myVotes())?void 0:e.length)>0,s=a.voteCount(),i=this.pendingOptions?this.pendingOptions.has(t.id()):null==(n=a.myVotes())||null==n.some?void 0:n.some((function(o){return o.option()===t})),u=t.voteCount(),c=s>0?Math.round(u/s*100):0,p="number"==typeof u,f=this.loadingOptions||l&&!a.canChangeVote(),h=p?c:Number(i)/((null==(r=a.myVotes())?void 0:r.length)||1)*100,v=!o().session.user||!a.hasEnded()&&a.canVote()&&(!l||a.canChangeVote()),g=m("div",{className:"PollBar","data-selected":!!i,style:"--poll-option-width: "+h+"%"},v&&m("label",{className:"PollAnswer-checkbox"},m("input",{onchange:this.changeVote.bind(this,t),type:"checkbox",checked:i,disabled:f}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},m("span",{className:"PollAnswer-text-answer"},t.answer()),i&&!v&&ht()("fas fa-check-circle",{className:"PollAnswer-check"}),p&&m("span",{className:d()("PollPercent",100!==c&&"PollPercent--option")},c,"%")),t.imageUrl()?m("img",{className:"PollAnswer-image",src:t.imageUrl(),alt:t.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",l&&"PollVoted",a.hasEnded()&&"PollEnded",t.imageUrl()&&"PollOption-hasImage"),"data-id":t.id()},p?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:u}),onremove:this.hideOptionTooltip},g):g)},n.changeVote=function(t,e){var n,r;if(!o().session.user)return o().modal.show(_t()),void(e.target.checked=!1);var a=this.pendingOptions||new Set(null==(n=(r=this.attrs.poll.myVotes()).map)?void 0:n.call(r,(function(t){return t.option().id()}))),l=a.delete(t.id());return this.attrs.poll.allowMultipleVotes()||a.clear(),l||a.add(t.id()),this.useSubmitUI?(this.pendingOptions=a.size?a:null,void(this.pendingSubmit=!!this.pendingOptions)):this.submit(a,null,(function(){return e.target.checked=l}))},n.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},n.submit=function(t,e,n){var r=this;return this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,m.redraw()}))},n.showVoters=function(){o().modal.show(St,{poll:this.attrs.poll,post:this.attrs.post})},n.deletePoll=function(){confirm(B()(o().translator.trans("fof-polls.forum.moderation.delete_confirm")))&&this.attrs.poll.delete().then((function(){m.redraw.sync()}))},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.preventClose=function(t){if(this.pendingOptions)return t.preventDefault(),!0},e}(A());function bo(t,o){(null==o||o>t.length)&&(o=t.length);for(var e=0,n=new Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.polls());!(e=n()).done;){var r=e.value;r&&t.push(m(go,{post:o,poll:r}))}})),(0,r.extend)(mo().prototype,"oninit",(function(){var t=this;this.subtree.check((function(){var o=t.attrs.post.polls(),e=null==o||null==o.map?void 0:o.map((function(t){var o,e,n,r,a;return t&&[null==(o=t.data)?void 0:o.attributes,null==(e=(n=t.options()).map)?void 0:e.call(n,(function(t){var o;return null==t||null==(o=t.data)?void 0:o.attributes})),null==(r=(a=t.myVotes()).map)?void 0:r.call(a,(function(t){var o;return null==(o=t.option())?void 0:o.id()}))]}));return JSON.stringify(e)}))})),(0,r.extend)(ho().prototype,"oncreate",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.bind("updatedPollOptions",(function(t){var e=o().store.getById("polls",t.pollId);e&&e.pushAttributes({voteCount:t.pollVoteCount});var n=t.options;for(var r in n){var a=o().store.getById("poll_options",r);a&&void 0!==a.voteCount()&&a.pushAttributes({voteCount:n[r]})}m.redraw()}))}))})),(0,r.extend)(ho().prototype,"onremove",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.unbind("updatedPollOptions")}))})),t=function(t){return o().modal.show(io,{onsubmit:function(e){return o().store.createRecord("polls").save(no({},e,{relationships:{post:t}}),{data:{include:"options,myVotes,myVotes.option"}}).then((function(o){var e;return null==(e=t.rawRelationship("polls"))||null==e.push||e.push({type:"polls",id:o.id()}),o}))}})},(0,r.extend)(wo(),"moderationControls",(function(e,n){!n.isHidden()&&n.canStartPoll()&&e.add("addPoll",m(S(),{icon:"fas fa-poll",onclick:t.bind(this,n)},o().translator.trans("fof-polls.forum.moderation.add")))})),(0,r.extend)(et().prototype,"navItems",(function(t){o().forum.attribute("globalPollsEnabled")&&(t.add("fof-polls-showcase",W().component({href:o().route("fof.polls.showcase"),icon:"fas fa-poll"},o().translator.trans("fof-polls.forum.page.nav")),35),o().forum.attribute("canStartGlobalPolls")&&t.add("fof-polls-list",W().component({href:o().route("fof.polls.list"),icon:"fas fa-list"},o().translator.trans("fof-polls.forum.page.nav-all")),32))}))}))})(),module.exports=n})(); +(()=>{var t={24:(t,o,e)=>{var n=e(735).default;function r(){"use strict";t.exports=r=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var o,e={},a=Object.prototype,l=a.hasOwnProperty,s=Object.defineProperty||function(t,o,e){t[o]=e.value},i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",p=i.toStringTag||"@@toStringTag";function m(t,o,e){return Object.defineProperty(t,o,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{m({},"")}catch(o){m=function(t,o,e){return t[o]=e}}function d(t,o,e,n){var r=o&&o.prototype instanceof w?o:w,a=Object.create(r.prototype),l=new M(n||[]);return s(a,"_invoke",{value:S(t,e,l)}),a}function f(t,o,e){try{return{type:"normal",arg:t.call(o,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var h="suspendedStart",v="suspendedYield",g="executing",b="completed",y={};function w(){}function P(){}function N(){}var x={};m(x,u,(function(){return this}));var _=Object.getPrototypeOf,V=_&&_(_(U([])));V&&V!==a&&l.call(V,u)&&(x=V);var I=N.prototype=w.prototype=Object.create(x);function A(t){["next","throw","return"].forEach((function(o){m(t,o,(function(t){return this._invoke(o,t)}))}))}function C(t,o){function e(r,a,s,i){var u=f(t[r],t,a);if("throw"!==u.type){var c=u.arg,p=c.value;return p&&"object"==n(p)&&l.call(p,"__await")?o.resolve(p.__await).then((function(t){e("next",t,s,i)}),(function(t){e("throw",t,s,i)})):o.resolve(p).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,i)}))}i(u.arg)}var r;s(this,"_invoke",{value:function(t,n){function a(){return new o((function(o,r){e(t,n,o,r)}))}return r=r?r.then(a,a):a()}})}function S(t,e,n){var r=h;return function(a,l){if(r===g)throw Error("Generator is already running");if(r===b){if("throw"===a)throw l;return{value:o,done:!0}}for(n.method=a,n.arg=l;;){var s=n.delegate;if(s){var i=O(s,n);if(i){if(i===y)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var u=f(t,e,n);if("normal"===u.type){if(r=n.done?b:v,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=b,n.method="throw",n.arg=u.arg)}}}function O(t,e){var n=e.method,r=t.iterator[n];if(r===o)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=o,O(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(r,t.iterator,e.arg);if("throw"===a.type)return e.method="throw",e.arg=a.arg,e.delegate=null,y;var l=a.arg;return l?l.done?(e[t.resultName]=l.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=o),e.delegate=null,y):l:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function k(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function E(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function U(t){if(t||""===t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r=0;--r){var a=this.tryEntries[r],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var i=l.call(a,"catchLoc"),u=l.call(a,"finallyLoc");if(i&&u){if(this.prev=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&l.call(n,"finallyLoc")&&this.prev=0;--o){var e=this.tryEntries[o];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),E(e),y}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var e=this.tryEntries[o];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var r=n.arg;E(e)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:U(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=o),y}},e}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports},735:t=>{function o(e){return t.exports=o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,o(e)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},183:(t,o,e)=>{var n=e(24)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},o={};function e(n){var r=o[n];if(void 0!==r)return r.exports;var a=o[n]={exports:{}};return t[n](a,a.exports,e),a.exports}e.n=t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},e.d=(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},e.o=(t,o)=>Object.prototype.hasOwnProperty.call(t,o),e.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";e.r(n),e.d(n,{components:()=>_o,extend:()=>qo,models:()=>Eo,states:()=>Mo,utils:()=>Uo});const t=flarum.core.compat["forum/app"];var o=e.n(t);const r=flarum.core.compat["common/extend"],a=flarum.core.compat["common/components/Badge"];var l=e.n(a);const s=flarum.core.compat["forum/components/DiscussionList"];var i=e.n(s);const u=flarum.core.compat["common/models/Discussion"];var c=e.n(u);const p=flarum.core.compat["common/utils/classList"];var d=e.n(p);const f=flarum.core.compat["forum/components/DiscussionComposer"];var h=e.n(f);const v=flarum.core.compat["forum/components/ReplyComposer"];var g=e.n(v);function b(t,o,e,n,r,a,l){try{var s=t[a](l),i=s.value}catch(t){return void e(t)}s.done?o(i):Promise.resolve(i).then(n,r)}function y(t){return function(){var o=this,e=arguments;return new Promise((function(n,r){var a=t.apply(o,e);function l(t){b(a,n,r,l,s,"next",t)}function s(t){b(a,n,r,l,s,"throw",t)}l(void 0)}))}}function w(t,o){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(t,o)}function P(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o)}var N=e(183),x=e.n(N);const _=flarum.core.compat["common/components/Modal"];var V=e.n(_);const I=flarum.core.compat["common/Component"];var A=e.n(I);const C=flarum.core.compat["common/components/Button"];var S=e.n(C);const O=flarum.core.compat["common/components/Switch"];var k=e.n(O);const E=flarum.core.compat["common/utils/ItemList"];var M=e.n(E);const U=flarum.core.compat["common/utils/Stream"];var L=e.n(U);const D=flarum.core.compat["common/utils/extractText"];var B=e.n(D);function T(t){return T=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},T(t)}function j(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(j=function(){return!!t})()}function F(t){var o="function"==typeof Map?new Map:void 0;return F=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(o){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,e)}function e(){return function(t,o,e){if(j())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,o);var r=new(t.bind.apply(t,n));return e&&w(r,e.prototype),r}(t,arguments,T(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),w(e,t)},F(t)}var q=function(t){function o(o){return t.call(this,o+"")||this}return P(o,t),o}(F(Error)),H=function(){function t(o){this.poll=void 0,this.loading=void 0,this.deleting=void 0,this.expandedGroup=void 0,o||(o=t.createNewPoll()),this.loading=!1,this.deleting=!1,this.poll=o,this.expandedGroup="setup"}t.createNewPoll=function(){var t=o().store.createRecord("polls");return t.pushAttributes({question:"",endDate:"",publicPoll:!1,allowMultipleVotes:!1,hideVotes:!1,allowChangeVote:!1,maxVotes:0}),t.tempOptions=[o().store.createRecord("poll_options"),o().store.createRecord("poll_options")],t};var e=t.prototype;return e.isExpanded=function(t){return this.expandedGroup===t},e.expand=function(t){this.expandedGroup=t,m.redraw()},e.save=function(){var t=y(x().mark((function t(o){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.save(o);case 5:this.poll=t.sent,delete this.poll.data.attributes.options;case 7:return t.prev=7,this.loading=!1,m.redraw(),t.finish(7);case 11:case"end":return t.stop()}}),t,this,[[2,,7,11]])})));return function(o){return t.apply(this,arguments)}}(),e.delete=function(){var t=y(x().mark((function t(){return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.loading=!0,m.redraw(),t.prev=2,t.next=5,this.poll.delete();case 5:this.deleting=!0;case 6:return t.prev=6,this.loading=!1,m.redraw(),t.finish(6);case 10:case"end":return t.stop()}}),t,this,[[2,,6,10]])})));return function(){return t.apply(this,arguments)}}(),t}();const R=flarum.core.compat["common/components/Page"];var G=e.n(R);const z=flarum.core.compat["common/components/LoadingIndicator"];var Y=e.n(z);const J=flarum.core.compat["common/components/LinkButton"];var W=e.n(J),K=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r0?Math.round(this.votes/this.totalVotes*100):0},n.view=function(){var t;this.hasVoted=this.state.hasVoted(),this.totalVotes=this.state.overallVoteCount(),this.votes=this.option.voteCount(),this.voted=this.state.hasVotedFor(this.option);var e=this.state.loadingOptions||this.hasVoted&&!this.poll.canChangeVote(),n=this.canSeeVoteCount?this.percent():Number(this.voted)/((null==(t=this.poll.myVotes())?void 0:t.length)||1)*100,r=m("label",{className:"PollBar","data-selected":!!this.voted,style:"--poll-option-width: "+n+"%"},this.state.showCheckMarks&&m("div",{className:"PollAnswer-checkbox"},m("input",{className:"PollAnswer-input sr-only",type:"checkbox",id:this.option.id(),name:this.name,value:this.answer,checked:this.voted,disabled:e,"aria-labelledby":this.name+"-"+this.option.id()+"-label",onchange:this.state.changeVote.bind(this.state,this.option)}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},this.optionDisplayItems().toArray()),this.option.imageUrl()?m("img",{className:"PollAnswer-image",src:this.option.imageUrl(),alt:this.option.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",this.hasVoted&&"PollVoted",this.option.imageUrl()&&"PollOption-hasImage"),"data-id":this.option.id()},this.canSeeVoteCount?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:this.votes}),onremove:this.hideOptionTooltip},r):r)},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.optionDisplayItems=function(){var t=new(M());return t.add("answer",m("span",{className:"PollAnswer-text-answer",id:this.name+"-"+this.option.id()+"-label"},this.answer)),this.voted&&!this.state.showCheckMarks&&t.add("check",ht()("fas fa-check-circle",{className:"PollAnswer-check"})),this.canSeeVoteCount&&t.add("percent",m("span",{className:d()("PollPercent",100!==this.percent()&&"PollPercent--option")},this.percent(),"%")),t},e}(A()),Pt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-options list-layout"},this.pollOptions().toArray())},e.pollOptions=function(){var t=this,o=new(M());return this.attrs.options.forEach((function(e){o.add("option"+e.id(),t.createOptionView(e))})),o},e.createOptionView=function(t){return m(wt,{name:this.attrs.name,option:t,state:this.attrs.state})},o}(A()),Nt=function(t){function o(){for(var o,e=arguments.length,n=new Array(e),r=0;r0},e.overallVoteCount=function(){return this.poll.voteCount()},e.hasVotedFor=function(t){return this.pendingOptions?this.pendingOptions.has(t.id()):this.poll.myVotes().some((function(o){return o.option()===t}))},e.getMaxVotes=function(){var t=this.poll,o=t.allowMultipleVotes()?t.maxVotes():1;return 0===o&&(o=t.options().length),o},e.showButton=function(){return this.useSubmitUI&&this.pendingSubmit},e.changeVote=function(t,e){var n=e.target;if(!o().session.user)return o().modal.show(_t()),void(n.checked=!1);var r=this.pendingOptions||new Set(this.poll.myVotes().map((function(t){return t.option().id()}))),a=r.delete(t.id());if(this.poll.allowMultipleVotes()||r.clear(),a||r.add(t.id()),this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,this.useSubmitUI)return this.pendingOptions=r.size?r:null,this.pendingSubmit=!!this.pendingOptions,void m.redraw();this.submit(r,null,(function(){return n.checked=a}))},e.hasSelectedOptions=function(){return this.pendingSubmit},e.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},e.submit=function(t,e,n){var r=this;return void 0===n&&(n=null),this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,r.canSeeVoteCount="number"==typeof r.poll.voteCount(),m.redraw()}))},t}(),kt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.state;return m(S(),{className:"Button Button--primary Poll-submit",loading:e.loadingOptions,onclick:function(o){return t.pollButtonSubmit(e,o)},disabled:!e.hasSelectedOptions()},o().translator.trans("fof-polls.forum.poll.submit_button"))},n.pollButtonSubmit=function(t,o){t.onsubmit()},e}(A());const Et=flarum.core.compat["common/utils/string"];var Mt=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){return m("div",{className:"Poll-title-component"},this.pollTitleItems().toArray())},e.pollTitleItems=function(){var t=new(M());return t.add("title",m("h3",{className:"Poll-title"},this.attrs.poll.question())),t},o}(A()),Ut=function(t){function o(){return t.apply(this,arguments)||this}P(o,t);var e=o.prototype;return e.view=function(){if(this.attrs.poll.subtitle())return m("div",{className:"Poll-subtitle-component"},this.pollSubtitleItems().toArray())},e.pollSubtitleItems=function(){var t=new(M());return t.add("subtitle",m("p",{className:"Poll-subtitle"},this.attrs.poll.subtitle())),t},o}(A()),Lt=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;rt.length)&&(o=t.length);for(var e=0,n=Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.pages);!(o=e()).done;){var n=o.value,r=n.items.indexOf(t);if(-1!==r){n.items.splice(r,1);break}}var a=this.extraPolls.indexOf(t);-1!==a&&this.extraPolls.splice(a),m.redraw()},n.addPoll=function(t){this.removePoll(t),this.extraPolls.unshift(t),m.redraw()},n.getAllItems=function(){return this.extraPolls.concat(t.prototype.getAllItems.call(this))},n.getPages=function(){var o=t.prototype.getPages.call(this);return this.extraPolls.length?[{number:-1,items:this.extraPolls}].concat(o):o},jt(e,[{key:"type",get:function(){return"fof/polls"}}])}(Jt()),Zt=function(t){function e(){return t.apply(this,arguments)||this}P(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),o().forum.attribute("globalPollsEnabled")?(this.state=new Xt({sort:m.route.param("sort"),filter:m.route.param("filter")}),this.state.refresh(),o().setTitle(B()(o().translator.trans("fof-polls.forum.page.nav")))):m.route.set("/")},n.view=function(){return this.loading?m(Y(),null):this.poll?m("div",{className:"PollsListPage"},m("div",{className:"container"},m(Lt,{poll:this.poll}))):m("div",{className:"PollsListPage"},t.prototype.hero.call(this),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"PollsListPage-nav sideNav"},m("ul",null,X()(this.sidebarItems().toArray()))),m("div",{className:"PollsPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},X()(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},X()(this.actionItems().toArray()))),m(zt,{state:this.state})))))},n.sidebarItems=function(){var t=this,e=new(M()),n=o().forum.attribute("canStartGlobalPolls");return e.add("newGlobalPoll",m(S(),{icon:"fas fa-edit",className:"Button Button--primary App-primaryControl PollsPage-newPoll",itemClassName:"App-primaryControl",onclick:function(){t.newPollAction()},disabled:!n},o().translator.trans("fof-polls.forum.poll."+(n?"start_poll_button":"cannot_start_poll_button")))),e.add("nav",m(tt(),{buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:o().translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems().toArray())),e},n.actionItems=function(){var t=this,e=new(M());return e.add("refresh",S().component({title:o().translator.trans("fof-polls.forum.page.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){t.state.refresh()}})),e},n.viewItems=function(){return et().prototype.viewItems()},n.navItems=function(){return et().prototype.navItems()},n.newPollAction=function(){o().session.user?m.route.set(o().route("fof.polls.compose")):o().modal.show(_t())},e}(qt);const to=flarum.core.compat["common/components/Separator"];var oo=e.n(to);const eo={controls:function(t,o){var e=this,n=new(M());return["poll","moderation","destructive"].forEach((function(r){var a=e[r+"Controls"](t,o).toArray();a.length&&(a.forEach((function(t){return n.add(t.itemName,t)})),n.add(r+"Separator",m(oo(),null)))})),n},pollControls:function(t,o){return new(M())},moderationControls:function(t,e){var n=new(M());return t.canEdit()&&n.add("edit",m(S(),{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.edit_label"))),n},destructiveControls:function(t,e){var n=new(M());return t.canDelete()&&n.add("delete",m(S(),{icon:"far fa-trash-alt",onclick:this.deleteAction.bind(this,t)},o().translator.trans("fof-polls.forum.poll_controls.delete_label"))),n},deleteAction:function(t){var e=this;return y(x().mark((function n(){return x().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(confirm(o().translator.trans("fof-polls.forum.poll_controls.delete_confirmation"))){n.next=2;break}return n.abrupt("return");case 2:return n.abrupt("return",t.delete().then((function(){e.showDeletionAlert(t,"success"),o().current.matches(nt,{id:t.id()})||o().current.matches(Zt,{id:t.id()})?o().history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")})));case 3:case"end":return n.stop()}}),n)})))()},showDeletionAlert:function(t,e){var n={success:"fof-polls.forum.poll_controls.delete_success_message",error:"fof-polls.forum.poll_controls.delete_error_message"}[e];o().alerts.show({type:e},o().translator.trans(n,{poll:t}))},editAction:function(t){m.route.set(o().route("fof.polls.compose",{id:t.id()}))}};function no(){return no=Object.assign?Object.assign.bind():function(t){for(var o=1;o'),this.$input.appendTo("body").hide().trigger("click").on("change",(function(e){var n=new FormData;n.append(t.attrs.name,$(e.target)[0].files[0]),t.loading=!0,m.redraw(),o().request({method:"POST",url:t.resourceUrl(),serialize:function(t){return t},body:n}).then(t.success.bind(t),t.failure.bind(t))})))},n.remove=function(){var t,e,n=this;this.loading=!0,m.redraw();var r=void 0;null!=(t=this.attrs.poll)&&t.exists||null!=(e=this.attrs.option)&&e.exists||(r=this.fileName),o().request({method:"DELETE",url:this.resourceUrl(r)}).then((function(t){var o,e;return null!=(o=n.attrs.poll)&&o.exists&&n.attrs.poll.pushAttributes({image:null,imageUrl:null,isImageUpload:!1}),null!=(e=n.attrs.option)&&e.exists&&n.attrs.option.pushAttributes({imageUrl:!1}),t})).then(this.success.bind(this),this.failure.bind(this))},n.resourceUrl=function(t){void 0===t&&(t=void 0);var e=o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.name,n=this.attrs.poll,r=this.attrs.option;return t?e+="/name/"+t:(null!=n&&n.exists&&(e+="/"+(null==n?void 0:n.id())),null!=r&&r.exists&&(e+="/"+(null==r?void 0:r.id()))),e},n.getImageUrl=function(){var t,o;return!1!==this.uploadedImageUrl?this.uploadedImageUrl:(null==(t=this.attrs.poll)?void 0:t.imageUrl())||(null==(o=this.attrs.option)?void 0:o.imageUrl())},n.success=function(t){var o,e,n;this.loading=!1,this.uploadedImageUrl=null==t?void 0:t.fileUrl,this.fileName=null==t?void 0:t.fileName,null==(o=(e=this.attrs).onUpload)||o.call(e,null==t?void 0:t.fileName),m.redraw(),null==(n=this.$input)||n.remove()},n.failure=function(t){var o;this.loading=!1,m.redraw(),null==(o=this.$input)||o.remove()},e}(S());const ao=flarum.core.compat["common/utils/RequestError"];var lo=e.n(ao),so=function(t){function e(){for(var o,e=arguments.length,n=new Array(e),r=0;r=2?S().component({type:"button",className:"Button PollModal--button Button--icon",icon:"fas fa-minus",onclick:r>=2?t.removeOption.bind(t,r):""}):""))})),e},n.addOption=function(){var t=Math.max(o().forum.attribute("pollMaxOptions"),2);this.options.length0;return!o().session.user||r.canVote()||r.hasEnded()||n.add("no-permission",m("span",null,m("i",{className:"icon fas fa-times-circle fa-fw"}),o().translator.trans("fof-polls.forum.no_permission"))),r.endDate()&&n.add("end-date",m("span",null,m("i",{class:"icon fas fa-clock fa-fw"}),r.hasEnded()?o().translator.trans("fof-polls.forum.poll_ended"):o().translator.trans("fof-polls.forum.days_remaining",{time:dayjs(r.endDate()).fromNow()}))),r.canVote()&&(n.add("max-votes",m("span",null,m("i",{className:"icon fas fa-poll fa-fw"}),o().translator.trans("fof-polls.forum.max_votes_allowed",{max:t}))),r.canChangeVote()||n.add("cannot-change-vote",m("span",null,m("i",{className:"icon fas fa-"+(a?"times":"exclamation")+"-circle fa-fw"}),o().translator.trans("fof-polls.forum.poll.cannot_change_vote")))),n},n.viewOption=function(t){var e,n,r,a=this.attrs.poll,l=(null==(e=a.myVotes())?void 0:e.length)>0,s=a.voteCount(),i=this.pendingOptions?this.pendingOptions.has(t.id()):null==(n=a.myVotes())||null==n.some?void 0:n.some((function(o){return o.option()===t})),u=t.voteCount(),c=s>0?Math.round(u/s*100):0,p="number"==typeof u,f=this.loadingOptions||l&&!a.canChangeVote(),h=p?c:Number(i)/((null==(r=a.myVotes())?void 0:r.length)||1)*100,v=!o().session.user||!a.hasEnded()&&a.canVote()&&(!l||a.canChangeVote()),g=m("div",{className:"PollBar","data-selected":!!i,style:"--poll-option-width: "+h+"%"},v&&m("label",{className:"PollAnswer-checkbox"},m("input",{onchange:this.changeVote.bind(this,t),type:"checkbox",checked:i,disabled:f}),m("span",{className:"checkmark"})),m("div",{className:"PollAnswer-text"},m("span",{className:"PollAnswer-text-answer"},t.answer()),i&&!v&&ht()("fas fa-check-circle",{className:"PollAnswer-check"}),p&&m("span",{className:d()("PollPercent",100!==c&&"PollPercent--option")},c,"%")),t.imageUrl()?m("img",{className:"PollAnswer-image",src:t.imageUrl(),alt:t.answer(),loading:"lazy"}):null);return m("div",{className:d()("PollOption",l&&"PollVoted",a.hasEnded()&&"PollEnded",t.imageUrl()&&"PollOption-hasImage"),"data-id":t.id()},p?m(yt(),{text:o().translator.trans("fof-polls.forum.tooltip.votes",{count:u}),onremove:this.hideOptionTooltip},g):g)},n.changeVote=function(t,e){var n,r;if(!o().session.user)return o().modal.show(_t()),void(e.target.checked=!1);var a=this.pendingOptions||new Set(null==(n=(r=this.attrs.poll.myVotes()).map)?void 0:n.call(r,(function(t){return t.option().id()}))),l=a.delete(t.id());return this.attrs.poll.allowMultipleVotes()||a.clear(),l||a.add(t.id()),this.useSubmitUI?(this.pendingOptions=a.size?a:null,void(this.pendingSubmit=!!this.pendingOptions)):this.submit(a,null,(function(){return e.target.checked=l}))},n.onsubmit=function(){var t=this;return this.submit(this.pendingOptions,(function(){t.pendingOptions=null,t.pendingSubmit=!1}))},n.submit=function(t,e,n){var r=this;return this.loadingOptions=!0,m.redraw(),o().request({method:"PATCH",url:o().forum.attribute("apiUrl")+"/fof/polls/"+this.attrs.poll.id()+"/votes",body:{data:{optionIds:Array.from(t)}}}).then((function(t){o().store.pushPayload(t),null==e||e()})).catch((function(t){null==n||n(t)})).finally((function(){r.loadingOptions=!1,m.redraw()}))},n.showVoters=function(){o().modal.show(St,{poll:this.attrs.poll,post:this.attrs.post})},n.deletePoll=function(){confirm(B()(o().translator.trans("fof-polls.forum.moderation.delete_confirm")))&&this.attrs.poll.delete().then((function(){m.redraw.sync()}))},n.hideOptionTooltip=function(t){t.attrs.tooltipVisible=!1,t.state.updateVisibility()},n.preventClose=function(t){if(this.pendingOptions)return t.preventDefault(),!0},e}(A());function bo(t,o){(null==o||o>t.length)&&(o=t.length);for(var e=0,n=Array(o);e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o.polls());!(e=n()).done;){var r=e.value;r&&t.push(m(go,{post:o,poll:r}))}})),(0,r.extend)(mo().prototype,"oninit",(function(){var t=this;this.subtree.check((function(){var o=t.attrs.post.polls(),e=null==o||null==o.map?void 0:o.map((function(t){var o,e,n,r,a;return t&&[null==(o=t.data)?void 0:o.attributes,null==(e=(n=t.options()).map)?void 0:e.call(n,(function(t){var o;return null==t||null==(o=t.data)?void 0:o.attributes})),null==(r=(a=t.myVotes()).map)?void 0:r.call(a,(function(t){var o;return null==(o=t.option())?void 0:o.id()}))]}));return JSON.stringify(e)}))})),(0,r.extend)(ho().prototype,"oncreate",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.bind("updatedPollOptions",(function(t){var e=o().store.getById("polls",t.pollId);e&&e.pushAttributes({voteCount:t.pollVoteCount});var n=t.options;for(var r in n){var a=o().store.getById("poll_options",r);a&&void 0!==a.voteCount()&&a.pushAttributes({voteCount:n[r]})}m.redraw()}))}))})),(0,r.extend)(ho().prototype,"onremove",(function(){o().pusher&&o().pusher.then((function(t){t.channels.main.unbind("updatedPollOptions")}))})),t=function(t){return o().modal.show(io,{onsubmit:function(e){return o().store.createRecord("polls").save(no({},e,{relationships:{post:t}}),{data:{include:"options,myVotes,myVotes.option"}}).then((function(o){var e;return null==(e=t.rawRelationship("polls"))||null==e.push||e.push({type:"polls",id:o.id()}),o}))}})},(0,r.extend)(wo(),"moderationControls",(function(e,n){!n.isHidden()&&n.canStartPoll()&&e.add("addPoll",m(S(),{icon:"fas fa-poll",onclick:t.bind(this,n)},o().translator.trans("fof-polls.forum.moderation.add")))})),(0,r.extend)(et().prototype,"navItems",(function(t){o().forum.attribute("globalPollsEnabled")&&(t.add("fof-polls-showcase",W().component({href:o().route("fof.polls.showcase"),icon:"fas fa-poll"},o().translator.trans("fof-polls.forum.page.nav")),35),o().forum.attribute("canStartGlobalPolls")&&t.add("fof-polls-list",W().component({href:o().route("fof.polls.list"),icon:"fas fa-list"},o().translator.trans("fof-polls.forum.page.nav-all")),32))}))}))})(),module.exports=n})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 3e887f51..b52229a0 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QA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AK,SAACqmB,GACfA,EAAQC,SAASC,KAAKE,OAAO,qBAC/B,GAEJ,ImBhFMzB,EAAa,SAAC5B,GAAU,OAC5Blc,IAAAA,MAAUkF,KAAKwV,GAAiB,CAC9BjW,SAAU,SAACrD,GAAyB,OAClCpB,IAAAA,MACGC,aAAa,SACbgB,KAAIyU,GAAC,CAAD,EAEEtU,EAAI,CACPoe,cAAe,CACbtD,KAAAA,KAGJ,CACE9a,KAAM,CACJ0H,QAAS,oCAIdhQ,MAAK,SAAC6G,GAAS,IAAA8f,EAId,OAF6B,OAA7BA,EAAAvD,EAAKwD,gBAAgB,WAAc,MAAnCD,EAA+BtlB,MAA/BslB,EAA+BtlB,KAAO,CAAE7C,KAAM,QAASmL,GAAI9C,EAAK8C,OAEzD9C,CACT,GAAE,GACN,GAEJsb,EAAAA,EAAAA,QAAO0E,KAAc,sBAAsB,SAAU/c,EAAOsZ,IAErDA,EAAKjM,YAAciM,EAAK3H,gBAC3B3R,EAAME,IACJ,UACA/B,EAACiE,IAAM,CAAChC,KAAK,cAAciC,QAAS6Y,EAAW5f,KAAKjG,KAAMikB,IACvDlc,IAAAA,WAAewC,MAAM,mCAI9B,KCxCAyY,EAAAA,EAAAA,QAAOtV,KAAAA,UAAqB,YAAY,SAAC/C,GAClC5C,IAAAA,MAAUwD,UAAmB,wBAIlCZ,EAAME,IACJ,qBACAC,IAAAA,UACE,CACEG,KAAMlD,IAAAA,MAAU,sBAChBgD,KAAM,eAERhD,IAAAA,WAAewC,MAAM,6BAEvB,IAGyBxC,IAAAA,MAAUwD,UAAmB,wBAGtDZ,EAAME,IACJ,iBACAC,IAAAA,UACE,CACEG,KAAMlD,IAAAA,MAAU,kBAChBgD,KAAM,eAERhD,IAAAA,WAAewC,MAAM,iCAEvB,IAGN,GFnBF","sources":["webpack://@fof/polls/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/polls/./src/forum/addDiscussionBadge.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@fof/polls/./src/forum/components/form/FormError.tsx","webpack://@fof/polls/./src/forum/states/PollFormState.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/polls/./src/forum/components/ComposePollHero.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/SelectDropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/polls/./src/forum/components/ComposePollPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/slidable']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/./src/forum/components/Poll/PollOption.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollOptions.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollImage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/polls/./src/forum/components/ListVotersModal.tsx","webpack://@fof/polls/./src/forum/states/PollState.ts","webpack://@fof/polls/./src/forum/components/Poll/PollSubmitButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/string']\"","webpack://@fof/polls/./src/forum/components/Poll/PollTitle.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubtitle.tsx","webpack://@fof/polls/./src/forum/components/PollView.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/polls/./src/forum/components/PollPageHero.tsx","webpack://@fof/polls/./src/forum/components/AbstractPollPage.tsx","webpack://@fof/polls/./src/forum/components/PollViewPage.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollListItem.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/polls/./src/forum/components/Poll/PollList.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/EventEmitter']\"","webpack://@fof/polls/./src/forum/states/PollListState.ts","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://@fof/polls/./src/forum/components/PollsPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@fof/polls/./src/forum/utils/PollControls.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/./src/forum/components/UploadPollImageButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/RequestError']\"","webpack://@fof/polls/./src/forum/components/PollForm.tsx","webpack://@fof/polls/./src/forum/components/CreatePollModal.tsx","webpack://@fof/polls/./src/forum/addComposerItems.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","webpack://@fof/polls/./src/forum/addPollsToPost.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/PollShowcaseItem.tsx","webpack://@fof/polls/./src/forum/components/PollShowcase.tsx","webpack://@fof/polls/./src/forum/components/PollsShowcasePage.tsx","webpack://@fof/polls/./src/forum/components/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/polls/./src/forum/models/Poll.ts","webpack://@fof/polls/./src/forum/models/PollOption.ts","webpack://@fof/polls/./src/forum/models/PollVote.ts","webpack://@fof/polls/./src/forum/models/index.ts","webpack://@fof/polls/./src/forum/states/index.ts","webpack://@fof/polls/./src/forum/utils/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Forum']\"","webpack://@fof/polls/./src/forum/extend.ts","webpack://@fof/polls/./src/forum/index.ts","webpack://@fof/polls/./src/forum/addPostControls.tsx","webpack://@fof/polls/./src/forum/addNavItem.ts"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport DiscussionList from 'flarum/forum/components/DiscussionList';\nimport Discussion from 'flarum/common/models/Discussion';\nimport { PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\n\nexport default () => {\n // @ts-ignore\n extend(DiscussionList.prototype, 'requestParams', (params: PaginatedListRequestParams) => {\n (params.include as string[]).push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n // @ts-ignore\n if (this.hasPoll()) {\n badges.add(\n 'poll',\n Badge.component({\n type: 'poll',\n label: app.translator.trans('fof-polls.forum.tooltip.badge'),\n icon: 'fas fa-poll',\n }),\n 5\n );\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/ReplyComposer'];","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nexport default function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !isNativeFunction(Class)) return Class;\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n _cache.set(Class, Wrapper);\n }\n function Wrapper() {\n return construct(Class, arguments, getPrototypeOf(this).constructor);\n }\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return setPrototypeOf(Wrapper, Class);\n };\n return _wrapNativeSuper(Class);\n}","export default function _isNativeFunction(fn) {\n try {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n } catch (e) {\n return typeof fn === \"function\";\n }\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nexport default function _construct(t, e, r) {\n if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);\n var o = [null];\n o.push.apply(o, e);\n var p = new (t.bind.apply(t, o))();\n return r && setPrototypeOf(p, r.prototype), p;\n}","import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\nexport default class FormError extends Error {\n constructor(props: NestedStringArray | string) {\n super(props + '');\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport default class PollFormState {\n poll: Poll;\n loading: boolean;\n deleting: boolean;\n expandedGroup: string;\n\n static createNewPoll() {\n const poll = app.store.createRecord('polls');\n\n poll.pushAttributes({\n question: '',\n endDate: '',\n publicPoll: false,\n allowMultipleVotes: false,\n hideVotes: false,\n allowChangeVote: false,\n maxVotes: 0,\n });\n\n poll.tempOptions = [app.store.createRecord('poll_options'), app.store.createRecord('poll_options')];\n\n return poll;\n }\n\n constructor(poll: Poll) {\n if (!poll) {\n poll = PollFormState.createNewPoll();\n }\n\n this.loading = false;\n this.deleting = false;\n this.poll = poll;\n this.expandedGroup = 'setup';\n }\n\n isExpanded(groupKey: string) {\n return this.expandedGroup === groupKey;\n }\n\n expand(groupKey: string) {\n this.expandedGroup = groupKey;\n m.redraw();\n }\n\n async save(data: any) {\n this.loading = true;\n m.redraw();\n\n try {\n this.poll = await this.poll.save(data);\n /**\n * Cleanup attributes:\n * For the saving process, we add the options directly to the attributes.\n * As we currently cannot add new PollOptions as relationships.\n */\n delete this.poll!.data!.attributes!.options;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n\n async delete() {\n this.loading = true;\n m.redraw();\n\n try {\n await this.poll.delete();\n this.deleting = true;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","import Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport interface ComposePollHeroAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class ComposePollHero extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n
\n

{app.translator.trans(`fof-polls.forum.compose.${!!this.poll.id() ? 'edit' : 'add'}_title`)}

\n
{this.controlItems().toArray()}
\n
\n
\n
\n );\n }\n\n controlItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'edit',\n \n {app.translator.trans('fof-polls.forum.compose.polls_manager')}\n \n );\n\n if (this.poll.exists) {\n items.add(\n 'view',\n \n {app.translator.trans('fof-polls.forum.compose.polls_preview')}\n \n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/SelectDropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport Poll from '../models/Poll';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollForm from './PollForm';\nimport PollFormState from '../states/PollFormState';\nimport ComposePollHero from './ComposePollHero';\nimport Button from 'flarum/common/components/Button';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPage from 'flarum/forum/components/IndexPage';\n\nexport default class ComposePollPage extends Page {\n poll: Poll | null | undefined = null;\n\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n // prevent users from accessing the page if they can't start global polls or if they are disabled altogether\n if (!app.forum.attribute('globalPollsEnabled') || !app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n this.bodyClass = 'App--compose-poll';\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n\n // either load the poll we're editing or create a new one\n const pollPromise = editId ? this.loadEditingPoll(editId) : Promise.resolve(PollFormState.createNewPoll());\n\n pollPromise.then((poll: Poll | null | undefined) => {\n this.poll = poll;\n\n if (poll?.exists && !poll.canEdit()) {\n m.route.set('/');\n return;\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n\n m.redraw();\n });\n }\n\n async loadEditingPoll(editId: string) {\n const alreadyLoaded = app.store.getById('poll', editId);\n\n if (alreadyLoaded) return alreadyLoaded;\n\n this.loading = true;\n\n const poll = await app.store.find('fof/polls', editId);\n\n this.loading = false;\n\n return poll;\n }\n\n view(): Mithril.Children {\n if (this.loading || !this.poll) {\n return ;\n }\n\n return (\n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n );\n }\n\n async onsubmit(data: Object, state: PollFormState) {\n const isNew = state.poll.id() === undefined;\n await state.save(data);\n\n const alertAttrs = isNew\n ? {\n type: 'success',\n controls: [\n \n m.route.set(\n app.route('fof.polls.compose', {\n id: state.poll.id(),\n })\n )\n }\n >\n {app.translator.trans('fof-polls.forum.compose.continue_editing')}\n ,\n ],\n }\n : {\n type: 'success',\n };\n\n // Show success alert\n const alertId = app.alerts.show(alertAttrs, app.translator.trans('fof-polls.forum.compose.success'));\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n\n if (isNew) {\n m.route.set(app.route('fof.polls.list'));\n }\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/slidable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOptionModel from '../../models/PollOption';\nimport PollState from '../../states/PollState';\nimport Tooltip, { TooltipAttrs } from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from '../../models/Poll';\n\ninterface PollOptionAttrs extends ComponentAttrs {\n option: PollOptionModel;\n name: string;\n state: PollState;\n}\n\nexport default class PollOption extends Component {\n option!: PollOptionModel;\n name!: string;\n state!: PollState;\n hasVoted: boolean = false;\n totalVotes: number = 0;\n votes: number = 0;\n voted: boolean = false;\n poll!: Poll;\n canSeeVoteCount: boolean = false;\n answer!: string;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\n this.poll = this.state.poll;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n this.canSeeVoteCount = typeof this.votes === 'number';\n\n this.answer = this.option.answer();\n }\n\n percent(): number {\n return this.totalVotes > 0 ? Math.round((this.votes / this.totalVotes) * 100) : 0;\n }\n\n view(): Mithril.Children {\n // following values can be changed by ui interactions, so we need to update them on every render\n this.hasVoted = this.state.hasVoted();\n this.totalVotes = this.state.overallVoteCount();\n this.votes = this.option.voteCount();\n this.voted = this.state.hasVotedFor(this.option);\n\n const isDisabled = this.state.loadingOptions || (this.hasVoted && !this.poll.canChangeVote());\n const width = this.canSeeVoteCount ? this.percent() : (Number(this.voted) / (this.poll.myVotes()?.length || 1)) * 100;\n\n const bar = (\n \n );\n\n return (\n \n {this.canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n \n );\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n\n // @ts-ignore\n vnode.state.updateVisibility();\n }\n\n optionDisplayItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'answer',\n \n {this.answer}\n \n );\n\n this.voted && !this.state.showCheckMarks && items.add('check', icon('fas fa-check-circle', { className: 'PollAnswer-check' }));\n\n this.canSeeVoteCount &&\n items.add('percent', {this.percent()}%);\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOption from './PollOption';\nimport PollOptionModel from '../../models/PollOption';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollState from '../../states/PollState';\n\ninterface PollOptionsAttrs extends ComponentAttrs {\n options: PollOptionModel[];\n name: String;\n state: PollState;\n}\n\nexport default class PollOptions extends Component {\n view(): Mithril.Children {\n return
{this.pollOptions().toArray()}
;\n }\n\n pollOptions(): ItemList {\n const items = new ItemList();\n\n this.attrs.options.forEach((option: PollOptionModel): void => {\n items.add('option' + option.id(), this.createOptionView(option));\n });\n\n return items;\n }\n\n createOptionView(option: PollOptionModel): Mithril.Children {\n return ;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from 'src/forum/models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface PollImageAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollImage extends Component {\n imageUrl: string | null = null;\n imageAlt: string | null = null;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.imageUrl = this.attrs.poll.imageUrl();\n this.imageAlt = this.attrs.poll.imageAlt();\n }\n\n view(): Mithril.Children {\n if (!this.imageUrl) {\n return;\n }\n\n return
{this.imageItems().toArray()}
;\n }\n\n imageItems(): ItemList {\n const items = new ItemList();\n\n items.add('image', {this.imageAlt);\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollModel from '../models/Poll';\nimport PollVote from '../models/PollVote';\nimport User from 'flarum/common/models/User';\nimport PollOption from '../models/PollOption';\n\ninterface ListVotersModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.loading = true;\n\n app.store\n .find('fof/polls', this.attrs.poll.id()!, {\n include: 'votes,votes.user,votes.option',\n })\n .then(() => (this.loading = false))\n .finally(() => m.redraw());\n }\n\n className(): string {\n return 'Modal--medium VotesModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content(): Mithril.Children {\n const options = this.attrs.poll.options() as PollOption[];\n return
{this.loading ? : options.map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt: PollOption): Mithril.Children {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v!.option()!.id()) as PollVote[];\n\n return (\n
\n

{this.optionAnswer(opt)! + ':'}

\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n

{app.translator.trans('fof-polls.forum.modal.no_voters')}

\n )}\n
\n );\n }\n\n optionAnswer(opt: PollOption): string {\n return opt.answer();\n }\n\n voteContent(vote: PollVote): Mithril.Children {\n const user = vote.user() as User;\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport PollOption from '../models/PollOption';\nimport PollVote from '../models/PollVote';\nimport ListVotersModal from '../components/ListVotersModal';\nimport { ApiPayloadSingle } from 'flarum/common/Store';\n\nexport default class PollState {\n public poll: Poll;\n protected pendingSubmit: boolean = false;\n protected pendingOptions: Set | null = null;\n public loadingOptions: boolean = false;\n public useSubmitUI: boolean;\n public showCheckMarks: boolean;\n public canSeeVoteCount: boolean;\n\n constructor(poll: Poll) {\n this.poll = poll;\n this.useSubmitUI = !poll?.canChangeVote() && poll?.allowMultipleVotes();\n this.showCheckMarks = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()));\n this.canSeeVoteCount = typeof poll.voteCount() === 'number';\n this.init();\n }\n\n /**\n * used as en extendable entry point for init customizations\n */\n init(): void {}\n\n isShowResult(): boolean {\n return this.poll.hasEnded() || (this.canSeeVoteCount && !!app.session.user && this.hasVoted());\n }\n\n hasVoted(): boolean {\n return this.poll.myVotes().length > 0;\n }\n\n overallVoteCount(): number {\n return this.poll.voteCount();\n }\n\n hasVotedFor(option: PollOption): boolean {\n return this.pendingOptions ? this.pendingOptions.has(option.id()!) : this.poll.myVotes().some((vote: PollVote) => vote.option() === option);\n }\n\n getMaxVotes(): number {\n const poll = this.poll;\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n if (maxVotes === 0) maxVotes = poll.options().length;\n return maxVotes;\n }\n\n showButton(): boolean {\n return this.useSubmitUI && this.pendingSubmit;\n }\n\n changeVote(option: PollOption, evt: Event): void {\n const target = evt.target as HTMLInputElement;\n\n if (!app.session.user) {\n app.modal.show(LogInModal);\n target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.poll.myVotes().map((v: PollVote) => v.option()!.id()!));\n const isUnvoting = optionIds.delete(option.id()!);\n const allowsMultiple = this.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id()!);\n }\n\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n m.redraw();\n return;\n }\n\n this.submit(optionIds, null, () => (target.checked = isUnvoting));\n }\n\n hasSelectedOptions(): boolean {\n return this.pendingSubmit;\n }\n\n onsubmit(): Promise {\n return this.submit(this.pendingOptions!, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds: Set, cb: Function | null, onerror: Function | null = null) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res: ApiPayloadSingle) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n this.canSeeVoteCount = typeof this.poll.voteCount() === 'number';\n m.redraw();\n });\n }\n\n showVoters = () => {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.poll,\n });\n };\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport PollState from '../../states/PollState';\n\ninterface PollSubmitButtonAttrs extends ComponentAttrs {\n state: PollState;\n}\n\nexport default class PollSubmitButton extends Component {\n view(): Mithril.Children {\n const state = this.attrs.state;\n return (\n this.pollButtonSubmit(state, event)}\n disabled={!state.hasSelectedOptions()}\n >\n {app.translator.trans('fof-polls.forum.poll.submit_button')}\n \n );\n }\n\n /**\n * Event handler for submit button being clicked\n */\n\n pollButtonSubmit(state: PollState, event: Event): void {\n state.onsubmit();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollTitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollTitle extends Component {\n view() {\n return
{this.pollTitleItems().toArray()}
;\n }\n\n pollTitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('title',

{this.attrs.poll.question()}

);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollSubtitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollSubtitle extends Component {\n view() {\n if (!this.attrs.poll.subtitle()) {\n return;\n }\n\n return
{this.pollSubtitleItems().toArray()}
;\n }\n\n pollSubtitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('subtitle',

{this.attrs.poll.subtitle()}

);\n\n return items;\n }\n}\n","import Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport app from 'flarum/forum/app';\nimport PollOptions from './Poll/PollOptions';\nimport PollImage from './Poll/PollImage';\nimport PollModel from '../models/Poll';\nimport PollState from '../states/PollState';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollControls from '../utils/PollControls';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport { slug } from 'flarum/common/utils/string';\nimport classList from 'flarum/common/utils/classList';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\n\ninterface PollAttrs extends ComponentAttrs {\n poll: PollModel;\n}\n\nexport default class PollView extends Component {\n state!: PollState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.state = new PollState(this.attrs.poll);\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view(): Mithril.Children {\n const poll = this.attrs.poll;\n const state = this.state;\n const controls = PollControls.controls(poll, this);\n\n (poll.publicPoll() || poll.canEdit()) &&\n controls.add(\n 'view',\n \n );\n\n return (\n
\n {this.controlsView(controls.toArray())}\n
{this.createMainView().toArray()}
\n
\n );\n }\n\n createMainView(): ItemList {\n const items = new ItemList();\n\n items.add('header',
{this.createPollHeader().toArray()}
);\n items.add('content',
{this.createPollContent().toArray()}
);\n items.add('footer',
{this.createPollFooter().toArray()}
);\n\n return items;\n }\n\n createPollHeader(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n items.add('title', );\n if (poll.subtitle()) items.add('subtitle', );\n\n return items;\n }\n\n createPollContent(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (poll.imageUrl()) {\n items.add('image', );\n }\n\n items.add('form',
{this.createFormItems().toArray()}
);\n\n return items;\n }\n\n createPollFooter(): ItemList {\n const items = new ItemList();\n const state = this.state;\n\n const infoItems = this.infoItems(state.getMaxVotes());\n\n items.add(\n 'sticky',\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n {state.showButton() && }\n
\n );\n\n return items;\n }\n\n createFormItems(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const state = this.state;\n const questionSlug = slug(poll.question());\n\n items.add(\n 'elements',\n
\n {poll.question()}\n \n
\n );\n\n return items;\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose = (e: Event): boolean | void => {\n if (this.state.hasSelectedOptions()) {\n e.preventDefault();\n return true;\n }\n };\n}\n","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\ninterface PollPageHeroAttrs extends ComponentAttrs {\n icon?: string;\n title?: string;\n}\n\nexport default class PollPageHero extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n get classNames(): string {\n return classList({\n PollPageHero: true,\n Hero: true,\n });\n }\n\n get wrapperClasses(): string {\n return classList({\n 'PollPageHero--wrapper': true,\n });\n }\n\n oncreate(vnode: Mithril.Vnode): void {\n super.oncreate(vnode);\n }\n\n get title() {\n return this.attrs.title || app.translator.trans('fof-polls.forum.polls_page.title');\n }\n\n get icon() {\n return this.attrs.icon || 'fas fa-poll';\n }\n\n view() {\n return (\n
\n
\n
\n
{this.items().toArray()}
\n
\n
\n
\n );\n }\n\n items() {\n const items = new ItemList();\n items.add('title',

{[icon(this.icon), ' ', this.title]}

, 50);\n\n return items;\n }\n}\n","import Page, { IPageAttrs } from 'flarum/common/components/Page';\nimport PollListState from '../states/PollListState';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport listItems from 'flarum/common/helpers/listItems';\nimport app from 'flarum/forum/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPageHero from './PollPageHero';\n\nexport abstract class AbstractPollPage extends Page {\n loading: boolean = false;\n poll: Poll | null | undefined = null;\n polls: Poll[] = [];\n\n view(): Mithril.Children {\n return
{this.pageContent().toArray()}
;\n }\n\n pageContent(): ItemList {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
{this.mainContent().toArray()}
, 10);\n\n return items;\n }\n\n mainContent(): ItemList {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content(): Mithril.Children {\n return
{this.contentItems().toArray()}
;\n }\n\n contentItems(): ItemList {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n }\n\n return items;\n }\n\n hero(): Mithril.Children {\n return ;\n }\n\n sidebar(): Mithril.Children {\n return (\n \n );\n }\n\n sidebarItems(): ItemList {\n const items = IndexPage.prototype.sidebarItems();\n\n items.setContent(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems(): ItemList {\n const items = IndexPage.prototype.navItems();\n\n if (app.initializers.has('flarum-tags')) {\n // remove the tags from the nav items\n items.remove('separator');\n items.remove('moreTags');\n\n // each tag is added using the key \"tag{id}\". We need to remove all of them\n for (const key in items.toObject()) {\n if (key.startsWith('tag') && key !== 'tags') {\n items.remove(key);\n }\n }\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport PollModel from '../models/Poll';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class PollViewPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n const editId = m.route.param('id');\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(this.poll.question());\n m.redraw();\n });\n }\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll', );\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type { PollListParams } from '../../states/PollListState';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\nimport classList from 'flarum/common/utils/classList';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Link from 'flarum/common/components/Link';\nimport highlight from 'flarum/common/helpers/highlight';\nimport slidable from 'flarum/forum/utils/slidable';\nimport icon from 'flarum/common/helpers/icon';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Poll from '../../models/Poll';\nimport PollControls from '../../utils/PollControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PollViewPage from '../PollViewPage';\n\nexport interface IPollListItemAttrs extends ComponentAttrs {\n poll: Poll;\n params: PollListParams;\n}\n\n/**\n * The `PollListItem` component shows a single poll in the\n * poll list.\n */\nexport default class PollListItem extends Component {\n /**\n * Ensures that the poll will not be redrawn\n * unless new data comes in.\n */\n subtree!: SubtreeRetainer;\n poll!: Poll;\n\n highlightRegExp?: RegExp;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.subtree = new SubtreeRetainer(\n () => this.poll.freshness,\n () => {\n const time = app.session.user && app.session.user.markedAllAsReadAt();\n return time && time.getTime();\n },\n () => this.active()\n );\n }\n\n elementAttrs() {\n return {\n className: classList('PollListItem', {\n active: this.active(),\n 'PollListItem--hidden': this.poll.isHidden(),\n Slidable: 'ontouchstart' in window,\n }),\n };\n }\n\n view() {\n const controls = PollControls.controls(this.poll, this).toArray();\n const attrs = this.elementAttrs();\n\n return (\n
\n {this.controlsView(controls)}\n {this.contentView()}\n {this.slidableUnderneathView()}\n
\n );\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n slidableUnderneathView(): Mithril.Children {\n const isUnread = this.poll.isUnread();\n\n return (\n \n {icon('fas fa-check')}\n \n );\n }\n\n contentView(): Mithril.Children {\n // const isUnread = this.poll.isUnread();\n // const isRead = this.poll.isRead();\n\n return (\n //
\n
{this.mainView()}
\n );\n }\n\n mainView(): Mithril.Children {\n return (\n \n

{highlight(this.poll.question(), this.highlightRegExp)}

\n {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n // infoView() {\n // return (\n //
\n // {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n //
    {listItems(this.infoItems().toArray())}
\n //
\n // );\n // }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n // If we're on a touch device, set up the discussion row to be slidable.\n // This allows the user to drag the row to either side of the screen to\n // reveal controls.\n if ('ontouchstart' in window) {\n const slidableInstance = slidable(this.element);\n\n this.$('.PollListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());\n }\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.needsRebuild();\n }\n\n /**\n * Determine whether or not the discussion is currently being viewed.\n */\n active() {\n return app.current.matches(PollViewPage, { poll: this.poll });\n }\n\n /**\n * Mark the poll as read.\n */\n markAsRead() {\n if (this.poll.isUnread()) {\n this.poll.save({ lastVotedNumber: this.poll.voteCount() });\n m.redraw();\n }\n }\n\n infoItems(): ItemList {\n const items = new ItemList();\n const active = !this.poll.hasEnded();\n const activeView = this.poll.endDate()\n ? [\n icon('fas fa-clock'),\n ' ',\n active\n ? app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.poll.endDate()).fromNow() })\n : app.translator.trans('fof-polls.forum.poll_ended'),\n ]\n : [icon('fas fa-infinity'), ' ', app.translator.trans('fof-polls.forum.poll_never_ends')];\n\n items.add('active', {activeView});\n\n const voteCount = this.poll.voteCount();\n if (voteCount !== undefined) {\n items.add(\n 'voteCount',\n \n {icon('fas fa-poll fa-fw')}\n {[\n ' ',\n app.translator.trans('fof-polls.forum.polls_count', {\n count: abbreviateNumber(voteCount),\n }),\n ]}\n ,\n 70\n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListItem from './PollListItem';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport classList from 'flarum/common/utils/classList';\nimport PollListState from '../../states/PollListState';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\n/**\n * The `PollList` component displays a list of polls.\n */\nexport default class PollList extends Component {\n view() {\n const state = this.attrs.state;\n const params = state.getParams();\n const isLoading = state.isInitialLoading() || state.isLoadingNext();\n\n let loading;\n\n if (isLoading) {\n loading = ;\n } else if (state.hasNext()) {\n loading = (\n \n );\n }\n\n if (state.isEmpty()) {\n const text = app.translator.trans('fof-polls.forum.polls_list.empty_text');\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {state.getPages().map((pg) => {\n return pg.items.map((poll) => (\n
  • \n \n
  • \n ));\n })}\n
\n
{loading}
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/PaginatedListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/EventEmitter'];","import app from 'flarum/forum/app';\nimport PaginatedListState, { Page, PaginatedListParams, PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\nimport Poll from '../models/Poll';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport EventEmitter from 'flarum/common/utils/EventEmitter';\n\nexport interface PollListParams extends PaginatedListParams {\n sort?: string;\n}\n\nconst globalEventEmitter = new EventEmitter();\n\nexport default class PollListState

extends PaginatedListState {\n protected extraPolls: Poll[] = [];\n protected eventEmitter: EventEmitter;\n\n constructor(params: P, page: number = 1) {\n super(params, page, 20);\n\n this.eventEmitter = globalEventEmitter.on('poll.deleted', this.deletePoll.bind(this));\n }\n\n get type(): string {\n return 'fof/polls';\n }\n\n requestParams(): PaginatedListRequestParams {\n const params = {\n include: this.params.include || ['options', 'votes'],\n filter: this.params.filter || {},\n sort: this.sortMap()[this.params.sort ?? ''],\n };\n\n if (this.params.q) {\n params.filter.q = this.params.q;\n }\n\n return params;\n }\n\n protected loadPage(page: number = 1): Promise> {\n const preloadedPolls = app.preloadedApiDocument();\n\n if (preloadedPolls) {\n this.initialLoading = false;\n\n return Promise.resolve(preloadedPolls);\n }\n\n return super.loadPage(page);\n }\n\n clear(): void {\n super.clear();\n\n this.extraPolls = [];\n }\n\n /**\n * Get a map of sort keys (which appear in the URL, and are used for\n * translation) to the API sort value that they represent.\n */\n sortMap() {\n const map: any = {};\n\n if (this.params.q) {\n map.relevance = '';\n }\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n\n return map;\n }\n\n /**\n * In the last request, has the user searched for a poll?\n */\n isSearchResults(): boolean {\n return !!this.params.q;\n }\n\n removePoll(poll: Poll): void {\n this.eventEmitter.emit('poll.deleted', poll);\n }\n\n deletePoll(poll: Poll): void {\n for (const page of this.pages) {\n const index = page.items.indexOf(poll);\n\n if (index !== -1) {\n page.items.splice(index, 1);\n break;\n }\n }\n\n const index = this.extraPolls.indexOf(poll);\n\n if (index !== -1) {\n this.extraPolls.splice(index);\n }\n\n m.redraw();\n }\n\n /**\n * Add a poll to the top of the list.\n */\n addPoll(poll: Poll): void {\n this.removePoll(poll);\n this.extraPolls.unshift(poll);\n\n m.redraw();\n }\n\n protected getAllItems(): Poll[] {\n return this.extraPolls.concat(super.getAllItems());\n }\n\n public getPages(): Page[] {\n const pages = super.getPages();\n\n if (this.extraPolls.length) {\n return [\n {\n number: -1,\n items: this.extraPolls,\n },\n ...pages,\n ];\n }\n\n return pages;\n }\n}\n","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 return self;\n}","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PollList from './Poll/PollList';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollListState from '../states/PollListState';\nimport Button from 'flarum/common/components/Button';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\n\nexport default class PollsPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n view(): Mithril.Children {\n if (this.loading) {\n return ;\n }\n\n if (this.poll) {\n return (\n

\n
\n \n
\n
\n );\n }\n\n return (\n
\n {super.hero()}\n
\n
\n \n
\n
\n
    {listItems(this.viewItems().toArray())}
\n
    {listItems(this.actionItems().toArray())}
\n
\n \n
\n
\n
\n
\n );\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n \n );\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'refresh',\n Button.component({\n title: app.translator.trans('fof-polls.forum.page.refresh_tooltip'),\n icon: 'fas fa-sync',\n className: 'Button Button--icon',\n onclick: () => {\n this.state.refresh();\n },\n })\n );\n\n return items;\n }\n\n viewItems() {\n return IndexPage.prototype.viewItems();\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n\n /**\n * Change to create new poll page\n */\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Separator'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport Component from 'flarum/common/Component';\nimport ComposePollPage from '../components/ComposePollPage';\nimport PollsPage from '../components/PollsPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Separator from 'flarum/common/components/Separator';\nimport Button from 'flarum/common/components/Button';\n\n/**\n * The `UserControls` utility constructs a list of buttons for a user which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a user.\n */\n controls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n ['poll', 'moderation', 'destructive'].forEach((section) => {\n const controls = (this[section + 'Controls'](poll, context) as ItemList).toArray();\n if (controls.length) {\n controls.forEach((item) => items.add(item.itemName, item));\n items.add(section + 'Separator', );\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for direct modifcation actions on polls (e.g. vote, view voters).\n */\n pollControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n return items;\n },\n\n /**\n * Get controls for a user pertaining to moderation (e.g. suspend, edit).\n */\n moderationControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canEdit()) {\n items.add(\n 'edit',\n \n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a user which are destructive (e.g. delete).\n * @protected\n */\n destructiveControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canDelete()) {\n items.add(\n 'delete',\n \n );\n }\n\n return items;\n },\n\n /**\n * Delete the poll.\n */\n async deleteAction(poll: Poll): Promise {\n if (!confirm(app.translator.trans(`fof-polls.forum.poll_controls.delete_confirmation`) as string)) {\n return;\n }\n\n return poll\n .delete()\n .then(() => {\n this.showDeletionAlert(poll, 'success');\n if (app.current.matches(ComposePollPage, { id: poll.id() }) || app.current.matches(PollsPage, { id: poll.id() })) {\n app.history.back();\n } else {\n window.location.reload();\n }\n })\n .catch(() => this.showDeletionAlert(poll, 'error'));\n },\n\n /**\n * Show deletion alert of poll\n */\n showDeletionAlert(poll: Poll, type: string): void {\n const message = {\n success: `fof-polls.forum.poll_controls.delete_success_message`,\n error: `fof-polls.forum.poll_controls.delete_error_message`,\n }[type]!;\n\n app.alerts.show({ type }, app.translator.trans(message, { poll: poll }));\n },\n\n /**\n * Edit the poll.\n */\n editAction(poll: Poll): void {\n m.route.set(app.route('fof.polls.compose', { id: poll.id() }));\n },\n};\n","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","import app from 'flarum/forum/app';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport Mithril from 'mithril';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport interface UploadPollImageButtonAttrs extends IButtonAttrs {\n className?: string;\n loading?: boolean;\n name: string;\n onclick: () => void;\n poll?: Poll | null;\n option?: PollOption | null;\n onUpload: (fileName: string | null | undefined) => void;\n}\n\nexport interface PollUploadObject {\n fileUrl: string;\n fileName: string;\n}\n\nexport default class UploadPollImageButton extends Button {\n loading: boolean = false;\n uploadedImageUrl: string | undefined | false = false;\n fileName: string | undefined = undefined;\n $input: JQuery | undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button', 'Button--inverted');\n\n const imageUrl = this.getImageUrl();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n if (imageUrl) {\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

\n {super.view({\n ...vnode,\n children: app.translator.trans('fof-polls.forum.upload_image.remove_button'),\n })}\n

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return canUpload && super.view({ ...vnode, poll: undefined, children: app.translator.trans('fof-polls.forum.upload_image.upload_button') });\n }\n\n /**\n * Prompt the user to upload an image.\n */\n upload() {\n if (this.loading) return;\n\n this.$input = $('');\n\n this.$input\n .appendTo('body')\n .hide()\n .trigger('click')\n .on('change', (e) => {\n const body = new FormData();\n body.append(this.attrs.name, $(e.target)[0].files[0]);\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: this.resourceUrl(),\n serialize: (raw) => raw,\n body,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n });\n }\n\n /**\n * Remove the image.\n */\n remove() {\n this.loading = true;\n m.redraw();\n\n let fileName = undefined;\n\n if (!this.attrs.poll?.exists && !this.attrs.option?.exists) {\n fileName = this.fileName;\n }\n\n app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(fileName),\n })\n .then((upload) => {\n if (this.attrs.poll?.exists) {\n this.attrs.poll.pushAttributes({ image: null, imageUrl: null, isImageUpload: false });\n }\n\n if (this.attrs.option?.exists) {\n this.attrs.option.pushAttributes({ imageUrl: false });\n }\n\n return upload;\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl(fileName: string | undefined = undefined) {\n let url = app.forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name;\n const poll = this.attrs.poll;\n const option = this.attrs.option;\n\n if (fileName) {\n url += '/name/' + fileName;\n } else {\n if (poll?.exists) url += '/' + poll?.id();\n if (option?.exists) url += '/' + option?.id();\n }\n\n return url;\n }\n\n getImageUrl() {\n if (this.uploadedImageUrl !== false) {\n return this.uploadedImageUrl;\n }\n\n return this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl();\n }\n\n /**\n * After a successful upload/removal, redraw the page.\n *\n * @param {PollUploadObject} response\n * @protected\n */\n success(response: PollUploadObject | null) {\n this.loading = false;\n this.uploadedImageUrl = response?.fileUrl;\n this.fileName = response?.fileName;\n\n this.attrs.onUpload?.(response?.fileName);\n m.redraw();\n this.$input?.remove();\n }\n\n /**\n * If upload/removal fails, stop loading.\n *\n * @param {object} response\n * @protected\n */\n failure(response: object) {\n this.loading = false;\n m.redraw();\n this.$input?.remove();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/RequestError'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport Switch from 'flarum/common/components/Switch';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport FormError from './form/FormError';\nimport PollFormState from '../states/PollFormState';\nimport PollControls from '../utils/PollControls';\nimport PollModel from '../models/Poll';\nimport PollOption from '../models/PollOption';\nimport UploadPollImageButton from './UploadPollImageButton';\nimport Poll from '../models/Poll';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport RequestError from 'flarum/common/utils/RequestError';\n\ninterface PollFormAttrs extends ComponentAttrs {\n poll: PollModel;\n onsubmit: (data: object, state: PollFormState) => Promise;\n}\n\nexport default class PollForm extends Component {\n protected options: PollOption[] = [];\n protected optionAnswers: Stream[] = [];\n protected optionImageUrls: Stream[] = [];\n protected question: Stream;\n protected subtitle: Stream;\n protected image: Stream;\n protected imageAlt: Stream;\n protected endDate: Stream;\n protected publicPoll: Stream;\n protected allowMultipleVotes: Stream;\n protected hideVotes: Stream;\n protected allowChangeVote: Stream;\n protected maxVotes: Stream;\n protected datepickerMinDate: string = '';\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n this.state = new PollFormState(this.attrs.poll);\n\n // state handles poll initialization\n const poll = this.state.poll;\n\n this.options = (poll.tempOptions ?? poll.options()) as PollOption[];\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n\n this.question = Stream(poll.question());\n this.subtitle = Stream(poll.subtitle());\n this.image = Stream(poll.image());\n this.imageAlt = Stream(poll.imageAlt());\n this.endDate = Stream(this.formatDate(poll.endDate()));\n this.publicPoll = Stream(poll.publicPoll());\n this.allowMultipleVotes = Stream(poll.allowMultipleVotes());\n this.hideVotes = Stream(poll.hideVotes());\n this.allowChangeVote = Stream(poll.allowChangeVote());\n this.maxVotes = Stream(poll.maxVotes() || 0);\n\n // Set minimum date for datepicker to current date\n this.datepickerMinDate = this.formatDate() as string;\n\n // Replace minimum of 'today' for poll end date only if the poll is not already closed\n if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) {\n // We know that endDate is set, so we can safely cast the result to string\n this.datepickerMinDate = this.formatDate(poll.endDate()) as string;\n }\n }\n\n view(): Mithril.Children {\n return (\n
\n
{this.fields().toArray()}
\n
\n );\n }\n\n fields(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'question',\n
\n \n\n \n
,\n 100\n );\n\n items.add(\n 'subtitle',\n
\n \n\n \n
,\n 95\n );\n\n const hasImage = this.image();\n\n items.add(\n 'poll_image',\n
\n \n {this.uploadConditional(\n hasImage,\n this.state.poll?.isImageUpload(),\n <>\n

{app.translator.trans('fof-polls.forum.modal.poll_image.help')}

\n \n ,\n ,\n \n )}\n
,\n 90\n );\n\n if (hasImage) {\n items.add(\n 'poll_image_alt',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.poll_image.alt_help_text')}

\n
,\n 90\n );\n }\n\n items.add(\n 'answers',\n
\n \n\n {this.displayOptions().toArray()}\n\n \n
,\n 80\n );\n\n items.add(\n 'date',\n
\n \n\n
\n \n {Button.component({\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-times',\n onclick: this.endDate.bind(this, null),\n })}\n
\n\n {this.endDate() && (\n

\n \n  \n {dayjs(this.endDate()).isBefore(dayjs())\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.endDate()).fromNow() })}\n

\n )}\n
,\n 40\n );\n\n items.add(\n 'public',\n
\n {Switch.component(\n {\n state: this.publicPoll() || false,\n onchange: this.publicPoll,\n },\n app.translator.trans('fof-polls.forum.modal.public_poll_label')\n )}\n
,\n 20\n );\n\n items.add(\n 'hide-votes',\n
\n \n {app.translator.trans('fof-polls.forum.modal.hide_votes_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-change-vote',\n
\n \n {app.translator.trans('fof-polls.forum.modal.allow_change_vote_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-multiple-votes',\n
\n {Switch.component(\n {\n state: this.allowMultipleVotes() || false,\n onchange: this.allowMultipleVotes,\n },\n app.translator.trans('fof-polls.forum.modal.allow_multiple_votes_label')\n )}\n
,\n 15\n );\n\n if (this.allowMultipleVotes()) {\n items.add(\n 'max-votes',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.max_votes_help')}

\n
,\n 15\n );\n }\n\n items.add(\n 'submit',\n
\n \n {this.state.poll.exists && (\n \n {app.translator.trans('fof-polls.forum.modal.delete')}\n \n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions(): ItemList {\n const items = new ItemList();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n this.options.forEach((option, i) => {\n const imgFunc = this.optionImageUrls[i];\n\n items.add(\n 'option-' + i,\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') && (\n
\n {this.uploadConditional(\n !!imgFunc(),\n option?.isImageUpload(),\n <>\n \n

{app.translator.trans('fof-polls.forum.modal.poll_option_image.help')}

\n \n ,\n\n ,\n\n \n )}\n
\n )}\n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n
\n );\n });\n\n return items;\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(app.store.createRecord('poll_options'));\n this.optionAnswers.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(i: number): void {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data(): object {\n if (this.question() === '') {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.include_question'));\n }\n\n if (this.options.length < 2) {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.min'));\n }\n\n const pollExists = this.state.poll.exists;\n const options = this.options.map((option, i) => {\n option.pushAttributes({\n answer: this.optionAnswers[i](),\n imageUrl: this.optionImageUrls[i](),\n });\n\n return pollExists ? option.data : option.data.attributes;\n });\n\n return {\n question: this.question(),\n subtitle: this.subtitle(),\n pollImage: this.image(),\n imageAlt: this.imageAlt(),\n endDate: this.dateToTimestamp(this.endDate()) ?? false,\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options,\n };\n }\n\n async onsubmit(event: Event) {\n event.preventDefault();\n\n try {\n await this.attrs.onsubmit(this.data(), this.state);\n } catch (error) {\n if (error instanceof FormError) {\n app.alerts.show({ type: 'error' }, error.message);\n } else if (error instanceof RequestError) {\n console.error(error);\n app.alerts.show({ type: 'error' }, app.translator.trans('fof-polls.forum.modal.error'));\n }\n }\n }\n\n async delete(): Promise {\n this.state.loading = true;\n try {\n await PollControls.deleteAction(this.state.poll);\n this.state.deleting = true;\n } finally {\n this.state.loading = false;\n m.redraw();\n }\n }\n\n formatDate(date: Date | string | false | undefined | null = undefined, def: Date | false = false): string | false {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date: Date | false): string | null {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return null;\n\n return dayjsDate.format();\n }\n\n pollImageUploadSuccess(fileName: string | null | undefined): void {\n this.image(fileName);\n }\n\n pollOptionImageUploadSuccess(index: number, fileName: string | null | undefined): void {\n this.optionImageUrls[index] = Stream(fileName);\n }\n\n uploadConditional(hasImage: boolean, isUpload: boolean, ifCanUpload: JSX.Element, uploadButton: JSX.Element, imageUrlInput: JSX.Element) {\n const canUpload = app.forum.attribute('canUploadPollImages');\n const canUploadNow = this.state.poll?.exists || (app.forum.attribute('canStartPolls') && app.forum.attribute('canStartGlobalPolls'));\n\n // if can upload OR image is already uploaded\n if (canUpload || isUpload) {\n // may not have enough permissions to upload before creating poll\n if (!canUploadNow && !isUpload) {\n return (\n <>\n {imageUrlInput}\n

{app.translator.trans('fof-polls.forum.modal.poll_image.later_help')}

\n \n );\n }\n\n return (\n <>\n {ifCanUpload}\n
\n {!hasImage && imageUrlInput}\n {uploadButton}\n
\n \n );\n }\n\n return imageUrlInput;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport PollForm from './PollForm';\nimport PollModel from '../models/Poll';\nimport PollFormState from '../states/PollFormState';\n\ninterface CreatePollModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class CreatePollModal extends Modal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className(): string {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content(): Mithril.Children {\n return [\n
\n \n
,\n ];\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n this.hide();\n await this.attrs.onsubmit(data);\n }\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\nimport CreatePollModal from './components/CreatePollModal';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport { ModelAttributes } from 'flarum/common/Model';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nfunction toPoll(data: PollModelAttributes) {\n if (data) {\n const poll = app.store.createRecord('polls');\n\n poll.tempOptions = data.options.map((option: ModelAttributes) => {\n const pollOption = app.store.createRecord('poll_options');\n pollOption.pushAttributes(option);\n return pollOption;\n });\n poll.pushAttributes(data);\n\n return poll;\n }\n return data;\n}\n\nexport const addToComposer = (composer: ComponentClass) => {\n // @ts-ignore\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: toPoll(this.composer.fields.poll),\n onsubmit: (poll: PollModelAttributes) => (this.composer.fields.poll = poll),\n });\n };\n\n // Add button to DiscussionComposer header\n extend(composer.prototype, 'headerItems', function (items) {\n const discussion = this.composer.body?.attrs?.discussion;\n\n // @ts-ignore\n const canStartPoll = discussion?.canStartPoll() ?? app.forum.canStartPolls();\n\n if (canStartPoll) {\n items.add(\n 'polls',\n \n \n {app.translator.trans(`fof-polls.forum.composer_discussion.${this.composer.fields.poll ? 'edit' : 'add'}_poll`)}\n \n ,\n 1\n );\n }\n });\n\n extend(composer.prototype, 'data', function (data) {\n if (this.composer.fields.poll) {\n data.poll = this.composer.fields.poll;\n }\n });\n};\n\nexport default () => {\n addToComposer(DiscussionComposer);\n addToComposer(ReplyComposer);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport CreatePollModal from './CreatePollModal';\nimport PollFormState from '../states/PollFormState';\n\nexport default class EditPollModal extends CreatePollModal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n await state.save(data);\n\n // Show success alert\n const alertId = app.alerts.show(\n {\n type: 'success',\n },\n app.translator.trans('fof-polls.forum.compose.success')\n );\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ListVotersModal from './ListVotersModal';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport EditPollModal from './EditPollModal';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollOption from '../models/PollOption';\nimport Post from 'flarum/common/models/Post';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollImage from './Poll/PollImage';\n\nexport interface PostPollAttrs extends ComponentAttrs {\n poll: Poll;\n post?: Post;\n}\n\nexport default class PostPoll extends Component {\n loadingOptions: boolean = false;\n useSubmitUI!: boolean;\n pendingSubmit: boolean = false;\n pendingOptions: any;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingOptions = null;\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view() {\n const poll = this.attrs.poll;\n const options = poll.options() || [];\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n\n if (maxVotes === 0) maxVotes = options.length;\n\n const infoItems = this.infoItems(maxVotes);\n\n return (\n
\n
\n
\n

{poll.question()}

\n {poll.subtitle() &&

{poll.subtitle()}

}\n
\n\n
\n {poll.canSeeVoters() && (\n \n
\n
\n\n {!!poll.imageUrl() && }\n\n
\n
{options.map(this.viewOption.bind(this))}
\n\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n\n {this.useSubmitUI && this.pendingSubmit && (\n \n )}\n
\n
\n
\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n viewOption(opt: PollOption) {\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n const totalVotes = poll.voteCount();\n\n const voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : poll.myVotes()?.some?.((vote) => vote.option() === opt);\n const votes = opt.voteCount();\n const percent = totalVotes > 0 ? Math.round((votes / totalVotes) * 100) : 0;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n const canSeeVoteCount = typeof votes === 'number';\n const isDisabled = this.loadingOptions || (hasVoted && !poll.canChangeVote());\n const width = canSeeVoteCount ? percent : (Number(voted) / (poll.myVotes()?.length || 1)) * 100;\n\n const showCheckmark = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()));\n\n const bar = (\n
\n {showCheckmark && (\n \n )}\n\n
\n {opt.answer()}\n {voted && !showCheckmark && icon('fas fa-check-circle', { className: 'PollAnswer-check' })}\n {canSeeVoteCount && {percent}%}\n
\n\n {opt.imageUrl() ? {opt.answer()} : null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option: PollOption, evt: Event) {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n evt.target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.attrs.poll.myVotes().map?.((v) => v.option().id()));\n const isUnvoting = optionIds.delete(option.id());\n const allowsMultiple = this.attrs.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id());\n }\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n return;\n }\n\n return this.submit(optionIds, null, () => (evt.target.checked = isUnvoting));\n }\n\n onsubmit() {\n return this.submit(this.pendingOptions, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds, cb, onerror) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.attrs.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n\n m.redraw();\n });\n }\n\n showVoters() {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.attrs.poll,\n post: this.attrs.post,\n });\n }\n\n deletePoll() {\n if (confirm(extractText(app.translator.trans('fof-polls.forum.moderation.delete_confirm')))) {\n this.attrs.poll.delete().then(() => {\n m.redraw.sync();\n });\n }\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n vnode.state.updateVisibility();\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose(e) {\n if (this.pendingOptions) {\n e.preventDefault();\n return true;\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PollView from './components/PollView';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PostPoll from './components/PostPoll';\n\ninterface PusherPollDto {\n pollId: string;\n pollVoteCount: number;\n options: { [key: string]: number };\n}\n\nexport default () => {\n extend(CommentPost.prototype, 'content', function (content) {\n const post = this.attrs.post;\n\n if ((!post.isHidden() || this.revealContent) && post.polls()) {\n for (const poll of post.polls()) {\n if (poll) {\n content.push();\n }\n }\n }\n });\n\n extend(CommentPost.prototype, 'oninit', function () {\n this.subtree.check(() => {\n const polls = this.attrs.post.polls();\n\n const checks = polls?.map?.(\n (poll) =>\n poll && [\n poll.data?.attributes,\n poll.options().map?.((option) => option?.data?.attributes),\n poll.myVotes().map?.((vote) => vote.option()?.id()),\n ]\n );\n\n return JSON.stringify(checks);\n });\n });\n\n extend(DiscussionPage.prototype, 'oncreate', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n // We will listen for updates to all polls and options\n // Even if that model is not in the current discussion, it doesn't really matter\n binding.channels.main.bind('updatedPollOptions', (data: PusherPollDto) => {\n const poll = app.store.getById('polls', data['pollId']);\n\n if (poll) {\n poll.pushAttributes({\n voteCount: data['pollVoteCount'],\n });\n\n // Not redrawing here, as the option below should trigger the redraw already\n }\n\n const changedOptions = data['options'];\n\n for (const optionId in changedOptions) {\n const option = app.store.getById('poll_options', optionId);\n\n if (option && option.voteCount() !== undefined) {\n option.pushAttributes({\n voteCount: changedOptions[optionId],\n });\n }\n }\n\n m.redraw();\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollView from './PollView';\n\nexport interface PollShowcaseItemAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollShowcaseItem extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListState from '../states/PollListState';\nimport type Mithril from 'mithril';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport app from 'flarum/forum/app';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\nexport default class PollShowcase extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.attrs.state.refresh();\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.active-polls')}

\n {this.showcaseItems().toArray()}\n {this.showcaseItems().toArray().length === 0 && }\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.ended-polls')}

\n {this.endedItems().toArray()}\n {this.endedItems().toArray().length === 0 && }\n
\n
\n );\n }\n\n showcaseItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (!poll.hasEnded()) {\n items.add('poll-active-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n\n endedItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (poll.hasEnded()) {\n items.add('poll-ended-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Mithril from 'mithril';\nimport PollListState from '../states/PollListState';\nimport extractText from 'flarum/common/utils/extractText';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollShowcase from './PollShowcase';\n\nexport default class PollsShowcasePage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n include: this.includeParams(),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n includeParams(): string[] {\n return ['options', 'votes', 'myVotes', 'myVotes.option'];\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll-showcase', );\n }\n\n return items;\n }\n\n sidebarItems(): ItemList {\n const items = super.sidebarItems();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n if (canStartPoll) {\n items.remove('newDiscussion');\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n ,\n 100\n );\n }\n\n return items;\n }\n\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\nimport PollForm from './PollForm';\nimport ComposePollHero from './ComposePollHero';\nimport ComposePollPage from './ComposePollPage';\nimport PollsPage from './PollsPage';\nimport PollView from './PollView';\nimport PollViewPage from './PollViewPage';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport PollOption from './Poll/PollOption';\nimport PollOptions from './Poll/PollOptions';\nimport PollsShowcasePage from './PollsShowcasePage';\nimport PollShowcase from './PollShowcase';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\nimport PollImage from './Poll/PollImage';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n PollForm,\n ComposePollHero,\n ComposePollPage,\n PollsPage,\n PollView,\n PollViewPage,\n PollSubmitButton,\n PollOption,\n PollOptions,\n PollsShowcasePage,\n PollShowcase,\n PollShowcaseItem,\n AbstractPollPage,\n PollTitle,\n PollSubtitle,\n PollImage,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","import Model from 'flarum/common/Model';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\nimport computed from 'flarum/common/utils/computed';\n\nexport default class Poll extends Model {\n public tempOptions: PollOption[] | undefined;\n\n question() {\n return Model.attribute('question').call(this);\n }\n\n subtitle() {\n return Model.attribute('subtitle').call(this);\n }\n\n image() {\n return Model.attribute('image').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n imageAlt() {\n return Model.attribute('imageAlt').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n hasEnded() {\n return Model.attribute('hasEnded').call(this);\n }\n\n endDate() {\n return Model.attribute('endDate', Model.transformDate).call(this);\n }\n\n publicPoll() {\n return Model.attribute('publicPoll').call(this);\n }\n\n hideVotes() {\n return Model.attribute('hideVotes').call(this);\n }\n\n allowChangeVote() {\n return Model.attribute('allowChangeVote').call(this);\n }\n\n allowMultipleVotes() {\n return Model.attribute('allowMultipleVotes').call(this);\n }\n\n maxVotes() {\n return Model.attribute('maxVotes').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n canVote() {\n return Model.attribute('canVote').call(this);\n }\n\n canEdit() {\n return Model.attribute('canEdit').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n canSeeVoters() {\n return Model.attribute('canSeeVoters').call(this);\n }\n\n canChangeVote() {\n return Model.attribute('canChangeVote').call(this);\n }\n\n options() {\n const options = Model.hasMany('options').call(this);\n return options ? (options as PollOption[]) : [];\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n myVotes(): PollVote[] {\n const myVotes = Model.hasMany('myVotes').call(this);\n return myVotes ? (myVotes as PollVote[]) : [];\n }\n\n isGlobal() {\n return Model.attribute('isGlobal').call(this);\n }\n\n isHidden() {\n return computed('hiddenAt', (hiddenAt) => !!hiddenAt).call(this);\n }\n\n // TODO: These two don't make sense as of now\n isUnread() {\n return false;\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollVote from './PollVote';\n\nexport default class PollOption extends Model {\n answer() {\n return Model.attribute('answer').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n poll() {\n return Model.hasOne('polls').call(this);\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollOption from './PollOption';\nimport User from 'flarum/common/models/User';\n\nexport default class PollVote extends Model {\n poll() {\n return Model.hasOne('poll').call(this);\n }\n\n option() {\n const result = Model.hasOne('option').call(this);\n return result === false ? null : result;\n }\n\n user() {\n return Model.hasOne('user').call(this);\n }\n\n pollId() {\n return Model.attribute('pollId').call(this);\n }\n\n optionId() {\n return Model.attribute('optionId').call(this);\n }\n\n apiEndpoint() {\n return `/fof/polls/${this.pollId()}/vote`;\n }\n}\n","import Poll from './Poll';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\n\nexport const models = {\n Poll,\n PollOption,\n PollVote,\n};\n","import PollFormState from './PollFormState';\nimport PollListState from './PollListState';\nimport PollState from './PollState';\n\nexport const states = {\n PollFormState,\n PollListState,\n PollState,\n};\n","import PollControls from './PollControls';\n\nexport const utils = {\n PollControls,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Forum'];","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport Forum from 'flarum/common/models/Forum';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PollVote from './models/PollVote';\nimport PollsPage from './components/PollsPage';\nimport ComposePollPage from './components/ComposePollPage';\nimport PollViewPage from './components/PollViewPage';\nimport PollsShowcasePage from './components/PollsShowcasePage';\n\nexport default [\n new Extend.Routes() //\n .add('fof.polls.showcase', '/polls', PollsShowcasePage)\n .add('fof.polls.list', '/polls/all', PollsPage)\n .add('fof.polls.view', '/polls/view/:id', PollViewPage)\n .add('fof.polls.compose', '/polls/composer', ComposePollPage),\n\n new Extend.Store() //\n .add('polls', Poll)\n .add('poll_options', PollOption)\n .add('poll_votes', PollVote),\n\n new Extend.Model(Post) //\n .hasMany('polls')\n .attribute('canStartPoll'),\n\n new Extend.Model(Forum) //\n .attribute('canStartPolls'),\n\n new Extend.Model(Discussion) //\n .attribute('hasPoll')\n .attribute('canStartPoll'),\n];\n","import app from 'flarum/forum/app';\n\nimport addDiscussionBadge from './addDiscussionBadge';\nimport addComposerItems from './addComposerItems';\nimport addPollsToPost from './addPollsToPost';\nimport addPostControls from './addPostControls';\nimport addNavItem from './addNavItem';\n\nexport * from './components';\nexport * from './models';\nexport * from './states';\nexport * from './utils';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n addNavItem();\n});\n\nexport { default as extend } from './extend';\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CreatePollModal from './components/CreatePollModal';\nimport Button from 'flarum/common/components/Button';\nimport Post from 'flarum/common/models/Post';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nexport default () => {\n const createPoll = (post: Post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data: PollModelAttributes) =>\n app.store\n .createRecord('polls')\n .save(\n {\n ...data,\n relationships: {\n post,\n },\n },\n {\n data: {\n include: 'options,myVotes,myVotes.option',\n },\n }\n )\n .then((poll) => {\n // @ts-ignore\n post.rawRelationship('polls')?.push?.({ type: 'polls', id: poll.id() });\n\n return poll;\n }),\n });\n\n extend(PostControls, 'moderationControls', function (items, post) {\n // @ts-ignore\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function addNavItem() {\n extend(IndexPage.prototype, 'navItems', (items) => {\n if (!app.forum.attribute('globalPollsEnabled')) {\n return;\n }\n\n items.add(\n 'fof-polls-showcase',\n LinkButton.component(\n {\n href: app.route('fof.polls.showcase'),\n icon: 'fas fa-poll',\n },\n app.translator.trans('fof-polls.forum.page.nav')\n ),\n 35\n );\n\n const showAllGlobalPolls = app.forum.attribute('canStartGlobalPolls');\n\n if (showAllGlobalPolls) {\n items.add(\n 'fof-polls-list',\n LinkButton.component(\n {\n href: app.route('fof.polls.list'),\n icon: 'fas fa-list',\n },\n app.translator.trans('fof-polls.forum.page.nav-all')\n ),\n 32\n );\n }\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","asyncGeneratorStep","gen","reject","_next","_throw","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","_setPrototypeOf","bind","_inheritsLoose","subClass","superClass","_getPrototypeOf","_isNativeReflectConstruct","Boolean","valueOf","Reflect","construct","_wrapNativeSuper","Class","_cache","Map","toString","indexOf","isNativeFunction","has","set","Wrapper","isNativeReflectConstruct","FormError","_Error","props","PollFormState","poll","loading","deleting","expandedGroup","createNewPoll","app","createRecord","pushAttributes","question","endDate","publicPoll","allowMultipleVotes","hideVotes","allowChangeVote","maxVotes","tempOptions","_proto","isExpanded","groupKey","expand","m","redraw","save","_save","_callee","data","_context","attributes","options","_x","_delete2","_callee2","_context2","ComposePollHero","_Component","_this","_len","Array","_key","concat","oninit","vnode","attrs","view","className","trans","id","controlItems","toArray","items","ItemList","add","LinkButton","icon","itemClassName","href","exists","Component","ComposePollPage","_Page","_this2","attribute","bodyClass","editId","route","param","loadEditingPoll","_this2$poll","_this2$poll2","canEdit","_loadEditingPoll","alreadyLoaded","getById","find","LoadingIndicator","listItems","sidebarItems","PollForm","onsubmit","_onsubmit","state","isNew","alertAttrs","alertId","controls","Button","onclick","show","setTimeout","dismiss","_x2","_x3","SelectDropdown","buttonClassName","accessibleToggleLabel","navItems","IndexPage","Page","PollOption","option","hasVoted","totalVotes","votes","voted","canSeeVoteCount","answer","percent","Math","round","_this$poll$myVotes","overallVoteCount","voteCount","hasVotedFor","isDisabled","loadingOptions","canChangeVote","width","Number","myVotes","bar","style","showCheckMarks","checked","disabled","onchange","changeVote","optionDisplayItems","imageUrl","src","alt","classList","Tooltip","text","count","onremove","hideOptionTooltip","tooltipVisible","updateVisibility","PollOptions","pollOptions","createOptionView","PollImage","imageAlt","imageItems","_this$imageAlt","ListVotersModal","_Modal","include","title","content","map","optionContent","opt","filter","optionAnswer","voteContent","vote","user","Link","avatar","username","Modal","PollState","pendingSubmit","pendingOptions","useSubmitUI","showVoters","hasEnded","canVote","init","isShowResult","some","getMaxVotes","showButton","evt","target","LogInModal","optionIds","Set","isUnvoting","clear","size","submit","hasSelectedOptions","cb","onerror","_this3","url","body","from","res","pushPayload","PollSubmitButton","event","pollButtonSubmit","PollTitle","pollTitleItems","PollSubtitle","subtitle","pollSubtitleItems","PollView","preventClose","preventDefault","oncreate","window","addEventListener","removeEventListener","PollControls","controlsView","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","infoItems","isEmpty","questionSlug","slug","Dropdown","menuClassName","class","time","dayjs","fromNow","max","toPropertyKey","toPrimitive","String","_defineProperties","descriptor","_createClass","Constructor","protoProps","staticProps","PollPageHero","wrapperClasses","classNames","Hero","AbstractPollPage","polls","pageContent","hero","mainContent","sidebar","contentItems","IndexPageHero","setContent","remove","toObject","startsWith","PollViewPage","_AbstractPollPage","item","PollListItem","subtree","highlightRegExp","SubtreeRetainer","freshness","markedAllAsReadAt","getTime","active","elementAttrs","isHidden","Slidable","contentView","slidableUnderneathView","isUnread","markAsRead","mainView","highlight","slidableInstance","slidable","element","$","on","onbeforeupdate","needsRebuild","matches","lastVotedNumber","activeView","abbreviateNumber","PollList","params","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","Placeholder","isSearchResults","getPages","pg","globalEventEmitter","EventEmitter","PollListState","_PaginatedListState","page","extraPolls","eventEmitter","deletePoll","ReferenceError","_assertThisInitialized","requestParams","_this$params$sort","sort","sortMap","q","loadPage","preloadedPolls","initialLoading","relevance","newest","oldest","removePoll","emit","_step","_iterator","_createForOfIteratorHelperLoose","pages","index","splice","addPoll","unshift","getAllItems","number","PaginatedListState","PollsPage","refresh","extractText","viewItems","actionItems","canStartPoll","newPollAction","context","section","itemName","Separator","pollControls","moderationControls","editAction","destructiveControls","canDelete","deleteAction","confirm","showDeletionAlert","back","location","reload","message","success","_extends","assign","source","UploadPollImageButton","_Button","uploadedImageUrl","fileName","$input","getImageUrl","canUpload","children","upload","appendTo","hide","trigger","FormData","append","files","resourceUrl","serialize","raw","failure","_this$attrs$poll","_this$attrs$option","_this3$attrs$poll","_this3$attrs$option","image","isImageUpload","_this$attrs$poll2","_this$attrs$option2","response","_this$attrs$onUpload","_this$attrs","_this$$input","fileUrl","onUpload","_this$$input2","optionAnswers","optionImageUrls","datepickerMinDate","_poll$tempOptions","Stream","formatDate","isAfter","fields","_this$state$poll","bidi","hasImage","uploadConditional","'['","pollImageUploadSuccess","placeholder","required","displayOptions","addOption","min","isBefore","Switch","imgFunc","pollOptionImageUploadSuccess","removeOption","alert","_this$dateToTimestamp","pollExists","pollImage","dateToTimestamp","t0","RequestError","console","date","def","dayjsDate","isValid","format","isUpload","ifCanUpload","uploadButton","imageUrlInput","_this$state$poll2","canUploadNow","CreatePollModal","onFormSubmit","_onFormSubmit","toPoll","pollOption","addToComposer","composer","extend","_this$composer$body","_discussion$canStartP","discussion","canStartPolls","EditPollModal","_CreatePollModal","PostPoll","canSeeVoters","viewOption","_poll$myVotes","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","showCheckmark","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","post","sync","PollShowcaseItem","PollShowcase","showcaseItems","endedItems","PollsShowcasePage","includeParams","components","Poll","_Model","Model","isGlobal","computed","hiddenAt","apiEndpoint","PollVote","result","pollId","optionId","models","states","utils","Extend","Post","hasMany","Forum","Discussion","createPoll","DiscussionList","badges","hasPoll","Badge","label","DiscussionComposer","ReplyComposer","CommentPost","revealContent","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_option$data","_vote$option","JSON","stringify","DiscussionPage","binding","channels","main","changedOptions","unbind","relationships","_post$rawRelationship","rawRelationship","PostControls"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":";0BAAA,IAAIA,EAAUC,EAAAA,KAAAA,QACd,SAASC,IACP,aACAC,EAAOC,QAAUF,EAAsB,WACrC,OAAOG,CACT,EAAGF,EAAOC,QAAQE,YAAa,EAAMH,EAAOC,QAAiB,QAAID,EAAOC,QACxE,IAAIG,EACFF,EAAI,CAAC,EACLG,EAAIC,OAAOC,UACXC,EAAIH,EAAEI,eACNC,EAAIJ,OAAOK,gBAAkB,SAAUP,EAAGF,EAAGG,GAC3CD,EAAEF,GAAKG,EAAEO,KACX,EACAC,EAAI,mBAAqBC,OAASA,OAAS,CAAC,EAC5CC,EAAIF,EAAEG,UAAY,aAClBC,EAAIJ,EAAEK,eAAiB,kBACvBC,EAAIN,EAAEO,aAAe,gBACvB,SAASC,EAAOjB,EAAGF,EAAGG,GACpB,OAAOC,OAAOK,eAAeP,EAAGF,EAAG,CACjCU,MAAOP,EACPiB,YAAY,EACZC,cAAc,EACdC,UAAU,IACRpB,EAAEF,EACR,CACA,IACEmB,EAAO,CAAC,EAAG,GACb,CAAE,MAAOjB,GACPiB,EAAS,SAAgBjB,EAAGF,EAAGG,GAC7B,OAAOD,EAAEF,GAAKG,CAChB,CACF,CACA,SAASoB,EAAKrB,EAAGF,EAAGG,EAAGG,GACrB,IAAIK,EAAIX,GAAKA,EAAEK,qBAAqBmB,EAAYxB,EAAIwB,EAClDX,EAAIT,OAAOqB,OAAOd,EAAEN,WACpBU,EAAI,IAAIW,EAAQpB,GAAK,IACvB,OAAOE,EAAEK,EAAG,UAAW,CACr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b,IAAAA,WAAeyC,MAAM,mCAI9B,KCxCAqY,EAAAA,EAAAA,QAAOlV,KAAAA,UAAqB,YAAY,SAAC/C,GAClC7C,IAAAA,MAAUyD,UAAmB,wBAIlCZ,EAAME,IACJ,qBACAC,IAAAA,UACE,CACEG,KAAMnD,IAAAA,MAAU,sBAChBiD,KAAM,eAERjD,IAAAA,WAAeyC,MAAM,6BAEvB,IAGyBzC,IAAAA,MAAUyD,UAAmB,wBAGtDZ,EAAME,IACJ,iBACAC,IAAAA,UACE,CACEG,KAAMnD,IAAAA,MAAU,kBAChBiD,KAAM,eAERjD,IAAAA,WAAeyC,MAAM,iCAEvB,IAGN,GFnBF","sources":["webpack://@fof/polls/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/regenerator/index.js","webpack://@fof/polls/webpack/bootstrap","webpack://@fof/polls/webpack/runtime/compat get default export","webpack://@fof/polls/webpack/runtime/define property getters","webpack://@fof/polls/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/polls/webpack/runtime/make namespace object","webpack://@fof/polls/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/polls/./src/forum/addDiscussionBadge.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/ReplyComposer']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/isNativeFunction.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/construct.js","webpack://@fof/polls/./src/forum/components/form/FormError.tsx","webpack://@fof/polls/./src/forum/states/PollFormState.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Page']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/polls/./src/forum/components/ComposePollHero.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/SelectDropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/polls/./src/forum/components/ComposePollPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/SubtreeRetainer']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Link']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/slidable']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/abbreviateNumber']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/polls/./src/forum/components/Poll/PollOption.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollOptions.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollImage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/polls/./src/forum/components/ListVotersModal.tsx","webpack://@fof/polls/./src/forum/states/PollState.ts","webpack://@fof/polls/./src/forum/components/Poll/PollSubmitButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/string']\"","webpack://@fof/polls/./src/forum/components/Poll/PollTitle.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollSubtitle.tsx","webpack://@fof/polls/./src/forum/components/PollView.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/polls/./src/forum/components/PollPageHero.tsx","webpack://@fof/polls/./src/forum/components/AbstractPollPage.tsx","webpack://@fof/polls/./src/forum/components/PollViewPage.tsx","webpack://@fof/polls/./src/forum/components/Poll/PollListItem.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Placeholder']\"","webpack://@fof/polls/./src/forum/components/Poll/PollList.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/states/PaginatedListState']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/EventEmitter']\"","webpack://@fof/polls/./src/forum/states/PollListState.ts","webpack://@fof/polls/./src/forum/components/PollsPage.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/components/Separator']\"","webpack://@fof/polls/./src/forum/utils/PollControls.tsx","webpack://@fof/polls/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/polls/./src/forum/components/UploadPollImageButton.tsx","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/RequestError']\"","webpack://@fof/polls/./src/forum/components/PollForm.tsx","webpack://@fof/polls/./src/forum/components/CreatePollModal.tsx","webpack://@fof/polls/./src/forum/addComposerItems.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/CommentPost']\"","webpack://@fof/polls/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/polls/./src/forum/components/EditPollModal.tsx","webpack://@fof/polls/./src/forum/components/PostPoll.tsx","webpack://@fof/polls/./src/forum/addPollsToPost.tsx","webpack://@fof/polls/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@fof/polls/./src/forum/components/PollShowcaseItem.tsx","webpack://@fof/polls/./src/forum/components/PollShowcase.tsx","webpack://@fof/polls/./src/forum/components/PollsShowcasePage.tsx","webpack://@fof/polls/./src/forum/components/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/Model']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/utils/computed']\"","webpack://@fof/polls/./src/forum/models/Poll.ts","webpack://@fof/polls/./src/forum/models/PollOption.ts","webpack://@fof/polls/./src/forum/models/PollVote.ts","webpack://@fof/polls/./src/forum/models/index.ts","webpack://@fof/polls/./src/forum/states/index.ts","webpack://@fof/polls/./src/forum/utils/index.ts","webpack://@fof/polls/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Post']\"","webpack://@fof/polls/external root \"flarum.core.compat['common/models/Forum']\"","webpack://@fof/polls/./src/forum/extend.ts","webpack://@fof/polls/./src/forum/index.ts","webpack://@fof/polls/./src/forum/addPostControls.tsx","webpack://@fof/polls/./src/forum/addNavItem.ts"],"sourcesContent":["var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport DiscussionList from 'flarum/forum/components/DiscussionList';\nimport Discussion from 'flarum/common/models/Discussion';\nimport { PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\n\nexport default () => {\n // @ts-ignore\n extend(DiscussionList.prototype, 'requestParams', (params: PaginatedListRequestParams) => {\n (params.include as string[]).push('poll');\n });\n\n extend(Discussion.prototype, 'badges', function (badges) {\n // @ts-ignore\n if (this.hasPoll()) {\n badges.add(\n 'poll',\n Badge.component({\n type: 'poll',\n label: app.translator.trans('fof-polls.forum.tooltip.badge'),\n icon: 'fas fa-poll',\n }),\n 5\n );\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/ReplyComposer'];","function asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nexport { _asyncToGenerator as default };","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","function _getPrototypeOf(t) {\n return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {\n return t.__proto__ || Object.getPrototypeOf(t);\n }, _getPrototypeOf(t);\n}\nexport { _getPrototypeOf as default };","function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}\nexport { _isNativeReflectConstruct as default };","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nimport isNativeFunction from \"./isNativeFunction.js\";\nimport construct from \"./construct.js\";\nfunction _wrapNativeSuper(t) {\n var r = \"function\" == typeof Map ? new Map() : void 0;\n return _wrapNativeSuper = function _wrapNativeSuper(t) {\n if (null === t || !isNativeFunction(t)) return t;\n if (\"function\" != typeof t) throw new TypeError(\"Super expression must either be null or a function\");\n if (void 0 !== r) {\n if (r.has(t)) return r.get(t);\n r.set(t, Wrapper);\n }\n function Wrapper() {\n return construct(t, arguments, getPrototypeOf(this).constructor);\n }\n return Wrapper.prototype = Object.create(t.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), setPrototypeOf(Wrapper, t);\n }, _wrapNativeSuper(t);\n}\nexport { _wrapNativeSuper as default };","function _isNativeFunction(t) {\n try {\n return -1 !== Function.toString.call(t).indexOf(\"[native code]\");\n } catch (n) {\n return \"function\" == typeof t;\n }\n}\nexport { _isNativeFunction as default };","import isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _construct(t, e, r) {\n if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);\n var o = [null];\n o.push.apply(o, e);\n var p = new (t.bind.apply(t, o))();\n return r && setPrototypeOf(p, r.prototype), p;\n}\nexport { _construct as default };","import { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\nexport default class FormError extends Error {\n constructor(props: NestedStringArray | string) {\n super(props + '');\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport default class PollFormState {\n poll: Poll;\n loading: boolean;\n deleting: boolean;\n expandedGroup: string;\n\n static createNewPoll() {\n const poll = app.store.createRecord('polls');\n\n poll.pushAttributes({\n question: '',\n endDate: '',\n publicPoll: false,\n allowMultipleVotes: false,\n hideVotes: false,\n allowChangeVote: false,\n maxVotes: 0,\n });\n\n poll.tempOptions = [app.store.createRecord('poll_options'), app.store.createRecord('poll_options')];\n\n return poll;\n }\n\n constructor(poll: Poll) {\n if (!poll) {\n poll = PollFormState.createNewPoll();\n }\n\n this.loading = false;\n this.deleting = false;\n this.poll = poll;\n this.expandedGroup = 'setup';\n }\n\n isExpanded(groupKey: string) {\n return this.expandedGroup === groupKey;\n }\n\n expand(groupKey: string) {\n this.expandedGroup = groupKey;\n m.redraw();\n }\n\n async save(data: any) {\n this.loading = true;\n m.redraw();\n\n try {\n this.poll = await this.poll.save(data);\n /**\n * Cleanup attributes:\n * For the saving process, we add the options directly to the attributes.\n * As we currently cannot add new PollOptions as relationships.\n */\n delete this.poll!.data!.attributes!.options;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n\n async delete() {\n this.loading = true;\n m.redraw();\n\n try {\n await this.poll.delete();\n this.deleting = true;\n } finally {\n this.loading = false;\n m.redraw();\n }\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Page'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","import Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport interface ComposePollHeroAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class ComposePollHero extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n
\n

{app.translator.trans(`fof-polls.forum.compose.${!!this.poll.id() ? 'edit' : 'add'}_title`)}

\n
{this.controlItems().toArray()}
\n
\n
\n
\n );\n }\n\n controlItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'edit',\n \n {app.translator.trans('fof-polls.forum.compose.polls_manager')}\n \n );\n\n if (this.poll.exists) {\n items.add(\n 'view',\n \n {app.translator.trans('fof-polls.forum.compose.polls_preview')}\n \n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/SelectDropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport Poll from '../models/Poll';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollForm from './PollForm';\nimport PollFormState from '../states/PollFormState';\nimport ComposePollHero from './ComposePollHero';\nimport Button from 'flarum/common/components/Button';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPage from 'flarum/forum/components/IndexPage';\n\nexport default class ComposePollPage extends Page {\n poll: Poll | null | undefined = null;\n\n loading: boolean = false;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n // prevent users from accessing the page if they can't start global polls or if they are disabled altogether\n if (!app.forum.attribute('globalPollsEnabled') || !app.forum.attribute('canStartGlobalPolls')) {\n m.route.set('/');\n return;\n }\n\n this.bodyClass = 'App--compose-poll';\n\n // Get the `edit` parameter from the URL\n const editId = m.route.param('id');\n\n // either load the poll we're editing or create a new one\n const pollPromise = editId ? this.loadEditingPoll(editId) : Promise.resolve(PollFormState.createNewPoll());\n\n pollPromise.then((poll: Poll | null | undefined) => {\n this.poll = poll;\n\n if (poll?.exists && !poll.canEdit()) {\n m.route.set('/');\n return;\n }\n\n app.history.push('compose-poll', app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n app.setTitle(app.translator.trans(`fof-polls.forum.compose.${!!this.poll?.id() ? 'edit' : 'add'}_title`) as string);\n\n m.redraw();\n });\n }\n\n async loadEditingPoll(editId: string) {\n const alreadyLoaded = app.store.getById('poll', editId);\n\n if (alreadyLoaded) return alreadyLoaded;\n\n this.loading = true;\n\n const poll = await app.store.find('fof/polls', editId);\n\n this.loading = false;\n\n return poll;\n }\n\n view(): Mithril.Children {\n if (this.loading || !this.poll) {\n return ;\n }\n\n return (\n
\n \n
\n
\n \n
\n \n
\n
\n
\n
\n );\n }\n\n async onsubmit(data: Object, state: PollFormState) {\n const isNew = state.poll.id() === undefined;\n await state.save(data);\n\n const alertAttrs = isNew\n ? {\n type: 'success',\n controls: [\n \n m.route.set(\n app.route('fof.polls.compose', {\n id: state.poll.id(),\n })\n )\n }\n >\n {app.translator.trans('fof-polls.forum.compose.continue_editing')}\n ,\n ],\n }\n : {\n type: 'success',\n };\n\n // Show success alert\n const alertId = app.alerts.show(alertAttrs, app.translator.trans('fof-polls.forum.compose.success'));\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n\n if (isNew) {\n m.route.set(app.route('fof.polls.list'));\n }\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/SubtreeRetainer'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/slidable'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/abbreviateNumber'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOptionModel from '../../models/PollOption';\nimport PollState from '../../states/PollState';\nimport Tooltip, { TooltipAttrs } from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from '../../models/Poll';\n\ninterface PollOptionAttrs extends ComponentAttrs {\n option: PollOptionModel;\n name: string;\n state: PollState;\n}\n\nexport default class PollOption extends Component {\n option!: PollOptionModel;\n name!: string;\n state!: PollState;\n hasVoted: boolean = false;\n totalVotes: number = 0;\n votes: number = 0;\n voted: boolean = false;\n poll!: Poll;\n canSeeVoteCount: boolean = false;\n answer!: string;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.option = this.attrs.option;\n this.name = this.attrs.name;\n this.state = this.attrs.state;\n this.poll = this.state.poll;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n this.canSeeVoteCount = typeof this.votes === 'number';\n\n this.answer = this.option.answer();\n }\n\n percent(): number {\n return this.totalVotes > 0 ? Math.round((this.votes / this.totalVotes) * 100) : 0;\n }\n\n view(): Mithril.Children {\n // following values can be changed by ui interactions, so we need to update them on every render\n this.hasVoted = this.state.hasVoted();\n this.totalVotes = this.state.overallVoteCount();\n this.votes = this.option.voteCount();\n this.voted = this.state.hasVotedFor(this.option);\n\n const isDisabled = this.state.loadingOptions || (this.hasVoted && !this.poll.canChangeVote());\n const width = this.canSeeVoteCount ? this.percent() : (Number(this.voted) / (this.poll.myVotes()?.length || 1)) * 100;\n\n const bar = (\n \n );\n\n return (\n \n {this.canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n \n );\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n\n // @ts-ignore\n vnode.state.updateVisibility();\n }\n\n optionDisplayItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'answer',\n \n {this.answer}\n \n );\n\n this.voted && !this.state.showCheckMarks && items.add('check', icon('fas fa-check-circle', { className: 'PollAnswer-check' }));\n\n this.canSeeVoteCount &&\n items.add('percent', {this.percent()}%);\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollOption from './PollOption';\nimport PollOptionModel from '../../models/PollOption';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollState from '../../states/PollState';\n\ninterface PollOptionsAttrs extends ComponentAttrs {\n options: PollOptionModel[];\n name: String;\n state: PollState;\n}\n\nexport default class PollOptions extends Component {\n view(): Mithril.Children {\n return
{this.pollOptions().toArray()}
;\n }\n\n pollOptions(): ItemList {\n const items = new ItemList();\n\n this.attrs.options.forEach((option: PollOptionModel): void => {\n items.add('option' + option.id(), this.createOptionView(option));\n });\n\n return items;\n }\n\n createOptionView(option: PollOptionModel): Mithril.Children {\n return ;\n }\n}\n","import type Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from 'src/forum/models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\n\ninterface PollImageAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollImage extends Component {\n imageUrl: string | null = null;\n imageAlt: string | null = null;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.imageUrl = this.attrs.poll.imageUrl();\n this.imageAlt = this.attrs.poll.imageAlt();\n }\n\n view(): Mithril.Children {\n if (!this.imageUrl) {\n return;\n }\n\n return
{this.imageItems().toArray()}
;\n }\n\n imageItems(): ItemList {\n const items = new ItemList();\n\n items.add('image', {this.imageAlt);\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollModel from '../models/Poll';\nimport PollVote from '../models/PollVote';\nimport User from 'flarum/common/models/User';\nimport PollOption from '../models/PollOption';\n\ninterface ListVotersModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class ListVotersModal extends Modal {\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.loading = true;\n\n app.store\n .find('fof/polls', this.attrs.poll.id()!, {\n include: 'votes,votes.user,votes.option',\n })\n .then(() => (this.loading = false))\n .finally(() => m.redraw());\n }\n\n className(): string {\n return 'Modal--medium VotesModal';\n }\n\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.votes_modal.title');\n }\n\n content(): Mithril.Children {\n const options = this.attrs.poll.options() as PollOption[];\n return
{this.loading ? : options.map(this.optionContent.bind(this))}
;\n }\n\n optionContent(opt: PollOption): Mithril.Children {\n const votes = (this.attrs.poll.votes() || []).filter((v) => opt.id() === v!.option()!.id()) as PollVote[];\n\n return (\n
\n

{this.optionAnswer(opt)! + ':'}

\n\n {votes.length ? (\n
{votes.map(this.voteContent.bind(this))}
\n ) : (\n

{app.translator.trans('fof-polls.forum.modal.no_voters')}

\n )}\n
\n );\n }\n\n optionAnswer(opt: PollOption): string {\n return opt.answer();\n }\n\n voteContent(vote: PollVote): Mithril.Children {\n const user = vote.user() as User;\n const attrs = user && { href: app.route.user(user) };\n\n return (\n \n {avatar(user)} {username(user)}\n \n );\n }\n}\n","import app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport PollOption from '../models/PollOption';\nimport PollVote from '../models/PollVote';\nimport ListVotersModal from '../components/ListVotersModal';\nimport { ApiPayloadSingle } from 'flarum/common/Store';\n\nexport default class PollState {\n public poll: Poll;\n protected pendingSubmit: boolean = false;\n protected pendingOptions: Set | null = null;\n public loadingOptions: boolean = false;\n public useSubmitUI: boolean;\n public showCheckMarks: boolean;\n public canSeeVoteCount: boolean;\n\n constructor(poll: Poll) {\n this.poll = poll;\n this.useSubmitUI = !poll?.canChangeVote() && poll?.allowMultipleVotes();\n this.showCheckMarks = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!this.hasVoted() || poll.canChangeVote()));\n this.canSeeVoteCount = typeof poll.voteCount() === 'number';\n this.init();\n }\n\n /**\n * used as en extendable entry point for init customizations\n */\n init(): void {}\n\n isShowResult(): boolean {\n return this.poll.hasEnded() || (this.canSeeVoteCount && !!app.session.user && this.hasVoted());\n }\n\n hasVoted(): boolean {\n return this.poll.myVotes().length > 0;\n }\n\n overallVoteCount(): number {\n return this.poll.voteCount();\n }\n\n hasVotedFor(option: PollOption): boolean {\n return this.pendingOptions ? this.pendingOptions.has(option.id()!) : this.poll.myVotes().some((vote: PollVote) => vote.option() === option);\n }\n\n getMaxVotes(): number {\n const poll = this.poll;\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n if (maxVotes === 0) maxVotes = poll.options().length;\n return maxVotes;\n }\n\n showButton(): boolean {\n return this.useSubmitUI && this.pendingSubmit;\n }\n\n changeVote(option: PollOption, evt: Event): void {\n const target = evt.target as HTMLInputElement;\n\n if (!app.session.user) {\n app.modal.show(LogInModal);\n target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.poll.myVotes().map((v: PollVote) => v.option()!.id()!));\n const isUnvoting = optionIds.delete(option.id()!);\n const allowsMultiple = this.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id()!);\n }\n\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n m.redraw();\n return;\n }\n\n this.submit(optionIds, null, () => (target.checked = isUnvoting));\n }\n\n hasSelectedOptions(): boolean {\n return this.pendingSubmit;\n }\n\n onsubmit(): Promise {\n return this.submit(this.pendingOptions!, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds: Set, cb: Function | null, onerror: Function | null = null) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res: ApiPayloadSingle) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n this.canSeeVoteCount = typeof this.poll.voteCount() === 'number';\n m.redraw();\n });\n }\n\n showVoters = () => {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.poll,\n });\n };\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport PollState from '../../states/PollState';\n\ninterface PollSubmitButtonAttrs extends ComponentAttrs {\n state: PollState;\n}\n\nexport default class PollSubmitButton extends Component {\n view(): Mithril.Children {\n const state = this.attrs.state;\n return (\n this.pollButtonSubmit(state, event)}\n disabled={!state.hasSelectedOptions()}\n >\n {app.translator.trans('fof-polls.forum.poll.submit_button')}\n \n );\n }\n\n /**\n * Event handler for submit button being clicked\n */\n\n pollButtonSubmit(state: PollState, event: Event): void {\n state.onsubmit();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/string'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollTitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollTitle extends Component {\n view() {\n return
{this.pollTitleItems().toArray()}
;\n }\n\n pollTitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('title',

{this.attrs.poll.question()}

);\n\n return items;\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Poll from 'src/forum/models/Poll';\nimport Mithril from 'mithril';\n\nexport interface PollSubtitleAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollSubtitle extends Component {\n view() {\n if (!this.attrs.poll.subtitle()) {\n return;\n }\n\n return
{this.pollSubtitleItems().toArray()}
;\n }\n\n pollSubtitleItems(): ItemList {\n const items = new ItemList();\n\n items.add('subtitle',

{this.attrs.poll.subtitle()}

);\n\n return items;\n }\n}\n","import Mithril from 'mithril';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport app from 'flarum/forum/app';\nimport PollOptions from './Poll/PollOptions';\nimport PollImage from './Poll/PollImage';\nimport PollModel from '../models/Poll';\nimport PollState from '../states/PollState';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollControls from '../utils/PollControls';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport { slug } from 'flarum/common/utils/string';\nimport classList from 'flarum/common/utils/classList';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\n\ninterface PollAttrs extends ComponentAttrs {\n poll: PollModel;\n}\n\nexport default class PollView extends Component {\n state!: PollState;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n this.state = new PollState(this.attrs.poll);\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view(): Mithril.Children {\n const poll = this.attrs.poll;\n const state = this.state;\n const controls = PollControls.controls(poll, this);\n\n (poll.publicPoll() || poll.canEdit()) &&\n controls.add(\n 'view',\n \n );\n\n return (\n
\n {this.controlsView(controls.toArray())}\n
{this.createMainView().toArray()}
\n
\n );\n }\n\n createMainView(): ItemList {\n const items = new ItemList();\n\n items.add('header',
{this.createPollHeader().toArray()}
);\n items.add('content',
{this.createPollContent().toArray()}
);\n items.add('footer',
{this.createPollFooter().toArray()}
);\n\n return items;\n }\n\n createPollHeader(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n items.add('title', );\n if (poll.subtitle()) items.add('subtitle', );\n\n return items;\n }\n\n createPollContent(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (poll.imageUrl()) {\n items.add('image', );\n }\n\n items.add('form',
{this.createFormItems().toArray()}
);\n\n return items;\n }\n\n createPollFooter(): ItemList {\n const items = new ItemList();\n const state = this.state;\n\n const infoItems = this.infoItems(state.getMaxVotes());\n\n items.add(\n 'sticky',\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n {state.showButton() && }\n
\n );\n\n return items;\n }\n\n createFormItems(): ItemList {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const state = this.state;\n const questionSlug = slug(poll.question());\n\n items.add(\n 'elements',\n
\n {poll.question()}\n \n
\n );\n\n return items;\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose = (e: Event): boolean | void => {\n if (this.state.hasSelectedOptions()) {\n e.preventDefault();\n return true;\n }\n };\n}\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nexport { _createClass as default };","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nimport icon from 'flarum/common/helpers/icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\n\ninterface PollPageHeroAttrs extends ComponentAttrs {\n icon?: string;\n title?: string;\n}\n\nexport default class PollPageHero extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n }\n\n get classNames(): string {\n return classList({\n PollPageHero: true,\n Hero: true,\n });\n }\n\n get wrapperClasses(): string {\n return classList({\n 'PollPageHero--wrapper': true,\n });\n }\n\n oncreate(vnode: Mithril.Vnode): void {\n super.oncreate(vnode);\n }\n\n get title() {\n return this.attrs.title || app.translator.trans('fof-polls.forum.polls_page.title');\n }\n\n get icon() {\n return this.attrs.icon || 'fas fa-poll';\n }\n\n view() {\n return (\n
\n
\n
\n
{this.items().toArray()}
\n
\n
\n
\n );\n }\n\n items() {\n const items = new ItemList();\n items.add('title',

{[icon(this.icon), ' ', this.title]}

, 50);\n\n return items;\n }\n}\n","import Page, { IPageAttrs } from 'flarum/common/components/Page';\nimport PollListState from '../states/PollListState';\nimport Poll from '../models/Poll';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport type Mithril from 'mithril';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport listItems from 'flarum/common/helpers/listItems';\nimport app from 'flarum/forum/app';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport IndexPageHero from './PollPageHero';\n\nexport abstract class AbstractPollPage extends Page {\n loading: boolean = false;\n poll: Poll | null | undefined = null;\n polls: Poll[] = [];\n\n view(): Mithril.Children {\n return
{this.pageContent().toArray()}
;\n }\n\n pageContent(): ItemList {\n const items = new ItemList();\n\n items.add('hero', this.hero(), 100);\n items.add('main',
{this.mainContent().toArray()}
, 10);\n\n return items;\n }\n\n mainContent(): ItemList {\n const items = new ItemList();\n\n items.add('sidebar', this.sidebar(), 100);\n items.add('content', this.content(), 10);\n\n return items;\n }\n\n content(): Mithril.Children {\n return
{this.contentItems().toArray()}
;\n }\n\n contentItems(): ItemList {\n const items = new ItemList();\n\n if (this.loading) {\n items.add('loading', );\n }\n\n return items;\n }\n\n hero(): Mithril.Children {\n return ;\n }\n\n sidebar(): Mithril.Children {\n return (\n \n );\n }\n\n sidebarItems(): ItemList {\n const items = IndexPage.prototype.sidebarItems();\n\n items.setContent(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n navItems(): ItemList {\n const items = IndexPage.prototype.navItems();\n\n if (app.initializers.has('flarum-tags')) {\n // remove the tags from the nav items\n items.remove('separator');\n items.remove('moreTags');\n\n // each tag is added using the key \"tag{id}\". We need to remove all of them\n for (const key in items.toObject()) {\n if (key.startsWith('tag') && key !== 'tags') {\n items.remove(key);\n }\n }\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport PollModel from '../models/Poll';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class PollViewPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n const editId = m.route.param('id');\n this.poll = app.store.getById('poll', editId);\n\n if (!this.poll) {\n this.loading = true;\n\n app.store.find('fof/polls', editId).then((item) => {\n this.poll = item;\n this.loading = false;\n app.setTitle(this.poll.question());\n m.redraw();\n });\n }\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll', );\n }\n\n return items;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport type { PollListParams } from '../../states/PollListState';\nimport SubtreeRetainer from 'flarum/common/utils/SubtreeRetainer';\nimport classList from 'flarum/common/utils/classList';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Link from 'flarum/common/components/Link';\nimport highlight from 'flarum/common/helpers/highlight';\nimport slidable from 'flarum/forum/utils/slidable';\nimport icon from 'flarum/common/helpers/icon';\nimport abbreviateNumber from 'flarum/common/utils/abbreviateNumber';\nimport Poll from '../../models/Poll';\nimport PollControls from '../../utils/PollControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PollViewPage from '../PollViewPage';\n\nexport interface IPollListItemAttrs extends ComponentAttrs {\n poll: Poll;\n params: PollListParams;\n}\n\n/**\n * The `PollListItem` component shows a single poll in the\n * poll list.\n */\nexport default class PollListItem extends Component {\n /**\n * Ensures that the poll will not be redrawn\n * unless new data comes in.\n */\n subtree!: SubtreeRetainer;\n poll!: Poll;\n\n highlightRegExp?: RegExp;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n\n this.subtree = new SubtreeRetainer(\n () => this.poll.freshness,\n () => {\n const time = app.session.user && app.session.user.markedAllAsReadAt();\n return time && time.getTime();\n },\n () => this.active()\n );\n }\n\n elementAttrs() {\n return {\n className: classList('PollListItem', {\n active: this.active(),\n 'PollListItem--hidden': this.poll.isHidden(),\n Slidable: 'ontouchstart' in window,\n }),\n };\n }\n\n view() {\n const controls = PollControls.controls(this.poll, this).toArray();\n const attrs = this.elementAttrs();\n\n return (\n
\n {this.controlsView(controls)}\n {this.contentView()}\n {this.slidableUnderneathView()}\n
\n );\n }\n\n controlsView(controls: Mithril.ChildArray): Mithril.Children {\n return (\n !!controls.length && (\n \n {controls}\n \n )\n );\n }\n\n slidableUnderneathView(): Mithril.Children {\n const isUnread = this.poll.isUnread();\n\n return (\n \n {icon('fas fa-check')}\n \n );\n }\n\n contentView(): Mithril.Children {\n // const isUnread = this.poll.isUnread();\n // const isRead = this.poll.isRead();\n\n return (\n //
\n
{this.mainView()}
\n );\n }\n\n mainView(): Mithril.Children {\n return (\n \n

{highlight(this.poll.question(), this.highlightRegExp)}

\n {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n
    {listItems(this.infoItems().toArray())}
\n \n );\n }\n\n // infoView() {\n // return (\n //
\n // {this.poll.subtitle() &&

{this.poll.subtitle()}

}\n //
    {listItems(this.infoItems().toArray())}
\n //
\n // );\n // }\n\n oncreate(vnode: Mithril.VnodeDOM) {\n super.oncreate(vnode);\n\n // If we're on a touch device, set up the discussion row to be slidable.\n // This allows the user to drag the row to either side of the screen to\n // reveal controls.\n if ('ontouchstart' in window) {\n const slidableInstance = slidable(this.element);\n\n this.$('.PollListItem-controls').on('hidden.bs.dropdown', () => slidableInstance.reset());\n }\n }\n\n onbeforeupdate(vnode: Mithril.VnodeDOM) {\n super.onbeforeupdate(vnode);\n\n return this.subtree.needsRebuild();\n }\n\n /**\n * Determine whether or not the discussion is currently being viewed.\n */\n active() {\n return app.current.matches(PollViewPage, { poll: this.poll });\n }\n\n /**\n * Mark the poll as read.\n */\n markAsRead() {\n if (this.poll.isUnread()) {\n this.poll.save({ lastVotedNumber: this.poll.voteCount() });\n m.redraw();\n }\n }\n\n infoItems(): ItemList {\n const items = new ItemList();\n const active = !this.poll.hasEnded();\n const activeView = this.poll.endDate()\n ? [\n icon('fas fa-clock'),\n ' ',\n active\n ? app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.poll.endDate()).fromNow() })\n : app.translator.trans('fof-polls.forum.poll_ended'),\n ]\n : [icon('fas fa-infinity'), ' ', app.translator.trans('fof-polls.forum.poll_never_ends')];\n\n items.add('active', {activeView});\n\n const voteCount = this.poll.voteCount();\n if (voteCount !== undefined) {\n items.add(\n 'voteCount',\n \n {icon('fas fa-poll fa-fw')}\n {[\n ' ',\n app.translator.trans('fof-polls.forum.polls_count', {\n count: abbreviateNumber(voteCount),\n }),\n ]}\n ,\n 70\n );\n }\n\n return items;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Placeholder'];","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListItem from './PollListItem';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport classList from 'flarum/common/utils/classList';\nimport PollListState from '../../states/PollListState';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\n/**\n * The `PollList` component displays a list of polls.\n */\nexport default class PollList extends Component {\n view() {\n const state = this.attrs.state;\n const params = state.getParams();\n const isLoading = state.isInitialLoading() || state.isLoadingNext();\n\n let loading;\n\n if (isLoading) {\n loading = ;\n } else if (state.hasNext()) {\n loading = (\n \n );\n }\n\n if (state.isEmpty()) {\n const text = app.translator.trans('fof-polls.forum.polls_list.empty_text');\n return (\n
\n \n
\n );\n }\n\n return (\n
\n
    \n {state.getPages().map((pg) => {\n return pg.items.map((poll) => (\n
  • \n \n
  • \n ));\n })}\n
\n
{loading}
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/states/PaginatedListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/EventEmitter'];","import app from 'flarum/forum/app';\nimport PaginatedListState, { Page, PaginatedListParams, PaginatedListRequestParams } from 'flarum/common/states/PaginatedListState';\nimport Poll from '../models/Poll';\nimport { ApiResponsePlural } from 'flarum/common/Store';\nimport EventEmitter from 'flarum/common/utils/EventEmitter';\n\nexport interface PollListParams extends PaginatedListParams {\n sort?: string;\n}\n\nconst globalEventEmitter = new EventEmitter();\n\nexport default class PollListState

extends PaginatedListState {\n protected extraPolls: Poll[] = [];\n protected eventEmitter: EventEmitter;\n\n constructor(params: P, page: number = 1) {\n super(params, page, 20);\n\n this.eventEmitter = globalEventEmitter.on('poll.deleted', this.deletePoll.bind(this));\n }\n\n get type(): string {\n return 'fof/polls';\n }\n\n requestParams(): PaginatedListRequestParams {\n const params = {\n include: this.params.include || ['options', 'votes'],\n filter: this.params.filter || {},\n sort: this.sortMap()[this.params.sort ?? ''],\n };\n\n if (this.params.q) {\n params.filter.q = this.params.q;\n }\n\n return params;\n }\n\n protected loadPage(page: number = 1): Promise> {\n const preloadedPolls = app.preloadedApiDocument();\n\n if (preloadedPolls) {\n this.initialLoading = false;\n\n return Promise.resolve(preloadedPolls);\n }\n\n return super.loadPage(page);\n }\n\n clear(): void {\n super.clear();\n\n this.extraPolls = [];\n }\n\n /**\n * Get a map of sort keys (which appear in the URL, and are used for\n * translation) to the API sort value that they represent.\n */\n sortMap() {\n const map: any = {};\n\n if (this.params.q) {\n map.relevance = '';\n }\n map.newest = '-createdAt';\n map.oldest = 'createdAt';\n\n return map;\n }\n\n /**\n * In the last request, has the user searched for a poll?\n */\n isSearchResults(): boolean {\n return !!this.params.q;\n }\n\n removePoll(poll: Poll): void {\n this.eventEmitter.emit('poll.deleted', poll);\n }\n\n deletePoll(poll: Poll): void {\n for (const page of this.pages) {\n const index = page.items.indexOf(poll);\n\n if (index !== -1) {\n page.items.splice(index, 1);\n break;\n }\n }\n\n const index = this.extraPolls.indexOf(poll);\n\n if (index !== -1) {\n this.extraPolls.splice(index);\n }\n\n m.redraw();\n }\n\n /**\n * Add a poll to the top of the list.\n */\n addPoll(poll: Poll): void {\n this.removePoll(poll);\n this.extraPolls.unshift(poll);\n\n m.redraw();\n }\n\n protected getAllItems(): Poll[] {\n return this.extraPolls.concat(super.getAllItems());\n }\n\n public getPages(): Page[] {\n const pages = super.getPages();\n\n if (this.extraPolls.length) {\n return [\n {\n number: -1,\n items: this.extraPolls,\n },\n ...pages,\n ];\n }\n\n return pages;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport listItems from 'flarum/common/helpers/listItems';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PollList from './Poll/PollList';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollListState from '../states/PollListState';\nimport Button from 'flarum/common/components/Button';\nimport SelectDropdown from 'flarum/common/components/SelectDropdown';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport PollView from './PollView';\nimport { AbstractPollPage } from './AbstractPollPage';\n\nexport default class PollsPage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n view(): Mithril.Children {\n if (this.loading) {\n return ;\n }\n\n if (this.poll) {\n return (\n

\n
\n \n
\n
\n );\n }\n\n return (\n
\n {super.hero()}\n
\n
\n \n
\n
\n
    {listItems(this.viewItems().toArray())}
\n
    {listItems(this.actionItems().toArray())}
\n
\n \n
\n
\n
\n
\n );\n }\n\n sidebarItems(): ItemList {\n const items = new ItemList();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n \n );\n\n items.add(\n 'nav',\n \n {this.navItems().toArray()}\n \n );\n\n return items;\n }\n\n actionItems(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'refresh',\n Button.component({\n title: app.translator.trans('fof-polls.forum.page.refresh_tooltip'),\n icon: 'fas fa-sync',\n className: 'Button Button--icon',\n onclick: () => {\n this.state.refresh();\n },\n })\n );\n\n return items;\n }\n\n viewItems() {\n return IndexPage.prototype.viewItems();\n }\n\n navItems() {\n return IndexPage.prototype.navItems();\n }\n\n /**\n * Change to create new poll page\n */\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Separator'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Poll from '../models/Poll';\nimport Component from 'flarum/common/Component';\nimport ComposePollPage from '../components/ComposePollPage';\nimport PollsPage from '../components/PollsPage';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Separator from 'flarum/common/components/Separator';\nimport Button from 'flarum/common/components/Button';\n\n/**\n * The `UserControls` utility constructs a list of buttons for a user which\n * perform actions on it.\n */\nexport default {\n /**\n * Get a list of controls for a user.\n */\n controls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n ['poll', 'moderation', 'destructive'].forEach((section) => {\n const controls = (this[section + 'Controls'](poll, context) as ItemList).toArray();\n if (controls.length) {\n controls.forEach((item) => items.add(item.itemName, item));\n items.add(section + 'Separator', );\n }\n });\n\n return items;\n },\n\n /**\n * Get controls for direct modifcation actions on polls (e.g. vote, view voters).\n */\n pollControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n return items;\n },\n\n /**\n * Get controls for a user pertaining to moderation (e.g. suspend, edit).\n */\n moderationControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canEdit()) {\n items.add(\n 'edit',\n \n );\n }\n\n return items;\n },\n\n /**\n * Get controls for a user which are destructive (e.g. delete).\n * @protected\n */\n destructiveControls(poll: Poll, context: Component): ItemList {\n const items = new ItemList();\n\n if (poll.canDelete()) {\n items.add(\n 'delete',\n \n );\n }\n\n return items;\n },\n\n /**\n * Delete the poll.\n */\n async deleteAction(poll: Poll): Promise {\n if (!confirm(app.translator.trans(`fof-polls.forum.poll_controls.delete_confirmation`) as string)) {\n return;\n }\n\n return poll\n .delete()\n .then(() => {\n this.showDeletionAlert(poll, 'success');\n if (app.current.matches(ComposePollPage, { id: poll.id() }) || app.current.matches(PollsPage, { id: poll.id() })) {\n app.history.back();\n } else {\n window.location.reload();\n }\n })\n .catch(() => this.showDeletionAlert(poll, 'error'));\n },\n\n /**\n * Show deletion alert of poll\n */\n showDeletionAlert(poll: Poll, type: string): void {\n const message = {\n success: `fof-polls.forum.poll_controls.delete_success_message`,\n error: `fof-polls.forum.poll_controls.delete_error_message`,\n }[type]!;\n\n app.alerts.show({ type }, app.translator.trans(message, { poll: poll }));\n },\n\n /**\n * Edit the poll.\n */\n editAction(poll: Poll): void {\n m.route.set(app.route('fof.polls.compose', { id: poll.id() }));\n },\n};\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import app from 'flarum/forum/app';\nimport Button, { IButtonAttrs } from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nimport Mithril from 'mithril';\nimport Poll from '../models/Poll';\nimport PollOption from '../models/PollOption';\n\nexport interface UploadPollImageButtonAttrs extends IButtonAttrs {\n className?: string;\n loading?: boolean;\n name: string;\n onclick: () => void;\n poll?: Poll | null;\n option?: PollOption | null;\n onUpload: (fileName: string | null | undefined) => void;\n}\n\nexport interface PollUploadObject {\n fileUrl: string;\n fileName: string;\n}\n\nexport default class UploadPollImageButton extends Button {\n loading: boolean = false;\n uploadedImageUrl: string | undefined | false = false;\n fileName: string | undefined = undefined;\n $input: JQuery | undefined;\n\n view(vnode: Mithril.Vnode) {\n this.attrs.loading = this.loading;\n this.attrs.className = classList(this.attrs.className, 'Button', 'Button--inverted');\n\n const imageUrl = this.getImageUrl();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n if (imageUrl) {\n this.attrs.onclick = this.remove.bind(this);\n\n return (\n
\n

\n \"\"\n

\n

\n {super.view({\n ...vnode,\n children: app.translator.trans('fof-polls.forum.upload_image.remove_button'),\n })}\n

\n
\n );\n } else {\n this.attrs.onclick = this.upload.bind(this);\n }\n\n return canUpload && super.view({ ...vnode, poll: undefined, children: app.translator.trans('fof-polls.forum.upload_image.upload_button') });\n }\n\n /**\n * Prompt the user to upload an image.\n */\n upload() {\n if (this.loading) return;\n\n this.$input = $('');\n\n this.$input\n .appendTo('body')\n .hide()\n .trigger('click')\n .on('change', (e) => {\n const body = new FormData();\n body.append(this.attrs.name, $(e.target)[0].files[0]);\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'POST',\n url: this.resourceUrl(),\n serialize: (raw) => raw,\n body,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n });\n }\n\n /**\n * Remove the image.\n */\n remove() {\n this.loading = true;\n m.redraw();\n\n let fileName = undefined;\n\n if (!this.attrs.poll?.exists && !this.attrs.option?.exists) {\n fileName = this.fileName;\n }\n\n app\n .request({\n method: 'DELETE',\n url: this.resourceUrl(fileName),\n })\n .then((upload) => {\n if (this.attrs.poll?.exists) {\n this.attrs.poll.pushAttributes({ image: null, imageUrl: null, isImageUpload: false });\n }\n\n if (this.attrs.option?.exists) {\n this.attrs.option.pushAttributes({ imageUrl: false });\n }\n\n return upload;\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }\n\n resourceUrl(fileName: string | undefined = undefined) {\n let url = app.forum.attribute('apiUrl') + '/fof/polls/' + this.attrs.name;\n const poll = this.attrs.poll;\n const option = this.attrs.option;\n\n if (fileName) {\n url += '/name/' + fileName;\n } else {\n if (poll?.exists) url += '/' + poll?.id();\n if (option?.exists) url += '/' + option?.id();\n }\n\n return url;\n }\n\n getImageUrl() {\n if (this.uploadedImageUrl !== false) {\n return this.uploadedImageUrl;\n }\n\n return this.attrs.poll?.imageUrl() || this.attrs.option?.imageUrl();\n }\n\n /**\n * After a successful upload/removal, redraw the page.\n *\n * @param {PollUploadObject} response\n * @protected\n */\n success(response: PollUploadObject | null) {\n this.loading = false;\n this.uploadedImageUrl = response?.fileUrl;\n this.fileName = response?.fileName;\n\n this.attrs.onUpload?.(response?.fileName);\n m.redraw();\n this.$input?.remove();\n }\n\n /**\n * If upload/removal fails, stop loading.\n *\n * @param {object} response\n * @protected\n */\n failure(response: object) {\n this.loading = false;\n m.redraw();\n this.$input?.remove();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/RequestError'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport Switch from 'flarum/common/components/Switch';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport extractText from 'flarum/common/utils/extractText';\nimport FormError from './form/FormError';\nimport PollFormState from '../states/PollFormState';\nimport PollControls from '../utils/PollControls';\nimport PollModel from '../models/Poll';\nimport PollOption from '../models/PollOption';\nimport UploadPollImageButton from './UploadPollImageButton';\nimport Poll from '../models/Poll';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport RequestError from 'flarum/common/utils/RequestError';\n\ninterface PollFormAttrs extends ComponentAttrs {\n poll: PollModel;\n onsubmit: (data: object, state: PollFormState) => Promise;\n}\n\nexport default class PollForm extends Component {\n protected options: PollOption[] = [];\n protected optionAnswers: Stream[] = [];\n protected optionImageUrls: Stream[] = [];\n protected question: Stream;\n protected subtitle: Stream;\n protected image: Stream;\n protected imageAlt: Stream;\n protected endDate: Stream;\n protected publicPoll: Stream;\n protected allowMultipleVotes: Stream;\n protected hideVotes: Stream;\n protected allowChangeVote: Stream;\n protected maxVotes: Stream;\n protected datepickerMinDate: string = '';\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n this.state = new PollFormState(this.attrs.poll);\n\n // state handles poll initialization\n const poll = this.state.poll;\n\n this.options = (poll.tempOptions ?? poll.options()) as PollOption[];\n this.optionAnswers = this.options.map((o) => Stream(o.answer()));\n this.optionImageUrls = this.options.map((o) => Stream(o.imageUrl()));\n\n this.question = Stream(poll.question());\n this.subtitle = Stream(poll.subtitle());\n this.image = Stream(poll.image());\n this.imageAlt = Stream(poll.imageAlt());\n this.endDate = Stream(this.formatDate(poll.endDate()));\n this.publicPoll = Stream(poll.publicPoll());\n this.allowMultipleVotes = Stream(poll.allowMultipleVotes());\n this.hideVotes = Stream(poll.hideVotes());\n this.allowChangeVote = Stream(poll.allowChangeVote());\n this.maxVotes = Stream(poll.maxVotes() || 0);\n\n // Set minimum date for datepicker to current date\n this.datepickerMinDate = this.formatDate() as string;\n\n // Replace minimum of 'today' for poll end date only if the poll is not already closed\n if (this.endDate() && dayjs(poll.endDate).isAfter(dayjs())) {\n // We know that endDate is set, so we can safely cast the result to string\n this.datepickerMinDate = this.formatDate(poll.endDate()) as string;\n }\n }\n\n view(): Mithril.Children {\n return (\n
\n
{this.fields().toArray()}
\n
\n );\n }\n\n fields(): ItemList {\n const items = new ItemList();\n\n items.add(\n 'question',\n
\n \n\n \n
,\n 100\n );\n\n items.add(\n 'subtitle',\n
\n \n\n \n
,\n 95\n );\n\n const hasImage = this.image();\n\n items.add(\n 'poll_image',\n
\n \n {this.uploadConditional(\n hasImage,\n this.state.poll?.isImageUpload(),\n <>\n

{app.translator.trans('fof-polls.forum.modal.poll_image.help')}

\n \n ,\n ,\n \n )}\n
,\n 90\n );\n\n if (hasImage) {\n items.add(\n 'poll_image_alt',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.poll_image.alt_help_text')}

\n
,\n 90\n );\n }\n\n items.add(\n 'answers',\n
\n \n\n {this.displayOptions().toArray()}\n\n \n
,\n 80\n );\n\n items.add(\n 'date',\n
\n \n\n
\n \n {Button.component({\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-times',\n onclick: this.endDate.bind(this, null),\n })}\n
\n\n {this.endDate() && (\n

\n \n  \n {dayjs(this.endDate()).isBefore(dayjs())\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(this.endDate()).fromNow() })}\n

\n )}\n
,\n 40\n );\n\n items.add(\n 'public',\n
\n {Switch.component(\n {\n state: this.publicPoll() || false,\n onchange: this.publicPoll,\n },\n app.translator.trans('fof-polls.forum.modal.public_poll_label')\n )}\n
,\n 20\n );\n\n items.add(\n 'hide-votes',\n
\n \n {app.translator.trans('fof-polls.forum.modal.hide_votes_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-change-vote',\n
\n \n {app.translator.trans('fof-polls.forum.modal.allow_change_vote_label')}\n \n
,\n 20\n );\n\n items.add(\n 'allow-multiple-votes',\n
\n {Switch.component(\n {\n state: this.allowMultipleVotes() || false,\n onchange: this.allowMultipleVotes,\n },\n app.translator.trans('fof-polls.forum.modal.allow_multiple_votes_label')\n )}\n
,\n 15\n );\n\n if (this.allowMultipleVotes()) {\n items.add(\n 'max-votes',\n
\n \n\n \n\n

{app.translator.trans('fof-polls.forum.modal.max_votes_help')}

\n
,\n 15\n );\n }\n\n items.add(\n 'submit',\n
\n \n {this.state.poll.exists && (\n \n {app.translator.trans('fof-polls.forum.modal.delete')}\n \n )}\n
,\n -10\n );\n\n return items;\n }\n\n displayOptions(): ItemList {\n const items = new ItemList();\n const canUpload = app.forum.attribute('canUploadPollImages');\n\n this.options.forEach((option, i) => {\n const imgFunc = this.optionImageUrls[i];\n\n items.add(\n 'option-' + i,\n
\n
\n \n {app.forum.attribute('allowPollOptionImage') && (\n
\n {this.uploadConditional(\n !!imgFunc(),\n option?.isImageUpload(),\n <>\n \n

{app.translator.trans('fof-polls.forum.modal.poll_option_image.help')}

\n \n ,\n\n ,\n\n \n )}\n
\n )}\n
\n {i >= 2\n ? Button.component({\n type: 'button',\n className: 'Button PollModal--button Button--icon',\n icon: 'fas fa-minus',\n onclick: i >= 2 ? this.removeOption.bind(this, i) : '',\n })\n : ''}\n
\n );\n });\n\n return items;\n }\n\n addOption() {\n const max = Math.max(app.forum.attribute('pollMaxOptions'), 2);\n\n if (this.options.length < max) {\n this.options.push(app.store.createRecord('poll_options'));\n this.optionAnswers.push(Stream(''));\n this.optionImageUrls.push(Stream(''));\n } else {\n alert(extractText(app.translator.trans('fof-polls.forum.modal.max', { max })));\n }\n }\n\n removeOption(i: number): void {\n this.options.splice(i, 1);\n this.optionAnswers.splice(i, 1);\n this.optionImageUrls.splice(i, 1);\n }\n\n data(): object {\n if (this.question() === '') {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.include_question'));\n }\n\n if (this.options.length < 2) {\n throw new FormError(app.translator.trans('fof-polls.forum.modal.min'));\n }\n\n console.log(\n 'option answers',\n this.optionAnswers.map((o) => o())\n );\n console.log(\n 'option image urls',\n this.optionImageUrls.map((o) => o())\n );\n\n const pollExists = this.state.poll.exists;\n const options = this.options.map((option, i) => {\n option.pushAttributes({\n answer: this.optionAnswers[i](),\n imageUrl: this.optionImageUrls[i](),\n });\n\n return pollExists ? option.data : option.data.attributes;\n });\n\n return {\n question: this.question(),\n subtitle: this.subtitle(),\n pollImage: this.image(),\n imageAlt: this.imageAlt(),\n endDate: this.dateToTimestamp(this.endDate()) ?? false,\n publicPoll: this.publicPoll(),\n hideVotes: this.hideVotes(),\n allowChangeVote: this.allowChangeVote(),\n allowMultipleVotes: this.allowMultipleVotes(),\n maxVotes: this.maxVotes(),\n options,\n };\n }\n\n async onsubmit(event: Event) {\n event.preventDefault();\n\n try {\n await this.attrs.onsubmit(this.data(), this.state);\n } catch (error) {\n if (error instanceof FormError) {\n app.alerts.show({ type: 'error' }, error.message);\n } else if (error instanceof RequestError) {\n console.error(error);\n app.alerts.show({ type: 'error' }, app.translator.trans('fof-polls.forum.modal.error'));\n }\n }\n }\n\n async delete(): Promise {\n this.state.loading = true;\n try {\n await PollControls.deleteAction(this.state.poll);\n this.state.deleting = true;\n } finally {\n this.state.loading = false;\n m.redraw();\n }\n }\n\n formatDate(date: Date | string | false | undefined | null = undefined, def: Date | false = false): string | false {\n const dayjsDate = dayjs(date);\n\n if (date === false || !dayjsDate.isValid()) return def !== false ? this.formatDate(def) : false;\n\n return dayjsDate.format('YYYY-MM-DDTHH:mm');\n }\n\n dateToTimestamp(date: Date | false): string | null {\n const dayjsDate = dayjs(date);\n\n if (!date || !dayjsDate.isValid()) return null;\n\n return dayjsDate.format();\n }\n\n pollImageUploadSuccess(fileName: string | null | undefined): void {\n this.image(fileName);\n }\n\n pollOptionImageUploadSuccess(index: number, fileName: string | null | undefined): void {\n this.optionImageUrls[index] = Stream(fileName);\n }\n\n uploadConditional(hasImage: boolean, isUpload: boolean, ifCanUpload: JSX.Element, uploadButton: JSX.Element, imageUrlInput: JSX.Element) {\n const canUpload = app.forum.attribute('canUploadPollImages');\n const canUploadNow = this.state.poll?.exists || (app.forum.attribute('canStartPolls') && app.forum.attribute('canStartGlobalPolls'));\n\n // if can upload OR image is already uploaded\n if (canUpload || isUpload) {\n // may not have enough permissions to upload before creating poll\n if (!canUploadNow && !isUpload) {\n return (\n <>\n {imageUrlInput}\n

{app.translator.trans('fof-polls.forum.modal.poll_image.later_help')}

\n \n );\n }\n\n return (\n <>\n {ifCanUpload}\n
\n {!hasImage && imageUrlInput}\n {uploadButton}\n
\n \n );\n }\n\n return imageUrlInput;\n }\n}\n","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';\nimport PollForm from './PollForm';\nimport PollModel from '../models/Poll';\nimport PollFormState from '../states/PollFormState';\n\ninterface CreatePollModalAttrs extends IInternalModalAttrs {\n poll: PollModel;\n onsubmit: (data: object) => Promise;\n}\n\nexport default class CreatePollModal extends Modal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.add_title');\n }\n\n className(): string {\n return 'PollDiscussionModal Modal--medium';\n }\n\n content(): Mithril.Children {\n return [\n
\n \n
,\n ];\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n this.hide();\n await this.attrs.onsubmit(data);\n }\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport classList from 'flarum/common/utils/classList';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport ReplyComposer from 'flarum/forum/components/ReplyComposer';\nimport CreatePollModal from './components/CreatePollModal';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport { ModelAttributes } from 'flarum/common/Model';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nfunction toPoll(data: PollModelAttributes) {\n if (data) {\n const poll = app.store.createRecord('polls');\n\n poll.tempOptions = data.options.map((option: ModelAttributes) => {\n const pollOption = app.store.createRecord('poll_options');\n pollOption.pushAttributes(option);\n return pollOption;\n });\n poll.pushAttributes(data);\n\n return poll;\n }\n return data;\n}\n\nexport const addToComposer = (composer: ComponentClass) => {\n // @ts-ignore\n composer.prototype.addPoll = function () {\n app.modal.show(CreatePollModal, {\n poll: toPoll(this.composer.fields.poll),\n onsubmit: (poll: PollModelAttributes) => (this.composer.fields.poll = poll),\n });\n };\n\n // Add button to DiscussionComposer header\n extend(composer.prototype, 'headerItems', function (items) {\n const discussion = this.composer.body?.attrs?.discussion;\n\n // @ts-ignore\n const canStartPoll = discussion?.canStartPoll() ?? app.forum.canStartPolls();\n\n if (canStartPoll) {\n items.add(\n 'polls',\n \n \n {app.translator.trans(`fof-polls.forum.composer_discussion.${this.composer.fields.poll ? 'edit' : 'add'}_poll`)}\n \n ,\n 1\n );\n }\n });\n\n extend(composer.prototype, 'data', function (data) {\n if (this.composer.fields.poll) {\n data.poll = this.composer.fields.poll;\n }\n });\n};\n\nexport default () => {\n addToComposer(DiscussionComposer);\n addToComposer(ReplyComposer);\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/CommentPost'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","import type Mithril from 'mithril';\nimport app from 'flarum/forum/app';\nimport CreatePollModal from './CreatePollModal';\nimport PollFormState from '../states/PollFormState';\n\nexport default class EditPollModal extends CreatePollModal {\n title(): Mithril.Children {\n return app.translator.trans('fof-polls.forum.modal.edit_title');\n }\n\n async onFormSubmit(data: object, state: PollFormState): Promise {\n await state.save(data);\n\n // Show success alert\n const alertId = app.alerts.show(\n {\n type: 'success',\n },\n app.translator.trans('fof-polls.forum.compose.success')\n );\n\n // Hide alert after 10 seconds\n setTimeout(() => app.alerts.dismiss(alertId), 10000);\n }\n}\n","import app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ListVotersModal from './ListVotersModal';\nimport classList from 'flarum/common/utils/classList';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport icon from 'flarum/common/helpers/icon';\nimport EditPollModal from './EditPollModal';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollOption from '../models/PollOption';\nimport Post from 'flarum/common/models/Post';\nimport extractText from 'flarum/common/utils/extractText';\nimport PollImage from './Poll/PollImage';\n\nexport interface PostPollAttrs extends ComponentAttrs {\n poll: Poll;\n post?: Post;\n}\n\nexport default class PostPoll extends Component {\n loadingOptions: boolean = false;\n useSubmitUI!: boolean;\n pendingSubmit: boolean = false;\n pendingOptions: any;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.useSubmitUI = !this.attrs.poll?.canChangeVote() && this.attrs.poll?.allowMultipleVotes();\n this.pendingOptions = null;\n }\n\n oncreate(vnode: Mithril.Vnode) {\n super.oncreate(vnode);\n\n this.preventClose = this.preventClose.bind(this);\n window.addEventListener('beforeunload', this.preventClose);\n }\n\n onremove(vnode: Mithril.Vnode) {\n super.onremove(vnode);\n\n window.removeEventListener('beforeunload', this.preventClose);\n }\n\n view() {\n const poll = this.attrs.poll;\n const options = poll.options() || [];\n let maxVotes = poll.allowMultipleVotes() ? poll.maxVotes() : 1;\n\n if (maxVotes === 0) maxVotes = options.length;\n\n const infoItems = this.infoItems(maxVotes);\n\n return (\n
\n
\n
\n

{poll.question()}

\n {poll.subtitle() &&

{poll.subtitle()}

}\n
\n\n
\n {poll.canSeeVoters() && (\n \n
\n
\n\n {!!poll.imageUrl() && }\n\n
\n
{options.map(this.viewOption.bind(this))}
\n\n
\n {!infoItems.isEmpty() &&
{infoItems.toArray()}
}\n\n {this.useSubmitUI && this.pendingSubmit && (\n \n )}\n
\n
\n
\n );\n }\n\n infoItems(maxVotes: number) {\n const items = new ItemList();\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n\n if (app.session.user && !poll.canVote() && !poll.hasEnded()) {\n items.add(\n 'no-permission',\n \n \n {app.translator.trans('fof-polls.forum.no_permission')}\n \n );\n }\n\n if (poll.endDate()) {\n items.add(\n 'end-date',\n \n \n {poll.hasEnded()\n ? app.translator.trans('fof-polls.forum.poll_ended')\n : app.translator.trans('fof-polls.forum.days_remaining', { time: dayjs(poll.endDate()).fromNow() })}\n \n );\n }\n\n if (poll.canVote()) {\n items.add(\n 'max-votes',\n \n \n {app.translator.trans('fof-polls.forum.max_votes_allowed', { max: maxVotes })}\n \n );\n\n if (!poll.canChangeVote()) {\n items.add(\n 'cannot-change-vote',\n \n \n {app.translator.trans('fof-polls.forum.poll.cannot_change_vote')}\n \n );\n }\n }\n\n return items;\n }\n\n viewOption(opt: PollOption) {\n const poll = this.attrs.poll;\n const hasVoted = poll.myVotes()?.length > 0;\n const totalVotes = poll.voteCount();\n\n const voted = this.pendingOptions ? this.pendingOptions.has(opt.id()) : poll.myVotes()?.some?.((vote) => vote.option() === opt);\n const votes = opt.voteCount();\n const percent = totalVotes > 0 ? Math.round((votes / totalVotes) * 100) : 0;\n\n // isNaN(null) is false, so we have to check type directly now that API always returns the field\n const canSeeVoteCount = typeof votes === 'number';\n const isDisabled = this.loadingOptions || (hasVoted && !poll.canChangeVote());\n const width = canSeeVoteCount ? percent : (Number(voted) / (poll.myVotes()?.length || 1)) * 100;\n\n const showCheckmark = !app.session.user || (!poll.hasEnded() && poll.canVote() && (!hasVoted || poll.canChangeVote()));\n\n const bar = (\n
\n {showCheckmark && (\n \n )}\n\n
\n {opt.answer()}\n {voted && !showCheckmark && icon('fas fa-check-circle', { className: 'PollAnswer-check' })}\n {canSeeVoteCount && {percent}%}\n
\n\n {opt.imageUrl() ? {opt.answer()} : null}\n
\n );\n\n return (\n \n {canSeeVoteCount ? (\n \n {bar}\n \n ) : (\n bar\n )}\n
\n );\n }\n\n changeVote(option: PollOption, evt: Event) {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n evt.target.checked = false;\n return;\n }\n\n const optionIds = this.pendingOptions || new Set(this.attrs.poll.myVotes().map?.((v) => v.option().id()));\n const isUnvoting = optionIds.delete(option.id());\n const allowsMultiple = this.attrs.poll.allowMultipleVotes();\n\n if (!allowsMultiple) {\n optionIds.clear();\n }\n\n if (!isUnvoting) {\n optionIds.add(option.id());\n }\n\n if (this.useSubmitUI) {\n this.pendingOptions = optionIds.size ? optionIds : null;\n this.pendingSubmit = !!this.pendingOptions;\n return;\n }\n\n return this.submit(optionIds, null, () => (evt.target.checked = isUnvoting));\n }\n\n onsubmit() {\n return this.submit(this.pendingOptions, () => {\n this.pendingOptions = null;\n this.pendingSubmit = false;\n });\n }\n\n submit(optionIds, cb, onerror) {\n this.loadingOptions = true;\n m.redraw();\n\n return app\n .request({\n method: 'PATCH',\n url: `${app.forum.attribute('apiUrl')}/fof/polls/${this.attrs.poll.id()}/votes`,\n body: {\n data: {\n optionIds: Array.from(optionIds),\n },\n },\n })\n .then((res) => {\n app.store.pushPayload(res);\n cb?.();\n })\n .catch((err) => {\n onerror?.(err);\n })\n .finally(() => {\n this.loadingOptions = false;\n\n m.redraw();\n });\n }\n\n showVoters() {\n // Load all the votes only when opening the votes list\n app.modal.show(ListVotersModal, {\n poll: this.attrs.poll,\n post: this.attrs.post,\n });\n }\n\n deletePoll() {\n if (confirm(extractText(app.translator.trans('fof-polls.forum.moderation.delete_confirm')))) {\n this.attrs.poll.delete().then(() => {\n m.redraw.sync();\n });\n }\n }\n\n /**\n * Attempting to use the `tooltipVisible` attr on the Tooltip component set to 'false' when no vote count\n * caused the tooltip to break on click. This is a workaround to hide the tooltip when no vote count is available,\n * called on 'onremove' of the Tooltip component. It doesn't always work as intended either, but it does the job.\n */\n hideOptionTooltip(vnode: Mithril.Vnode) {\n vnode.attrs.tooltipVisible = false;\n vnode.state.updateVisibility();\n }\n\n /**\n * Alert before navigating away using browser's 'beforeunload' event\n */\n preventClose(e) {\n if (this.pendingOptions) {\n e.preventDefault();\n return true;\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PollView from './components/PollView';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PostPoll from './components/PostPoll';\n\ninterface PusherPollDto {\n pollId: string;\n pollVoteCount: number;\n options: { [key: string]: number };\n}\n\nexport default () => {\n extend(CommentPost.prototype, 'content', function (content) {\n const post = this.attrs.post;\n\n if ((!post.isHidden() || this.revealContent) && post.polls()) {\n for (const poll of post.polls()) {\n if (poll) {\n content.push();\n }\n }\n }\n });\n\n extend(CommentPost.prototype, 'oninit', function () {\n this.subtree.check(() => {\n const polls = this.attrs.post.polls();\n\n const checks = polls?.map?.(\n (poll) =>\n poll && [\n poll.data?.attributes,\n poll.options().map?.((option) => option?.data?.attributes),\n poll.myVotes().map?.((vote) => vote.option()?.id()),\n ]\n );\n\n return JSON.stringify(checks);\n });\n });\n\n extend(DiscussionPage.prototype, 'oncreate', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n // We will listen for updates to all polls and options\n // Even if that model is not in the current discussion, it doesn't really matter\n binding.channels.main.bind('updatedPollOptions', (data: PusherPollDto) => {\n const poll = app.store.getById('polls', data['pollId']);\n\n if (poll) {\n poll.pushAttributes({\n voteCount: data['pollVoteCount'],\n });\n\n // Not redrawing here, as the option below should trigger the redraw already\n }\n\n const changedOptions = data['options'];\n\n for (const optionId in changedOptions) {\n const option = app.store.getById('poll_options', optionId);\n\n if (option && option.voteCount() !== undefined) {\n option.pushAttributes({\n voteCount: changedOptions[optionId],\n });\n }\n }\n\n m.redraw();\n });\n });\n }\n });\n\n extend(DiscussionPage.prototype, 'onremove', function () {\n // @ts-ignore\n if (app.pusher) {\n // @ts-ignore\n app.pusher.then((binding) => {\n binding.channels.main.unbind('updatedPollOptions');\n });\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport Poll from '../models/Poll';\nimport type Mithril from 'mithril';\nimport PollView from './PollView';\n\nexport interface PollShowcaseItemAttrs extends ComponentAttrs {\n poll: Poll;\n}\n\nexport default class PollShowcaseItem extends Component {\n poll!: Poll;\n\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.poll = this.attrs.poll;\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","import Component, { ComponentAttrs } from 'flarum/common/Component';\nimport PollListState from '../states/PollListState';\nimport type Mithril from 'mithril';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport Placeholder from 'flarum/common/components/Placeholder';\nimport app from 'flarum/forum/app';\n\nexport interface PollListAttrs extends ComponentAttrs {\n state: PollListState;\n}\n\nexport default class PollShowcase extends Component {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.attrs.state.refresh();\n }\n\n view(): Mithril.Children {\n return (\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.active-polls')}

\n {this.showcaseItems().toArray()}\n {this.showcaseItems().toArray().length === 0 && }\n
\n
\n

{app.translator.trans('fof-polls.forum.showcase.ended-polls')}

\n {this.endedItems().toArray()}\n {this.endedItems().toArray().length === 0 && }\n
\n
\n );\n }\n\n showcaseItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (!poll.hasEnded()) {\n items.add('poll-active-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n\n endedItems(): ItemList {\n const items = new ItemList();\n\n this.attrs.state.getPages().map((page) => {\n page.items.map((poll) => {\n if (poll.hasEnded()) {\n items.add('poll-ended-' + poll.id(), );\n }\n });\n });\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport { IPageAttrs } from 'flarum/common/components/Page';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Mithril from 'mithril';\nimport PollListState from '../states/PollListState';\nimport extractText from 'flarum/common/utils/extractText';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollShowcase from './PollShowcase';\n\nexport default class PollsShowcasePage extends AbstractPollPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n if (!app.forum.attribute('globalPollsEnabled')) {\n m.route.set('/');\n return;\n }\n\n this.state = new PollListState({\n sort: m.route.param('sort'),\n filter: m.route.param('filter'),\n include: this.includeParams(),\n });\n\n this.state.refresh();\n\n app.setTitle(extractText(app.translator.trans('fof-polls.forum.page.nav')));\n }\n\n includeParams(): string[] {\n return ['options', 'votes', 'myVotes', 'myVotes.option'];\n }\n\n contentItems(): ItemList {\n const items = super.contentItems();\n\n if (!this.loading) {\n items.add('poll-showcase', );\n }\n\n return items;\n }\n\n sidebarItems(): ItemList {\n const items = super.sidebarItems();\n const canStartPoll = app.forum.attribute('canStartGlobalPolls');\n\n if (canStartPoll) {\n items.remove('newDiscussion');\n items.add(\n 'newGlobalPoll',\n {\n this.newPollAction();\n }}\n disabled={!canStartPoll}\n >\n {app.translator.trans(`fof-polls.forum.poll.${canStartPoll ? 'start_poll_button' : 'cannot_start_poll_button'}`)}\n ,\n 100\n );\n }\n\n return items;\n }\n\n newPollAction(): void {\n if (!app.session.user) {\n app.modal.show(LogInModal);\n return;\n }\n\n m.route.set(app.route('fof.polls.compose'));\n }\n}\n","import CreatePollModal from './CreatePollModal';\nimport PostPoll from './PostPoll';\nimport EditPollModal from './EditPollModal';\nimport ListVotersModal from './ListVotersModal';\nimport PollForm from './PollForm';\nimport ComposePollHero from './ComposePollHero';\nimport ComposePollPage from './ComposePollPage';\nimport PollsPage from './PollsPage';\nimport PollView from './PollView';\nimport PollViewPage from './PollViewPage';\nimport PollSubmitButton from './Poll/PollSubmitButton';\nimport PollOption from './Poll/PollOption';\nimport PollOptions from './Poll/PollOptions';\nimport PollsShowcasePage from './PollsShowcasePage';\nimport PollShowcase from './PollShowcase';\nimport PollShowcaseItem from './PollShowcaseItem';\nimport { AbstractPollPage } from './AbstractPollPage';\nimport PollTitle from './Poll/PollTitle';\nimport PollSubtitle from './Poll/PollSubtitle';\nimport PollImage from './Poll/PollImage';\n\nexport const components = {\n CreatePollModal,\n PostPoll,\n EditPollModal,\n ListVotersModal,\n PollForm,\n ComposePollHero,\n ComposePollPage,\n PollsPage,\n PollView,\n PollViewPage,\n PollSubmitButton,\n PollOption,\n PollOptions,\n PollsShowcasePage,\n PollShowcase,\n PollShowcaseItem,\n AbstractPollPage,\n PollTitle,\n PollSubtitle,\n PollImage,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/computed'];","import Model from 'flarum/common/Model';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\nimport computed from 'flarum/common/utils/computed';\n\nexport default class Poll extends Model {\n public tempOptions: PollOption[] | undefined;\n\n question() {\n return Model.attribute('question').call(this);\n }\n\n subtitle() {\n return Model.attribute('subtitle').call(this);\n }\n\n image() {\n return Model.attribute('image').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n imageAlt() {\n return Model.attribute('imageAlt').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n hasEnded() {\n return Model.attribute('hasEnded').call(this);\n }\n\n endDate() {\n return Model.attribute('endDate', Model.transformDate).call(this);\n }\n\n publicPoll() {\n return Model.attribute('publicPoll').call(this);\n }\n\n hideVotes() {\n return Model.attribute('hideVotes').call(this);\n }\n\n allowChangeVote() {\n return Model.attribute('allowChangeVote').call(this);\n }\n\n allowMultipleVotes() {\n return Model.attribute('allowMultipleVotes').call(this);\n }\n\n maxVotes() {\n return Model.attribute('maxVotes').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n canVote() {\n return Model.attribute('canVote').call(this);\n }\n\n canEdit() {\n return Model.attribute('canEdit').call(this);\n }\n\n canDelete() {\n return Model.attribute('canDelete').call(this);\n }\n\n canSeeVoters() {\n return Model.attribute('canSeeVoters').call(this);\n }\n\n canChangeVote() {\n return Model.attribute('canChangeVote').call(this);\n }\n\n options() {\n const options = Model.hasMany('options').call(this);\n return options ? (options as PollOption[]) : [];\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n myVotes(): PollVote[] {\n const myVotes = Model.hasMany('myVotes').call(this);\n return myVotes ? (myVotes as PollVote[]) : [];\n }\n\n isGlobal() {\n return Model.attribute('isGlobal').call(this);\n }\n\n isHidden() {\n return computed('hiddenAt', (hiddenAt) => !!hiddenAt).call(this);\n }\n\n // TODO: These two don't make sense as of now\n isUnread() {\n return false;\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollVote from './PollVote';\n\nexport default class PollOption extends Model {\n answer() {\n return Model.attribute('answer').call(this);\n }\n\n imageUrl() {\n return Model.attribute('imageUrl').call(this);\n }\n\n isImageUpload() {\n return Model.attribute('isImageUpload').call(this);\n }\n\n voteCount() {\n return Model.attribute('voteCount').call(this);\n }\n\n poll() {\n return Model.hasOne('polls').call(this);\n }\n\n votes() {\n return Model.hasMany('votes').call(this);\n }\n\n apiEndpoint() {\n /** @ts-ignore */\n return `/fof/polls/answers${this.exists ? `/${this.data.id}` : ''}`;\n }\n}\n","import Model from 'flarum/common/Model';\nimport Poll from './Poll';\nimport PollOption from './PollOption';\nimport User from 'flarum/common/models/User';\n\nexport default class PollVote extends Model {\n poll() {\n return Model.hasOne('poll').call(this);\n }\n\n option() {\n const result = Model.hasOne('option').call(this);\n return result === false ? null : result;\n }\n\n user() {\n return Model.hasOne('user').call(this);\n }\n\n pollId() {\n return Model.attribute('pollId').call(this);\n }\n\n optionId() {\n return Model.attribute('optionId').call(this);\n }\n\n apiEndpoint() {\n return `/fof/polls/${this.pollId()}/vote`;\n }\n}\n","import Poll from './Poll';\nimport PollOption from './PollOption';\nimport PollVote from './PollVote';\n\nexport const models = {\n Poll,\n PollOption,\n PollVote,\n};\n","import PollFormState from './PollFormState';\nimport PollListState from './PollListState';\nimport PollState from './PollState';\n\nexport const states = {\n PollFormState,\n PollListState,\n PollState,\n};\n","import PollControls from './PollControls';\n\nexport const utils = {\n PollControls,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Forum'];","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport Forum from 'flarum/common/models/Forum';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Poll from './models/Poll';\nimport PollOption from './models/PollOption';\nimport PollVote from './models/PollVote';\nimport PollsPage from './components/PollsPage';\nimport ComposePollPage from './components/ComposePollPage';\nimport PollViewPage from './components/PollViewPage';\nimport PollsShowcasePage from './components/PollsShowcasePage';\n\nexport default [\n new Extend.Routes() //\n .add('fof.polls.showcase', '/polls', PollsShowcasePage)\n .add('fof.polls.list', '/polls/all', PollsPage)\n .add('fof.polls.view', '/polls/view/:id', PollViewPage)\n .add('fof.polls.compose', '/polls/composer', ComposePollPage),\n\n new Extend.Store() //\n .add('polls', Poll)\n .add('poll_options', PollOption)\n .add('poll_votes', PollVote),\n\n new Extend.Model(Post) //\n .hasMany('polls')\n .attribute('canStartPoll'),\n\n new Extend.Model(Forum) //\n .attribute('canStartPolls'),\n\n new Extend.Model(Discussion) //\n .attribute('hasPoll')\n .attribute('canStartPoll'),\n];\n","import app from 'flarum/forum/app';\n\nimport addDiscussionBadge from './addDiscussionBadge';\nimport addComposerItems from './addComposerItems';\nimport addPollsToPost from './addPollsToPost';\nimport addPostControls from './addPostControls';\nimport addNavItem from './addNavItem';\n\nexport * from './components';\nexport * from './models';\nexport * from './states';\nexport * from './utils';\n\napp.initializers.add('fof/polls', () => {\n addDiscussionBadge();\n addComposerItems();\n addPollsToPost();\n addPostControls();\n addNavItem();\n});\n\nexport { default as extend } from './extend';\n","import app from 'flarum/forum/app';\n\nimport { extend } from 'flarum/common/extend';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport CreatePollModal from './components/CreatePollModal';\nimport Button from 'flarum/common/components/Button';\nimport Post from 'flarum/common/models/Post';\nimport PollModelAttributes from './models/PollModelAttributes';\n\nexport default () => {\n const createPoll = (post: Post) =>\n app.modal.show(CreatePollModal, {\n onsubmit: (data: PollModelAttributes) =>\n app.store\n .createRecord('polls')\n .save(\n {\n ...data,\n relationships: {\n post,\n },\n },\n {\n data: {\n include: 'options,myVotes,myVotes.option',\n },\n }\n )\n .then((poll) => {\n // @ts-ignore\n post.rawRelationship('polls')?.push?.({ type: 'polls', id: poll.id() });\n\n return poll;\n }),\n });\n\n extend(PostControls, 'moderationControls', function (items, post) {\n // @ts-ignore\n if (!post.isHidden() && post.canStartPoll()) {\n items.add(\n 'addPoll',\n \n );\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function addNavItem() {\n extend(IndexPage.prototype, 'navItems', (items) => {\n if (!app.forum.attribute('globalPollsEnabled')) {\n return;\n }\n\n items.add(\n 'fof-polls-showcase',\n LinkButton.component(\n {\n href: app.route('fof.polls.showcase'),\n icon: 'fas fa-poll',\n },\n app.translator.trans('fof-polls.forum.page.nav')\n ),\n 35\n );\n\n const showAllGlobalPolls = app.forum.attribute('canStartGlobalPolls');\n\n if (showAllGlobalPolls) {\n items.add(\n 'fof-polls-list',\n LinkButton.component(\n {\n href: app.route('fof.polls.list'),\n icon: 'fas fa-list',\n },\n app.translator.trans('fof-polls.forum.page.nav-all')\n ),\n 32\n );\n }\n });\n}\n"],"names":["_typeof","require","_regeneratorRuntime","module","exports","e","__esModule","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","this","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","delegateYield","runtime","regeneratorRuntime","accidentalStrictMode","globalThis","Function","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","getter","definition","key","get","obj","prop","flarum","core","compat","asyncGeneratorStep","_asyncToGenerator","arguments","apply","_next","_throw","_setPrototypeOf","bind","_inheritsLoose","_getPrototypeOf","_isNativeReflectConstruct","Boolean","valueOf","Reflect","construct","_wrapNativeSuper","Map","toString","indexOf","isNativeFunction","has","set","Wrapper","isNativeReflectConstruct","FormError","_Error","props","PollFormState","poll","loading","deleting","expandedGroup","createNewPoll","app","createRecord","pushAttributes","question","endDate","publicPoll","allowMultipleVotes","hideVotes","allowChangeVote","maxVotes","tempOptions","_proto","isExpanded","groupKey","expand","m","redraw","save","_save","_callee","data","_context","attributes","options","_x","_delete2","_callee2","_context2","ComposePollHero","_Component","_this","_len","args","Array","_key","concat","oninit","vnode","attrs","view","className","trans","id","controlItems","toArray","items","ItemList","add","LinkButton","icon","itemClassName","href","exists","Component","ComposePollPage","_Page","_this2","attribute","bodyClass","editId","route","param","loadEditingPoll","_this2$poll","_this2$poll2","canEdit","_loadEditingPoll","alreadyLoaded","getById","find","LoadingIndicator","listItems","sidebarItems","PollForm","onsubmit","_onsubmit","state","isNew","alertAttrs","alertId","controls","Button","onclick","show","setTimeout","dismiss","_x2","_x3","SelectDropdown","buttonClassName","accessibleToggleLabel","navItems","IndexPage","Page","PollOption","option","hasVoted","totalVotes","votes","voted","canSeeVoteCount","answer","percent","Math","round","_this$poll$myVotes","overallVoteCount","voteCount","hasVotedFor","isDisabled","loadingOptions","canChangeVote","width","Number","myVotes","bar","style","showCheckMarks","checked","disabled","onchange","changeVote","optionDisplayItems","imageUrl","src","alt","classList","Tooltip","text","count","onremove","hideOptionTooltip","tooltipVisible","updateVisibility","PollOptions","pollOptions","createOptionView","PollImage","imageAlt","imageItems","_this$imageAlt","ListVotersModal","_Modal","include","title","content","map","optionContent","opt","filter","optionAnswer","voteContent","vote","user","Link","avatar","username","Modal","PollState","pendingSubmit","pendingOptions","useSubmitUI","showVoters","hasEnded","canVote","init","isShowResult","some","getMaxVotes","showButton","evt","target","LogInModal","optionIds","Set","isUnvoting","clear","size","submit","hasSelectedOptions","cb","onerror","_this3","url","body","from","res","pushPayload","err","PollSubmitButton","event","pollButtonSubmit","PollTitle","pollTitleItems","PollSubtitle","subtitle","pollSubtitleItems","PollView","preventClose","preventDefault","oncreate","window","addEventListener","removeEventListener","PollControls","controlsView","createMainView","createPollHeader","createPollContent","createPollFooter","createFormItems","infoItems","isEmpty","questionSlug","slug","Dropdown","menuClassName","class","time","dayjs","fromNow","max","toPropertyKey","toPrimitive","String","_defineProperties","_createClass","PollPageHero","wrapperClasses","classNames","Hero","AbstractPollPage","polls","pageContent","hero","mainContent","sidebar","contentItems","IndexPageHero","setContent","remove","toObject","startsWith","PollViewPage","_AbstractPollPage","item","PollListItem","subtree","highlightRegExp","SubtreeRetainer","freshness","markedAllAsReadAt","getTime","active","elementAttrs","isHidden","Slidable","contentView","slidableUnderneathView","isUnread","markAsRead","mainView","highlight","slidableInstance","slidable","element","$","on","onbeforeupdate","needsRebuild","matches","lastVotedNumber","activeView","abbreviateNumber","PollList","params","getParams","isLoading","isInitialLoading","isLoadingNext","hasNext","loadNext","Placeholder","isSearchResults","getPages","pg","globalEventEmitter","EventEmitter","PollListState","_PaginatedListState","page","extraPolls","eventEmitter","deletePoll","requestParams","_this$params$sort","sort","sortMap","q","loadPage","preloadedPolls","initialLoading","relevance","newest","oldest","removePoll","emit","_step","_iterator","_createForOfIteratorHelperLoose","pages","index","splice","addPoll","unshift","getAllItems","number","PaginatedListState","PollsPage","refresh","extractText","viewItems","actionItems","canStartPoll","newPollAction","context","section","itemName","Separator","pollControls","moderationControls","editAction","destructiveControls","canDelete","deleteAction","confirm","showDeletionAlert","back","location","reload","message","success","error","_extends","assign","UploadPollImageButton","_Button","uploadedImageUrl","fileName","$input","getImageUrl","canUpload","children","upload","appendTo","hide","trigger","FormData","append","files","resourceUrl","serialize","raw","failure","_this$attrs$poll","_this$attrs$option","_this3$attrs$poll","_this3$attrs$option","image","isImageUpload","_this$attrs$poll2","_this$attrs$option2","response","_this$attrs$onUpload","_this$attrs","_this$$input","fileUrl","onUpload","_this$$input2","optionAnswers","optionImageUrls","datepickerMinDate","_poll$tempOptions","Stream","formatDate","isAfter","fields","_this$state$poll","bidi","hasImage","uploadConditional","'['","pollImageUploadSuccess","placeholder","required","displayOptions","addOption","min","isBefore","Switch","imgFunc","pollOptionImageUploadSuccess","removeOption","alert","_this$dateToTimestamp","console","log","pollExists","pollImage","dateToTimestamp","t0","RequestError","date","def","dayjsDate","isValid","format","isUpload","ifCanUpload","uploadButton","imageUrlInput","_this$state$poll2","canUploadNow","CreatePollModal","onFormSubmit","_onFormSubmit","toPoll","pollOption","addToComposer","composer","extend","_this$composer$body","_discussion$canStartP","discussion","canStartPolls","EditPollModal","_CreatePollModal","PostPoll","canSeeVoters","viewOption","_poll$myVotes","_poll$myVotes2","_poll$myVotes3","_poll$myVotes4","showCheckmark","_this$attrs$poll$myVo","_this$attrs$poll$myVo2","post","sync","PollShowcaseItem","PollShowcase","showcaseItems","endedItems","PollsShowcasePage","includeParams","components","Poll","_Model","Model","isGlobal","computed","hiddenAt","apiEndpoint","PollVote","result","pollId","optionId","models","states","utils","Extend","Post","hasMany","Forum","Discussion","createPoll","DiscussionList","badges","hasPoll","Badge","label","DiscussionComposer","ReplyComposer","CommentPost","revealContent","check","checks","_poll$data","_poll$options$map","_poll$options","_poll$myVotes$map","_option$data","_vote$option","JSON","stringify","DiscussionPage","binding","channels","main","changedOptions","unbind","relationships","_post$rawRelationship","rawRelationship","PostControls"],"sourceRoot":""} \ No newline at end of file