PageSourceSearch

https://starwarsdatabase.com/gallery/src/gift-shop-plan.js?v=0.67.1

js starwarsdatabase.com collected 2026-10-07 19:29:55 UTC 1,416 bytes, 17 lines download raw bytes

1// One annex per physical floor, anchored to the room nearest that floor's midpoint.
2// Neither catalog partitioning nor display identifiers are changed by this feature.
3export const SHOP_TITLE='Information Booth';
4export const SHOP_SIZE=Object.freeze({width:7.6,depth:7.6,height:3.35,doorWidth:1.6,passageLength:3.2});
5export function giftShopsForData(data){
6  if(!data?.plan)return [];
7  const specs=data.layout?.rooms||(data.connected?.length?data.connected.map(r=>r.spec):null)||[{index:data.plan.annex||0,x:0,y:0,floor:0,width:data.plan.width,depth:data.plan.depth}];
8  return [...new Set(specs.map(r=>r.floor))].map(floor=>{
9    const rooms=specs.filter(r=>r.floor===floor),mid=(Math.min(...rooms.map(r=>r.x-r.width/2))+Math.max(...rooms.map(r=>r.x+r.width/2)))/2;
10    const host=[...rooms].sort((a,b)=>Math.abs(a.x-mid)-Math.abs(b.x-mid)||a.index-b.index)[0];
11    const {width,depth,doorWidth,passageLength}=SHOP_SIZE,doorX=host.x+Math.min(2.55,host.width/2-1.1),wallZ=-host.depth/2,south=wallZ-passageLength;
12    return {floor,host:host.index,hostWidth:host.width,x:host.x,y:host.y||0,z:south-depth/2,width,depth,doorX,doorWidth,wallZ,south,
13      passage:{x:doorX,z:(wallZ+south)/2,width:doorWidth,depth:passageLength,y:host.y||0},
14      arrival:{x:doorX,y:host.y||0,z:south-.9}};
15  });
16}
17export function currentGiftShop(data){return giftShopsForData(data).find(s=>s.floor===(data?.spec?.floor||0))||null;}

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.