File indexing completed on 2024-12-22 05:35:06
0001 !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";e.exports=r(1)},function(e,t,r){"use strict"; 0002 /** @license React v16.6.1 0003 * react.production.min.js 0004 * 0005 * Copyright (c) Facebook, Inc. and its affiliates. 0006 * 0007 * This source code is licensed under the MIT license found in the 0008 * LICENSE file in the root directory of this source tree. 0009 */var n=r(2),o="function"==typeof Symbol&&Symbol.for,a=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,c=o?Symbol.for("react.fragment"):60107,u=o?Symbol.for("react.strict_mode"):60108,l=o?Symbol.for("react.profiler"):60114,s=o?Symbol.for("react.provider"):60109,f=o?Symbol.for("react.context"):60110,p=o?Symbol.for("react.concurrent_mode"):60111,m=o?Symbol.for("react.forward_ref"):60112,y=o?Symbol.for("react.suspense"):60113,b=o?Symbol.for("react.memo"):60115,d=o?Symbol.for("react.lazy"):60116,h="function"==typeof Symbol&&Symbol.iterator;function v(e){for(var t=arguments.length-1,r="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=0;n<t;n++)r+="&args[]="+encodeURIComponent(arguments[n+1]);!function(e,t,r,n,o,a,i,c){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,a,i,c],l=0;(e=Error(t.replace(/%s/g,function(){return u[l++]}))).name="Invariant Violation"}throw e.framesToPop=1,e}}(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",r)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g={};function E(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||_}function w(){}function O(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||_}E.prototype.isReactComponent={},E.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&v("85"),this.updater.enqueueSetState(this,e,t,"setState")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=E.prototype;var S=O.prototype=new w;S.constructor=O,n(S,E.prototype),S.isPureReactComponent=!0;var j={current:null,currentDispatcher:null},P=Object.prototype.hasOwnProperty,k={key:!0,ref:!0,__self:!0,__source:!0};function C(e,t,r){var n=void 0,o={},i=null,c=null;if(null!=t)for(n in void 0!==t.ref&&(c=t.ref),void 0!==t.key&&(i=""+t.key),t)P.call(t,n)&&!k.hasOwnProperty(n)&&(o[n]=t[n]);var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){for(var l=Array(u),s=0;s<u;s++)l[s]=arguments[s+2];o.children=l}if(e&&e.defaultProps)for(n in u=e.defaultProps)void 0===o[n]&&(o[n]=u[n]);return{$$typeof:a,type:e,key:i,ref:c,props:o,_owner:j.current}}function N(e){return"object"==typeof e&&null!==e&&e.$$typeof===a}var x=/\/+/g,$=[];function T(e,t,r,n){if($.length){var o=$.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function A(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>$.length&&$.push(e)}function R(e,t,r){return null==e?0:function e(t,r,n,o){var c=typeof t;"undefined"!==c&&"boolean"!==c||(t=null);var u=!1;if(null===t)u=!0;else switch(c){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case a:case i:u=!0}}if(u)return n(o,t,""===r?"."+U(t,0):r),1;if(u=0,r=""===r?".":r+":",Array.isArray(t))for(var l=0;l<t.length;l++){var s=r+U(c=t[l],l);u+=e(c,s,n,o)}else if(s=null===t||"object"!=typeof t?null:"function"==typeof(s=h&&t[h]||t["@@iterator"])?s:null,"function"==typeof s)for(t=s.call(t),l=0;!(c=t.next()).done;)u+=e(c=c.value,s=r+U(c,l++),n,o);else"object"===c&&v("31","[object Object]"==(n=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":n,"");return u}(e,"",t,r)}function U(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}(e.key):t.toString(36)}function D(e,t){e.func.call(e.context,t,e.count++)}function M(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?F(e,n,r,function(e){return e}):null!=e&&(N(e)&&(e=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(x,"$&/")+"/")+r)),n.push(e))}function F(e,t,r,n,o){var a="";null!=r&&(a=(""+r).replace(x,"$&/")+"/"),R(e,M,t=T(t,a,n,o)),A(t)}var q={Children:{map:function(e,t,r){if(null==e)return e;var n=[];return F(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;R(e,D,t=T(null,null,t,r)),A(t)},count:function(e){return R(e,function(){return null},null)},toArray:function(e){var t=[];return F(e,t,null,function(e){return e}),t},only:function(e){return N(e)||v("143"),e}},createRef:function(){return{current:null}},Component:E,PureComponent:O,createContext:function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:m,render:e}},lazy:function(e){return{$$typeof:d,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:b,type:e,compare:void 0===t?null:t}},Fragment:c,StrictMode:u,Suspense:y,createElement:C,cloneElement:function(e,t,r){null==e&&v("267",e);var o=void 0,i=n({},e.props),c=e.key,u=e.ref,l=e._owner;if(null!=t){void 0!==t.ref&&(u=t.ref,l=j.current),void 0!==t.key&&(c=""+t.key);var s=void 0;for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)P.call(t,o)&&!k.hasOwnProperty(o)&&(i[o]=void 0===t[o]&&void 0!==s?s[o]:t[o])}if(1===(o=arguments.length-2))i.children=r;else if(1<o){s=Array(o);for(var f=0;f<o;f++)s[f]=arguments[f+2];i.children=s}return{$$typeof:a,type:e.type,key:c,ref:u,props:i,_owner:l}},createFactory:function(e){var t=C.bind(null,e);return t.type=e,t},isValidElement:N,version:"16.6.3",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:j,assign:n}};q.unstable_ConcurrentMode=p,q.unstable_Profiler=l;var I={default:q},L=I&&q||I;e.exports=L.default||L},function(e,t,r){"use strict"; 0010 /* 0011 object-assign 0012 (c) Sindre Sorhus 0013 @license MIT 0014 */var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,i,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u<arguments.length;u++){for(var l in r=Object(arguments[u]))o.call(r,l)&&(c[l]=r[l]);if(n){i=n(r);for(var s=0;s<i.length;s++)a.call(r,i[s])&&(c[i[s]]=r[i[s]])}}return c}},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n);function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,u(t).apply(this,arguments))}var r,n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,o.a.Component),r=t,(n=[{key:"render",value:function(){var e=this.props.baseUrlStore+"/p/"+this.props.product.project_id,t=o.a.createElement("div",{className:"score-info"},o.a.createElement("div",{className:"score-number"},(this.props.product.laplace_score/10).toFixed(1)+"%"),o.a.createElement("div",{className:"score-bar-container"},o.a.createElement("div",{className:"score-bar",style:{width:this.props.product.laplace_score/10+"%"}}),o.a.createElement("span",null,"$",this.props.product.probably_payout_amount_factor," ",this.props.isAdmin?"($"+this.props.product.probably_payout_amount+")":""))),r=o.a.createElement("div",{className:"product-info"},o.a.createElement("span",{className:"product-info-title"},o.a.createElement("a",{href:e},this.props.product.title)),o.a.createElement("span",{className:"product-info-category"},this.props.product.cat_title),o.a.createElement("span",{className:"product-info-date"},this.props.product.updated_at));return o.a.createElement("div",{className:"productrow row"},o.a.createElement("div",{className:"col-lg-2"},o.a.createElement("a",{href:e},o.a.createElement("figure",null,o.a.createElement("img",{className:"productimg",src:this.props.product.image_small})))),o.a.createElement("div",{className:"col-lg-7"},r),o.a.createElement("div",{className:"col-lg-3"},t))}}])&&i(r.prototype,n),a&&i(r,a),t}();function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var d=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=m(this,y(t).call(this,e))).state={},r}var r,n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&b(e,t)}(t,o.a.Component),r=t,(n=[{key:"render",value:function(){var e,t=this;if(this.props.products){var r=this.props.products.map(function(e,r){return o.a.createElement("li",{key:r},o.a.createElement(s,{product:e,baseUrlStore:t.props.baseUrlStore,isAdmin:t.props.isAdmin}))});e=o.a.createElement("ul",null,r)}return this.props.category?this.props.category.title:this.props.section?this.props.section.name:"All",o.a.createElement("div",{className:"panelContainer"},o.a.createElement("div",{className:"title"},"Top 20 Products Last Month Payout"),e)}}])&&p(r.prototype,n),a&&p(r,a),t}();var h=function(e){return o.a.createElement("div",{className:"creatorrow row"},o.a.createElement("div",{className:"col-lg-4"},o.a.createElement("a",{href:e.baseUrlStore+"/u/"+e.creator.username},o.a.createElement("figure",null,o.a.createElement("img",{className:"productimg",src:e.creator.profile_image_url})))),o.a.createElement("div",{className:"col-lg-8 userinfo"},o.a.createElement("div",{className:"userinfo-title"},e.creator.username),o.a.createElement("span",null,"$",e.creator.probably_payout_amount_factor," ",e.isAdmin?"($"+e.creator.probably_payout_amount+")":"")))};function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g(e,t){return!t||"object"!==v(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function E(e){return(E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var O=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=g(this,E(t).call(this,e))).state={},r}var r,n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&w(e,t)}(t,o.a.Component),r=t,(n=[{key:"render",value:function(){var e,t=this;if(this.props.creators){var r=this.props.creators.map(function(e,r){return o.a.createElement("li",{key:r},o.a.createElement(h,{creator:e,baseUrlStore:t.props.baseUrlStore,isAdmin:t.props.isAdmin}))});e=o.a.createElement("ul",null,r)}return o.a.createElement("div",{className:"panelContainer"},o.a.createElement("div",{className:"title"},"Top 20 Creators Last Month Payout"),e)}}])&&_(r.prototype,n),a&&_(r,a),t}();function S(e){return(S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e,t){return(C=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var N=function(e){function t(e){var r,n,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(r=!(o=P(t).call(this,e))||"object"!==S(o)&&"function"!=typeof o?k(n):o).state={},r.onChangeFreeamount=r.onChangeFreeamount.bind(k(r)),r}var r,n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&C(e,t)}(t,o.a.Component),r=t,(n=[{key:"onChangeFreeamount",value:function(e){this.setState({typed:e.target.value})}},{key:"render",value:function(){var e,t,r=this,n=[2,5,10,20,50,100],a=[.99,2,5,10,20,50].map(function(e,t){var a,i;a=0==t?0:n[t-1],i=n[t];var c=r.props.supporters.filter(function(e){return e.section_support_tier>=a&&e.section_support_tier<i});return o.a.createElement("div",{className:"tier-container"},o.a.createElement("span",null,c.length+" Supporters"),o.a.createElement("div",{className:"join"},o.a.createElement("a",{href:u},"Join $",e," Tier")))}),i=this.props.supporters,c=(i=i.filter(function(e){return e.section_support_tier>=100})).map(function(e,t){return o.a.createElement("li",{key:t},o.a.createElement("a",{href:r.props.baseUrlStore+"/u/"+e.username},o.a.createElement("img",{src:e.profile_image_url})))});t=o.a.createElement("ul",null,c);var u=this.props.baseUrlStore+"/support-predefined?section_id="+this.props.section.section_id;return u=u+"&amount_predefined="+this.state.typed,e=o.a.createElement("div",{className:"tier-container"},t&&o.a.createElement("span",null,c.length," Supporters "),o.a.createElement("div",{className:"join"},o.a.createElement("div",null,"$",o.a.createElement("input",{className:"free-amount",onChange:this.onChangeFreeamount.bind(this)}),o.a.createElement("span",null,"100 or more")),o.a.createElement("div",null,o.a.createElement("a",{href:u,id:"free-amount-link"},"Join ")))),o.a.createElement("div",{className:"support-container"},o.a.createElement("div",{className:"tiers"},o.a.createElement("h5",null,"Tiers")),a,e)}}])&&j(r.prototype,n),a&&j(r,a),t}();function x(e){return(x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var U=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=T(this,A(t).call(this,e))).state={},r}var r,n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&R(e,t)}(t,o.a.Component),r=t,(n=[{key:"render",value:function(){var e=this;var t=this.props.supporters.filter(function(e,t,r){for(var n=0;n<r.length;n++)if(r[n].member_id==e.member_id){if(t==n)return e;break}}).map(function(t,r){return o.a.createElement("li",{key:r},o.a.createElement("a",{href:e.props.baseUrlStore+"/u/"+t.username},o.a.createElement("img",{src:t.profile_image_url})),o.a.createElement("div",{className:"username"},t.username))}),r=o.a.createElement("ul",null,t);return o.a.createElement("div",{className:"supporters-container"},r)}}])&&$(r.prototype,n),a&&$(r,a),t}();function D(e){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function F(e,t){return!t||"object"!==D(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function q(e){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var L=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),F(this,q(t).call(this,e))}var r,a,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(t,n["Component"]),r=t,(a=[{key:"render",value:function(){var e=this.props.supporters.filter(function(e,t,r){for(var n=0;n<r.length;n++)if(r[n].member_id==e.member_id){if(t==n)return e;break}}).length,t=50*Math.ceil(e/50);return 0==t&&(t=50),o.a.createElement("div",{className:"pling-section-header"},o.a.createElement("div",{className:"header-title"},o.a.createElement("span",null,this.props.section?this.props.section.name:"")),o.a.createElement("div",{className:"score-container"},o.a.createElement("span",null,"Goal:"),o.a.createElement("div",{className:"score-bar-container"},o.a.createElement("div",{className:"score-bar",style:{width:e/t*100+"%"}},e)),o.a.createElement("span",null,t)))}}])&&M(r.prototype,a),i&&M(r,i),t}();function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function J(e){return(J=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function G(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function W(e,t){return(W=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var Y=function(e){function t(e){var r,n,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=this,(r=!(o=J(t).call(this,e))||"object"!==B(o)&&"function"!=typeof o?G(n):o).state=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){V(e,t,r[t])})}return e}({},window.data,{showContent:"overview"}),r.loadData=r.loadData.bind(G(r)),r.onClickCategory=r.onClickCategory.bind(G(r)),r.showDetail=r.showDetail.bind(G(r)),r}var r,a,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&W(e,t)}(t,n["Component"]),r=t,(a=[{key:"loadData",value:function(e){var t=this,r="/section/top?id="+e.section_id;fetch(r).then(function(e){return e.json()}).then(function(e){t.setState(function(t){return{loading:!1,products:e.products,creators:e.creators}})})}},{key:"showDetail",value:function(e){this.setState(function(t){return{showContent:e}}),"overview"==e&&this.loadData(this.state.section)}},{key:"onClickCategory",value:function(e){var t=this,r="/section/topcat?cat_id="+e.project_category_id;fetch(r).then(function(e){return e.json()}).then(function(r){t.setState(function(t){return{loading:!1,showContent:"overview",products:r.products,creators:r.creators,category:e}})})}},{key:"render",value:function(){var e,t,r,n,a=this;if(this.state.sections){var i=this.state.sections.map(function(e,t){return o.a.createElement("li",{key:e.section_id,className:a.state.section&&e.section_id==a.state.section.section_id?"active":""},o.a.createElement("a",{href:"/section?id="+e.section_id},e.name))});e=o.a.createElement("div",{className:"pling-nav-tabs"},o.a.createElement("ul",{className:"nav nav-tabs pling-section-tabs"},i))}return this.state.details&&this.state.section&&(r=this.state.details.map(function(e,t){if(e.section_id==a.state.section.section_id)return o.a.createElement("li",null,o.a.createElement("a",{onClick:function(){return a.onClickCategory(e)}},e.title))})),n="supporters"==this.state.showContent?o.a.createElement(U,{baseUrlStore:this.state.baseurlStore,supporters:this.state.supporters}):o.a.createElement(o.a.Fragment,null,o.a.createElement(d,{isAdmin:this.state.isAdmin,baseUrlStore:this.state.baseurlStore,products:this.state.products,section:this.state.section,category:this.state.category}),o.a.createElement(O,{isAdmin:this.state.isAdmin,creators:this.state.creators,section:this.state.section,category:this.state.category,baseUrlStore:this.state.baseurlStore})),t=o.a.createElement("div",{className:"pling-section-detail"},this.state.section&&o.a.createElement("div",{className:"pling-section-detail-left"},o.a.createElement("h2",{className:"overview"==this.state.showContent?"focused":""},o.a.createElement("a",{onClick:function(){return a.showDetail("overview")}},"Overview")),o.a.createElement("h2",{className:"supporters"==this.state.showContent?"focused":""},o.a.createElement("a",{onClick:function(){return a.showDetail("supporters")}},"Supporters")),o.a.createElement("h2",{className:"categories"==this.state.showContent?"focused":""},o.a.createElement("a",{onClick:function(){return a.showDetail("overview")}},"Categories")),o.a.createElement("ul",{className:"pling-section-detail-ul"},r)),o.a.createElement("div",{className:"pling-section-detail-middle"},n),o.a.createElement("div",{className:"pling-section-detail-right"},o.a.createElement("div",{className:"btnSupporter"},"Become a Supporter"),this.state.section&&o.a.createElement(N,{baseUrlStore:this.state.baseurlStore,section:this.state.section,supporters:this.state.supporters}))),o.a.createElement(o.a.Fragment,null,o.a.createElement(L,{section:this.state.section,isAdmin:this.state.isAdmin,supporters:this.state.supporters}),e,t)}}])&&z(r.prototype,a),i&&z(r,i),t}();ReactDOM.render(o.a.createElement(Y,null),document.getElementById("pling-section-content"))}]);