PageSourceSearch

https://spacejot-cad.vercel.app/_next/static/chunks/2014.75ce00e575d257be.js

js spacejot-cad.vercel.app collected 2026-10-03 07:49:11 UTC 12,411 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2014],{2014:(e,t,r)=>{r.r(t),r.d(t,{SketchAnnotationModal:()=>x});var o=r(70830),a=r(8766),n=r(20670),s=r(31978),i=r(64687),d=r(58419),l=r(68701),c=r(69965),u=r(15757),g=r(89443),h=r.n(g),m=r(10713),b=r(78729);let f=[{name:"Red",value:"#ef4444"},{name:"Purple",value:"#a855f7"},{name:"Blue",value:"#3b82f6"},{name:"Green",value:"#22c55e"}];function x(e){let{isOpen:t,onClose:r,imageUrl:g,onConfirm:x}=e,[p]=h()(g,"anonymous"),[v,k]=(0,a.useState)([]),[w,y]=(0,a.useState)("brush"),[j,C]=(0,a.useState)(f[0].value),[N,S]=(0,a.useState)(5),[E,P]=(0,a.useState)(!1),T=(0,a.useRef)(null),z=(0,a.useRef)(null),[M,W]=(0,a.useState)({width:800,height:600,scale:1,offsetX:0,offsetY:0});(0,a.useEffect)(()=>{if(!p)return;let e=()=>{let t=document.querySelector("[data-sketch-modal-container]");if(!t)return void setTimeout(e,50);let r=t.getBoundingClientRect(),o=r.width,a=r.height;if(0===o||0===a)return void setTimeout(e,50);let n=a-40,s=Math.min((o-40)/p.width,n/p.height,1),i=p.width*s,d=p.height*s;W({width:o,height:a,scale:s,offsetX:(o-i)/2,offsetY:(a-d)/2})},t=setTimeout(e,100);return window.addEventListener("resize",e),()=>{clearTimeout(t),window.removeEventListener("resize",e)}},[p,t]);let A=(0,a.useCallback)(e=>{P(!0);let t=e.target.getStage();if(!t)return;let r=t.getPointerPosition();if(r)k([...v,{points:[(r.x-M.offsetX)/M.scale,(r.y-M.offsetY)/M.scale],color:"brush"===w?j:"#000000",strokeWidth:N,tool:w}])},[v,w,j,N,M]),L=(0,a.useCallback)(e=>{if(!E)return;let t=e.target.getStage();if(!t)return;let r=t.getPointerPosition();if(!r)return;let o=(r.x-M.offsetX)/M.scale,a=(r.y-M.offsetY)/M.scale,n=v[v.length-1];if(!n)return;let s=[...v];s[s.length-1]={...n,points:[...n.points,o,a]},k(s)},[E,v,M]),R=(0,a.useCallback)(()=>{P(!1)},[]),$=(0,a.useCallback)(()=>{try{let e;if(!p){console.error("No image available"),alert("Image not loaded. Please try again.");return}let t=document.createElement("canvas");t.width=p.width,t.height=p.height;let o=t.getContext("2d");if(!o){console.error("Could not get 2d context for temp canvas"),alert("Could not create canvas. Please try again.");return}v.filter(e=>"brush"===e.tool).forEach(e=>{if(!e.points||e.points.length<2)return;o.strokeStyle=e.color,o.lineWidth=e.strokeWidth,o.lineCap="round",o.lineJoin="round",o.globalCompositeOperation="source-over",o.beginPath();let t=e.points[0],r=e.points[1];if(void 0!==t&&void 0!==r){o.moveTo(t,r);for(let t=2;t<e.points.length;t+=2){let r=e.points[t],a=e.points[t+1];void 0!==r&&void 0!==a&&o.lineTo(r,a)}o.stroke()}}),v.filter(e=>"eraser"===e.tool).forEach(e=>{if(!e.points||e.points.length<2)return;o.lineWidth=e.strokeWidth,o.lineCap="round",o.lineJoin="round",o.globalCompositeOperation="destination-out",o.beginPath();let t=e.points[0],r=e.points[1];if(void 0!==t&&void 0!==r){o.moveTo(t,r);for(let t=2;t<e.points.length;t+=2){let r=e.points[t],a=e.points[t+1];void 0!==r&&void 0!==a&&o.lineTo(r,a)}o.stroke()}});let a=document.createElement("canvas");a.width=p.width,a.height=p.height;let n=a.getContext("2d");if(!n)return void console.error("Could not get 2d context for final canvas");n.drawImage(p,0,0),n.drawImage(t,0,0);try{e=a.toDataURL("image/png")}catch(e){console.error("Failed to export canvas (possibly tainted by CORS):",e),alert("Unable to save sketch. The image may have cross-origin restrictions. Please try refreshing the page.");return}if(!e||"data:,"===e){console.error("Failed to generate data URL - empty result"),alert("Failed to generate image. Please try again.");return}if(!e.startsWith("data:image/")){console.error("Invalid data URL format:",e.substring(0,50)),alert("Invalid image format. Please try again.");return}x(e),r(),k([])}catch(t){console.error("Error in handleConfirm:",t);let e=t instanceof Error?t.message:"Unknown error";alert("Failed to save sketch: ".concat(e))}},[p,v,x,r]),B=(0,a.useCallback)(()=>{k([])},[]);return(0,o.jsx)(n.lG,{open:t,onOpenChange:r,children:(0,o.jsxs)(n.Cf,{className:"flex h-full max-h-[98vh] w-full max-w-[98vw] flex-col gap-0 border-border bg-background/95 p-0 backdrop-blur-3xl sm:max-w-[98vw]",showCloseButton:!1,children:[(0,o.jsxs)("div",{className:"flex flex-shrink-0 items-center justify-between border-b border-border bg-background px-4 py-2.5 sm:px-6",children:[(0,o.jsxs)("div",{className:"flex items-center gap-3",children:[(0,o.jsx)("h2",{className:"text-sm font-medium text-foreground",children:"Sketch"}),(0,o.jsxs)("div",{className:"flex items-center gap-1.5 sm:hidden",children:[(0,o.jsx)(s.$,{size:"sm",variant:"ghost",onClick:r,className:"h-7 rounded-lg border border-border px-3 text-xs font-medium text-muted-foreground transition-all hover:bg-accent hover:text-accent-foreground",children:"Cancel"}),(0,o.jsxs)(s.$,{size:"sm",onClick:$,disabled:0===v.length,className:(0,m.cn)("h-7 rounded-lg px-3 text-xs font-semibold shadow-lg transition-all disabled:opacity-30",b.x6.primary),children:[(0,o.jsx)(i.A,{className:"mr-1 h-3 w-3"}),"Done"]})]})]}),(0,o.jsx)(s.$,{size:"sm",variant:"ghost",onClick:r,className:"hidden h-7 w-7 rounded-full p-0 transition-colors hover:bg-accent sm:flex",children:(0,o.jsx)(d.A,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),(0,o.jsx)("div",{className:"relative flex-1 overflow-hidden bg-black","data-sketch-modal-container":!0,children:p&&(0,o.jsxs)(u.BI,{ref:T,width:M.width,height:M.height,onMouseDown:A,onMouseMove:L,onMouseUp:R,onTouchStart:A,onTouchMove:L,onTouchEnd:R,className:"cursor-crosshair",children:[(0,o.jsx)(u.Wd,{children:(0,o.jsx)(u._V,{image:p,x:M.offsetX,y:M.offsetY,width:p.width*M.scale,height:p.height*M.scale,listening:!1})}),(0,o.jsx)(u.Wd,{ref:z,children:v.map((e,t)=>(0,o.jsx)(u.N1,{points:e.points.map((e,t)=>t%2==0?e*M.scale+M.offsetX:e*M.scale+M.offsetY),stroke:e.color,strokeWidth:e.strokeWidth*M.scale,tension:.5,lineCap:"round",lineJoin:"round",globalCompositeOperation:"eraser"===e.tool?"destination-out":"source-over"},t))})]})}),(0,o.jsx)("div",{className:"flex-shrink-0 border-t border-border bg-background px-4 py-3 sm:px-6",children:(0,o.jsxs)("div",{className:"flex items-center justify-between gap-2 sm:gap-4",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,o.jsxs)("div",{className:"flex items-center gap-0.5 rounded-lg bg-muted p-0.5 backdrop-blur-xl",children:[(0,o.jsx)(s.$,{size:"sm",variant:"ghost",onClick:()=>y("brush"),className:"h-8 w-8 rounded-md p-0 transition-all ".concat("brush"===w?"bg-accent text-accent-foreground":"hover:bg-accent"),children:(0,o.jsx)(l.A,{className:"h-3.5 w-3.5 ".concat("brush"===w?"text-foreground":"text-muted-foreground")})}),(0,o.jsx)(s.$,{size:"sm",variant:"ghost",onClick:()=>y("eraser"),className:"h-8 w-8 rounded-md p-0 transition-all ".concat("eraser"===w?"bg-accent text-accent-foreground":"hover:bg-accent"),children:(0,o.jsx)(c.A,{className:"h-3.5 w-3.5 ".concat("eraser"===w?"text-foreground":"text-muted-foreground")})})]}),"brush"===w&&(0,o.jsx)("div",{className:"flex items-center gap-1 rounded-lg bg-muted p-1.5 backdrop-blur-xl",children:f.map(e=>(0,o.jsx)("button",{onClick:()=>C(e.value),className:"h-7 w-7 rounded-md transition-all ".concat(j===e.value?"scale-110 ring-2 ring-ring ring-offset-2 ring-offset-background":"opacity-70 hover:scale-105 hover:opacity-100"),style:{backgroundColor:e.value},title:e.name},e.value))}),(0,o.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-muted px-2.5 py-1.5 backdrop-blur-xl sm:gap-2.5 sm:px-3",children:[(0,o.jsx)("span",{className:"hidden text-[10px] font-medium uppercase tracking-wider text-muted-foreground sm:inline",children:"Size"}),(0,o.jsx)("input",{type:"range",min:"2",max:"20",value:N,onChange:e=>S(Number(e.target.value)),className:"h-1 w-16 cursor-pointer appearance-none rounded-lg bg-muted accent-primary sm:w-20",style:{background:"linear-gradient(to right, var(--primary) 0%, var(--primary) ".concat((N-2)/18*100,"%, var(--border) ").concat((N-2)/18*100,"%, var(--border) 100%)")}}),(0,o.jsx)("span",{className:"w-5 text-right text-xs font-medium tabular-nums text-foreground sm:w-6",children:N})]}),(0,o.jsx)(s.$,{size:"sm",variant:"ghost",onClick:B,disabled:0===v.length,className:"h-8 rounded-lg px-2.5 text-[11px] font-medium text-muted-foreground transition-all hover:bg-accent hover:text-accent-foreground disabled:opacity-30 sm:px-3",children:"Clear"})]}),(0,o.jsxs)("div",{className:"hidden items-center gap-2 sm:flex",children:[(0,o.jsx)(s.$,{size:"sm",variant:"ghost",onClick:r,className:"h-8 rounded-lg border border-border px-4 text-xs font-medium text-muted-foreground transition-all hover:bg-accent hover:text-accent-foreground",children:"Cancel"}),(0,o.jsxs)(s.$,{size:"sm",onClick:$,disabled:0===v.length,className:(0,m.cn)("h-8 rounded-lg px-4 text-xs font-semibold shadow-lg transition-all disabled:opacity-30",b.x6.primary),children:[(0,o.jsx)(i.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Confirm"]})]})]})})]})})}},68701:(e,t,r)=>{r.d(t,{A:()=>
1o});let o=(0,r(59993).A)("Paintbrush",[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]])},69965:(e,t,r)=>{r.d(t,{A:()=>o});let o=(0,r(59993).A)("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]])},78729:(e,t,r)=>{r.d(t,{f:()=>c,PQ:()=>n,x6:()=>s,jw:()=>d,ET:()=>g,hF:()=>i,cW:()=>u,wk:()=>l,MT:()=>o,Qq:()=>a});let o={page:"bg-background text-foreground",card:"bg-card text-card-foreground border border-border backdrop-blur-xl",panel:"bg-muted text-foreground backdrop-blur-xl",popover:"bg-popover text-popover-foreground border border-border shadow-lg backdrop-blur-xl",overlayLight:"bg-foreground
1/5 backdrop-blur-sm",overlayHeavy:"bg-foreground/40 backdrop-blur-md",scrim:"bg-foreground/60 backdrop-blur-sm"},a={body:"text-foreground",heading:"text-foreground font-semibold tracking-tight",muted:"text-muted-foreground",subtle:"text-muted-foreground/80",accent:"text-brand-text",danger:"text-destructive",link:"text-brand-text underline-offset-4 hover:underline"},n={hairline:"border border-border",top:"border-t border-border",bottom:"border-b border-border",focusRing:"ring-ring"},s={primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-primary/40 disabled:cursor-not-allowed transition-colors",secondary:"bg-secondary text-secondary-foreground hover:bg-accent hover:text-accent-foreground transition-colors",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/85 transition-colors",ghost:"hover:bg-accent hover:text-accent-foreground transition-colors",outline:"border border-border bg-transparent hover:bg-accent hover:text-accent-foreground transition-colors",link:"text-foreground underline-offset-4 hover:underline"},i={field:"border border-input bg-background text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",disabled:"bg-muted text-muted-foreground cursor-not-allowed"},d={neutral:"bg-muted text-muted-foreground border border-border",accent:"bg-accent text-accent-foreground",success:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",warning:"bg-amber-500/15 text-amber-700 dark:text-amber-300",danger:"bg-destructive/15 text-destructive"},l={hoverable:"transition-colors hover:bg-accent hover:text-accent-foreground",selected:"bg-brand-soft text-brand-text",skeleton:"animate-pulse bg-muted",focus:"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"},c={studio:"border-fuchsia-500 text-fuchsia-500",studioBg:"bg-fuchsia-500 text-white hover:bg-fuchsia-600",studioGradient:"bg-gradient-to-br from-fuchsia-700 to-purple-800 text-white",pick:"border-yellow-400",pickBg:"bg-yellow-400",pro:"bg-gradient-to-br from-fuchsia-700 to-purple-800 text-white"},u={pill:"rounded-full",card:"rounded-lg",modal:"rounded-2xl",chip:"rounded-md"},g={flat:"",low:"shadow-sm",medium:"shadow-md",high:"shadow-lg",modal:"shadow-2xl"}}}]);

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.