1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="37f8d7bb-95cd-4ddc-9051-dbb32367f6ba",e._sentryDebugIdIdentifier="sentry-dbid-37f8d7bb-95cd-4ddc-9051-dbb32367f6ba")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18405],{16461:(e,t,n)=>{n.d(t,{$l:()=>i});function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"quick_capture";window.dispatchEvent(new CustomEvent("site-walk:camera-request",{detail:{source:t,input:e}}))}},18405:(e,t,n)=>{n.r(t),n.d(t,{PlanViewerLeaflet:()=>M});var i=n(95155),a=n(12115),r=n(55027),l=n.n(r),o=n(4755),s=n(94882),c=n(26264);n(35603);var d=n(35299);let u={sessionText:"#0B0F15",capturedRing:"rgba(0,230,153,0.55)",foreignFill:"#475569",foreignBorder:"#64748b",foreignText:"#cbd5e1",iconWidthPx:28,iconHeightPx:36,longPressMs:550},p="#00c985",h="#2f6fd6",m="#6b7a90";function x(e){let{errorText:t,retrying:n,onRetry:a,onContinueWithCamera:r}=e;return(0,i.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3 px-6 text-center",children:[(0,i.jsx)("p",{className:"text-sm font-black text-[var(--graphite-text-header)]",children:"This plan couldn't be processed"}),(0,i.jsx)("p",{className:"max-w-xs text-xs font-semibold text-[var(--graphite-muted)]",children:t||"Something went wrong converting the drawing."}),(0,i.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,i.jsx)("button",{type:"button",onClick:a,disabled:n,className:"rounded-lg bg-[var(--graphite-primary)] px-4 py-2 text-xs font-bold text-white disabled:opacity-60",children:n?"Retryingâ¦":"Retry"}),r?(0,i.jsx)("button",{type:"button",onClick:r,className:"rounded-lg border border-[var(--graphite-border)] px-4 py-2 text-xs font-bold text-[var(--graphite-text-header)]",children:"Continue with camera"}):null]})]})}var f=n(53141);function b(e,t,n){return"number"!=typeof e||!Number.isFinite(e)||e<t||e>n?null:e}function g(e,t,n,i,a){if(!e)return;let r=function(e,t,n){let i=function(e){if(!e||"object"!=typeof e)return null;let t=e.crop_bbox_pct;if(!t||"object"!=typeof t)return null;let n=b(t.x,0,100),i=b(t.y,0,100),a=b(t.w,0,100),r=b(t.h,0,100);return null===n||null===i||null===a||null===r||a<=0||r<=0||n+a>100.001||i+r>100.001?null:{x:n,y:i,w:a,h:r}}(null==e?void 0:e.metadata);if(!i)return[[0,0],[n,t]];let a=i.y/100*n,r=i.x/100*t,l=a+i.h/100*n,o=r+i.w/100*t;return[[a,r],[l,o]]}(t,n,i);e.fitBounds(r,{paddingTopLeft:[a.left,a.top],paddingBottomRight:[a.right,a.bottom],animate:!1})}var v=n(82148),_=n(49035),y=n(17054),w=n(31179);function k(e){let{toolMode:t,imageWidth:n,imageHeight:i,sessionId:r,planSheetId:l,pins:o,setPins:s,setQuickMenu:c,onPinDropped:d,onPersistPin:p,useSourcePickerFlow:h=!1}=e,m=(0,y.ko)(),x=(0,a.useRef)(null),f=(0,a.useRef)(null),b=(0,a.useRef)(0),g=o.filter(e=>e.session_id===r).length,v=(0,a.useCallback)(e=>{let t=e.lat/i*100,a=e.lng/n*100;if(a<0||a>100||t<0||t>100)return;let o=(0,w.Gu)(),u=g+1,m={id:o,client_pin_id:o,x_pct:a,y_pct:t,session_id:r,label:String(u).padStart(2,"0"),amber:!0,item_id:null};s(e=>[...e,m]);let x=e=>{let n={...m,id:null!=e?e:m.id};if(h&&d)return void d({clientPinId:o,planSheetId:l,xPct:a,yPct:t,pinNumber:u,pin:n});c({clientPinId:o,xPct:a,yPct:t})};if(p)return void p(m).then(e=>{if(!(null==e?void 0:e.id))return void x(null);s(t=>t.map(t=>t.client_pin_id===o?{...t,id:e.id}:t)),x(e.id)});x(null),navigator.vibrate&&navigator.vibrate(50)},[i,n,p,d,l,r,g,s,c,h]);return(0,a.useEffect)(()=>{"draw"===t?m.dragging.disable():m.dragging.enable()},[m,t]),(0,a.useEffect)(()=>{let e=m.getContainer();function t(){x.current&&window.clearTimeout(x.current),x.current=null}function n(){t(),f.current=null,b.current=Math.max(0,b.current-1)}function i(e){if(("mouse"!==e.pointerType||0===e.button)&&!j(e.target)){if(b.current+=1,b.current>1)return void t();f.current={pointerId:e.pointerId,x:e.clientX,y:e.clientY,pointerCount:b.current},t(),x.current=window.setTimeout(()=>{let t=f.current;if(!t||t.pointerId!==e.pointerId||1!==t.pointerCount||1!==b.current)return;let n=m.mouseEventToLatLng(e);console.log("[PLAN_WALK] long press detected"),v(n),f.current=null},u.longPressMs)}}function a(e){let n=f.current;n&&n.pointerId===e.pointerId&&Math.hypot(e.clientX-n.x,e.clientY-n.y)>10&&(t(),f.current=null)}return e.addEventListener("pointerdown",i,{passive:!0}),e.addEventListener("pointermove",a,{passive:!0}),e.addEventListener("pointerup",n,{passive:!0}),e.addEventListener("pointercancel",n,{passive:!0}),e.addEventListener("pointerleave",n,{passive:!0}),()=>{t(),e.removeEventListener("pointerdown",i),e.removeEventListener("pointermove",a),e.removeEventListener("pointerup",n),e.removeEventListener("pointercancel",n),e.removeEventListener("pointerleave",n)}},[m,v]),(0,y.Po)({click(e){"draw"===t&&(j(e.originalEvent.target)||v(e.latlng))},contextmenu(e){j(e.originalEvent.target)||v(e.latlng)}
1}),null}function j(e){return e instanceof HTMLElement&&!!e.closest(".leaflet-marker-icon")}var N=n(5619);function P(e){var t;return{plan_sheet_id:e.planSheetId,session_id:e.sessionId,project_id:null!=(t=e.projectId)?t:null,x_pct:e.xPct,y_pct:e.yPct,client_pin_id:e.clientPinId,pin_number:e.pinNumber,pin_color:"green",pin_status:"draft"}}async function I(e){var t;await (0,N.tl)({kind:"pin_mutation",url:"/api/site-walk/pins",method:"POST",body:P(e),sessionId:e.sessionId});let n=new Date().toISOString();return{id:e.clientPinId,plan_id:null,plan_sheet_id:e.planSheetId,item_id:null,org_id:"",project_id:null!=(t=e.projectId)?t:null,session_id:e.sessionId,x_pct:e.xPct,y_pct:e.yPct,pin_number:e.pinNumber,pin_color:"green",client_pin_id:e.clientPinId,pin_status:"draft",label:null,created_by:null,markup_data:{},created_at:n,updated_at:n}}async function S(e){let t;if("undefined"!=typeof navigator&&!1===navigator.onLine)return I(e);try{t=await fetch("/api/site-walk/pins",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P(e))})}catch(t){return I(e)}let n=await t.json().catch(()=>null);if(!t.ok||!(null==n?void 0:n.pin)){var i;throw Error(null!=(i=null==n?void 0:n.error)?i:"Failed to create plan pin.")}return n.pin}var C=n(73863);let L=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function E(e,t,n){return[e.y_pct/100*n,e.x_pct/100*t]}function M(e){var t,n,r,b,y,w,j;let{projectId:N,sessionId:P="current-session",planSets:I=[],sheets:M=[],items:A=[],onCaptureRequest:T,onSelectItem:z,onPinDropped:R,onSessionPinTap:B,onContinueWithCamera:W,hideToolbar:D=!1,pageIndex:F,onPageIndexChange:O,sheetImageUrls:U,fitPadding:K,allowPinPlacement:q=!0,useSourcePickerFlow:H=!1,pinRefreshKey:$=0,devExposeMap:Z=!1,focusItemId:G=null,focusTick:Q=0}=e,[X,J]=(0,a.useState)(0),[V,Y]=(0,a.useState)("all"),[ee,et]=(0,a.useState)(null),[en,ei]=(0,a.useState)(!1),ea=(0,a.useRef)(null),er=(0,a.useRef)(null),el=null!=K?K:(0,f.o)(),eo=(0,a.useMemo)(()=>{var e,t,n;return null!=(n=null!=(t=null!=(e=I.find(e=>"ready"===e.processing_status))?e:I.find(e=>"failed"!==e.processing_status))?t:I[0])?n:null},[I]),es=(null==eo?void 0:eo.processing_status)==="failed",ec=(0,a.useCallback)(async()=>{if(eo&&!en){ei(!0);try{await fetch("/api/site-walk/plan-sets/".concat(eo.id,"/rasterize"),{method:"POST"})}finally{ei(!1)}}},[eo,en]),ed=(0,a.useMemo)(()=>eo?[...M.filter(e=>e.plan_set_id===eo.id)].sort((e,t)=>e.sort_order-t.sort_order||e.sheet_number-t.sheet_number):[],[eo,M]),eu=(0,a.useMemo)(()=>ed.map((e,t)=>{var n;return{key:e.id,label:(null==(n=e.sheet_name)?void 0:n.trim())||"Sheet ".concat(e.sheet_number),pageNumber:t+1,sheetId:e.id}}),[ed]),ep=eu.length>0?Math.min(null!=F?F:X,eu.length-1):0,eh=null!=(t=eu[ep])?t:null,em=null!=(n=ed.find(e=>e.id===(null==eh?void 0:eh.sheetId)))?n:null,ex=!!((null==em?void 0:em.rasterized_key)&&em.rasterized_width&&em.rasterized_height),ef=null!=(r=null==em?void 0:em.rasterized_width)?r:2048,eb=null!=(b=null==em?void 0:em.rasterized_height)?b:1448,eg=em&&(null==U?void 0:U[em.id])?U[em.id]:(null==em?void 0:em.rasterized_key)?"/api/site-walk/plan-sheets/".concat(em.id,"/image"):null,ev=(0,a.useMemo)(()=>{let e=new Map;for(let t of A)t.id&&t.item_type&&e.set(t.id,t.item_type);return e},[A]),e_=(0,a.useMemo)(()=>[[0,0],[eb,ef]],[eb,ef]),{pins:ey,setPins:ew,persistPin:ek,movePin:ej}=function(e){let{planSheetId:t,sessionId:n,projectId:i,pinRefreshKey:r}=e,[l,o]=(0,a.useState)([]);(0,a.useEffect)(()=>{if(!t)return void o([]);let e=!1;return fetch("/api/site-walk/pins?plan_sheet_id=".concat(encodeURIComponent(t)),{cache:"no-store"}).then(e=>e.ok?e.json():null).then(t=>{if(e||!(null==t?void 0:t.pins))return;let i=t.pins.map((e,t)=>(0,C.tI)(e,t,n));o(e=>(0,C.Ds)(e,i))}).catch(()=>void 0),()=>{e=!0}},[t,r,n]);let s=(0,a.useCallback)(async e=>{if(!t||!e.client_pin_id)return null;try{return{id:(await S({planSheetId:t,sessionId:n,projectId:i,xPct:e.x_pct,yPct:e.y_pct,clientPinId:e.client_pin_id,pinNumber:Number.parseInt(e.label,10)||1})).id}}catch(e){return null}},[t,i,n]),c=(0,a.useCallback)(async(e,t,n)=>{let i=e=>Math.min(100,Math.max(0,e)),a=i(t),r=i(n),l=null;if(o(t=>t.map(t=>
1t.id!==e?t:(l={x:t.x_pct,y:t.y_pct},{...t,x_pct:a,y_pct:r}))),L.test(e))try{let t=await fetch("/api/site-walk/pins/".concat(e),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({x_pct:a,y_pct:r})});if(!t.ok)throw Error("move failed: ".concat(t.status))}catch(t){l&&o(t=>t.map(t=>t.id===e?{...t,x_pct:l.x,y_pct:l.y}:t))}},[]);return{pins:l,setPins:o,persistPin:s,movePin:c}}({planSheetId:null==eh?void 0:eh.sheetId,sessionId:P,projectId:N,pinRefreshKey:$}),eN=(0,a.useCallback)(()=>{let e=ea.current;e&&ex&&g(e,em,ef,eb,el)},[em,ex,eb,ef,el]);(0,a.useEffect)(()=>{eN()},[null==em?void 0:em.id,ex,eN]),(0,a.useEffect)(()=>{let e=er.current;if(!e)return;let t=new ResizeObserver(()=>eN());return t.observe(e),()=>t.disconnect()},[eN]),(0,a.useEffect)(()=>{if(!G)return;let e=ea.current;if(!e)return;let t=ey.find(e=>e.item_id===G);t&&e.panTo(E(t,ef,eb),{animate:!0})},[G,Q,ey,ef,eb]);let eP=ey.filter(e=>"none"!==V&&("current"!==V||e.session_id===P)),eI=(0,a.useCallback)(e=>{if(e){if(ea.current=e,Z&&1){let t=window;t.__devPlanLeafletMap=e,t.__devPlanImageSize={width:ef,height:eb}}ex&&g(e,em,ef,eb,el)}},[em,Z,ex,eb,ef,el]),eS=(0,a.useCallback)(e=>{var t,n;if(e.session_id===P){if(B&&(e.item_id||H))return void B(e);H||et({pinId:(n=e.id,/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n))?e.id:null,clientPinId:null!=(t=e.client_pin_id)?t:e.id,xPct:e.x_pct,yPct:e.y_pct,isSavedPin:!!e.item_id})}},[B,P,H]);return(0,i.jsxs)("div",{ref:er,className:"absolute inset-0 select-none overflow-hidden bg-black text-white",style:{WebkitTouchCallout:"none"},children:[ex&&eg?(0,i.jsxs)(o.W,{crs:l().CRS.Simple,bounds:e_,maxBounds:l().latLngBounds([[-(.1*eb),-(.1*ef)],[1.1*eb,1.1*ef]]),maxBoundsViscosity:.8,zoomSnap:.25,zoomDelta:.5,minZoom:-2,maxZoom:4,attributionControl:!1,zoomControl:!1,className:"h-full w-full",style:{background:"#000"},ref:eI,children:[(0,i.jsx)(s.a,{url:eg,bounds:e_}),q?(0,i.jsx)(k,{toolMode:"pan",imageWidth:ef,imageHeight:eb,sessionId:P,planSheetId:null!=(y=null==eh?void 0:eh.sheetId)?y:"",pins:ey,setPins:ew,setQuickMenu:et,onPinDropped:R,onPersistPin:ek,useSourcePickerFlow:H}):null,eP.map(e=>{var t,n;let a=e.session_id===P,r=!!e.item_id;return(0,i.jsx)(c.p,{position:E(e,ef,eb),icon:function(e){let{label:t,currentSession:n,captured:i,xPct:a,yPct:r,itemType:o}=e,s=function(e){switch(e){case"photo_360":return{fill:"#3D8EFF",border:h,text:"#fff",badgeSvg:'<svg viewBox="0 0 16 16" width="9" height="9" fill="none" stroke="#fff" stroke-width="1.6" stroke-linecap="round"><circle cx="8" cy="8" r="6"/><ellipse cx="8" cy="8" rx="2.6" ry="6"/><path d="M2 8h12"/></svg>',badgeBg:h};case"file_attachment":return{fill:"#94A3B8",border:m,text:"#0B0F15",badgeSvg:'<svg viewBox="0 0 16 16" width="9" height="9" fill="none" stroke="#fff" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M13 7.5l-5.4 5.4a3 3 0 0 1-4.2-4.2l5.7-5.7a2 2 0 0 1 2.8 2.8l-5.7 5.7a1 1 0 0 1-1.4-1.4l5-5"/></svg>',badgeBg:m};default:return{fill:"#00E699",border:p,text:"#0B0F15",badgeSvg:null,badgeBg:p}}}(i?o:"photo"),c=n?s.fill:u.foreignFill,d=n?s.border:u.foreignBorder,x=n?s.text:u.foreignText,f=i&&n?"box-shadow:0 0 0 2px ".concat(u.capturedRing,";"):"",b=n&&i&&s.badgeSvg?'<div style="position:absolute;top:-4px;right:-4px;width:14px;height:14px;border-radius:50%;background:'.concat(s.badgeBg,";border:1.5px solid ").concat(u.sessionText,';display:flex;align-items:center;justify-content:center">').concat(s.badgeSvg,"</div>"):"";
1return l().divIcon({className:"",iconSize:[u.iconWidthPx,u.iconHeightPx],iconAnchor:[u.iconWidthPx/2,u.iconHeightPx],html:'<div style="display:flex;flex-direction:column;align-items:center" data-plan-pin-marker="'.concat(n?"session":"foreign",'" data-plan-pin-type="').concat(i?null!=o?o:"photo":"empty",'" data-plan-pin-label="').concat(t,'" data-plan-pin-x-pct="').concat(a.toFixed(3),'" data-plan-pin-y-pct="').concat(r.toFixed(3),'"><div style="position:relative;width:28px;height:28px;border-radius:50%;background:').concat(c,";color:").concat(x,";display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;border:2px solid ").concat(d,";").concat(f,'">').concat(t).concat(b,'</div><div style="width:2px;height:8px;background:').concat(c,';border-radius:1px"></div></div>')})}({label:e.label,currentSession:a,captured:r,xPct:e.x_pct,yPct:e.y_pct,itemType:e.item_id&&null!=(t=ev.get(e.item_id))?t:null}),draggable:a,eventHandlers:a?{click:()=>eS(e),dragend:t=>{let n=t.target.getLatLng(),i=n.lat/eb*100,a=n.lng/ef*100;ej(e.id,a,i)}}:void 0},null!=(n=e.client_pin_id)?n:e.id)})]},null!=(w=null==em?void 0:em.id)?w:"plan-map"):es?(0,i.jsx)(x,{errorText:null==eo?void 0:eo.processing_error,retrying:en,onRetry:()=>void ec(),onContinueWithCamera:W}):(0,i.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center gap-3 px-6 text-center",children:[(0,i.jsx)(d.A,{className:"h-8 w-8 animate-spin text-[var(--graphite-primary)]"}),(0,i.jsx)("p",{className:"text-sm font-black text-[var(--graphite-text-header)]",children:"Loading planâ¦"}),(0,i.jsx)("p",{className:"text-xs font-semibold text-[var(--graphite-muted)]",children:eo?"Plan is being processed. The image will appear shortly.":"No plan sets found for this project."})]}),D?null:(0,i.jsx)(_.t,{fileUrl:null,pages:eu.map(e=>({key:e.key,label:e.label,pageNumber:e.pageNumber})),activeIndex:ep,zoomPercent:ea.current?Math.round(100*Math.pow(2,ea.current.getZoom())):100,filter:V,pinCount:eP.length,onSelect:null!=O?O:J,onZoom:e=>{ea.current&&(e>0?ea.current.zoomIn(.5):ea.current.zoomOut(.5))},onChangeFilter:Y}),ee&&!H?(0,i.jsx)(v.S,{pinId:ee.pinId,clientPinId:ee.clientPinId,isSavedPin:ee.isSavedPin,planSheetId:null!=(j=null==eh?void 0:eh.sheetId)?j:"",xPct:ee.xPct,yPct:ee.yPct,captureDisabledReason:eh&&!eh.sheetId?"Sheet is still syncing.":void 0,onClose:()=>et(null),onCaptureRequest:T}):null]})}},20711:(e,t,n)=>{n.d(t,{U:()=>l,c:()=>r});var i=n(12115);let a="site-walk-plan-capture-target";function r(e){window.dispatchEvent(new CustomEvent(a,{detail:e}))}function l(){let[e,t]=(0,i.useState)(null);return(0,i.useEffect)(()=>{function e(e){let n=e instanceof CustomEvent?e.detail:null;n&&"object"==typeof n&&"string"==typeof n.planSheetId&&"number"==typeof n.xPct&&"number"==typeof n.yPct&&("photo"===n.action||"note"===n.action)&&t({planSheetId:n.planSheetId,xPct:n.xPct,yPct:n.yPct,pinId:n.pinId,clientPinId:n.clientPinId})}return window.addEventListener(a,e),()=>window.removeEventListener(a,e)},[]),{target:e,clearTarget:()=>t(null)}}},31179:(e,t,n)=>{n.d(t,{$Q:()=>d,A1:()=>l,DX:()=>c,FU:()=>h,Gu:()=>u,OF:()=>r,QG:()=>p,RC:()=>s,S6:()=>o,o4:()=>i,pi:()=>a,qE:()=>m});let i=1200,a=858,r=.25,l=2.5,o=16;function s(){let e=window.innerWidth<768;return{toolbar:e?44:120,bottom:e?44:80}}function c(e,t,n){return e?Array.from({length:Math.max(e.page_count||0,t.length,n,1)},(n,i)=>{var a,r;let l=i+1,o=t.find(e=>e.sheet_number===l);return{key:null!=(a=null==o?void 0:o.id)?a:"".concat(e.id,"-").concat(l),label:null!=(r=null==o?void 0:o.sheet_name)?r:"Sheet ".concat(l),pageNumber:l,sheetId:null==o?void 0:o.id}}):[]}function d(e,t,n,i){if(!t)return null;let a=t.getBoundingClientRect(),r=m((e.x-a.left)/a.width*100,0,100),l=m((e.y-a.top)/a.height*100,0,100),o=u();return{id:o,client_pin_id:o,x_pct:r,y_pct:l,session_id:i,label:String(n).padStart(2,"0"),amber:!0,item_id:null}}function u(){var e,t,n;return"pin_".concat(null!=(n=null==(t=globalThis.crypto)||null==(e=t.randomUUID)?void 0:e.call(t))?n:Math.random().toString(36).slice(2))}function p(e){e.current&&clearTimeout(e.current),e.current=null}function h(e){let[t,n]=Array.from(e.values());return t&&n?Math.hypot(n.x-t.x,n.y-t.y):1}function m(e,t,n){return Math.min(n,Math.max(t,e))}},49035:(e,t,n)=>{n.d(t,{t:()=>o});var i=n(95155),a=n(12115),r=n(24033),l=n(21873);function o(e){var t,n;let{fileUrl:o,pages:s,activeIndex:c,zoomPercent:d,filter:u,pinCount:p,onSelect:h,onZoom:m,onCh
1angeFilter:x}=e,[f,b]=(0,a.useState)(!1),g=s.length,v=null!=(n=null==(t=s[c])?void 0:t.label)?n:"No pages";return(0,i.jsxs)("div",{className:"absolute left-3 top-3 z-[700] md:left-4 md:top-4",children:[(0,i.jsxs)("div",{className:"inline-flex max-w-[calc(100vw-1.5rem)] items-center gap-2 rounded-2xl border border-white/15 bg-slate-950/78 px-3 py-2 text-white shadow-2xl backdrop-blur-xl",children:[(0,i.jsxs)("button",{type:"button",onClick:()=>b(e=>!e),className:"inline-flex shrink-0 items-center gap-1 text-[10px] font-black uppercase tracking-[0.12em] text-[var(--graphite-primary)]",children:["Plans ",(0,i.jsx)(r.A,{className:"h-3.5 w-3.5 transition ".concat(f?"rotate-180":"")})]}),(0,i.jsx)("button",{type:"button",onClick:()=>b(e=>!e),className:"min-w-0 max-w-[10rem] truncate text-left text-[10px] font-black uppercase tracking-[0.14em] text-slate-300",children:0===g?"No pages":"".concat(c+1,"/").concat(g," \xb7 ").concat(v)}),(0,i.jsxs)("span",{className:"inline-flex h-6 shrink-0 items-center gap-1 rounded-lg bg-[color-mix(in_srgb,var(--graphite-primary)_15%,transparent)] px-2 text-[10px] font-black text-[var(--graphite-primary)]","aria-label":"".concat(p," pins visible"),children:[(0,i.jsx)(l.A,{className:"h-3 w-3"})," ",p]}),(0,i.jsxs)("div",{className:"ml-1 flex shrink-0 items-center gap-1",children:[(0,i.jsx)("button",{type:"button",onClick:()=>m(-1),className:"rounded-md px-1.5 py-0.5 text-[10px] font-black text-slate-300",children:"â"}),(0,i.jsx)("button",{type:"button",onClick:()=>m(1),className:"rounded-md px-1.5 py-0.5 text-[10px] font-black text-slate-300",children:"+"})]})]}),f&&g>0?(0,i.jsx)("div",{className:"mt-2 max-h-48 overflow-y-auto rounded-2xl border border-white/15 bg-slate-950/92 p-1 shadow-2xl backdrop-blur-xl",children:s.map((e,t)=>(0,i.jsxs)("button",{type:"button",onClick:()=>{h(t),b(!1)},className:"flex w-full items-center rounded-xl px-3 py-2 text-left text-[11px] font-semibold ".concat(t===c?"bg-[color-mix(in_srgb,var(--graphite-primary)_15%,transparent)] text-[var(--graphite-primary)]":"text-slate-300"),children:[t+1,"/",g," \xb7 ",e.label]},e.key))}):null]})}},69786:(e,t,n)=>{n.d(t,{R:()=>a});var i=n(12115);function a(){let[e,t]=(0,i.useState)("desktop");(0,i.useEffect)(()=>{let e=[window.matchMedia("(pointer: coarse)"),window.matchMedia("(hover: none)"),window.matchMedia("(max-width: 767px)")],n=()=>t(function(){let e=window.matchMedia("(pointer: coarse)").matches,t=window.matchMedia("(hover: none)").matches,n=window.matchMedia("(max-width: 767px)").matches;return e&&t||n?"mobile":"desktop"}());for(let t of(n(),window.addEventListener("resize",n),e))t.addEventListener("change",n);return()=>{for(let t of(window.removeEventListener("resize",n),e))t.removeEventListener("change",n)}},[]);let n="mobile"===e?"camera":"upload";return{deviceKind:e,isMobile:"mobile"===e,isDesktop:"desktop"===e,primaryCaptureInput:n,primaryCaptureLabel:"camera"===n?"Camera":"Upload Photo"}}},73863:(e,t,n)=>{n.d(t,{Ds:()=>o,No:()=>r,tI:()=>l});var i=n(95155),a=n(25016);function r(e){let{pin:t,active:n,current:r,onClick:l}=e;return(0,i.jsx)("button",{type:"button",onClick:l,className:(0,a.cn)("absolute -translate-x-1/2 -translate-y-full p-2 transition-all duration-300",n?"z-20 scale-125":"z-10 hover:scale-110"),style:{left:"".concat(t.x_pct,"%"),top:"".concat(t.y_pct,"%")},children:(0,i.jsxs)("span",{className:"relative flex flex-col items-center",children:[(0,i.jsx)("span",{className:(0,a.cn)("flex h-8 w-8 items-center justify-center rounded-full border-2 shadow-xl shadow-black/50",r?"border-[color-mix(in_srgb,var(--graphite-primary)_60%,white)] bg-[var(--graphite-primary)] text-[var(--graphite-canvas)]":"border-slate-500 bg-slate-700 text-slate-300",n&&r&&"ring-4 ring-[color-mix(in_srgb,var(--graphite-primary)_30%,transparent)]"),children:(0,i.jsx)("span",{className:"text-[11px] font-black",children:t.label})}),(0,i.jsx)("span",{className:(0,a.cn)("h-3 w-0.5 shadow-lg",r?"bg-[var(--graphite-primary)]":"bg-slate-700")})]})})}function l(e,t,n){var i,a;return{id:e.id,client_pin_id:e.client_pin_id,x_pct:e.x_pct,y_pct:e.y_pct,session_id:null!=(i=e.session_id)?i:"",label:e.pin_
1number?String(e.pin_number).padStart(2,"0"):String(t+1).padStart(2,"0"),amber:e.session_id===n,item_id:null!=(a=e.item_id)?a:null}}function o(e,t){let n=e.filter(e=>{var n;return e.amber&&(n=e.id,!/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(n))&&!t.some(t=>{var n,i,a,r;return n=t,i=e,!!(n.client_pin_id&&i.client_pin_id&&n.client_pin_id===i.client_pin_id)||(a=t,r=e,.25>Math.abs(a.x_pct-r.x_pct)&&.25>Math.abs(a.y_pct-r.y_pct))})});return[...t,...n]}},82148:(e,t,n)=>{n.d(t,{S:()=>h});var i=n(95155),a=n(12115),r=n(65229),l=n(11047),o=n(95664),s=n(21786),c=n(69786),d=n(53760),u=n(16461),p=n(20711);function h(e){let{pinId:t,clientPinId:n,isSavedPin:h=!1,planSheetId:m,xPct:x,yPct:f,captureDisabledReason:b,onClose:g,onCaptureRequest:v}=e,{isDesktop:_}=(0,c.R)(),y=(0,d.RM)(),w=!!b;function k(e,i){var a;let r={pinId:t&&(a=t,/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(a))?t:null,clientPinId:null!=n?n:null,planSheetId:m,xPct:x,yPct:f};w||(y?(y.setPlanTarget(r),console.log("[PLAN_WALK] capture context target set",r),i&&(console.log("camera"===i?"[PLAN_WALK] Take Photo tapped":"[PLAN_WALK] Upload tapped",{target:r}),console.log("[PLAN_WALK] capture requested",{input:i,target:r}),v?v(i):y.requestCapture(i,"plan_pin"))):((0,p.c)({...r,action:e}),i&&(console.log("camera"===i?"[PLAN_WALK] Take Photo tapped":"[PLAN_WALK] Upload tapped",{target:r}),console.log("[PLAN_WALK] capture requested",{input:i,target:r}),(0,u.$l)(i,"plan_pin"))),g())}return(0,a.useEffect)(()=>{console.log("[PLAN_WALK] action sheet visible",{planSheetId:m,xPct:x,yPct:f,clientPinId:n,pinId:t})},[n,t,m,x,f]),(0,i.jsx)("div",{className:"pointer-events-none fixed inset-x-0 bottom-0 z-[2000] flex justify-center px-3 pb-[max(env(safe-area-inset-bottom),0.75rem)] sm:inset-0 sm:items-center sm:px-4 sm:pb-0",children:(0,i.jsxs)("div",{className:"pointer-events-auto w-full max-w-sm rounded-[1.75rem] border border-[color-mix(in_srgb,var(--graphite-primary)_25%,transparent)] bg-slate-900/95 p-4 text-left text-slate-50 shadow-2xl shadow-black/70 backdrop-blur-xl",children:[(0,i.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("p",{className:"text-xs font-black uppercase tracking-[0.16em] text-[var(--graphite-primary)]",children:h?"Saved Stop":"Draft pin"}),(0,i.jsx)("p",{className:"mt-1 text-sm font-bold text-slate-400",children:h?"Location locked. Add evidence from this saved location.":"Drag the pin to adjust it, then attach the next capture."})]}),(0,i.jsx)("button",{type:"button",onClick:g,className:"rounded-lg p-1 text-slate-500 hover:bg-white/[0.06]","aria-label":"Close pin actions",children:(0,i.jsx)(r.A,{className:"h-4 w-4"})})]}),(0,i.jsxs)("div",{className:"mt-3 grid gap-2",children:[h&&(0,i.jsxs)("button",{type:"button",disabled:!0,className:"flex min-h-11 items-center gap-2 rounded-xl border border-white/10 bg-white/[0.03] px-3 py-2 text-sm font-black text-slate-500 opacity-70",title:"No linked stop details are available in this walk view.",children:[(0,i.jsx)(l.A,{className:"h-4 w-4"})," Open details unavailable"]}),!_&&(0,i.jsxs)("button",{type:"button",onClick:()=>k("photo","camera"),disabled:w,className:"flex min-h-11 items-center gap-2 rounded-xl bg-[var(--graphite-primary)] px-3 py-2 text-sm font-black text-[var(--graphite-canvas)] hover:bg-[color-mix(in_srgb,var(--graphite-primary)_85%,white)] disabled:opacity-50",children:[(0,i.jsx)(o.A,{className:"h-4 w-4"})," Take photo at this pin"]}),(0,i.jsxs)("button",{type:"button",onClick:()=>k("photo","upload"),disabled:w,className:"flex min-h-11 items-center gap-2 rounded-xl border border-white/10 bg-white/[0.04] px-3 py-2 text-sm font-black text-slate-200 hover:border-[color-mix(in_srgb,var(--graphite-primary)_50%,transparent)] hover:text-[var(--graphite-primary)] disabled:opacity-50",children:[(0,i.jsx)(s.A,{className:"h-4 w-4"})," Upload existing photo"]}),b&&(0,i.jsx)("p",{className:"rounded-xl border border-white/10 bg-white/[0.05] px-3 py-2 text-xs font-bold leading-5 text-[var(--graphite-muted)]",children:b}),(0,i.jsxs)("button",{type:"button",disabled:!0,className:"flex min-h-11 items-center gap-2 rounded-xl border border-white/10 bg-white/[0.03] px-3 py-2 text-sm font-black text-slate-500 opacity-70",title:"Add notes after capturing or uploading a photo for this plan stop.",children:[(0,i.jsx)(l.A,{className:"h-4 w-4"})," Add Note after photo/upload"]}),(0,i.jsx)("button",{type:"button",onClick:g,className:"flex min-h-11 items-center justify-center rounded-xl border border-white/10 bg-black/30 px-3 py-2 text-sm font-black text-slate-200 hover:border-white/20 hover:text-white",children:"Cancel"})]})]})})}}}]);
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.