PageSourceSearch

https://app.tinn.app/_next/static/chunks/3247.91b1d51ac74d4de0.js

js tinn.app collected 2026-10-02 01:16:20 UTC 54,283 bytes, 31 lines download raw bytes

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]="f81adda8-627e-4fe2-bead-a35340d6196c",e._sentryDebugIdIdentifier="sentry-dbid-f81adda8-627e-4fe2-bead-a35340d6196c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3247],{93247:function(e,t,n){n.r(t),n.d(t,{default:function(){return W}});var l=n(57437),r=n(2265),i=n(58895),a=n(54817),o=n(74697),s=n(22468),d=n(81981),c=n(10883),x=n(58184),u=n(4224),p=n(78030);/**
2 * @license lucide-react v0.395.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */let h=(0,p.Z)("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);var g=n(49321);/**
7 * @license lucide-react v0.395.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */let m=(0,p.Z)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var f=n(75134),y=n(44828),b=n(71106),v=n(75733),j=n(18422);/**
12 * @license lucide-react v0.395.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */let w=(0,p.Z)("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);var k=n(92513);/**
17 * @license lucide-react v0.395.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */let N=(0,p.Z)("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var C=n(42421),I=n(87592),S=n(97063),z=n(99654),A=n(34530),E=n(37440),M=n(65530),D=n(17951),B=n(23814),P=n(18669),_=n(64552);function F(e){return e.startsWith("data:application/pdf")||e.startsWith("r2://")&&e.toLowerCase().endsWith(".pdf")}function R(){return Date.now().toString()+Math.random().toString(36).slice(2,6)}function Z(e){let{status:t}=e;return(0,l.jsx)(z.Z,{status:t,size:"sm"})}function U(e){let{pin:t,number:n,product:r,imageHeight:i}=e,{fmt:a}=(0,A.V)(),o=(0,_.NT)(),s=t.y>.5;return(0,l.jsxs)("div",{className:"absolute z-30 pointer-events-none bg-white border border-gray-200 rounded-xl shadow-2xl p-2.5 w-48 text-xs ".concat(s?"bottom-full mb-2":"top-full mt-2"," left-1/2 -translate-x-1/2"),style:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,l.jsx)("span",{className:"w-4 h-4 rounded-full bg-gray-900 text-white flex items-center justify-center text-[9px] font-bold shrink-0",children:n}),(0,l.jsx)("span",{className:"font-semibold text-gray-800 truncate",children:r?(0,E.Gf)(r):o("planBoard.unlinkedMarker")})]}),r&&(0,l.jsxs)(l.Fragment,{children:[r.space&&(0,l.jsx)("div",{className:"text-gray-500 truncate",children:r.space}),r.category&&(0,l.jsx)("div",{className:"text-gray-400 truncate",children:r.category}),r.widthMm||r.depthMm||r.heightMm?(0,l.jsxs)("div",{className:"text-gray-500 mt-0.5 tabular-nums",children:[[r.widthMm?"W".concat(r.widthMm):null,r.depthMm?"D".concat(r.depthMm):null,r.heightMm?"H".concat(r.heightMm):null].filter(Boolean).join(" \xd7 ")," mm"]}):r.dims?(0,l.jsx)("div",{className:"text-gray-500 mt-0.5 truncate",children:r.dims}):null,null!=r.price&&(0,l.jsxs)("div",{className:"text-gray-700 font-medium mt-0.5",children:[a(r.price),r.quantity>1?" \xd7 ".concat(r.quantity," = ").concat(a((0,M.B)(r))):""]}),(0,l.jsx)("div",{className:"mt-1",children:(0,l.jsx)(Z,{status:r.status})})]})]})}function L(e){let{products:t,pinnedProductIds:n,containerRect:i,position:d,onSelect:c,onClose:x}=e,u=(0,_.NT)(),[p,h]=(0,r.useState)(""),g=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e;null===(e=g.current)||void 0===e||e.focus()},[]);let m=(0,r.useMemo)(()=>{let e=p.toLowerCase();return e?t.filter(t=>{var n;return t.name.toLowerCase().includes(e)||t.space.toLowerCase().includes(e)||t.category.toLowerCase().includes(e)||(null!==(n=t.mark)&&void 0!==n?n:"").toLowerCase().includes(e)}):t},[t,p]),f=d.x,y=d.y;return i&&(f+240>i.right-8&&(f=i.right-240-8),f<i.left+8&&(f=i.left+8),y+280>i.bottom-8&&(y=i.bottom-280-8),y<i.top+8&&(y=i.top+8)),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-40",onClick:x}),(0,l.jsxs)("div",{className:"fixed z-50 bg-white rounded-xl shadow-2xl border border-gray-200 flex flex-col",style:{left:f,top:y,width:240,maxHeight:280,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-100",children:[(0,l.jsx)(a.Z,{size:13,className:"text-gray-400 shrink-0"}),(0,l.jsx)("input",{ref:g,value:p,onChange:e=>h(e.target.value),placeholder:u("planBoard.search.placeholder"),className:"flex-1 text-xs outline-none bg-transparent text-gray-800 placeholder-gray-400",onKeyDown:e=>{"Escape"===e.key&&x()}}),(0,l.jsx)("button",{onClick:x,className:"text-gray-400 hover:text-gray-600",children:(0,l.jsx)(o.Z,{size:13})})]}),(0,l.jsxs)("div",{className:"overflow-y-auto flex-1",children:[0===m.length&&(0,l.jsx)("div",{className:"py-6 text-center text-xs text-gray-400",children:u("planBoard.products.noneFound")}),m.map(e=>{let t=n.has(e.id);return(0,l.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 hover:bg-gray-50 text-left transition-colors",onClick:()=>c(e.id),children:[e.imageUrl?(0,l.jsx)("img",{src:e.imageUrl,alt:"",className:"w-7 h-7 rounded-lg object-cover shrink-0"}):(0,l.jsx)("div",{className:"w-7 h-7 rounded-lg bg-gray-100 shrink-0"}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-xs font-medium text-gray-800 truncate",children:(0,E.Gf)(e)}),(0,l.jsx)("div",{className:"text-[10px] text-gray-400 truncate",children:e.space})]}),t&&(0,l.jsx)(s.Z,{size:13,className:"text-[#182A41] shrink-0"})]},e.id)})]})]})]})}function W(e){var t,n,s,p,z,M,W;let{projectId:T,products:O,planImages:H,planPins:X,onSaveImages:Y,onSavePins:G,onCreateProductForPin:q,onOpenProduct:K}=e,V=(0,_.NT)(),$=(0,_.XX)(),{fmt:J}=(0,A.V)(),Q=(0,i.d)(),[ee,et]=(0,r.useState)(null!==(p=null===(t=H[0])||void 0===t?void 0:t.id)&&void 0!==p?p:null),[en,el]=(0,r.useState)(!1),[er,ei]=(0,r.useState)(!1),[ea,eo]=(0,r.useState)(null),[es,ed]=(0,r.useState)(null),[ec,ex]=(0,r.useState)(null),[eu,ep]=(0,r.useState)(null),[eh,eg]=(0,r.useState)(!1),[em,ef]=(0,r.useState)(null),[ey,eb]=(0,r.useState)(""),[ev,ej]=(0,r.useState)("All"),[ew,ek]=(0,r.useState)(""),[eN,eC]=(0,r.useState)(!1),[eI,eS]=(0,r.useState)(null),[ez,eA]=(0,r.useState)(null),[eE,eM]=(0,r.useState)(null),[eD,eB]=(0,r.useState)(null),[eP,e_]=(0,r.useState)(null),[eF,eR]=(0,r.useState)(""),[eZ,eU]=(0,r.useState)(null),[eL,eW]=(0,r.useState)(null),[eT,eO]=(0,r.useState)(!1),[eH,eX]=(0,r.useState)(!1),[eY,eG]=(0,r.useState)(!1),[eq,eK]=(0,r.useState)(1),[eV,e$]=(0,r.useState)({x:0,y:0}),eJ=(0,r.useRef)(null),[eQ,e0]=(0,r.useState)({});(0,r.useEffect)(()=>{let e=H.filter(e=>(0,B.iP)(e.dataUrl)&&!eQ[e.dataUrl]);if(0===e.length)return;let t=!1;return(async()=>{let n={};await Promise.all(e.map(async e=>{let t=await (0,B.CO)(e.dataUrl);t&&t!==B.no&&(n[e.dataUrl]=t)})),!t&&Object.keys(n).length>0&&e0(e=>({...e,...n}))})(),()=>{t=!0}},[H]);let e1=(0,r.useCallback)(e=>{var t;return(0,B.iP)(e)?null!==(t=eQ[e])&&void 0!==t?t:B.no:e},[eQ]),[e2,e5]=(0,r.useState)([]),[e4,e8]=(0,r.useState)(!1),[e3,e7]=(0,r.useState)(null),[e6,e9]=(0,r.useState)(null),[te,tt]=(0,r.useState)(null),tn=(0,r.useRef)(null),tl=(0,r.useRef)(null),tr=(0,r.useRef)(null),ti=(0,r.useRef)(new Map),ta=null!==(z=H.find(e=>e.id===ee))&&void 0!==z?z:null,to=(0,r.useMemo)(()=>X.filter(e=>e.planImageId===ee),[X,ee]),ts=(0,r.useMemo)(()=>(function(e,t){let n=(0,E.uL)(t),l=new Map;for(let t of e)if("__placeholder__"===t.productId||t.productId.startsWith("__placeholder__"))l.set(t.i
21d,"?");else{var r;l.set(t.id,null!==(r=n.get(t.productId))&&void 0!==r?r:"?")}return l})(to,O),[to,O]),td=(0,r.useMemo)(()=>{let e=new Map;for(let n of to){var t;"__placeholder__"!==n.productId&&e.set(n.productId,(null!==(t=e.get(n.productId))&&void 0!==t?t:0)+1)}return e},[to]),tc=(0,r.useMemo)(()=>new Set(to.filter(e=>"__placeholder__"!==e.productId).map(e=>e.productId)),[to]),tx=(0,r.useMemo)(()=>to.filter(e=>"__placeholder__"===e.productId),[to]),tu=(0,r.useMemo)(()=>["All",...Array.from(new Set(O.map(e=>e.space).filter(Boolean)))],[O]),tp=(0,r.useMemo)(()=>{let e=O.filter(e=>{var t;let n=e.quantity||1;return(null!==(t=td.get(e.id))&&void 0!==t?t:0)<n});if("All"!==ev&&(e=e.filter(e=>e.space===ev)),ew){let t=ew.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.space.toLowerCase().includes(t)||e.category.toLowerCase().includes(t))}return e},[O,td,ev,ew]),th=(0,r.useMemo)(()=>O.filter(e=>{var t;return(null!==(t=td.get(e.id))&&void 0!==t?t:0)>0}),[O,td]),tg=(0,r.useCallback)(async e=>{if(e)for(let t of Array.from(e)){let e=await new Promise(e=>{let n=new FileReader;n.onload=t=>{var n;return e(null===(n=t.target)||void 0===n?void 0:n.result)},n.readAsDataURL(t)}),n=e;try{let l=(0,P.kD)(e),r=l.type||t.type||"image/jpeg",i=await (0,B.pl)(l,T,"plan",r);i?n=i:eW("Cloud upload failed — plan saved locally only")}catch(e){console.error("[PlanBoard] R2 upload error:",e),eW("Cloud upload failed — plan saved locally only")}let l={id:Date.now().toString()+Math.random().toString(36).slice(2,5),projectId:T,name:t.name.replace(/\.[^/.]+$/,""),dataUrl:n,createdAt:new Date().toISOString()};Y([...H,l]),et(l.id)}},[T,H,Y]);function tm(e){let t=tl.current;if(!t)return null;let n=t.getBoundingClientRect(),l=(e.clientX-n.left)/n.width,r=(e.clientY-n.top)/n.height;return l<0||r<0||l>1||r>1?null:{x:l,y:r}}let[tf,ty]=(0,r.useState)(!1);function tb(e,t){e5(n=>n.map(n=>n.id===e?{...n,...t}:n))}function tv(e){G(X.filter(t=>t.id!==e)),ea===e&&eo(null),ex(null)}function tj(e){G(X.map(t=>{if(t.collectionId!==e)return t;let{collectionId:n,...l}=t;return l})),eU(null)}function tw(){if(!em)return;let e=ey.trim();e&&Y(H.map(t=>t.id===em?{...t,name:e}:t)),ef(null)}function tk(e){let t=to.find(t=>t.productId===e);t&&(eo(t.id),eC(!0),setTimeout(()=>{var t;null===(t=ti.current.get(e))||void 0===t||t.scrollIntoView({behavior:"smooth",block:"nearest"})},50))}return(0,r.useEffect)(()=>ty(!1),[ee]),(0,r.useEffect)(()=>{(0,D.LB)(T).then(e=>e5(e))},[T]),(0,r.useEffect)(()=>{(0,D.Xi)(T,e2)},[T,e2]),(0,r.useEffect)(()=>{eK(1),e$({x:0,y:0})},[ee]),(0,r.useEffect)(()=>{let e=eJ.current;if(!e)return;let t=t=>{if(!(!ta||F(ta.dataUrl))){if(t.preventDefault(),t.ctrlKey||t.metaKey){let n=t.deltaY<0?1.1:.909;eK(l=>{let r=Math.min(10,Math.max(.2,l*n)),i=e.getBoundingClientRect(),a=t.clientX-i.left-i.width/2,o=t.clientY-i.top-i.height/2;return e$(e=>({x:a-(a-e.x)*(r/l),y:o-(o-e.y)*(r/l)})),r})}else e$(e=>({x:e.x-t.deltaX,y:e.y-t.deltaY}))}};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[ta]),(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&eG(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,r.useEffect)(()=>{function e(e){if(en&&ea){if("Delete"===e.key||"Backspace"===e.key){let e=document.activeElement;if(e&&("INPUT"===e.tagName||"TEXTAREA"===e.tagName))return;tv(ea)}"Escape"===e.key&&(eo(null),ei(!1),ep(null),ex(null))}}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[en,ea,X]),(0,r.useEffect)(()=>{if(eI)return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t)};function e(e){let t=tl.current,n=tr.current;if(!t||!n)return;let l=t.getBoundingClientRect(),r=n.naturalWidth,i=n.naturalHeight;if(!r||!i)return;let a=l.width,o=l.height,s=Math.min(a/r,o/i),d=r*s,c=i*s,x=e.clientX-l.left-(a-d)/2,u=e.clientY-l.top-(o-c)/2,p=Math.max(0,Math.min(1,x/d)),h=Math.max(0,Math.min(1,u/c)),g=X.find(e=>e.id===eI),m=null==g?void 0:g.collectionId;G(X.map(e=>e.id===eI||m&&e.collectionId===m?{...e,x:p,y:h}:e))}function t(){let e=X.find(e=>e.id===eI);if(e){let t=e.planImageId,n=X.find(n=>n.id!==eI&&n.planImageId===t&&.04>Math.abs(n.x-e.x)&&.04>Math.abs(n.y-e.y)&&!(e.collectionId&&n.collectionId===e.collectionId));n&&eM({draggedPinId:eI,targetPinId:n.id})}eS(null)}},[eI,X,G]),(0,r.useEffect)(()=>
21{if(!ez)return;let e=tl.current;if(!e)return;let t=X.find(e=>e.id===ez);if(t)return window.addEventListener("mousemove",n),window.addEventListener("mouseup",l),()=>{window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",l)};function n(n){let l=e.getBoundingClientRect(),r=l.width,i=l.height,a=l.left+t.x*r,o=l.top+t.y*i,s=n.clientX-a,d=(Math.round(180/Math.PI*Math.atan2(n.clientY-o,s)+90)%360+360)%360;G(X.map(e=>e.id===ez?{...e,rotation:d}:e))}function l(){eA(null)}},[ez,X,G]),(0,r.useEffect)(()=>{if(!ec)return;let e=()=>ex(null);return window.addEventListener("click",e),()=>window.removeEventListener("click",e)},[ec]),(0,l.jsxs)("div",{className:"flex overflow-hidden",style:{height:"100%",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),tg(e.dataTransfer.files)},children:[!Q&&(0,l.jsxs)("div",{className:"flex flex-col border-r border-gray-200 overflow-hidden shrink-0 transition-all duration-200",style:{width:eT?0:220,background:"#F5F5F7"},children:[(0,l.jsxs)("div",{className:"px-3 pt-4 pb-2 flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-[10px] uppercase tracking-widest text-gray-400 font-semibold",children:"Plans"}),(0,l.jsx)("button",{onClick:()=>eO(!0),title:"Hide plans panel",className:"p-1 rounded text-gray-400 hover:text-gray-700 hover:bg-gray-200 transition-all",children:(0,l.jsx)(d.Z,{size:13})})]}),eL&&(0,l.jsxs)("div",{className:"mx-2 mb-2 px-2 py-1.5 rounded text-[11px] flex items-center justify-between gap-1",style:{background:"#FBF0D8",border:"1px solid #E8C97A",color:"#7A5200"},children:[(0,l.jsx)("span",{children:eL}),(0,l.jsx)("button",{onClick:()=>eW(null),style:{background:"none",border:"none",cursor:"pointer",padding:1,color:"#7A5200",lineHeight:1,fontSize:11},children:"✕"})]}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto px-2",children:H.map(e=>{let t=e.id===ee;return(0,l.jsxs)("div",{className:"group flex items-center gap-2 rounded-lg px-2 py-1.5 mb-0.5 cursor-pointer transition-all duration-150 relative ".concat(t?"bg-white shadow-sm border-l-2 border-[#182A41]":"hover:bg-white/60 border-l-2 border-transparent"),onClick:()=>et(e.id),children:[F(e.dataUrl)?(0,l.jsx)("div",{className:"w-11 h-8 rounded-md bg-gray-200 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"text-[9px] font-bold text-gray-500",children:"PDF"})}):(0,l.jsx)("img",{src:e1(e.dataUrl),alt:"",className:"w-11 h-8 rounded-md object-cover shrink-0"}),(0,l.jsx)("div",{className:"flex-1 min-w-0",children:em===e.id?(0,l.jsx)("input",{autoFocus:!0,value:ey,onChange:e=>eb(e.target.value),onBlur:tw,onKeyDown:e=>{"Enter"===e.key&&tw(),"Escape"===e.key&&ef(null)},className:"w-full text-[13px] bg-white border border-[#182A41] rounded px-1 outline-none",onClick:e=>e.stopPropagation()}):(0,l.jsx)("span",{className:"text-[13px] text-gray-700 truncate block",onDoubleClick:t=>{t.stopPropagation(),ef(e.id),eb(e.name)},children:e.name})}),(0,l.jsx)("button",{className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-500 transition-opacity shrink-0",onClick:t=>{t.stopPropagation(),function(e){let t=H.filter(t=>t.id!==e),n=X.filter(t=>t.planImageId!==e);if(Y(t),G(n),ee===e){var l,r;et(null!==(r=null===(l=t[0])||void 0===l?void 0:l.id)&&void 0!==r?r:null)}}(e.id)},children:(0,l.jsx)(c.Z,{size:13})})]},e.id)})}),(0,l.jsxs)("div",{className:"px-3 py-3 border-t border-gray-200",children:[(0,l.jsxs)("div",{className:"rounded-xl border-2 border-dashed text-center py-4 px-2 cursor-pointer transition-colors ".concat(eh?"border-[#182A41] bg-[#E8EBF0]":"border-gray-300 hover:border-gray-400"),onDragOver:e=>{e.preventDefault(),e.stopPropagation(),eg(!0)},onDragLeave:e=>{e.stopPropagation(),eg(!1)},onDrop:e=>{e.preventDefault(),e.stopPropagation(),eg(!1),tg(e.dataTransfer.files)},onClick:()=>{var e;return null===(e=tn.current)||void 0===e?void 0:e.click()},children:[(0,l.jsx)(x.Z,{size:16,className:"mx-auto mb-1 text-gray-400"}),(0,l.jsx)("span",{className:"text-[11px] text-gray-400",children:V("planBoard.dropZone.placeholder")})]}),(0,l.jsx)("input",{ref:tn,type:"file",accept:"image/*,.pdf",multiple:!0,className:"hidden",onChange:e=>tg(e.target.files)}),(0,l.jsx)("button",{className:"mt-2 w-full text-[12px] text-[#182A41] hover:underline text-center",onClick:()=>{var e;return null===(e=tn.current)||void 0===e?void 0:e.click()},children:"+ Upload"})]})]}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden bg-white relative",children:[!Q&&eT&&(0,l.jsx)("button",{onClick:()=>eO(!1),title:"Show plans panel",className:"absolute left-0 top-1/2 -translate-y-1/2 z-10 flex items-center justify-center bg-white border border-l-0 border-gray-200 rounded-r-lg shadow-sm text-gray-400 hover:text-gray-700 hover:bg-gray-50 transition-all",style:{width:18,height:48},children:(0,l.jsx)(u.Z,{size:12})}),!Q&&eH&&(0,l.jsx)("button",{onClick:()=>eX(!1),title:"Show products panel",className:"absolute right-0 top-1/2 -translate-y-1/2 z-10 flex items-center justify-center bg-white border border-r-0 border-gray-200 rounded-l-lg shadow-sm text-gray-400 hover:text-gray-700 hover:bg-gray-50 transition-all",style:{width:18,height:48},children:(0,l.jsx)(h,{size:12})}),(0,l.jsxs)("div",{className:"flex items-center justify-between px-2 py-2.5 border-b border-gray-100 shrink-0",children:[(0,l.jsx)("div",{className:"flex items-center gap-1.5",children:(0,l.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:null!==(M=null==ta?void 0:ta.name)&&void 0!==M?M:"No plan selected"})}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[en&&(0,l.jsxs)("button",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150 ".concat(er?"bg-[#182A41] text-white shadow-sm":"bg-gray-100 text-gray-600 hover:bg-gray-200"),onClick:()=>ei(e=>!e),children:[(0,l.jsx)(g.Z,{size:13}),er?"Cancel Marker":"Place Marker"]}),en&&(0,l.jsxs)("button",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150 ".concat(e4?"bg-amber-500 text-white shadow-sm":"bg-gray-100 text-gray-600 hover:bg-gray-200"),onClick:()=>{e8(e=>!e),ei(!1),ep(null)},title:V("planBoard.instruction.drawZone"),children:[(0,l.jsx)(m,{size:13}),e4?"Cancel Zone":"Add Zone"]}),ta&&!F(ta.dataUrl)&&(0,l.jsxs)("button",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-600 hover:bg-gray-200 transition-all duration-150",onClick:function(){if(!ta)return;let e=X.filter(e=>e.planImageId===ee).map(e=>{var t;return{pin:e,number:null!==(t=ts.get(e.id))&&void 0!==t?t:"?",product:"__placeholder__"!==e.productId?O.find(t=>
21t.id===e.productId):void 0}}),t=e.map(e=>{let{pin:t,number:n}=e;return'\n      <div style="position:absolute;left:'.concat(100*t.x,"%;top:").concat(100*t.y,'%;transform:translate(-50%,-50%);width:22px;height:22px;border-radius:50%;background:#1A1814;color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;box-shadow:0 1px 4px rgba(0,0,0,.4);">\n        ').concat(n,"\n      </div>")}).join(""),n=e.filter(e=>e.product).map(e=>{var t,n;let{number:l,product:r}=e;return'\n        <tr>\n          <td style="padding:5px 10px 5px 0;font-weight:700;text-align:center;">'.concat(l,'</td>\n          <td style="padding:5px 10px 5px 0;">').concat(r.name,'</td>\n          <td style="padding:5px 10px 5px 0;color:#666;">').concat(null!==(t=r.space)&&void 0!==t?t:"",'</td>\n          <td style="padding:5px 10px 5px 0;color:#666;">').concat(null!==(n=r.category)&&void 0!==n?n:"",'</td>\n          <td style="padding:5px 0;font-weight:600;">').concat(null!=r.price?J(r.price):"","</td>\n        </tr>")}).join(""),l='<!DOCTYPE html><html><head>\n      <meta charset="utf-8">\n      <title>'.concat(ta.name,"</title>\n      <style>\n        * { box-sizing: border-box; margin: 0; padding: 0; }\n        body { font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif; font-size: 11px; color: #1A1814; }\n        .plan-wrap { position: relative; display: inline-block; max-width: 100%; }\n        .plan-wrap img { display: block; max-width: 100%; height: auto; }\n        h1 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }\n        table { width: 100%; border-collapse: collapse; margin-top: 18px; }\n        th { text-align: left; padding: 5px 10px 5px 0; border-bottom: 1.5px solid #1A1814; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #555; }\n        td { border-bottom: 1px solid #E5E3E0; vertical-align: top; }\n        @page { margin: 15mm; size: auto; }\n        @media print { body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }\n      </style>\n    </head><body>\n      <h1>").concat(ta.name,'</h1>\n      <div class="plan-wrap">\n        <img src="').concat(e1(ta.dataUrl),'" />\n        <div style="position:absolute;inset:0;pointer-events:none;">\n          ').concat(t,"\n        </div>\n      </div>\n      ").concat(n?'<table><thead><tr><th style="width:30px;">#</th><th>Product</th><th>Space</th><th>Category</th><th>Price</th></tr></thead><tbody>'.concat(n,"</tbody></table>"):"","\n    </body></html>"),r=window.open("","_blank","width=900,height=700");r&&(r.document.write(l),r.document.close(),r.onload=()=>{r.focus(),r.print()})},title:V("planBoard.instruction.printWithLegend"),children:[(0,l.jsx)(f.Z,{size:13}),"Print"]}),ta&&!F(ta.dataUrl)&&(1!==eq||0!==eV.x||0!==eV.y)&&(0,l.jsxs)("button",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-600 hover:bg-gray-200 transition-all",onClick:()=>{eK(1),e$({x:0,y:0})},title:"Reset zoom",children:[(0,l.jsx)(y.Z,{size:13}),Math.round(100*eq),"%"]}),ta&&!F(ta.dataUrl)&&(0,l.jsx)("button",{className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs font-medium bg-gray-100 text-gray-600 hover:bg-gray-200 transition-all",onClick:()=>eG(!0),title:"Presentation mode (Esc to exit)",children:(0,l.jsx)(b.Z,{size:13})}),(0,l.jsxs)("button",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150 ".concat(en?"bg-gray-900 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),onClick:()=>{el(e=>!e),en&&(ei(!1),ep(null))},children:[en?(0,l.jsx)(v.Z,{size:13}):(0,l.jsx)(j.Z,{size:13}),en?"View":"Edit Pins"]})]})]}),eD&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 bg-[#182A41] text-white text-xs font-medium shrink-0",children:[(0,l.jsxs)("span",{children:["\uD83D\uDCCD Click on the plan to place ",(0,l.jsx)("strong",{children:null===(n=O.find(e=>e.id===eD))||void 0===n?void 0:n.name})]}),(0,l.jsx)("button",{onClick:()=>eB(null),className:"underline opacity-80 hover:opacity-100",children:"Cancel"})]}),(0,l.jsx)("div",{className:"flex-1 overflow-hidden relative",children:ta?(0,l.jsx)("div",{ref:eJ,className:"absolute inset-0 bg-white overflow-hidden",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:F(ta.dataUrl)?(0,l.jsx)("div",{className:"text-gray-400 text-sm",children:V("planBoard.preview.pdfUnavailable")}):(0,l.jsx)("div",{style:{transform:"translate(".concat(eV.x,"px, ").concat(eV.y,"px) scale(").concat(eq,")"),transformOrigin:"center center",willChange:"transform"},children:(0,l.jsxs)("div",{ref:tl,className:"relative select-none",style:{cursor:e4?"crosshair":eD?"crosshair":en?"crosshair":"default"},onClick:function(e){if(!ta||e4)return;if(eo(null),eZ){eU(null);return}if(te){tt(null);return}if(ec){ex(null);return}let t=tm(e);if(t){if(eD){let e=[...X,{id:R(),planImageId:ee,productId:eD,x:t.x,y:t.y}];G(e);let n=O.find(e=>e.id===eD),l=(null==n?void 0:n.quantity)||1;e.filter(e=>e.productId===eD).length>=l&&eB(null);return}
21if(en){if(er){e_({id:R(),planImageId:ee,productId:"__placeholder__",x:t.x,y:t.y}),eR(""),ei(!1);return}ep({x:e.clientX,y:e.clientY})}}},onMouseDown:function(e){if(!e4||!ee)return;e.stopPropagation();let t=tm(e);t&&(e7(t),e9(t))},onMouseMove:function(e){if(!e4||!e3)return;let t=tm(e);t&&e9(t)},onMouseUp:function(){if(!e4||!e3||!e6||!ee)return;let e=Math.min(e3.x,e6.x),t=Math.min(e3.y,e6.y),n=Math.max(e3.x,e6.x),l=Math.max(e3.y,e6.y);if(n-e<.02&&l-t<.02){e7(null),e9(null);return}let r={id:R(),planImageId:ee,x1:e,y1:t,x2:n,y2:l,label:"Zone",color:"#4A90D9",opacity:.2};e5([...e2,r]),tt(r.id),e7(null),e9(null),e8(!1)},children:[(0,l.jsx)("img",{ref:tr,src:e1(ta.dataUrl),alt:ta.name,style:{display:"block",maxWidth:"100%",maxHeight:"100%"},onLoad:()=>ty(!0),draggable:!1},ee),tf&&e2.filter(e=>e.planImageId===ee).map(e=>{let t=100*Math.min(e.x1,e.x2),n=100*Math.min(e.y1,e.y2),r=100*Math.abs(e.x2-e.x1),i=100*Math.abs(e.y2-e.y1),a=te===e.id;return(0,l.jsx)("div",{className:"absolute",style:{left:"".concat(t,"%"),top:"".concat(n,"%"),width:"".concat(r,"%"),height:"".concat(i,"%"),background:e.color,opacity:e.opacity,zIndex:2,border:a?"2px solid ".concat(e.color):"1px solid transparent",cursor:en?"pointer":"default",boxSizing:"border-box"},onClick:t=>{en&&(t.stopPropagation(),tt(a?null:e.id),eU(null))},title:e.label,children:(0,l.jsx)("span",{style:{position:"absolute",top:4,left:6,fontSize:11,fontWeight:700,color:e.color,opacity:1/e.opacity,letterSpacing:.3,pointerEvents:"none",textShadow:"0 1px 2px rgba(255,255,255,.8)",filter:"saturate(2) brightness(.6)"},children:e.label})},e.id)}),e4&&e3&&e6&&(0,l.jsx)("div",{className:"absolute pointer-events-none",style:{left:"".concat(100*Math.min(e3.x,e6.x),"%"),top:"".concat(100*Math.min(e3.y,e6.y),"%"),width:"".concat(100*Math.abs(e6.x-e3.x),"%"),height:"".concat(100*Math.abs(e6.y-e3.y),"%"),background:"#4A90D9",opacity:.25,border:"2px dashed #4A90D9",zIndex:3,boxSizing:"border-box"}}),tf&&(()=>{let e=new Map,t=[];for(let l of to)if(l.collectionId){var n;let t=null!==(n=e.get(l.collectionId))&&void 0!==n?n:[];t.push(l),e.set(l.collectionId,t)}else t.push(l);return[...t.map(e=>({anchor:e,members:[e]})),...Array.from(e.values()).map(e=>({anchor:e[0],members:e}))].map(e=>{var t,n,r,i;let{anchor:a,members:s}=e,d={left:"".concat(100*a.x,"%"),top:"".concat(100*a.y,"%")},c=null!==(n=ts.get(a.id))&&void 0!==n?n:"?",x="__placeholder__"===a.productId,u=x?void 0:O.find(e=>e.id===a.productId),p=ea===a.id||s.some(e=>e.id===ea),h=es===a.id||s.some(e=>e.id===es),m=s.length>1;return(0,l.jsxs)("div",{className:"absolute -translate-x-1/2 -translate-y-1/2 group/pin",style:{left:d.left,top:d.top,zIndex:p?20:10},onMouseDown:e=>{var t;return t=a.id,void(e.stopPropagation(),e.preventDefault(),eS(t),eo(t))},onMouseEnter:()=>ed(a.id),onMouseLeave:()=>ed(null),onClick:e=>{if(e.stopPropagation(),en&&x){var t;(null===(t=tl.current)||void 0===t?void 0:t.getBoundingClientRect())&&ep({x:e.clientX,y:e.clientY,forPinId:a.id})}else eo(a.id),en||"__placeholder__"===a.productId||(tk(a.productId),eU(a.id))},onContextMenu:e=>{var t;return t=a.id,void(e.preventDefault(),e.stopPropagation(),ex({pinId:t,x:e.clientX,y:e.clientY}),eo(t))},children:[m?(0,l.jsxs)("div",{style:{position:"relative",cursor:eI===a.id?"grabbing":"grab",transform:h||p?"scale(1.1)":"scale(1)",transition:"transform 150ms"},children:[(0,l.jsx)("div",{style:{width:32,borderRadius:16,background:"#1A1814",boxShadow:p?"0 0 0 2px #182A41, 0 0 0 4px #fff, 0 2px 8px rgba(0,0,0,.4)":"0 2px 8px rgba(0,0,0,.35)",overflow:"hidden"},children:s.map((e,t)=>{var n;let r=null!==(n=ts.get(e.id))&&void 0!==n?n:"?";return(0,l.jsxs)("div",{children:[t>0&&(0,l.jsx)("div",{style:{height:1,background:"#3D3A36",margin:"0 6px"}}),(0,l.jsx)("div",{style:{width:32,height:26,display:"flex",alignItems:"center",justifyContent:"center",fontSize:11,fontWeight:700,color:"#fff",lineHeight:1},children:r})]},e.id)})}),(0,l.jsx)("div",{style:{position:"absolute",top:-4,right:-4,width:14,height:14,borderRadius:"50%",background:"#E8A020",color:"#fff",fontSize:8,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 1px 3px rgba(0,0,0,.3)"},children:s.length})]}):(0,l.jsxs)("div",{style:{position:"relative",transform:"rotate(".concat(null!==(r=a.rotation)&&void 0!==r?r:0,"deg)"),transformOrigin:"center"},children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold select-none transition-transform duration-150 ".concat(h||p?"scale-110":"scale-100"," ").concat(x?"bg-white border-2 border-dashed border-gray-400 text-gray-400":"bg-gray-900 text-white shadow-md"," ").concat(p?"ring-2 ring-[#182A41] ring-offset-1":""),style:{cursor:eI===a.id?"grabbing":"grab"},children:c}),en&&p&&!eI&&(0,l.jsx)("div",{title:V("planBoard.instruction.rotate"),style:{position:"absolute",left:"50%",top:"calc(100% + 6px)",transform:"translateX(-50%)",width:10,height:10,borderRadius:"50%",background:"#182A41",border:"2px s
21olid #fff",cursor:"crosshair",boxShadow:"0 1px 3px rgba(0,0,0,.4)",zIndex:40},onMouseDown:e=>{e.stopPropagation(),e.preventDefault(),eA(a.id)}})]}),(h||p)&&!eI&&eZ!==a.id&&(0,l.jsx)("button",{className:"absolute z-30",style:{top:-8,right:m?-12:-8,width:22,height:22,borderRadius:"50%",background:"#7A3535",border:"2px solid #fff",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0,boxShadow:"0 1px 4px rgba(0,0,0,.3)"},title:V("planBoard.instruction.removePin"),onClick:e=>{e.stopPropagation(),tv(a.id)},onMouseDown:e=>e.stopPropagation(),children:(0,l.jsx)(o.Z,{size:10,strokeWidth:3})}),h&&!eI&&eZ!==a.id&&(m?(0,l.jsxs)("div",{className:"absolute z-30 pointer-events-none bg-[#1A1814] border border-[#3D3A36] rounded-xl shadow-2xl p-2.5 w-48 text-xs ".concat(a.y>.5?"bottom-full mb-2":"top-full mt-2"," left-1/2 -translate-x-1/2"),children:[(0,l.jsx)("div",{style:{fontSize:9,fontWeight:700,color:"#8A8680",letterSpacing:"0.07em",marginBottom:6},children:"COLLECTION"}),s.map(e=>{var t,n,r;let i=null!==(t=ts.get(e.id))&&void 0!==t?t:"?",a=O.find(t=>t.id===e.productId);return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[(0,l.jsx)("div",{style:{width:14,height:14,borderRadius:"50%",background:"#3D3A36",color:"#fff",fontSize:7,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i}),(0,l.jsx)("span",{style:{fontSize:11,color:"#EDEAE6",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:null!==(r=null!==(n=null==a?void 0:a.name)&&void 0!==n?n:e.label)&&void 0!==r?r:"Unlinked"})]},e.id)})]}):(0,l.jsx)(U,{pin:a,number:c,product:u,imageHeight:null!==(i=null===(t=tl.current)||void 0===t?void 0:t.clientHeight)&&void 0!==i?i:0})),eZ===a.id&&m&&(0,l.jsxs)("div",{className:"absolute z-40 bg-white border border-gray-200 rounded-2xl shadow-2xl overflow-hidden ".concat(a.y>.5?"bottom-full mb-2":"top-full mt-2"," left-1/2 -translate-x-1/2"),style:{width:200,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},onClick:e=>e.stopPropagation(),children:[(0,l.jsxs)("div",{style:{padding:"12px 14px 4px"},children:[(0,l.jsxs)("div",{style:{fontSize:9,fontWeight:700,color:"#8A8680",letterSpacing:"0.08em",marginBottom:8},children:["COLLECTION \xb7 ",s.length," ITEMS"]}),s.map(e=>{var t,n,r;let i=null!==(t=ts.get(e.id))&&void 0!==t?t:"?",a=O.find(t=>t.id===e.productId);return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[(0,l.jsx)("div",{style:{width:18,height:18,borderRadius:"50%",background:"#1A1814",color:"#fff",fontSize:8,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:i}),(0,l.jsx)("span",{style:{fontSize:12,color:"#1A1814",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:null!==(r=null!==(n=null==a?void 0:a.name)&&void 0!==n?n:e.label)&&void 0!==r?r:"Unlinked"})]},e.id)})]}),(0,l.jsx)("div",{style:{padding:"8px 14px 12px",borderTop:"1px solid #F0EDEA",marginTop:4},children:(0,l.jsx)("button",{style:{width:"100%",padding:"7px 0",background:"none",color:"#7A3535",border:"1px solid #E8D0D0",borderRadius:8,fontSize:12,fontWeight:600,cursor:"pointer",letterSpacing:.2},onClick:()=>tj(s[0].collectionId),children:"Ungroup"})})]}),eZ===a.id&&u&&!m&&(0,l.jsxs)("div",{className:"absolute z-40 bg-white border border-gray-200 rounded-2xl shadow-2xl overflow-hidden ".concat(a.y>.5?"bottom-full mb-2":"top-full mt-2"," left-1/2 -translate-x-1/2"),style:{width:220,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},onClick:e=>e.stopPropagation(),children:[u.imageUrl?(0,l.jsx)("div",{style:{height:110,overflow:"hidden",background:"#F5F5F7"},children:(0,l.jsx)("img",{src:u.imageUrl,alt:(0,E.Gf)(u),style:{width:"100%",height:"100%",objectFit:"cover"}})}):(0,l.jsx)("div",{style:{height:60,background:"#F0EDEA",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(g.Z,{size:20,color:"#A09A92"})}),(0,l.jsxs)("div",{style:{padding:"10px 12px 12px"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",ga
21p:6,marginBottom:6},children:[(0,l.jsx)("span",{style:{width:18,height:18,borderRadius:"50%",background:"#1A1814",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:9,fontWeight:700,flexShrink:0,marginTop:1},children:c}),(0,l.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#1A1814",lineHeight:1.3,flex:1},children:(0,E.Gf)(u)})]}),u.space&&(0,l.jsx)("div",{style:{fontSize:11,color:"#8A8680",marginBottom:4},children:u.space}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:10},children:[(0,l.jsx)(Z,{status:u.status}),null!=u.price&&(0,l.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"#1A1814"},children:J(u.price)})]}),K&&(0,l.jsx)("button",{style:{width:"100%",padding:"7px 0",background:"#182A41",color:"#fff",border:"none",borderRadius:8,fontSize:12,fontWeight:600,cursor:"pointer",letterSpacing:.2},onClick:()=>{eU(null),K(u.id)},children:"Open product →"})]})]})]},a.id)})})()]})})}):(0,l.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3",children:[(0,l.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gray-100 flex items-center justify-center",children:(0,l.jsx)(x.Z,{size:28,className:"text-gray-400"})}),(0,l.jsx)("div",{className:"text-sm text-gray-400",children:V("planBoard.onboarding.uploadPlan")}),(0,l.jsx)("button",{className:"px-4 py-2 rounded-lg bg-[#182A41] text-white text-sm font-medium hover:bg-[#4A7464] transition-colors",onClick:()=>{var e;return null===(e=tn.current)||void 0===e?void 0:e.click()},children:V("planBoard.upload.plan")})]})})]}),!Q&&(0,l.jsxs)("div",{className:"flex flex-col border-l border-gray-200 overflow-hidden shrink-0 transition-all duration-200",style:{width:eH?0:280,background:"#F5F5F7"},children:[(0,l.jsxs)("div",{className:"px-3 pt-4 pb-2 shrink-0",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("button",{onClick:()=>eX(!0),title:"Hide products panel",className:"p-1 rounded text-gray-400 hover:text-gray-700 hover:bg-gray-200 transition-all",children:(0,l.jsx)(w,{size:13})}),(0,l.jsx)("span",{className:"text-[10px] uppercase tracking-widest text-gray-400 font-semibold",children:"Products"})]}),(0,l.jsxs)("span",{className:"text-[11px] text-gray-400 bg-gray-200 rounded-full px-2 py-0.5",children:[tp.length," remaining"]})]}),(0,l.jsx)("div",{className:"flex gap-1 flex-wrap mb-2",children:tu.map(e=>(0,l.jsx)("button",{onClick:()=>ej(e),className:"text-[10px] px-2 py-0.5 rounded-lg border transition-all duration-150 ".concat(ev===e?"bg-[#182A41] text-white border-[#182A41]":"bg-white text-gray-500 border-gray-200 hover:border-gray-300"),children:e},e))}),(0,l.jsxs)("div",{className:"flex items-center gap-2 bg-white rounded-lg border border-gray-200 px-2 py-1.5",children:[(0,l.jsx)(a.Z,{size:12,className:"text-gray-400 shrink-0"}),(0,l.jsx)("input",{value:ew,onChange:e=>ek(e.target.value),placeholder:"Search…",className:"flex-1 text-xs outline-none bg-transparent text-gray-700 placeholder-gray-400"})]})]}),(0,l.jsxs)("div",{className:"flex-1 overflow-y-auto px-2 pb-4",children:[0===tp.length&&0===th.length&&(0,l.jsx)("div",{className:"py-8 text-center text-xs text-gray-400",children:V("common.noProductsToDisplay")}),tp.map(e=>{var t;let n=eD===e.id,r=e.quantity||1,i=null!==(t=td.get(e.id))&&void 0!==t?t:0;return(0,l.jsxs)("div",{className:"group flex items-center gap-2 rounded-xl border shadow-sm px-2.5 py-2 mb-1 transition-all duration-150 ".concat(n?"bg-[#E8EBF0] border-[#182A41]":"bg-white border-gray-100 hover:border-[#182A41]/30 hover:shadow-md"),children:[(0,l.jsx)("div",{className:"w-7 h-7 rounded-full bg-gray-100 border border-gray-200 flex items-center justify-center shrink-0",children:r>1?(0,l.jsxs)("span",{className:"text-[9px] font-bold text-gray-500",children:[i,"/",r]}):(0,l.jsx)("span",{className:"text-[10px] text-gray-400",children:"—"})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:(0,E.Gf)(e)}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.space&&(0,l.jsx)("span",{className:"text-[10px] text-gray-400 bg-gray-100 rounded-full px-1.5 py-0.5",children:e.space}),null!=e.price&&(0,l.jsx)("span",{className:"text-[10px] text-gray-500",children:J(e.price)}),r>1&&(0,l.jsxs)("span",{className:"text-[10px] text-orange-500 font-medium",children:[r-i," left"]})]})]}),e.imageUrl&&(0,l.jsx)("img",{src:e.imageUrl,alt:"",className:"w-8 h-8 rounded-lg object-cover shrink-0"}),(0,l.jsx)("button",{onClick:t=>{t.stopPropagation(),n?eB(null):eB(e.id)},title:n?"Cancel placement":"Click to place on plan",className:"w-7 h-7 rounded-full flex items-center justify-center shrink-0 transition-all ".concat(n?"bg-[#182A41] text-white":"bg-gray-100 text-gray-400 opacity-0 group-hover:opacity-100 hover:bg-[#182A41] hover:text-white"),children:n?(0,l.jsx)(o.Z,{size:11}):(0,l.jsx)(k.Z,{size:11})})]},e.id)}),(tx.length>0||eP)&&(0,l.jsxs)("div",{className:"mt-3",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5 px-1 mb-1.5",children:[(0,l.jsx)(N,{size:12,className:"text-amber-500"}),(0,l.jsx)("span",{className:"text-[11px] font-semibold text-gray-500",children:$("planBoard.unlinkedMarkers",{count:tx.length+(eP?1:0)})})]}),eP&&(0,l.jsxs)("div",{className:"rounded-xl bg-amber-50 border border-amber-300 px-2.5 py-2 mb-1",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,l.jsx)("div",{className:"w-7 h-7 rounded-full bg-white border-2 border-dashed border-amber-400 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"text-[10px] font-bold text-amber-500",children:"?"})}),(0,l.jsx)("input",{autoFocus:!0,value:eF,onChange:e=>eR(e.target.value),placeholder:V("planBoard.marker.placeholder"),className:"flex-1 text-xs border border-gray-200 rounded-lg px-2 py-1 outline-none focus:border-[#182A41] bg-white text-gray-700 placeholder-gray-400",onKeyDown:e=>{"Enter"===e.key&&(G([...X,{...eP,label:eF.trim()||"Marker"}
21]),e_(null),eR("")),"Escape"===e.key&&(G([...X,eP]),e_(null),eR(""))}})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 pl-9",children:[(0,l.jsx)("button",{className:"text-[11px] px-2 py-0.5 rounded-lg text-white font-medium",style:{background:"#182A41"},onClick:()=>{G([...X,{...eP,label:eF.trim()||"Marker"}]),e_(null),eR("")},children:"Save"}),(0,l.jsx)("button",{className:"text-[11px] px-2 py-0.5 rounded-lg bg-gray-200 text-gray-600 font-medium hover:bg-gray-300",onClick:()=>{G([...X,eP]),e_(null),eR("")},children:"Skip"})]})]}),tx.map(e=>{var t;let n=null!==(t=ts.get(e.id))&&void 0!==t?t:"?";return(0,l.jsxs)("div",{className:"group flex items-center gap-2 rounded-xl bg-amber-50 border border-amber-200 px-2.5 py-2 mb-1",children:[(0,l.jsx)("div",{className:"w-7 h-7 rounded-full bg-white border-2 border-dashed border-amber-400 flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"text-[10px] font-bold text-amber-500",children:n})}),(0,l.jsx)("div",{className:"flex-1 min-w-0",children:e.label?(0,l.jsx)("div",{className:"text-[12px] text-gray-700 truncate",children:e.label}):(0,l.jsx)("div",{className:"text-[12px] text-gray-400 italic",children:V("project.export.unlinkedMarker")})}),(0,l.jsxs)("div",{className:"flex items-center shrink-0",style:{gap:6},children:[(0,l.jsx)("button",{className:"text-[11px] text-[#182A41] hover:underline shrink-0",onClick:()=>{var t;let n=null===(t=tl.current)||void 0===t?void 0:t.getBoundingClientRect();n&&(el(!0),ep({x:n.left+n.width/2,y:n.top+n.height/2,forPinId:e.id}))},children:"Assign"}),q&&(0,l.jsx)("button",{style:{fontSize:11,background:"#EDEAE6",color:"#3D3A36",border:"1px solid #D4D1CC",borderRadius:5,padding:"3px 8px",cursor:"pointer"},onClick:()=>q(e.id),children:"+ New"})]}),(0,l.jsx)("button",{className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-400 transition-opacity shrink-0",onClick:t=>{t.stopPropagation(),G(X.filter(t=>t.id!==e.id))},children:(0,l.jsx)(o.Z,{size:12})})]},e.id)})]}),th.length>0&&(0,l.jsxs)("div",{className:"mt-3",children:[(0,l.jsxs)("button",{className:"flex items-center gap-1.5 w-full px-1 mb-1.5 text-left",onClick:()=>eC(e=>!e),children:[eN?(0,l.jsx)(C.Z,{size:13,className:"text-gray-400"}):(0,l.jsx)(I.Z,{size:13,className:"text-gray-400"}),(0,l.jsxs)("span",{className:"text-[11px] font-semibold text-gray-500",children:["Show placed (",th.length,")"]})]}),eN&&(()=>{let e=to.find(e=>e.id===ea),t=null==e?void 0:e.collectionId;return th.map(e=>{var n;let r=to.find(t=>t.productId===e.id),i=r&&null!==(n=ts.get(r.id))&&void 0!==n?n:"?",a=!!r&&(ea===r.id||!!t&&r.collectionId===t);return(0,l.jsxs)("div",{ref:t=>{t?ti.current.set(e.id,t):ti.current.delete(e.id)},className:"group flex items-center gap-2 rounded-xl border px-2.5 py-2 mb-1 cursor-pointer transition-all duration-150 ".concat(a?"bg-[#182A41]/5 border-[#182A41]/30 shadow-sm":"bg-white border-gray-100 shadow-sm hover:border-[#182A41]/20"),onClick:()=>r&&tk(e.id),children:[(0,l.jsx)("div",{className:"w-7 h-7 rounded-full bg-gray-900 text-white flex items-center justify-center shrink-0",children:(0,l.jsx)("span",{className:"text-[10px] font-bold",children:i})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,l.jsx)("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:(0,E.Gf)(e)}),(null==r?void 0:r.collectionId)&&(0,l.jsx)("span",{title:V("planBoard.collection.partOf"),style:{fontSize:8,fontWeight:700,background:"#E8A020",color:"#fff",borderRadius:99,padding:"1px 5px",flexShrink:0,letterSpacing:"0.03em"},children:"GRP"})]}),e.space&&(0,l.jsx)("div",{className:"text-[10px] text-gray-400 truncate",children:e.space})]}),e.imageUrl&&(0,l.jsx)("img",{src:e.imageUrl,alt:"",className:"w-8 h-8 rounded-lg object-cover shrink-0"}),r&&(0,l.jsx)("button",{className:"opacity-0 group-hover:opacity-100 text-gray-400 hover:text-red-400 transition-opacity shrink-0",onClick:e=>{e.stopPropagation(),G(X.filter(e=>e.id!==r.id)),ea===r.id&&eo(null)},children:(0,l.jsx)(o.Z,{size:12})})]},e.id)})})()]})]})]}),eu&&ta&&(0,l.jsx)(L,{products:O,pinnedProductIds:tc,containerRect:null!==(W=null===(s=tl.current)||void 0===s?void 0:s.getBoundingClientRect())&&void 0!==W?W:null,position:{x:eu.x,y:eu.y},onSelect:function(e){if(ee){if(null==eu?void 0:eu.forPinId)G(X.map(t=>
21t.id===eu.forPinId?{...t,productId:e}:t));else{var t,n;let l=tl.current;if(!l)return;let r=l.getBoundingClientRect(),i=Math.max(0,Math.min(1,((null!==(t=null==eu?void 0:eu.x)&&void 0!==t?t:0)-r.left)/r.width)),a=Math.max(0,Math.min(1,((null!==(n=null==eu?void 0:eu.y)&&void 0!==n?n:0)-r.top)/r.height));G([...X,{id:R(),planImageId:ee,productId:e,x:i,y:a}])}ep(null)}},onClose:()=>ep(null)}),ec&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>ex(null)}),(0,l.jsxs)("div",{className:"fixed z-50 bg-white rounded-xl shadow-2xl border border-gray-200 py-1 min-w-[160px]",style:{left:ec.x,top:ec.y},children:[(()=>{var e;let t=null===(e=X.find(e=>e.id===ec.pinId))||void 0===e?void 0:e.collectionId;if(!t)return null;let n=X.filter(e=>e.collectionId===t);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",onClick:()=>tj(t),children:[(0,l.jsx)(m,{size:13}),"Ungroup all (",n.length,")"]}),(0,l.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 transition-colors",onClick:()=>(function(e){let t=X.find(t=>t.id===e);if(!(null==t?void 0:t.collectionId))return;let n=X.filter(e=>e.collectionId===t.collectionId);G(X.map(l=>{if(l.id===e){let{collectionId:e,...t}=l;return t}if(2===n.length&&l.collectionId===t.collectionId){let{collectionId:e,...t}=l;return t}return l})),ex(null)})(ec.pinId),children:[(0,l.jsx)(m,{size:13}),V("planBoard.collection.removeFrom")]})]})})(),(0,l.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-red-500 hover:bg-red-50 transition-colors",onClick:()=>tv(ec.pinId),children:[(0,l.jsx)(c.Z,{size:13}),"Remove pin"]})]})]}),eE&&(()=>{var e,t,n,r;let i=X.find(e=>e.id===eE.draggedPinId),a=X.find(e=>e.id===eE.targetPinId),o=i?O.find(e=>e.id===i.productId):void 0,s=a?O.find(e=>e.id===a.productId):void 0,d=null!==(t=null!==(e=null==o?void 0:o.name)&&void 0!==e?e:null==i?void 0:i.label)&&void 0!==t?t:"Pin",c=null!==(r=null!==(n=null==s?void 0:s.name)&&void 0!==n?n:null==a?void 0:a.label)&&void 0!==r?r:"Pin";return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-50",onClick:()=>eM(null)}),(0,l.jsxs)("div",{className:"fixed z-50 rounded-xl shadow-2xl",style:{bottom:32,left:"50%",transform:"translateX(-50%)",background:"#1A1814",border:"1px solid #3D3A36",width:280,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",overflow:"hidden"},onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("div",{style:{height:3,background:"#182A41"}}),(0,l.jsxs)("div",{style:{padding:"14px 16px"},children:[(0,l.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"#EDEAE6",marginBottom:4},children:V("planBoard.collection.mergeInto")}),(0,l.jsxs)("div",{style:{fontSize:11,color:"#8A8680",marginBottom:14,lineHeight:1.5},children:[(0,l.jsx)("span",{style:{color:"#C8C4BC"},children:d})," ","will be grouped with"," ",(0,l.jsx)("span",{style:{color:"#C8C4BC"},children:c})]}),(0,l.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,l.jsx)("button",{style:{flex:1,padding:"8px 0",background:"#182A41",color:"#fff",border:"none",borderRadius:6,fontSize:12,fontWeight:700,cursor:"pointer"},onClick:()=>(function(e,t){var n,l;let r=X.find(t=>t.id===e),i=X.find(e=>e.id===t);if(!r||!i)return;let a=null!==(l=null!==(n=i.collectionId)&&void 0!==n?n:r.collectionId)&&void 0!==l?l:R();G(X.map(n=>n.id===e||r.collectionId&&n.collectionId===r.collectionId?{...n,x:i.x,y:i.y,collectionId:a}:n.id===t||i.collectionId&&n.collectionId===i.collectionId?{...n,collectionId:a}:n)),eM(null)})(eE.draggedPinId,eE.targetPinId),children:"Merge"}),(0,l.jsx)("button",{style:{flex:1,padding:"8px 0",background:"#2A2825",color:"#EDEAE6",border:"1px solid #3D3A36",borderRadius:6,fontSize:12,fontWeight:600,cursor:"pointer"},onClick:()=>eM(null),children:V("planBoard.collection.keepSeparate")})]})]})]})]})})(),te&&en&&(()=>{let e=e2.find(e=>e.id===te);return e?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>tt(null)}),(0,l.jsxs)("div",{className:"fixed z-50 bg-white rounded-2xl shadow-2xl border border-gray-200",style:{bottom:80,right:320,width:240,fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},onClick:e=>e.stopPropagation(),children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px 8px",borderBottom:"1px solid #E5E3E0"},children:[(0,l.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"#1A1814"},children:V("planBoard.zone.edit")}),(0,l.jsx)("button",{onClick:()=>tt(null),style:{background:"none",border:"none",cursor:"pointer",color:"#8A8680",padding:0},children:(0,l.jsx)(o.Z,{size:14})})]}),(0,l.jsxs)("div",{style:{padding:"12px 14px 14px",display:"flex",flexDirection:"column",gap:10},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{style:{fontSize:10,fontWeight:600,color:"#8A8680",textTransform:"uppercase",letterSpacing:".05em",display:"block",marginBottom:4},children:"Label"}),(0,l.jsx)("input",{type:"text",value:e.label,onChange:t=>tb(e.id,{label:t.target.value}),style:{width:"100%",padding:"6px 8px",border:"1px solid #D4D1CC",borderRadius:6,fontSize:12,color:"#1A1814",outline:"none",boxSizing:"border-box"}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{style:{fontSize:10,fontWeight:600,color:"#8A8680",textTransform:"uppercase",letterSpacing:".05em",display:"block",marginBottom:4},children:"Color"}),(0,l.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[["#4A90D9","#E8734A","#4A5E7B","#D9C84A","#9B59B6","#E74C3C","#1ABC9C","#F39C12"].map(t=>(0,l.jsx)("button",{onClick:()=>tb(e.id,{color:t}),style:{width:22,height:22,borderRadius:"50%",background:t,border:e.color===t?"2.5px solid #1A1814":"2px s
21olid transparent",cursor:"pointer",outline:"none",padding:0}},t)),(0,l.jsx)("input",{type:"color",value:e.color,onChange:t=>tb(e.id,{color:t.target.value}),style:{width:22,height:22,padding:0,border:"1px solid #D4D1CC",borderRadius:"50%",cursor:"pointer"},title:V("planBoard.zone.customColor")})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("label",{style:{fontSize:10,fontWeight:600,color:"#8A8680",textTransform:"uppercase",letterSpacing:".05em",display:"block",marginBottom:4},children:["Opacity — ",Math.round(100*e.opacity),"%"]}),(0,l.jsx)("input",{type:"range",min:5,max:70,value:Math.round(100*e.opacity),onChange:t=>tb(e.id,{opacity:Number(t.target.value)/100}),style:{width:"100%",accentColor:e.color}})]}),(0,l.jsxs)("button",{onClick:()=>{var t;return t=e.id,void(e5(e=>e.filter(e=>e.id!==t)),te===t&&tt(null))},style:{marginTop:2,width:"100%",padding:"7px 0",background:"none",border:"1.5px solid #E74C3C",borderRadius:8,color:"#E74C3C",fontSize:12,fontWeight:600,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:5},children:[(0,l.jsx)(c.Z,{size:13}),V("planBoard.zone.delete")]})]})]})]}):null})(),eY&&ta&&!F(ta.dataUrl)&&(()=>{let e=e1(ta.dataUrl);return(0,l.jsxs)("div",{className:"fixed inset-0 z-[9000] bg-black flex flex-col",style:{fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-6 py-3 shrink-0",style:{background:"rgba(0,0,0,0.7)"},children:[(0,l.jsx)("span",{className:"text-white font-semibold text-sm tracking-wide",children:ta.name}),(0,l.jsxs)("div",{className:"flex items-center gap-3",children:[(0,l.jsx)("span",{className:"text-gray-400 text-xs",children:"Press Esc to exit"}),(0,l.jsxs)("button",{onClick:()=>eG(!1),className:"flex items-center gap-1.5 text-white/70 hover:text-white text-xs bg-white/10 hover:bg-white/20 px-3 py-1.5 rounded-lg transition-all",children:[(0,l.jsx)(S.Z,{size:13})," Exit"]})]})]}),(0,l.jsx)("div",{className:"flex-1 relative overflow-hidden flex items-center justify-center",children:(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("img",{src:e,alt:ta.name,style:{maxWidth:"100vw",maxHeight:"calc(100vh - 56px)",objectFit:"contain",display:"block"}}),to.filter(e=>"__placeholder__"!==e.productId).map(e=>{var t;let n=O.find(t=>t.id===e.productId),r=null!==(t=ts.get(e.id))&&void 0!==t?t:"?";return(0,l.jsxs)("div",{style:{position:"absolute",left:"".concat(100*e.x,"%"),top:"".concat(100*e.y,"%"),transform:"translate(-50%, -50%)",zIndex:10},children:[(0,l.jsx)("div",{style:{width:32,height:32,borderRadius:"50%",background:"#1A1814",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,boxShadow:"0 2px 8px rgba(0,0,0,.5)",border:"2px solid #fff"},children:r}),n&&(0,l.jsx)("div",{style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:4,background:"rgba(26,24,20,0.9)",color:"#EDEAE6",borderRadius:6,padding:"3px 8px",fontSize:10,fontWeight:600,whiteSpace:"nowrap",border:"1px solid #3D3A36"},children:n.name})]},e.id)})]})})]})})()]})}},75733:function(e,t,n){n.d(t,{Z:function(){return l}});/**
22 * @license lucide-react v0.395.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */let l=(0,n(78030).Z)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},18422:function(e,t,n){n.d(t,{Z:function(){return l}});/**
27 * @license lucide-react v0.395.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */let l=(0,n(78030).Z)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])}}]);

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.