PageSourceSearch

https://app.mentortools.com/app/_next/static/chunks/pages/settings/affiliate-links-1c3e28623ba081fe.js

js mentortools.com collected 2026-09-24 10:33:46 UTC 17,253 bytes, 2 lines download raw bytes

1try{let e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ae2a1738-85c6-4eeb-a59e-e1bed36fa578",e._sentryDebugIdIdentifier="sentry-dbid-ae2a1738-85c6-4eeb-a59e-e1bed36fa578")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9135],{1508:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var i=a(44501),n=a(40670),r=a(14232),s=a(49995),l=a(4697),o=a(26200),d=a(64713),c=a(47951),u=a(45879);function f(e){return(0,u.Ay)("MuiTableContainer",e)}(0,c.A)("MuiTableContainer",["root"]);var y=a(37876);let g=["className","component"],A=(0,d.Ay)("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),p=r.forwardRef(function(e,t){let a=(0,o.A)({props:e,name:"MuiTableContainer"}),{className:r,component:d="div"}=a,c=(0,n.A)(a,g),u=(0,i.A)({},a,{component:d}),p=(e=>{let{classes:t}=e;return(0,l.A)({root:["root"]},f,t)})(u);return(0,y.jsx)(A,(0,i.A)({ref:t,as:d,className:(0,s.A)(p.root,r),ownerState:u},c))})},4454:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var i=a(44501),n=a(40670),r=a(14232),s=a(49995),l=a(4697),o=a(18057),d=a(26200),c=a(64713),u=a(47951),f=a(45879);function y(e){return(0,f.Ay)("MuiTableHead",e)}(0,u.A)("MuiTableHead",["root"]);var g=a(37876);let A=["className","component"],p=(0,c.Ay)("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),x={variant:"head"},m="thead",h=r.forwardRef(function(e,t){let a=(0,d.A)({props:e,name:"MuiTableHead"}),{className:r,component:c=m}=a,u=(0,n.A)(a,A),f=(0,i.A)({},a,{component:c}),h=(e=>{let{classes:t}=e;return(0,l.A)({root:["root"]},y,t)})(f);return(0,g.jsx)(o.A.Provider,{value:x,children:(0,g.jsx)(p,(0,i.A)({as:c,className:(0,s.A)(h.root,r),ref:t,role:c===m?null:"rowgroup",ownerState:f},u))})})},5919:(e,t,a)=>{"use strict";a.d(t,{A:()=>j,m:()=>m});var i=a(37876),n=a(14232),r=a(24868),s=a(4454),l=a(74725),o=a(93212),d=a(26086),c=a(1508),u=a(64713),f=a(62902),y=a(31941),g=a(26183),A=a(74234),p=a(35126),x=a(41093);let m=(0,u.Ay)(r.A)(({theme:e})=>({border:"1px solid "+e.palette.divider,borderBottom:"none",borderRadius:e.spacing(1.5),borderCollapse:"initial"})),h=(0,u.Ay)(f.A)({opacity:1,transition:"opacity 0.3s ease"}),b=(0,u.Ay)(g.A)({padding:0}),j=(0,n.memo)(({data:e,columns:t,sortQuery:a,onSort:r,onRowClick:u,getRowStyle:g,containerProps:j,tableProps:k})=>{let{t:I}=(0,x.o)(),_=(0,A.A)();return(0,i.jsx)(c.A,{...j,"data-sentry-element":"TableContainer","data-sentry-component":"GenericTable","data-sentry-source-file":"index.tsx",children:(0,i.jsxs)(m,{"aria-label":I("extracted.customized_table"),...k,sx:{"& .MuiTableCell-stickyHeader":{backgroundColor:_.palette.background.paper}},"data-sentry-element":"TableStyled","data-sentry-source-file":"index.tsx",children:[(0,i.jsx)(s.A,{"data-sentry-element":"TableHead","data-sentry-source-file":"index.tsx",children:(0,i.jsx)(l.A,{"data-sentry-element":"TableRow","data-sentry-source-file":"index.tsx",children:t.map(({id:e,cell:t="",customKey:n="",isSortable:s,label:l})=>(0,i.jsx)(o.A,{onClick:()=>{if(a&&s){let t=a.column!==e||!a.ascending;r?.(e,t)}},children:(0,i.jsxs)(f.A,{direction:"row",alignItems:"center",gap:_.spacing(2),children:["string"==typeof l?(0,i.jsx)(y.A,{fontWeight:500,children:l}):l,s&&(0,i.jsxs)(h,{children:[(0,i.jsx)(b,{onClick:()=>r?.(e,!0),children:(0,i.jsx)(p.A,{icon:"tabler:chevron-up"})}),(0,i.jsx)(b,{onClick:()=>r?.(e,!1),children:(0,i.jsx)(p.A,{icon:"tabler:chevron-down"})})]})]})},`${n}-${(e||t)?.toString()}`))})}),(0,i.jsx)(d.A,{"data-sentry-element":"TableBody","data-sentry-source-file":"index.tsx",children:e.map((e,a)=>(0,i.jsxs)(n.Fragment,{children:[(0,i.jsx)(l.A,{hover:!0,onClick:()=>u?.(e),sx:{cursor:u&&"pointer",...g?.(e)},children:t.map(({id:t,cell:n,render:r})=>(0,i.jsx)(o.A,{children:(0,i.jsxs)(i.Fragment,{children:[t&&(0,i.jsx)(i.Fragment,{children:r?r(e):(0,i.jsx)(i.Fragment,{children:e[t]})}),n&&(0,i.jsx)(i.Fragment,{children:r&&r(e)})]})},`${a}-${(t||n)?.toString()}`))}),e.collapseContent&&(0,i.jsx)(l.A,{children:(0,i.jsx)(o.A,{sx:{border:"none"},padding:"none",colSpan:t.length,children:e.collapseContent})})]},a))})]})})})},12848:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>Y});var i=a(37876),n=a(31941),r=a(62902),s=a(74234),l=a(35126),o=a(99399),d=a(41093),c=a(69884),u=a(29305),f=a(39280),y=a(86761),g=a(64713),A=a(3801),p=a(56809),x=a(14232),m=a(89099),h=a(11313),b=a(25750),j=a(34020);let k={columns:["template_link","title","id"]};var I=a(88992),_=a(13810),T=a(67768),L=a(40097),C=a(51802);let v=C.Ik({digistore_id:C.Yj().min(1,"validations.digistore_id_required")});var F=a(67732),S=a(85189),w=a(64148),E=a(82867);let N=(0,g.Ay)(y.Ay)(({theme:e})=>({maxWidth:600,width:"100%",flexDirection:"row",alignItems:"end",gap:e.spacing(6),paddingTop:e.spacing(8),paddingLeft:e.spacing(8),paddingRight:e.spacing(8)})),G=(0,g.Ay)(p.Ay)(()=>({"& .MuiFormHelperText-root.Mui-error":{position:"absolute",top:"100%"}})),P=({portalAffiliate:e,isFetching:t,isRegenerate:a=!1})=>{let{t:n}=(0,d.o)("translation",{keyPrefix:"FORM.AFFILIATE_LINKS"}),o=(0,s.A)(),{onSubmit:c,register:u,isSubmitting:f,errors:g}=(e=>{let{notify:t}=(0,F.A)(),a=(0,T.jE)(),i=(0,m.useRouter)(),n=(0,S.A)(),{register:r,handleSubmit:s,formState:{isSubmitting:l,errors:o}}=(0,I.mN)({resolver:(0,_.u)(v),defaultValues:e?{digistore_id:e.digistore_id}:void 0}),{mutateAsync:d}=(0,L.n)({mutationFn:e=>
1b.A.updateAffiliateLinks({filter_by:[{attribute:"portal_id",operator:"==",value:n.user.portal.id}],values:e}),onSettled:async()=>{a.invalidateQueries(h.Ay.portal.all),a.invalidateQueries({queryKey:[h.Ay.settings.affiliateLinks.queryKey,{limit:parseInt(`${i.query?.limit}`),page:parseInt(`${i.query?.page}`)}]}),a.invalidateQueries({queryKey:[h.Ay.settings.affiliateLinksCount.queryKey]})},onSuccess:()=>t("AFFILIATE_LINKS.update",{type:"success"})});return{register:r,isSubmitting:l,errors:o,onSubmit:s((0,x.useCallback)(async({digistore_id:a})=>{try{let t;t=e?{...e,digistore_id:a}:{digistore_id:a,portal_id:n.user.portal.id},await d(t)}catch(e){t("AFFILIATE_LINKS.update",{type:"error"})}},[e,n,d,t]))}})(e);return a?(0,i.jsxs)(N,{container:!0,children:[(0,i.jsx)(y.Ay,{item:!0,xs:!0,children:(0,i.jsx)(w.f,{action:E.Qi.EDIT_AFFILIATE_SETTINGS,sx:{width:"100%"},children:(0,i.jsx)(G,{label:n("label"),placeholder:n("placeholder"),fullWidth:!0,...u("digistore_id"),error:!!g.digistore_id,helperText:g.digistore_id&&n(g.digistore_id.message||"")})})}),(0,i.jsx)(y.Ay,{item:!0,children:(0,i.jsx)(A.A,{variant:"contained",endIcon:(0,i.jsx)(l.A,{icon:"tabler:refresh",fontSize:18}),loading:f,disabled:t,onClick:c,children:n("regenerate")})})]}):(0,i.jsxs)(r.A,{spacing:o.spacing(6),alignItems:"center",width:"100%",maxWidth:400,"data-sentry-element":"Stack","data-sentry-component":"GenerateAff
1iliateLinksForm","data-sentry-source-file":"GenerateAffiliateLinksForm.tsx",children:[(0,i.jsx)(w.f,{action:E.Qi.EDIT_AFFILIATE_SETTINGS,sx:{width:"100%"},"data-sentry-element":"TeamMemberGuard","data-sentry-source-file":"GenerateAffiliateLinksForm.tsx",children:(0,i.jsx)(p.Ay,{label:n("label"),placeholder:n("placeholder"),fullWidth:!0,...u("digistore_id"),error:!!g.digistore_id,helperText:g.digistore_id&&n(g.digistore_id.message||""),"data-sentry-element":"CustomTextField","data-sentry-source-file":"GenerateAffiliateLinksForm.tsx"})}),(0,i.jsx)(w.f,{action:E.Qi.EDIT_AFFILIATE_SETTINGS,"data-sentry-element":"TeamMemberGuard","data-sentry-source-file":"GenerateAffiliateLinksForm.tsx",children:(0,i.jsx)(A.A,{variant:"contained",size:"large",loading:f,disabled:t,onClick:c,"data-sentry-element":"LoadingButton","data-sentry-source-file":"GenerateAffiliateLinksForm.tsx",children:n("generate")})})]})};var q=a(5919),R=a(26183),M=a(79494);let K=({templateLink:e})=>{let{copyToClipboard:t}=(0,M.T)(),a=(0,s.A)();return(0,i.jsxs)(r.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:a.spacing(4),"data-sentry-element":"Stack","data-sentry-component":"TableLinkColumn","data-sentry-source-file":"TableLinkColumn.tsx",children:[(0,i.jsx)(n.A,{variant:"body1",color:a.palette.primary.main,"data-sentry-element":"Typography","data-sentry-source-file":"TableLinkColumn.tsx",children:e}),(0,i.jsx)(R.A,{onClick:()=>t(e),"data-sentry-element":"IconButton","data-sentry-source-file":"TableLinkColumn.tsx",children:(0,i.jsx)(l.A,{icon:"tabler:copy",color:a.palette.primary.main,fontSize:a.spacing(6),"data-sentry-element":"Icon","data-sentry-source-file":"TableLinkColumn.tsx"})})]})},D=({portalAffiliate:e,isFetching:t,query:a,isLoading:l,affiliateLinks:o})=>{let{t:c}=(0,d.o)("translation",{keyPrefix:"PAGE.AFFILIATE_LINKS"}),u=(0,s.A)();return(0,i.jsxs)(r.A,{padding:u.spacing(4),"data-sentry-element":"Stack","data-sentry-component":"AffiliateLinksTable","data-sentry-source-file":"AffiliateLinksTable.tsx",children:[(0,i.jsx)(P,{portalAffiliate:e,isFetching:t,isRegenerate:!0,"data-sentry-element":"GenerateAff
1iliateLinksForm","data-sentry-source-file":"AffiliateLinksTable.tsx"}),(0,i.jsx)(f.A,{hasData:o?.length>0,isLoading:l,"data-sentry-element":"PaginationDataWrapper","data-sentry-source-file":"AffiliateLinksTable.tsx",children:(0,i.jsx)(q.A,{data:o,columns:[{id:"title",isSortable:!0,label:c("table_labels.page_type"),render:({title:e})=>(0,i.jsx)(n.A,{variant:"h6",children:e})},{id:"template_link",isSortable:!0,label:c("table_labels.link"),render:({template_link:e})=>(0,i.jsx)(K,{templateLink:e})}],onSort:a.onChangeOrder,sortQuery:a.order,"data-sentry-element":"GenericTable","data-sentry-source-file":"AffiliateLinksTable.tsx"})})]})};var W=a(40241),H=a(94596);let $={columns:["affiliates","affiliates.digistore_id","affiliates.portal_id","affiliates.one_click_affiliate_is_active","language_id","is_active","id"]},Q=(0,g.Ay)(r.A)(({theme:e})=>({maxWidth:500,minHeight:554,width:"100%",gap:e.spacing(12),alignItems:"center",justifyContent:"center"})),O=(0,g.Ay)(r.A)(({theme:e})=>({backgroundColor:e.palette.primary[100],borderRadius:e.spacing(20),height:e.spacing(24),width:e.spacing(24),alignItems:"center",justifyContent:"center"})),z=({portalAffiliate:e,isFetching:t})=>{let{t:a}=(0,d.o)("translation",{keyPrefix:"FORM.AFFILIATE_LINKS"}),o=(0,s.A)();return(0,i.jsx)(r.A,{alignItems:"center",padding:o.spacing(12),"data-sentry-element":"Stack","data-sentry-component":"AffiliateLinksIntroduction","data-sentry-source-file":"AffiliateLinksIntroduction.tsx",children:(0,i.jsxs)(Q,{"data-sentry-element":"FormContainer","data-sentry-source-file":"AffiliateLinksIntroduction.tsx",children:[(0,i.jsx)(r.A,{alignItems:"center","data-sentry-element":"Stack","data-sentry-source-file":"AffiliateLinksIntroduction.tsx",children:(0,i.jsx)(O,{"data-sentry-element":"IconWrapper","data-sentry-source-file":"AffiliateLinksIntroduction.tsx",children:(0,i.jsx)(l.A,{icon:"tabler:link",color:o.palette.primary[500],fontSize:o.spacing(13),"data-sentry-element":"Icon","data-sentry-source-file":"AffiliateLinksIntroduction.tsx"})})}),(0,i.jsxs)(r.A,{spacing:o.spacing(4),alignItems:"center","data-sentry-element":"Stack","data-sentry-source-file":"AffiliateLinksIntroduction.tsx",children:[(0,i.jsx)(n.A,{variant:"h4","data-sentry-element":"Typography","data-sentry-source-file":"AffiliateLinksIntroduction.tsx",children:a("title")}),(0,i.jsx)(n.A,{variant:"subtitle1",color:o.palette.grey[500],"data-sentry-element":"Typography","data-sentry-source-file":"AffiliateLinksIntroduction.tsx",children:a("subtitle")})]}),(0,i.jsx)(P,{portalAffiliate:e,isFetching:t,"data-sentry-element":"GenerateAff
1iliateLinksForm","data-sentry-source-file":"AffiliateLinksIntroduction.tsx"})]})})},B=(0,g.Ay)(r.A)(({theme:e})=>({backgroundColor:e.palette.background.paper,borderRadius:e.spacing(1.5),boxShadow:e.shadow.grey.card})),V=({hasAccess:e})=>{let{t}=(0,d.o)(),{data:a,isError:r,isFetching:s,isLoading:l}=(0,H.WP)($,e),{affiliateLinks:o,portalAffiliate:c,isLoading:u,isError:f,query:y}=((e,t=!0)=>{let a=(0,m.useRouter)(),{data:i=[],query:n,isError:r,isLoading:s}=(0,j.A)({queryDataKey:h.Ay.settings.affiliateLinks.queryKey,queryCountKey:h.Ay.settings.affiliateLinksCount.queryKey,queryDataFn:({limit:t,offset:a,order:i})=>b.A.getAffiliateLinks({...k,filter_by:[{attribute:"language_id",value:e?.language_id}],order_by:i,limit:t,offset:a}),queryCountFn:()=>b.A.getAffiliateLinksCount({filter_by:[{attribute:"language_id",value:e?.language_id}]}),enabled:!!e&&t},{initialPage:parseInt(`${a.query?.page}`)||1,initialLimit:parseInt(`${a.query?.limit}`)||10,initialOrder:{column:a.query?.order?`${a.query?.order}`:"id",ascending:!a.query?.ascending||!!a.query?.ascending}}),l=(0,x.useMemo)(()=>{let t;return(e?.affiliates??[]).forEach(a=>{e?.id===a.portal_id&&a.digistore_id&&(t=a)}),t},[e]);return{affiliateLinks:(0,x.useMemo)(()=>{if(!i)return;let e=l?.digistore_id;return e?i.map(t=>({...t,template_link:t.template_link.replace("{{digistore_id}}",e)})):[]},[i,l]),portalAffiliate:l,isLoading:s,isError:r,query:n}})(a,e);return u||l?(0,i.jsx)(B,{children:(0,i.jsx)(W.A,{})}):!o||f||r?(0,i.jsx)(B,{children:(0,i.jsx)(n.A,{children:t("PAGE.AFFILIATE_LINKS.error")})}):c?(0,i.jsx)(B,{"data-sentry-element":"Container","data-sentry-component":"AffiliateLinksSettings","data-sentry-source-file":"AffiliateLinksSettings.tsx",children:(0,i.jsx)(D,{portalAffiliate:c,isFetching:s,query:y,isLoading:u||l,affiliateLinks:o,"data-sentry-element":"AffiliateLinksTable","data-sentry-source-file":"AffiliateLinksSettings.tsx"})}):(0,i.jsx)(B,{children:(0,i.jsx)(z,{portalAffiliate:c,isFetching:s})})};var X=a(54651);let Y=()=>{let{t:e}=(0,d.o)("translation",{keyPrefix:"PAGE.AFFILIATE_LINKS"}),t=(0,s.A)(),{hasAccess:a}=(0,o.D)();return a(E.Qi.VIEW_AFFILIATE_SETTINGS)?(0,i.jsxs)(r.A,{spacing:t.spacing(6.5),"data-sentry-element":"Stack","data-sentry-component":"Page","data-sentry-source-file":"index.tsx",children:[(0,i.jsx)(u.A,{separator:(0,i.jsx)(l.A,{icon:"tabler:chevron-right"}),data:[{href:c.C.settings,text:e("breadcrumb_first")},{isActive:!0,text:e("title")}],"data-sentry-element":"BreadCrumbs","data-sentry-source-file":"index.tsx"}),(0,i.jsx)(n.A,{variant:"h2","data-sentry-element":"Typography","data-sentry-source-file":"index.tsx",children:e("title")}),(0,i.jsx)(V,{hasAccess:a(E.Qi.VIEW_AFFILIATE_SETTINGS),"data-sentry-element":"AffiliateLinksSettings","data-sentry-source-file":"index.tsx"})]}):(0,i.jsx)(X.default,{isTeamMember:!0})}},39280:(e,t,a)=>{"use strict";a.d(t,{A:()=>h});var i=a(37876),n=a(14232),r=a(62902),s=a(66950),l=a(31941),o=a(64713),d=a(74234),c=a(40241),u=a(35126),f=a(80013),y=a(41093),g=a(95144);let A=[10,25,50,100],p=(0,n.memo)(({page:e,pageSize:t,onChangePage:a,onChangePageSize:n,pagesCount:s,itemsPerPageCount:o,itemsCount:d,hideResultsDisplay:c})=>{let{t:u}=(0,y.o)();return(0,i.jsxs)(r.A,{direction:{xs:"column",sm:"row"},alignItems:"center",justifyContent:"space-between","data-sentry-element":"Stack","data-sentry-component":"PaginationControls","data-sentry-source-file":"index.tsx",children:[c?(0,i.jsx)(r.A,{flex:1}):(0,i.jsx)(l.A,{children:u("PAGE.PAGINATION.results_display",{displayedEnd:o,itemsCount:d})}),(0,i.jsxs)(r.A,{direction:{xs:"column-reverse",sm:"row"},alignItems:"center",spacing:4,"data-sentry-element":"Stack","data-sentry-source-file":"index.tsx",children:[(0,i.jsx)(f.A,{defaultPage:1,page:e,onChange:(e,t)=>
1a(t),boundaryCount:1,siblingCount:1,count:s,color:"primary",shape:"rounded","data-sentry-element":"Pagination","data-sentry-source-file":"index.tsx"}),n&&(0,i.jsx)(g.A,{value:t,handleValueChange:e=>n(parseInt(`${e.target.value}`)),selectItems:A,labelText:u("PAGE.PAGINATION.item_per_page")})]})]})}),x=(0,o.Ay)(s.A)(({theme:e})=>({backgroundColor:e.palette.grey[100],width:"44px",height:"44px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:e.shape.borderRadius})),m=(0,o.Ay)(r.A)(({theme:e})=>({backgroundColor:e.palette.background.paper,minHeight:125,gap:e.spacing(8),borderRadius:e.shape.borderRadius,flex:1})),h=({isLoading:e,hasData:t,emptyStateMessage:a,emptyPlaceholder:o,controls:f,children:y,hasPadding:g=!0,hasShadow:A=!0,hasBackground:h=!0,paginationControlsProps:b})=>{let j=(0,d.A)(),k=(0,n.useCallback)(()=>e?(0,i.jsx)(r.A,{alignItems:"center",justifyContent:"center",children:(0,i.jsx)(c.A,{})}):t?y:(0,i.jsxs)(r.A,{alignItems:"center",justifyContent:"center",gap:"24px",flex:"1",children:[(0,i.jsx)(x,{children:(0,i.jsx)(u.A,{icon:"tabler:database"})}),o||a&&(0,i.jsx)(s.A,{justifyContent:"center",children:(0,i.jsx)(l.A,{variant:"h4",children:a})})]}),[y,o,a,t,e]);return(0,i.jsxs)(m,{sx:{padding:g?j.spacing(8):0,boxShadow:A?j.shadows[2]:0,backgroundColor:h?j.palette.background.paper:"transparent",minHeight:h?125:"auto",gap:h?j.spacing(8):j.spacing(4),[j.breakpoints.down("md")]:{padding:g?j.spacing(5):0}},"data-sentry-element":"PaginationToolbarContainer","data-sentry-component":"PaginationDataWrapper","data-sentry-source-file":"index.tsx",children:[f,k(),b&&(0,i.jsx)(p,{...b})]})}},57793:(e,t,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/affiliate-links",function(){return a(12848)}])}},e=>{e.O(0,[6862,13,636,6593,8792],()=>e(e.s=57793)),_N_E=e.O()}]);
2//# sourceMappingURL=affiliate-links-1c3e28623ba081fe.js.map

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.