PageSourceSearch

https://wab-booking-dev.pages.dev/assets/TableOverlay-YiEL9djj.js

js wab-booking-dev.pages.dev collected 2026-10-03 05:47:22 UTC 4,432 bytes, 1 lines download raw bytes

1var x=Object.defineProperty;var L=(i,r,t)=>r in i?x(i,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[r]=t;var l=(i,r,t)=>L(i,typeof r!="symbol"?r+"":r,t);import{g as p,a as w}from"./types-zEhY_XAE.js";const h=14;function S(){return class extends google.maps.OverlayView{constructor(t){super();l(this,"table");l(this,"div",null);l(this,"canvas",null);l(this,"onClick");l(this,"onHover");l(this,"onHoverEnd");l(this,"isSelected");l(this,"_w",h);l(this,"_h",h);l(this,"_diag",h);l(this,"_latLng",null);l(this,"_lastSig","");this.table=t.table,this.onClick=t.onClick,this.onHover=t.onHover,this.onHoverEnd=t.onHoverEnd,this.isSelected=t.isSelected??!1}onAdd(){const t=document.createElement("div");t.style.position="absolute",t.style.cursor="pointer",t.style.userSelect="none",t.style.left="0",t.style.top="0";const e=document.createElement("canvas");e.width=32,e.height=32,e.style.width="32px",e.style.height="32px",t.appendChild(e),this.div=t,this.canvas=e,this._latLng=new google.maps.LatLng(this.table.latitude,this.table.longitude),this._lastSig=b(this.table),this.render(),this.registerEvents(),this.getPanes().overlayMouseTarget.appendChild(t)}draw(){if(!this.div||!this.canvas)return;const t=this.getProjection();if(!t)return;this._latLng||(this._latLng=new google.maps.LatLng(this.table.latitude,this.table.longitude));const e=t.fromLatLngToDivPixel(this._latLng);if(!e)return;const{w:n,h:a}=this.computePixelSize(t),s=Math.ceil(Math.sqrt(n*n+a*a))+4;(this._w!==n||this._h!==a)&&(this._w=n,this._h=a,this._diag=s,this.canvas.width!==s&&(this.canvas.width=s,this.canvas.height=s,this.canvas.style.width=`${s}px`,this.canvas.style.height=`${s}px`),this.render());const d=Math.round(e.x-this._diag/2),c=Math.round(e.y-this._diag/2);this.div.style.transform=`translate3d(${d}px, ${c}px, 0)`}onRemove(){var t,e;(e=(t=this.div)==null?void 0:t.parentNode)==null||e.removeChild(this.div),this.div=null,this.canvas=null,this._latLng=null}setSelected(t){this.isSelected!==t&&(this.isSelected=t,this.render())}update(t,e){const n=b(t),a=this.isSelected!==e;if(n===this._lastSig&&!a)return;const s=this.table;this.table=t,this.isSelected=e,this._lastSig=n,(s.latitude!==t.latitude||s.longitude!==t.longitude)&&(this._latLng=new google.maps.LatLng(t.latitude,t.longitude)),this.render(),this.draw()}computePixelSize(t){const{latitude:e,longitude:n,width:a,height:s,shape:v}=this.table,d=t.fromLatLngToDivPixel(new google.maps.LatLng(e,n));if(!d)return{w:h,h};if(v==="rhombus"){const c=Math.max(a,s),g=t.fromLatLngToDivPixel(new google.maps.LatLng(e,n+c)),o=Math.max(h,g?Math.abs(g.x-d.x)*Math.SQRT2:h);return{w:o,h:o}}else{const c=t.fromLatLngToDivPixel(new google.maps.LatLng(e,n+a)),g=t.fromLatLngToDivPixel(new google.maps.LatLng(e-s,n)),o=c?Math.abs(c.x-d.x)*2:h,u=g?Math.abs(g.y-d.y)*2:h;return{w:Math.max(h,o),h:Math.max(h,u)}}}render(){if(!this.canvas)return;const t=this.canvas.getContext("2d"),e=this.canvas.width,n=this.canvas.height;t.clearRect(0,0,e,n);const a=this._w,s=this._h,v=this.table.shape==="rhombus"?this.table.angle*Math.PI/180:0;t.save(),t.translate(e/2,n/2),t.rotate(v);const d=this.isSelected?"#FFEB3B":p(this.table),c=this.isSelected?"#F57F17":w(this.table);t.fillStyle=d,t.strokeStyle=c,t.lineWidth=2,t.beginPath(),t.rect(-a/2,-s/2,a,s),t.fill(),t.stroke(),t.rotate(-v);const g=Math.max(9,Math.min(18,Math.round(Math.min(a,s)*.55)));if(t.fillStyle="#000",t.font=`bold ${g}px sans-serif`,t.textAlign="center",t.textBaseline="middle",t.fillText(String(this.table.label),0,0),this.table.hasPhantomAssignment){const o=Math.max(7,Math.min(9,Math.round(Math.min(a,s)*.22))),u=a/2-o,m=-s/2+o;t.beginPath(),t.arc(u,m,o,0,Math.PI*2),t.fillStyle="#5b21b6",t.fill(),t.lineWidth=1,t.strokeStyle="#fff",t.stroke(),t.fillStyle="#fff",t.font=`bold ${Math.max(8,Math.round(o*1.2))}px sans-serif`,t.fillText("P",u,m+.5)}t.restore()}registerEvents(){this.div&&(this.div.addEventListener("click",t=>{var e;t.stopPropagation(),(e=this.onClick)==null||e.call(this,this.table)}),this.onHover&&this.div.addEventListener("mouseenter",()=>this.onHover(this.table,this.div)),this.onHoverEnd&&this.div.addEventListener("mouseleave",()=>this.onHoverEnd()))}}}function b(i){return`${i.latitude}|${i.longitude}|${i.width}|${i.height}|${i.shape}|${i.angle}|${i.label}|${i.assignedSeats}|${i.paidSeats}|${i.cancelledSeats}|${i.tableCostId}|${i.hasPhantomAssignment?"P":""}`}let f=null;function C(){return f||(f=S()),f}export{C as g};

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.