1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0dac8-8698-78c3-94c5-0a4d3e01f1c7")}catch(e){}}();(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,451102,e=>{"use strict";var t=e.i(843476),i=e.i(271645),n=e.i(351558),l=e.i(715493),r=e.i(686834),a=e.i(480388),u=e.i(181788),s=e.i(765120);let c="FETCH_START",o="FETCH_END",m="FETCH_END_PRESERVE",d={loading:!0,dailyAchievement:null},y=(e,t)=>{switch(t.type){case c:return e.loading?e:(0,u._)((0,a._)({},e),{loading:!0});case o:if(!e.loading&&(0,s.isDeepEqual)(e.dailyAchievement,t.dailyAchievement))return e;return{loading:!1,dailyAchievement:t.dailyAchievement};case m:return e.loading?(0,u._)((0,a._)({},e),{loading:!1}):e}},T=(0,i.createContext)(null);e.s(["GamificationContext",0,T,"GamificationProvider",0,e=>{let{children:a}=e,{authLoading:u,isLoggedIn:s}=(0,l.useAuthContext)(),[{dailyAchievement:f,loading:h},g]=(0,i.useReducer)(y,d),v=(0,i.useMemo)(()=>!!f&&("daily"===f.type||"weekly"===f.type)&&f.event===r.GAMIFICATION_ENGAGEMENTS.ARTICLE_READ,[f]),A=(0,i.useCallback)(async()=>{g({type:c});try{var e,t,i,l,r;let a=null;if(s){let l=await (0,n.fetchGameificationUser)();a=null!=(e=null==l||null==(i=l.achievements)||null==(t=i.dailyAchievements)?void 0:t[0])?e:null}else{let e=await (0,n.fetchDailyAchievement)();a=e&&e?{id:e.id,text:e.title,event:e.event_name,expValue:e.xp,type:"daily",achStructure:"completion",successMetric:1,successMetricArr:null,startTime:0,endTime:new Date(e.endTime).getTime(),expireTime:new Date(e.endTime).getTime(),week:0,year:0,status:"NOT_STARTED",userProgress:0,link:null!=(l=e.link)?l:null,engagementSourceIds:null!=(r=e.engagement_source_ids)?r:null}:null}g({type:o,dailyAchievement:null!=a?a:null})}catch(e){console.error("Error fetching daily achievement:",e),g({type:m})}},[s]),[p,E]=(0,i.useState)(!1);(0,i.useEffect)(()=>{if(!u)return;let e=setTimeout(()=>E(!0),1500);return()=>clearTimeout(e)},[u]),(0,i.useEffect)(()=>{(!u||p)&&A()},[u,p,A]);let w=(0,i.useMemo)(()=>({dailyAchievement:f,loading:h,isReadArticleAchievement:v,refresh:A}),[f,h,v,A]);return(0,t.jsx)(T.Provider,{value:w,children:a})},"useGamificationContext",0,()=>{let e=(0,i.use)(T);if(!e)throw Error("useGamificationContext must be used within a GamificationProvider.");return e}],451102)},765120,e=>{"use strict";e.s(["createDeferred",0,function(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}},"hasNotStarted",0,e=>e-new Date().getTime()/1e3>0,"isBetweenDates",0,(e,t)=>{let i=new Date().getTime()/1e3;return!!(i>e)&&!!(i<t)},"isDeepEqual",0,(e,t)=>typeof e==typeof t&&("object"==typeof e&&null!==e?JSON.stringify(e)===JSON.stringify(t):e===t),"isPastTime",0,e=>e-new Date().getTime()/1e3<0])}]); 2 3//# chunkId=01a0dac8-8698-78c3-94c5-0a4d3e01f1c7
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.