@articles-media/articles-dev-box 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Ad.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),c=require("react"),v=require("./numberWithCommas-CRgrb58X.cjs"),E=require("./index-Ddv_TnxK.cjs"),H=require("./Button-0ZK0NKiK.cjs"),J=require("./index-BlP2-uOi.cjs");function Q(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>s[i]})}}return t.default=s,Object.freeze(t)}const _=Q(c);var C=new Map,S=new WeakMap,q=0,Y;function Z(s){return s?(S.has(s)||(q+=1,S.set(s,q.toString())),S.get(s)):"0"}function ee(s){return Object.keys(s).sort().filter(t=>s[t]!==void 0).map(t=>`${t}_${t==="root"?Z(s.root):s[t]}`).toString()}function se(s){const t=ee(s);let i=C.get(t);if(!i){const r=new Map;let o;const x=new IntersectionObserver(p=>{p.forEach(a=>{var u;const R=a.isIntersecting&&o.some(j=>a.intersectionRatio>=j);s.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=R),(u=r.get(a.target))==null||u.forEach(j=>{j(R,a)})})},s);o=x.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),i={id:t,observer:x,elements:r},C.set(t,i)}return i}function te(s,t,i={},r=Y){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const u=s.getBoundingClientRect();return t(r,{isIntersecting:r,target:s,intersectionRatio:typeof i.threshold=="number"?i.threshold:0,time:0,boundingClientRect:u,intersectionRect:u,rootBounds:u}),()=>{}}const{id:o,observer:x,elements:p}=se(i),a=p.get(s)||[];return p.has(s)||p.set(s,a),a.push(t),x.observe(s),function(){a.splice(a.indexOf(t),1),a.length===0&&(p.delete(s),x.unobserve(s)),p.size===0&&(x.disconnect(),C.delete(o))}}function ne({threshold:s,delay:t,trackVisibility:i,rootMargin:r,root:o,triggerOnce:x,skip:p,initialInView:a,fallbackInView:u,onChange:R}={}){var j;const[n,d]=_.useState(null),k=_.useRef(R),N=_.useRef(a),[y,I]=_.useState({inView:!!a,entry:void 0});k.current=R,_.useEffect(()=>{if(N.current===void 0&&(N.current=a),p||!n)return;let f;return f=te(n,(w,A)=>{const D=N.current;N.current=w,!(D===void 0&&!w)&&(I({inView:w,entry:A}),k.current&&k.current(w,A),A.isIntersecting&&x&&f&&(f(),f=void 0))},{root:o,rootMargin:r,threshold:s,trackVisibility:i,delay:t},u),()=>{f&&f()}},[Array.isArray(s)?s.toString():s,n,o,r,x,p,i,u,t]);const g=(j=y.entry)==null?void 0:j.target,M=_.useRef(void 0);!n&&g&&!x&&!p&&M.current!==g&&(M.current=g,I({inView:!!a,entry:void 0}),N.current=a);const m=[d,y.inView,y.entry];return m.ref=m[0],m.inView=m[1],m.entry=m[2],m}const re=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get(`http://localhost:3001/api/ads/${s.ad_id}`,{params:{ad_id:s.ad_id,user_ad_token:s.user_ad_token}})).data.result}catch{}return E.axios.get(s.url,{params:{ad_id:s.ad_id}}).then(t=>t.data.result)},ie=60,oe={dedupingInterval:1e3*60*ie},ae=(s,t)=>{const{data:i,error:r,isLoading:o,mutate:x}=E.useSWR(s?{url:`https://articles.media/api/ads/${s}`,ad_id:s,user_ad_token:t}:null,re,oe);return{data:i,error:r,isLoading:o,mutate:x}};function ce(s){return t=>{const r=(s?Math[s]:Math.trunc)(t);return r===0?0:r}}function le(s,t){return+v.toDate(s)-+v.toDate(t)}function B(s,t,i){const r=le(s,t)/v.millisecondsInMinute;return ce(i?.roundingMethod)(r)}function W(s){return Math.trunc(s*v.millisecondsInMinute)}const de=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get("http://localhost:3001/api/ads",{params:{}})).data}catch{}return E.axios.get(s.url,{params:{}}).then(t=>t.data)},z=60,ue={dedupingInterval:W(z),focusThrottleInterval:W(z)},xe=s=>{const{data:t,error:i,isLoading:r,mutate:o}=E.useSWR(s?.loading||s?.disabled?null:{url:"https://articles.media/api/ads"},de,ue);return{data:t,error:i,isLoading:r,mutate:o}},me=c.lazy(()=>Promise.resolve().then(()=>require("./AdDetailsModal-k840vrS2.cjs"))),pe=c.lazy(()=>Promise.resolve().then(()=>require("./AdConfirmExitModal-CcSxmXKT.cjs")));function je(s,t){return Math.floor(Math.random()*(t-s+1))+s}function fe(s){let{previewMode:t,darkMode:i,user_ad_token:r,userDetails:o,userDetailsLoading:x}=s;const p=!1,a=[],[u,R]=c.useState(null),{data:j}=xe({loading:x,disabled:o?.articles_membership?.status=="Active"}),{data:n}=ae(u,r);let d=s.previewData||{};const[k,N]=c.useState(null),[y,I]=c.useState(null),[g,M]=c.useState(null),[m,f]=c.useState(0),[w,A]=c.useState(!1),[D,P]=c.useState(!1),[U,$]=c.useState(!1),[ve,ge]=c.useState(new Date),[O,X]=c.useState([]);c.useEffect(()=>{j&&j?.length>0&&!u&&(console.log("Ad Mounted or reduxAds changed"),R(s.ad_id||j[je(0,j?.length-1)]?._id))},[j]),c.useEffect(()=>{},[n]),c.useEffect(()=>{n?.populated_promos&&m>=0&&M(n?.populated_promos[m])},[m,n]);function K(){P(!D)}const{ref:F,inView:b}=ne({threshold:0,triggerOnce:!0});function L(l){if(t&&console.log("Preventing this event from being logged as this ad is being shown in preview mode."),O.find(h=>h==l)){console.log("Already logged this event");return}E.axios.get("/api/ads/event",{params:{ad_id:n?._id,event:l}}).then(function(h){X([...O,l]),console.log(h.data)}).catch(function(h){console.log(h)})}c.useEffect(()=>{if(!t&&(console.log("inView",b),b&&u)){let l=[{ad_id:u,date:new Date().toString()},...a.filter(h=>{if(console.log(B(new Date,new Date(h.date))),B(new Date,new Date(h.date))>5){console.log("adsViewed - Remove Old Ad View Object");return}else return console.log("adsViewed - Keep Ad View Object"),h})];console.log("unexpiredRecentViews",l)}},[b,u]);const[V,G]=c.useState(null);function T(){console.log("logAdAvoided called",r),E.axios.get(process.env.NODE_ENV==="development"?"http://localhost:3001/api/user/advertising/avoided":"https://articles.media/api/user/advertising/avoided",{params:{user_id:o?._id},headers:{"x-articles-api-key":r}}).then(function(l){G(l.data.avoided_count),console.log(l.data)}).catch(function(l){console.log(l)})}return c.useEffect(()=>{t||(console.log("inView",b),o?.articles_membership?.status=="Active"&&b&&T())},[b,o]),x?null:e.jsxRuntimeExports.jsxs("div",{ref:F,className:J.classNames("ad-wrap",{"active-member":o?.articles_membership?.status=="Active"}),style:{"--articles-ad-background-color":d.background_color||n?.background_color,"--articles-ad-font-color":d.font_color||n?.font_color,"--articles-ad-border-color":d.border_color||n?.border_color},children:[D&&e.jsxRuntimeExports.jsx(me,{setModalShow:P,ad:n,previewData:d}),U&&e.jsxRuntimeExports.jsx(pe,{setModalShow:$,ad:n,previewData:d}),e.jsxRuntimeExports.jsxs("div",{className:"ad",children:[o?.articles_membership?.status!=="Active"&&e.jsxRuntimeExports.jsxs("div",{className:"main-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"ad-warning flex-header",children:e.jsxRuntimeExports.jsxs("div",{className:"",children:[n?.city&&"Local"," Advertisement"]})}),e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo",children:(d.logo?.location||n?.logo?.location)&&e.jsxRuntimeExports.jsx("img",{src:d?.logo?.key?`${process.env.NEXT_PUBLIC_CDN}${d?.logo?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.logo?.key}`,alt:""})}),e.jsxRuntimeExports.jsx("div",{className:"icon d-none",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-mug-hot"})}),e.jsxRuntimeExports.jsx("img",{className:"photo",src:d?.background?.key?`${process.env.NEXT_PUBLIC_CDN}${d.background?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.background?.key}`,alt:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail-title",children:[e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:d?.business||n?.business})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-column d-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-search-location"})}),e.jsxRuntimeExports.jsxs("span",{children:[n?.city,", ",n?.state]})]}),e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-clock me-2"})}),e.jsxRuntimeExports.jsx("span",{children:"6:30AM–8PM"})]})]})]}),n?.city&&e.jsxRuntimeExports.jsx("div",{className:"details mb-3 d-none"}),e.jsxRuntimeExports.jsx("div",{className:"short-description",children:d?.description||n?.description})]})]}),p?.roles?.isDev&&n?.populated_promos?.length>0&&e.jsxRuntimeExports.jsxs("div",{children:[g&&e.jsxRuntimeExports.jsx("div",{className:"promos-wrap",children:g&&e.jsxRuntimeExports.jsxs("div",{className:"promo-wrap d-flex justify-content-between align-items-center mx-2 p-1 px-2 border border-2 border-light mb-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"",children:[e.jsxRuntimeExports.jsx("div",{children:g.title}),e.jsxRuntimeExports.jsx("div",{className:"small",children:e.jsxRuntimeExports.jsx("div",{className:"small",children:g.details})})]}),e.jsxRuntimeExports.jsx(H.ArticlesButton,{className:"px-3",small:!0,onClick:()=>{console.log("Load Save Modal"),A(!0)},children:"Save"})]},g._id)}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsxRuntimeExports.jsxs("div",{className:"px-2",children:[n?.populated_promos?.length," Promos Active"]}),e.jsxRuntimeExports.jsxs("div",{className:"controls",children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-left",type:"button",onClick:()=>{m==0?f(n?.populated_promos?.length-1):f(l=>l-1)}}),n?.populated_promos?.map((l,h)=>e.jsxRuntimeExports.jsx("i",{className:`fa-square ${h==m?"fad":"fas"}`},l._id)),e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-right",type:"button",onClick:()=>{m==n?.populated_promos?.length-1?f(0):f(l=>l+1)}})]})]})]}),e.jsxRuntimeExports.jsx("hr",{style:{borderColor:"white"},className:"mt-auto mb-0"}),e.jsxRuntimeExports.jsxs("div",{className:"action-wrap d-flex justify-content-lg-between px-3 py-2",children:[e.jsxRuntimeExports.jsx("div",{onClick:()=>{K(),L("Details")},className:"action flex-grow-1 flex-shrink-0",children:"Details"}),e.jsxRuntimeExports.jsx("span",{className:"px-4"}),e.jsxRuntimeExports.jsx("a",{className:"action flex-grow-1 flex-shrink-0",href:n?.website,target:"_blank",rel:"noreferrer",onClick:l=>{l.preventDefault(),$(!0),L("Confirm Exit Modal Opened")},children:e.jsxRuntimeExports.jsx("div",{children:"Website"})})]})]}),o?.articles_membership?.status=="Active"&&e.jsxRuntimeExports.jsx("div",{className:"main-panel",children:e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo"}),e.jsxRuntimeExports.jsxs("div",{className:"splash",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-broadcast-tower"}),e.jsxRuntimeExports.jsxs("div",{className:"text",children:[e.jsxRuntimeExports.jsx("div",{className:"count",children:V?v.numberWithCommas(V):0}),e.jsxRuntimeExports.jsx("div",{className:"label",children:"ads avoided."})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"member-since",children:["Member since: ",e.jsxRuntimeExports.jsx(v.ArticlesDate,{format:"PP",date:o?.articles_membership?.membership_started})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsx("div",{className:"detail-title",children:e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:"Thanks for the support!"})})}),e.jsxRuntimeExports.jsxs("div",{className:"short-description",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-2",children:"Without support from users like you, we wouldn't be here."}),e.jsxRuntimeExports.jsxs("div",{className:"links-list",children:[e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/messages",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-comments-alt"}),"0 unread messages."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/notifications",onClick:()=>{T()},children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-bell"}),"0 notifications."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/account",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-cog"}),"Manage account settings."]})]})]})]})]})})]}),!t&&e.jsxRuntimeExports.jsx("div",{className:"advertise-with-us p-1",style:{backgroundColor:d.background_color||n?.background_color,color:d.font_color||n?.font_color,borderColor:d.border_color||n?.border_color},children:e.jsxRuntimeExports.jsxs(v.Link,{className:"small d-block w-100 text-center",href:"https://articles.media/advertising",newPage:!0,children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-share me-1"}),"Advertise with Articles Media!"]})})]})}const he=c.memo(fe);module.exports=he;
1
+ "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),o=require("react"),v=require("./numberWithCommas-CRgrb58X.cjs"),E=require("./index-Ddv_TnxK.cjs"),Q=require("./Button-0ZK0NKiK.cjs"),Y=require("./index-BlP2-uOi.cjs");function Z(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const i in s)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(s,i);Object.defineProperty(t,i,r.get?r:{enumerable:!0,get:()=>s[i]})}}return t.default=s,Object.freeze(t)}const _=Z(o);var P=new Map,S=new WeakMap,B=0,ee;function se(s){return s?(S.has(s)||(B+=1,S.set(s,B.toString())),S.get(s)):"0"}function te(s){return Object.keys(s).sort().filter(t=>s[t]!==void 0).map(t=>`${t}_${t==="root"?se(s.root):s[t]}`).toString()}function ne(s){const t=te(s);let i=P.get(t);if(!i){const r=new Map;let a;const x=new IntersectionObserver(p=>{p.forEach(c=>{var u;const R=c.isIntersecting&&a.some(f=>c.intersectionRatio>=f);s.trackVisibility&&typeof c.isVisible>"u"&&(c.isVisible=R),(u=r.get(c.target))==null||u.forEach(f=>{f(R,c)})})},s);a=x.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),i={id:t,observer:x,elements:r},P.set(t,i)}return i}function re(s,t,i={},r=ee){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const u=s.getBoundingClientRect();return t(r,{isIntersecting:r,target:s,intersectionRatio:typeof i.threshold=="number"?i.threshold:0,time:0,boundingClientRect:u,intersectionRect:u,rootBounds:u}),()=>{}}const{id:a,observer:x,elements:p}=ne(i),c=p.get(s)||[];return p.has(s)||p.set(s,c),c.push(t),x.observe(s),function(){c.splice(c.indexOf(t),1),c.length===0&&(p.delete(s),x.unobserve(s)),p.size===0&&(x.disconnect(),P.delete(a))}}function ie({threshold:s,delay:t,trackVisibility:i,rootMargin:r,root:a,triggerOnce:x,skip:p,initialInView:c,fallbackInView:u,onChange:R}={}){var f;const[n,d]=_.useState(null),k=_.useRef(R),N=_.useRef(c),[y,I]=_.useState({inView:!!c,entry:void 0});k.current=R,_.useEffect(()=>{if(N.current===void 0&&(N.current=c),p||!n)return;let j;return j=re(n,(w,A)=>{const D=N.current;N.current=w,!(D===void 0&&!w)&&(I({inView:w,entry:A}),k.current&&k.current(w,A),A.isIntersecting&&x&&j&&(j(),j=void 0))},{root:a,rootMargin:r,threshold:s,trackVisibility:i,delay:t},u),()=>{j&&j()}},[Array.isArray(s)?s.toString():s,n,a,r,x,p,i,u,t]);const g=(f=y.entry)==null?void 0:f.target,M=_.useRef(void 0);!n&&g&&!x&&!p&&M.current!==g&&(M.current=g,I({inView:!!c,entry:void 0}),N.current=c);const m=[d,y.inView,y.entry];return m.ref=m[0],m.inView=m[1],m.entry=m[2],m}const oe=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get(`http://localhost:3001/api/ads/${s.ad_id}`,{params:{ad_id:s.ad_id,user_ad_token:s.user_ad_token}})).data.result}catch{}return E.axios.get(s.url,{params:{ad_id:s.ad_id}}).then(t=>t.data.result)},ae=60,ce={dedupingInterval:1e3*60*ae},le=(s,t)=>{const{data:i,error:r,isLoading:a,mutate:x}=E.useSWR(s?{url:`https://articles.media/api/ads/${s}`,ad_id:s,user_ad_token:t}:null,oe,ce);return{data:i,error:r,isLoading:a,mutate:x}};function de(s){return t=>{const r=(s?Math[s]:Math.trunc)(t);return r===0?0:r}}function ue(s,t){return+v.toDate(s)-+v.toDate(t)}function W(s,t,i){const r=ue(s,t)/v.millisecondsInMinute;return de(i?.roundingMethod)(r)}function z(s){return Math.trunc(s*v.millisecondsInMinute)}const xe=async s=>{if(process.env.NODE_ENV==="development")try{return(await E.axios.get("http://localhost:3001/api/ads",{params:{}})).data}catch{}return E.axios.get(s.url,{params:{}}).then(t=>t.data)},U=60,me={dedupingInterval:z(U),focusThrottleInterval:z(U)},pe=s=>{const{data:t,error:i,isLoading:r,mutate:a}=E.useSWR(s?.loading||s?.disabled?null:{url:"https://articles.media/api/ads"},xe,me);return{data:t,error:i,isLoading:r,mutate:a}},fe=o.lazy(()=>Promise.resolve().then(()=>require("./AdDetailsModal-k840vrS2.cjs"))),je=o.lazy(()=>Promise.resolve().then(()=>require("./AdConfirmExitModal-CcSxmXKT.cjs")));function he(s,t){return Math.floor(Math.random()*(t-s+1))+s}function ve(s){let{previewMode:t,darkMode:i,user_ad_token:r,userDetails:a,userDetailsLoading:x}=s;const p=!1,c=[],[u,R]=o.useState(null),{data:f}=pe({loading:x,disabled:a?.articles_membership?.status=="Active"}),{data:n}=le(u,r);let d=s.previewData||{};const[k,N]=o.useState(null),[y,I]=o.useState(null),[g,M]=o.useState(null),[m,j]=o.useState(0),[w,A]=o.useState(!1),[D,$]=o.useState(!1),[X,L]=o.useState(!1),[Ee,Re]=o.useState(new Date),[O,K]=o.useState([]);o.useEffect(()=>{f&&f?.length>0&&!u&&(console.log("Ad Mounted or reduxAds changed"),R(s.ad_id||f[he(0,f?.length-1)]?._id))},[f]),o.useEffect(()=>{},[n]),o.useEffect(()=>{n?.populated_promos&&m>=0&&M(n?.populated_promos[m])},[m,n]);function F(){$(!D)}const{ref:G,inView:b}=ie({threshold:0,triggerOnce:!0});function V(l){if(t&&console.log("Preventing this event from being logged as this ad is being shown in preview mode."),O.find(h=>h==l)){console.log("Already logged this event");return}E.axios.get("/api/ads/event",{params:{ad_id:n?._id,event:l}}).then(function(h){K([...O,l]),console.log(h.data)}).catch(function(h){console.log(h)})}o.useEffect(()=>{if(!t&&(console.log("inView",b),b&&u)){let l=[{ad_id:u,date:new Date().toString()},...c.filter(h=>{if(console.log(W(new Date,new Date(h.date))),W(new Date,new Date(h.date))>5){console.log("adsViewed - Remove Old Ad View Object");return}else return console.log("adsViewed - Keep Ad View Object"),h})];console.log("unexpiredRecentViews",l)}},[b,u]);const[T,H]=o.useState(null),[J,C]=o.useState(!1);function q(){C(!0),console.log("logAdAvoided called",r),E.axios.get(process.env.NODE_ENV==="development"?"http://localhost:3001/api/user/advertising/avoided":"https://articles.media/api/user/advertising/avoided",{params:{user_id:a?._id},headers:{"x-articles-api-key":r}}).then(function(l){C(!1),H(l.data.avoided_count),console.log(l.data)}).catch(function(l){console.log(l),C(!1)})}return o.useEffect(()=>{t||(console.log("inView",b),a?.articles_membership?.status=="Active"&&b&&q())},[b,a]),x?null:e.jsxRuntimeExports.jsxs("div",{ref:G,className:Y.classNames("ad-wrap",{"active-member":a?.articles_membership?.status=="Active"}),style:{"--articles-ad-background-color":d.background_color||n?.background_color,"--articles-ad-font-color":d.font_color||n?.font_color,"--articles-ad-border-color":d.border_color||n?.border_color},children:[D&&e.jsxRuntimeExports.jsx(fe,{setModalShow:$,ad:n,previewData:d}),X&&e.jsxRuntimeExports.jsx(je,{setModalShow:L,ad:n,previewData:d}),e.jsxRuntimeExports.jsxs("div",{className:"ad",children:[a?.articles_membership?.status!=="Active"&&e.jsxRuntimeExports.jsxs("div",{className:"main-panel",children:[e.jsxRuntimeExports.jsx("div",{className:"ad-warning flex-header",children:e.jsxRuntimeExports.jsxs("div",{className:"",children:[n?.city&&"Local"," Advertisement"]})}),e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo",children:(d.logo?.location||n?.logo?.location)&&e.jsxRuntimeExports.jsx("img",{src:d?.logo?.key?`${process.env.NEXT_PUBLIC_CDN}${d?.logo?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.logo?.key}`,alt:""})}),e.jsxRuntimeExports.jsx("div",{className:"icon d-none",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-mug-hot"})}),e.jsxRuntimeExports.jsx("img",{className:"photo",src:d?.background?.key?`${process.env.NEXT_PUBLIC_CDN}${d.background?.key}`:`${process.env.NEXT_PUBLIC_CDN}${n?.background?.key}`,alt:""})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail-title",children:[e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:d?.business||n?.business})}),e.jsxRuntimeExports.jsxs("div",{className:"flex flex-column d-none",children:[e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-search-location"})}),e.jsxRuntimeExports.jsxs("span",{children:[n?.city,", ",n?.state]})]}),e.jsxRuntimeExports.jsxs("div",{className:"detail",children:[e.jsxRuntimeExports.jsx("span",{className:"icon",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-clock me-2"})}),e.jsxRuntimeExports.jsx("span",{children:"6:30AM–8PM"})]})]})]}),n?.city&&e.jsxRuntimeExports.jsx("div",{className:"details mb-3 d-none"}),e.jsxRuntimeExports.jsx("div",{className:"short-description",children:d?.description||n?.description})]})]}),p?.roles?.isDev&&n?.populated_promos?.length>0&&e.jsxRuntimeExports.jsxs("div",{children:[g&&e.jsxRuntimeExports.jsx("div",{className:"promos-wrap",children:g&&e.jsxRuntimeExports.jsxs("div",{className:"promo-wrap d-flex justify-content-between align-items-center mx-2 p-1 px-2 border border-2 border-light mb-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"",children:[e.jsxRuntimeExports.jsx("div",{children:g.title}),e.jsxRuntimeExports.jsx("div",{className:"small",children:e.jsxRuntimeExports.jsx("div",{className:"small",children:g.details})})]}),e.jsxRuntimeExports.jsx(Q.ArticlesButton,{className:"px-3",small:!0,onClick:()=>{console.log("Load Save Modal"),A(!0)},children:"Save"})]},g._id)}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between",children:[e.jsxRuntimeExports.jsxs("div",{className:"px-2",children:[n?.populated_promos?.length," Promos Active"]}),e.jsxRuntimeExports.jsxs("div",{className:"controls",children:[e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-left",type:"button",onClick:()=>{m==0?j(n?.populated_promos?.length-1):j(l=>l-1)}}),n?.populated_promos?.map((l,h)=>e.jsxRuntimeExports.jsx("i",{className:`fa-square ${h==m?"fad":"fas"}`},l._id)),e.jsxRuntimeExports.jsx("i",{className:"fad fa-arrow-circle-right",type:"button",onClick:()=>{m==n?.populated_promos?.length-1?j(0):j(l=>l+1)}})]})]})]}),e.jsxRuntimeExports.jsx("hr",{style:{borderColor:"white"},className:"mt-auto mb-0"}),e.jsxRuntimeExports.jsxs("div",{className:"action-wrap d-flex justify-content-lg-between px-3 py-2",children:[e.jsxRuntimeExports.jsx("div",{onClick:()=>{F(),V("Details")},className:"action flex-grow-1 flex-shrink-0",children:"Details"}),e.jsxRuntimeExports.jsx("span",{className:"px-4"}),e.jsxRuntimeExports.jsx("a",{className:"action flex-grow-1 flex-shrink-0",href:n?.website,target:"_blank",rel:"noreferrer",onClick:l=>{l.preventDefault(),L(!0),V("Confirm Exit Modal Opened")},children:e.jsxRuntimeExports.jsx("div",{children:"Website"})})]})]}),a?.articles_membership?.status=="Active"&&e.jsxRuntimeExports.jsx("div",{className:"main-panel",children:e.jsxRuntimeExports.jsxs("div",{className:"content-wrap",children:[e.jsxRuntimeExports.jsxs("div",{className:"photo-banner",children:[e.jsxRuntimeExports.jsx("div",{className:"logo"}),e.jsxRuntimeExports.jsxs("div",{className:"splash",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-broadcast-tower"}),e.jsxRuntimeExports.jsxs("div",{className:"text",children:[e.jsxRuntimeExports.jsx("div",{className:"count",children:J?e.jsxRuntimeExports.jsx("i",{className:"fas fa-spinner fa-spin me-0"}):T?v.numberWithCommas(T):0}),e.jsxRuntimeExports.jsx("div",{className:"label",children:"ads avoided."})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"member-since",children:["Member since: ",e.jsxRuntimeExports.jsx(v.ArticlesDate,{format:"PP",date:a?.articles_membership?.membership_started})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"details-wrap",children:[e.jsxRuntimeExports.jsx("div",{className:"detail-title",children:e.jsxRuntimeExports.jsx("div",{className:"detail",children:e.jsxRuntimeExports.jsx("span",{className:"h4",children:"Thanks for the support!"})})}),e.jsxRuntimeExports.jsxs("div",{className:"short-description",children:[e.jsxRuntimeExports.jsx("div",{className:"mb-2",children:"Without support from users like you, we wouldn't be here."}),e.jsxRuntimeExports.jsxs("div",{className:"links-list",children:[e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/messages",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-comments-alt"}),"0 unread messages."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/notifications",onClick:()=>{q()},children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-bell"}),"0 notifications."]}),e.jsxRuntimeExports.jsxs(v.Link,{newPage:!0,className:"link-item",href:"https://articles.media/settings/account",children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-cog"}),"Manage account settings."]})]})]})]})]})})]}),!t&&e.jsxRuntimeExports.jsx("div",{className:"advertise-with-us p-1",style:{backgroundColor:d.background_color||n?.background_color,color:d.font_color||n?.font_color,borderColor:d.border_color||n?.border_color},children:e.jsxRuntimeExports.jsxs(v.Link,{className:"small d-block w-100 text-center",href:"https://articles.media/advertising",newPage:!0,children:[e.jsxRuntimeExports.jsx("i",{className:"fas fa-share me-1"}),"Advertise with Articles Media!"]})})]})}const ge=o.memo(ve);module.exports=ge;
package/dist/Ad.js CHANGED
@@ -1,31 +1,31 @@
1
1
  import { j as e } from "./jsx-runtime-tc70JA_2.js";
2
2
  import * as _ from "react";
3
- import { lazy as K, memo as ee, useState as g, useEffect as y } from "react";
4
- import { t as W, m as F, n as se, A as te, L as C } from "./numberWithCommas-DnAkiOFL.js";
5
- import { u as G, a as w } from "./index-DLYx67wi.js";
6
- import { A as ae } from "./Button-_Quon8UV.js";
7
- import { c as re } from "./index-YnD2EP-S.js";
8
- var S = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new WeakMap(), U = 0, ne;
9
- function ie(s) {
10
- return s ? (R.has(s) || (U += 1, R.set(s, U.toString())), R.get(s)) : "0";
3
+ import { lazy as F, memo as te, useState as p, useEffect as y } from "react";
4
+ import { t as U, m as G, n as ae, A as re, L as C } from "./numberWithCommas-DnAkiOFL.js";
5
+ import { u as H, a as w } from "./index-DLYx67wi.js";
6
+ import { A as ne } from "./Button-_Quon8UV.js";
7
+ import { c as ie } from "./index-YnD2EP-S.js";
8
+ var $ = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new WeakMap(), X = 0, oe;
9
+ function le(s) {
10
+ return s ? (R.has(s) || (X += 1, R.set(s, X.toString())), R.get(s)) : "0";
11
11
  }
12
- function oe(s) {
12
+ function de(s) {
13
13
  return Object.keys(s).sort().filter(
14
14
  (t) => s[t] !== void 0
15
- ).map((t) => `${t}_${t === "root" ? ie(s.root) : s[t]}`).toString();
15
+ ).map((t) => `${t}_${t === "root" ? le(s.root) : s[t]}`).toString();
16
16
  }
17
- function le(s) {
18
- const t = oe(s);
19
- let o = S.get(t);
17
+ function ce(s) {
18
+ const t = de(s);
19
+ let o = $.get(t);
20
20
  if (!o) {
21
21
  const r = /* @__PURE__ */ new Map();
22
22
  let n;
23
- const u = new IntersectionObserver((h) => {
24
- h.forEach((i) => {
25
- var d;
26
- const j = i.isIntersecting && n.some((f) => i.intersectionRatio >= f);
27
- s.trackVisibility && typeof i.isVisible > "u" && (i.isVisible = j), (d = r.get(i.target)) == null || d.forEach((f) => {
28
- f(j, i);
23
+ const u = new IntersectionObserver((f) => {
24
+ f.forEach((i) => {
25
+ var c;
26
+ const j = i.isIntersecting && n.some((h) => i.intersectionRatio >= h);
27
+ s.trackVisibility && typeof i.isVisible > "u" && (i.isVisible = j), (c = r.get(i.target)) == null || c.forEach((h) => {
28
+ h(j, i);
29
29
  });
30
30
  });
31
31
  }, s);
@@ -33,58 +33,58 @@ function le(s) {
33
33
  id: t,
34
34
  observer: u,
35
35
  elements: r
36
- }, S.set(t, o);
36
+ }, $.set(t, o);
37
37
  }
38
38
  return o;
39
39
  }
40
- function ce(s, t, o = {}, r = ne) {
40
+ function ue(s, t, o = {}, r = oe) {
41
41
  if (typeof window.IntersectionObserver > "u" && r !== void 0) {
42
- const d = s.getBoundingClientRect();
42
+ const c = s.getBoundingClientRect();
43
43
  return t(r, {
44
44
  isIntersecting: r,
45
45
  target: s,
46
46
  intersectionRatio: typeof o.threshold == "number" ? o.threshold : 0,
47
47
  time: 0,
48
- boundingClientRect: d,
49
- intersectionRect: d,
50
- rootBounds: d
48
+ boundingClientRect: c,
49
+ intersectionRect: c,
50
+ rootBounds: c
51
51
  }), () => {
52
52
  };
53
53
  }
54
- const { id: n, observer: u, elements: h } = le(o), i = h.get(s) || [];
55
- return h.has(s) || h.set(s, i), i.push(t), u.observe(s), function() {
56
- i.splice(i.indexOf(t), 1), i.length === 0 && (h.delete(s), u.unobserve(s)), h.size === 0 && (u.disconnect(), S.delete(n));
54
+ const { id: n, observer: u, elements: f } = ce(o), i = f.get(s) || [];
55
+ return f.has(s) || f.set(s, i), i.push(t), u.observe(s), function() {
56
+ i.splice(i.indexOf(t), 1), i.length === 0 && (f.delete(s), u.unobserve(s)), f.size === 0 && (u.disconnect(), $.delete(n));
57
57
  };
58
58
  }
59
- function de({
59
+ function me({
60
60
  threshold: s,
61
61
  delay: t,
62
62
  trackVisibility: o,
63
63
  rootMargin: r,
64
64
  root: n,
65
65
  triggerOnce: u,
66
- skip: h,
66
+ skip: f,
67
67
  initialInView: i,
68
- fallbackInView: d,
68
+ fallbackInView: c,
69
69
  onChange: j
70
70
  } = {}) {
71
- var f;
72
- const [a, c] = _.useState(null), M = _.useRef(j), N = _.useRef(i), [D, P] = _.useState({
71
+ var h;
72
+ const [a, d] = _.useState(null), M = _.useRef(j), N = _.useRef(i), [D, P] = _.useState({
73
73
  inView: !!i,
74
74
  entry: void 0
75
75
  });
76
76
  M.current = j, _.useEffect(
77
77
  () => {
78
- if (N.current === void 0 && (N.current = i), h || !a) return;
79
- let p;
80
- return p = ce(
78
+ if (N.current === void 0 && (N.current = i), f || !a) return;
79
+ let v;
80
+ return v = ue(
81
81
  a,
82
82
  (A, k) => {
83
83
  const I = N.current;
84
84
  N.current = A, !(I === void 0 && !A) && (P({
85
85
  inView: A,
86
86
  entry: k
87
- }), M.current && M.current(A, k), k.isIntersecting && u && p && (p(), p = void 0));
87
+ }), M.current && M.current(A, k), k.isIntersecting && u && v && (v(), v = void 0));
88
88
  },
89
89
  {
90
90
  root: n,
@@ -94,9 +94,9 @@ function de({
94
94
  trackVisibility: o,
95
95
  delay: t
96
96
  },
97
- d
97
+ c
98
98
  ), () => {
99
- p && p();
99
+ v && v();
100
100
  };
101
101
  },
102
102
  // We break the rule here, because we aren't including the actual `threshold` variable
@@ -108,21 +108,21 @@ function de({
108
108
  n,
109
109
  r,
110
110
  u,
111
- h,
111
+ f,
112
112
  o,
113
- d,
113
+ c,
114
114
  t
115
115
  ]
116
116
  );
117
- const x = (f = D.entry) == null ? void 0 : f.target, E = _.useRef(void 0);
118
- !a && x && !u && !h && E.current !== x && (E.current = x, P({
117
+ const x = (h = D.entry) == null ? void 0 : h.target, E = _.useRef(void 0);
118
+ !a && x && !u && !f && E.current !== x && (E.current = x, P({
119
119
  inView: !!i,
120
120
  entry: void 0
121
121
  }), N.current = i);
122
- const m = [c, D.inView, D.entry];
122
+ const m = [d, D.inView, D.entry];
123
123
  return m.ref = m[0], m.inView = m[1], m.entry = m[2], m;
124
124
  }
125
- const ue = async (s) => {
125
+ const fe = async (s) => {
126
126
  if (process.env.NODE_ENV === "development")
127
127
  try {
128
128
  return (await w.get(`http://localhost:3001/api/ads/${s.ad_id}`, {
@@ -138,19 +138,19 @@ const ue = async (s) => {
138
138
  ad_id: s.ad_id
139
139
  }
140
140
  }).then((t) => t.data.result);
141
- }, me = 60, he = {
142
- dedupingInterval: 1e3 * 60 * me
141
+ }, he = 60, pe = {
142
+ dedupingInterval: 1e3 * 60 * he
143
143
  // keepPreviousData: true,
144
144
  // fallbackData: []
145
- }, fe = (s, t) => {
146
- const { data: o, error: r, isLoading: n, mutate: u } = G(
145
+ }, ve = (s, t) => {
146
+ const { data: o, error: r, isLoading: n, mutate: u } = H(
147
147
  s ? {
148
148
  url: `https://articles.media/api/ads/${s}`,
149
149
  ad_id: s,
150
150
  user_ad_token: t
151
151
  } : null,
152
- ue,
153
- he
152
+ fe,
153
+ pe
154
154
  );
155
155
  return {
156
156
  data: o,
@@ -159,23 +159,23 @@ const ue = async (s) => {
159
159
  mutate: u
160
160
  };
161
161
  };
162
- function pe(s) {
162
+ function ge(s) {
163
163
  return (t) => {
164
164
  const r = (s ? Math[s] : Math.trunc)(t);
165
165
  return r === 0 ? 0 : r;
166
166
  };
167
167
  }
168
- function ve(s, t) {
169
- return +W(s) - +W(t);
168
+ function xe(s, t) {
169
+ return +U(s) - +U(t);
170
170
  }
171
- function X(s, t, o) {
172
- const r = ve(s, t) / F;
173
- return pe(o?.roundingMethod)(r);
171
+ function z(s, t, o) {
172
+ const r = xe(s, t) / G;
173
+ return ge(o?.roundingMethod)(r);
174
174
  }
175
- function z(s) {
176
- return Math.trunc(s * F);
175
+ function q(s) {
176
+ return Math.trunc(s * G);
177
177
  }
178
- const ge = async (s) => {
178
+ const je = async (s) => {
179
179
  if (process.env.NODE_ENV === "development")
180
180
  try {
181
181
  return (await w.get("http://localhost:3001/api/ads", {
@@ -190,19 +190,19 @@ const ge = async (s) => {
190
190
  // ad_id: data.ad_id
191
191
  }
192
192
  }).then((t) => t.data);
193
- }, q = 60, xe = {
194
- dedupingInterval: z(q),
195
- focusThrottleInterval: z(q)
193
+ }, K = 60, Ne = {
194
+ dedupingInterval: q(K),
195
+ focusThrottleInterval: q(K)
196
196
  // keepPreviousData: true,
197
197
  // fallbackData: []
198
- }, je = (s) => {
199
- const { data: t, error: o, isLoading: r, mutate: n } = G(
198
+ }, be = (s) => {
199
+ const { data: t, error: o, isLoading: r, mutate: n } = H(
200
200
  s?.loading || s?.disabled ? null : {
201
201
  url: "https://articles.media/api/ads"
202
202
  // ad_id
203
203
  },
204
- ge,
205
- xe
204
+ je,
205
+ Ne
206
206
  );
207
207
  return {
208
208
  data: t,
@@ -210,11 +210,11 @@ const ge = async (s) => {
210
210
  isLoading: r,
211
211
  mutate: n
212
212
  };
213
- }, Ne = K(() => import("./AdDetailsModal-Bp5hZm9N.js")), be = K(() => import("./AdConfirmExitModal-CKkMAvBK.js"));
214
- function _e(s, t) {
213
+ }, _e = F(() => import("./AdDetailsModal-Bp5hZm9N.js")), we = F(() => import("./AdConfirmExitModal-CKkMAvBK.js"));
214
+ function Ae(s, t) {
215
215
  return Math.floor(Math.random() * (t - s + 1)) + s;
216
216
  }
217
- function we(s) {
217
+ function ke(s) {
218
218
  let {
219
219
  previewMode: t,
220
220
  darkMode: o,
@@ -222,32 +222,32 @@ function we(s) {
222
222
  userDetails: n,
223
223
  userDetailsLoading: u
224
224
  } = s;
225
- const h = !1, i = [], [d, j] = g(null), {
226
- data: f
227
- } = je(
225
+ const f = !1, i = [], [c, j] = p(null), {
226
+ data: h
227
+ } = be(
228
228
  {
229
229
  loading: u,
230
230
  disabled: n?.articles_membership?.status == "Active"
231
231
  }
232
- ), { data: a } = fe(d, r);
233
- let c = s.previewData || {};
234
- const [M, N] = g(null), [D, P] = g(null), [x, E] = g(null), [m, p] = g(0), [A, k] = g(!1), [I, $] = g(!1), [H, L] = g(!1), [Ae, ke] = g(/* @__PURE__ */ new Date()), [V, J] = g([]);
232
+ ), { data: a } = ve(c, r);
233
+ let d = s.previewData || {};
234
+ const [M, N] = p(null), [D, P] = p(null), [x, E] = p(null), [m, v] = p(0), [A, k] = p(!1), [I, L] = p(!1), [J, V] = p(!1), [ye, Me] = p(/* @__PURE__ */ new Date()), [O, Q] = p([]);
235
235
  y(() => {
236
- f && f?.length > 0 && !d && (console.log("Ad Mounted or reduxAds changed"), j(s.ad_id || f[_e(0, f?.length - 1)]?._id));
237
- }, [f]), y(() => {
236
+ h && h?.length > 0 && !c && (console.log("Ad Mounted or reduxAds changed"), j(s.ad_id || h[Ae(0, h?.length - 1)]?._id));
237
+ }, [h]), y(() => {
238
238
  }, [a]), y(() => {
239
239
  a?.populated_promos && m >= 0 && E(a?.populated_promos[m]);
240
240
  }, [m, a]);
241
- function Q() {
242
- $(!I);
241
+ function Y() {
242
+ L(!I);
243
243
  }
244
- const { ref: Y, inView: b } = de({
244
+ const { ref: Z, inView: b } = me({
245
245
  /* Optional options */
246
246
  threshold: 0,
247
247
  triggerOnce: !0
248
248
  });
249
- function O(l) {
250
- if (t && console.log("Preventing this event from being logged as this ad is being shown in preview mode."), V.find((v) => v == l)) {
249
+ function T(l) {
250
+ if (t && console.log("Preventing this event from being logged as this ad is being shown in preview mode."), O.find((g) => g == l)) {
251
251
  console.log("Already logged this event");
252
252
  return;
253
253
  }
@@ -256,35 +256,35 @@ function we(s) {
256
256
  ad_id: a?._id,
257
257
  event: l
258
258
  }
259
- }).then(function(v) {
260
- J([...V, l]), console.log(v.data);
261
- }).catch(function(v) {
262
- console.log(v);
259
+ }).then(function(g) {
260
+ Q([...O, l]), console.log(g.data);
261
+ }).catch(function(g) {
262
+ console.log(g);
263
263
  });
264
264
  }
265
265
  y(() => {
266
- if (!t && (console.log("inView", b), b && d)) {
266
+ if (!t && (console.log("inView", b), b && c)) {
267
267
  let l = [
268
268
  {
269
- ad_id: d,
269
+ ad_id: c,
270
270
  date: (/* @__PURE__ */ new Date()).toString()
271
271
  },
272
- ...i.filter((v) => {
272
+ ...i.filter((g) => {
273
273
  if (console.log(
274
- X(/* @__PURE__ */ new Date(), new Date(v.date))
275
- ), X(/* @__PURE__ */ new Date(), new Date(v.date)) > 5) {
274
+ z(/* @__PURE__ */ new Date(), new Date(g.date))
275
+ ), z(/* @__PURE__ */ new Date(), new Date(g.date)) > 5) {
276
276
  console.log("adsViewed - Remove Old Ad View Object");
277
277
  return;
278
278
  } else
279
- return console.log("adsViewed - Keep Ad View Object"), v;
279
+ return console.log("adsViewed - Keep Ad View Object"), g;
280
280
  })
281
281
  ];
282
282
  console.log("unexpiredRecentViews", l);
283
283
  }
284
- }, [b, d]);
285
- const [T, Z] = g(null);
286
- function B() {
287
- console.log("logAdAvoided called", r), w.get(
284
+ }, [b, c]);
285
+ const [B, ee] = p(null), [se, S] = p(!1);
286
+ function W() {
287
+ S(!0), console.log("logAdAvoided called", r), w.get(
288
288
  process.env.NODE_ENV === "development" ? "http://localhost:3001/api/user/advertising/avoided" : "https://articles.media/api/user/advertising/avoided",
289
289
  {
290
290
  params: {
@@ -295,43 +295,43 @@ function we(s) {
295
295
  }
296
296
  }
297
297
  ).then(function(l) {
298
- Z(l.data.avoided_count), console.log(l.data);
298
+ S(!1), ee(l.data.avoided_count), console.log(l.data);
299
299
  }).catch(function(l) {
300
- console.log(l);
300
+ console.log(l), S(!1);
301
301
  });
302
302
  }
303
303
  return y(() => {
304
- t || (console.log("inView", b), n?.articles_membership?.status == "Active" && b && B());
304
+ t || (console.log("inView", b), n?.articles_membership?.status == "Active" && b && W());
305
305
  }, [b, n]), u ? null : /* @__PURE__ */ e.jsxs(
306
306
  "div",
307
307
  {
308
- ref: Y,
309
- className: re(
308
+ ref: Z,
309
+ className: ie(
310
310
  "ad-wrap",
311
311
  {
312
312
  "active-member": n?.articles_membership?.status == "Active"
313
313
  }
314
314
  ),
315
315
  style: {
316
- "--articles-ad-background-color": c.background_color || a?.background_color,
317
- "--articles-ad-font-color": c.font_color || a?.font_color,
318
- "--articles-ad-border-color": c.border_color || a?.border_color
316
+ "--articles-ad-background-color": d.background_color || a?.background_color,
317
+ "--articles-ad-font-color": d.font_color || a?.font_color,
318
+ "--articles-ad-border-color": d.border_color || a?.border_color
319
319
  },
320
320
  children: [
321
321
  I && /* @__PURE__ */ e.jsx(
322
- Ne,
322
+ _e,
323
323
  {
324
- setModalShow: $,
324
+ setModalShow: L,
325
325
  ad: a,
326
- previewData: c
326
+ previewData: d
327
327
  }
328
328
  ),
329
- H && /* @__PURE__ */ e.jsx(
330
- be,
329
+ J && /* @__PURE__ */ e.jsx(
330
+ we,
331
331
  {
332
- setModalShow: L,
332
+ setModalShow: V,
333
333
  ad: a,
334
- previewData: c
334
+ previewData: d
335
335
  }
336
336
  ),
337
337
  /* @__PURE__ */ e.jsxs(
@@ -350,10 +350,10 @@ function we(s) {
350
350
  ] }) }),
351
351
  /* @__PURE__ */ e.jsxs("div", { className: "content-wrap", children: [
352
352
  /* @__PURE__ */ e.jsxs("div", { className: "photo-banner", children: [
353
- /* @__PURE__ */ e.jsx("div", { className: "logo", children: (c.logo?.location || a?.logo?.location) && /* @__PURE__ */ e.jsx(
353
+ /* @__PURE__ */ e.jsx("div", { className: "logo", children: (d.logo?.location || a?.logo?.location) && /* @__PURE__ */ e.jsx(
354
354
  "img",
355
355
  {
356
- src: c?.logo?.key ? `${process.env.NEXT_PUBLIC_CDN}${c?.logo?.key}` : `${process.env.NEXT_PUBLIC_CDN}${a?.logo?.key}`,
356
+ src: d?.logo?.key ? `${process.env.NEXT_PUBLIC_CDN}${d?.logo?.key}` : `${process.env.NEXT_PUBLIC_CDN}${a?.logo?.key}`,
357
357
  alt: ""
358
358
  }
359
359
  ) }),
@@ -362,14 +362,14 @@ function we(s) {
362
362
  "img",
363
363
  {
364
364
  className: "photo",
365
- src: c?.background?.key ? `${process.env.NEXT_PUBLIC_CDN}${c.background?.key}` : `${process.env.NEXT_PUBLIC_CDN}${a?.background?.key}`,
365
+ src: d?.background?.key ? `${process.env.NEXT_PUBLIC_CDN}${d.background?.key}` : `${process.env.NEXT_PUBLIC_CDN}${a?.background?.key}`,
366
366
  alt: ""
367
367
  }
368
368
  )
369
369
  ] }),
370
370
  /* @__PURE__ */ e.jsxs("div", { className: "details-wrap", children: [
371
371
  /* @__PURE__ */ e.jsxs("div", { className: "detail-title", children: [
372
- /* @__PURE__ */ e.jsx("div", { className: "detail", children: /* @__PURE__ */ e.jsx("span", { className: "h4", children: c?.business || a?.business }) }),
372
+ /* @__PURE__ */ e.jsx("div", { className: "detail", children: /* @__PURE__ */ e.jsx("span", { className: "h4", children: d?.business || a?.business }) }),
373
373
  /* @__PURE__ */ e.jsxs("div", { className: "flex flex-column d-none", children: [
374
374
  /* @__PURE__ */ e.jsxs("div", { className: "detail", children: [
375
375
  /* @__PURE__ */ e.jsx("span", { className: "icon", children: /* @__PURE__ */ e.jsx("i", { className: "fas fa-search-location" }) }),
@@ -386,10 +386,10 @@ function we(s) {
386
386
  ] })
387
387
  ] }),
388
388
  a?.city && /* @__PURE__ */ e.jsx("div", { className: "details mb-3 d-none" }),
389
- /* @__PURE__ */ e.jsx("div", { className: "short-description", children: c?.description || a?.description })
389
+ /* @__PURE__ */ e.jsx("div", { className: "short-description", children: d?.description || a?.description })
390
390
  ] })
391
391
  ] }),
392
- h?.roles?.isDev && a?.populated_promos?.length > 0 && /* @__PURE__ */ e.jsxs("div", { children: [
392
+ f?.roles?.isDev && a?.populated_promos?.length > 0 && /* @__PURE__ */ e.jsxs("div", { children: [
393
393
  x && /* @__PURE__ */ e.jsx("div", { className: "promos-wrap", children: x && /* @__PURE__ */ e.jsxs(
394
394
  "div",
395
395
  {
@@ -400,7 +400,7 @@ function we(s) {
400
400
  /* @__PURE__ */ e.jsx("div", { className: "small", children: /* @__PURE__ */ e.jsx("div", { className: "small", children: x.details }) })
401
401
  ] }),
402
402
  /* @__PURE__ */ e.jsx(
403
- ae,
403
+ ne,
404
404
  {
405
405
  className: "px-3",
406
406
  small: !0,
@@ -426,15 +426,15 @@ function we(s) {
426
426
  className: "fad fa-arrow-circle-left",
427
427
  type: "button",
428
428
  onClick: () => {
429
- m == 0 ? p(a?.populated_promos?.length - 1) : p((l) => l - 1);
429
+ m == 0 ? v(a?.populated_promos?.length - 1) : v((l) => l - 1);
430
430
  }
431
431
  }
432
432
  ),
433
433
  a?.populated_promos?.map(
434
- (l, v) => /* @__PURE__ */ e.jsx(
434
+ (l, g) => /* @__PURE__ */ e.jsx(
435
435
  "i",
436
436
  {
437
- className: `fa-square ${v == m ? "fad" : "fas"}`
437
+ className: `fa-square ${g == m ? "fad" : "fas"}`
438
438
  },
439
439
  l._id
440
440
  )
@@ -445,7 +445,7 @@ function we(s) {
445
445
  className: "fad fa-arrow-circle-right",
446
446
  type: "button",
447
447
  onClick: () => {
448
- m == a?.populated_promos?.length - 1 ? p(0) : p((l) => l + 1);
448
+ m == a?.populated_promos?.length - 1 ? v(0) : v((l) => l + 1);
449
449
  }
450
450
  }
451
451
  )
@@ -458,7 +458,7 @@ function we(s) {
458
458
  "div",
459
459
  {
460
460
  onClick: () => {
461
- Q(), O("Details");
461
+ Y(), T("Details");
462
462
  },
463
463
  className: "action flex-grow-1 flex-shrink-0",
464
464
  children: "Details"
@@ -473,7 +473,7 @@ function we(s) {
473
473
  target: "_blank",
474
474
  rel: "noreferrer",
475
475
  onClick: (l) => {
476
- l.preventDefault(), L(!0), O("Confirm Exit Modal Opened");
476
+ l.preventDefault(), V(!0), T("Confirm Exit Modal Opened");
477
477
  },
478
478
  children: /* @__PURE__ */ e.jsx("div", { children: "Website" })
479
479
  }
@@ -492,7 +492,13 @@ function we(s) {
492
492
  /* @__PURE__ */ e.jsxs("div", { className: "splash", children: [
493
493
  /* @__PURE__ */ e.jsx("i", { className: "fas fa-broadcast-tower" }),
494
494
  /* @__PURE__ */ e.jsxs("div", { className: "text", children: [
495
- /* @__PURE__ */ e.jsx("div", { className: "count", children: T ? se(T) : 0 }),
495
+ /* @__PURE__ */ e.jsx(
496
+ "div",
497
+ {
498
+ className: "count",
499
+ children: se ? /* @__PURE__ */ e.jsx("i", { className: "fas fa-spinner fa-spin me-0" }) : B ? ae(B) : 0
500
+ }
501
+ ),
496
502
  /* @__PURE__ */ e.jsx("div", { className: "label", children: "ads avoided." })
497
503
  ] })
498
504
  ] }),
@@ -502,7 +508,7 @@ function we(s) {
502
508
  className: "member-since",
503
509
  children: [
504
510
  "Member since: ",
505
- /* @__PURE__ */ e.jsx(te, { format: "PP", date: n?.articles_membership?.membership_started })
511
+ /* @__PURE__ */ e.jsx(re, { format: "PP", date: n?.articles_membership?.membership_started })
506
512
  ]
507
513
  }
508
514
  )
@@ -531,7 +537,7 @@ function we(s) {
531
537
  className: "link-item",
532
538
  href: "https://articles.media/settings/notifications",
533
539
  onClick: () => {
534
- B();
540
+ W();
535
541
  },
536
542
  children: [
537
543
  /* @__PURE__ */ e.jsx("i", { className: "fas fa-bell" }),
@@ -566,9 +572,9 @@ function we(s) {
566
572
  className: "advertise-with-us p-1",
567
573
  style: {
568
574
  // ...(props.previewData ? props.previewData.background_color : ad?.background_color),
569
- backgroundColor: c.background_color || a?.background_color,
570
- color: c.font_color || a?.font_color,
571
- borderColor: c.border_color || a?.border_color
575
+ backgroundColor: d.background_color || a?.background_color,
576
+ color: d.font_color || a?.font_color,
577
+ borderColor: d.border_color || a?.border_color
572
578
  },
573
579
  children: /* @__PURE__ */ e.jsxs(
574
580
  C,
@@ -588,7 +594,7 @@ function we(s) {
588
594
  }
589
595
  );
590
596
  }
591
- const Re = ee(we);
597
+ const Se = te(ke);
592
598
  export {
593
- Re as default
599
+ Se as default
594
600
  };
@@ -1,4 +1,4 @@
1
- "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),l=require("./index-Ddv_TnxK.cjs"),u=require("./index-BlP2-uOi.cjs"),r=require("react"),d=s=>l.axios.get(s).then(t=>t.data),i=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3001/api/config":null,d,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},m=s=>l.axios.get(s).then(t=>t.data),c=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3012/api/status":null,m,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},p=r.lazy(()=>Promise.resolve().then(()=>require("./StatusModal-BdAmgekT.cjs")));function x(s){const[t,n]=r.useState(!1),{data:a}=i({disable:process.env.NODE_ENV!=="development"}),{data:o}=c({disable:process.env.NODE_ENV!=="development"});return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:process.env.NODE_ENV==="development"&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("style",{children:`
1
+ "use strict";const e=require("./jsx-runtime-nZSsnGb7.cjs"),l=require("./index-Ddv_TnxK.cjs"),u=require("./index-BlP2-uOi.cjs"),r=require("react"),d=s=>l.axios.get(s).then(t=>t.data),i=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3001/api/config":null,d,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},m=s=>l.axios.get(s).then(t=>t.data),c=s=>{const{data:t,error:n,isLoading:a,mutate:o}=l.useSWR(process.env.NODE_ENV==="development"&&!s?.disable?"http://localhost:3012/api/status":null,m,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:n,isLoading:a,mutate:o}},p=r.lazy(()=>Promise.resolve().then(()=>require("./StatusModal-BlwaI-2B.cjs")));function x(s){const[t,n]=r.useState(!1),{data:a}=i({disable:process.env.NODE_ENV!=="development"}),{data:o}=c({disable:process.env.NODE_ENV!=="development"});return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("link",{rel:"stylesheet",href:"https://cdn.articles.media/fonts/fontawesome/css/all.min.css"}),process.env.NODE_ENV==="development"&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("style",{children:`
2
2
  @keyframes grow-shrink {
3
3
  0% { transform: translateY(-50px); }
4
4
  50% { transform: translateY(0px); }
@@ -30,4 +30,4 @@
30
30
  .articles-global-body.auth-connected {
31
31
  border-color: blue;
32
32
  }
33
- `}),e.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(!0)},className:u.classNames("articles-global-body",{"main-connected":a,"auth-connected":o}),children:[e.jsxRuntimeExports.jsx("link",{rel:"stylesheet",href:"https://cdn.articles.media/fonts/fontawesome/css/all.min.css"}),e.jsxRuntimeExports.jsx("div",{className:"content",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-thumbs-up"})})]}),t&&e.jsxRuntimeExports.jsx(r.Suspense,{children:e.jsxRuntimeExports.jsx(p,{show:t,setShow:n})})]})})}const h=r.memo(x);exports.GlobalBody_default=h;exports.useAuthSiteStatus=c;exports.useMainSiteStatus=i;
33
+ `}),e.jsxRuntimeExports.jsx("div",{onClick:()=>{n(!0)},className:u.classNames("articles-global-body",{"main-connected":a,"auth-connected":o}),children:e.jsxRuntimeExports.jsx("div",{className:"content",children:e.jsxRuntimeExports.jsx("i",{className:"fas fa-thumbs-up"})})}),t&&e.jsxRuntimeExports.jsx(r.Suspense,{children:e.jsxRuntimeExports.jsx(p,{show:t,setShow:n})})]})]})}const h=r.memo(x);exports.GlobalBody_default=h;exports.useAuthSiteStatus=c;exports.useMainSiteStatus=i;
@@ -36,7 +36,7 @@ const p = (s) => l.get(s).then((t) => t.data), f = (s) => {
36
36
  isLoading: o,
37
37
  mutate: n
38
38
  };
39
- }, x = c(() => import("./StatusModal-C757TssZ.js"));
39
+ }, x = c(() => import("./StatusModal-CAVxWCUq.js"));
40
40
  function g(s) {
41
41
  const [t, a] = u(!1), {
42
42
  data: o
@@ -47,8 +47,16 @@ function g(s) {
47
47
  } = b({
48
48
  disable: process.env.NODE_ENV !== "development"
49
49
  });
50
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: process.env.NODE_ENV === "development" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
51
- /* @__PURE__ */ e.jsx("style", { children: `
50
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
51
+ /* @__PURE__ */ e.jsx(
52
+ "link",
53
+ {
54
+ rel: "stylesheet",
55
+ href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
56
+ }
57
+ ),
58
+ process.env.NODE_ENV === "development" && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
59
+ /* @__PURE__ */ e.jsx("style", { children: `
52
60
  @keyframes grow-shrink {
53
61
  0% { transform: translateY(-50px); }
54
62
  50% { transform: translateY(0px); }
@@ -81,39 +89,31 @@ function g(s) {
81
89
  border-color: blue;
82
90
  }
83
91
  ` }),
84
- /* @__PURE__ */ e.jsxs(
85
- "div",
86
- {
87
- onClick: () => {
88
- a(!0);
89
- },
90
- className: i(
91
- "articles-global-body",
92
- {
93
- "main-connected": o,
94
- "auth-connected": n
95
- }
96
- ),
97
- children: [
98
- /* @__PURE__ */ e.jsx(
99
- "link",
92
+ /* @__PURE__ */ e.jsx(
93
+ "div",
94
+ {
95
+ onClick: () => {
96
+ a(!0);
97
+ },
98
+ className: i(
99
+ "articles-global-body",
100
100
  {
101
- rel: "stylesheet",
102
- href: "https://cdn.articles.media/fonts/fontawesome/css/all.min.css"
101
+ "main-connected": o,
102
+ "auth-connected": n
103
103
  }
104
104
  ),
105
- /* @__PURE__ */ e.jsx("div", { className: "content", children: /* @__PURE__ */ e.jsx("i", { className: "fas fa-thumbs-up" }) })
106
- ]
107
- }
108
- ),
109
- t && /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx(
110
- x,
111
- {
112
- show: t,
113
- setShow: a
114
- }
115
- ) })
116
- ] }) });
105
+ children: /* @__PURE__ */ e.jsx("div", { className: "content", children: /* @__PURE__ */ e.jsx("i", { className: "fas fa-thumbs-up" }) })
106
+ }
107
+ ),
108
+ t && /* @__PURE__ */ e.jsx(m, { children: /* @__PURE__ */ e.jsx(
109
+ x,
110
+ {
111
+ show: t,
112
+ setShow: a
113
+ }
114
+ ) })
115
+ ] })
116
+ ] });
117
117
  }
118
118
  const E = d(g);
119
119
  export {
@@ -1 +1 @@
1
- "use strict";require("./jsx-runtime-nZSsnGb7.cjs");const e=require("./GlobalBody-BbM8X_Jk.cjs");require("./index-BlP2-uOi.cjs");require("react");module.exports=e.GlobalBody_default;
1
+ "use strict";require("./jsx-runtime-nZSsnGb7.cjs");const e=require("./GlobalBody-BQ2qC81K.cjs");require("./index-BlP2-uOi.cjs");require("react");module.exports=e.GlobalBody_default;
@@ -1,5 +1,5 @@
1
1
  import "./jsx-runtime-tc70JA_2.js";
2
- import { G as i } from "./GlobalBody-Dw17Ik2b.js";
2
+ import { G as i } from "./GlobalBody-tmIC_GWn.js";
3
3
  import "./index-YnD2EP-S.js";
4
4
  import "react";
5
5
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.cjs"),j=require("react"),l=require("./Button-0ZK0NKiK.cjs"),S=require("./GlobalBody-BbM8X_Jk.cjs"),t=require("./Modal-Wmqy9fOm.cjs");function g({show:h,setShow:u}){const[s,p]=j.useState(!1),[i,E]=j.useState(!1),c=(R,m,f)=>f?"...":m?m.response?.status||"Error":R?"200":"-",{data:r,error:n,isLoading:d}=S.useMainSiteStatus({disable:process.env.NODE_ENV!=="development"}),{data:a,error:o,isLoading:x}=S.useAuthSiteStatus({disable:process.env.NODE_ENV!=="development"});return e.jsxRuntimeExports.jsxs(t.Modal,{show:h,size:"md",className:"articles-modal",centered:!0,onHide:()=>u(!1),children:[e.jsxRuntimeExports.jsx(t.Modal.Header,{children:e.jsxRuntimeExports.jsx(t.Modal.Title,{children:"Status Details"})}),e.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mb-2",children:[e.jsxRuntimeExports.jsxs("h5",{className:"mb-0 me-2",children:["Main Site Status: ",c(r,n,d)]}),e.jsxRuntimeExports.jsxs(l.ArticlesButton,{variant:"link",size:"sm",className:"p-0",onClick:()=>p(!s),children:[s?"Hide":"View"," More"]})]}),s&&e.jsxRuntimeExports.jsxs("pre",{children:[d&&"Loading...",n&&`Error: ${n.message}`,r&&JSON.stringify(r,null,2)]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mb-2",children:[e.jsxRuntimeExports.jsxs("h5",{className:"mb-0 me-2",children:["Auth Site Status: ",c(a,o,x)]}),e.jsxRuntimeExports.jsxs(l.ArticlesButton,{variant:"link",size:"sm",className:"p-0",onClick:()=>E(!i),children:[i?"Hide":"View"," More"]})]}),i&&e.jsxRuntimeExports.jsxs("pre",{children:[x&&"Loading...",o&&`Error: ${o.message}`,a&&JSON.stringify(a,null,2)]})]}),e.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"justify-content-between",children:e.jsxRuntimeExports.jsx(l.ArticlesButton,{variant:"articles",onClick:()=>{u(!1)},children:"Close"})})]})}exports.default=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-nZSsnGb7.cjs"),j=require("react"),l=require("./Button-0ZK0NKiK.cjs"),S=require("./GlobalBody-BQ2qC81K.cjs"),t=require("./Modal-Wmqy9fOm.cjs");function g({show:h,setShow:u}){const[s,p]=j.useState(!1),[i,E]=j.useState(!1),c=(R,m,f)=>f?"...":m?m.response?.status||"Error":R?"200":"-",{data:r,error:n,isLoading:d}=S.useMainSiteStatus({disable:process.env.NODE_ENV!=="development"}),{data:a,error:o,isLoading:x}=S.useAuthSiteStatus({disable:process.env.NODE_ENV!=="development"});return e.jsxRuntimeExports.jsxs(t.Modal,{show:h,size:"md",className:"articles-modal",centered:!0,onHide:()=>u(!1),children:[e.jsxRuntimeExports.jsx(t.Modal.Header,{children:e.jsxRuntimeExports.jsx(t.Modal.Title,{children:"Status Details"})}),e.jsxRuntimeExports.jsxs(t.Modal.Body,{children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mb-2",children:[e.jsxRuntimeExports.jsxs("h5",{className:"mb-0 me-2",children:["Main Site Status: ",c(r,n,d)]}),e.jsxRuntimeExports.jsxs(l.ArticlesButton,{variant:"link",size:"sm",className:"p-0",onClick:()=>p(!s),children:[s?"Hide":"View"," More"]})]}),s&&e.jsxRuntimeExports.jsxs("pre",{children:[d&&"Loading...",n&&`Error: ${n.message}`,r&&JSON.stringify(r,null,2)]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center mb-2",children:[e.jsxRuntimeExports.jsxs("h5",{className:"mb-0 me-2",children:["Auth Site Status: ",c(a,o,x)]}),e.jsxRuntimeExports.jsxs(l.ArticlesButton,{variant:"link",size:"sm",className:"p-0",onClick:()=>E(!i),children:[i?"Hide":"View"," More"]})]}),i&&e.jsxRuntimeExports.jsxs("pre",{children:[x&&"Loading...",o&&`Error: ${o.message}`,a&&JSON.stringify(a,null,2)]})]}),e.jsxRuntimeExports.jsx(t.Modal.Footer,{className:"justify-content-between",children:e.jsxRuntimeExports.jsx(l.ArticlesButton,{variant:"articles",onClick:()=>{u(!1)},children:"Close"})})]})}exports.default=g;
@@ -1,7 +1,7 @@
1
1
  import { j as e } from "./jsx-runtime-tc70JA_2.js";
2
2
  import { useState as h } from "react";
3
3
  import { A as o } from "./Button-_Quon8UV.js";
4
- import { u as g, a as E } from "./GlobalBody-Dw17Ik2b.js";
4
+ import { u as g, a as E } from "./GlobalBody-tmIC_GWn.js";
5
5
  import { M as s } from "./Modal-C9oYRgI1.js";
6
6
  function A({
7
7
  show: f,
@@ -1 +1 @@
1
- .ad-wrap{z-index:1;margin:0 auto;margin-bottom:1rem;max-width:312px;width:100%;--card-background: #f9edcd}.ad-wrap.active-member .ad .main-panel{height:310px}.ad-wrap .ad{position:relative;align-self:flex-start;width:100%;z-index:2;font-family:brandon-grotesque,sans-serif;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003;font-size:14px}@media(max-width:768px){.ad-wrap .ad{font-size:16px;width:100%}}.ad-wrap .ad .main-panel{background-color:var(--articles-ad-background-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));height:400px;display:flex;flex-direction:column}.ad-wrap .ad .main-panel .ad-warning{padding:.1rem .75rem;font-family:brandon-grotesque,sans-serif;font-weight:900;font-size:1rem;border-bottom:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .content-wrap{display:flex;flex-direction:column;align-items:center}@media(min-width:992px){.ad-wrap .ad .main-panel .content-wrap{flex-direction:column}}.ad-wrap .ad .main-panel .photo-banner{position:relative;height:100px;width:100px;flex-shrink:0;display:flex;align-items:center;padding-left:1rem;margin-left:.75rem;margin-left:0rem;height:125px;width:100%;border-bottom:1px solid black}.ad-wrap .ad .main-panel .photo-banner .logo{object-fit:cover;z-index:1}.ad-wrap .ad .main-panel .photo-banner .logo img{width:75px;height:75px;object-fit:contain}.ad-wrap .ad .main-panel .photo-banner .splash{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%) translateY(-50%);width:100%;display:flex;align-items:center;justify-content:center;color:#000}.ad-wrap .ad .main-panel .photo-banner .splash i{font-size:3rem;margin-right:1rem}.ad-wrap .ad .main-panel .photo-banner .splash .text{display:flex;flex-direction:column;line-height:1;align-items:start}.ad-wrap .ad .main-panel .photo-banner .splash .text .label{font-size:1.5rem}.ad-wrap .ad .main-panel .photo-banner .splash .text .count{font-weight:700;font-size:2rem}.ad-wrap .ad .main-panel .photo-banner .member-since{position:absolute;bottom:0;left:0;padding:.25rem .5rem;background-color:#00000080;color:#fff;font-size:.75rem;border-top-right-radius:5px}.ad-wrap .ad .main-panel .photo-banner .photo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.ad-wrap .ad .main-panel .details-wrap{width:100%}.ad-wrap .ad .main-panel .links-list{display:flex;flex-direction:column}.ad-wrap .ad .main-panel .links-list .link-item{color:#000}.ad-wrap .ad .main-panel .links-list .link-item:hover{text-decoration:underline;text-decoration-color:red}.ad-wrap .ad .main-panel .details,.ad-wrap .ad .main-panel .detail-title{padding:.75rem .75rem 0rem;display:grid;grid-gap:5px 5px;grid-template-columns:repeat(2,1fr)}.ad-wrap .ad .main-panel .details .detail .icon,.ad-wrap .ad .main-panel .detail-title .detail .icon{display:inline-block;width:1.5rem}.ad-wrap .ad .main-panel .details .detail .icon i,.ad-wrap .ad .main-panel .detail-title .detail .icon i{justify-content:flex-start;display:flex}.ad-wrap .ad .main-panel .short-description{padding:.25rem .75rem 0rem;min-height:50px;overflow-y:auto;max-height:125px}.ad-wrap .ad .main-panel .detail-title{display:flex;justify-content:space-between;align-items:center}.ad-wrap .ad .main-panel .action-wrap{border-top:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .action-wrap .action{padding:.25rem;display:flex;justify-content:center;align-items:center;border:1px solid var(--articles-ad-border-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));border-radius:10px;margin-left:auto;margin-right:auto;cursor:pointer;transition-duration:.2s}.ad-wrap .ad .main-panel .action-wrap .action:hover{background-color:#fff;color:#000}.ad-wrap .ad .main-panel .action-wrap .action:active{background-color:gray}.ad-wrap .advertise-with-us{background-color:var(--articles-ad-background-color, var(--card-background));border-top:2px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .advertise-with-us a{color:var(--articles-ad-font-color, var(--bs-body-color))!important}.view-user-modal-badge-wrap{display:flex;align-items:stretch;cursor:pointer}.view-user-modal-badge-wrap.large .view-user-modal-badge{position:relative;height:30px}.view-user-modal-badge-wrap.large .view-user-modal-badge .membership-badge{font-size:1rem!important}.view-user-modal-badge-wrap.large .view-user-modal-badge .profile-photo-wrap{height:22px!important;width:22px!important;margin-right:.5rem}.view-user-modal-badge-wrap.large .view-user-modal-badge img{margin-right:.5rem}.view-user-modal-badge-wrap .badge-membership{position:relative}.view-user-modal-badge-wrap .verification-user-badge{display:flex;align-items:center}.profile-photo-wrap{position:relative}.profile-photo-wrap .online-status{position:absolute;width:10px;height:10px;background-color:gray;bottom:1px;right:1px;border:2px solid #000;z-index:1}.profile-photo-wrap .online-status.status-online{background-color:green;border:2px solid #009b22}:root{--articles-theme-primary: #f9edcd}.bg-articles{background-color:var(--articles-theme-primary);color:#000!important}.shadow-articles{box-shadow:0 0 0 1px #0000004d,0 2px 3px #0003;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003}.text-center{text-align:center}.d-flex{display:flex}.flex-header{display:flex;justify-content:space-between;align-items:center}.scoreboard{margin-top:1rem;max-width:300px;width:100%;margin-bottom:1rem}@media(min-width:992px){.scoreboard{margin-top:0rem;margin-bottom:0rem;display:block;position:absolute;left:1rem;top:50%;transform:translateY(-50%)}}.articles-game-scoreboard{border:1px solid rgb(206,212,218);border-radius:8px;box-shadow:#00000012 0 2px 8px;color:#222;width:100%;max-width:350px;margin:0px 1rem;overflow:hidden;display:flex;flex-direction:column;z-index:1;position:fixed;bottom:50%;transform:translateY(50%);left:8px}
1
+ .ad-wrap{z-index:1;margin:0 auto;margin-bottom:1rem;max-width:312px;width:100%;--card-background: #f9edcd}.ad-wrap.active-member .ad .main-panel{height:310px}.ad-wrap .ad{position:relative;align-self:flex-start;width:100%;z-index:2;font-family:brandon-grotesque,sans-serif;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003;font-size:14px}@media(max-width:768px){.ad-wrap .ad{font-size:16px;width:100%}}.ad-wrap .ad .main-panel{background-color:var(--articles-ad-background-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));height:400px;display:flex;flex-direction:column}.ad-wrap .ad .main-panel .ad-warning{padding:.1rem .75rem;font-family:brandon-grotesque,sans-serif;font-weight:900;font-size:1rem;border-bottom:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .content-wrap{display:flex;flex-direction:column;align-items:center}@media(min-width:992px){.ad-wrap .ad .main-panel .content-wrap{flex-direction:column}}.ad-wrap .ad .main-panel .photo-banner{position:relative;height:100px;width:100px;flex-shrink:0;display:flex;align-items:center;padding-left:1rem;margin-left:.75rem;margin-left:0rem;height:125px;width:100%;border-bottom:1px solid black}.ad-wrap .ad .main-panel .photo-banner .logo{object-fit:cover;z-index:1}.ad-wrap .ad .main-panel .photo-banner .logo img{width:75px;height:75px;object-fit:contain}.ad-wrap .ad .main-panel .photo-banner .splash{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%) translateY(-50%);width:100%;display:flex;align-items:center;justify-content:center;color:#000}.ad-wrap .ad .main-panel .photo-banner .splash i{font-size:3rem;margin-right:1rem}.ad-wrap .ad .main-panel .photo-banner .splash .text{display:flex;flex-direction:column;line-height:1;align-items:start}.ad-wrap .ad .main-panel .photo-banner .splash .text .label{font-size:1.5rem}.ad-wrap .ad .main-panel .photo-banner .splash .text .count{font-weight:700;font-size:2rem}.ad-wrap .ad .main-panel .photo-banner .splash .text .count .fa-spinner{font-size:1.5rem}.ad-wrap .ad .main-panel .photo-banner .member-since{position:absolute;bottom:0;left:0;padding:.25rem .5rem;background-color:#00000080;color:#fff;font-size:.75rem;border-top-right-radius:5px}.ad-wrap .ad .main-panel .photo-banner .photo{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover}.ad-wrap .ad .main-panel .details-wrap{width:100%}.ad-wrap .ad .main-panel .links-list{display:flex;flex-direction:column}.ad-wrap .ad .main-panel .links-list .link-item{color:#000}.ad-wrap .ad .main-panel .links-list .link-item:hover{text-decoration:underline;text-decoration-color:red}.ad-wrap .ad .main-panel .details,.ad-wrap .ad .main-panel .detail-title{padding:.75rem .75rem 0rem;display:grid;grid-gap:5px 5px;grid-template-columns:repeat(2,1fr)}.ad-wrap .ad .main-panel .details .detail .icon,.ad-wrap .ad .main-panel .detail-title .detail .icon{display:inline-block;width:1.5rem}.ad-wrap .ad .main-panel .details .detail .icon i,.ad-wrap .ad .main-panel .detail-title .detail .icon i{justify-content:flex-start;display:flex}.ad-wrap .ad .main-panel .short-description{padding:.25rem .75rem 0rem;min-height:50px;overflow-y:auto;max-height:125px}.ad-wrap .ad .main-panel .detail-title{display:flex;justify-content:space-between;align-items:center}.ad-wrap .ad .main-panel .action-wrap{border-top:1px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .ad .main-panel .action-wrap .action{padding:.25rem;display:flex;justify-content:center;align-items:center;border:1px solid var(--articles-ad-border-color, var(--card-background));color:var(--articles-ad-font-color, var(--bs-body-color));border-radius:10px;margin-left:auto;margin-right:auto;cursor:pointer;transition-duration:.2s}.ad-wrap .ad .main-panel .action-wrap .action:hover{background-color:#fff;color:#000}.ad-wrap .ad .main-panel .action-wrap .action:active{background-color:gray}.ad-wrap .advertise-with-us{background-color:var(--articles-ad-background-color, var(--card-background));border-top:2px solid var(--articles-ad-border-color, var(--card-background))}.ad-wrap .advertise-with-us a{color:var(--articles-ad-font-color, var(--bs-body-color))!important}.view-user-modal-badge-wrap{display:flex;align-items:stretch;cursor:pointer}.view-user-modal-badge-wrap.large .view-user-modal-badge{position:relative;height:30px}.view-user-modal-badge-wrap.large .view-user-modal-badge .membership-badge{font-size:1rem!important}.view-user-modal-badge-wrap.large .view-user-modal-badge .profile-photo-wrap{height:22px!important;width:22px!important;margin-right:.5rem}.view-user-modal-badge-wrap.large .view-user-modal-badge img{margin-right:.5rem}.view-user-modal-badge-wrap .badge-membership{position:relative}.view-user-modal-badge-wrap .verification-user-badge{display:flex;align-items:center}.profile-photo-wrap{position:relative}.profile-photo-wrap .online-status{position:absolute;width:10px;height:10px;background-color:gray;bottom:1px;right:1px;border:2px solid #000;z-index:1}.profile-photo-wrap .online-status.status-online{background-color:green;border:2px solid #009b22}:root{--articles-theme-primary: #f9edcd}.bg-articles{background-color:var(--articles-theme-primary);color:#000!important}.shadow-articles{box-shadow:0 0 0 1px #0000004d,0 2px 3px #0003;box-shadow:0 0 0 1px #00000040,0 2px 3px #0003}.text-center{text-align:center}.d-flex{display:flex}.flex-header{display:flex;justify-content:space-between;align-items:center}.scoreboard{margin-top:1rem;max-width:300px;width:100%;margin-bottom:1rem}@media(min-width:992px){.scoreboard{margin-top:0rem;margin-bottom:0rem;display:block;position:absolute;left:1rem;top:50%;transform:translateY(-50%)}}.articles-game-scoreboard{border:1px solid rgb(206,212,218);border-radius:8px;box-shadow:#00000012 0 2px 8px;color:#222;width:100%;max-width:350px;margin:0px 1rem;overflow:hidden;display:flex;flex-direction:column;z-index:1;position:fixed;bottom:50%;transform:translateY(50%);left:8px}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReturnToLauncherButton.cjs"),r=require("./ArticlesAd.cjs"),o=require("./Ad.cjs"),t=require("./GameScoreboard.cjs"),s=require("./GlobalHead.cjs"),u=require("./GlobalBody-BbM8X_Jk.cjs"),a=require("./ViewUserModal.cjs"),l=require("./useUserDetails.cjs"),n=require("./useUserToken.cjs");exports.ReturnToLauncherButton=e;exports.ArticlesAd=r;exports.Ad=o;exports.GameScoreboard=t;exports.GlobalHead=s;exports.GlobalBody=u.GlobalBody_default;exports.ViewUserModal=a;exports.useUserDetails=l;exports.useUserToken=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ReturnToLauncherButton.cjs"),r=require("./ArticlesAd.cjs"),o=require("./Ad.cjs"),t=require("./GameScoreboard.cjs"),s=require("./GlobalHead.cjs"),u=require("./GlobalBody-BQ2qC81K.cjs"),a=require("./ViewUserModal.cjs"),l=require("./useUserDetails.cjs"),n=require("./useUserToken.cjs");exports.ReturnToLauncherButton=e;exports.ArticlesAd=r;exports.Ad=o;exports.GameScoreboard=t;exports.GlobalHead=s;exports.GlobalBody=u.GlobalBody_default;exports.ViewUserModal=a;exports.useUserDetails=l;exports.useUserToken=n;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { default as t } from "./ArticlesAd.js";
3
3
  import { default as s } from "./Ad.js";
4
4
  import { default as d } from "./GameScoreboard.js";
5
5
  import { default as m } from "./GlobalHead.js";
6
- import { G as x } from "./GlobalBody-Dw17Ik2b.js";
6
+ import { G as x } from "./GlobalBody-tmIC_GWn.js";
7
7
  import { default as G } from "./ViewUserModal.js";
8
8
  import { default as c } from "./useUserDetails.js";
9
9
  import { default as A } from "./useUserToken.js";
@@ -1 +1 @@
1
- "use strict";const s=require("./index-Ddv_TnxK.cjs"),r=e=>s.axios.get(e).then(t=>t.data),c=e=>{const{data:t,error:a,isLoading:o,mutate:n}=s.useSWR(process.env.NODE_ENV==="development"?`http://localhost:${e}/api/token`:"https://accounts.articles.media/api/token",r,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:a,isLoading:o,mutate:n}};module.exports=c;
1
+ "use strict";const s=require("./index-Ddv_TnxK.cjs"),a=e=>s.axios.get(e).then(t=>t.data),c=e=>{const{data:t,error:o,isLoading:n,mutate:r}=s.useSWR(process.env.NODE_ENV==="development"?`http://localhost:${e}/api/token`:"/api/token",a,{revalidateOnFocus:!1,revalidateOnReconnect:!1,shouldRetryOnError:!1});return{data:t,error:o,isLoading:n,mutate:r}};module.exports=c;
@@ -1,9 +1,9 @@
1
1
  import { u as r, a as n } from "./index-DLYx67wi.js";
2
- const c = (e) => n.get(e).then((t) => t.data), i = (e) => {
3
- const { data: t, error: a, isLoading: s, mutate: o } = r(
2
+ const l = (e) => n.get(e).then((t) => t.data), d = (e) => {
3
+ const { data: t, error: a, isLoading: o, mutate: s } = r(
4
4
  // "http://localhost:3012/api/auth/session",
5
- process.env.NODE_ENV === "development" ? `http://localhost:${e}/api/token` : "https://accounts.articles.media/api/token",
6
- c,
5
+ process.env.NODE_ENV === "development" ? `http://localhost:${e}/api/token` : "/api/token",
6
+ l,
7
7
  {
8
8
  revalidateOnFocus: !1,
9
9
  revalidateOnReconnect: !1,
@@ -13,10 +13,10 @@ const c = (e) => n.get(e).then((t) => t.data), i = (e) => {
13
13
  return {
14
14
  data: t,
15
15
  error: a,
16
- isLoading: s,
17
- mutate: o
16
+ isLoading: o,
17
+ mutate: s
18
18
  };
19
19
  };
20
20
  export {
21
- i as default
21
+ d as default
22
22
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@articles-media/articles-dev-box",
3
3
  "description": "Shared code, functions, and components for different Articles Media projects.",
4
- "version": "1.0.9",
4
+ "version": "1.0.11",
5
5
  "type": "module",
6
6
  "imports": {
7
7
  "#root/src/*": "./src/*"