diff --git a/extensions/subscriptions/js/dist/forum.js b/extensions/subscriptions/js/dist/forum.js index 537855e85..6a4bfbd28 100644 --- a/extensions/subscriptions/js/dist/forum.js +++ b/extensions/subscriptions/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var n={};function o(r){if(n[r])return n[r].exports;var e=n[r]={i:r,l:!1,exports:{}};return t[r].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=t,o.c=n,o.d=function(t,n,r){o.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,n){if(1&n&&(t=o(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var e in t)o.d(r,e,function(n){return t[n]}.bind(null,e));return r},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="",o(o.s=33)}([function(t,n){t.exports=flarum.core.compat.extend},function(t,n){t.exports=flarum.core.compat["helpers/icon"]},function(t,n,o){t.exports=!o(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var o=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=o)},function(t,n){t.exports=flarum.core.compat["components/Button"]},function(t,n){t.exports=flarum.core.compat["models/Discussion"]},function(t,n){t.exports=flarum.core.compat.app},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,o){var r=o(7);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var o=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=o)},function(t,n){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,n){t.exports=flarum.core.compat["components/Badge"]},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,o){var r=o(40)("keys"),e=o(38);t.exports=function(t){return r[t]||(r[t]=e(t))}},function(t,n){var o=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:o)(t)}},function(t,n,o){var r=o(46),e=o(44);t.exports=function(t){return r(e(t))}},function(t,n){var o={}.hasOwnProperty;t.exports=function(t,n){return o.call(t,n)}},function(t,n,o){var r=o(7),e=o(3).document,i=r(e)&&r(e.createElement);t.exports=function(t){return i?e.createElement(t):{}}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,o){var r=o(8),e=o(53),i=o(52),s=Object.defineProperty;n.f=o(2)?Object.defineProperty:function(t,n,o){if(r(t),n=i(n,!0),r(o),e)try{return s(t,n,o)}catch(t){}if("get"in o||"set"in o)throw TypeError("Accessors not supported!");return"value"in o&&(t[n]=o.value),t}},function(t,n){t.exports=flarum.core.compat["components/Notification"]},function(t,n){t.exports=flarum.core.compat["components/Switch"]},function(t,n){t.exports=flarum.core.compat["components/SettingsPage"]},function(t,n){t.exports=flarum.core.compat["components/DiscussionList"]},function(t,n){t.exports=flarum.core.compat["components/IndexPage"]},function(t,n){t.exports=flarum.core.compat["components/LinkButton"]},function(t,n){t.exports=flarum.core.compat.Component},function(t,n){t.exports=flarum.core.compat["utils/extractText"]},function(t,n){t.exports=flarum.core.compat["components/Dropdown"]},function(t,n,o){t.exports=o(59)},function(t,n){t.exports=flarum.core.compat["utils/DiscussionControls"]},function(t,n){t.exports=flarum.core.compat["components/NotificationGrid"]},function(t,n){t.exports=flarum.core.compat.Model},function(t,n,o){"use strict";o.r(n);var r=o(0),e=o(6),i=o.n(e),s=o(32),u=o.n(s),a=o(5),c=o.n(a),p=o(31),f=o.n(p),l=o(11),b=o.n(l);var d=o(4),v=o.n(d),y=o(10),h=o.n(y),x=o(30),_=o.n(x),g=o(29),w=o.n(g);function O(t,n){t.prototype=w()(n.prototype),t.prototype.constructor=t,t.__proto__=n}var j=o(28),S=o.n(j),P=o(1),M=o.n(P),k=o(27),N=o.n(k),I=o(26),B=function(t){function n(){return t.apply(this,arguments)||this}return O(n,t),n.prototype.view=function(){return m("button",{className:"SubscriptionMenuItem hasIcon",onclick:this.props.onclick},this.props.active?M()("fas fa-check",{className:"Button-icon"}):"",m("span",{className:"SubscriptionMenuItem-label"},M()(this.props.icon,{className:"Button-icon"}),m("strong",null,this.props.label),m("span",{className:"SubscriptionMenuItem-description"},this.props.description)))},n}(o.n(I).a),E=function(t){function n(){return t.apply(this,arguments)||this}O(n,t);var o=n.prototype;return o.init=function(){this.options=[{subscription:!1,icon:"far fa-star",label:app.translator.trans("flarum-subscriptions.forum.sub_controls.not_following_button"),description:app.translator.trans("flarum-subscriptions.forum.sub_controls.not_following_text")},{subscription:"follow",icon:"fas fa-star",label:app.translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),description:app.translator.trans("flarum-subscriptions.forum.sub_controls.following_text")},{subscription:"ignore",icon:"far fa-eye-slash",label:app.translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),description:app.translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_text")}]},o.view=function(){var t=this,n=this.props.discussion,o=n.subscription(),r=app.translator.trans("flarum-subscriptions.forum.sub_controls.follow_button"),e="far fa-star",i="SubscriptionMenu-button--"+o;switch(o){case"follow":r=app.translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),e="fas fa-star";break;case"ignore":r=app.translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),e="far fa-eye-slash"}var s=app.session.user.preferences(),u=s.notify_newPost_email,a=s.notify_newPost_alert,c=N()(app.translator.trans(u?"flarum-subscriptions.forum.sub_controls.notify_email_tooltip":"flarum-subscriptions.forum.sub_controls.notify_alert_tooltip")),p={className:"Button SubscriptionMenu-button "+i,icon:e,children:r,onclick:this.saveSubscription.bind(this,n,-1===["follow","ignore"].indexOf(o)&&"follow"),title:c};return p.config=(u||a)&&!1===o?function(t){$(t).tooltip({container:".SubscriptionMenu",placement:"bottom",delay:250,title:c})}:function(t){return $(t).tooltip("destroy")},m("div",{className:"Dropdown ButtonGroup SubscriptionMenu"},v.a.component(p),m("button",{className:"Dropdown-toggle Button Button--icon "+i,"data-toggle":"dropdown"},M()("fas fa-caret-down",{className:"Button-icon"})),m("ul",{className:"Dropdown-menu dropdown-menu Dropdown-menu--right"},this.options.map(function(r){return r.onclick=t.saveSubscription.bind(t,n,r.subscription),r.active=o===r.subscription,m("li",null,B.component(r))})))},o.saveSubscription=function(t,n){t.save({subscription:n}),this.$(".SubscriptionMenu-button").tooltip("hide")},n}(S.a);var T=o(25),D=o.n(T),C=o(24),F=o.n(C),R=o(23),A=o.n(R);var G=o(22),L=o.n(G),q=(o(36),o(21)),z=o.n(q),W=(o(35),o(20)),U=o.n(W),H=(o(34),function(t){function n(){return t.apply(this,arguments)||this}O(n,t);var o=n.prototype;return o.icon=function(){return"fas fa-star"},o.href=function(){var t=this.props.notification,n=t.subject(),o=t.content()||{};return app.route.discussion(n,o.postNumber)},o.content=function(){return app.translator.trans("flarum-subscriptions.forum.notifications.new_post_text",{user:this.props.notification.sender()})},n}(U.a));i.a.initializers.add("subscriptions",function(){i.a.notificationComponents.newPost=H,c.a.prototype.subscription=u.a.attribute("subscription"),Object(r.extend)(c.a.prototype,"badges",function(t){var n;switch(this.subscription()){case"follow":n=b.a.component({label:app.translator.trans("flarum-subscriptions.forum.badge.following_tooltip"),icon:"fas fa-star",type:"following"});break;case"ignore":n=b.a.component({label:app.translator.trans("flarum-subscriptions.forum.badge.ignoring_tooltip"),icon:"far fa-eye-slash",type:"ignoring"})}n&&t.add("subscription",n)}),Object(r.extend)(_.a,"userControls",function(t,n,o){if(app.session.user&&!(o instanceof h.a)){var r={none:{label:app.translator.trans("flarum-subscriptions.forum.discussion_controls.follow_button"),icon:"fas fa-star",save:"follow"},follow:{label:app.translator.trans("flarum-subscriptions.forum.discussion_controls.unfollow_button"),icon:"far fa-star",save:!1},ignore:{label:app.translator.trans("flarum-subscriptions.forum.discussion_controls.unignore_button"),icon:"fas fa-eye",save:!1}},e=n.subscription()||"none";t.add("subscription",v.a.component({children:r[e].label,icon:r[e].icon,onclick:n.save.bind(n,{subscription:r[e].save})}))}}),Object(r.extend)(h.a.prototype,"sidebarItems",function(t){if(app.session.user){var n=this.discussion;t.add("subscription",E.component({discussion:n}))}}),Object(r.extend)(F.a.prototype,"navItems",function(t){if(app.session.user){var n=this.stickyParams();n.filter="following",t.add("following",D.a.component({href:app.route("index.filter",n),children:app.translator.trans("flarum-subscriptions.forum.index.following_link"),icon:"fas fa-star"}),50)}}),Object(r.extend)(A.a.prototype,"requestParams",function(t){"following"===this.props.params.filter&&(t.filter.q=(t.filter.q||"")+" is:following")}),Object(r.extend)(L.a.prototype,"notificationsItems",function(t){t.add("followAfterReply",z.a.component({children:app.translator.trans("flarum-subscriptions.forum.settings.follow_after_reply_label"),state:this.user.preferences().followAfterReply,onchange:this.preferenceSaver("followAfterReply")}))}),Object(r.extend)(f.a.prototype,"notificationTypes",function(t){t.add("newPost",{name:"newPost",icon:"fas fa-star",label:i.a.translator.trans("flarum-subscriptions.forum.settings.notify_new_post_label")})})})},function(t,n){t.exports=flarum.core.compat["helpers/username"]},function(t,n){t.exports=flarum.core.compat["utils/ItemList"]},function(t,n){t.exports=flarum.core.compat["components/FieldSet"]},function(t,n,o){var r=o(3).document;t.exports=r&&r.documentElement},function(t,n){var o=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++o+r).toString(36))}},function(t,n){t.exports=!0},function(t,n,o){var r=o(9),e=o(3),i=e["__core-js_shared__"]||(e["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:o(39)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n,o){var r=o(14),e=Math.max,i=Math.min;t.exports=function(t,n){return(t=r(t))<0?e(t+n,0):i(t,n)}},function(t,n,o){var r=o(14),e=Math.min;t.exports=function(t){return t>0?e(r(t),9007199254740991):0}},function(t,n,o){var r=o(15),e=o(42),i=o(41);t.exports=function(t){return function(n,o,s){var u,a=r(n),c=e(a.length),p=i(s,c);if(t&&o!=o){for(;c>p;)if((u=a[p++])!=u)return!0}else for(;c>p;p++)if((t||p in a)&&a[p]===o)return t||p||0;return!t&&-1}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var o={}.toString;t.exports=function(t){return o.call(t).slice(8,-1)}},function(t,n,o){var r=o(45);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,n,o){var r=o(16),e=o(15),i=o(43)(!1),s=o(13)("IE_PROTO");t.exports=function(t,n){var o,u=e(t),a=0,c=[];for(o in u)o!=s&&r(u,o)&&c.push(o);for(;n.length>a;)r(u,o=n[a++])&&(~i(c,o)||c.push(o));return c}},function(t,n,o){var r=o(47),e=o(12);t.exports=Object.keys||function(t){return r(t,e)}},function(t,n,o){var r=o(19),e=o(8),i=o(48);t.exports=o(2)?Object.defineProperties:function(t,n){e(t);for(var o,s=i(n),u=s.length,a=0;u>a;)r.f(t,o=s[a++],n[o]);return t}},function(t,n,o){var r=o(8),e=o(49),i=o(12),s=o(13)("IE_PROTO"),u=function(){},a=function(){var t,n=o(17)("iframe"),r=i.length;for(n.style.display="none",o(37).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("