/
var
/
www
/
barefootlaw.org
/
wp-content
/
plugins
/
userfeedback-lite
/
assets
/
vue
/
js
/
Upload File
HOME
(function(e){function t(t){for(var s,i,o=t[0],d=t[1],l=t[2],c=0,h=[];c<o.length;c++)i=o[c],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&h.push(r[i][0]),r[i]=0;for(s in d)Object.prototype.hasOwnProperty.call(d,s)&&(e[s]=d[s]);u&&u(t);while(h.length)h.shift()();return n.push.apply(n,l||[]),a()}function a(){for(var e,t=0;t<n.length;t++){for(var a=n[t],s=!0,o=1;o<a.length;o++){var d=a[o];0!==r[d]&&(s=!1)}s&&(n.splice(t--,1),e=i(i.s=a[0]))}return e}var s={},r={"dashboard-widget":0},n=[];function i(t){if(s[t])return s[t].exports;var a=s[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=s,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(a,s,function(t){return e[t]}.bind(null,s));return a},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var o=window["webpackJsonp"]=window["webpackJsonp"]||[],d=o.push.bind(o);o.push=t,o=o.slice();for(var l=0;l<o.length;l++)t(o[l]);var u=d;n.push([1,"chunk-vendors","chunk-common"]),a()})({1:function(e,t,a){e.exports=a("2d7b")},"2d7b":function(e,t,a){"use strict";a.r(t);var s=a("a026"),r=(a("41a0"),a("918d")),n=function(){var e=this,t=e._self._c;return e.widgetData?t("section",{staticClass:"userfeedback-dashboard-widget"},[t("section",{staticClass:"userfeedback-dashboard-widget__chart"},[t("h4",{staticClass:"userfeedback-dashboard-widget__title"},[e._v(e._s(e.texts.totalEntries))]),t("line-chart",{attrs:{"chart-data":e.chartData,options:e.chartOptions}})],1),t("section",{staticClass:"userfeedback-dashboard-widget__heading"},[t("div",{staticClass:"userfeedback-dashboard-widget__heading-start"},[t("h4",{staticClass:"userfeedback-dashboard-widget__title"},[e._v(e._s(e.texts.totalEntriesBySurvey))])]),t("div",{staticClass:"userfeedback-dashboard-widget__heading-end"},[t("div",{staticClass:"select"},[t("select",{directives:[{name:"model",rawName:"v-model",value:e.currentRangeId,expression:"currentRangeId"}],attrs:{name:"dashboard-range",id:"dashboard-range"},on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.currentRangeId=t.target.multiple?a:a[0]}}},e._l(e.availableRanges,(function(a){return t("option",{key:a.value,domProps:{value:a.value}},[e._v(e._s(a.label))])})),0)])])]),t("user-feedback-dashboard-widget-surveys",{attrs:{surveys:e.widgetData.surveys}})],1):e._e()},i=[],o=(a("14d9"),a("561c")),d=a("2abc"),l=a("9ea0"),u=a("33e7"),c=function(){var e=this,t=e._self._c;return t("section",{staticClass:"userfeedback-dashboard-widget-surveys"},[t("section",{staticClass:"userfeedback-dashboard-widget-surveys__list"},e._l(e.displayedSurveys,(function(a){return t("article",{key:a.id,staticClass:"userfeedback-dashboard-widget-survey-item"},[t("h6",{staticClass:"userfeedback-dashboard-widget-survey-item__title"},[e._v(e._s(a.title))]),t("div",{staticClass:"userfeedback-dashboard-widget-survey-item__info"},[t("a",{attrs:{href:e.getSurveyResultsLink(a.id)}},[e._v(e._s(a.range_responses_count))]),t("span",{directives:[{name:"icon",rawName:"v-icon:graph-lines",arg:"graph-lines"}]})])])})),0),t("button",{staticClass:"userfeedback-dashboard-widget-surveys__toggle",class:{"is-open":e.showAll},attrs:{type:"button"},on:{click:e.toggleAll}},[t("span",[e._v(e._s(e.toggleLabel))]),t("span",{directives:[{name:"icon",rawName:"v-icon:arrow-down",arg:"arrow-down"}]})])])},h=[],b=a("a878"),g={name:"UserFeedbackDashboardWidgetSurveys",props:{surveys:{type:Array,required:!0}},data(){return{showAll:!1}},computed:{displayedSurveys(){if(this.showAll)return this.surveys;const e=[...this.surveys];return e.slice(0,5)},texts(){return{showMore:Object(o["a"])("Show More",this.$textDomain),showLess:Object(o["a"])("Show Less",this.$textDomain)}},toggleLabel(){return this.showAll?this.texts.showLess:this.texts.showMore}},methods:{toggleAll(){this.showAll=!this.showAll},getSurveyResultsLink(e){return Object(b["a"])("results","survey/"+e)}}},p=g,v=a("2877"),f=Object(v["a"])(p,c,h,!1,null,null,null),w=f.exports,y={name:"UserFeedbackDashboardWidget",components:{LineChart:u["a"],UserFeedbackDashboardWidgetSurveys:w},data(){return{currentRangeId:"",isLoading:!1,widgetData:null}},computed:{texts(){return{totalEntries:Object(o["a"])("Total Entries",this.$textDomain),totalEntriesBySurvey:Object(o["a"])("Total Entries by Survey",this.$textDomain),responses:Object(o["a"])("Responses",this.$textDomain)}},availableRanges(){const e=new Date,t=new Date;t.setDate(e.getDate()-7);const a=new Date;a.setDate(e.getDate()-30);const s=[{startDate:Object(d["a"])(t),endDate:Object(d["a"])(e),label:Object(o["a"])("Last 7 Days",this.$textDomain),value:"7-days"}];return this.$uf.is_pro&&this.$uf.is_licensed&&s.push({startDate:Object(d["a"])(a),endDate:Object(d["a"])(e),label:Object(o["a"])("Last 30 Days",this.$textDomain),value:"30-days"}),s},currentRange(){const e=this.availableRanges.find(e=>e.value===this.currentRangeId);if(e){const{startDate:t,endDate:a}=e;return{start_date:t,end_date:a}}return null},chartData(){const e=this.widgetData.data_points,t=[],a=[];for(const s of e){const{count:e,date:r}=s,n=new Date(r).getDate();t.push(e),a.push(n)}return{datasets:[{data:t}],labels:a}},chartOptions(){return{plugins:{tooltip:{callbacks:{title:e=>{const t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=e[0].dataIndex,s=this.widgetData.data_points,r=new Date(s[a].date),n=r.getDate()+" "+t[r.getMonth()]+" "+r.getFullYear();return this.$getLocalizedDate(n)},label:function(e){let t=e.dataset.label||e.parsed.y;return t=Object(o["d"])(Object(o["b"])("%s Response","%s Responses",Number.parseInt(t),this.$textDomain),t),t}}}}}}},methods:{async fetchData(){const e={...this.currentRange};this.widgetData=await Object(l["a"])(e)}},beforeMount(){this.currentRangeId=this.availableRanges[0].value},watch:{currentRangeId(){this.fetchData()}}},_=y,m=Object(v["a"])(_,n,i,!1,null,null,null),D=m.exports;(()=>{const e=document.getElementById("userfeedback-dashboard-widget");e&&(s["a"].use(r["a"]),new s["a"]({render:e=>e(D)}).$mount(e))})()},"41a0":function(e,t,a){}});