PageSourceSearch

https://www.artcore.com/_next/static/chunks/6134.403925b01cd960de.js

js artcore.com collected 2026-10-01 15:16:46 UTC 14,452 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6134],{10779:(e,r,a)=>{a.d(r,{F:()=>s});var t=a(37876),l=a(55006);function s(){return(0,t.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2 text-neutral-400",children:[(0,t.jsx)(l.A,{size:24}),"Loading.."]})}a(14232)},16134:(e,r,a)=>{a.r(r),a.d(r,{SalesPanel:()=>$});var t=a(37876),l=a(61875),s=a(75656),i=a(26861),d=a(32846),n=a(24243),o=a(14232),c=a(71134),u=a(10779);function m({sellerId:e}){let[r,a]=(0,o.useState)({page:0,pageSize:50}),l=e?`/api/edit/seller/sales?sellerId=${e}&page=${r.page}&pageSize=${r.pageSize}`:null,h=e=>fetch(e).then(e=>e.json()),{data:p,isLoading:x}=(0,s.Ay)(l,h),y=p?.items??[],_=p?.totalCount??0,v=(0,o.useMemo)(()=>y.map(e=>e.latest_purchase_item_id).filter(Boolean),[y]),j=(0,o.useMemo)(()=>y.map(e=>e.product_id).filter(Boolean),[y]),f=e&&(v.length||j.length)?`/api/edit/seller/sales_allocations?sellerId=${e}`+(v.length?`&purchaseItemIds=${v.join(",")}`:"")+(j.length?`&productIds=${j.join(",")}`:""):null,{data:w}=(0,s.Ay)(f,h),b=(e,r)=>(0,c.$g)(e?.toString(),r.royalty_seller_currency),N=[{field:"title",headerName:"Title",width:200,type:"string"},{field:"product_id",headerName:"Id",width:60,type:"string"},{field:"artists_json",headerName:"Artist(s)",width:100},{field:"unit_price",headerName:"Price",width:80,type:"number",valueFormatter:b},{field:"sales",headerName:"Sales",width:30},{field:"total",headerName:"Total",width:100,type:"number",valueFormatter:b},{field:"royalty_converted_amount",headerName:"Your Share",width:100,type:"number",valueFormatter:b},{field:"expense_deducted",headerName:"Exp.Deduct",width:100,type:"number",valueFormatter:b},{field:"expenses_recouped",headerName:"Exp.Recoup %",width:100,type:"number",valueFormatter:(e,r)=>{let a,t=(a=r?.allocations,a?.expenses?Object.entries(a?.expenses).map(e=>[e[0],e[1][r.royalty_seller_id]?.expense]):[]),l=(Array.isArray(r.expenses_recouped)?r.expenses_recouped:[]).filter(e=>e.seller_id==r.royalty_seller_id).map(e=>{let r=t.find(r=>r[0]==e.track_id);return r?[e.track_id,e.expense_amount,r[1]]:void 0}).filter(e=>e)||[],s=0,i=0;for(let e of l)s+=parseFloat(e[1]),i+=parseFloat(e[2]);if(!w&&(v.length||j.length))return"…";if(!i)return"-";{let e=0==i?100:Math.min((0,c.yp)(s/i*100),100);return`${e}%`}}},{field:"paid",headerName:"Paid Out",width:100,type:"number",valueFormatter:b},{field:"outstanding",headerName:"Outstanding",width:100,type:"number",valueFormatter:b,cellClassName:e=>e&&e.value>0?" text-brand ":" "},{field:"held",headerName:"Held",width:60,type:"number",valueFormatter:b,cellClassName:e=>e&&e.value>0?" text-red-500 ":" "},{field:"earliest_sale_date",headerName:"First Sale",width:100},{field:"latest_sale_date",headerName:"Latest Sale",width:100}],g=y.map(e=>{let r=e.latest_purchase_item_id;return{...e,id:`${e.product_id}-${e.royalty_seller_currency}-${e.unit_price}`,title:e._full_title,artists_json:(Array.isArray(e.artists_json)?e.artists_json:[]).map(e=>e?.name).filter(Boolean).join(", "),earliest_sale_date:(0,c.XV)(e.earliest_sale_date),latest_sale_date:(0,c.XV)(e.latest_sale_date),allocations:null!=r?w?.allocations?.[r]??null:null,expenses_recouped:w?.expensesRecouped?.[e.product_id]??e.expenses_recouped??null}});return(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:" ",style:{height:400,width:"100%"},children:(0,t.jsx)(n.A,{theme:(0,d.O)(),children:(0,t.jsx)(i.z,{rows:g,rowCount:_,loading:x,paginationMode:"server",paginationModel:r,onPaginationModelChange:a,slots:{loadingOverlay:u.F},columns:N,pageSizeOptions:[20,50,100],checkboxSelection:!0,style:{border:0,fontSize:"0.8em"},sx:{"& .MuiDataGrid-columnHeaderTitle":{textOverflow:"clip",lineHeight:1},"& .MuiDataGrid-cell":{color:"#ccc",borderColor:"rgb(38,38,38)"},"& .MuiDataGrid-columnHeaders":{color:"#999",borderColor:"rgb(38,38,38)"},"& .MuiDataGrid-footerContainer":{borderColor:"rgb(38,38,38)"}}})})})})}var h=a(73507);let p=(e,r)=>(0,c.$g)(e?.toString(),r.seller_currency),x=(e,r)=>(0,c.$g)(e?.toString(),r.royalty_seller_currency),y=(e,r)=>`${(0,c.$g)(r.converted_sale_amount,r.seller_currency)} (${(0,c.$g)(e?.toString(),r.cust_currency)})`,_=e=>(0,t.jsxs)("div",{children:[(0,c.XV)(e.row.created_date),(0,t.jsx)("div",{children:e.row.id})]});function v({sellerId:e}){let[r,a]=(0,o.useState)({page:0,pageSize:50}),l=e?`/api/edit/seller/sales_breakdown?sellerId=${e}&page=${r.page}&pageSize=${r.pageSize}`:null,{data:m,isLoading:j}=(0,s.Ay)(l,e=>fetch(e).then(e=>e.json())),f=m?.items??[],w=m?.totalCount??0,b=[{field:"created_date",headerName:"Date",width:90,renderCell:_},{field:"_full_title",headerName:"Title",width:140,renderCell:e=>e.value},{field:"product_price",headerName:"Price",width:70,type:"number",valueFormatter:p},{field:"discount_amount",headerName:"Discount",width:80,type:"number",valueFormatter:p}
1,{field:"final_price",headerName:"Sold Price",width:100,type:"number",valueFormatter:y},{field:"commission",headerName:"Rev Shr",width:60,type:"number",valueFormatter:p},{field:"seller_transaction_price",headerName:"PP Fee",width:60,type:"number",valueFormatter:p},{field:"net_to_pay",headerName:"Net",width:70,type:"number",valueFormatter:p},{field:"royalty",headerName:"Your cut",width:100},{field:"deduction",headerName:"Expense Deduct",width:60,type:"number",valueFormatter:p},{field:"expense_recoup",headerName:"Expense Recoup",width:60,type:"number",valueFormatter:p},{field:"royaltiesExtended",headerName:"Split",width:60,renderCell:e=>{let{royalties:r,currency:a}=e.value;return(0,t.jsx)(t.Fragment,{children:r&&r.length>1?(0,t.jsx)("div",{className:"cursor-pointer",children:(0,t.jsx)(h.A,{title:(0,t.jsx)("div",{children:r.map(e=>(0,t.jsxs)("div",{className:"flex flex-row gap-4 text-xs",children:[(0,t.jsx)("div",{className:"flex-grow",children:e.name}),(0,t.jsx)("div",{children:(0,c.$g)(e.amount,a)}),(0,t.jsxs)("div",{children:["(",e.share_of_net,"%)"]})]},e.id))}),className:"",children:(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:"underline text-xs",children:`${r.length} ways`})})})}):(0,t.jsx)("div",{children:"-"})})}},{field:"converted_payable",headerName:"To Pay",width:70,type:"number",valueFormatter:x},{field:"royalty_seller_paid",headerName:"Paid",width:50},{field:"cust_country",headerName:"Cust",width:80}],N=(0,o.useMemo)(()=>f.map(e=>{let r=(Array.isArray(e.artists_json)?e.artists_json:[]).map(e=>e?.name).filter(Boolean).join(", ");return{...e,cust_currency:e.cust_currency?.toUpperCase(),seller_currency:e.seller_currency?.toUpperCase(),royalty_seller_currency:e.royalty_seller_currency?.toUpperCase(),royalty:`${(0,c.$g)(e.royalty_converted_amount,e.seller_currency)} (${Math.round(e.royalty_share_of_net)}%)`,cust_country:`${e.cust_country}/${e.cust_currency}`,_full_title:(0,t.jsxs)("div",{children:[e._full_title,(0,t.jsx)("div",{}),r]}),artists_json:r,royalty_seller_paid:e.royalty_seller_paid?"Yes":"-",royaltiesExtended:{royalties:e.royalties,currency:e.seller_currency},id:e.royalty_id}}),[f]);return(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:"",style:{height:800,width:"100%"},children:(0,t.jsx)(n.A,{theme:(0,d.O)(),children:(0,t.jsx)(i.z,{rows:N,rowCount:w,loading:j,paginationMode:"server",paginationModel:r,onPaginationModelChange:a,slots:{loadingOverlay:u.F},columns:b,pageSizeOptions:[20,50,100],checkboxSelection:!0,initialState:{sorting:{sortModel:[{field:"id",sort:"desc"}]}},style:{border:0,fontSize:"0.8em"},sx:{"& .MuiDataGrid-columnHeaderTitle":{textOverflow:"clip",whiteSpace:"break-spaces",lineHeight:1},"& .MuiDataGrid-cell":{color:"#ccc",borderColor:"rgb(38,38,38)"},"& .MuiDataGrid-columnHeaders":{color:"#999",borderColor:"rgb(38,38,38)"},"& .MuiDataGrid-footerContainer":{borderColor:"rgb(38,38,38)"}}})})})})}var j=a(19512),f=a(48230),w=a.n(f);function b({payoutsList:e}){return(0,t.jsxs)("div",{className:"bg-neutral-900 rounded-md",children:[(0,t.jsxs)("div",{className:"flex flex-row p-2 text-neutral-500 font-semibold gap-2 border-b-[1px] border-neutral-800 text-sm  child:truncate",children:[(0,t.jsx)("div",{className:"w-2/12",children:"Date"}),(0,t.jsx)("div",{className:"w-1/12",children:"Sales"}),(0,t.jsx)("div",{className:"w-1/12",children:"Currency"}),(0,t.jsx)("div",{className:"w-1/12",children:"Net Pay"}),(0,t.jsx)("div",{className:"w-1/12",children:"PP Payout Fee"}),(0,t.jsx)("div",{className:"w-1/12",children:"Payable"}),(0,t.jsx)("div",{className:"w-2/12",children:"Approval"}),(0,t.jsx)("div",{className:"w-2/12",children:"Paid"}),(0,t.jsx)("div",{className:"w-2/12",children:"Status"})]}),e?.sort(function(e,r){return e.created_date<r.created_date?-1:+(e.created_date>r.created_date)}).reverse().map(e=>(0,t.jsxs)("div",{className:"flex p-2 flex-row gap-2 text-xs ",children:[(0,t.jsx)("div",{className:"w-2/12",children:(0,c.iC)(e.created_date)}),(0,t.jsx)("div",{className:"w-1/12",children:e.items?.length}),(0,t.jsx)("div",{className:"w-1/12 uppercase",children:e.currency}),(0,t.jsx)("div",{className:"w-1/12",children:(0,c.$g)(e.net_amount,e.currency)}),(0,t.jsx)("div",{className:"w-1/12",children:(0,c.$g)(e.seller_payout_fee,e.currency)}),(0,t.jsx)("div",{className:"w-1/12",children:(0,c.$g)(e.seller_payout_amount,e.currency)}),(0,t.jsxs)("div",{className:"w-2/12",children:[e.requires_approval?"Required":"Not Required",e.requires_approval?e.approved?" - Approved":" - Waiting":"-"]}),(0,t.jsx)("div",{className:"w-2/12",children:e.seller_paid?(0,t.jsxs)("span",{children:["Yes ",(0,t.jsx)("span",{className:"text-neutral-400 text-xs",children:e.paid_date?(0,c.XV)(e.paid_date):""})]}):"-"}),(0,t.jsx)("div",{className:"w-2/12",children:e.processor_status})]},e.id))]})}var N=a(92306),g=a(68812);function $({sellerId:e,seller:r}){let a=e?`/api/edit/seller/manage_sales?sellerId=${e}`:void 0,{data:i,mutate:d}=(0,s.Ay)(a,(0,N.we)()),[n,u]=(0,o.useState)("overview"),[h,p]=(0,o.useState)("requested"),x=i?.outstandingPayments??[],y=i?.payouts?.filter(e=>e.seller_paid)??[],_=i?.payouts?.filter(e=>!e.seller_paid)??[],f=r?(0,c.CC)(r):null,S=x.length>0;async function C(r){if(confirm(`Are you sure you would like to request a payout for sales in ${r}`))try{await fetch("/api/edit/seller/request_payout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sellerId:e,currency:r})}).then(e=>e.json()),d(),alert("Payout requested. It should be visible in your payout list below.")}catch(e){alert("Payout request failed")}}return(0,t.jsxs)("div",{className:"mt-6 space-y-8",children:[(0,t.jsxs)("section",{children:[(0,t.jsxs)("div",{className:"mb-3 flex flex-row flex-wrap items-end justify-between gap-3",children:[(0,t.jsx)(l.Pz,{className:"mt-0 mb-0",children:"Sales"}),(0,t.jsx)("a",{className:"text-sm text-brand hover:underline",href:`/api/edit/report/sales?sellerId=${e}`,children:"Download sales report"})]}),(0,t.jsx)(g.e,{ariaLabel:"Sales views",tabs:[{id:"overview",label:"Overview"},{id:"breakdown",label:"Breakdown"}],value:n,onChange:u}),(0,t.jsxs)("div",{className:"overflow-hidden rounded-md bg-neutral-900",children:[e&&"overview"===n?(0,t.jsx)(m,{sellerId:e}):null,e&&"breakdown"===n?(0,t.jsx)(v,{sellerId:e}):null]})]}),(0,t.jsxs)("section",{className:`text-sm ${S?"text-neutral-300":"text-neutral-500"}`,children:[(0,t.jsx)(l.Pz,{className:"mt-0 mb-0",textColour:S?"text-neutral-300":"text-neutral-500",children:"Pending payouts"}),(0,t.jsxs)("div",{className:"mt-3 overflow-hidden rounded-md bg-neutral-900",children:[(0,t.jsxs)("div",{className:"flex flex-row gap-2 border-b border-neutral-800 p-2 font-semibold text-neutral-500 child:truncate",children:[(0,t.jsx)("div",{className:"w-2/12",children:"Date"}),(0,t.jsx)("div",{className:"w-1/12",children:"Sales"}),(0,t.jsx)("div",{className:"w-1/12",children:"Currency"}),(0,t.jsx)("div",{className:"w-1/12",children:"Net"}),(0,t.jsx)("div",{className:"w-1/12",children:"PayoutFee"}),(0,t.jsx)("div",{className:"w-1/12",children:"Payout"}),(0,t.jsx)("div",{className:"w-3/12",children:"Action"})]}),S?x.map(e=>(0,t.jsxs)("div",{className:"flex flex-row items-center gap-2 border-b border-neutral-800/70 p-2 last:border-b-0",children:[(0,t.jsx)("div",{className:"w-2/12",children:(0,c.XV)(e.since_date)}),(0,t.jsx)("div",{className:"w-1/12",children:e.sales}),(0,t.jsx)("div",{className:"w-1/12 uppercase",children:e.royalty_seller_currency}),(0,t.jsx)("div",{className:"w-1/12",children:(0,c.$g)(e.net_to_pay,e.royalty_seller_currency)}),(0,t.jsx)("div",{className:"w-1/12",children:(0,c.$g)(e.payoutFee,e.royalty_seller_currency)}),(0,t.jsx)("div",{className:"w-1/12",children:(0,c.$g)(e.payoutAmount,e.royalty_seller_currency)}),(0,t.jsx)("div",{className:"w-3/12",children:r?.paypal_email?(0,t.jsx)(j.A,{size:"small",onClick:()=>C(e.royalty_seller_currency),children:"Request Payout"}):(0,t.jsx)(w(),{className:"text-brand",href:f||"",children:"Set your paypal address"})})]},e.royalty_seller_currency)):(0,t.jsx)("div",{className:"p-3 text-sm text-neutral-500",children:"No pending payouts right now."})]})]}),(0,t.jsxs)("section",{className:"text-sm text-neutral-300",children:[(0,t.jsx)(l.Pz,{className:"mt-0 mb-0",children:"Payout history"}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(g.e,{ariaLabel:"Payout history",tabs:[{id:"requested",label:"Requested",count:_.length},{id:"completed",label:"Completed",count:y.length}],value:h,onChange:p})}),"requested"===h?_.length?(0,t.jsx)(b,{payoutsList:_}):(0,t.jsx)("div",{className:"rounded-md bg-neutral-900 p-3 text-neutral-500",children:"No requested payouts."}):y.length?(0,t.jsx)(b,{payoutsList:y}):(0,t.jsx)("div",{className:"rounded-md bg-neutral-900 p-3 text-neutral-500",children:"No completed payouts yet."})]})]})}},68812:(e,r,a)=>{a.d(r,{e:()=>l});var t=a(37876);function l({tabs:e,value:r,onChange:a,ariaLabel:s,className:i="mb-3"}){return(0,t.jsx)("div",{className:`flex flex-row gap-4 border-b border-neutral-800 ${i}`,role:"tablist","aria-label":s,children:e.map(e=>{let l=e.id===r;return(0,t.jsxs)("div",{role:"tab",id:`manage-subtab-${e.id}
1`,tabIndex:0,"aria-selected":l,className:`cursor-pointer shrink-0 whitespace-nowrap bg-transparent pb-2 text-sm hover:bg-transparent ${l?"border-b-[2px] border-brand font-semibold text-mainheading":"border-b-[2px] border-transparent text-neutral-400 hover:border-b-[2px] hover:text-neutral-200"}`,onClick:()=>a(e.id),onKeyDown:r=>{("Enter"===r.key||" "===r.key)&&(r.preventDefault(),a(e.id))},children:[e.label,"number"==typeof e.count?` (${e.count})`:""]},e.id)})})}a(14232)}}]);

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.