PageSourceSearch

https://dwvil.com/_/fo-shopping/assets/index-nNWNo2Hg.js

js dwvil.com collected 2026-10-02 00:31:16 UTC 21,605 bytes, 1 lines download raw bytes

1var R=class extends Error{constructor(){super("액세스 토큰 요청에 실패했습니다. 다시 시도해주세요."),this.name="GetAccessTokenRequestFailedException"}},P=class extends Error{constructor(){super("액세스 토큰 발급 재요청 최대 횟수에 도달했습니다. 잠시 후에 다시 시도해주세요."),this.name="MaxRetryAccessTokenException"}},k=class extends Error{constructor(t="로그인 요청에 실패했습니다. 다시 시도해주세요."){super(t),this.name="SignInFailedException"}},f=class extends Error{response;request;options;constructor(t,e,r){let s=`${t.status||t.status===0?t.status:""} ${t.statusText??""}`.trim(),i=s?`status code ${s}`:"an unknown error";super(`Request failed with ${i}: ${e.method} ${e.url}`),this.name="HTTPError",this.response=t,this.request=e,this.options=r}},v=class extends Error{name="NonError";value;constructor(t){let e="Non-error value was thrown";try{typeof t=="string"?e=t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"&&(e=t.message)}catch{}super(e),this.value=t}},g=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(t){let e=t?.cause?t.cause instanceof Error?t.cause:new v(t.cause):void 0;super(t?.code?`Forced retry: ${t.code}`:"Forced retry",e?{cause:e}:void 0),this.customDelay=t?.delay,this.code=t?.code,this.customRequest=t?.request}},S=(()=>{let t=!1,e=!1,r=typeof globalThis.ReadableStream=="function",s=typeof globalThis.Request=="function";if(r&&s)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return t&&!e})(),D=typeof globalThis.AbortController=="function",q=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",L=typeof globalThis.ReadableStream=="function",K=typeof globalThis.FormData=="function",M=["get","post","put","patch","head","delete"],$={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},A=2147483647,F=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,I=Symbol("stop"),_=class{options;constructor(t){this.options=t}},H=t=>new _(t),J={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},W={next:!0},Y={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},z=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[r,s]of t)e+=F,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,e+=typeof s=="string"?new TextEncoder().encode(s).length:s.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},N=(t,e,r)=>{let s,i=0;return t.pipeThrough(new TransformStream({transform(o,a){if(a.enqueue(o),s){i+=s.byteLength;let n=e===0?0:i/e;n>=1&&(n=1-2**-52),r?.({percent:n,totalBytes:Math.max(e,i),transferredBytes:i},s)}s=o},flush(){s&&(i+=s.byteLength,r?.({percent:1,totalBytes:Math.max(e,i),transferredBytes:i},s))}}))},B=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});let r=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response(N(t.body,r,e),{status:t.status,statusText:t.statusText,headers:t.headers})},X=(t,e,r)=>{if(!t.body)return t;let s=z(r??t.body);return new Request(t,{duplex:"half",body:N(t.body,s,e)})},c=t=>typeof t=="object"&&!!t,d=(...t)=>{for(let e of t)if((!c(e)||Array.isArray(e))&&e!==void 0)throw TypeError("The `options` argument must be an object");return E({},...t)},O=(t={},e={})=>{let r=new globalThis.Headers(t),s=e instanceof globalThis.Headers,i=new globalThis.Headers(e);
1for(let[o,a]of i.entries())s&&a==="undefined"||a===void 0?r.delete(o):r.set(o,a);return r};function p(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:E(t[r]??[],e[r]??[])}var U=(t={},e={})=>({beforeRequest:p(t,e,"beforeRequest"),beforeRetry:p(t,e,"beforeRetry"),afterResponse:p(t,e,"afterResponse"),beforeError:p(t,e,"beforeError")}),G=(t,e)=>{let r=new URLSearchParams;for(let s of[t,e])if(s!==void 0)if(s instanceof URLSearchParams)for(let[i,o]of s.entries())r.append(i,o);else if(Array.isArray(s))for(let i of s){if(!Array.isArray(i)||i.length!==2)throw TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(i[0]),String(i[1]))}else if(c(s))for(let[i,o]of Object.entries(s))o!==void 0&&r.append(i,String(o));else{let i=new URLSearchParams(s);for(let[o,a]of i.entries())r.append(o,a)}return r},E=(...t)=>{let e={},r={},s={},i,o=[];for(let a of t)if(Array.isArray(a))Array.isArray(e)||(e=[]),e=[...e,...a];else if(c(a)){for(let[n,h]of Object.entries(a)){if(n==="signal"&&h instanceof globalThis.AbortSignal){o.push(h);continue}if(n==="context"){if(h!=null&&(!c(h)||Array.isArray(h)))throw TypeError("The `context` option must be an object");e={...e,context:h==null?{}:{...e.context,...h}};continue}if(n==="searchParams"){i=h==null?void 0:i===void 0?h:G(i,h);continue}c(h)&&n in e&&(h=E(e[n],h)),e={...e,[n]:h}}c(a.hooks)&&(s=U(s,a.hooks),e.hooks=s),c(a.headers)&&(r=O(r,a.headers),e.headers=r)}return i!==void 0&&(e.searchParams=i),o.length>0&&(o.length===1?e.signal=o[0]:q?e.signal=AbortSignal.any(o):e.signal=o.at(-1)),e},V=t=>M.includes(t)?t.toUpperCase():t,C={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:1/0,backoffLimit:1/0,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Q=(t={})=>{if(typeof t=="number")return{...C,limit:t};if(t.methods&&!Array.isArray(t.methods))throw Error("retry.methods must be an array");if(t.methods&&=t.methods.map(r=>r.toLowerCase()),t.statusCodes&&!Array.isArray(t.statusCodes))throw Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries(t).filter(([,r])=>r!==void 0));return{...C,...e}},b=class extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}};async function Z(t,e,r,s){return new Promise((i,o)=>{let a=setTimeout(()=>{r&&r.abort(),o(new b(t))},s.timeout);s.fetch(t,e).then(i).catch(o).then(()=>{clearTimeout(a)})})}async function ee(t,{signal:e}){return new Promise((r,s)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(o),s(e.reason)}let o=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}var te=(t,e)=>{let r={};for(let s in e)Object.hasOwn(e,s)&&!(s in Y)&&!(s in J)&&(!(s in t)||s in W)&&(r[s]=e[s]);return r},se=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t;function re(t){return t instanceof f||t?.name===f.name}function ie(t){return t instanceof b||t?.name===b.name}var x=class T{static create(e,r){let s=new T(e,r),i=s.#d(async()=>{if(typeof s.#e.timeout=="number"&&s.#e.timeout>2147483647)throw RangeError(`The \`timeout\` option cannot be greater than ${A}`);await Promise.resolve();let o=await s.#m();for(let a of s.#e.hooks.afterResponse){let n=s.#f(o.clone()),h;try{h=await a(s.request,s.#h(),n,{retryCount:s.#s})}catch(j){throw s.#o(n),s.#o(o),j}if(h instanceof _)throw s.#o(n),s.#o(o),new g(h.options);let y=h instanceof globalThis.Response?h:o;n!==y&&s.#o(n),o!==y&&s.#o(o),o=y}if(s.#f(o),!o.ok&&(typeof s.#e.throwHttpErrors=="function"?s.#e.throwHttpErrors(o.status):s.#e.throwHttpErrors)){let a=new f(o,s.request,s.#h());for(let n of s.#e.hooks.beforeError)a=await n(a,{retryCount:s.#s});throw a}if(s.#e.onDownloadProgress){if(typeof s.#e.onDownloadProgress!="function")throw TypeError("The `onDownloadProgress` option must be a function");if(!L)throw Error("Streams are not supported in your environment. `ReadableStream` is missing.");let a=o.clone();return s.#o(o),B(a,s.#e.onDownloadProgress)}return o}
1).finally(()=>{let o=s.#n;s.#c(o?.body??void 0),s.#c(s.request.body??void 0)});for(let[o,a]of Object.entries($))o==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(i[o]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||a);let n=await i;if(o==="json"){if(n.status===204)return"";let h=await n.text();return h===""?"":r.parseJson?r.parseJson(h):JSON.parse(h)}return n[o]()});return i}static#y(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0)):e}request;#r;#s=0;#t;#e;#n;#i;#a;constructor(e,r={}){if(this.#t=e,this.#e={...r,headers:O(this.#t.headers,r.headers),hooks:U({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:V(r.method??this.#t.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:Q(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}D&&q&&(this.#i=this.#e.signal??this.#t.signal,this.#r=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#r.signal]):this.#r.signal),S&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let s=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(K&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!s&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),se(this.#e.searchParams)){let i="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(T.#y(this.#e.searchParams)).toString()),o=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);this.request=new globalThis.Request(o,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw TypeError("The `onUploadProgress` option must be a function");if(!S)throw Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#p(this.request,this.#e.body??void 0)}}#l(){let e=this.#e.retry.delay(this.#s),r=e;this.#e.retry.jitter===!0?r=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(r=this.#e.retry.jitter(e),(!Number.isFinite(r)||r<0)&&(r=e));let s=this.#e.retry.backoffLimit??1/0;return Math.min(s,r)}async#g(e){if(this.#s++,this.#s>this.#e.retry.limit)throw e;let r=e instanceof Error?e:new v(e);if(r instanceof g)return r.customDelay??this.#l();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){let s=await this.#e.retry.shouldRetry({error:r,retryCount:this.#s});if(s===!1)throw e;if(s===!0)return this.#l()}if(ie(e)&&!this.#e.retry.retryOnTimeout)throw e;if(re(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let s=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(s&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let i=Number(s)*1e3;Number.isNaN(i)?i=Date.parse(s)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());let o=this.#e.retry.maxRetryAfter??i;return i<o?i:o}if(e.response.status===413)throw e}return this.#l()}#f(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}#c(e){e&&e.cancel().catch(()=>{})}#o(e){this.#c(e.body??void 0)}async#d(e){try{return await e()}catch(r){let s=Math.min(await this.#g(r),A);if(this.#s<1)throw r;if(await ee(s,this.#i?{signal:this.#i}:{}),r instanceof g&&r.customRequest){let i=this.#e.signal?new globalThis.Request(r.customRequest,{signal:this.#e.signal}):new globalThis.Request(r.customRequest);this.#u(i)}for(let i of this.#e.hooks.beforeRetry){let o=await i({request:this.request,options:this.#h(),error:r,retryCount:this.#s});if(o instanceof globalThis.Request){this.#u(o);break}if(o instanceof globalThis.Response)return o;if(o===I)return}return this.#d(e)}}async#m(){this.#r?.signal.aborted&&(this.#r=new globalThis.AbortController,this.#e.signal=this.#i?AbortSignal.any([this.#i,this.#r.signal]):this.#r.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let r of this.#e.hooks.beforeRequest){let s=await r(this.request,this.#h(),{retryCount:this.#s});if(s instanceof Response)return s;if(s instanceof globalThis.Request){this.#u(s);break}}let e=te(this.request,this.#e);return this.#n=this.request,this.request=this.#n.clone(),this.#e.timeout===!1?this.#e.fetch(this.#n,e):Z(this.#n,e,this.#r,this.#e)}#h(){if(!this.#a){let{hooks:e,...r}=this.#e;this.#a=Object.freeze(r)}return this.#a}#u(e){this.#a=void 0,this.request=this.#p(e)}#p(e,r){return!this.#e.onUploadProgress||!e.body?e:X(e,this.#e.onUploadProgress,r??this.#e.body??void 0)}},w=t=>{let e=(r,s)=>x.create(r,d(t,s));for(let r of M)e[r]=(s,i)=>x.create(s,d(t,i,{method:r}));return e.create=r=>w(d(r)),e.extend=r=>(typeof r=="function"&&(r=r(t??{})),w(d(t,r))),e.stop=I,e.retry=H,e}
1,oe=w(),u=class extends Error{};u.prototype.name="InvalidTokenError";function ne(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,r)=>{let s=r.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}function ae(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Error("base64 string is not of the correct length")}try{return ne(e)}catch{return atob(e)}}function m(t,e){if(typeof t!="string")throw new u("Invalid token specified: must be a string");e||={};let r=e.header===!0?0:1,s=t.split(".")[r];if(typeof s!="string")throw new u(`Invalid token specified: missing part #${r+1}`);let i;try{i=ae(s)}catch(o){throw new u(`Invalid token specified: invalid base64 for part #${r+1} (${o.message})`)}try{return JSON.parse(i)}catch(o){throw new u(`Invalid token specified: invalid json for part #${r+1} (${o.message})`)}}function he(t,e){let r={};for(let s=0;s<e.length;s++){let i=e[s];Object.hasOwn(t,i)&&(r[i]=t[i])}return r}var le=t=>he(oe.extend({headers:{"Content-Type":"application/json"},retry:0,hooks:{beforeRequest:[e=>{t?.requestCallback&&t.requestCallback(e)}],afterResponse:[(e,r,s)=>(t?.responseCallback&&t.responseCallback(e,r,s),s)],beforeError:[e=>(t?.errorCallback&&t.errorCallback(e),e)]},...t?.options||{}}),["get","post","put","delete","patch","extend"]),ce=class{constructor(t){this.httpClient=le({options:{prefixUrl:`${t?.siteHost||""}/_/api/auth`,headers:{"Content-Type":"application/json",Accept:"application/json"}}})}async signIn(){return this.httpClient.post("sign-in/legacy").json()}async getAccessToken(){return this.httpClient.post("access-token").json()}},l,ue=(l=class{constructor(e){this.GET_ACCESS_TOKEN_MAXIMUM_RETRY_COUNT=2,this.isInitialized=!1,typeof e?.getAccessTokenMaximumRetryCount=="number"&&Number.isFinite(e.getAccessTokenMaximumRetryCount)&&e.getAccessTokenMaximumRetryCount>=0&&(this.GET_ACCESS_TOKEN_MAXIMUM_RETRY_COUNT=e.getAccessTokenMaximumRetryCount),this.onSignInError=e?.onSignInError,this.cacheStrategy=e?.cacheStrategy||"sdk",this.authApiHttpClient=new ce({siteHost:e?.siteHost}),this.recordClockSamples()}async getAccessToken(){if(console.debug("액세스 토큰 요청"),this.cacheStrategy==="sdk"){let e=this.getCachedAccessToken();if(e)return console.debug("캐시된 액세스 토큰 반환"),e}if(this.pendingTokenRequest)return console.debug("이미 진행 중인 토큰 요청 대기"),this.pendingTokenRequest;this.pendingTokenRequest=this.fetchNewToken(0);try{let e=await this.pendingTokenRequest;return this.cacheStrategy==="sdk"&&(this.cacheAccessToken(e),console.debug("액세스 토큰 캐시 설정 완료")),e}finally{this.pendingTokenRequest=void 0}}async signIn(e=0){let r=await this.authApiHttpClient.signIn().then(({accessToken:s})=>s).catch(async s=>{if(s instanceof f){if([400,401].includes(s.response.status))throw this.onSignInError&&this.onSignInError(),new k(s.message);if(e<this.GET_ACCESS_TOKEN_MAXIMUM_RETRY_COUNT){let i=this.calculateRetryDelayTime(e);return console.debug(`로그인 실패, ${i}ms 후 재시도 (${e+1}/${this.GET_ACCESS_TOKEN_MAXIMUM_RETRY_COUNT})`),await this.delay(i),this.signIn(e+1)}}throw new k(s.message)});return this.assertValidAccessTokenShape(r),r}assertValidAccessTokenShape(e){if(typeof e!="string"||e.length===0||!this.isWellFormedJwt(e))throw new R}clearCache(){this.clearCachedAccessToken()}isWellFormedJwt(e){try{return m(e),!0}catch{return!1}}initializeFromSessionStorage(){if(this.isInitialized||!this.isSessionStorageAvailable()){this.isInitialized=!0;return}try{let e=sessionStorage.getItem(l.TOKEN_SKEW_KEY),r=e===null?NaN:Number(e);Number.isFinite(r)&&(this.serverSkewMs=r);let s=sessionStorage.getItem(l.TOKEN_CACHE_KEY);s&&this.isWellFormedJwt(s)&&(this.cacheAccessToken(s,{measureSkew:!1}),console.debug("sessionStorage에서 토큰 복원 완료"))}catch{}this.isInitialized=!0}async fetchNewToken(e){let r=await this.authApiHttpClient.getAccessToken().then(({accessToken:s})=>s).catch(async s=>{if(s instanceof f){if([400,401,403,404].includes(s.response.status))return this.signIn();if(e>=this.GET_ACCESS_TOKEN_MAXIMUM_RETRY_COUNT)throw new P;let i=this.calculateRetryDelayTime(e);return console.debug(`토큰 요청 실패, ${i}ms 후 재시도 (${e+1}/${this.GET_ACCESS_TOKEN_MAXIMUM_RETRY_COUNT})`),await this.delay(i),this.fetchNewToken(e+1)}throw new R});return this.assertValidAccessTokenShape(r),r}isSessionStorageAvailable(){try{return typeof sessionStorage<"u"&&sessionStorage!==null}catch{return!1}}updateSkewFromIat(e){if(this.serverSkewMs=Date.now()-e*1e3,this.isSessionStorageAvailable())try{sessionStorage.setItem(l.TOKEN_SKEW_KEY,String(this.serverSkewMs))}catch{}}
1detectClockJump(e=1e3){if(this.lastWallMs===void 0||this.lastMonoMs===void 0)return!1;let r=Date.now()-this.lastWallMs,s=performance.now()-this.lastMonoMs;return Math.abs(r-s)>e}recordClockSamples(){this.lastWallMs=Date.now(),this.lastMonoMs=performance.now()}dispose(){this.clearRefreshTimer()}getCachedAccessToken(){this.isInitialized||this.initializeFromSessionStorage();let e=this.detectClockJump();return this.recordClockSamples(),e?(console.debug("시계 점프/sleep 감지, 캐시 무효화"),this.clearCachedAccessToken(),null):this.accessToken&&this.isWellFormedJwt(this.accessToken)?this.isExpiredBySkew(this.accessToken)?(console.debug("만료된 토큰 캐시 삭제 (skew 보정)"),this.clearCachedAccessToken(),null):this.accessToken:(this.accessToken&&(console.debug("형식이 손상된 토큰 캐시 삭제"),this.clearCachedAccessToken()),null)}isExpiredBySkew(e){try{let{exp:r}=m(e);return typeof r!="number"||!Number.isFinite(r)?!1:Date.now()-(this.serverSkewMs??0)>=r*1e3}catch{return!1}}clearCachedAccessToken(){if(this.accessToken=void 0,this.clearRefreshTimer(),this.isSessionStorageAvailable())try{sessionStorage.removeItem(l.TOKEN_CACHE_KEY)}catch{}this.isInitialized=!1}clearRefreshTimer(){this.refreshTimerId!==void 0&&(clearTimeout(this.refreshTimerId),this.refreshTimerId=void 0)}cacheAccessToken(e,r={}){let s,i;try{let n=m(e);if(typeof n.exp!="number"||!Number.isFinite(n.exp)){console.debug("JWT exp 클레임이 유효하지 않아 캐싱 생략");return}s=n.exp,i=typeof n.iat=="number"&&Number.isFinite(n.iat)?n.iat:void 0}catch{console.debug("JWT 디코딩 실패, 토큰 캐싱 생략");return}if(r.measureSkew!==!1&&i!==void 0&&this.updateSkewFromIat(i),this.accessToken=e,this.isSessionStorageAvailable())try{sessionStorage.setItem(l.TOKEN_CACHE_KEY,e)}catch{console.debug("세션 스토리지에 토큰 저장 실패, 메모리 캐시만 사용")}this.clearRefreshTimer();let o=Date.now()-(this.serverSkewMs??0),a;if(i!==void 0&&s>i){let n=(i+(s-i)*.8)*1e3;a=Math.max(0,n-o)}else{let n=s*1e3-o;if(a=Math.floor(n*.8),a<5e3){console.debug("iat 부재 + 잔여 시간 부족으로 자동 갱신 예약 생략");return}}this.refreshTimerId=setTimeout(async()=>{console.debug("액세스 토큰 자동 갱신 시점 도래, 재요청"),this.refreshTimerId=void 0;try{let n=await this.fetchNewToken(0);this.cacheAccessToken(n)}catch{console.debug("토큰 자동 갱신 실패, 캐시 무효화"),this.clearCachedAccessToken()}},a)}calculateRetryDelayTime(e){let r=1e3*2**e;return Math.min(r,3e4)}delay(e){return new Promise(r=>setTimeout(r,e))}},l.TOKEN_CACHE_KEY="imweb_site_auth_token",l.TOKEN_SKEW_KEY="imweb_site_auth_skew_ms",l);export{ue as e};

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.