PageSourceSearch

https://www.papaya.co.th/_next/static/chunks/794.368a2bf5b8169c3d.js

js papaya.co.th collected 2026-10-06 02:19:00 UTC 2,597 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[794],{94794:function(e,r,t){let i;t.d(r,{getPricesByLookupKeys:function(){return getPricesByLookupKeys}});var s=t(49521),n=t(57474);let c=new class{constructor(){this.redis=n.so.fromEnv()}pipeline(){return this.redis.pipeline()}async get(e){return this.redis.get(e)}async set(e,r,t){return this.redis.set(e,r,t)}async sadd(e,r){let t=await this.redis.sadd(e,r);return 1===t}async sIsMember(e,r){let t=await this.redis.sismember(e,r);return 1===t}async sMembers(e){return this.redis.smembers(e)}async sRem(e,r){let t=await this.redis.srem(e,r);return 1===t}async xAdd(e,r,t,i){let s=await this.redis.xadd(e,r,t,i);return s}async xRange(e,r,t,i){return this.redis.xrange(e,r,t,i)}async xDel(e,r){let t=await this.redis.xdel(e,r);return 1===t}async xTrim(e,r){return this.redis.xtrim(e,r)}async incr(e){return this.redis.incr(e)}async expire(e,r){return this.redis.expire(e,r)}async del(e){return this.redis.del(...e)}};var a=t(22623),u=t(90587),o=t(93542);let getStripe=()=>(i||(i=new u.ZP(o.env.STRIPE_SECRET_KEY,{apiVersion:"2026-04-22.dahlia"})),i),l=s.cM.with({source:a.X.SERVICE_PACKAGE,name:"packages/services/src/stripe/getPricesByLookupKeys.ts"}),p="__none__",priceCacheKey=e=>`stripe:price:v2:${e}`;async function getPricesByLookupKeys(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.filter((r,t)=>e.indexOf(r)===t);if(0===t.length)return[];let i=[],s=t;if(!r.fresh){let e=[];try{let r=c.pipeline();t.forEach(e=>r.get(priceCacheKey(e))),e=await r.exec()}catch(r){l.warn("[stripe] price cache read failed, resolving from Stripe",{error:JSON.stringify(r)}),e=[]}s=[],t.forEach((r,t)=>{let n=e[t];if(n!==p){if(n){i.push(n);return}s.push(r)}})}if(0===s.length)return i;let n=[];for(let e=0;e<s.length;e+=10){let r=s.slice(e,e+10),t=await getStripe().prices.list({lookup_keys:r,limit:10,expand:["data.currency_options"]});t.data.forEach(e=>{if(!e.lookup_key)return;let r={};Object.keys(e.currency_options??{}).forEach(t=>{r[t]=e.currency_options?.[t]?.unit_amount??null}),n.push({priceId:e.id,lookupKey:e.lookup_key,productId:"string"==typeof e.product?e.product:e.product.id,currency:e.currency,unitAmount:e.unit_amount,currencyOptions:r,active:e.active,interval:e.recurring?.interval??null})})}let a={};n.forEach(e=>{a[e.lookupKey]=e});try{let e=c.pipeline();s.forEach(r=>{let t=a[r];t?e.set(priceCacheKey(r),t,{ex:600}):e.set(priceCacheKey(r),p,{ex:60})}),await e.exec()}catch(e){l.warn("[stripe] price cache write failed, serving uncached prices",{error:JSON.stringify(e)})}return i.concat(n)}}}]);

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.