PageSourceSearch

https://mdxalgo.com/build/assets/Show.2d89825f.js

js mdxalgo.com collected 2026-10-05 21:33:35 UTC 7,055 bytes, 1 lines download raw bytes

1import{A as l}from"./AppLayout.903b227d.js";import{A as n}from"./AdminPageHeader.1d9ed9e3.js";import{D as c}from"./DataTable.8fd43ebc.js";import{G as m}from"./GhostButton.be455fab.js";import{P as d}from"./Pagination.c14d6316.js";import{_ as a}from"./lodash_throttle.abfcc1b6.js";import{_ as o}from"./lodash_pickBy.4cd42a33.js";import{n as f}from"./plugin-vue2_normalizer.000ba15c.js";import"./laravel-vite-plugin_inertia-helpers.9c4f003d.js";import"./vuex.9a713e87.js";import"./AnimatedParagraph.898882e0.js";import"./featureSlugs.b4bb1dc1.js";import"./Tooltip.37f2b546.js";import"./btc.38c7b727.js";import"./PrimaryButton.4ea37368.js";import"./Logo.d79c0716.js";import"./mdx.21cb3b8e.js";import"./socketService.5b6e8b75.js";import"./chunk-7TXMVMS6.80c94c5e.js";import"./Modal.55f10e39.js";import"./SignupAndPayModal.865fe969.js";import"./SignupAndPay.846aea00.js";import"./TextInput.accc894b.js";import"./Checkbox.76dac451.js";import"./lodash_flatMap.c1aa4c3b.js";import"./chunk-EQKERSRP.6ba6c6f9.js";import"./2.543b16fc.js";import"./DialogModal.9bec62c6.js";import"./chunk-DWP7GWWG.613ecf25.js";const u=a.__esModule?a.default:a,p=o.__esModule?o.default:o,_={name:"AdminReferralDashboardShow",components:{AppLayout:l,AdminPageHeader:n,DataTable:c,GhostButton:m,Pagination:d},props:{referrer:{type:Object,required:!0},referred:{type:Object,required:!0},filters:{type:Object,default:()=>({})}},data(){return{form:{search:this.filters.search||""},columns:[{key:"user",label:"USER",slot:"user"},{key:"subscribed",label:"STATUS",slot:"subscribed"},{key:"created_at",label:"SIGNED UP",slot:"created_at"}]}},computed:{statCards(){var s,e,t,r,i;return[{label:"Clicks",value:(s=this.referrer.ref_clicks)!=null?s:0},{label:"Signups",value:(e=this.referrer.referrals_count)!=null?e:0},{label:"Active subs",value:(t=this.referrer.active_subscribed_count)!=null?t:0},{label:"All subs",value:(r=this.referrer.subscribed_count)!=null?r:0},{label:"Commission",value:((i=this.referrer.commission_rate)!=null?i:0)+"%"},{label:"Pending",value:this.formatCurrency(this.referrer.ref_pending)},{label:"Paid",value:this.formatCurrency(this.referrer.ref_paid)}]}},watch:{form:{handler:u(function(){this.fetchResults()},150),deep:!0}},methods:{fetchResults(s){const e=p(this.form);s&&(e.page=s),this.$inertia.get(this.route("admin.referral-dashboard.show",{user:this.referrer.id,...e}),{},{preserveState:!0,replace:!0})},handlePageChange(s){this.fetchResults(s)},formatDate(s){return s?this.$moment?this.$moment(s).format("MMM D, YYYY"):s:"\u2014"},formatCurrency(s){return"$"+(Number(s)||0).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})},copyCode(s){const e=(t,r)=>{this.$notify({group:"notifications",text:t,type:r})};if(this.$copyText){this.$copyText(s).then(()=>e("Referral code copied","success"),()=>e("Could not copy referral code","error"));return}navigator.clipboard&&navigator.clipboard.writeText&&navigator.clipboard.writeText(s).then(()=>e("Referral code copied","success"),()=>e("Could not copy referral code","error"))}}};var b=function(){var e=this,t=e._self._c;return t("app-layout",{attrs:{boxed:!1}},[t("div",{staticClass:"h-[calc(100dvh-130px)] grid grid-rows-[auto_auto_auto_1fr_auto] overflow-hidden"},[t("div",{staticClass:"mb-3"},[t("AdminPageHeader",{attrs:{title:"Referral code",subtitle:e.referrer.affiliate_id,"back-link":e.route("admin.referral-dashboard"),"back-title":"Back to dashboard","user-email":e.referrer.email}})],1),t("div",{staticClass:"flex items-center gap-3 mb-4"},[t("img",{staticClass:"w-12 h-12 rounded-full object-cover",attrs:{src:e.referrer.profile_photo_url,alt:e.referrer.name}}),t("div",{staticClass:"flex-1"},[t("p",{staticClass:"text-gray-900 font-semibold"},[e._v(" "+e._s(e.referrer.name)+" ")]),t("p",{staticClass:"text-sm text-gray-600"},[e._v(e._s(e.referrer.email))])]),t("button",{staticClass:"font-mono text-sm px-3 py-1.5 rounded border border-gray-500 text-primary-500 hover:bg-gray-200",attrs:{type:"button"},on:{click:function(r){return e.copyCode(e.referrer.affiliate_id)}}},[e._v(" "+e._s(e.referrer.affiliate_id)+" ")])]),t("div",{staticClass:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-2 mb-4"},e._l(e.statCards,function(r){return t("div",{key:r.label,staticClass:"bg-gray-200 rounded-md px-3 py-2"},[t("p",{staticClass:"text-xs text-gray-700"},[e._v(e._s(r.label))]),t("p",{staticClass:"text-lg font-semibold text-gray-900"},[e._v(" "+e._s(r.value)+" ")])])}),0),t("div",{staticClass:"flex flex-col sm:flex-row items-stretch sm:items-end gap-2 sm:gap-3 mb-4"},[t("div",{staticClass:"flex-1"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.form.search,expression:"form.search"}],staticClass:"w-full px-3 py-2 text-sm rounded border border-gray-500 bg-gray-100 text-gray-900 placeholder-gray-600 focus:outline-none focus:ring-primary-500 focus:border-primary-500",attrs:{type:"text",placeholder:"Search referred users by name or email..."},domProps:{value:e.form.search},on:{input:function(r){r.target.composing||e.$set(e.form,"search",r.target.value)}}})]),t("GhostButton",{attrs:{size:"small"},nativeOn:{click:function(r){e.form.search=""}}},[e._v(" Reset ")])],1),t("div",{staticClass:"overflow-auto min-h-0"},[t("DataTable",{attrs:{data:e.referred.data,columns:e.columns,"sticky-header":"","hover-effect":"","empty-message":"No referred users found."},scopedSlots:e._u([{key:"cell-user",fn:function({row:r}){return[t("inertia-link",{staticClass:"flex items-center gap-2",attrs:{href:e.route("admin.users.show",r.id)}},[t("img",{staticClass:"w-8 h-8 rounded-full object-cover",attrs:{src:r.profile_photo_url,alt:r.name}}),t("div",[t("p",{staticClass:"text-blue-700 font-semibold"},[e._v(" "+e._s(r.name)+" ")]),t("p",{staticClass:"text-sm text-gray-600"},[e._v(" "+e._s(r.email)+" ")])])])]}},{key:"cell-subscribed",fn:function({row:r}){return[t("span",{staticClass:"text-sm font-semibold",class:r.paying_monthly?"text-green-500":r.subscribed?"text-yellow-500":"text-gray-600"},[e._v(" "+e._s(r.paying_monthly?"Active monthly":r.subscribed?"Access only":"Not subscribed")+" ")])]}},{key:"cell-created_at",fn:function({row:r}){return[t("span",{staticClass:"text-sm text-gray-700"},[e._v(e._s(e.formatDate(r.created_at)))])]}}])})],1),t("div",{staticClass:"flex flex-col sm:flex-row items-center justify-between bg-black rounded-b border-t border-gray-700 px-1 sm:px-2 py-1 sm:py-0 sticky bottom-0 z-10 gap-1 sm:gap-0"},[t("div",{staticClass:"w-full sm:w-auto text-center sm:text-left"},[t("div",{staticClass:"text-gray-700 py-1 text-sm sm:text-[15px]"},[e._v(" Showing "+e._s(e.referred.from||0)+" to "+e._s(e.referred.to||0)+" of "+e._s(e.referred.total||0)+" entr
1ies ")])]),t("div",{staticClass:"w-full sm:w-auto py-1"},[t("pagination",{attrs:{data:e.referred,limit:2},on:{"pagination-change-page":e.handlePageChange}},[t("span",{attrs:{slot:"prev-nav"},slot:"prev-nav"},[e._v("< Previous")]),t("span",{attrs:{slot:"next-nav"},slot:"next-nav"},[e._v("Next >")])])],1)])])])},h=[],g=f(_,b,h,!1,null,null,null,null);const K=g.exports;export{K as default};

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.