PageSourceSearch

https://www.sportstalksocial.com/_nuxt/f7a59e2.modern.js

js sportstalksocial.com collected 2026-09-25 01:35:28 UTC 33,647 bytes, 1 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{1075:function(t,e,r){"use strict";var o=r(888),n=r.n(o);e.default=n.a},1115:function(t,e,r){"use strict";r.r(e);var o=r(7),n=r(15),l=(r(29),r(61),r(32),r(24),r(357),r(139),r(126),r(154),r(508),r(509),r(510),r(511),r(512),r(513),r(514),r(515),r(516),r(517),r(518),r(519),r(520),r(82)),c=r(1154),d=r(1114),m=r(83),v=(r(41),r(226)),f=r(1111);function h(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function y(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?h(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):h(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var D={name:"CreateProposalModal",data:()=>({title:"",startDate:"",endDate:"",amountPerDay:"",authorPermlink:"",payout:{type:"user",name:"",contractPayload:"{}"},payoutOptions:[{text:"User",value:"user"},{text:"Contract",value:"contract"}],tokenBalance:0}),computed:y(y({},Object(l.c)("dao",["fund"])),{},{minDate:()=>Object(f.a)(Date.now(),2),minEndDate(){return Object(f.a)(new Date(this.startDate).getTime(),2)},maxEndDate(){return Object(f.a)(new Date(this.startDate).getTime(),Number(this.fund.maxDays))},creationFee(){var{proposalFee:t}=this.fund;return t?y(y({},t),{},{amount:Number(t.amount)}):null},shouldBeDisabled(){return!!this.creationFee&&this.creationFee.amount>this.tokenBalance},proposalDuration(){if(this.startDate&&this.endDate){var t=new Date(this.startDate).getTime(),e=new Date(this.endDate).getTime();return Object(c.a)(e,t)}return 0},expectedPayout(){return this.proposalDuration&&this.amountPerDay?Object(m.i)(this.proposalDuration*this.amountPerDay):0}}),mounted(){this.$root.$on("bv::modal::show",this.onModalShow),this.$eventBus.$on("dao-proposal-creation-successful",this.onProposalCreation)},beforeDestroy(){this.$root.$off("bv::modal::show",this.onModalShow),this.$eventBus.$off("dao-proposal-creation-successful",this.onProposalCreation)},methods:y(y({},Object(l.b)("dao",["requestCreateProposal"])),{},{createProposal(){if(this.$v.$touch(),!this.$v.$invalid){var t={fundId:this.fund.id,title:this.title,startDate:"".concat(this.startDate,"T00:00:00.000Z"),endDate:"".concat(this.endDate,"T00:00:00.000Z"),amountPerDay:this.amountPerDay.toString(),authorPermlink:this.authorPermlink,payout:{type:this.payout.type,name:this.payout.name}};"contract"===this.payout.type&&(t.payout.contractPayload=JSON.parse(this.payout.contractPayload)),this.requestCreateProposal(t)}},resetForm(){this.$v.$reset(),this.title="",this.startDate="",this.endDate="",this.amountPerDay="",this.authorPermlink="",this.payout={type:"user",name:this.$auth.user.username,contractPayload:"{}"}},onModalShow(t,e){var r=this;return Object(n.a)((function*(){if("createProposalModal"===e&&(r.resetForm(),r.creationFee)){var t=yield r.$sidechain.getBalance(r.$auth.user.username,r.creationFee.symbol);r.tokenBalance=t?Number(t.balance):0}}))()},onProposalCreation(data){this.$bvModal.hide("createProposalModal"),this.resetForm()}}),validations:{title:{required:v.required,minLength:Object(v.minLength)(1),maxLength:Object(v.maxLength)(80)},startDate:{required:v.required,validValue:(t,e)=>""===t||""===e.endDate||new Date(t).getTime()<new Date(e.endDate).getTime()},endDate:{required:v.required,validValue:(t,e)=>""===t||""===e.startDate||new Date(t).getTime()>new Date(e.startDate).getTime()},amountPerDay:{required:v.required,decimal:v.decimal,greaterThanZero:t=>""===t||t>0,maxValue:(t,e)=>t<=Number(e.fund.maxAmountPerDay)},authorPermlink:{required:v.required,maxLength:Object(v.maxLength)(255),validAuthorPermlink:t=>""===t||/^@[a-z0-9-.]{3,16}\/[\w\d-]+$/.test(t)},payout:{type:{required:v.required,valid:t=>["user","contract"].includes(t)},name:{required:v.required,validUsername:t=>""===t||/^([a-z])[a-z0-9-.]*$/.test(t)},contractPayload:{requiredIf:Object(v.requiredIf)((t=>"contract"===t.type)),validJson:t=>{if(""===t)return!0;var e=!1;try{e=!!JSON.parse(t)}catch(t){}return e}}}}},P=r(77),component=Object(P.a)(D,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-modal",{attrs:{id:"createProposalModal",centered:"",size:"lg",title:"Create Proposal"},scopedSlots:t._u([{key:"modal-footer",fn:function(){return[r("b-button",{attrs:{disabled:t.shouldBeDisabled,variant:"primary"},on:{click:function(e){return e.preventDefault(),t.createProposal.apply(null,arguments)}}},[t._v("\n      Create\n    ")])]},proxy:!0}])},[r("b-form-group",{attrs:{label:"Title",description:"Brief description of your proposal. Maximum of 80 characters."}},[r("b-form-input",{attrs:{trim:"",state:t.$v.title.$dirty?!t.$v.title.$error:null},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1),t._v(" "),r("b-form-group",{attrs:{label:"Permlink",description:"Permlink to the hive post describing the proposal. E.g.: @username/i-would-do-awesome-things"}},[r("b-form-input",{attrs:{trim:"",state:t.$v.authorPermlink.$dirty?!t.$v.authorPermlink.$error:null},model:{value:t.authorPermlink,callback:function(e){t.authorPermlink=e},expression:"authorPermlink"}})],1),t._v(" "),r("b-form-row",[r("b-col",[r("b-form-group",{attrs:{label:"Start Date",description:"Proposal start date. Must be at least one day in to the future."}},[r("b-form-datepicker",{attrs:{min:t.minDate,state:t.$v.startDate.$dirty?!t.$v.
1startDate.$error:null,"menu-class":"w-100","calendar-width":"100%","date-format-options":{year:"numeric",month:"numeric",day:"numeric"}},model:{value:t.startDate,callback:function(e){t.startDate=e},expression:"startDate"}})],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"End Date",description:"Proposal end date, must not exceed the max duration of the token fund."}},[r("b-form-datepicker",{attrs:{min:t.minEndDate,max:t.maxEndDate,state:t.$v.endDate.$dirty?!t.$v.endDate.$error:null,"menu-class":"w-100","calendar-width":"100%","date-format-options":{year:"numeric",month:"numeric",day:"numeric"}},model:{value:t.endDate,callback:function(e){t.endDate=e},expression:"endDate"}})],1)],1)],1),t._v(" "),r("b-form-row",[r("b-col",[r("b-form-group",{attrs:{label:"Duration",description:"Duration of the proposal."}},[r("b-input-group",{attrs:{append:"Days"}},[r("b-form-input",{attrs:{value:t.proposalDuration,readonly:""}})],1)],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"Amount Per Day",description:"Amount of "+t.fund.payToken+" you want to receive per day."}},[r("b-input-group",{attrs:{append:t.fund.payToken}},[r("b-form-input",{attrs:{number:"",state:t.$v.amountPerDay.$dirty?!t.$v.amountPerDay.$error:null},model:{value:t.amountPerDay,callback:function(e){t.amountPerDay=e},expression:"amountPerDay"}})],1)],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"Expected Payout",description:"Total expected payout if the proposal is being funded the whole duration of the proposal."}},[r("b-input-group",{attrs:{append:t.fund.payToken}},[r("b-form-input",{attrs:{value:t.expectedPayout,readonly:""}})],1)],1)],1)],1),t._v(" "),r("b-form-row",[r("b-col",[r("b-form-group",{attrs:{label:"Payout Type",description:"Select a payout recipient type"}},[r("b-form-select",{attrs:{options:t.payoutOptions,state:t.$v.payout.type.$dirty?!t.$v.payout.type.$error:null},model:{value:t.payout.type,callback:function(e){t.$set(t.payout,"type",e)},expression:"payout.type"}})],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"Recipent Name",description:"Recipent "+t.payout.type+" name"}},[r("b-form-input",{attrs:{trim:"",state:t.$v.payout.name.$dirty?!t.$v.payout.name.$error:null},model:{value:t.payout.name,callback:function(e){t.$set(t.payout,"name",e)},expression:"payout.name"}})],1)],1),t._v(" "),r("b-col",["contract"===t.payout.type?r("b-form-group",{attrs:{label:"Contract Payload",description:"Custom object that is passed to the target contract's receiveDtfTokens action"}},[r("b-form-input",{attrs:{trim:"",state:t.$v.payout.contractPayload.$dirty?!t.$v.payout.contractPayload.$error:null},model:{value:t.payout.contractPayload,callback:function(e){t.$set(t.payout,"contractPayload",e)},expression:"payout.contractPayload"}})],1):t._e()],1)],1),t._v(" "),t.creationFee?r("div",{staticClass:"text-info mt-5"},[r("p",[t._v("Proposal creation fee: "+t._s(t.creationFee.amount)+" "+t._s(t.creationFee.symbol))]),t._v(" "),r("p",[t._v("Your current balance: "+t._s(t.tokenBalance)+" "+t._s(t.creationFee.symbol))])]):t._e()],1)}),[],!1,null,null,null),_=component.exports;function $(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function O(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?$(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):$(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var x={name:"UpdateFundModal",data:()=>({voteThreshold:"",maxDays:"",maxAmountPerDay:"",proposalFee:{method:"burn",symbol:"",amount:""},feeRequired:!0,feeMethodOptions:[{value:"burn",text:"Burn"},{value:"issuer",text:"To Issuer"}],tokenBalance:0,dtfUpdateFee:0,tokens:[]}),computed:O(O({},Object(l.c)("dao",["fund"])),{},{availableTokens(){return this.tokens.map((t=>({value:t.symbol,text:"".concat(t.name," (").concat(t.symbol,")")})))}}
1),mounted(){this.$root.$on("bv::modal::show",this.onModalShow),this.$eventBus.$on("dao-update-successful",this.onDaoUpdate)},beforeDestroy(){this.$root.$off("bv::modal::show",this.onModalShow),this.$eventBus.$off("dao-update-successful")},methods:O(O({},Object(l.b)("dao",["fetchTokens","requestUpdateFund"])),{},{updateFund(){if(this.$v.$touch(),!this.$v.$invalid){var t={fundId:this.fund.id,voteThreshold:this.voteThreshold.toString(),maxDays:this.maxDays.toString(),maxAmountPerDay:this.maxAmountPerDay.toString()};if(this.feeRequired){var{method:e,symbol:symbol,amount:r}=this.proposalFee;t.proposalFee={method:e,symbol:symbol,amount:r.toString()}}this.requestUpdateFund(t)}},onModalShow(t,e){var r=this;return Object(n.a)((function*(){if("updateFundModal"===e){r.$v.$reset();var{voteThreshold:t,maxDays:o,maxAmountPerDay:n,proposalFee:l}=JSON.parse(JSON.stringify(r.fund));r.voteThreshold=t,r.maxDays=o,r.maxAmountPerDay=n,r.feeRequired=!!l,r.feeRequired&&(r.proposalFee=l);var[{dtfUpdateFee:c},d,m]=yield Promise.all([r.$sidechain.getContractParams("tokenfunds"),r.$sidechain.getBalance(r.$auth.user.username,"BEE"),r.fetchTokens()]);r.dtfUpdateFee=Number(c),r.tokenBalance=d?Number(d.balance):0,r.tokens=m}}))()},onDaoUpdate(){this.$bvModal.hide("updateFundModal")}}),validations:{voteThreshold:{required:v.required,decimal:v.decimal,minValue:Object(v.minValue)(1)},maxDays:{required:v.required,numeric:v.numeric,minValue:Object(v.minValue)(1),maxValue:Object(v.maxValue)(730)},maxAmountPerDay:{greaterThanZero:t=>t>0},proposalFee:{method:{requiredIf:Object(v.requiredIf)((function(){return this.feeRequired}))},symbol:{requiredIf:Object(v.requiredIf)((function(){return this.feeRequired}))},amount:{requiredIf:Object(v.requiredIf)((function(){return this.feeRequired})),decimal:v.decimal,greaterThanZero:t=>""===t||t>0}}}},k=Object(P.a)(x,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-modal",{attrs:{id:"updateFundModal",centered:"",size:"lg",title:"Update DAO"},scopedSlots:t._u([{key:"modal-footer",fn:function(){return[r("b-button",{attrs:{variant:"primary"},on:{click:function(e){return e.preventDefault(),t.updateFund.apply(null,arguments)}}},[t._v("\n      Update\n    ")])]},proxy:!0}])},[r("b-form-group",{attrs:{label:"Vote Threshold",description:"Minimum amount of stake required for proposal consideration."}},[r("b-form-input",{attrs:{number:"",type:"number",min:"1",state:t.$v.voteThreshold.$dirty?!t.$v.voteThreshold.$error:null},model:{value:t.voteThreshold,callback:function(e){t.voteThreshold=e},expression:"voteThreshold"}})],1),t._v(" "),r("b-form-group",{attrs:{label:"Maximum Duration",description:"Maximum duration of any proposal. Must be between 1 and 730 days."}},[r("b-form-input",{attrs:{number:"",type:"number",min:"1",state:t.$v.maxDays.$dirty?!t.$v.maxDays.$error:null},model:{value:t.maxDays,callback:function(e){t.maxDays=e},expression:"maxDays"}})],1),t._v(" "),r("b-form-group",{attrs:{label:"Maximum Amount Per Day",description:"Maximum amount of payment tokens a proposal can request"}},[r("b-form-input",{attrs:{number:"",type:"number",min:"1",state:t.$v.maxAmountPerDay.$dirty?!t.$v.maxAmountPerDay.$error:null},model:{value:t.maxAmountPerDay,callback:function(e){t.maxAmountPerDay=e},expression:"maxAmountPerDay"}})],1),t._v(" "),t.feeRequired?[r("b-form-row",[r("b-col",[r("b-form-group",{attrs:{label:"Payment Method",description:"Fee can be burned or sent to the fee payment token's issuer."}},[r("b-form-select",{attrs:{options:t.feeMethodOptions,state:t.$v.proposalFee.method.$dirty?!t.$v.proposalFee.method.$error:null},model:{value:t.proposalFee.method,callback:function(e){t.$set(t.proposalFee,"method",e)},expression:"proposalFee.method"}})],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"Fee Payment Token",description:"Token to be used for paying creation fee.",state:t.$v.proposalFee.symbol.$dirty?!t.$v.proposalFee.symbol.$error:null,"invalid-feedback":"Please select a token."}},[r("b-form-select",{attrs:{options:t.availableTokens},scopedSlots:t._u([{key:"first",fn:function(){return[r("b-form-select-option",{attrs:{value:"",disabled:""}},[t._v("\n                Select a Token\n              ")])]},proxy:!0}],null,!1,2303001201),model:{value:t.proposalFee.symbol,callback:function(e){t.$set(t.proposalFee,"symbol",e)},expression:"proposalFee.symbol"}})],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"Amount",description:"Amount of fee."}},[r("b-form-input",{attrs:{number:"",type:"number",state:t.$v.proposalFee.amount.$dirty?!t.$v.proposalFee.amount.$error:null},model:{value:t.proposalFee.amount,callback:function(e){t.$set(t.proposalFee,"amount",e)}
1,expression:"proposalFee.amount"}})],1)],1)],1)]:t._e(),t._v(" "),r("div",{staticClass:"text-info"},[r("p",[t._v("Updating dao costs: "+t._s(t.dtfUpdateFee)+" BEE")]),t._v(" "),r("p",[t._v("Your current balance: "+t._s(t.tokenBalance)+" BEE")])])],2)}),[],!1,null,null,null),w=k.exports;function j(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function C(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?j(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):j(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var T={name:"UpdateProposalModal",props:{proposal:{type:Object,required:!0}},data:()=>({title:"",startDate:"",endDate:"",amountPerDay:"",authorPermlink:""}),computed:{minEndDate(){return Object(f.a)(new Date(this.proposal.startDate).getTime(),2)},maxEndDate(){return new Date(this.proposal.endDate)},proposalDuration(){if(this.startDate&&this.endDate){var t=new Date(this.startDate).getTime(),e=new Date(this.endDate).getTime();return Object(c.a)(e,t)}return 0}},mounted(){this.$root.$on("bv::modal::shown",this.onModalShow),this.$eventBus.$on("dao-proposal-update-successful",this.onProposalUpdate)},beforeDestroy(){this.$root.$off("bv::modal::shown",this.onModalShow),this.$eventBus.$off("dao-proposal-update-successful",this.onProposalUpdate)},methods:C(C({},Object(l.b)("dao",["requestUpdateProposal"])),{},{onModalShow(t,e){if("updateProposalModal"===e){this.$v.$reset();var{title:title,startDate:r,endDate:o,amountPerDay:n,authorPermlink:l}=this.proposal;this.title=title,this.startDate=Object(d.a)(new Date(r).getTime(),"yyyy-MM-dd"),this.endDate=Object(d.a)(new Date(o).getTime(),"yyyy-MM-dd"),this.amountPerDay=n,this.authorPermlink=l}},onProposalUpdate(){this.$bvModal.hide("updateProposalModal")},updateProposal(){if(this.$v.$touch(),!this.$v.$invalid){var t={id:this.proposal._id.toString(),title:this.title,endDate:"".concat(this.endDate,"T00:00:00.000Z"),amountPerDay:this.amountPerDay.toString(),authorPermlink:this.authorPermlink};this.requestUpdateProposal(t)}}}),validations:{title:{required:v.required},endDate:{required:v.required},amountPerDay:{required:v.required,decimal:v.decimal,greaterThanZero:t=>""===t||t>0,maxValue:(t,e)=>t<=Number(e.proposal.amountPerDay)},authorPermlink:{required:v.required,maxLength:Object(v.maxLength)(255),validAuthorPermlink:t=>""===t||/^@[a-z0-9-.]{3,16}\/[\w\d-]+$/.test(t)}}},M=Object(P.a)(T,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-modal",{attrs:{id:"updateProposalModal",centered:"",size:"lg",title:"Update Proposal #"+t.proposal._id},scopedSlots:t._u([{key:"modal-footer",fn:function(){return[r("b-button",{attrs:{variant:"primary"},on:{click:function(e){return e.preventDefault(),t.updateProposal.apply(null,arguments)}}},[t._v("\n      Update\n    ")])]},proxy:!0}])},[r("b-form-group",{attrs:{label:"Title",description:"Brief description of your proposal. Maximum of 80 characters."}},[r("b-form-input",{attrs:{trim:"",state:t.$v.title.$dirty?!t.$v.title.$error:null},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1),t._v(" "),r("b-form-group",{attrs:{label:"Permlink",description:"Permlink to the hive post describing the proposal. E.g.: @username/i-would-do-awesome-things"}},[r("b-form-input",{attrs:{trim:"",state:t.$v.authorPermlink.$dirty?!t.$v.authorPermlink.$error:null},model:{value:t.authorPermlink,callback:function(e){t.authorPermlink=e},expression:"authorPermlink"}})],1),t._v(" "),r("b-form-row",[r("b-col",[r("b-form-group",{attrs:{label:"Start Date",description:"Proposal start date. Must be at least one day in to the future."}},[r("b-form-datepicker",{attrs:{"menu-class":"w-100","calendar-width":"100%","date-format-options":{year:"numeric",month:"numeric",day:"numeric"},disabled:""},model:{value:t.startDate,callback:function(e){t.startDate=e},expression:"startDate"}})],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"End Date",description:"Proposal end date, must not exceed the max duration of the token fund."}},[r("b-form-datepicker",{attrs:{min:t.minEndDate,max:t.maxEndDate,state:t.$v.endD
1ate.$dirty?!t.$v.endDate.$error:null,"menu-class":"w-100","calendar-width":"100%","date-format-options":{year:"numeric",month:"numeric",day:"numeric"}},model:{value:t.endDate,callback:function(e){t.endDate=e},expression:"endDate"}})],1)],1)],1),t._v(" "),r("b-form-row",[r("b-col",[r("b-form-group",{attrs:{label:"Duration",description:"Duration of the proposal."}},[r("b-input-group",{attrs:{append:"Days"}},[r("b-form-input",{attrs:{value:t.proposalDuration,readonly:""}})],1)],1)],1),t._v(" "),r("b-col",[r("b-form-group",{attrs:{label:"Amount Per Day",description:"Amount of tokens you want to receive per day."}},[r("b-form-input",{attrs:{number:"",type:"number",state:t.$v.amountPerDay.$dirty?!t.$v.amountPerDay.$error:null},model:{value:t.amountPerDay,callback:function(e){t.amountPerDay=e},expression:"amountPerDay"}})],1)],1)],1)],1)}),[],!1,null,null,null);function F(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function A(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?F(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):F(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var S={name:"Proposals",components:{CreateProposal:_,UpdateFund:w,UpdateProposal:M.exports},asyncData:t=>Object(n.a)((function*(){var{store:e,error:r}=t;try{if(yield e.dispatch("dao/fetchFund",{root:!0}),!e.state.dao.fund)return r({statusCode:404,message:"DTF fund has not been found!"})}catch(t){return r({statusCode:404,message:"DTF fund has not been found!"})}}))(),data:()=>({search:"",filter:"all",sortOptions:[{text:"Vote Weight",value:"weight"},{text:"Start Date",value:"startDate"},{text:"End Date",value:"endDate"}],sortBy:"weight",currentPage:1,perPage:20,query:{},approvals:[],approvers:[],selectedProposal:{},approversLoading:!1}),fetch(){var t=this;return Object(n.a)((function*(){t.loading=!0;var e=[t.fetchProposals(t.query)];t.$auth.loggedIn&&e.push(t.fetchUserApprovals()),yield Promise.all(e),t.loading=!1}))()},head:()=>({title:"Proposals"}),computed:A(A({},Object(l.c)("dao",["fund","proposals","approval_weight"])),{},{filterOptions(){var t=[{text:"All",value:"all"},{text:"Funded",value:"funded"},{text:"Upcoming",value:"upcoming"}];return this.$auth.loggedIn&&t.push({text:"Voted",value:"voted"}),t},computedProposals(){var t=this,e=this.proposals.map((p=>{var t=new Date(p.startDate).getTime(),e=new Date(p.endDate).getTime(),r=Object(c.a)(e,t);return A(A({},p),{},{startDateFormated:Object(d.a)(t,"PP"),endDateFormated:Object(d.a)(e,"PP"),startDateMs:t,endDateMs:e,duration:r,fundRequested:Object(m.i)(r*Number(p.amountPerDay),8),approvalWeight:Number(p.approvalWeight.$numberDecimal),started:Date.now()>t})}));if("all"!==this.filter&&(e=e.filter((e=>"voted"===t.filter?t.userApprovals.has(e._id):"funded"===t.filter?e.approvalWeight>t.fund.voteThreshold:"upcoming"!==t.filter||e.startDateMs>Date.now()))),""!==this.search){var text=this.search.toLowerCase();e=Number.isInteger(parseInt(text))?e.filter((t=>t._id===Number(text))):e.filter((t=>t.title.toLowerCase().includes(text)||t.creator.toLowerCase().includes(text)||t.authorPermlink.toLowerCase().includes(text)))}return e=e.sort(((a,b)=>"startDate"===t.sortBy?a.startDateMs-b.startDateMs:"endDate"===t.sortBy?a.endDateMs-b.endDateMs:b.approvalWeight-a.approvalWeight))},paginatedProposals(){return this.computedProposals.slice((this.currentPage-1)*this.perPage,this.currentPage*this.perPage)},userApprovals(){return new Map(this.approvals.map((a=>[a.to,a])))}}),watch:{"$auth.loggedIn":{handler(t){var e=this;return Object(n.a)((function*(){t?yield e.fetchUserApprovals():e.approvals=[]}))()}}},created(){this.query={active:!0,endDate:{$gt:(new Date).toISOString()}},this.$route.params.id&&!isNaN(Number(this.$route.params.id))&&(this.search=this.$route.params.id)},mounted(){this.$root.$on("bv::modal::show",this.onModalShow),this.$eventBus.$on(["dao-prop
1osal-creation-successful","dao-proposal-update-successful","dao-proposal-approve-successful","dao-proposal-disable-successful","dao-update-successful","dao-activation-successful"],this.requestValidateTransaction),this.$eventBus.$on("transaction-validated",this.$nuxt.refresh)},beforeDestroy(){this.$root.$off("bv::modal::show",this.onModalShow),this.$eventBus.$off(["dao-proposal-creation-successful","dao-proposal-update-successful","dao-proposal-approve-successful","dao-proposal-disable-successful","dao-update-successful","dao-activation-successful"],this.requestValidateTransaction),this.$eventBus.$off("transaction-validated",this.$nuxt.refresh)},methods:A(A(A(A({},Object(l.b)(["showConfirmation"])),Object(l.b)("dao",["fetchFund","fetchProposals","fetchApprovals","fetchProposalApprovals","fetchApprovalWeight","requestFundActivation","requestApproveProposal","requestDisableProposal"])),Object(l.b)("transaction",["validateTransaction"])),{},{formatNumumber:m.e,fetchUserApprovals(){var t=this;return Object(n.a)((function*(){var[e]=yield Promise.all([t.fetchApprovals({from:t.$auth.user.username}),t.fetchApprovalWeight()]);t.approvals=e}))()},disableProposal(t){var e=this;return Object(n.a)((function*(){try{yield e.showConfirmation({title:"Disable Proposal",message:"Are you sure you want to permanently disable the proposal #".concat(t,"?"),variant:"danger"}),e.requestDisableProposal(t)}catch(t){console.log(t)}}))()},requestValidateTransaction(data){var t=this;return Object(n.a)((function*(){t.loading=!0,yield t.validateTransaction(data.id)}))()},onModalShow(t,e){var r=this;return Object(n.a)((function*(){"proposalApproversModal"===e&&(r.approversLoading=!0,r.approvers=yield r.fetchProposalApprovals({id:r.selectedProposal._id,fundId:r.fund.id}),r.approversLoading=!1)}))()}})},E=r(1075),B=Object(P.a)(S,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"dtf"},[r("div",{staticClass:"page-header"},[r("b-container",[r("h2",[t._v("Proposals")]),t._v(" "),t.fund.active?t._e():r("div",{staticClass:"text-warning mt-3"},[t._v("\n        DAO is currenly inactive.\n      ")]),t._v(" "),t.$auth.loggedIn?r("div",{staticClass:"mt-3"},[t.fund.active?r("b-button",{attrs:{size:"sm",variant:"primary"},on:{click:function(e){return e.preventDefault(),t.$bvModal.show("createProposalModal")}}},[t._v("\n          Create Proposal\n        ")]):t._e(),t._v(" "),t.$auth.user.username===t.fund.creator?r("b-button",{attrs:{size:"sm",variant:"primary"},on:{click:function(e){return e.preventDefault(),t.$bvModal.show("updateFundModal")}}},[t._v("\n          Edit DAO\n        ")]):t._e(),t._v(" "),t.$auth.user.username===t.fund.creator?r("b-button",{attrs:{size:"sm",variant:t.fund.active?"danger":"success"},on:{click:function(e){return e.preventDefault(),t.requestFundActivation(!t.fund.active)}}},[t._v("\n          "+t._s(t.fund.active?"Deactivate":"Activate")+"\n        ")]):t._e()],1):t._e()])],1),t._v(" "),r("b-container",{attrs:{fluid:"lg"}},[r("b-form-row",[r("b-col",{staticClass:"text-center mt-3"},[r("b-card",{staticClass:"h-100"},[t._v("\n          Vote / Payment Token\n          "),r("div",{staticClass:"font-weight-bold"},[t._v("\n            "+t._s(t.fund.voteToken)+" / "+t._s(t.fund.payToken)+"\n          ")])])],1),t._v(" "),r("b-col",{staticClass:"text-center mt-3"},[r("b-card",{staticClass:"h-100"},[t._v("\n          Max Duration\n          "),r("div",{staticClass:"font-weight-bold"},[t._v("\n            "+t._s(t.fund.maxDays)+" days\n          ")])])],1),t._v(" "),r("b-col",{staticClass:"text-center mt-3"},[r("b-card",{staticClass:"h-100"},[t._v("\n          Max Payment Per Day\n          "),r("div",{staticClass:"font-weight-bold"},[t._v("\n            "+t._s(t.fund.maxAmountPerDay)+" "+t._s(t.fund.payToken)+"\n          ")])])],1),t._v(" "),r("b-col",{staticClass:"text-center mt-3"},[r("b-card",{staticClass:"h-100"},[t._v("\n          Vote Threshold\n          "),r("div",{staticClass:"font-weight-bold"},[t._v("\n            "+t._s(t.fund.voteThreshold)+" "+t._s(t.fund.voteToken)+"\n          ")])])],1),t._v(" "),t.$auth.loggedIn?r("b-col",{staticClass:"text-center mt-3"},[r("b-card",{staticClass:"h-100"},[t._v("\n          Your Vote Weight\n          "),r("div",{staticClass:"font-weight-bold"},[t._v("\n            "+t._s(t.approval_weight)+" "+t._s(t.fund.voteToken)+"\n          ")])])],1):t._e()],1),t._v(" "),r("b-form-row",[r("b-col",{staticClass:"mt-4",attrs:{md:"3"}},[r("b-input-group",{scopedSlots:t._u([{key:"append",fn:function(){return[r("b-button",{attrs:{title:"Refresh",variant:"primary"},on:{click:t.$fetch}},[r("fa-icon",{attrs:{icon:"sync"}})],1)]},proxy:!0}])},[r("b-form-input",{attrs:{placeholder:"Search..."}
1,model:{value:t.search,callback:function(e){t.search=e},expression:"search"}})],1)],1),t._v(" "),r("b-col",{staticClass:"mt-4 text-center",attrs:{md:"6"}},[r("b-form-radio-group",{attrs:{id:"btn-filters",options:t.filterOptions,name:"btn-filters","button-variant":"outline-primary",buttons:""},model:{value:t.filter,callback:function(e){t.filter=e},expression:"filter"}})],1),t._v(" "),r("b-col",{staticClass:"mt-4 text-center text-md-right",attrs:{md:"3"}},[r("b-form-select",{attrs:{options:t.sortOptions},model:{value:t.sortBy,callback:function(e){t.sortBy=e},expression:"sortBy"}})],1)],1),t._v(" "),t.loading?[r("loading")]:[t.paginatedProposals.length>0?[t._l(t.paginatedProposals,(function(e,i){return r("b-card",{key:i,staticClass:"mt-3"},[r("b-form-row",[r("b-col",{attrs:{sm:"9",md:"10"}},[r("div",{staticClass:"h5"},[r("a",{attrs:{href:t.$config.APP_DOMAIN+"/"+e.authorPermlink,target:"_blank"}},[t._v(t._s(e.title)+" "),r("span",{staticClass:"text-muted"},[t._v("#"+t._s(e._id))])]),t._v(" "),e.active?e.started?r("b-badge",{attrs:{variant:"outline-success"}},[t._v("\n                  Started\n                ")]):t._e():r("b-badge",{attrs:{variant:"warning"}},[t._v("\n                  Disabled\n                ")])],1),t._v(" "),r("div",{staticClass:"d-inline-flex"},[r("div",[t._v(t._s(e.startDateFormated)+" - "+t._s(e.endDateFormated)+" "),r("span",{staticClass:"text-muted"},[t._v("("+t._s(e.duration)+" days)")])]),t._v(" "),r("div",{staticClass:"ml-3"},[r("span",{staticClass:"font-weight-bold"},[t._v(t._s(t.formatNumumber(e.fundRequested))+" "+t._s(t.fund.payToken))]),t._v(" "),r("span",{staticClass:"text-muted"},[t._v("(Daily "+t._s(e.amountPerDay)+" "+t._s(t.fund.payToken)+")")])])])]),t._v(" "),r("b-col",{staticClass:"text-center mt-3 mt-sm-0",attrs:{sm:"3",md:"2"}},[r("div",{staticClass:"h5 mb-3"},[e.approvalWeight>0?r("span",{staticClass:"cursor-pointer",on:{click:function(r){r.preventDefault(),t.selectedProposal=e,t.$bvModal.show("proposalApproversModal")}}},[t._v(t._s(t.formatNumumber(e.approvalWeight))+" "+t._s(t.fund.voteToken))]):r("span",[t._v(t._s(t.formatNumumber(e.approvalWeight))+" "+t._s(t.fund.voteToken))])]),t._v(" "),t.userApprovals.has(e._id)?r("b-button",{staticClass:"mt-1",attrs:{size:"sm",variant:"warning"},on:{click:function(r){return r.preventDefault(),t.requestApproveProposal({id:e._id,approve:!1})}}},[t._v("\n                Unvote\n              ")]):r("b-button",{staticClass:"mt-1",attrs:{disabled:!t.$auth.loggedIn,size:"sm",variant:"primary"},on:{click:function(r){return r.preventDefault(),t.requestApproveProposal({id:e._id,approve:!0})}}},[t._v("\n                Vote\n              ")]),t._v(" "),t.$auth.loggedIn&&e.creator===t.$auth.user.username?[r("b-button",{staticClass:"mt-1",attrs:{disabled:!t.fund.active,size:"sm",variant:"info"},on:{click:function(r){r.preventDefault(),t.selectedProposal=e,t.$bvModal.show("updateProposalModal")}}},[t._v("\n                  Edit\n                ")]),t._v(" "),e.active?r("b-button",{staticClass:"mt-1",attrs:{size:"sm",variant:"danger"},on:{click:function(r){return r.preventDefault(),t.disableProposal(e._id)}}},[t._v("\n                  Disable\n                ")]):t._e()]:t._e()],2),t._v(" "),r("b-col",{attrs:{cols:"12"}},[r("div",{staticClass:"d-inline-flex align-items-center mt-2"},[r("b-avatar",{attrs:{variant:"dark",size:"30px",src:"https://images.hive.blog/u/"+e.creator+"/avatar"}}),t._v(" "),r("div",{staticClass:"ml-2"},[t._v("\n                  by "),r("nuxt-link",{attrs:{to:{name:"user",params:{user:e.creator}},target:"_blank"}},[t._v("\n                    "+t._s(e.creator)+"\n                  ")])],1),t._v(" "),e.creator!==e.payout.name?r("div",{staticClass:"ml-2"},[t._v("\n                  for "),"user"===e.payout.type?r("nuxt-link",{attrs:{to:{name:"user",params:{user:e.payout.name}},target:"_blank"}},[t._v("\n                    "+t._s(e.payout.name)+"\n                  ")]):r("span",[t._v(t._s(e.payout.name)+" contract")])],1):t._e()],1)])],1)],1)})),t._v(" "),t.computedProposals.length>t.perPage?r("b-pagination",{staticClass:"mt-5",attrs:{align:"center","total-rows":t.computedProposals.length,"per-page":t.perPage},model:{value:t.currentPage,callback:function(e){t.currentPage=e},expression:"currentPage"}}):t._e()]:r("b-card",{staticClass:"mt-3"},[t._v("\n        No proposal has been found!\n      ")])]],2),t._v(" "),r("b-modal",{attrs:{id:"proposalApproversModal",centered:"",scrollable:"",size:"lg","hide-footer":"",title:"Accounts Approved Proposal #"+t.selectedProposal._id}},[t.approversLoading?[r("div",{staticClass:"text-center d-flex justify-content-center align-items-center flex-column"},[r("b-spinner",{staticClass:"align-middle",attrs:{type:"grow"}}),t._v(" "),r("br"),t._v(" "),r("p",{staticClass:"mt-3 mb-0"},[t._v("\n          Loading...\n        ")])],1)]:[r("b-row",t._l(t.approvers,(function(e,i){return r("b-col",{key:i,staticClass:"mb-4",attrs:{md:"6",lg:"4"}},[r("b-media",{scopedSlots:t._u([{key:"aside",fn:function(){return[r("b-avatar",{attrs:{variant:"dark",src:"https://images.hive.blog/u/"+e.account+"/avatar",rounded:"circle",size:"40px"}})]},proxy:!0}],null,!0)},[t._v(" "),r("h6",{staticClass:"mt-0 mb-1"},[t._v("\n              "+t._s(e.account)+"\n            ")]),t._v(" "),r("p",{staticClass:"mb-0 text-muted"}
1,[t._v("\n              "+t._s(e.approvalWeight.toLocaleString())+" "+t._s(e.symbol)+"\n            ")])])],1)})),1)]],2),t._v(" "),r("create-proposal"),t._v(" "),r("update-fund"),t._v(" "),r("update-proposal",{attrs:{proposal:t.selectedProposal}})],1)}),[],!1,null,null,null);"function"==typeof E.default&&Object(E.default)(B);e.default=B.exports},888:function(t,e){}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.