1"use strict";(self.webpackChunkmy_webpack_project=self.webpackChunkmy_webpack_project||[]).push([[1536],{4031(e,t,l){l.d(t,{A:()=>d});var a=l(82195),n=l(39471);const r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};var o=l(72812),i=function(e,t){return n.createElement(o.A,(0,a.A)({},e,{ref:t,icon:r}))};const d=n.forwardRef(i)},19028(e,t,l){var a=l(39471),n=l(17325);const r=n.A.Option;l.d(t,["A",0,e=>{let t=e.label,l=e.options,o=void 0===l?[]:l,i=e.value,d=e.onChange,s=e.mode,p=void 0===s?"multiple":s,c=e.disabled,u=void 0!==c&&c,x=e.onPopupScroll,m=void 0===x?null:x,g=e.loading,f=void 0!==g&&g;return a.createElement("div",{className:"custom-select"},a.createElement(n.A,{placeholder:t,value:i,onChange:d,disabled:u,loading:f,showSearch:!0,optionFilterProp:"children",filterOption:(e,t)=>t.children.toLowerCase().includes(e.toLowerCase()),mode:p,onPopupScroll:m,dropdownStyle:{maxHeight:300}},o.map(e=>a.createElement(r,{key:e.value,value:e.value},e.label))))}])},58068(e,t,l){var a=l(39471),n=l(86287),r=l(26371),o=l(17325),i=l(4826),d=l.n(i);function s(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,a)}return l}function p(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?s(Object(l),!0).forEach(function(t){c(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):s(Object(l)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}function c(e,t,l){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var l=t.call(e,"string");if("object"!=typeof l)return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a,n,r,o,i=[],d=!0,s=!1;try{if(r=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;d=!1}else for(;!(d=(a=r.call(l)).done)&&(i.push(a.value),i.length!==t);d=!0);}catch(e){s=!0,n=e}finally{try{if(!d&&null!=l.return&&(o=l.return(),Object(o)!==o))return}finally{if(s)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var l={}.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?x(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,a=Array(t);l<t;l++)a[l]=e[l];return a}o.A.Option;const m=r.A.RangePicker;l.d(t,["A",0,e=>{let t=e.value,l=e.onChange,r=e.style,o=void 0===r?{}:r,i=(e.allowClear,e.onApply);e.onReset;const s=u((0,a.useState)(!1),2),c=s[0],x=s[1],g=u((0,a.useState)(t),2),f=g[0],y=g[1],v=u((0,a.useState)(null),2),b=v[0],h=v[1],w=a.useRef(!1),E=[{label:"This Week",value:()=>[d()().startOf("week"),d()().endOf("week")]},{label:"This Month",value:()=>[d()().startOf("month"),d()().endOf("month")]},{label:"This Year",value:()=>[d()().startOf("year"),d()().endOf("year")]},{label:"Last Year",value:()=>[d()().subtract(1,"year").startOf("year"),d()().subtract(1,"year").endOf("year")]}],A=e=>{var t,a;null==e||e.stopPropagation(),null==e||e.preventDefault();const n=f&&2===f.length?[null===(t=f[0])||void 0===t?void 0:t.format("MM/DD/YYYY"),null===(a=f[1])||void 0===a?void 0:a.format("MM/DD/YYYY")]:[];l(f,n),i&&i(f,n),w.current=!0,x(!1)},_=e=>{null==e||e.stopPropagation(),null==e||e.preventDefault(),w.current=!0,x(!1)};return a.createElement(m,{value:c?f:t,onCalendarChange:e=>{y(e)},format:"MM/DD/YYYY",allowClear:!1,open:c,onOpenChange:e=>{(e||w.current)&&(e?(y(t),h(null),w.current=!1):w.current=!1,x(e))},panelRender:e=>a.createElement("div",{style:{display:"flex"}},a.createElement("div",{style:{width:"140px",borderRight:"1px solid #f0f0f0",padding:"12px 8px",background:"#fafafa"}},E.map(e=>a.createElement("div",{key:e.label,onClick:()=>(e=>{const t=e.value();y(t),h(e.label)})(e),style:{padding:"8px 12px",cursor:"pointer",borderRadius:"6px",marginBottom:"4px",fontSize:"14px",background:b===e.label?"#e6f7ff":"transparent",color:b===e.label?"#1890ff":"#000",fontWeight:b===e.label?"500":"normal",transition:"all 0.2s ease"},onMouseEnter:t=>{b!==e.label&&(t.target.style.background="#f5f5f5")},onMouseLeave:t=>{b!==e.label&&(t.target.style.background="transparent")}},e.label))),a.createElement("div",{style:{flex:1}},e)),renderExtraFooter:()=>a.createElement("div",{style:{display:"flex",gap:"10px",justifyContent:"space-between",alignItems:"center",padding:"8px"}},a.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"center"}},a.createElement("div",{style:{borderRadius:"8px",border:"1px solid #D0D5DD",background:"#fff",fontSize:"14px",fontWeight:"500",minWidth:"110px",textAlign:"center"}},f&&f[0]?f[0].format("MM/DD/YYYY"):"Start Date"),a.createElement("span",{style:{fontSize:"16px",fontWeight:"600",color:"#000"}},"-"),a.createElement("div",{style:{borderRadius:"8px",border:"1px solid #D0D5DD",background:"#fff",fontSize:"14px",fontWeight:"500",minWidth:"110px",textAlign:"center"}},f&&f[1]?f[1].format("MM/DD/YYYY"):"End Date")),a.createElement("div",{style:{display:"flex",gap:"10px"}},a.createElement(n.A,{style:{fontWeight:"600",height:"40px",color:"black",borderRadius:"8px",border:"1px solid #2B2A2A",background:"#FFFFFF"},onMouseDown:_},"Cancel"),a.createElement(n.A,{style:{fontWeight:"600",color:"white",background:"#34B5B1",borderRadius:"8px",border:"1px solid #2B2A2A",height:"40px"},onClick:A},"Apply"))),changeOnBlur:!1,separator:a.createElement("span",{style:{margin:"0 8px",color:"#000",fontWeight:"600"}},"-"),style:p({width:"100%"},o)})}])},1536(e,t,l){l.r(t),l.d(t,{default:()=>R});var a=l(39471),n=l(32972),r=l(4172),o=l(35710),i=l(45345),d=l(33195),s=l(71757),p=l(86287),c=l(17325),u=l(82195);const x={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.
104-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};var m=l(72812),g=function(e,t){return a.createElement(m.A,(0,u.A)({},e,{ref:t,icon:x}))};const f=a.forwardRef(g);var y=l(4031),v=l(71244),b=l(58068),h=l(4826),w=l.n(h),E=l(78854),A=l(51794),_=l(62064),k=l(36277),D=l(19028),C=l(18467);function S(e,t){var l=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),l.push.apply(l,a)}return l}function O(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{};t%2?S(Object(l),!0).forEach(function(t){Y(e,t,l[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(l)):S(Object(l)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(l,t))})}return e}function Y(e,t,l){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var l=t.call(e,"string");if("object"!=typeof l)return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var l=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=l){var a,n,r,o,i=[],d=!0,s=!1;try{if(r=(l=l.call(e)).next,0===t){if(Object(l)!==l)return;d=!1}else for(;!(d=(a=r.call(l)).done)&&(i.push(a.value),i.length!==t);d=!0);}catch(e){s=!0,n=e}finally{try{if(!d&&null!=l.return&&(o=l.return(),Object(o)!==o))return}finally{if(s)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var l={}.toString.call(e).slice(8,-1);return"Object"===l&&e.constructor&&(l=e.constructor.name),"Map"===l||"Set"===l?Array.from(e):"Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l)?j(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,a=Array(t);l<t;l++)a[l]=e[l];return a}const R=e=>{e.mode,e.data;const t=(0,n.Zp)(),l=(0,n.zy)(),u=(0,C.d4)(e=>e.user.data),x=P((0,a.useState)(!1),2),m=x[0],g=x[1],h=P((0,a.useState)(!1),2),S=h[0],Y=h[1],j=P((0,a.useState)(!1),2),R=j[0],F=j[1],M=P((0,a.useState)(""),2),W=M[0],N=M[1],B=P((0,a.useState)(null),2),I=B[0],T=B[1],z=(0,n.g)().id,U=P(a.useState(l.state),2),L=U[0],H=U[1],q=P(a.useState(null),2),G=q[0],V=q[1],$=P(a.useState(!1),2),Z=$[0],J=$[1],K=P(a.useState(!1),2),Q=K[0],X=K[1],ee=P(a.useState(null),2),te=ee[0],le=ee[1],ae=P(a.useState("error"),2),ne=ae[0],re=ae[1],oe=P(a.useState([{id:Date.now(),influencerId:null,dateRange:null,startDate:null,endDate:null,loading:!1,isFromApi:!1}]),2),ie=oe[0],de=oe[1],se=P(a.useState([]),2),pe=se[0],ce=se[1],ue=P(a.useState(!1),2),xe=ue[0],me=ue[1],ge=P(a.useState(1),2),fe=ge[0],ye=ge[1],ve=P(a.useState(!0),2),be=ve[0],he=ve[1],we=P(a.useState(0),2),Ee=(we[0],we[1]),Ae=(null==u?void 0:u.is_super_user)||!1;(0,a.useEffect)(()=>{l.state||(g(!0),A.tY.GetUserFanAccount(z).then(e=>{H(e.data)}).catch(e=>{console.error("Error fetching user data:",e)}).finally(()=>{g(!1)}))},[]),(0,a.useEffect)(()=>{if(null!=L&&L.paywall_skip_start_date&&null!=L&&L.paywall_skip_end_date){const e=w()(L.paywall_skip_start_date),t=w()(L.paywall_skip_end_date);H(l=>O(O({},l),{},{paywall_date_range:[e,t],paywall_start_date:L.paywall_skip_start_date,paywall_end_date:L.paywall_skip_end_date}))}},[null==L?void 0:L.paywall_skip_start_date,null==L?void 0:L.paywall_skip_end_date]);const _e=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{var l,a,n;me(!0);const r=await A.tY.GetInfluencersList(e,10),o=(null===(l=r.data)||void 0===l||null===(l=l.results)||void 0===l?void 0:l.map(e=>({value:e.id,label:(0,_.A6)(e)})))||[];ce(t?e=>[...e,...o]:o);const i=(null===(a=r.data)||void 0===a?void 0:a.count)||0,d=null!==(n=r.data)&&void 0!==n&&n.next?e+1:null;Ee(i),he(!!d),ye(e)}catch(e){console.error("Error fetching influencers:",e),V("Failed to load influencers list"),re("error")}finally{me(!1)}},ke=e=>{const t=e.target;t.scrollTop+t.clientHeight>=t.scrollHeight-10&&be&&!xe&&_e(fe+1,!0)};(0,a.useEffect)(()=>{_e(1,!1)},[]),(0,a.useEffect)(()=>{null!=L&&L.id&&De()},[null==L?void 0:L.id]),(0,a.useEffect)(()=>{null!=L&&L.role&&T(L.role)},[null==L?void 0:L.role]);const De=async()=>{try{var e;const t=await A.tY.GetPaywallSkips(L.id);console.log("Paywall Skip API Response:",t.data);const l=(null===(e=t.data)||void 0===e?void 0:e.configurations)||[];if(l.length>0){const e=l.map(e=>{const t=e.paywall_skip_start_date,l=e.paywall_skip_end_date;return console.log("Processing item:",{id:e.id,influencer:e.influencer,influencer_name:e.influencer_name,startDate:t,endDate:l}),{id:e.id||Date.now()+Math.random(),influencerId:e.influencer,dateRange:t&&l?[w()(t),w()(l)]:null,
1startDate:t?w()(t).format("MM/DD/YYYY"):null,endDate:l?w()(l).format("MM/DD/YYYY"):null,loading:!1,isFromApi:!0}});console.log("Formatted promotional dates:",e),de(e)}else console.log("No promotional dates found, keeping default empty row")}catch(e){var t,l;console.error("Error fetching promotional dates:",e),V((null===(t=e.response)||void 0===t||null===(t=t.data)||void 0===t?void 0:t.message)||(null===(l=e.response)||void 0===l||null===(l=l.data)||void 0===l?void 0:l.error)||"Failed to load promotional dates"),re("error")}};return console.log("promotionalDates: ",ie),a.createElement("main",{className:"px-8 py-4 flex-1 flex flex-col",style:{backgroundColor:"#F3EDE9"}},a.createElement("section",{className:"flex justify-between items-center"},a.createElement("h2",{className:" text-[18px] leading-[28px] sm:text-[20px] sm:leading-[30px] md:text-[22px] md:leading-[32px] lg:text-[26px] lg:leading-[36px] xl:text-[30px] xl:leading-[38px] 2xl:text-[36px] 2xl:leading-[40px] p-0 m-0 ",style:{fontWeight:"400"}},"Admin Console")),a.createElement(r.A,{className:"!mb-8 !mt-4",style:{borderColor:"#34B5B1"}}),a.createElement("h3",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16px] 2xl:leading-[38px]\n",style:{fontWeight:"500"}},"Add Credits"),a.createElement("h2",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16px] 2xl:leading-[38px]\n",style:{fontWeight:"700"}},"Available Token: ",null==L?void 0:L.available_token),a.createElement("h2",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16px] 2xl:leading-[38px]\n",style:{fontWeight:"700"}},null==L?void 0:L.first_name),a.createElement("h2",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16px] 2xl:leading-[38px]\n",style:{fontWeight:"700"}},null==L?void 0:L.email),a.createElement("div",{className:" gap-2"},a.createElement(d.A,{gap:"16px"},a.createElement(s.A,{style:{borderRadius:"12px",border:"1px solid #8E8E93",backgroundColor:"#fff",height:"40px",width:"150px",padding:"5px 10px"},placeholder:"800",controls:!1,onChange:e=>{N(e)},value:W}),a.createElement(p.A,{className:" lg:w-[140px] sm:w-[90px] md:w-[110px] xl:w-[155px] 2xl:w-[170px] !text-[14px] ",style:{fontWeight:700,borderRadius:"10px",backgroundColor:"#F3EDE9",height:"40.32px",borderColor:"#2B2A2A",borderWidth:"1px"},loading:m,disabled:m,onClick:()=>{W?J(!0):(V("Please enter a token value"),re("warning"))}},"Add Credits"),Z&&a.createElement(k.A,{isModalVisible:Z,onCancel:()=>J(!1),confirmButtonText:"Yes, Add",modalContent:"Are you sure you want to add ".concat(W," Credits?"),onConfirm:()=>{(async e=>{try{var t;g(!0);const l=await A.tY.EditUserFanTokensRequest(e.id,e.available_token);V("Credits updated successfully"),re("success"),H(O(O({},L),{},{available_token:(null===(t=l.data)||void 0===t?void 0:t.available_token)||L.available_token},l.data)),N("")}catch(e){console.error(e),V("Failed to update credits"),re("error")}finally{g(!1)}})({id:L.id,available_token:W}),J(!1)}}))),a.createElement(r.A,{className:"!mb-8",style:{borderColor:"#2B2A2A",marginTop:"2.5rem"}}),Ae&&a.createElement(a.Fragment,null,a.createElement("h3",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16px] 2xl:leading-[38px] ",style:{fontWeight:"500"}},"Update User Role"),a.createElement("h2",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16
1px] 2xl:leading-[38px] ",style:{fontWeight:"700"}},"Current Role: ",(null==L?void 0:L.role)||"Not Set"),a.createElement("div",{className:"gap-2 mt-4"},a.createElement(d.A,{gap:"16px"},a.createElement(c.A,{style:{borderRadius:"12px",border:"1px solid #8E8E93",backgroundColor:"#fff",height:"40px",width:"200px"},placeholder:"Select Role",value:I,onChange:e=>T(e),options:[{label:"Fan",value:"fan"},{label:"Influencer",value:"influencer"},{label:"Admin",value:"admin"},{label:"Other",value:"other"}]}),a.createElement(p.A,{className:" lg:w-[140px] sm:w-[90px] md:w-[110px] xl:w-[155px] 2xl:w-[170px] !text-[14px] ",style:{fontWeight:700,borderRadius:"10px",backgroundColor:"#F3EDE9",height:"40.32px",borderColor:"#2B2A2A",borderWidth:"1px"},loading:R,disabled:R||!I,onClick:async()=>{if(!I)return V("Please select a role"),void re("warning");try{F(!0),await A.tY.UpdateUserRole(L.id,{role:I}),V("User role updated successfully!"),re("success"),H(O(O({},L),{},{role:I}))}catch(t){var e;console.error("Error updating user role:",t),V((null===(e=t.response)||void 0===e||null===(e=e.data)||void 0===e?void 0:e.error)||"Failed to update user role"),re("error")}finally{F(!1)}}},"Update Role"))),a.createElement(r.A,{className:"!mb-8",style:{borderColor:"#2B2A2A",marginTop:"2.5rem"}})),a.createElement("h3",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16px] 2xl:leading-[38px]\n",style:{fontWeight:"500"}},"Paywall Dates"),a.createElement("div",{className:"gap-2 mt-4"},a.createElement(d.A,{gap:"16px"},a.createElement("div",null,a.createElement(b.A,{style:{borderRadius:"12px",border:"1px solid #8E8E93",backgroundColor:"#fff",height:"40px",width:"300px"},value:(null==L?void 0:L.paywall_date_range)||(null!=L&&L.paywall_skip_start_date&&null!=L&&L.paywall_skip_end_date?[w()(L.paywall_skip_start_date),w()(L.paywall_skip_end_date)]:null),onChange:(e,t)=>
1{H(O(O({},L),{},{paywall_date_range:e,paywall_start_date:t[0],paywall_end_date:t[1]}))}})),a.createElement(p.A,{className:" lg:w-[140px] sm:w-[90px] md:w-[110px] xl:w-[155px] 2xl:w-[170px] !text-[14px] ",style:{fontWeight:700,borderRadius:"10px",backgroundColor:"#F3EDE9",height:"40.32px",borderColor:"#2B2A2A",borderWidth:"1px"},loading:S,disabled:S,onClick:async()=>{try{Y(!0);const e=e=>e?new Date(e).toISOString().split("T")[0]:null,t={paywall_skip_start_date:e(null==L?void 0:L.paywall_start_date),paywall_skip_end_date:e(null==L?void 0:L.paywall_end_date)};console.log("Sending paywall data:",t),await A.tY.UpdateUserPaywallDates(null==L?void 0:L.id,t),V("Paywall dates updated successfully!"),re("success")}catch(e){console.error("Error updating paywall dates:",e),V("Failed to update paywall dates"),re("error")}finally{Y(!1)}}},"Submit"))),a.createElement(r.A,{className:"!mb-8",style:{borderColor:"#2B2A2A",marginTop:"2.5rem"}}),a.createElement("h3",{className:" text-[9px] leading-[28px] sm:text-[10px] sm:leading-[30px] md:text-[11px] md:leading-[32px] lg:text-[12.8px] lg:leading-[34.272px] xl:text-[14px] xl:leading-[36px] 2xl:text-[16px] 2xl:leading-[38px]\n",style:{fontWeight:"500"}},"Paywall Dates per Infleuncer"),a.createElement("div",{className:"gap-2 mt-4"},ie.map((e,t)=>a.createElement(d.A,{key:e.id,gap:"16px",style:{marginBottom:"16px"},align:"center"},a.createElement("div",{style:{width:"300px",marginBottom:"10px"}},a.createElement(D.A,{label:"Select Influencer",options:pe,value:e.influencerId,onChange:t=>((e,t)=>{de(ie.map(l=>l.id===e?O(O({},l),{},{influencerId:t}):l))})(e.id,t),mode:null,disabled:!1,loading:xe,onPopupScroll:ke})),a.createElement("div",null,a.createElement(b.A,{style:{borderRadius:"12px",border:"1px solid #8E8E93",backgroundColor:"#fff",height:"40px",width:"300px"},value:e.dateRange,onChange:(t,l)=>((e,t,l)=>{console.log("Selected dates: ",l),de(ie.map(a=>a.id===e?O(O({},a),{},{dateRange:t,startDate:l[0],endDate:l[1]}):a))})(e.id,t,l)})),a.createElement(p.A,{className:" lg:w-[140px] sm:w-[90px] md:w-[110px] xl:w-[155px] 2xl:w-[170px] !text-[14px] ",style:{fontWeight:700,borderRadius:"10px",backgroundColor:"#F3EDE9",height:"40.32px",borderColor:"#2B2A2A",borderWidth:"1px"},loading:e.loading,disabled:e.loading,onClick:()=>(async e=>{const t=ie.find(t=>t.id===e),l=e=>{if(!e)return null;const t=w()(e,["MM/DD/YYYY","YYYY-MM-DD"],!0);return t.isValid()?t.format("YYYY-MM-DD"):null};if(!t.influencerId)return V("Please select an influencer before submitting"),void re("warning");if(!t.dateRange||!t.startDate||!t.endDate)return V("Please select a date range before submitting"),void re("warning");const a=l(t.startDate),n=l(t.endDate);if(!a||!n)return V("Invalid date format. Please reselect the range"),void re("warning");de(ie.map(t=>t.id===e?O(O({},t),{},{loading:!0}):t));try{var r;const e={fan:L.id,influencer:t.influencerId,paywall_skip_start_date:a,paywall_skip_end_date:n};t.isFromApi&&t.id&&(e.id=t.id);const l=await A.tY.CreatePaywallSkip(e);V((null===(r=l.data)||void 0===r?void 0:r.message)||"Promotional date saved successfully!"),re("success"),await De()}catch(t){var o,i,d,s;console.error("Error saving promotional date:",t),(null===(o=t.response)||void 0===o||null===(o=o.data)||void 0===o||null===(o=o.errors)||void 0===o||null===(o=o.non_field_errors)||void 0===o||null===(o=o[0])||void 0===o?void 0:o.includes("must make a unique set"))||(null===(i=t.response)||void 0===i||null===(i=i.data)||void 0===i||null===(i=i.errors)||void 0===i||null===(i=i.non_field_errors)||void 0===i||null===(i=i[0])||void 0===i?void 0:i.includes("unique set"))?V("This influencer already has promotional dates for the same period. Please select different dates."):V((null===(d=t.response)||void 0===d||null===(d=d.data)||void 0===d?void 0:d.message)||(null===(s=t.response)||void 0===s||null===(s=s.data)||void 0===s?void 0:s.error)||"Failed to save promotional date"),re("error"),de(ie.map(t=>t.id===e?O(O({},t),{},{loading:!1}):t))}})(e.id)},"Submit"),!e.isFromApi&&a.createElement(p.A,{type:"text",danger:!0,style:{height:"40.32px",minWidth:"40px",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>(e=>{de(ie.filter(t=>t.id!==e))})(e.id)},a.createElement(f,{style:{fontSize:"20px",color:"#ff4d4f"}})),e.isFromApi&&a.createElement(p.A,{type:"text",danger:!0,style:{height:"40.32px",minWidth:"40px",display:"flex",alignItems:"center",justifyContent:"center"},loading:e.loading,disabled:e.loading,onClick:()=>(e=>{le(e),X(!0)})(e.id)},a.createElement(y.A,{style:{fontSize:"20px",color:"#ff4d4f"}})))),a.createElement(d.A,{justify:"center",style:{marginTop:"16px"}},a.createElement(p.A,{type:"dashed",style:{borderRadius:"10px",backgroundColor:"#F3EDE9",height:"40.32px",borderColor:"#2B2A2A",borderWidth:"1px",fontWeight:700},disabled:ie.length>=10,onClick:()=>
1{if(ie.length>=10)return V("Maximum 10 promotional dates allowed"),void re("warning");const e={id:Date.now(),influencerId:null,dateRange:null,startDate:null,endDate:null,loading:!1,isFromApi:!1};de([...ie,e])},icon:a.createElement(v.A,null)},"Add Promotional Date"))),a.createElement(r.A,{className:"!mb-8",style:{borderColor:"#2B2A2A",marginTop:"2.5rem"}}),a.createElement("div",{style:{display:"flex",justifyContent:"center"}},a.createElement(p.A,{className:" lg:w-[140px] sm:w-[90pxpx] md:w-[110px] xl:w-[155px] 2xl:w-[170px] !text-[14px] ",style:{fontWeight:700,borderRadius:"10px",backgroundColor:"#F3EDE9",height:"40.32px",borderColor:"#2B2A2A",borderWidth:"1px"},onClick:()=>{t(E.bw.adminUsers.route)}},"Cancel")),Q&&a.createElement(k.A,{isModalVisible:Q,onCancel:()=>X(!1),confirmButtonText:"Yes, Delete",modalContent:"Are you sure you want to delete this paywall skip configuration?",onConfirm:async()=>{const e=te;X(!1);const t=ie.find(t=>t.id===e);if(!t||!t.isFromApi)return V("Cannot delete unsaved configuration"),void re("warning");de(ie.map(t=>t.id===e?O(O({},t),{},{loading:!0}):t));try{await A.tY.DeletePaywallSkip(e),de(ie.filter(t=>t.id!==e)),V("Promotional date deleted successfully!"),re("success")}catch(t){var l,a;console.error("Error deleting promotional date:",t),V((null===(l=t.response)||void 0===l||null===(l=l.data)||void 0===l?void 0:l.message)||(null===(a=t.response)||void 0===a||null===(a=a.data)||void 0===a?void 0:a.error)||"Failed to delete promotional date"),re("error"),de(ie.map(t=>t.id===e?O(O({},t),{},{loading:!1}):t))}}}),a.createElement(i.A,{anchorOrigin:{vertical:"top",horizontal:"right"},open:null!==G,autoHideDuration:5e3,onClose:()=>V(null),showClose:!1,key:"topright"},a.createElement(o.A,{severity:ne},G)))}}}]);
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.