PageSourceSearch

https://www.offgridcentrum.nl/assets/_handle-BmKd0RZ-.js

js offgridcentrum.nl collected 2026-10-09 00:05:28 UTC 4,594 bytes, 1 lines download raw bytes

1import{p as S}from"./index-3yOcXwLt.js";import{$ as p,e as w,aE as F,y as b,gw as R,aF as C,aG as q,gz as g,gA as A}from"./main-DCLmGFZV.js";import{O as T}from"./model-designation-UpPo7y4z.js";async function O(c){if(!c)return null;try{return(await p.client.fetch(`/store/product-redirects?handle=${encodeURIComponent(c)}`))?.handle??null}catch{return null}}const y="victron-thuisbatterij-sets",D={"victron-1-fase-thuisbatterij-set-a-5kwh":"batterij-set-a","victron-thuisbatterij-set-b":"batterij-set-b","victron-1-fase-ess-thuisbatterij-alles-in-een-set-c-2048-kwh-lifepo-6-kw-omvormer":"batterij-set-c","victron-3-fase-ess-thuisbatterij-alles-in-een-set-d-1536-kwh-lifepo-72-kw-omvormer":"batterij-set-d","victron-1-fase-ess-thuisbatterij-alles-in-een-set-e-1536-kwh-8-kw-omvormer":"batterij-set-e","victron-3-fase-ess-thuisbatterij-alles-in-een-set-f-2048-kwh-lifepo-12-kw-omvormer":"batterij-set-f","victron-1-fase-ess-thuisbatterij-alles-in-een-set-g-3072-kwh-lifepo-12-kw-omvormer":"batterij-set-g","victron-3-fase-ess-thuisbatterij-alles-in-een-set-h-3072-kwh-lifepo-18-kw-omvormer":"batterij-set-h","victron-3-fase-ess-thuisbatterij-alles-in-een-set-i-3072-kwh-lifepo-24-kw-omvormers":"batterij-set-i","victron-3-fase-ess-thuisbatterij-alles-in-een-set-j-4608-kwh-lifepo-36-kw-omvormers":"batterij-set-j","victron-3-fase-ess-thuisbatterij-alles-in-een-set-k-4608-kwh-24-kw-omvormer":"batterij-set-k","victron-3-fase-ess-thuisbatterij-alles-in-een-set-l-6144-kwh-lifepo-36-kw-omvormer":"batterij-set-l","victron-3-fase-ess-thuisbatterij-alles-in-een-set-n-2048-kwh-lifepo-108-kw-omvormer":"batterij-set-n","victron-3-fase-ess-thuisbatterij-alles-in-een-set-o-3072-kwh-lifepo-156-kw-omvormer":"batterij-set-o","victron-3-fase-ess-thuisbatterij-alles-in-een-set-m-9216-kwh-lifepo-36kw-omvormer":"batterij-set-m","victron-set-3f-a":"Set 3F - A","victron-set-3f-b":"Set 3F - B","victron-set-3f-c":"3F - C","victron-set-3f-d":"Set 3F - D","victron-set-3f-f":"Set 3F - F","victron-set-3f-g":"Set 3F - G","victron-set-3f-h":"Set 3F - H","victron-set-3f-i":"Set 3F - I","victron-set-3f-j":"Set 3F - J","victron-set-3f-k":"Set 3F - K","victron-set-3f-l":"Set 3F - L","victron-set-3f-m":"Set 3F - M"},U=async({params:c,context:h})=>{const{countryCode:r,handle:s}=c,{queryClient:o}=h,v=A(s);if(v)throw w({to:v.to,params:{countryCode:r},statusCode:301});const k=S(o);let i=null;try{i=await o.ensureQueryData({queryKey:["region",r],queryFn:()=>F({country_code:r})})}catch(e){const l=e instanceof Error?e.message:String(e);console.error(`[SSR][product loader] Failed to fetch region for "${r}": ${l}`)}if(!i||!s)throw b();let a=null;try{a=(await p.client.fetch(`/store/pages/by-product/${encodeURIComponent(s)}`)).page,a?.html&&(a={...a,html:a.html.replace(/https?:\/\/[^"'\s/]+\/static\//g,"https://backend-next.offgridcentrum.nl/static/")})}catch{}let t;try{t=await R({handle:s,region_id:i.id,country_code:r,fields:"*variants, +variants.inventory_quantity, +variants.manage_inventory, +variants.allow_backorder, +variants.calculated_price, *images, *options, *options.values, *collection, *tags, *categories, *categories.parent_category, +product_extra.*, +metadata"})}catch{const e=await O(s);throw e&&e!==s?w({to:"/$countryCode/products/$handle",params:{countryCode:r,handle:e},statusCode:301}):b()}o.setQueryData(["product",s,i.id,r],t);const j=t.categories?.some(e=>e.handle===y||e.parent_category?.handle===y)||!1;await o.ensureQueryData({queryKey:q.products.related(t.id,i.id),queryFn:async()=>{const e={fields:"title, handle, *thumbnail, *variants",is_giftcard:!1,limit:4};t.collection_id&&(e.collection_id=[t.collection_id]),t.tags&&t.tags.length>0&&(e.tag_id=t.tags.map(f=>f.id));const{response:l}=await C({queryParams:e,regionId:i.id,countryCode:r});return l.products.filter(f=>f.id!==t.id)}});const _=D[s]||"";let m={average:null,count:0,bestRating:5,reviews:[]};const d=t.variants?.[0]?.sku;if(d)try{m=await o.ensureQueryData({queryKey:["product-reviews",d],queryFn:()=>p.client.fetch("/store/product-reviews",{query:{sku:d}})})}catch{}const u=t.product_extra;t.description&&(t.description=g(t.description)),u?.short_description&&(u.short_description=g(u.short_description));const n=t.metadata;return n&&(delete n.standard_price,Array.isArray(n.suppliers)&&(n.suppliers=n.suppliers.filter(e=>!(typeof e?.name=="string"&&T.test(e.name))).map(e=>({id:e?.id,delay:e?.delay})))),await k,{countryCode:r,region:i,product:t,isVictronThuisbatterij:j,pageOverride:a??null,set_tag:_,reviews:m,priceValidUntil:new Date(Date.now()+365*24*60*60*1e3).toISOString().split("T")[0]}};export{U as loader};

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.