PageSourceSearch

https://us.fusionmap.com/_next/static/chunks/5296-01496213648ca493.js

js fusionmap.com collected 2026-10-01 02:00:53 UTC 15,484 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="78d959ce-ecb0-434b-941b-e3bb3ee4aa77",e._sentryDebugIdIdentifier="sentry-dbid-78d959ce-ecb0-434b-941b-e3bb3ee4aa77")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5296],{54065:(e,a,t)=>{t.d(a,{gA:()=>u,RV:()=>i,eq:()=>x,f5:()=>d,Pp:()=>c,_7:()=>m,yW:()=>b,BY:()=>j,vr:()=>g,nv:()=>h,Hh:()=>p});var l=t(23117),r=t(85428),s=t(80856),n=t(23323);async function o(e){try{return await (0,n.x)(`/admin/project/${e}/feature-flag`)}catch(e){return console.error("Failed to fetch project feature flags:",e),{}}}let i=async(e,a,t,l,r,s)=>{t(!0);try{let t=(await (0,n.x)(`/main/projects/${e}`,{method:"GET"})).project;a({name:t.projectName||"",description:t.project_description||"",accept_domain:t.acceptDomain||!1,lat:t.map_lat.toString()||"",lon:t.map_lon.toString()||"",zoom:j(t.map_zoom).toString()||"",units:t.units||"Metric",image:null,lidar_epsg:t.lidarEPSG?t.lidarEPSG.split(":")[1]:"",camera_epsg:t.cameraEPSG?t.cameraEPSG.split(":")[1]:""}),l(t.map_lat.toString()||""),r(t.map_lon.toString()||""),s(j(t.map_zoom).toString()||"")}catch(e){console.error("Error fetching project metadata:",e)}finally{t(!1)}},c=(e,a,t)=>{let{name:s,value:n}=e.target,o="";switch(s){case"name":l.O0.test(n)||""===n||(o="Only English characters are allowed. Name cannot start or end with a space.");break;case"organization":l.bX.test(n)||""===n||(o="Only letters, numbers, and spaces are allowed. Name cannot begin or end with a space.");break;case"lidar_epsg":case"camera_epsg":l.IM.test(n)||""===n||(o="Please enter a valid EPSG code (4-5 digits).");break;case"lat":let i=(0,r.uE)(n);"string"==typeof i&&""!==n&&(o=i);break;case"lon":let c=(0,r.K6)(n);"string"==typeof c&&""!==n&&(o=c);break;case"zoom":let d=(0,r.SG)(n);"string"==typeof d&&""!==n&&(o=d)}t(s,o),a(e=>({...e,[s]:n}))},d=(e,a)=>{let t=e.target.files?.[0];t&&a(e=>({...e,image:t}))},m=(e,a)=>{a(a=>({...a,units:e.target.value}))},p=(e,a,t)=>{let l=[];return"add"===a&&(e.name||l.push("Project name is required"),e.organization||l.push("Organization name is required")),e.description||l.push("Description is required"),e.lat&&e.lon&&e.zoom?(t.lat&&l.push(t.lat),t.lon&&l.push(t.lon),t.zoom&&l.push(t.zoom)):l.push("Latitude, longitude, and zoom are required"),t.name&&l.push(t.name),t.organization&&l.push(t.organization),t.lidar_epsg&&l.push(t.lidar_epsg),t.camera_epsg&&l.push(t.camera_epsg),l},u=async(e,a)=>{try{let a=String(b(e.zoom)),t=new FormData;t.append("name",e.name),t.append("organization",e.organization),t.append("lat",e.lat),t.append("lon",e.lon),t.append("zoom",a),t.append("description",e.description),t.append("accept_domain",e.accept_domain.toString()),""!==e.lidar_epsg&&t.append("lidar_epsg","EPSG:"+e.lidar_epsg),""!==e.camera_epsg&&t.append("camera_epsg","EPSG:"+e.camera_epsg),e.image&&t.append("image",e.image);let l=await (0,n.x)("/admin/project-init/create",{method:"POST",form:t});return{success:!0,projectUuid:l.project_uuid}}catch(e){return{success:!1,error:e.message??"An error occurred while submitting the form"}}finally{a(!1)}},g=async(e,a,t)=>{try{let t=String(b(e.zoom)),l=new FormData;return l.append("project",a),l.append("accept_domain",e.accept_domain.toString()),l.append("units",e.units),l.append("name",e.name),l.append("description",e.description),l.append("lat",e.lat),l.append("lon",e.lon),l.append("zoom",t),""!==e.lidar_epsg&&l.append("lidar_epsg","EPSG:"+e.lidar_epsg),""!==e.camera_epsg&&l.append("camera_epsg","EPSG:"+e.camera_epsg),e.image&&l.append("image",e.image),await (0,n.x)("/admin/project-init/update",{method:"PATCH",form:l}),{success:!0}}catch(e){return{success:!1,error:e?.message||"An error occurred while submitting the form"}}finally{t(!1)}},x=async e=>{let a=await (0,n.x)("/admin/return-available-users",{params:{project_id:e}}),t={};for(let e of a)t[e.id]=e;return t},f=async e=>{try{return await (0,n.x)("/main/update-user-project",{method:"PUT",json:{uuid:e}})}catch(e){return console.error("Error fetching updated project:",e),null}},h=async e=>{let a=JSON.parse(localStorage.getItem("project")||"{}");e.get("project_id")&&(a={project_uuid:e.get("project_id")||"",project_name:e.get("project_name")||"",project_description:"",project_imageLink:"",units:s.WU.Metric,data_types:[],features:[],lrs_included:!1,sentinel_data:void 0,camera_epsg:"",lidar_epsg:"",integrations:[],accept_domain:!1,feature_flags:{},dashboard_id:-1,notificationsEnabled:!1});let t=await f(a.project_uuid);if(!t)return null;let l=await o(t.uuid);return{...a,project_uuid:t.uuid,project_name:t.projectName,project_description:t.project_description,project_imageLink:t.projectImageLink,dashboard_id:t.dashboard_id,units:t.units,data_types:t.dataTypes,features:t.features,lrs_included:t.lrsIncluded,sentinel_data:t.sentinelData,camera_epsg:t.cameraEPSG?t.cameraEPSG.split(":")[1]:"",lidar_epsg:t.lidarEPSG?t.lid
1arEPSG.split(":")[1]:"",accept_domain:t.acceptDomain,feature_flags:l,alert_defaults:t.alert_defaults,notificationsEnabled:!0===t.notificationsEnabled,camera_projection:t.camera_projection,lidar_projection:t.lidar_projection,container_name:t.containerName,client_name:t.client,lat:t.map_lat,lon:t.map_lon,zoom:t.map_zoom}},b=e=>e/100*22,j=e=>e/22*100},75296:(e,a,t)=>{t.d(a,{A:()=>h});var l=t(37876),r=t(14232),s=t(39149),n=t(97685),o=t(89099),i=t.n(o),c=t(54065),d=t(36367),m=t(11324),p=t.n(m),u=t(84412),g=t(78421),x=t.n(g);t(59352),t(62618);var f=t(21034);function h({isOpen:e,onClose:a,mode:t,projectUuid:o,projectName:m,mapView:g,saveAndReload:b,onSaveAndReloadHandled:j,triggerReload:N}){let _=(0,f.u)(),[w,y]=(0,r.useState)("edit"===t),[v,k]=(0,r.useState)([]),[z,S]=(0,r.useState)(!1),[E,P]=(0,r.useState)({}),L=r.useMemo(()=>[E.lat,E.lon,E.zoom].filter(e=>e).join("\n"),[E.lat,E.lon,E.zoom]),C=(0,r.useRef)(null),F=(0,r.useRef)(null),G=(0,r.useRef)(null),I={name:"edit"===t&&m||"",organization:"",description:"",accept_domain:!1,lat:"45",lon:"45",zoom:"2",units:"Metric",image:null,lidar_epsg:"",camera_epsg:""},[D,T]=(0,r.useState)(I),[M,A]=(0,r.useState)(""),[O,Z]=(0,r.useState)(""),[R,U]=(0,r.useState)("");(0,r.useEffect)(()=>{b&&(q({preventDefault:()=>{}}),j?.())},[b,j]),(0,r.useEffect)(()=>e&&!w&&C.current?(p().accessToken=u.Et,F.current=new(p()).Map({container:C.current,style:"mapbox://styles/mapbox/streets-v11",center:[Number.parseFloat(O)||45,Number.parseFloat(M)||45],zoom:(0,c.yW)(Number.parseFloat(R))||(0,c.yW)(2),attributionControl:!1,dragRotate:!1,interactive:!0}),F.current.on("mousedown",e=>{0===e.originalEvent.button&&e.originalEvent.stopPropagation()}),F.current.dragPan.enable(),F.current.scrollZoom.enable(),F.current.doubleClickZoom.disable(),F.current.on("load",()=>{let e=new(x())({accessToken:p().accessToken,mapboxgl:p(),marker:!1,zoom:10});e.on("result",e=>{let[a,t]=e.result.center;T(e=>({...e,lon:a.toFixed(6),lat:t.toFixed(6)})),G.current&&G.current.setLngLat({lon:a,lat:t})}),F.current?.resize(),document.getElementById("debug-mount")?.appendChild(e.onAdd(F.current));let a=Number.parseFloat(O),t=Number.parseFloat(M),l=Number.parseFloat(R);G.current=new(p()).Marker({anchor:"bottom"}).setLngLat([Number.isNaN(a)?45:a,Number.isNaN(t)?45:t]).addTo(F.current);let r=Number.isNaN(l)?2:l,s=(0,c.yW)(r);F.current.setZoom(s)}),F.current.on("click",e=>{let{lat:a,lng:t}=p().LngLat.convert(e.lngLat).wrap(),l=F.current.getZoom(),r=(0,c.BY)(l);T(e=>({...e,lat:a.toFixed(6),lon:t.toFixed(6),zoom:r})),G.current&&G.current.setLngLat([t,a]),e.preventDefault()}),()=>{!e&&F.current&&(F.current.remove(),F.current=null)}):void 0,[e,w]),(0,r.useEffect)(()=>{if(F.current&&G.current&&!E.lat&&!E.lon&&!E.zoom){let e=Number.parseFloat(D.lon),a=Number.parseFloat(D.lat),t=Number.parseFloat(D.zoom);if(!isNaN(e)&&!isNaN(a)&&!isNaN(t)){let l=(0,c.yW)(t);G.current.setLngLat([e,a]),F.current.setZoom(l),F.current.loaded()||F.current.setCenter([e,a])}}},[D.lat,D.lon,D.zoom]),(0,r.useEffect)(()=>{e&&"edit"===t&&_?.user&&o&&(0,c.RV)(o,T,y,A,Z,U)},[_?.user?.id,e]),(0,r.useEffect)(()=>{e||(T(I),P({}),k([]),A(""),Z(""),U(""))},[e]);let W=e=>{(0,c.Pp)(e,T,(e,a)=>{P(t=>({...t,[e]:a}))})},q=async e=>{e.preventDefault();let l=(0,c.Hh)(D,t,E);if(k(l),!(l.length>0))if(S(!0),"add"===t){let e=await (0,c.gA)(D,S);e.success?(n.Ay.success("Project added"),i().push("/projects"),a(),N&&N()):k([e.error])}else{let e=await (0,c.vr)(D,o,S);e.success?(n.Ay.success("Project updated"),g&&setTimeout(()=>{window.location.reload()},1e3),a()):k([e.error])}};return(0,l.jsx)(l.Fragment,{children:e&&(0,l.jsxs)("div",{className:`${g?"tablet:max-h-full max-h-96 h-full overflow-auto":"modal modal-open max-w-full text-left"}`,children:[(0,l.jsxs)("div",{className:`${g?"":"modal-box text-black tablet:min-w-fit h-[80vh] tablet:h-auto"}`,children:[!g&&(0,l.jsxs)("div",{className:"text-lg font-bold flex items-center border-b border-black/10 pb-3 justify-between",children:[(0,l.jsxs)("span",{className:"flex items-center gap-2",children:["\xa0","add"===t?"New Project Initiation":"Edit Project"]}),(0,l.jsx)("button",{onClick:a,className:"cursor-pointer hover:bg-black/10 rounded-full p-2",children:(0,l.jsx)(s.fUT,{})})]}),(0,l.jsx)("form",{onSubmit:q,className:"transition-opacity text-black rounded-lg duration-300",children:(0,l.jsx)("div",{className:"form-control w-full flex flex-col gap-0.5",children:w?(0,l.jsx)("div",{className:"flex items-center justify-center",children:(0,l.jsx)("span",{className:"loading loading-spinner"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col tablet:flex-row gap-4 w-full tablet:max-h-[calc(100vh-6rem)] overflow-auto mt-2",children:[(0,l.jsxs)("div",{className:"flex flex-col justify-between w-full max-w-sm items-start gap-3",children:[(0,l.jsx)("div",{className:"flex flex-col w-full items-start gap-2",children:(0,l.jsxs)("label",{className:"form-control w-full",children:[(0,l.jsxs)("span",{className:"label-text block mb-2",children:["Project Name ","add"===t?"*":""]}),(0,l.jsx)("input",{type:"text",id:"project-name-field",placeholder:"Project Name",className:"input text-black w-full",name:"name",value:D.name,onChange:W,maxLength:50})]})}),g&&(0,l.jsx)("span",{className:"text-gray-400 ml-1",children:`UUID: ${o}`}),E.name&&""!==D.name&&(0,l.jsx)("p",{className:"error-message",children:E.name}),"add"===t&&(0,l.jsxs)("div",{className:"flex flex-col w-full items-start gap-2",children:[(0,l.jsxs)("label",{className:"form-control w-full",children:[(0,l.jsx)("span",{className:"label-text block mb-2",children:"Organization *"}),(0,l.jsx)("input",{type:"text",id:"project-organization-field",placeholder:"Organization",className:"input text-black w-full",name:"organization",value:D.organization,onChange:W,maxLength:50})]}),E.organization&&""!==D.organization&&(0,l.jsx)("p",{className:"error-message break-words",children:E.organization})]}),(0,l.jsx)("div",{className:"flex flex-col w-full items-start gap-2",children:(0,l.jsxs)("label",{className:"form-control w-full",children:[(0,l.jsx)("span",{className:"label-text block mb-2",children:"Description *"}),(0,l.jsx)("input",{type:"text",id:"project-description-field",placeholder:"Project Description",className:"input text-black w-full",name:"description",value:D.description,onChange:W,maxLength:50})]})}),(0,l.jsxs)("div",{className:"flex w-full gap-2",children:[(0,l.jsx)("div",{className:"flex flex-col items-start gap-2",children:(0,l.jsxs)("label",{className:"form-control w-full",children:[(0,l.jsx)("span",{className:"label-text block mb-2",children:"Lidar EPSG"}),(0,l.jsx)("input",{type:"text",placeholder:"Lidar EPSG",className:"input text-black w-full",name:"lidar_epsg",value:D.lidar_epsg,onChange:W})]})}),(0,l.jsx)("div",{className:"flex flex-col items-start gap-2",children:(0,l.jsxs)("label",{className:"form-control w-full",children:[(0,l.jsx)("span",{className:"label-text block mb-2",children:"Camera EPSG"}),(0,l.jsx)("input",{type:"text",placeholder:"Camera EPSG",className:"input text-black w-full",name:"camera_epsg",value:D.camera_epsg,onChange:W})]})})]}),(E.lidar_epsg||E.camera_epsg)&&(0,l.jsx)("p",{className:"error-message",children:E.lidar_epsg||E.camera_epsg}),(0,l.jsxs)("div",{className:"flex mt-2 gap-3",children:[g&&(0,l.jsx)(d.A,{displaySelectMenu:!0,showOnMobile:!0,displayLabel:!1}),(0,l.jsxs)("div",{className:"flex items-center",children:[(0,l.jsxs)("label",{className:"flex items-center gap-x-2 cursor-pointer",children:[(0,l.jsx)("input",{type:"radio",name:"measurementSystem",value:"Metric",className:"radio",checked:"Metric"===D.units,onChange:e=>(0,c._7)(e,T)}),(0,l.jsx)("span",{className:"text-sm",children:"Metric"})]}),(0,l.jsxs)("label",{className:"flex items-center gap-x-2 ml-5 cursor-pointer",children:[(0,l.jsx)("input",{type:"radio",name:"measurementSystem",value:"Imperial",className:"radio",checked:"Imperial"===D.units,onChange:e=>(0,c._7)(e,T)}),(0,l.jsx)("span",{className:"text-sm",children:"Imperial"})]})]})]}),(0,l.jsx)("div",{className:"flex flex-col items-start gap-2",children:(0,l.jsxs)("label",{className:"form-control w-full",children:[(0,l.jsx)("span",{className:"label-text block mb-2",children:"Image"}),(0,l.jsx)("input",{type:"file",accept:".jpg,.jpeg,.png",className:"file-input text-black w-full",name:"image",onCh
1ange:e=>(0,c.f5)(e,T)})]})})]}),(0,l.jsxs)("div",{className:"w-full tablet:w-[300px] shrink-0 relative",children:[(0,l.jsx)("span",{className:"label-text",children:"Initial location"}),(0,l.jsx)("div",{id:"debug-mount",className:"absolute left-0 z-30 p-2 pointer-events-auto"}),(0,l.jsx)("div",{ref:C,className:"w-full min-h-[380px] rounded-md shadow-md",children:(0,l.jsxs)("div",{className:"absolute bottom-2 left-2 right-2 z-10 bg-white/80 p-2 rounded shadow-md",children:[(0,l.jsxs)("div",{className:"flex flex-row gap-2 w-full",children:[(0,l.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,l.jsx)("label",{className:"text-sm mb-1",htmlFor:"project-lat-field",children:"Lat"}),(0,l.jsx)("input",{type:"text",id:"project-lat-field",placeholder:"Lat",className:"input text-black",name:"lat",value:D.lat,onChange:W})]}),(0,l.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,l.jsx)("label",{className:"text-sm mb-1",htmlFor:"project-lon-field",children:"Lon"}),(0,l.jsx)("input",{type:"text",id:"project-lon-field",placeholder:"Lon",className:"input text-black",name:"lon",value:D.lon,onChange:W})]}),(0,l.jsxs)("div",{className:"flex flex-col flex-1",children:[(0,l.jsx)("label",{className:"text-sm mb-1",htmlFor:"project-zoom-field",children:"Zoom %"}),(0,l.jsx)("input",{type:"text",id:"project-zoom-field",placeholder:"Zoom %",className:"input text-black",name:"zoom",value:D.zoom,onChange:W})]})]}),L&&(0,l.jsx)("p",{className:"error-message text-xs text-red-500 mt-1",children:L})]})})]})]}),(0,l.jsxs)("div",{className:"w-full",children:[!g&&(0,l.jsxs)("button",{id:"project-submit-button",className:g?"btn tt-blue-button w-full":"btn tt-blue-button mt-5 w-full",type:"submit",disabled:z,children:[z&&(0,l.jsx)("div",{className:"flex justify-center items-center",children:(0,l.jsx)("span",{className:"loading loading-spinner loading-sm"})}),"Submit"]}),v.length>0&&(0,l.jsx)("ul",{className:"bulleted-list error-message",children:v.map((e,a)=>(0,l.jsx)("li",{children:e},a))})]})]})})})]}),(0,l.jsx)("div",{className:"modal-backdrop",onClick:a,children:"Close"})]})})}}}]);

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.