1var S=Object.defineProperty;var y=(e,o,t)=>o in e?S(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t;var l=(e,o,t)=>y(e,typeof o!="symbol"?o+"":o,t);import{X as c,r as j,j as s,bQ as v,e as C,bR as h,bS as x,bT as _,bU as k,bV as T,bW as P,aS as R,aT as m,b2 as L,b3 as D,b4 as M,a_ as p,M as u,b0 as B,aX as I}from"./index-1ZwnxBtP.js";import{B as g}from"./BootStrapPagedTable-Dx9C5Ed-.js";import{R as b}from"./RenderCommission-CAGJj7T-.js";import{B as O}from"./BackButton-gsucH3Mk.js";import"./StateBasedPagination-GXnzMTTz.js";class H extends j.Component{render(){return s.jsx(v,{source:this.props.program_reports_page})}}function $(e){return{program_reports_page:e.settings.program_reports_page||"/program_reports.html"}}const w=c($)(H);function f(e){const o=document.createElement("div"),t=T.createRoot(o);return P.flushSync(()=>{t.render(e)}),o.innerHTML}class E extends j.Component{constructor(){super(...arguments);l(this,"state",{data:[],loading:!1});l(this,"loadSiteOffers",()=>(this.setState({loading:!0}),C("/site_offers").then(t=>{this.setState({data:t,loading:!1})}).catch(t=>{this.setState({loading:!1})})));l(this,"loadHTMLPage",()=>{const{locale:t}=this.props;let n=t&&t.startsWith("zh")?t.split("_").join("-"):t;fetch(this.props.program_commissions_page).then(a=>a.text()).then(a=>{let i=a;i=a.replace("{commission_value}",f(s.jsx(h,{store:x,children:s.jsx(_,{locale:n,messages:this.props.messages,children:s.jsx(k,{})})}))),i=i.replace("{special_offers}",f(s.jsx(h,{store:x,children:s.jsx(_,{locale:n,messages:this.props.messages,children:s.jsx(V,{data:this.state.data})})}))),this.setState({html:i})})})}componentDidMount(){this.loadSiteOffers().then(()=>{this.loadHTMLPage()})}render(){return s.jsx("div",{dangerouslySetInnerHTML:{__html:this.state.html}})}}function V({data:e}){return e.length===0?s.jsx("p",{children:"No special offers are running at the moment"}):s.jsx(F,{data:e})}const z=[{title:"Product",dataIndex:"offer_data",render:e=>{const{product:o,variation:t}=JSON.parse(e);return o&&o.id?s.jsxs("div",{children:[s.jsx("span",{children:(o.name||"").replace(/(<([^>]+)>)/gi,"")}),t?s.jsx("small",{className:"text-muted ml-2",children:t.name}):null]}):s.jsx("span",{children:"Any"})}},{title:"Commission",dataIndex:"commission_type",key:"commission_type",sorter:(e,o)=>Number(e.commission_value)-Number(o.commission_value),render:(e,o)=>s.jsx(b,{commission_value:o.commission_value,commission_type:o.commission_type})}],A=[{title:"Collection",dataIndex:"offer_data",render:e=>{const{id:o,title:t}=JSON.parse(e);return t?s.jsx("span",{children:t}):s.jsx("span",{children:"Any"})}},{title:"Commission",dataIndex:"commission_type",key:"commission_type",sorter:(e,o)=>Number(e.commission_value)-Number(o.commission_value),render:(e,o)=>s.jsx(b,{commission_value:o.commission_value,commission_type:o.commission_type})}];function F({data:e}){const o=e.filter(n=>n.offer_type==="product"),t=e.filter(n=>n.offer_type==="collection");return s.jsxs("div",{children:[o.length>0&&s.jsx(g,{dataSource:o,columns:z,per_page:500}),t.length>0&&s.jsx(g,{dataSource:t,columns:A,per_page:500})]})}const J=(e,o)=>{const{locale:t,messages:n,default_commission_type:a,default_commission_value:i,show_commission_on_landing:d}=e.settings;return{default_commission_value:i,default_commission_type:a,show_commission_on_landing:d,locale:t,messages:n,program_commissions_page:e.settings.program_commissions_page||"/program_commissions.html"}},W=c(J)(E);function X({program_tools_page:e}){return s.jsx(v,{source:e})}function Q(e){return{program_tools_page:e.settings.program_tools_page||"/program_tools.html"}}const U=c(Q)(X);function ts(){return s.jsx(R,{children:s.jsxs(m,{element:s.jsx(q,{}),children:[s.jsx(m,{path:"reports",element:s.jsx(w,{})}),s.jsx(m,{path:"commissions",element:s.jsx(W,{})}),s.jsx(m,{path:"tools",element:s.jsx(U,{})})]})})}const q=c(G)(function(e){const{hasReports:o,hasTools:t,hasCommissions:n,defaultBannerVisible:a}=e;return s.jsxs(L,{children:[s.jsx(D,{}),a?s.jsx("div",{className:"bg-dark",children:s.jsx(M,{})}):s.jsx("div",{className:"container pt-4",children:s.jsx(O,{})}),s.jsx("div",{className:"bg-white",children:s.jsxs("div",{className:"container mx-auto py-2",children:[s.jsxs("ul",{className:"nav nav-tabs mt-2",children:[o&&s.jsx("li",{className:"nav-item",children:s.jsx(p,{activeClassName:"active",to:"/program-details/reports",className:"nav-link",children:s.jsx(u,{id:"Reports"})})}),t&&s.jsx("li",{className:"nav-item",children:s.jsx(p,{activeClassName:"active",to:"/program-details/tools",className:"nav-link",children:s.jsx(u,{id:"Tools"})})}),n&&s.jsx("li",{className:"nav-item",children:s.jsx(p,{activeClassName:"active",to:"/program-details/commissions",className:"nav-link",children:s.jsx(u,{id:"Commission Details"})})})]}),s.jsx("div",{className:"my-4",children:s.jsx(B,{})})]})}),s.jsx(I,{})]})});function G(e){const{page_sections:o}=e.settings,t=o.default_footer&&o.default_footer.props||{},a=(o.default_banner&&o.default_banner.props||{}).visible,i=t.blocks&&t.blocks.find(({description:r})=>r.match("{link_reporting}")),d=t.blocks&&t.blocks.find(({description:r})=>r.match("{link_commissions}")),N=t.blocks&&t.blocks.find(({description:r})=>r.match("{link_tools}"));return{website:e.settings.website,hasTools:N,hasReports:i,hasCommissions:d,defaultBannerVisible:a}}export{ts as default}; 2//# sourceMappingURL=LandingSectionsIndex-CzyeZA9k.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.